aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-04-28 05:34:23 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-29 14:48:36 -0400
commitf8dcb5e3365a23b620f5744f23f1918b9c38d883 (patch)
tree6889aff43bf79b37ab3f1def9653e140368967e3 /drivers/net/ethernet/broadcom
parent7e6b4d440b0ae9062b84dfb417ea6d51a45dab76 (diff)
bnx2x: remove {TPA,GRO}_ENABLE_FLAG
These flags are redundant with dev->features. Remove them. Just make sure to set dev->features ourselves in bnx2x_set_features() before performing the reload of the card. Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x.h2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c39
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c5
3 files changed, 15 insertions, 31 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 2a41604cdd0e..a3b0f7a0c61e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1545,9 +1545,7 @@ struct bnx2x {
1545#define USING_MSIX_FLAG (1 << 5) 1545#define USING_MSIX_FLAG (1 << 5)
1546#define USING_MSI_FLAG (1 << 6) 1546#define USING_MSI_FLAG (1 << 6)
1547#define DISABLE_MSI_FLAG (1 << 7) 1547#define DISABLE_MSI_FLAG (1 << 7)
1548#define TPA_ENABLE_FLAG (1 << 8)
1549#define NO_MCP_FLAG (1 << 9) 1548#define NO_MCP_FLAG (1 << 9)
1550#define GRO_ENABLE_FLAG (1 << 10)
1551#define MF_FUNC_DIS (1 << 11) 1549#define MF_FUNC_DIS (1 << 11)
1552#define OWN_CNIC_IRQ (1 << 12) 1550#define OWN_CNIC_IRQ (1 << 12)
1553#define NO_ISCSI_OOO_FLAG (1 << 13) 1551#define NO_ISCSI_OOO_FLAG (1 << 13)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 84612b082b86..a8bb8f664d3d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2477,9 +2477,9 @@ static void bnx2x_bz_fp(struct bnx2x *bp, int index)
2477 /* set the tpa flag for each queue. The tpa flag determines the queue 2477 /* set the tpa flag for each queue. The tpa flag determines the queue
2478 * minimal size so it must be set prior to queue memory allocation 2478 * minimal size so it must be set prior to queue memory allocation
2479 */ 2479 */
2480 if (bp->flags & TPA_ENABLE_FLAG) 2480 if (bp->dev->features & NETIF_F_LRO)
2481 fp->mode = TPA_MODE_LRO; 2481 fp->mode = TPA_MODE_LRO;
2482 else if (bp->flags & GRO_ENABLE_FLAG && 2482 else if (bp->dev->features & NETIF_F_GRO &&
2483 bnx2x_mtu_allows_gro(bp->dev->mtu)) 2483 bnx2x_mtu_allows_gro(bp->dev->mtu))
2484 fp->mode = TPA_MODE_GRO; 2484 fp->mode = TPA_MODE_GRO;
2485 else 2485 else
@@ -3249,7 +3249,7 @@ int bnx2x_low_latency_recv(struct napi_struct *napi)
3249 3249
3250 if ((bp->state == BNX2X_STATE_CLOSED) || 3250 if ((bp->state == BNX2X_STATE_CLOSED) ||
3251 (bp->state == BNX2X_STATE_ERROR) || 3251 (bp->state == BNX2X_STATE_ERROR) ||
3252 (bp->flags & (TPA_ENABLE_FLAG | GRO_ENABLE_FLAG))) 3252 (bp->dev->features & (NETIF_F_LRO | NETIF_F_GRO)))
3253 return LL_FLUSH_FAILED; 3253 return LL_FLUSH_FAILED;
3254 3254
3255 if (!bnx2x_fp_lock_poll(fp)) 3255 if (!bnx2x_fp_lock_poll(fp))
@@ -4840,19 +4840,9 @@ netdev_features_t bnx2x_fix_features(struct net_device *dev,
4840int bnx2x_set_features(struct net_device *dev, netdev_features_t features) 4840int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
4841{ 4841{
4842 struct bnx2x *bp = netdev_priv(dev); 4842 struct bnx2x *bp = netdev_priv(dev);
4843 u32 flags = bp->flags; 4843 netdev_features_t changes = features ^ dev->features;
4844 u32 changes;
4845 bool bnx2x_reload = false; 4844 bool bnx2x_reload = false;
4846 4845 int rc;
4847 if (features & NETIF_F_LRO)
4848 flags |= TPA_ENABLE_FLAG;
4849 else
4850 flags &= ~TPA_ENABLE_FLAG;
4851
4852 if (features & NETIF_F_GRO)
4853 flags |= GRO_ENABLE_FLAG;
4854 else
4855 flags &= ~GRO_ENABLE_FLAG;
4856 4846
4857 /* VFs or non SRIOV PFs should be able to change loopback feature */ 4847 /* VFs or non SRIOV PFs should be able to change loopback feature */
4858 if (!pci_num_vf(bp->pdev)) { 4848 if (!pci_num_vf(bp->pdev)) {
@@ -4869,24 +4859,23 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
4869 } 4859 }
4870 } 4860 }
4871 4861
4872 changes = flags ^ bp->flags;
4873
4874 /* if GRO is changed while LRO is enabled, don't force a reload */ 4862 /* if GRO is changed while LRO is enabled, don't force a reload */
4875 if ((changes & GRO_ENABLE_FLAG) && (flags & TPA_ENABLE_FLAG)) 4863 if ((changes & NETIF_F_GRO) && (features & NETIF_F_LRO))
4876 changes &= ~GRO_ENABLE_FLAG; 4864 changes &= ~NETIF_F_GRO;
4877 4865
4878 /* if GRO is changed while HW TPA is off, don't force a reload */ 4866 /* if GRO is changed while HW TPA is off, don't force a reload */
4879 if ((changes & GRO_ENABLE_FLAG) && bp->disable_tpa) 4867 if ((changes & NETIF_F_GRO) && bp->disable_tpa)
4880 changes &= ~GRO_ENABLE_FLAG; 4868 changes &= ~NETIF_F_GRO;
4881 4869
4882 if (changes) 4870 if (changes)
4883 bnx2x_reload = true; 4871 bnx2x_reload = true;
4884 4872
4885 bp->flags = flags;
4886
4887 if (bnx2x_reload) { 4873 if (bnx2x_reload) {
4888 if (bp->recovery_state == BNX2X_RECOVERY_DONE) 4874 if (bp->recovery_state == BNX2X_RECOVERY_DONE) {
4889 return bnx2x_reload_if_running(dev); 4875 dev->features = features;
4876 rc = bnx2x_reload_if_running(dev);
4877 return rc ? rc : 1;
4878 }
4890 /* else: bnx2x_nic_load() will be called at end of recovery */ 4879 /* else: bnx2x_nic_load() will be called at end of recovery */
4891 } 4880 }
4892 4881
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 64ea5adf72eb..60d2b8ebba16 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -3304,7 +3304,7 @@ static void bnx2x_pf_init(struct bnx2x *bp)
3304 /* This flag is relevant for E1x only. 3304 /* This flag is relevant for E1x only.
3305 * E2 doesn't have a TPA configuration in a function level. 3305 * E2 doesn't have a TPA configuration in a function level.
3306 */ 3306 */
3307 flags |= (bp->flags & TPA_ENABLE_FLAG) ? FUNC_FLG_TPA : 0; 3307 flags |= (bp->dev->features & NETIF_F_LRO) ? FUNC_FLG_TPA : 0;
3308 3308
3309 func_init.func_flgs = flags; 3309 func_init.func_flgs = flags;
3310 func_init.pf_id = BP_FUNC(bp); 3310 func_init.pf_id = BP_FUNC(bp);
@@ -12107,11 +12107,8 @@ static int bnx2x_init_bp(struct bnx2x *bp)
12107 12107
12108 /* Set TPA flags */ 12108 /* Set TPA flags */
12109 if (bp->disable_tpa) { 12109 if (bp->disable_tpa) {
12110 bp->flags &= ~(TPA_ENABLE_FLAG | GRO_ENABLE_FLAG);
12111 bp->dev->hw_features &= ~NETIF_F_LRO; 12110 bp->dev->hw_features &= ~NETIF_F_LRO;
12112 bp->dev->features &= ~NETIF_F_LRO; 12111 bp->dev->features &= ~NETIF_F_LRO;
12113 } else {
12114 bp->flags |= (TPA_ENABLE_FLAG | GRO_ENABLE_FLAG);
12115 } 12112 }
12116 12113
12117 if (CHIP_IS_E1(bp)) 12114 if (CHIP_IS_E1(bp))