Commit 1e5b311a authored by Jiri Benc's avatar Jiri Benc Committed by David S. Miller

be2net: allow offloading with the same port for IPv4 and IPv6

The callback for adding vxlan port can be called with the same port for both
IPv4 and IPv6. Do not disable the offloading if this occurs.
Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
Acked-by: default avatarSathya Perla <sathya.perla@avagotech.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 378fddc2
...@@ -582,6 +582,7 @@ struct be_adapter { ...@@ -582,6 +582,7 @@ struct be_adapter {
u16 pvid; u16 pvid;
__be16 vxlan_port; __be16 vxlan_port;
int vxlan_port_count; int vxlan_port_count;
int vxlan_port_aliases;
struct phy_info phy; struct phy_info phy;
u8 wol_cap; u8 wol_cap;
bool wol_en; bool wol_en;
......
...@@ -5176,6 +5176,11 @@ static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family, ...@@ -5176,6 +5176,11 @@ static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter)) if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter))
return; return;
if (adapter->vxlan_port == port && adapter->vxlan_port_count) {
adapter->vxlan_port_aliases++;
return;
}
if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS) { if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS) {
dev_info(dev, dev_info(dev,
"Only one UDP port supported for VxLAN offloads\n"); "Only one UDP port supported for VxLAN offloads\n");
...@@ -5226,6 +5231,11 @@ static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family, ...@@ -5226,6 +5231,11 @@ static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
if (adapter->vxlan_port != port) if (adapter->vxlan_port != port)
goto done; goto done;
if (adapter->vxlan_port_aliases) {
adapter->vxlan_port_aliases--;
return;
}
be_disable_vxlan_offloads(adapter); be_disable_vxlan_offloads(adapter);
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment