X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fvport-patch.c;h=4fdbcf5278d6558f7f75519b0f96687d9e1554cf;hb=d2bb2799e1b7cf2177140cf4ca8a60312c87625a;hp=d49f83d364ae900862f7bb47828e9197f294b02b;hpb=5b68fb428764e66dc73b2674ceb3f3e3555b59f2;p=openvswitch diff --git a/datapath/vport-patch.c b/datapath/vport-patch.c index d49f83d3..4fdbcf52 100644 --- a/datapath/vport-patch.c +++ b/datapath/vport-patch.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "datapath.h" #include "vport.h" @@ -30,11 +31,8 @@ struct patch_vport { char peer_name[IFNAMSIZ]; struct hlist_node hash_node; - /* Protected by RCU. */ - struct vport *peer; - - /* Protected by RCU. */ - struct device_config *devconf; + struct vport __rcu *peer; + struct device_config __rcu *devconf; }; /* Protected by RTNL lock. */ @@ -61,7 +59,7 @@ static void assign_config_rcu(struct vport *vport, struct patch_vport *patch_vport = patch_vport_priv(vport); struct device_config *old_config; - old_config = rcu_dereference(patch_vport->devconf); + old_config = rtnl_dereference(patch_vport->devconf); rcu_assign_pointer(patch_vport->devconf, new_config); call_rcu(&old_config->rcu, free_config); } @@ -130,8 +128,8 @@ static struct vport *patch_create(const struct vport_parms *parms) vport_gen_rand_ether_addr(patch_vport->devconf->eth_addr); - /* Make the default MTU fairly large so that it doesn't become the - * bottleneck on systems using jumbo frames. */ + /* Make the default MTU fairly large so that it doesn't become the + * bottleneck on systems using jumbo frames. */ patch_vport->devconf->mtu = 65535; hlist_add_head(&patch_vport->hash_node, hash_bucket(patch_vport->peer_name)); @@ -231,13 +229,13 @@ static const char *patch_get_name(const struct vport *vport) static const unsigned char *patch_get_addr(const struct vport *vport) { const struct patch_vport *patch_vport = patch_vport_priv(vport); - return rcu_dereference(patch_vport->devconf)->eth_addr; + return rcu_dereference_rtnl(patch_vport->devconf)->eth_addr; } static int patch_get_mtu(const struct vport *vport) { const struct patch_vport *patch_vport = patch_vport_priv(vport); - return rcu_dereference(patch_vport->devconf)->mtu; + return rcu_dereference_rtnl(patch_vport->devconf)->mtu; } static int patch_send(struct vport *vport, struct sk_buff *skb)