diff options
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 8b08b20e8b30..d4481454b5f8 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -483,11 +483,17 @@ static void qlcnic_add_vxlan_port(struct net_device *netdev, | |||
483 | /* Adapter supports only one VXLAN port. Use very first port | 483 | /* Adapter supports only one VXLAN port. Use very first port |
484 | * for enabling offload | 484 | * for enabling offload |
485 | */ | 485 | */ |
486 | if (!qlcnic_encap_rx_offload(adapter) || ahw->vxlan_port) | 486 | if (!qlcnic_encap_rx_offload(adapter)) |
487 | return; | 487 | return; |
488 | if (!ahw->vxlan_port_count) { | ||
489 | ahw->vxlan_port_count = 1; | ||
490 | ahw->vxlan_port = ntohs(port); | ||
491 | adapter->flags |= QLCNIC_ADD_VXLAN_PORT; | ||
492 | return; | ||
493 | } | ||
494 | if (ahw->vxlan_port == ntohs(port)) | ||
495 | ahw->vxlan_port_count++; | ||
488 | 496 | ||
489 | ahw->vxlan_port = ntohs(port); | ||
490 | adapter->flags |= QLCNIC_ADD_VXLAN_PORT; | ||
491 | } | 497 | } |
492 | 498 | ||
493 | static void qlcnic_del_vxlan_port(struct net_device *netdev, | 499 | static void qlcnic_del_vxlan_port(struct net_device *netdev, |
@@ -496,11 +502,13 @@ static void qlcnic_del_vxlan_port(struct net_device *netdev, | |||
496 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 502 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
497 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 503 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
498 | 504 | ||
499 | if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port || | 505 | if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port_count || |
500 | (ahw->vxlan_port != ntohs(port))) | 506 | (ahw->vxlan_port != ntohs(port))) |
501 | return; | 507 | return; |
502 | 508 | ||
503 | adapter->flags |= QLCNIC_DEL_VXLAN_PORT; | 509 | ahw->vxlan_port_count--; |
510 | if (!ahw->vxlan_port_count) | ||
511 | adapter->flags |= QLCNIC_DEL_VXLAN_PORT; | ||
504 | } | 512 | } |
505 | 513 | ||
506 | static netdev_features_t qlcnic_features_check(struct sk_buff *skb, | 514 | static netdev_features_t qlcnic_features_check(struct sk_buff *skb, |