aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c43
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c17
2 files changed, 51 insertions, 9 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 2f63467bce46..6f7dc81581ff 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -4809,6 +4809,23 @@ netdev_features_t bnx2x_fix_features(struct net_device *dev,
4809{ 4809{
4810 struct bnx2x *bp = netdev_priv(dev); 4810 struct bnx2x *bp = netdev_priv(dev);
4811 4811
4812 if (pci_num_vf(bp->pdev)) {
4813 netdev_features_t changed = dev->features ^ features;
4814
4815 /* Revert the requested changes in features if they
4816 * would require internal reload of PF in bnx2x_set_features().
4817 */
4818 if (!(features & NETIF_F_RXCSUM) && !bp->disable_tpa) {
4819 features &= ~NETIF_F_RXCSUM;
4820 features |= dev->features & NETIF_F_RXCSUM;
4821 }
4822
4823 if (changed & NETIF_F_LOOPBACK) {
4824 features &= ~NETIF_F_LOOPBACK;
4825 features |= dev->features & NETIF_F_LOOPBACK;
4826 }
4827 }
4828
4812 /* TPA requires Rx CSUM offloading */ 4829 /* TPA requires Rx CSUM offloading */
4813 if (!(features & NETIF_F_RXCSUM)) { 4830 if (!(features & NETIF_F_RXCSUM)) {
4814 features &= ~NETIF_F_LRO; 4831 features &= ~NETIF_F_LRO;
@@ -4839,15 +4856,18 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
4839 else 4856 else
4840 flags &= ~GRO_ENABLE_FLAG; 4857 flags &= ~GRO_ENABLE_FLAG;
4841 4858
4842 if (features & NETIF_F_LOOPBACK) { 4859 /* VFs or non SRIOV PFs should be able to change loopback feature */
4843 if (bp->link_params.loopback_mode != LOOPBACK_BMAC) { 4860 if (!pci_num_vf(bp->pdev)) {
4844 bp->link_params.loopback_mode = LOOPBACK_BMAC; 4861 if (features & NETIF_F_LOOPBACK) {
4845 bnx2x_reload = true; 4862 if (bp->link_params.loopback_mode != LOOPBACK_BMAC) {
4846 } 4863 bp->link_params.loopback_mode = LOOPBACK_BMAC;
4847 } else { 4864 bnx2x_reload = true;
4848 if (bp->link_params.loopback_mode != LOOPBACK_NONE) { 4865 }
4849 bp->link_params.loopback_mode = LOOPBACK_NONE; 4866 } else {
4850 bnx2x_reload = true; 4867 if (bp->link_params.loopback_mode != LOOPBACK_NONE) {
4868 bp->link_params.loopback_mode = LOOPBACK_NONE;
4869 bnx2x_reload = true;
4870 }
4851 } 4871 }
4852 } 4872 }
4853 4873
@@ -4931,6 +4951,11 @@ int bnx2x_resume(struct pci_dev *pdev)
4931 } 4951 }
4932 bp = netdev_priv(dev); 4952 bp = netdev_priv(dev);
4933 4953
4954 if (pci_num_vf(bp->pdev)) {
4955 DP(BNX2X_MSG_IOV, "VFs are enabled, can not change MTU\n");
4956 return -EPERM;
4957 }
4958
4934 if (bp->recovery_state != BNX2X_RECOVERY_DONE) { 4959 if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
4935 BNX2X_ERR("Handling parity error recovery. Try again later\n"); 4960 BNX2X_ERR("Handling parity error recovery. Try again later\n");
4936 return -EAGAIN; 4961 return -EAGAIN;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index e3d853cab7c9..48ed005ba73f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -1843,6 +1843,12 @@ static int bnx2x_set_ringparam(struct net_device *dev,
1843 "set ring params command parameters: rx_pending = %d, tx_pending = %d\n", 1843 "set ring params command parameters: rx_pending = %d, tx_pending = %d\n",
1844 ering->rx_pending, ering->tx_pending); 1844 ering->rx_pending, ering->tx_pending);
1845 1845
1846 if (pci_num_vf(bp->pdev)) {
1847 DP(BNX2X_MSG_IOV,
1848 "VFs are enabled, can not change ring parameters\n");
1849 return -EPERM;
1850 }
1851
1846 if (bp->recovery_state != BNX2X_RECOVERY_DONE) { 1852 if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
1847 DP(BNX2X_MSG_ETHTOOL, 1853 DP(BNX2X_MSG_ETHTOOL,
1848 "Handling parity error recovery. Try again later\n"); 1854 "Handling parity error recovery. Try again later\n");
@@ -2899,6 +2905,12 @@ static void bnx2x_self_test(struct net_device *dev,
2899 u8 is_serdes, link_up; 2905 u8 is_serdes, link_up;
2900 int rc, cnt = 0; 2906 int rc, cnt = 0;
2901 2907
2908 if (pci_num_vf(bp->pdev)) {
2909 DP(BNX2X_MSG_IOV,
2910 "VFs are enabled, can not perform self test\n");
2911 return;
2912 }
2913
2902 if (bp->recovery_state != BNX2X_RECOVERY_DONE) { 2914 if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
2903 netdev_err(bp->dev, 2915 netdev_err(bp->dev,
2904 "Handling parity error recovery. Try again later\n"); 2916 "Handling parity error recovery. Try again later\n");
@@ -3468,6 +3480,11 @@ static int bnx2x_set_channels(struct net_device *dev,
3468 channels->rx_count, channels->tx_count, channels->other_count, 3480 channels->rx_count, channels->tx_count, channels->other_count,
3469 channels->combined_count); 3481 channels->combined_count);
3470 3482
3483 if (pci_num_vf(bp->pdev)) {
3484 DP(BNX2X_MSG_IOV, "VFs are enabled, can not set channels\n");
3485 return -EPERM;
3486 }
3487
3471 /* We don't support separate rx / tx channels. 3488 /* We don't support separate rx / tx channels.
3472 * We don't allow setting 'other' channels. 3489 * We don't allow setting 'other' channels.
3473 */ 3490 */