From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] ethdev: moved bypass functions to ixgbe pmd Date: Mon, 29 May 2017 11:38:43 +0100 Message-ID: References: <1495809036-29625-1-git-send-email-radu.nicolau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Radu Nicolau , dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6C2672BB8 for ; Mon, 29 May 2017 12:38:46 +0200 (CEST) In-Reply-To: <1495809036-29625-1-git-send-email-radu.nicolau@intel.com> Content-Language: en-US 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 5/26/2017 3:30 PM, Radu Nicolau wrote: > Moved all bypass functions to ixgbe pmd and removed function > pointers from the eth_dev_ops struct. Hi Radu, Thanks for taking care of this, this was waiting for a while. > > Also cleared some checkpatch errors. > > Signed-off-by: Radu Nicolau <...> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 0afac68..66f9e63 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -523,7 +523,7 @@ static void cmd_help_long_parsed(void *parsed_result, > " Flush (default) or don't flush RX streams before" > " forwarding. Mainly used with PCAP drivers.\n\n" > > - #ifdef RTE_NIC_BYPASS > +#if defined(RTE_NIC_BYPASS) && defined(RTE_LIBRTE_IXGBE_PMD) What we did for other PMD specific API is: Enable commands always, do not disable them with compile time options, this is mostly to prevent different test paths. And move PMD specific #ifdefs into function, if the PMDs that support his feature are not enabled return not supported error. And if function called for port_id that doesn't support the function, again return not supported. > "set bypass mode (normal|bypass|isolate) (port_id)\n" > " Set the bypass mode for the lowest port on bypass enabled" > " NIC.\n\n" > @@ -3904,7 +3904,7 @@ cmdline_parse_inst_t cmd_set_link_check = { > }, > }; > <...> > diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c > index e8fc9a6..2b44a33 100644 > --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c > +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c > @@ -908,3 +908,110 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, > > return 0; > } > + > +#ifdef RTE_NIC_BYPASS > +int > +rte_pmd_ixgbe_bypass_init(uint8_t port_id) > +{ > + struct rte_eth_dev *dev; Should we add a check to all APIs if the port_id is ixgbe port_id? In case user provided a port_id of different NIC? > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + dev = &rte_eth_devices[port_id]; > + ixgbe_bypass_init(dev); > + return 0; > +} <...>