[dpdk-dev] [PATCH] app/testpmd: fix little perf drop with XL710

Zhang, Qi Z qi.z.zhang at intel.com
Tue Jul 10 06:31:13 CEST 2018


Hi Xiaoyun:

> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Xiaoyun Li
> Sent: Tuesday, July 10, 2018 10:28 AM
> To: Lu, Wenzhuo <wenzhuo.lu at intel.com>
> Cc: dev at dpdk.org; Li, Xiaoyun <xiaoyun.li at intel.com>; stable at dpdk.org
> Subject: [dpdk-dev] [PATCH] app/testpmd: fix little perf drop with XL710
> 
> There is about 1.8M perf drop with XL710. And it is because of a bitrate
> calculation in the datapath. So improve it by maintaining an array of port
> indexes in testpmd, which is updated with ethdev events.
> 
> Fixes: 8728ccf37615 ("fix ethdev ports enumeration")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Xiaoyun Li <xiaoyun.li at intel.com>
> ---
<...>

> @@ -2196,16 +2199,31 @@ static void
>  eth_dev_event_callback(char *device_name, enum rte_dev_event_type type,
>  			     __rte_unused void *arg)

Do we also need to update ports_ids when user attach or detach a port from command line? (see function attach_port and detach_port).
I think eth_dev_event_callback is only for the case to handle udev event when a hardware hotplug happen.


>  {
> +	portid_t port_id;
> +	uint16_t i;
> +
>  	if (type >= RTE_DEV_EVENT_MAX) {
>  		fprintf(stderr, "%s called upon invalid event %d\n",
>  			__func__, type);
>  		fflush(stderr);
>  	}
> 
> +	rte_eth_dev_get_port_by_name(device_name, &port_id);

It's better to check the return value to make sure we get a valid port_id.

Regards
Qi

<...>


More information about the dev mailing list