|
@@ -483,11 +483,17 @@ static void qlcnic_add_vxlan_port(struct net_device *netdev,
|
|
/* Adapter supports only one VXLAN port. Use very first port
|
|
/* Adapter supports only one VXLAN port. Use very first port
|
|
* for enabling offload
|
|
* for enabling offload
|
|
*/
|
|
*/
|
|
- if (!qlcnic_encap_rx_offload(adapter) || ahw->vxlan_port)
|
|
|
|
|
|
+ if (!qlcnic_encap_rx_offload(adapter))
|
|
return;
|
|
return;
|
|
|
|
+ if (!ahw->vxlan_port_count) {
|
|
|
|
+ ahw->vxlan_port_count = 1;
|
|
|
|
+ ahw->vxlan_port = ntohs(port);
|
|
|
|
+ adapter->flags |= QLCNIC_ADD_VXLAN_PORT;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (ahw->vxlan_port == ntohs(port))
|
|
|
|
+ ahw->vxlan_port_count++;
|
|
|
|
|
|
- ahw->vxlan_port = ntohs(port);
|
|
|
|
- adapter->flags |= QLCNIC_ADD_VXLAN_PORT;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static void qlcnic_del_vxlan_port(struct net_device *netdev,
|
|
static void qlcnic_del_vxlan_port(struct net_device *netdev,
|
|
@@ -496,11 +502,13 @@ static void qlcnic_del_vxlan_port(struct net_device *netdev,
|
|
struct qlcnic_adapter *adapter = netdev_priv(netdev);
|
|
struct qlcnic_adapter *adapter = netdev_priv(netdev);
|
|
struct qlcnic_hardware_context *ahw = adapter->ahw;
|
|
struct qlcnic_hardware_context *ahw = adapter->ahw;
|
|
|
|
|
|
- if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port ||
|
|
|
|
|
|
+ if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port_count ||
|
|
(ahw->vxlan_port != ntohs(port)))
|
|
(ahw->vxlan_port != ntohs(port)))
|
|
return;
|
|
return;
|
|
|
|
|
|
- adapter->flags |= QLCNIC_DEL_VXLAN_PORT;
|
|
|
|
|
|
+ ahw->vxlan_port_count--;
|
|
|
|
+ if (!ahw->vxlan_port_count)
|
|
|
|
+ adapter->flags |= QLCNIC_DEL_VXLAN_PORT;
|
|
}
|
|
}
|
|
|
|
|
|
static netdev_features_t qlcnic_features_check(struct sk_buff *skb,
|
|
static netdev_features_t qlcnic_features_check(struct sk_buff *skb,
|