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 DEB20A0C44; Tue, 15 Jun 2021 16:39:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C91DA4067A; Tue, 15 Jun 2021 16:39:00 +0200 (CEST) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by mails.dpdk.org (Postfix) with ESMTP id 3A19040140 for ; Tue, 15 Jun 2021 16:38:59 +0200 (CEST) Received: by mail-io1-f48.google.com with SMTP id a6so43722040ioe.0 for ; Tue, 15 Jun 2021 07:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zsJ0AdyZTfT2jvjWMOspsfmCLdU82zm5tR4b08GpidE=; b=aJeUhJKpTX8acbsZPsvSidJAIdJu+RLP0pL4D3LBiPhk+PTjP2CBfGKT0sKKs+sZCG TCkUMy1xIjz+IbgL9wmI1wpP5MV9h/GhQN2iE63qULbW5KUtCfpv9YTlBRXi7KNlbW82 cvLmL61L9wLo6Pbch4vQtjACzBedhBHhot9Li+7T/6ii1ZQ79+OfqeLF6TOLuGcy0Wzv G2PAZfq57pybZZlsTtwg3z20KZcUkqzRf9zZ8UxJRXFN1e0bDbES2TiWBjgwmFQheu8P jKAg1g26YBbr2Ph+LMEP7ddb3KECpuganzJ0blUXPByyq523ar+lS/inhqyFxxFTNav4 ah3w== 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=zsJ0AdyZTfT2jvjWMOspsfmCLdU82zm5tR4b08GpidE=; b=WA9IAGz5Pod21ZjMEm8Uqc5Mu08XzyBNBvkaYqLGjEAnlAs/I93fhXDiXN/XsqnJuh 5EohBCV590J79LA9u65kMwD/QIfGARL6JfdIj5Z/3/NL1r19nuymOIblddISzrYQ3wRt JcCCVAHmjLf8GvzT5LvJJz1FqLu5Q5oF1+ZEk7KUXi2JTU03ixSJSbUgXX0+FcyPn6rw z2F6ObvbM+w+J5FieBNI5m7yGiRQlcrBmYt/MMWfXvomf+5uX1q+4kLq/FjaXWmTCoqW eLmKycBgYe3yjVSCmj7jHl3qZxiP0Voe1uieYjVQ590Ekw8v+cI54uX7rVgHrH7e3fN2 siUw== X-Gm-Message-State: AOAM533TzqkxOvrDUqfWcy+EejEdBVkkjlY7tNfDhjuK9cD8dyJtCu8g kjZz67XSY8gpZwq36Q+FyrdA/wyZVzDER13sedc= X-Google-Smtp-Source: ABdhPJwzulbTMB1MVpWhHrGBKUts3zRCMNlOISo4qWW+VnjykJ7XVvpgVWv+VUyBWUcJzAa5iJVkoYQnRk9INKe6OjI= X-Received: by 2002:a6b:3e88:: with SMTP id l130mr18265038ioa.59.1623767938516; Tue, 15 Jun 2021 07:38:58 -0700 (PDT) MIME-Version: 1.0 References: <20210306153404.10781-1-ndabilpuram@marvell.com> <20210607175943.31690-1-ndabilpuram@marvell.com> <20210607175943.31690-54-ndabilpuram@marvell.com> In-Reply-To: <20210607175943.31690-54-ndabilpuram@marvell.com> From: Jerin Jacob Date: Tue, 15 Jun 2021 20:08:42 +0530 Message-ID: To: Nithin Dabilpuram Cc: dpdk-dev , Jerin Jacob , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Pavan Nikhilesh , Kiran Kumar K , Satheesh Paul , Ashwin Sekhar Thalakalath Kottilveetil Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 53/62] net/cnxk: support for rss in rte_flow 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 Sender: "dev" On Mon, Jun 7, 2021 at 11:39 PM Nithin Dabilpuram wrote: > > From: Satheesh Paul > > Added support for rss action in rte_flow code based on ROC. > > Signed-off-by: Satheesh Paul > --- > drivers/net/cnxk/cnxk_rte_flow.c | 72 +++++++++++++++++++++++++++++++++++----- Looks like we missed updating doc/guides/nics/features/cnxk.ini for this rss action. > 1 file changed, 64 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/cnxk/cnxk_rte_flow.c b/drivers/net/cnxk/cnxk_rte_flow.c > index d0e7bdc..8486e9e 100644 > --- a/drivers/net/cnxk/cnxk_rte_flow.c > +++ b/drivers/net/cnxk/cnxk_rte_flow.c > @@ -4,15 +4,64 @@ > #include > > static int > -cnxk_map_actions(struct rte_eth_dev *dev, > +npc_rss_action_validate(struct rte_eth_dev *dev, > + const struct rte_flow_attr *attr, > + const struct rte_flow_action *act) > +{ > + const struct rte_flow_action_rss *rss; > + > + rss = (const struct rte_flow_action_rss *)act->conf; > + > + if (attr->egress) { > + plt_err("No support of RSS in egress"); > + return -EINVAL; > + } > + > + if (dev->data->dev_conf.rxmode.mq_mode != ETH_MQ_RX_RSS) { > + plt_err("multi-queue mode is disabled"); > + return -ENOTSUP; > + } > + > + if (!rss || !rss->queue_num) { > + plt_err("no valid queues"); > + return -EINVAL; > + } > + > + if (rss->func != RTE_ETH_HASH_FUNCTION_DEFAULT) { > + plt_err("non-default RSS hash functions are not supported"); > + return -ENOTSUP; > + } > + > + if (rss->key_len && rss->key_len > ROC_NIX_RSS_KEY_LEN) { > + plt_err("RSS hash key too large"); > + return -ENOTSUP; > + } > + > + return 0; > +} > + > +static void > +npc_rss_flowkey_get(struct cnxk_eth_dev *dev, > + const struct roc_npc_action *rss_action, > + uint32_t *flowkey_cfg) > +{ > + const struct roc_npc_action_rss *rss; > + > + rss = (const struct roc_npc_action_rss *)rss_action->conf; > + > + *flowkey_cfg = cnxk_rss_ethdev_to_nix(dev, rss->types, rss->level); > +} > + > +static int > +cnxk_map_actions(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, > const struct rte_flow_action actions[], > - struct roc_npc_action in_actions[]) > + struct roc_npc_action in_actions[], uint32_t *flowkey_cfg) > { > struct cnxk_eth_dev *hw = dev->data->dev_private; > const struct rte_flow_action_count *act_count; > const struct rte_flow_action_queue *act_q; > + int i = 0, rc = 0; > int rq; > - int i = 0; > > RTE_SET_USED(hw); > > @@ -68,7 +117,12 @@ cnxk_map_actions(struct rte_eth_dev *dev, > break; > > case RTE_FLOW_ACTION_TYPE_RSS: > + rc = npc_rss_action_validate(dev, attr, actions); > + if (rc) > + goto err_exit; > in_actions[i].type = ROC_NPC_ACTION_TYPE_RSS; > + in_actions[i].conf = actions->conf; > + npc_rss_flowkey_get(hw, &in_actions[i], flowkey_cfg); > break; > > case RTE_FLOW_ACTION_TYPE_SECURITY: > @@ -94,7 +148,7 @@ cnxk_map_flow_data(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, > const struct rte_flow_action actions[], > struct roc_npc_attr *in_attr, > struct roc_npc_item_info in_pattern[], > - struct roc_npc_action in_actions[]) > + struct roc_npc_action in_actions[], uint32_t *flowkey_cfg) > { > int i = 0; > > @@ -113,7 +167,7 @@ cnxk_map_flow_data(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, > } > in_pattern[i].type = ROC_NPC_ITEM_TYPE_END; > > - return cnxk_map_actions(dev, actions, in_actions); > + return cnxk_map_actions(dev, attr, actions, in_actions, flowkey_cfg); > } > > static int > @@ -128,12 +182,13 @@ cnxk_flow_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, > struct roc_npc *npc = &hw->npc; > struct roc_npc_attr in_attr; > struct roc_npc_flow flow; > + uint32_t flowkey_cfg = 0; > int rc; > > memset(&flow, 0, sizeof(flow)); > > rc = cnxk_map_flow_data(dev, attr, pattern, actions, &in_attr, > - in_pattern, in_actions); > + in_pattern, in_actions, &flowkey_cfg); > if (rc) { > rte_flow_error_set(error, 0, RTE_FLOW_ERROR_TYPE_ACTION_NUM, > NULL, "Failed to map flow data"); > @@ -155,11 +210,12 @@ cnxk_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, > struct roc_npc *npc = &hw->npc; > struct roc_npc_attr in_attr; > struct roc_npc_flow *flow; > - int errcode; > + int errcode = 0; > int rc; > > rc = cnxk_map_flow_data(dev, attr, pattern, actions, &in_attr, > - in_pattern, in_actions); > + in_pattern, in_actions, > + &npc->flowkey_cfg_state); > if (rc) { > rte_flow_error_set(error, 0, RTE_FLOW_ERROR_TYPE_ACTION_NUM, > NULL, "Failed to map flow data"); > -- > 2.8.4 >