From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <xavier.huwei@huawei.com>
Subject: [dpdk-dev] [PATCH 06/11] net/hns3: support a maximun 256 FDIR counter
Date: Tue, 25 Aug 2020 19:53:00 +0800 [thread overview]
Message-ID: <20200825115305.58490-7-huwei013@chinasoftinc.com> (raw)
In-Reply-To: <20200825115305.58490-1-huwei013@chinasoftinc.com>
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
The FDIR counter was used to count the number of FDIR hit, the maximum
number of the counter is 128 based on kunpeng 920, and it was 256 based
on kunpeng 930.
The firmware is responsible to allocate counters for diffent PF devices,
so the available counter number of one PF may be bigger than 128.
Currently, there are two places using the counter in hns3 PMD driver:
1. Configure the counter. Driver uses the command whose opcode is
HNS3_OPC_FD_AD_OP, now we extend one bit to hold the high bit of
counter-id in the command format.
2. Query the statistic information of the counter. Driver uses the command
whose opcode is HNS3_OPC_FD_COUNTER_OP, now the command already support
16-bit counter-id.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
drivers/net/hns3/hns3_fdir.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index 6ab439d06..5c3dd05f2 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -41,6 +41,8 @@
#define HNS3_FD_AD_WR_RULE_ID_B 0
#define HNS3_FD_AD_RULE_ID_S 1
#define HNS3_FD_AD_RULE_ID_M GENMASK(13, 1)
+#define HNS3_FD_AD_COUNTER_HIGH_BIT 7
+#define HNS3_FD_AD_COUNTER_HIGH_BIT_B 26
enum HNS3_PORT_TYPE {
HOST_PORT,
@@ -424,6 +426,9 @@ static int hns3_fd_ad_config(struct hns3_hw *hw, int loc,
action->write_rule_id_to_bd);
hns3_set_field(ad_data, HNS3_FD_AD_RULE_ID_M, HNS3_FD_AD_RULE_ID_S,
action->rule_id);
+ /* set extend bit if counter_id is in [128 ~ 255] */
+ if (action->counter_id & BIT(HNS3_FD_AD_COUNTER_HIGH_BIT))
+ hns3_set_bit(ad_data, HNS3_FD_AD_COUNTER_HIGH_BIT_B, 1);
ad_data <<= HNS3_FD_AD_DATA_S;
hns3_set_bit(ad_data, HNS3_FD_AD_DROP_B, action->drop_packet);
hns3_set_bit(ad_data, HNS3_FD_AD_DIRECT_QID_B,
--
2.27.0
next prev parent reply other threads:[~2020-08-25 11:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 11:52 [dpdk-dev] [PATCH 00/11] updates for hns3 PMD driver Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 01/11] net/hns3: get device capability from firmware Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 02/11] net/hns3: get dev specifications " Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 03/11] net/hns3: compatibility issues about Rx interrupts Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 04/11] net/hns3: compatibility issues about Tx padding short frame Wei Hu (Xavier)
2020-08-25 11:52 ` [dpdk-dev] [PATCH 05/11] net/hns3: add more hardware error types Wei Hu (Xavier)
2020-09-04 10:34 ` Ferruh Yigit
2020-08-25 11:53 ` Wei Hu (Xavier) [this message]
2020-08-25 11:53 ` [dpdk-dev] [PATCH 07/11] net/hns3: replace private macro with RTE MAX Wei Hu (Xavier)
2020-08-25 11:53 ` [dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO Wei Hu (Xavier)
2020-09-04 10:34 ` Ferruh Yigit
2020-09-07 11:34 ` Wei Hu (Xavier)
2020-09-07 12:10 ` Ferruh Yigit
2020-09-07 12:28 ` Wei Hu (Xavier)
2020-08-25 11:53 ` [dpdk-dev] [PATCH 09/11] net/hns3: fix default MAC addr from firmware Wei Hu (Xavier)
2020-08-25 11:53 ` [dpdk-dev] [PATCH 10/11] net/hns3: fix Rx/Tx queue offload capability Wei Hu (Xavier)
2020-09-04 10:34 ` Ferruh Yigit
2020-09-08 11:48 ` Wei Hu (Xavier)
2020-09-08 12:28 ` [dpdk-dev] [PATCH v2] " Wei Hu (Xavier)
2020-09-15 13:35 ` Ferruh Yigit
2020-08-25 11:53 ` [dpdk-dev] [PATCH 11/11] net/hns3: fix some incomplete command structures Wei Hu (Xavier)
2020-09-03 1:04 ` [dpdk-dev] [PATCH 00/11] updates for hns3 PMD driver Wei Hu (Xavier)
2020-09-04 10:34 ` 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=20200825115305.58490-7-huwei013@chinasoftinc.com \
--to=huwei013@chinasoftinc.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=xavier.huwei@huawei.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).