From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5754A11C5; Thu, 12 Jan 2017 02:08:58 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP; 11 Jan 2017 17:08:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,347,1477983600"; d="scan'208";a="52246498" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 11 Jan 2017 17:08:58 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 17:08:58 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 17:08:57 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 09:08:49 +0800 From: "Lu, Wenzhuo" To: "Iremonger, Bernard" , "dev@dpdk.org" CC: "Wu, Jingjing" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API calling Thread-Index: AQHSa7UeEyFzOkmFNUGWYL1o73t2U6EyjQsAgAF1dlA= Date: Thu, 12 Jan 2017 01:08:49 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B55864B@shsmsx102.ccr.corp.intel.com> References: <1484102853-53205-1-git-send-email-wenzhuo.lu@intel.com> <8CEF83825BEC744B83065625E567D7C224D1CB14@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C224D1CB14@IRSMSX108.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API calling 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: Thu, 12 Jan 2017 01:09:00 -0000 Hi Bernard, > -----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 callin= g >=20 > Hi Wenzhuo, >=20 >=20 > > -----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 ixgb= e. > > Other NICs also have chance to call these APIs. > > This patch add the check and the feedback print. >=20 > 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 oth= er > 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.=20 But the APIs is so called private API, not really public. Considering if w= e have the same function on different NICs, for example we have rte_pmd_ixg= be_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; 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; testpmd is an example to let the users to know how to use the APIs. They sh= ould follow the example. How about your opinion?