On Mon, Feb 7, 2022 at 1:01 PM Nithin Dabilpuram <ndabilpu...@marvell.com> wrote: > > From: Satha Rao <skotesh...@marvell.com> > > Added rx_metadata_negotiate api to enable mark update RX offload. > Removed software logic to enable/disable mark update inside flow > create/destroy apis.
APIs > Signed-off-by: Satha Rao <skotesh...@marvell.com> > --- > +static int > +cn10k_nix_rx_metadata_negotiate(struct rte_eth_dev *eth_dev, uint64_t > *features) > +{ > + struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); > + > + *features &= > + (RTE_ETH_RX_METADATA_USER_FLAG | > RTE_ETH_RX_METADATA_USER_MARK); > + > + if (*features) { > + dev->rx_offload_flags |= NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = true; > + } else { > + dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = false; > + } > + > + cn10k_eth_set_rx_function(eth_dev); > + > + return 0; > +} See below. > > +static int > +cn9k_nix_rx_metadata_negotiate(struct rte_eth_dev *eth_dev, uint64_t > *features) > +{ > + struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); > + > + *features &= > + (RTE_ETH_RX_METADATA_USER_FLAG | > RTE_ETH_RX_METADATA_USER_MARK); > + > + if (*features) { > + dev->rx_offload_flags |= NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = true; > + } else { > + dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = false; > + } > + > + cn9k_eth_set_rx_function(eth_dev); > + > + return 0; > +} > + The above two functions are duplicates, Please pass the function pointer and make it as one function for common code.