DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>,
	Long Wu <long.wu@corigine.com>
Subject: [PATCH 2/5] net/nfp: modify the logic of set promisc mode
Date: Wed, 13 Dec 2023 11:24:13 +0800	[thread overview]
Message-ID: <20231213032416.1988817-3-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231213032416.1988817-1-chaoyong.he@corigine.com>

Modify the logic of set promisc mode, add the check logic of
capacity.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
---
 drivers/net/nfp/nfp_net_common.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index 79ce1dd837..12b62c1958 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -592,6 +592,11 @@ nfp_net_promisc_disable(struct rte_eth_dev *dev)
 	net_hw = nfp_net_get_hw(dev);
 	hw = &net_hw->super;
 
+	if ((hw->cap & NFP_NET_CFG_CTRL_PROMISC) == 0) {
+		PMD_DRV_LOG(ERR, "Promiscuous mode not supported");
+		return -ENOTSUP;
+	}
+
 	if ((hw->ctrl & NFP_NET_CFG_CTRL_PROMISC) == 0) {
 		PMD_DRV_LOG(INFO, "Promiscuous mode already disabled");
 		return 0;
-- 
2.39.1


  parent reply	other threads:[~2023-12-13  3:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  3:24 [PATCH 0/5] unify the usage of capacity and control Chaoyong He
2023-12-13  3:24 ` [PATCH 1/5] net/nfp: complete the logic of print capacity Chaoyong He
2023-12-13  3:24 ` Chaoyong He [this message]
2023-12-13  3:24 ` [PATCH 3/5] net/nfp: modify the logic of set MAC address Chaoyong He
2023-12-13  3:24 ` [PATCH 4/5] net/nfp: use ctrl to check the mode of features Chaoyong He
2023-12-13  3:24 ` [PATCH 5/5] net/nfp: use ctrl extend " Chaoyong He
2023-12-14 16:08 ` [PATCH 0/5] unify the usage of capacity and control Ferruh Yigit

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=20231213032416.1988817-3-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    /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).