From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 61BF25A29; Thu, 12 Jan 2017 11:08:51 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP; 12 Jan 2017 02:08:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,349,1477983600"; d="scan'208";a="48092785" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by orsmga004.jf.intel.com with ESMTP; 12 Jan 2017 02:08:49 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX109.ger.corp.intel.com ([169.254.13.44]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 10:08:48 +0000 From: "Iremonger, Bernard" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Wu, Jingjing" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API calling Thread-Index: AQHSa7UsMXEj69zzjU+lJx9SAm44+qEzEejQgAD3ioCAAJQpQA== Date: Thu, 12 Jan 2017 10:08:47 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C224D1D2E5@IRSMSX108.ger.corp.intel.com> References: <1484102853-53205-1-git-send-email-wenzhuo.lu@intel.com> <8CEF83825BEC744B83065625E567D7C224D1CB14@IRSMSX108.ger.corp.intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B55864B@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B55864B@shsmsx102.ccr.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTdlMjgzYjAtZGVlYi00MTA5LWE0MmItYjI3ZjFmZDg4NjQ2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ3S3RsNU1Ga1wvRVZTRzdsaEdzSjFnNXVwRU9jUGhXOVwvSEpoek1QT2pcL2djPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API calling X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 10:08:52 -0000 Hi Wenzhuo, > -----Original Message----- > From: Lu, Wenzhuo > Sent: Thursday, January 12, 2017 1:09 AM > To: Iremonger, Bernard ; dev@dpdk.org > Cc: Wu, Jingjing ; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API callin= g >=20 > Hi Bernard, >=20 > > -----Original Message----- > > From: Iremonger, Bernard > > Sent: Wednesday, January 11, 2017 6:27 PM > > To: Lu, Wenzhuo; dev@dpdk.org > > Cc: Wu, Jingjing; stable@dpdk.org > > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API > > calling > > > > Hi Wenzhuo, > > > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > > > Sent: Wednesday, January 11, 2017 2:48 AM > > > To: dev@dpdk.org > > > Cc: Wu, Jingjing ; Lu, Wenzhuo > > > ; stable@dpdk.org > > > Subject: [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API > > > calling > > > > > > Some ixgbe private APIs are added to expose ixgbe specific functions. > > > When they're used by testpmd, there's no check for if the NICs are ix= gbe. > > > Other NICs also have chance to call these APIs. > > > This patch add the check and the feedback print. > > > > I am not sure that testpmd is the right place to do this. > > The rte_pmd_ixgbe_* functions are public API's which can be called by > > other applications. > > The checks should be in the rte_pmd_ixgbe_* API's > To be safer, it's better to add a check in the APIs. I have already sent a patch for ixgbe which Ferruh has reviewed and applied= to dpdk-next-net http://dpdk.org/dev/patchwork/patch/19151/ We should consider doing something similar for the i40e. > But the APIs is so called private API, not really public. Considering if= we have > the same function on different NICs, for example we have rte_pmd_ixgbe_a > and rte_pmd_i40e_a. > APP still need to call them one by one, like ret =3D rte_pmd_ixgbe_a; ret= =3D > rte_pmd_i40e_a; >=20 > then, why not add the check, like > If (NIC is ixgbe) > ret =3D rte_pmd_ixgbe_a; > if (NIC is i40e) > ret =3D rte_pmd_i40e_a; There is already code like the above in testpmd in cases where there is a c= hoice of rte_pmd_* functions to call. =20 > testpmd is an example to let the users to know how to use the APIs. They > should follow the example. > How about your opinion? In the case where there is no choice of function to make. There is no need = to check the NIC in testpmd (as it is now done in the rte_pmd_ixgbe_* API's= ). Regards, Bernard.