#include <linux/dcache.h>
#include <linux/kernel.h>
#include <linux/list.h>
+#include <linux/rtnetlink.h>
#include "datapath.h"
#include "vport.h"
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. */
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);
}
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));
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)