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 7C64943196 for ; Wed, 18 Oct 2023 09:21:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9F30406BC; Wed, 18 Oct 2023 09:21:22 +0200 (CEST) Received: from office2.cesnet.cz (office2.cesnet.cz [78.128.248.237]) by mails.dpdk.org (Postfix) with ESMTP id E066D4025F for ; Wed, 18 Oct 2023 09:21:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2-2020; t=1697613681; bh=6n2kjnqqcCsPcaNWJSQ1RB+YlQFiHqfzHdrw7Djm3/E=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=ZQQNHk4XWzssnXbH4Wsn2tgp9lgiR2UdPh//SSsn17pL9zP+lZT6i2DGRIk61o/ZP 0HniU0mPfg6YdOuhB03AIXk722nZB09lTsXVxNTtXaAQAvuoC10Sz5v4My6mgqeVJL gJ6bWL1C2RzDmvJ0/kvJ5/qlKTtnpvi8nrYj4Ii2sBu9wV1W3DSOE/vXdWqFT6Cztj JEGl3rogMaOSB6ixj4r7pUDfgCYc+kTVnH597DcGK546J9efJV3Awj5xwCvsNr9dqw wt/prnX4FQ5a5S4SkGfFOvn4C97GvcwOzBKlNCsgF98zrvGZkkopPbNAhR0HugJqdt HuipVEugocanw== Received: from [IPV6:2001:67c:1220:80e:eee4:b5c9:3f38:d5c] (unknown [IPv6:2001:67c:1220:80e:eee4:b5c9:3f38:d5c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 9485F118004D; Wed, 18 Oct 2023 09:21:16 +0200 (CEST) Content-Type: multipart/alternative; boundary="------------qComhCWU37Bk24A0fyCSh0ak" Message-ID: <2d9a33c2-c4d3-4f05-8af4-d342d924fbe4@cesnet.cz> Date: Wed, 18 Oct 2023 09:21:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Whether the creatation of flow rules of i40e NIC support tcp port mask Content-Language: en-US To: "Xing, Beilei" , "jiangheng (G)" , "users@dpdk.org" , Stephen Hemminger Cc: "Fanbin(Kira,2012 Blue Lab.)" References: From: =?UTF-8?B?THVrw6HFoSDFoGnFoW1pxaE=?= In-Reply-To: X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org This is a multi-part message in MIME format. --------------qComhCWU37Bk24A0fyCSh0ak Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Jiangheng, maybe going through this thesis will help you - https://theses.cz/id/c96b6o/24818.pdf Page 46 mentions 7680 rules as the overall maximum capacity for i40e. Regards, Lukas On 18. 10. 23 6:09, Xing, Beilei wrote: > > Hi jiangheng, > > For TCP rules, it should be flow director. I remember i40e supports 8K > flow director rules. > > When the rule number is greater than 8K, only 8k rules can be created > successfully. > > BR, > > Beilei > > *From:*jiangheng (G) > *Sent:* Wednesday, October 18, 2023 10:19 AM > *To:* Xing, Beilei ; users@dpdk.org; Stephen > Hemminger > *Cc:* Fanbin(Kira,2012 Blue Lab.) > *Subject:* 答复: Whether the creatation of flow rules of i40e NIC > support tcp port mask > > Hi Beilei: > > What is the maximum number of flow rules supported by the i40e? > > What about that situation:  numbers of tcp connection is greater than > the maximum number of flow rules. > > *发件人**:*Xing, Beilei > *发送时间:* 2023年10月18日 9:55 > *收件人:* jiangheng (G) ; users@dpdk.org > *抄送:* Fanbin(Kira,2012 Blue Lab.) > *主题:* RE: Whether the creatation of flow rules of i40e NIC support tcp > port mask > > Hi Jiangheng, > > That’s because i40e only supports perfect match. > > BR, > > Beilei > > *From:*jiangheng (G) > *Sent:* Tuesday, October 17, 2023 4:52 PM > *To:* Xing, Beilei ; users@dpdk.org > *Cc:* Fanbin(Kira,2012 Blue Lab.) > *Subject:* Whether the creatation of flow rules of i40e NIC support > tcp port mask > > Hi beilei, > > I would like to create flows using tcp port mask, but it seems *only > mask 0xffff or 0x0 work*, Does flow rlue can be created using other mask? > > I40e dirver was using now. > > Here is my code: > >     struct rte_flow_attr attr; > >     struct rte_flow_item pattern[MAX_PATTERN_NUM]; > >     struct rte_flow_action action[MAX_ACTION_NUM]; > >     struct rte_flow *flow = NULL; > >     struct rte_flow_action_queue queue = { .index = queue_id }; > >     struct rte_flow_item_ipv4 ip_spec; > >     struct rte_flow_item_ipv4 ip_mask; > >     struct rte_flow_item_tcp tcp_spec; > >     struct rte_flow_item_tcp tcp_mask; > >     int res; > >     memset_s(pattern, sizeof(pattern), 0, sizeof(pattern)); > >     memset_s(action, sizeof(action), 0, sizeof(action)); > >     /* > >      * set the rule attribute. > >      * in this case only ingress packets will be checked. > >      */ > >     memset_s(&attr, sizeof(struct rte_flow_attr), 0, sizeof(struct > rte_flow_attr)); > >     attr.ingress = 1; > >     /* > >      * create the action sequence. > >      * one action only,  move packet to queue > >      */ > >     action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE; > >     action[0].conf = &queue; > >     action[1].type = RTE_FLOW_ACTION_TYPE_END; > >     // not limit eth header > >     pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH; > >     // ip header > >     memset_s(&ip_spec, sizeof(struct rte_flow_item_ipv4), 0, > sizeof(struct rte_flow_item_ipv4)); > >     memset_s(&ip_mask, sizeof(struct rte_flow_item_ipv4), 0, > sizeof(struct rte_flow_item_ipv4)); > >     ip_spec.hdr.dst_addr = dst_ip; > >     ip_mask.hdr.dst_addr = EMPTY_MASK; > >     ip_spec.hdr.src_addr = src_ip; > >     ip_mask.hdr.src_addr = EMPTY_MASK; > >     pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4; > >     pattern[1].spec = &ip_spec; > >     pattern[1].mask = &ip_mask; > >     // tcp header, full mask 0xffff > >     memset_s(&tcp_spec, sizeof(struct rte_flow_item_tcp), 0, > sizeof(struct rte_flow_item_tcp)); > >     memset_s(&tcp_mask, sizeof(struct rte_flow_item_tcp), 0, > sizeof(struct rte_flow_item_tcp)); > >     pattern[2].type = RTE_FLOW_ITEM_TYPE_TCP; // 2: pattern 2 is tcp > header > >     tcp_spec.hdr.src_port = src_port; > >     tcp_spec.hdr.dst_port = dst_port; > > *tcp_mask.hdr.src_port = 0xffff;  // only 0xffff and 0x0 work* > > *tcp_mask.hdr.dst_port = 0xffff; // only 0xffff and 0x0 work* > >     pattern[2].spec = &tcp_spec; > >     pattern[2].mask = &tcp_mask; > >     /* the final level must be always type end */ > >     pattern[3].type = RTE_FLOW_ITEM_TYPE_END; > >     res = rte_flow_validate(port_id, &attr, pattern, action, error); > >     if (!res) { > >         flow = rte_flow_create(port_id, &attr, pattern, action, error); > >     } else { > >         LSTACK_LOG(ERR, PORT, "rte_flow_create.rte_flow_validate > error, res %d \n", res); > >     } > > Looking forward to your favourable reply. > --------------qComhCWU37Bk24A0fyCSh0ak Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Jiangheng,


