From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhang, Qi Z" Subject: Re: [PATCH] app/testpmd: fix little perf drop with XL710 Date: Tue, 10 Jul 2018 04:31:13 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153257B27@SHSMSX103.ccr.corp.intel.com> References: <1531189709-312497-1-git-send-email-xiaoyun.li@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Li, Xiaoyun" , "stable@dpdk.org" To: "Li, Xiaoyun" , "Lu, Wenzhuo" Return-path: In-Reply-To: <1531189709-312497-1-git-send-email-xiaoyun.li@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Xiaoyun: > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xiaoyun Li > Sent: Tuesday, July 10, 2018 10:28 AM > To: Lu, Wenzhuo > Cc: dev@dpdk.org; Li, Xiaoyun ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] app/testpmd: fix little perf drop with XL710 >=20 > 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 por= t > indexes in testpmd, which is updated with ethdev events. >=20 > Fixes: 8728ccf37615 ("fix ethdev ports enumeration") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiaoyun Li > --- <...> > @@ -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 wh= en a hardware hotplug happen. > { > + portid_t port_id; > + uint16_t i; > + > if (type >=3D RTE_DEV_EVENT_MAX) { > fprintf(stderr, "%s called upon invalid event %d\n", > __func__, type); > fflush(stderr); > } >=20 > + 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 <...>