Hi Xiaoyun:

> -----Original Message-----
> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Xiaoyun Li
> Sent: Tuesday, July 10, 2018 10:28 AM
> To: Lu, Wenzhuo <wenzhuo...@intel.com>
> Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun...@intel.com>; sta...@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: sta...@dpdk.org
> 
> Signed-off-by: Xiaoyun Li <xiaoyun...@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

<...>

Reply via email to