maybe going through this thesis will help you - https://theses.cz/id/c96b6o/24818.pdf

Page 46 mentions 7680 rules as the overall maximum capacity for i40e.


Regards,

Lukas


On 18. 10. 23 6:09, Xing, Beilei wrote:

Hi jiangheng,

 

For TCP rules, it should be flow director. I remember i40e supports 8K flow director rules.

When the rule number is greater than 8K, only 8k rules can be created successfully.

 

BR,

Beilei

 

From: jiangheng (G) <jiangheng14@huawei.com>
Sent: Wednesday, October 18, 2023 10:19 AM
To: Xing, Beilei <beilei.xing@intel.com>; users@dpdk.org; Stephen Hemminger <stephen@networkplumber.org>
Cc: Fanbin(Kira,2012 Blue Lab.) <fanbin12@huawei.com>
Subject:
答复: Whether the creatation of flow rules of i40e NIC support tcp port mask

 

Hi Beilei:

What is the maximum number of flow rules supported by the i40e?

What about that situation:  numbers of tcp connection is greater than the maximum number of flow rules.

 

 

发件人: Xing, Beilei <beilei.xing@intel.com>
发送时间: 20231018 9:55
收件人: jiangheng (G) <jiangheng14@huawei.com>; users@dpdk.org
抄送: Fanbin(Kira,2012 Blue Lab.) <fanbin12@huawei.com>
主题: RE: Whether the creatation of flow rules of i40e NIC support tcp port mask

 

