From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2017 03:38:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,413,1491289200"; d="scan'208";a="92542237" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.81]) ([10.237.220.81]) by orsmga004.jf.intel.com with ESMTP; 29 May 2017 03:38:44 -0700 To: Radu Nicolau , dev@dpdk.org References: <1495809036-29625-1-git-send-email-radu.nicolau@intel.com> From: Ferruh Yigit Message-ID: Date: Mon, 29 May 2017 11:38:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1495809036-29625-1-git-send-email-radu.nicolau@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] ethdev: moved bypass functions to ixgbe pmd 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, 29 May 2017 10:38:46 -0000 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; > +} <...>