diff options
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index f996db343247..a4b724708a1a 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -158,11 +158,10 @@ static struct hlist_head *vport_hash_bucket(const struct datapath *dp, | |||
158 | struct vport *ovs_lookup_vport(const struct datapath *dp, u16 port_no) | 158 | struct vport *ovs_lookup_vport(const struct datapath *dp, u16 port_no) |
159 | { | 159 | { |
160 | struct vport *vport; | 160 | struct vport *vport; |
161 | struct hlist_node *n; | ||
162 | struct hlist_head *head; | 161 | struct hlist_head *head; |
163 | 162 | ||
164 | head = vport_hash_bucket(dp, port_no); | 163 | head = vport_hash_bucket(dp, port_no); |
165 | hlist_for_each_entry_rcu(vport, n, head, dp_hash_node) { | 164 | hlist_for_each_entry_rcu(vport, head, dp_hash_node) { |
166 | if (vport->port_no == port_no) | 165 | if (vport->port_no == port_no) |
167 | return vport; | 166 | return vport; |
168 | } | 167 | } |
@@ -301,7 +300,7 @@ static int queue_gso_packets(struct net *net, int dp_ifindex, | |||
301 | struct sk_buff *segs, *nskb; | 300 | struct sk_buff *segs, *nskb; |
302 | int err; | 301 | int err; |
303 | 302 | ||
304 | segs = skb_gso_segment(skb, NETIF_F_SG | NETIF_F_HW_CSUM); | 303 | segs = __skb_gso_segment(skb, NETIF_F_SG | NETIF_F_HW_CSUM, false); |
305 | if (IS_ERR(segs)) | 304 | if (IS_ERR(segs)) |
306 | return PTR_ERR(segs); | 305 | return PTR_ERR(segs); |
307 | 306 | ||
@@ -395,6 +394,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex, | |||
395 | 394 | ||
396 | skb_copy_and_csum_dev(skb, nla_data(nla)); | 395 | skb_copy_and_csum_dev(skb, nla_data(nla)); |
397 | 396 | ||
397 | genlmsg_end(user_skb, upcall); | ||
398 | err = genlmsg_unicast(net, user_skb, upcall_info->portid); | 398 | err = genlmsg_unicast(net, user_skb, upcall_info->portid); |
399 | 399 | ||
400 | out: | 400 | out: |
@@ -1386,9 +1386,9 @@ static void __dp_destroy(struct datapath *dp) | |||
1386 | 1386 | ||
1387 | for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++) { | 1387 | for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++) { |
1388 | struct vport *vport; | 1388 | struct vport *vport; |
1389 | struct hlist_node *node, *n; | 1389 | struct hlist_node *n; |
1390 | 1390 | ||
1391 | hlist_for_each_entry_safe(vport, node, n, &dp->ports[i], dp_hash_node) | 1391 | hlist_for_each_entry_safe(vport, n, &dp->ports[i], dp_hash_node) |
1392 | if (vport->port_no != OVSP_LOCAL) | 1392 | if (vport->port_no != OVSP_LOCAL) |
1393 | ovs_dp_detach_port(vport); | 1393 | ovs_dp_detach_port(vport); |
1394 | } | 1394 | } |
@@ -1691,6 +1691,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1691 | if (IS_ERR(vport)) | 1691 | if (IS_ERR(vport)) |
1692 | goto exit_unlock; | 1692 | goto exit_unlock; |
1693 | 1693 | ||
1694 | err = 0; | ||
1694 | reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, | 1695 | reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, |
1695 | OVS_VPORT_CMD_NEW); | 1696 | OVS_VPORT_CMD_NEW); |
1696 | if (IS_ERR(reply)) { | 1697 | if (IS_ERR(reply)) { |
@@ -1772,6 +1773,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1772 | if (IS_ERR(reply)) | 1773 | if (IS_ERR(reply)) |
1773 | goto exit_unlock; | 1774 | goto exit_unlock; |
1774 | 1775 | ||
1776 | err = 0; | ||
1775 | ovs_dp_detach_port(vport); | 1777 | ovs_dp_detach_port(vport); |
1776 | 1778 | ||
1777 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1779 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
@@ -1825,10 +1827,9 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1825 | rcu_read_lock(); | 1827 | rcu_read_lock(); |
1826 | for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) { | 1828 | for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) { |
1827 | struct vport *vport; | 1829 | struct vport *vport; |
1828 | struct hlist_node *n; | ||
1829 | 1830 | ||
1830 | j = 0; | 1831 | j = 0; |
1831 | hlist_for_each_entry_rcu(vport, n, &dp->ports[i], dp_hash_node) { | 1832 | hlist_for_each_entry_rcu(vport, &dp->ports[i], dp_hash_node) { |
1832 | if (j >= skip && | 1833 | if (j >= skip && |
1833 | ovs_vport_cmd_fill_info(vport, skb, | 1834 | ovs_vport_cmd_fill_info(vport, skb, |
1834 | NETLINK_CB(cb->skb).portid, | 1835 | NETLINK_CB(cb->skb).portid, |
@@ -1989,10 +1990,9 @@ static struct pernet_operations ovs_net_ops = { | |||
1989 | 1990 | ||
1990 | static int __init dp_init(void) | 1991 | static int __init dp_init(void) |
1991 | { | 1992 | { |
1992 | struct sk_buff *dummy_skb; | ||
1993 | int err; | 1993 | int err; |
1994 | 1994 | ||
1995 | BUILD_BUG_ON(sizeof(struct ovs_skb_cb) > sizeof(dummy_skb->cb)); | 1995 | BUILD_BUG_ON(sizeof(struct ovs_skb_cb) > FIELD_SIZEOF(struct sk_buff, cb)); |
1996 | 1996 | ||
1997 | pr_info("Open vSwitch switching datapath\n"); | 1997 | pr_info("Open vSwitch switching datapath\n"); |
1998 | 1998 | ||