netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Ariel Elior <Ariel.Elior@cavium.com>,
	everest-linux-l2@cavium.com
Subject: [PATCH net-next 3/4] bnx2x: Use NETIF_F_GRO_HW.
Date: Mon,  4 Dec 2017 06:12:46 -0500	[thread overview]
Message-ID: <1512385967-32339-4-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1512385967-32339-1-git-send-email-michael.chan@broadcom.com>

Advertise NETIF_F_GRO_HW and turn on TPA_MODE_GRO when NETIF_F_GRO_HW
is set.

Cc: Ariel Elior <Ariel.Elior@cavium.com>
Cc: everest-linux-l2@cavium.com
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c  | 10 +++-------
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |  4 +++-
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 4c739d5..79371fb 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2482,7 +2482,7 @@ static void bnx2x_bz_fp(struct bnx2x *bp, int index)
 	 */
 	if (bp->dev->features & NETIF_F_LRO)
 		fp->mode = TPA_MODE_LRO;
-	else if (bp->dev->features & NETIF_F_GRO &&
+	else if (bp->dev->features & NETIF_F_GRO_HW &&
 		 bnx2x_mtu_allows_gro(bp->dev->mtu))
 		fp->mode = TPA_MODE_GRO;
 	else
@@ -4933,13 +4933,9 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
 		}
 	}
 
-	/* if GRO is changed while LRO is enabled, don't force a reload */
-	if ((changes & NETIF_F_GRO) && (features & NETIF_F_LRO))
-		changes &= ~NETIF_F_GRO;
-
 	/* if GRO is changed while HW TPA is off, don't force a reload */
-	if ((changes & NETIF_F_GRO) && bp->disable_tpa)
-		changes &= ~NETIF_F_GRO;
+	if ((changes & NETIF_F_GRO_HW) && bp->disable_tpa)
+		changes &= ~NETIF_F_GRO_HW;
 
 	if (changes)
 		bnx2x_reload = true;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 54d15713..92d54b4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13266,7 +13266,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
 
 	dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
 		NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
-		NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_GRO |
+		NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_GRO | NETIF_F_GRO_HW |
 		NETIF_F_RXHASH | NETIF_F_HW_VLAN_CTAG_TX;
 	if (!chip_is_e1x) {
 		dev->hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_GRE_CSUM |
@@ -13302,6 +13302,8 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
 
 	dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX;
 	dev->features |= NETIF_F_HIGHDMA;
+	if (dev->features & NETIF_F_GRO_HW)
+		dev->features &= ~NETIF_F_LRO;
 
 	/* Add Loopback capability to the device */
 	dev->hw_features |= NETIF_F_LOOPBACK;
-- 
1.8.3.1

  parent reply	other threads:[~2017-12-04 11:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 11:12 [PATCH net-next 0/4] Introduce NETIF_F_GRO_HW Michael Chan
2017-12-04 11:12 ` [PATCH net-next 1/4] net: " Michael Chan
2017-12-04 16:30   ` Or Gerlitz
2017-12-04 16:47   ` Alexander Duyck
2017-12-04 18:23     ` Michael Chan
2017-12-04 18:43       ` Alexander Duyck
2017-12-04 18:59         ` David Miller
2017-12-04 19:24           ` Alexander Duyck
2017-12-04 19:26           ` Eric Dumazet
2017-12-04 19:36             ` Alexander Duyck
2017-12-04 19:52         ` Michael Chan
2017-12-04 20:58           ` Alexander Duyck
2017-12-04 23:05             ` Michael Chan
2017-12-04 22:15   ` Yuval Mintz
2017-12-04 22:31     ` Michael Chan
2017-12-04 11:12 ` [PATCH net-next 2/4] bnxt_en: Use NETIF_F_GRO_HW Michael Chan
2017-12-04 16:35   ` Or Gerlitz
2017-12-04 18:11     ` Michael Chan
2017-12-04 21:06       ` Or Gerlitz
2017-12-04 22:00         ` Eric Dumazet
2017-12-05  0:07           ` Michael Chan
2017-12-05 18:10             ` Marcelo Ricardo Leitner
2017-12-06 21:04               ` Michael Chan
2017-12-04 11:12 ` Michael Chan [this message]
2017-12-04 11:12 ` [PATCH net-next 4/4] qede: " Michael Chan
2017-12-04 21:48   ` Yuval Mintz
2017-12-04 22:45     ` Michael Chan
2017-12-05 12:32       ` Chopra, Manish
2017-12-05 17:13         ` Michael Chan
2017-12-04 11:38 ` [PATCH net-next 0/4] Introduce NETIF_F_GRO_HW Elior, Ariel
2017-12-05 19:31 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512385967-32339-4-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=Ariel.Elior@cavium.com \
    --cc=davem@davemloft.net \
    --cc=everest-linux-l2@cavium.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).