From: Ben Pfaff Date: Wed, 26 Nov 2008 19:27:06 +0000 (-0800) Subject: Allow the datapath ID to be configured by changing the ofX MAC address. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e21567dc0d9d62a87a59543379e87128e8438cc6;p=openvswitch Allow the datapath ID to be configured by changing the ofX MAC address. 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. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index 4f5acd03..326300d9 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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; diff --git a/datapath/datapath.h b/datapath/datapath.h index 89c9059d..48690227 100644 --- a/datapath/datapath.h +++ b/datapath/datapath.h @@ -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. */