aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <aduyck@mirantis.com>2016-03-10 13:01:10 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-04-04 20:45:49 -0400
commit0c5a616650a08b766e529511348274c1914ef4bf (patch)
tree5d44519d2602a8530531cb31c029212697a7473a /drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
parent4ae7834221679bff2d7f75ba80a20673cecb38ad (diff)
ixgbe: Add support for toggling VLAN filtering flag via ethtool
This change makes it so that we can use the ethtool rx-vlan-filter flag to toggle Rx VLAN filtering on and off. This is basically just an extension of the existing VLAN promisc work in that it just adds support for the additional ethtool flag. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 359869cf5b09..19bf3860d3d8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4447,6 +4447,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
4447 struct ixgbe_adapter *adapter = netdev_priv(netdev); 4447 struct ixgbe_adapter *adapter = netdev_priv(netdev);
4448 struct ixgbe_hw *hw = &adapter->hw; 4448 struct ixgbe_hw *hw = &adapter->hw;
4449 u32 fctrl, vmolr = IXGBE_VMOLR_BAM | IXGBE_VMOLR_AUPE; 4449 u32 fctrl, vmolr = IXGBE_VMOLR_BAM | IXGBE_VMOLR_AUPE;
4450 netdev_features_t features = netdev->features;
4450 int count; 4451 int count;
4451 4452
4452 /* Check for Promiscuous and All Multicast modes */ 4453 /* Check for Promiscuous and All Multicast modes */
@@ -4464,14 +4465,13 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
4464 hw->addr_ctrl.user_set_promisc = true; 4465 hw->addr_ctrl.user_set_promisc = true;
4465 fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); 4466 fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
4466 vmolr |= IXGBE_VMOLR_MPE; 4467 vmolr |= IXGBE_VMOLR_MPE;
4467 ixgbe_vlan_promisc_enable(adapter); 4468 features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
4468 } else { 4469 } else {
4469 if (netdev->flags & IFF_ALLMULTI) { 4470 if (netdev->flags & IFF_ALLMULTI) {
4470 fctrl |= IXGBE_FCTRL_MPE; 4471 fctrl |= IXGBE_FCTRL_MPE;
4471 vmolr |= IXGBE_VMOLR_MPE; 4472 vmolr |= IXGBE_VMOLR_MPE;
4472 } 4473 }
4473 hw->addr_ctrl.user_set_promisc = false; 4474 hw->addr_ctrl.user_set_promisc = false;
4474 ixgbe_vlan_promisc_disable(adapter);
4475 } 4475 }
4476 4476
4477 /* 4477 /*
@@ -4504,7 +4504,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
4504 } 4504 }
4505 4505
4506 /* This is useful for sniffing bad packets. */ 4506 /* This is useful for sniffing bad packets. */
4507 if (adapter->netdev->features & NETIF_F_RXALL) { 4507 if (features & NETIF_F_RXALL) {
4508 /* UPE and MPE will be handled by normal PROMISC logic 4508 /* UPE and MPE will be handled by normal PROMISC logic
4509 * in e1000e_set_rx_mode */ 4509 * in e1000e_set_rx_mode */
4510 fctrl |= (IXGBE_FCTRL_SBP | /* Receive bad packets */ 4510 fctrl |= (IXGBE_FCTRL_SBP | /* Receive bad packets */
@@ -4517,10 +4517,15 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
4517 4517
4518 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); 4518 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
4519 4519
4520 if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) 4520 if (features & NETIF_F_HW_VLAN_CTAG_RX)
4521 ixgbe_vlan_strip_enable(adapter); 4521 ixgbe_vlan_strip_enable(adapter);
4522 else 4522 else
4523 ixgbe_vlan_strip_disable(adapter); 4523 ixgbe_vlan_strip_disable(adapter);
4524
4525 if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
4526 ixgbe_vlan_promisc_disable(adapter);
4527 else
4528 ixgbe_vlan_promisc_enable(adapter);
4524} 4529}
4525 4530
4526static void ixgbe_napi_enable_all(struct ixgbe_adapter *adapter) 4531static void ixgbe_napi_enable_all(struct ixgbe_adapter *adapter)
@@ -8495,11 +8500,6 @@ static int ixgbe_set_features(struct net_device *netdev,
8495 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 8500 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
8496 } 8501 }
8497 8502
8498 if (features & NETIF_F_HW_VLAN_CTAG_RX)
8499 ixgbe_vlan_strip_enable(adapter);
8500 else
8501 ixgbe_vlan_strip_disable(adapter);
8502
8503 if (changed & NETIF_F_RXALL) 8503 if (changed & NETIF_F_RXALL)
8504 need_reset = true; 8504 need_reset = true;
8505 8505
@@ -8516,6 +8516,9 @@ static int ixgbe_set_features(struct net_device *netdev,
8516 8516
8517 if (need_reset) 8517 if (need_reset)
8518 ixgbe_do_reset(netdev); 8518 ixgbe_do_reset(netdev);
8519 else if (changed & (NETIF_F_HW_VLAN_CTAG_RX |
8520 NETIF_F_HW_VLAN_CTAG_FILTER))
8521 ixgbe_set_rx_mode(netdev);
8519 8522
8520 return 0; 8523 return 0;
8521} 8524}
@@ -9190,7 +9193,8 @@ skip_sriov:
9190 NETIF_F_RXCSUM | 9193 NETIF_F_RXCSUM |
9191 NETIF_F_HW_CSUM | 9194 NETIF_F_HW_CSUM |
9192 NETIF_F_HW_VLAN_CTAG_TX | 9195 NETIF_F_HW_VLAN_CTAG_TX |
9193 NETIF_F_HW_VLAN_CTAG_RX; 9196 NETIF_F_HW_VLAN_CTAG_RX |
9197 NETIF_F_HW_VLAN_CTAG_FILTER;
9194 9198
9195 if (hw->mac.type >= ixgbe_mac_82599EB) 9199 if (hw->mac.type >= ixgbe_mac_82599EB)
9196 netdev->features |= NETIF_F_SCTP_CRC; 9200 netdev->features |= NETIF_F_SCTP_CRC;
@@ -9204,9 +9208,6 @@ skip_sriov:
9204 netdev->hw_features |= NETIF_F_NTUPLE | 9208 netdev->hw_features |= NETIF_F_NTUPLE |
9205 NETIF_F_HW_TC; 9209 NETIF_F_HW_TC;
9206 9210
9207 /* set this bit last since it cannot be part of hw_features */
9208 netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
9209
9210 netdev->vlan_features |= NETIF_F_SG | 9211 netdev->vlan_features |= NETIF_F_SG |
9211 NETIF_F_TSO | 9212 NETIF_F_TSO |
9212 NETIF_F_TSO6 | 9213 NETIF_F_TSO6 |