[dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API calling

Lu, Wenzhuo wenzhuo.lu at intel.com
Thu Jan 12 02:08:49 CET 2017


Hi Bernard,

> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Wednesday, January 11, 2017 6:27 PM
> To: Lu, Wenzhuo; dev at dpdk.org
> Cc: Wu, Jingjing; stable at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] app/testpmd: fix ixgbe private API calling
> 
> Hi Wenzhuo,
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wenzhuo Lu
> > Sent: Wednesday, January 11, 2017 2:48 AM
> > To: dev at dpdk.org
> > Cc: Wu, Jingjing <jingjing.wu at intel.com>; Lu, Wenzhuo
> > <wenzhuo.lu at intel.com>; stable at 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 ixgbe.
> > 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. 
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 = rte_pmd_ixgbe_a;
ret = rte_pmd_i40e_a;

then, why not add the check, like
If (NIC is ixgbe)
	ret = rte_pmd_ixgbe_a;
if (NIC is i40e)
	ret = rte_pmd_i40e_a;

testpmd is an example to let the users to know how to use the APIs. They should follow the example.
How about your opinion?


More information about the dev mailing list