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 4513DA0C43; Thu, 21 Oct 2021 19:04:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C49CB40683; Thu, 21 Oct 2021 19:04:18 +0200 (CEST) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by mails.dpdk.org (Postfix) with ESMTP id AF3E74003E for ; Thu, 21 Oct 2021 19:04:17 +0200 (CEST) Received: by mail-io1-f46.google.com with SMTP id p142so1997630iod.0 for ; Thu, 21 Oct 2021 10:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y7OXvjJIrLPtdTfq4FgGpQczk0zZ50Au48NEfVNGqJM=; b=BA9kMsRAsWhm0ydomipiUtx7Kg7Z9cS5/J1AGniDToigL9w9tt7ihaxykciO8s4BZh 3hAj74DccVnpoiwHVKHoUopPxeH07ElQrSdB1EYgCHVXjpU+36R81BrqKmXA7Dc6RCvd LGvO7A15O0su12BqGt53vq7Nw1MI7fyCf6HE6NEyRXHTBzTlNyRQTTgTP/ikiB8L2Dxn +HSaE0l5IGEManIz+33pA2e1ZO031Ru1lHynOvJd/rbOqYgRLCkizR2+Nhf35f+Tz2Ay Bew5b2MRj5I3qZ9mqlUyYmmwpr2fFPzs9d1lAbehJhhwft2ol6A1Q4ceetDYgDMeUWmY Fs8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y7OXvjJIrLPtdTfq4FgGpQczk0zZ50Au48NEfVNGqJM=; b=duK0e5eOseP1H9UDhL955yqfoYWOvr+qAf0q/V6+dfNAL2svTYEoESclDXpgAQr5ay PZuIJTuM12lGCYfz+rDM6SCtpcjGhNXdEJlMktiFipACZiJ5MJl2y4n+8u8Rr0OCbF+Q vxUG+AnLbbcwUFauCmWcW8imUg6qlA8mMwLma2nb3pnLVNo9KCn6R3kZBeX/Ivc8c2R8 UwQmFKfKtf9Plmdho8DpBqh2Zm0q3rzPC+re0esRpIyiVW2c5AEvjaHLtc6KisYe96RW 7w5lA3r/sK86ZvtJbPPmjpVJd2nnrKqF9fJ2D/ci81b1HtSeA6Vq5m5TYHTJ422KKEUu EWkA== X-Gm-Message-State: AOAM533PERb9vgJX75Wo5oHIYBGysSwmckQI7T8UW1I/0pZesrIqS7IE xAc1g3VvGa0ExhEe6BpS6brtHDW9xLEIzw4gpoI= X-Google-Smtp-Source: ABdhPJywm7WvSC8S2YZpCoc8kPZtP7RVdAyseUqCclfl5fWCQwDayRk6u7wFQ+INsicMQMFKLXDcODfXK1OCANbGGq4= X-Received: by 2002:a6b:102:: with SMTP id 2mr4842027iob.185.1634835857039; Thu, 21 Oct 2021 10:04:17 -0700 (PDT) MIME-Version: 1.0 References: <20211005033026.4180257-1-psatheesh@marvell.com> <20211021051115.1473189-1-psatheesh@marvell.com> <20211021051115.1473189-2-psatheesh@marvell.com> In-Reply-To: <20211021051115.1473189-2-psatheesh@marvell.com> From: Jerin Jacob Date: Thu, 21 Oct 2021 22:33:50 +0530 Message-ID: To: Satheesh Paul , Ferruh Yigit Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 2/2] net/cnxk: support rte flow action type port ID 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 Thu, Oct 21, 2021 at 10:41 AM wrote: > > From: Satheesh Paul > > This patch adds support for rte flow action type port_id to > enable directing packets from an input port PF to an output > port which is a VF of the input port PF. > > Signed-off-by: Satheesh Paul Series Acked-by: Jerin Jacob Series applied to dpdk-next-net-mrvl/for-next-net. Thanks. > --- > doc/guides/nics/cnxk.rst | 5 +++++ > doc/guides/nics/features/cnxk.ini | 1 + > drivers/net/cnxk/cnxk_rte_flow.c | 36 +++++++++++++++++++++++++++++++ > 3 files changed, 42 insertions(+) > > diff --git a/doc/guides/nics/cnxk.rst b/doc/guides/nics/cnxk.rst > index d3d9682501..05c66d94b1 100644 > --- a/doc/guides/nics/cnxk.rst > +++ b/doc/guides/nics/cnxk.rst > @@ -305,6 +305,11 @@ RTE flow GRE support > - ``RTE_FLOW_ITEM_TYPE_GRE_KEY`` works only when checksum and routing > bits in the GRE header are equal to 0. > > +RTE flow action port_id support > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +- ``RTE_FLOW_ACTION_TYPE_PORT_ID`` is only supported between PF and its VFs. > + > Custom protocols supported in RTE Flow > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini > index f0586457ca..03af0da302 100644 > --- a/doc/guides/nics/features/cnxk.ini > +++ b/doc/guides/nics/features/cnxk.ini > @@ -85,6 +85,7 @@ of_push_vlan = Y > of_set_vlan_pcp = Y > of_set_vlan_vid = Y > pf = Y > +port_id = Y > queue = Y > rss = Y > security = Y > diff --git a/drivers/net/cnxk/cnxk_rte_flow.c b/drivers/net/cnxk/cnxk_rte_flow.c > index ad89a2e105..dfc33ba865 100644 > --- a/drivers/net/cnxk/cnxk_rte_flow.c > +++ b/drivers/net/cnxk/cnxk_rte_flow.c > @@ -110,7 +110,13 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr, > struct roc_npc_action in_actions[], uint32_t *flowkey_cfg) > { > struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); > + const struct rte_flow_action_port_id *port_act; > const struct rte_flow_action_queue *act_q; > + struct roc_npc *roc_npc_src = &dev->npc; > + struct rte_eth_dev *portid_eth_dev; > + char if_name[RTE_ETH_NAME_MAX_LEN]; > + struct cnxk_eth_dev *hw_dst; > + struct roc_npc *roc_npc_dst; > int i = 0, rc = 0; > int rq; > > @@ -146,6 +152,36 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr, > in_actions[i].conf = actions->conf; > break; > > + case RTE_FLOW_ACTION_TYPE_PORT_ID: > + in_actions[i].type = ROC_NPC_ACTION_TYPE_PORT_ID; > + in_actions[i].conf = actions->conf; > + port_act = (const struct rte_flow_action_port_id *) > + actions->conf; > + if (rte_eth_dev_get_name_by_port(port_act->id, > + if_name)) { > + plt_err("Name not found for output port id"); > + goto err_exit; > + } > + portid_eth_dev = rte_eth_dev_allocated(if_name); > + if (!portid_eth_dev) { > + plt_err("eth_dev not found for output port id"); > + goto err_exit; > + } > + if (strcmp(portid_eth_dev->device->driver->name, > + eth_dev->device->driver->name) != 0) { > + plt_err("Output port not under same driver"); > + goto err_exit; > + } > + hw_dst = portid_eth_dev->data->dev_private; > + roc_npc_dst = &hw_dst->npc; > + > + rc = roc_npc_validate_portid_action(roc_npc_src, > + roc_npc_dst); > + > + if (rc) > + goto err_exit; > + break; > + > case RTE_FLOW_ACTION_TYPE_QUEUE: > act_q = (const struct rte_flow_action_queue *) > actions->conf; > -- > 2.25.4 >