Allow the datapath ID to be configured by changing the ofX MAC address.
authorBen Pfaff <blp@nicira.com>
Wed, 26 Nov 2008 19:27:06 +0000 (11:27 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 27 Nov 2008 06:26:42 +0000 (22:26 -0800)
Previously, you could change the MAC address but that had no effect on
the datapath ID, so that there was no way to change the datapath ID at all.

datapath/datapath.c
datapath/datapath.h

index 4f5acd036615c400d33518385105b68a60ba2587..326300d9a9a474924dbc228baac185955c4a66c8 100644 (file)
@@ -265,7 +265,6 @@ static int new_dp(int dp_idx)
                goto err_free_dp;
 
        dp->dp_idx = dp_idx;
-       dp->id = get_datapath_id(dp->netdev);
        dp->chain = chain_create(dp);
        if (dp->chain == NULL)
                goto err_destroy_dp_dev;
@@ -805,9 +804,10 @@ static int
 fill_features_reply(struct datapath *dp, struct ofp_switch_features *ofr)
 {
        struct net_bridge_port *p;
+       uint64_t dpid = get_datapath_id(dp->netdev);
        int port_count = 0;
 
-       ofr->datapath_id  = cpu_to_be64(dp->id); 
+       ofr->datapath_id  = cpu_to_be64(dpid);
 
        ofr->n_buffers    = htonl(N_PKT_BUFFERS);
        ofr->n_tables     = dp->chain->n_tables;
index 89c9059d1f05748910c2178c380be986e15594c4..48690227226a00da14166c6c620dedb80712e171 100644 (file)
@@ -46,10 +46,6 @@ struct sk_buff;
 struct datapath {
        int dp_idx;
 
-       /* Unique identifier for this datapath, incorporates the dp_idx and
-        * a hardware address */
-       uint64_t  id;
-
        struct timer_list timer;        /* Expiration timer. */
        struct sw_chain *chain;  /* Forwarding rules. */
        struct task_struct *dp_task; /* Kernel thread for maintenance. */