Hi Jiangheng,

 

That’s because i40e only supports perfect match.

 

BR,

Beilei

 

From: jiangheng (G) <jiangheng14@huawei.com>
Sent: Tuesday, October 17, 2023 4:52 PM
To: Xing, Beilei <beilei.xing@intel.com>; users@dpdk.org
Cc: Fanbin(Kira,2012 Blue Lab.) <fanbin12@huawei.com>
Subject: Whether the creatation of flow rules of i40e NIC support tcp port mask

 

Hi beilei

I would like to create flows using tcp port mask, but it seems only mask 0xffff or 0x0 work, Does flow rlue can be created using other mask?

I40e dirver was using now.

   

Here is my code:

    struct rte_flow_attr attr;

    struct rte_flow_item pattern[MAX_PATTERN_NUM];

    struct rte_flow_action action[MAX_ACTION_NUM];

    struct rte_flow *flow = NULL;

    struct rte_flow_action_queue queue = { .index = queue_id };

    struct rte_flow_item_ipv4 ip_spec;

    struct rte_flow_item_ipv4 ip_mask;

 

    struct rte_flow_item_tcp tcp_spec;

    struct rte_flow_item_tcp tcp_mask;

    int res;

 

    memset_s(pattern, sizeof(pattern), 0, sizeof(pattern));

    memset_s(action, sizeof(action), 0, sizeof(action));

 

    /*

     * set the rule attribute.

     * in this case only ingress packets will be checked.

     */

    memset_s(&attr, sizeof(struct rte_flow_attr), 0, sizeof(struct rte_flow_attr));

    attr.ingress = 1;

 

    /*

     * create the action sequence.

     * one action only,  move packet to queue

     */

    action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;

    action[0].conf = &queue;

    action[1].type = RTE_FLOW_ACTION_TYPE_END;

 

    // not limit eth header

    pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH;

 

    // ip header

    memset_s(&ip_spec, sizeof(struct rte_flow_item_ipv4), 0, sizeof(struct rte_flow_item_ipv4));

    memset_s(&ip_mask, sizeof(struct rte_flow_item_ipv4), 0, sizeof(struct rte_flow_item_ipv4));

    ip_spec.hdr.dst_addr = dst_ip;

    ip_mask.hdr.dst_addr = EMPTY_MASK;

    ip_spec.hdr.src_addr = src_ip;

    ip_mask.hdr.src_addr = EMPTY_MASK;

    pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4;

    pattern[1].spec = &ip_spec;

    pattern[1].mask = &ip_mask;

 

    // tcp header, full mask 0xffff

    memset_s(&tcp_spec, sizeof(struct rte_flow_item_tcp), 0, sizeof(struct rte_flow_item_tcp));

    memset_s(&tcp_mask, sizeof(struct rte_flow_item_tcp), 0, sizeof(struct rte_flow_item_tcp));

    pattern[2].type = RTE_FLOW_ITEM_TYPE_TCP; // 2: pattern 2 is tcp header

    tcp_spec.hdr.src_port = src_port;

    tcp_spec.hdr.dst_port = dst_port;

    tcp_mask.hdr.src_port = 0xffff;  // only 0xffff and 0x0 work

    tcp_mask.hdr.dst_port = 0xffff; // only 0xffff and 0x0 work

    pattern[2].spec = &tcp_spec;

    pattern[2].mask = &tcp_mask;

 

    /* the final level must be always type end */

    pattern[3].type = RTE_FLOW_ITEM_TYPE_END;

    res = rte_flow_validate(port_id, &attr, pattern, action, error);

    if (!res) {

        flow = rte_flow_create(port_id, &attr, pattern, action, error);

    } else {

        LSTACK_LOG(ERR, PORT, "rte_flow_create.rte_flow_validate error, res %d \n", res);

    }

 

Looking forward to your favourable reply.

 

--------------qComhCWU37Bk24A0fyCSh0ak--