diff options
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index f30e406fbec5..d8c364d637b1 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -1881,7 +1881,7 @@ static struct genl_family dp_datapath_genl_family __ro_after_init = { | |||
1881 | /* Called with ovs_mutex or RCU read lock. */ | 1881 | /* Called with ovs_mutex or RCU read lock. */ |
1882 | static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, | 1882 | static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, |
1883 | struct net *net, u32 portid, u32 seq, | 1883 | struct net *net, u32 portid, u32 seq, |
1884 | u32 flags, u8 cmd) | 1884 | u32 flags, u8 cmd, gfp_t gfp) |
1885 | { | 1885 | { |
1886 | struct ovs_header *ovs_header; | 1886 | struct ovs_header *ovs_header; |
1887 | struct ovs_vport_stats vport_stats; | 1887 | struct ovs_vport_stats vport_stats; |
@@ -1902,7 +1902,7 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, | |||
1902 | goto nla_put_failure; | 1902 | goto nla_put_failure; |
1903 | 1903 | ||
1904 | if (!net_eq(net, dev_net(vport->dev))) { | 1904 | if (!net_eq(net, dev_net(vport->dev))) { |
1905 | int id = peernet2id_alloc(net, dev_net(vport->dev)); | 1905 | int id = peernet2id_alloc(net, dev_net(vport->dev), gfp); |
1906 | 1906 | ||
1907 | if (nla_put_s32(skb, OVS_VPORT_ATTR_NETNSID, id)) | 1907 | if (nla_put_s32(skb, OVS_VPORT_ATTR_NETNSID, id)) |
1908 | goto nla_put_failure; | 1908 | goto nla_put_failure; |
@@ -1943,11 +1943,12 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, struct net *net, | |||
1943 | struct sk_buff *skb; | 1943 | struct sk_buff *skb; |
1944 | int retval; | 1944 | int retval; |
1945 | 1945 | ||
1946 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); | 1946 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
1947 | if (!skb) | 1947 | if (!skb) |
1948 | return ERR_PTR(-ENOMEM); | 1948 | return ERR_PTR(-ENOMEM); |
1949 | 1949 | ||
1950 | retval = ovs_vport_cmd_fill_info(vport, skb, net, portid, seq, 0, cmd); | 1950 | retval = ovs_vport_cmd_fill_info(vport, skb, net, portid, seq, 0, cmd, |
1951 | GFP_KERNEL); | ||
1951 | BUG_ON(retval < 0); | 1952 | BUG_ON(retval < 0); |
1952 | 1953 | ||
1953 | return skb; | 1954 | return skb; |
@@ -2089,7 +2090,7 @@ restart: | |||
2089 | 2090 | ||
2090 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), | 2091 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), |
2091 | info->snd_portid, info->snd_seq, 0, | 2092 | info->snd_portid, info->snd_seq, 0, |
2092 | OVS_VPORT_CMD_NEW); | 2093 | OVS_VPORT_CMD_NEW, GFP_KERNEL); |
2093 | 2094 | ||
2094 | new_headroom = netdev_get_fwd_headroom(vport->dev); | 2095 | new_headroom = netdev_get_fwd_headroom(vport->dev); |
2095 | 2096 | ||
@@ -2150,7 +2151,7 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
2150 | 2151 | ||
2151 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), | 2152 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), |
2152 | info->snd_portid, info->snd_seq, 0, | 2153 | info->snd_portid, info->snd_seq, 0, |
2153 | OVS_VPORT_CMD_SET); | 2154 | OVS_VPORT_CMD_SET, GFP_KERNEL); |
2154 | BUG_ON(err < 0); | 2155 | BUG_ON(err < 0); |
2155 | 2156 | ||
2156 | ovs_unlock(); | 2157 | ovs_unlock(); |
@@ -2190,7 +2191,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
2190 | 2191 | ||
2191 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), | 2192 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), |
2192 | info->snd_portid, info->snd_seq, 0, | 2193 | info->snd_portid, info->snd_seq, 0, |
2193 | OVS_VPORT_CMD_DEL); | 2194 | OVS_VPORT_CMD_DEL, GFP_KERNEL); |
2194 | BUG_ON(err < 0); | 2195 | BUG_ON(err < 0); |
2195 | 2196 | ||
2196 | /* the vport deletion may trigger dp headroom update */ | 2197 | /* the vport deletion may trigger dp headroom update */ |
@@ -2237,7 +2238,7 @@ static int ovs_vport_cmd_get(struct sk_buff *skb, struct genl_info *info) | |||
2237 | goto exit_unlock_free; | 2238 | goto exit_unlock_free; |
2238 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), | 2239 | err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info), |
2239 | info->snd_portid, info->snd_seq, 0, | 2240 | info->snd_portid, info->snd_seq, 0, |
2240 | OVS_VPORT_CMD_GET); | 2241 | OVS_VPORT_CMD_GET, GFP_ATOMIC); |
2241 | BUG_ON(err < 0); | 2242 | BUG_ON(err < 0); |
2242 | rcu_read_unlock(); | 2243 | rcu_read_unlock(); |
2243 | 2244 | ||
@@ -2273,7 +2274,8 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
2273 | NETLINK_CB(cb->skb).portid, | 2274 | NETLINK_CB(cb->skb).portid, |
2274 | cb->nlh->nlmsg_seq, | 2275 | cb->nlh->nlmsg_seq, |
2275 | NLM_F_MULTI, | 2276 | NLM_F_MULTI, |
2276 | OVS_VPORT_CMD_GET) < 0) | 2277 | OVS_VPORT_CMD_GET, |
2278 | GFP_ATOMIC) < 0) | ||
2277 | goto out; | 2279 | goto out; |
2278 | 2280 | ||
2279 | j++; | 2281 | j++; |