From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD72BA04AF; Thu, 20 Aug 2020 05:19:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9C34B1BEC3; Thu, 20 Aug 2020 05:19:25 +0200 (CEST) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by dpdk.org (Postfix) with ESMTP id 06FB01BEBA for ; Thu, 20 Aug 2020 05:19:23 +0200 (CEST) Received: by mail-ot1-f66.google.com with SMTP id v21so357991otj.9 for ; Wed, 19 Aug 2020 20:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WH1wlFaPrluiqvNaVEFp9Rh4O+j8kP9EeMsTlTV4qi8=; b=HgQLRHQaz0UzrIzrNGRJDCV43QWsXwbU3ht5etlTEjKCMfGRlLFCq+lvHS5QGo/HIw l9M9SWeIE7UOiLpGeTV2ODOyCaHkHrb5IEqScfe/uPR923eQMgSv232ghViUg0TRBeHN X/DM+ntvT4AWgObRWg0TW+LjCVz1+ySPECZSE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WH1wlFaPrluiqvNaVEFp9Rh4O+j8kP9EeMsTlTV4qi8=; b=L2vtqS+UVf+BP1VbrjL8aQDX7wukogBUmfz21k5eF7JJ768QABArLjUDf8tuqYhjT2 X59M/xSn/0mTVDGvcHvLaHQzOG1INVokiFycsm2uI0PCRdWULv+bxQ/DxwHmAs0lBKex C0GW7RUErF+5xEpW1RpG5kDjIs0Qqmdt5kMRpDg3QLACqK2RJsXrSOFaNGP9IONwcgyF i0NjCSY0g17FoDeVf07AlHJ2KJB2h1QEALfEDBIxPEctMNkPu5VKI7z+AJQf3MyJXL+M wum3wNevFMHeO+pOuEcqSSsNdmUs7YL9eTSTOgv8CnEEBMuibCanszayurVeMMoE1GkL 5Rog== X-Gm-Message-State: AOAM533O7jmrKVa1bgD8wARgWxBXYqfYQdmGANOxtw8bV4LxHBKRHpUU hWWL2iyQUCGRmJypy23+05Yo4qndkUbRrT+NskRPTQ== X-Google-Smtp-Source: ABdhPJxTA057Fg1/hgGC7DH8SSiUZKYKS1lismw9vuq4p+iMVQ22szBjVhh/iGstD2WfnlHCtzfmJM9evnxmirJagHM= X-Received: by 2002:a9d:2c43:: with SMTP id f61mr785134otb.154.1597893562825; Wed, 19 Aug 2020 20:19:22 -0700 (PDT) MIME-Version: 1.0 References: <20200818103145.2192371-1-kirankumark@marvell.com> <20200819060446.2264111-1-kirankumark@marvell.com> In-Reply-To: <20200819060446.2264111-1-kirankumark@marvell.com> From: Ajit Khaparde Date: Wed, 19 Aug 2020 20:19:06 -0700 Message-ID: To: Kiran Kumar K Cc: Wenzhuo Lu , Beilei Xing , Bernard Iremonger , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , dpdk-dev , Jerin Jacob Kollanukkaran , Ori Kam , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Rosen Xu , jia.guo@intel.com, Rasesh Mody , Shahed Shaikh , Nithin Dabilpuram , Qiming Yang , Qi Zhang , "Wiles, Keith" , Hemant Agrawal , Sachin Saxena , "Zhao1, Wei" , John Daley , Hyong Youb Kim , Chas Williams , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Rahul Lakkireddy , Gaetan Rivet , lironh@marvell.com, Jingjing Wu , "Wei Hu (Xavier" , humin29@huawei.com, yisen.zhuang@huawei.com, Somnath Kotur , "Singh, Jasvinder" , "Dumitrescu, Cristian" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v5 1/2] ethdev: add level support for RSS offload types X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Aug 18, 2020 at 11:05 PM wrote: > From: Kiran Kumar K > > This patch reserves 2 bits as input selection to select Inner and > outer layers for RSS computation. It is combined with existing > ETH_RSS_* to choose Inner or outer layers for L2, L3 and L4. > This functionality already exists in rte_flow through level parameter in > RSS action configuration rte_flow_action_rss. > > Signed-off-by: Kiran Kumar K > --- > V5 Changes: > * Added support to set rss level type from port config in testpmd > > app/test-pmd/cmdline.c | 11 ++++++++++- > app/test-pmd/parameters.c | 6 ++++++ > Can you split this into testpmd and ethdev patches. Becomes easy to reference, fix. lib/librte_ethdev/rte_ethdev.h | 27 +++++++++++++++++++++++++++ > 3 files changed, 43 insertions(+), 1 deletion(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 0a6ed85f3..4eafee8c8 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -2334,7 +2334,16 @@ cmd_config_rss_parsed(void *parsed_result, > rss_conf.rss_hf = ETH_RSS_GTPU; > else if (!strcmp(res->value, "none")) > rss_conf.rss_hf = 0; > - else if (!strcmp(res->value, "default")) > + else if (!strcmp(res->value, "level-inner")) { > + rss_hf &= (~ETH_RSS_LEVEL_MASK); > + rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_INNER); > + } else if (!strcmp(res->value, "level-outer")) { > + rss_hf &= (~ETH_RSS_LEVEL_MASK); > + rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_OUTER); > + } else if (!strcmp(res->value, "level-inner-outer")) { > + rss_hf &= (~ETH_RSS_LEVEL_MASK); > + rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_INNER_OUTER); > + } else if (!strcmp(res->value, "default")) > use_default = 1; > else if (isdigit(res->value[0]) && atoi(res->value) > 0 && > atoi(res->value) < 64) > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index 7cb0e3d6e..5f669ff24 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -632,6 +632,8 @@ launch_args_parse(int argc, char** argv) > { "forward-mode", 1, 0, 0 }, > { "rss-ip", 0, 0, 0 }, > { "rss-udp", 0, 0, 0 }, > + { "rss-outer", 0, 0, 0 }, > + { "rss-inner-outer", 0, 0, 0 }, > { "rxq", 1, 0, 0 }, > { "txq", 1, 0, 0 }, > { "rxd", 1, 0, 0 }, > @@ -1051,6 +1053,10 @@ launch_args_parse(int argc, char** argv) > rss_hf = ETH_RSS_IP; > if (!strcmp(lgopts[opt_idx].name, "rss-udp")) > rss_hf = ETH_RSS_UDP; > + if (!strcmp(lgopts[opt_idx].name, "rss-outer")) > + rss_hf |= ETH_RSS_LEVEL_OUTER; > + if (!strcmp(lgopts[opt_idx].name, > "rss-inner-outer")) > + rss_hf |= ETH_RSS_LEVEL_INNER_OUTER; > if (!strcmp(lgopts[opt_idx].name, "rxq")) { > n = atoi(optarg); > if (n >= 0 && check_nb_rxq((queueid_t)n) > == 0) > diff --git a/lib/librte_ethdev/rte_ethdev.h > b/lib/librte_ethdev/rte_ethdev.h > index d29930fd8..28184cc85 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -552,6 +552,33 @@ struct rte_eth_rss_conf { > #define RTE_ETH_RSS_L3_PRE64 (1ULL << 53) > #define RTE_ETH_RSS_L3_PRE96 (1ULL << 52) > > +/* > + * We use the following macros to combine with the above layers to choose > + * inner and outer layers or both for RSS computation. > + * Note: Default is 0: inner layers, 1: outer layers, 2: both > + * bit 50 and 51 are reserved for this. > + */ > + > +/** > + * Level 0, It basically stands for the innermost encapsulation level RSS > + * can be performed on according to PMD and device capabilities. > + */ > +#define ETH_RSS_LEVEL_INNER (0ULL << 50) > +/** > + * Level 1, It basically stands for the outermost encapsulation level RSS > + * can be performed on according to PMD and device capabilities. > + */ > +#define ETH_RSS_LEVEL_OUTER (1ULL << 50) > +/** > + * Level 2, It basically stands for the both inner and outermost > + * encapsulation level RSS can be performed on according to PMD and > + * device capabilities. > + */ > +#define ETH_RSS_LEVEL_INNER_OUTER (2ULL << 50) > +#define ETH_RSS_LEVEL_MASK (3ULL << 50) > + > +#define ETH_RSS_LEVEL(rss_hf) ((rss_hf & ETH_RSS_LEVEL_MASK) >> 50) > + > /** > * For input set change of hash filter, if SRC_ONLY and DST_ONLY of > * the same level are used simultaneously, it is the same case as > -- > 2.25.1 > >