Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dmitry Bogdanov <dbogdanov@marvell.com>
To: <netdev@vger.kernel.org>, "David S . Miller" <davem@davemloft.net>
Cc: Dmitry Bogdanov <dbogdanov@marvell.com>,
	Manish Chopra <manishc@marvell.com>,
	Igor Russkikh <irusskikh@marvell.com>,
	Michal Kalderon <michal.kalderon@marvell.com>
Subject: [PATCH v2 net 2/3] net: qede: Disable aRFS for NPAR and 100G
Date: Mon, 31 Aug 2020 12:43:28 +0300	[thread overview]
Message-ID: <3950bbb988b66c9c43c46d46c9632a272cea294c.1597833340.git.dbogdanov@marvell.com> (raw)
Message-ID: <20200831094328.4yqAcIvdOYmjyUfx3i6GgG1nD4SpXiiqRGUkxEJMYuE@z> (raw)
In-Reply-To: <cover.1597833340.git.dbogdanov@marvell.com>

In some configurations ARFS cannot be used, so disable it if device
is not capable.

Fixes: e4917d46a653 ("qede: Add aRFS support")
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
---
 drivers/net/ethernet/qlogic/qede/qede_filter.c |  3 +++
 drivers/net/ethernet/qlogic/qede/qede_main.c   | 11 +++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index f961f65d9372..c59b72c90293 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -311,6 +311,9 @@ int qede_alloc_arfs(struct qede_dev *edev)
 {
 	int i;
 
+	if (!edev->dev_info.common.b_arfs_capable)
+		return -EINVAL;
+
 	edev->arfs = vzalloc(sizeof(*edev->arfs));
 	if (!edev->arfs)
 		return -ENOMEM;
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 140a392a81bb..9e1f41ba766c 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -804,7 +804,7 @@ static void qede_init_ndev(struct qede_dev *edev)
 		      NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
 		      NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_TC;
 
-	if (!IS_VF(edev) && edev->dev_info.common.num_hwfns == 1)
+	if (edev->dev_info.common.b_arfs_capable)
 		hw_features |= NETIF_F_NTUPLE;
 
 	if (edev->dev_info.common.vxlan_enable ||
@@ -2274,7 +2274,7 @@ static void qede_unload(struct qede_dev *edev, enum qede_unload_mode mode,
 	qede_vlan_mark_nonconfigured(edev);
 	edev->ops->fastpath_stop(edev->cdev);
 
-	if (!IS_VF(edev) && edev->dev_info.common.num_hwfns == 1) {
+	if (edev->dev_info.common.b_arfs_capable) {
 		qede_poll_for_freeing_arfs_filters(edev);
 		qede_free_arfs(edev);
 	}
@@ -2341,10 +2341,9 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode,
 	if (rc)
 		goto err2;
 
-	if (!IS_VF(edev) && edev->dev_info.common.num_hwfns == 1) {
-		rc = qede_alloc_arfs(edev);
-		if (rc)
-			DP_NOTICE(edev, "aRFS memory allocation failed\n");
+	if (qede_alloc_arfs(edev)) {
+		edev->ndev->features &= ~NETIF_F_NTUPLE;
+		edev->dev_info.common.b_arfs_capable = false;
 	}
 
 	qede_napi_add_enable(edev);
-- 
2.17.1


  parent reply	other threads:[~2020-08-31  9:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 20:29 [PATCH net 0/3] net: qed disable aRFS in " Dmitry Bogdanov
2020-08-19 20:29 ` [PATCH net 1/3] net: qed: Disable aRFS for " Dmitry Bogdanov
2020-08-20 11:08   ` Dmitry Bogdanov
2020-08-21 11:51   ` [PATCH v2, " Dmitry Bogdanov
2020-08-31  9:43   ` [PATCH v2 " Dmitry Bogdanov
2020-09-01 15:29   ` Igor Russkikh
2020-08-19 20:29 ` Dmitry Bogdanov [this message]
2020-08-19 22:49   ` [PATCH net 2/3] net: qede: " David Miller
2020-08-20 11:08   ` Dmitry Bogdanov
2020-08-21 11:51   ` [PATCH v2, " Dmitry Bogdanov
2020-08-31  9:43   ` [PATCH v2 " Dmitry Bogdanov
2020-08-19 20:29 ` [PATCH net 3/3] net: qed: RDMA personality shouldn't fail VF load Dmitry Bogdanov
2020-08-20 11:08   ` Dmitry Bogdanov
2020-08-21 11:51   ` [PATCH v2, " Dmitry Bogdanov
2020-08-31  9:43   ` [PATCH v2 " Dmitry Bogdanov
2020-08-20 11:08 ` [PATCH net 0/3] net: qed disable aRFS in NPAR and 100G Dmitry Bogdanov
2020-08-21 11:45 ` Dmitry Bogdanov
2020-08-21 11:51 ` [PATCH v2, " Dmitry Bogdanov
2020-08-31  9:43 ` [PATCH v2 " Dmitry Bogdanov

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=3950bbb988b66c9c43c46d46c9632a272cea294c.1597833340.git.dbogdanov@marvell.com \
    --to=dbogdanov@marvell.com \
    --cc=davem@davemloft.net \
    --cc=irusskikh@marvell.com \
    --cc=manishc@marvell.com \
    --cc=michal.kalderon@marvell.com \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH v2 net 2/3] net: qede: Disable aRFS for NPAR and 100G' \
    /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

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).