From: tanhuazhong <tanhuazhong@huawei.com>
To: Saeed Mahameed <saeed@kernel.org>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kuba@kernel.org>, <huangdaode@huawei.com>,
Jian Shen <shenjian15@huawei.com>
Subject: Re: [PATCH net-next 3/7] net: hns3: add support for forwarding packet to queues of specified TC when flow director rule hit
Date: Thu, 10 Dec 2020 20:24:12 +0800 [thread overview]
Message-ID: <dc805355-9cb8-87f1-dc4b-f9cfed2a5764@huawei.com> (raw)
In-Reply-To: <5057047d659b337317d1ee8355a2659c78d3315f.camel@kernel.org>
On 2020/12/10 13:40, Saeed Mahameed wrote:
> On Thu, 2020-12-10 at 11:42 +0800, Huazhong Tan wrote:
>> From: Jian Shen <shenjian15@huawei.com>
>>
>> For some new device, it supports forwarding packet to queues
>> of specified TC when flow director rule hit. So extend the
>> command handle to support it.
>>
>
> ...
>
>> static int hclge_config_action(struct hclge_dev *hdev, u8 stage,
>> struct hclge_fd_rule *rule)
>> {
>> + struct hclge_vport *vport = hdev->vport;
>> + struct hnae3_knic_private_info *kinfo = &vport->nic.kinfo;
>> struct hclge_fd_ad_data ad_data;
>>
>> + memset(&ad_data, 0, sizeof(struct hclge_fd_ad_data));
>> ad_data.ad_id = rule->location;
>>
>> if (rule->action == HCLGE_FD_ACTION_DROP_PACKET) {
>> ad_data.drop_packet = true;
>> - ad_data.forward_to_direct_queue = false;
>> - ad_data.queue_id = 0;
>> + } else if (rule->action == HCLGE_FD_ACTION_SELECT_TC) {
>> + ad_data.override_tc = true;
>> + ad_data.queue_id =
>> + kinfo->tc_info.tqp_offset[rule->tc];
>> + ad_data.tc_size =
>> + ilog2(kinfo->tc_info.tqp_count[rule->tc]);
>
> In the previous patch you copied this info from mqprio, which is an
> egress qdisc feature, this patch is clearly about rx flow director, I
> think the patch is missing some context otherwise it doesn't make any
> sense.
>
Since tx and rx are in the same tqp, what we do here is to make tx and
rx in the same tc when rule is hit.
>> } else {
>> - ad_data.drop_packet = false;
>> ad_data.forward_to_direct_queue = true;
>> ad_data.queue_id = rule->queue_id;
>> }
>> @@ -5937,7 +5950,7 @@ static int hclge_add_fd_entry(struct
>> hnae3_handle *handle,
>> return -EINVAL;
>> }
>>
>> - action = HCLGE_FD_ACTION_ACCEPT_PACKET;
>> + action = HCLGE_FD_ACTION_SELECT_QUEUE;
>> q_index = ring;
>> }
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
>> b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
>> index b3c1301..a481064 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
>> @@ -572,8 +572,9 @@ enum HCLGE_FD_PACKET_TYPE {
>> };
>>
>> enum HCLGE_FD_ACTION {
>> - HCLGE_FD_ACTION_ACCEPT_PACKET,
>> + HCLGE_FD_ACTION_SELECT_QUEUE,
>> HCLGE_FD_ACTION_DROP_PACKET,
>> + HCLGE_FD_ACTION_SELECT_TC,
>
> what is SELECT_TC ? you never actually write this value anywhere in
> this patch.
>
HCLGE_FD_ACTION_SELECT_TC means that the packet will be forwarded into
the queue of specified TC when rule is hit.
the assignment is in the next patch, maybe these two patch should be
merged for making it more readable.
Thanks.
Huazhong.
>
>
> .
>
next prev parent reply other threads:[~2020-12-10 12:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 3:42 [PATCH net-next 0/7] net: hns3: updates for -next Huazhong Tan
2020-12-10 3:42 ` [PATCH net-next 1/7] net: hns3: refine the struct hane3_tc_info Huazhong Tan
2020-12-10 3:42 ` [PATCH net-next 2/7] net: hns3: add support for tc mqprio offload Huazhong Tan
2020-12-10 4:50 ` Saeed Mahameed
2020-12-10 12:27 ` tanhuazhong
2020-12-10 20:24 ` Saeed Mahameed
2020-12-11 6:55 ` tanhuazhong
2020-12-10 3:42 ` [PATCH net-next 3/7] net: hns3: add support for forwarding packet to queues of specified TC when flow director rule hit Huazhong Tan
2020-12-10 5:40 ` Saeed Mahameed
2020-12-10 12:24 ` tanhuazhong [this message]
2020-12-10 20:46 ` Saeed Mahameed
2020-12-11 7:06 ` tanhuazhong
2020-12-10 3:42 ` [PATCH net-next 4/7] net: hns3: add support for hw tc offload of tc flower Huazhong Tan
2020-12-10 3:42 ` [PATCH net-next 5/7] net: hns3: add support for max 512 rss size Huazhong Tan
2020-12-10 3:42 ` [PATCH net-next 6/7] net: hns3: adjust rss indirection table configure command Huazhong Tan
2020-12-10 3:42 ` [PATCH net-next 7/7] net: hns3: adjust rss tc mode " Huazhong Tan
2020-12-10 4:34 ` [PATCH net-next 0/7] net: hns3: updates for -next 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=dc805355-9cb8-87f1-dc4b-f9cfed2a5764@huawei.com \
--to=tanhuazhong@huawei.com \
--cc=davem@davemloft.net \
--cc=huangdaode@huawei.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeed@kernel.org \
--cc=shenjian15@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).