From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 059822661 for ; Mon, 13 Aug 2018 12:10:58 +0200 (CEST) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w7DAAArv008289; Mon, 13 Aug 2018 03:10:10 -0700 Date: Mon, 13 Aug 2018 15:38:18 +0530 From: Rahul Lakkireddy To: Jack Min Cc: "dev@dpdk.org" , Shahaf Shuler , "Xueming(Steven) Li" , Thomas Monjalon , Adrien Mazarguil , shaguna@chelsio.com, indranil@chelsio.com, nirranjan@chelsio.com Message-ID: <20180813100756.GA20111@chelsio.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [RFC] ethdev: add generic MAC address rewrite actions 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: , X-List-Received-Date: Mon, 13 Aug 2018 10:10:59 -0000 On Tuesday, August 08/07/18, 2018 at 14:20:10 +0000, Jack Min wrote: > There is a need to offload rewrite MAC address for both destination and source > from the matched flow > > The proposed actions could make above easily achieved > +1. We're also looking to offload these actions. In addition, we also have a requirement to offload an action to swap the source and destination MAC addresses (i.e. source MAC address will get overwritten with the destination MAC address and vice-versa). Could you please add one more action RTE_FLOW_ACTION_TYPE_MAC_SWAP to achieve this? This action will not take any arguments. Let us know your thoughts. Thanks, Rahul > > Signed-off-by: Xiaoyu Min > > --- > lib/librte_ethdev/rte_flow.h | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index f8ba71cdb..4a51ab2a3 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -1505,6 +1505,26 @@ enum rte_flow_action_type { > * error. > */ > RTE_FLOW_ACTION_TYPE_NVGRE_DECAP, > + > + /** > + * Set source MAC address from matched flow. > + * > + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, > + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. > + * > + * See struct rte_flow_action_set_mac. > + */ > + RTE_FLOW_ACTION_TYPE_SET_MAC_SRC, > + > + /** > + * Set destination MAC address from matched flow. > + * > + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, > + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. > + * > + * See struct rte_flow_action_set_mac. > + */ > + RTE_FLOW_ACTION_TYPE_SET_MAC_DST, > }; > > /** > @@ -1868,6 +1888,18 @@ struct rte_flow_action_nvgre_encap { > struct rte_flow_item *definition; > }; > > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ACTION_TYPE_SET_MAC > + * > + * Set MAC address from the matched flow > + */ > +struct rte_flow_action_set_mac { > + uint8_t mac_addr[ETHER_ADDR_LEN]; > +}; > + > /* > * Definition of a single action. > * > -- > 2.17.1