From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4D50A04FD; Mon, 1 Aug 2022 15:27:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8079D4067B; Mon, 1 Aug 2022 15:27:25 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 7ECA04014F for ; Mon, 1 Aug 2022 15:27:23 +0200 (CEST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LxJkc1vl1zlW8G; Mon, 1 Aug 2022 21:24:40 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 1 Aug 2022 21:27:20 +0800 Received: from [10.67.103.231] (10.67.103.231) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 1 Aug 2022 21:27:19 +0800 Message-ID: Date: Mon, 1 Aug 2022 21:27:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: Question about pattern types for rte_flow RSS rule To: Andrew Rybchenko , "orika@nvidia.com >> Ori Kam" , "dev@dpdk.org" CC: Stephen Hemminger , Thomas Monjalon , Ferruh Yigit , huangdaode , "fengchengwen@huawei.com" , "liudongdong (C)" References: <8c5019cf-312e-708a-d1d5-cba666443f87@huawei.com> <6c38207f-d5cb-3b61-c65c-8e22239ff6b2@huawei.com> <55f8cb7c-22c6-bbf1-b3a2-59cc02bfdb91@huawei.com> <63d3c19c-9806-4ad5-2b7a-d5ec2b30406d@oktetlabs.ru> From: "lihuisong (C)" In-Reply-To: <63d3c19c-9806-4ad5-2b7a-d5ec2b30406d@oktetlabs.ru> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.231] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 在 2022/8/1 19:53, Andrew Rybchenko 写道: > On 8/1/22 06:39, lihuisong (C) wrote: >> >> 在 2022/7/31 17:40, Andrew Rybchenko 写道: >>> Hi, Huisong! >>> >>> On 7/29/22 05:30, lihuisong (C) wrote: >>>> Hi Ori, and all, >>>> >>>> For RSS flow rule, pattern item types and RSS types in action >>>> are an inclusive relationship, and RSS types contain pattern item >>>> types. >>> >>> I disagree with the statement. We can redirect various packets, >>> but apply RSS on subset only. Everything else goes to the first >>> queue (first entry in the redirection table in fact). >> Sorry, the statement above is inaccurate. >> I mean, pattern item type and RSS types in action are the same for >> creating specified types RSS rule, and this configuration is duplicate >> in this case(in <1> command, I think). Use one of them can specify >> which packet type flow performs action(like <1> or <2> command). > > No, I still disagree. Pattern is about filtering. It defines on which > packets flow rule actions are applied. RSS types choose packet header > fields (if applicable) to calculate hash. I.e. RSS types are no about > filtering. > >> >> Create a RSS rule that redirect ipv4-tcp flow to queues 1 and 2: >> <1> flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss >> types ipv4-tcp end queues 1 2 end / end > > Yes, this one will redirect IPv4 TCP packets only. > >> <2> flow create 0 ingress pattern end actions rss types ipv4-tcp end >> queues 1 2 end / end > > The rule will redirect all packets to queues 1 and 2. Some packets will > always go to queue 1, e.g. ARP packets. > In this case, only nonfrag ipv4 TCP packet flow calculate RSS hash and may distribute to queue 1 and 2 in hardware, and other packets will always go to queue 1, right? >> <3> flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss >> end queues 1 2 end / end > > This one will redirect IPv4 TCP and will use RSS hash function specified > in dev_conf on device configuration or default RSS hash function chosen > by corresponding driver. > >> >> What do you think about it, @Andrew and @Ori? >>> >>>> Is it necessary to set pattern item types when specify RSS >>>> types to create a rule? >>> >>> No, it is not strictly required. It depends on what you want. >>> >>>> How should the user set and how should the >>>> driver do? >>> >>> Pattern and action are not strictly related in the case of RSS. >>> Pattern defines on which packets the rule is applied. >>> Action defines what the rule does. If hash function is not >>> applicable to a packet, e.g. ARP packet and ipv4-tcp hash function, >>> the hash is 0 and goes via redirection table entry 0. >> I know this rule. Ori has already explained the usage of RSS rule in >> rte_flow API, >> but I still have a confusion momentioned above. >>> >>> Andrew. >>> >>>> >>>> Looking forward to your reply. >>>> >>>> Regards, >>>> Huisong >>>> >>>> 在 2022/7/13 9:34, lihuisong (C) 写道: >>>>> Hi all, >>>>> >>>>> Can someone open my confusion? >>>>> I'm looking forward to your reply. >>>>> >>>>> Thanks, >>>>> Huisong. >>>>> >>>>> 在 2022/7/7 11:50, lihuisong (C) 写道: >>>>>> Hi all, >>>>>> >>>>>> From following testpmd command: >>>>>> 'flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss >>>>>> types ipv4-tcp l3-src-only end queues end / end' >>>>>> and >>>>>> "flow create 0 ingress pattern end actions rss types ipv4-tcp >>>>>> l3-src-only end queues end / end" >>>>>> >>>>>> I have some confusions about rte_flow RSS rule: >>>>>> 1> Do pattern item types need to set when configure rte_flow RSS >>>>>> rule? >>>>>> 2> Does the driver need to check and process the pattern? (After >>>>>> all, the RSS types in actions alreadly contain all RSS offload >>>>>> types.) >>>>>> >>>>>> Have someone explains it? >>>>>> >>>>>> Regards, >>>>>> Huisong >>>>>> >>>>>> . >>>>> . >>> >>> . > > .