From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 74D955F44; Tue, 10 Jul 2018 06:31:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2018 21:31:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,332,1526367600"; d="scan'208";a="73538403" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 09 Jul 2018 21:31:16 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Jul 2018 21:31:15 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Jul 2018 21:31:15 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.100]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.173]) with mapi id 14.03.0319.002; Tue, 10 Jul 2018 12:31:13 +0800 From: "Zhang, Qi Z" To: "Li, Xiaoyun" , "Lu, Wenzhuo" CC: "dev@dpdk.org" , "Li, Xiaoyun" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix little perf drop with XL710 Thread-Index: AQHUF/ajXV8NW0cOrEOO+GFrHub/paSH2KmQ 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> In-Reply-To: <1531189709-312497-1-git-send-email-xiaoyun.li@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmQ3MzQxNDEtZmI0NC00ODRmLTg0ZTEtYzM5OGFjZWMxNDg1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieTJpVTdRYjExejF0alR5XC9kQ203QVE3WlpFMGxEeFB3eUFET0JiNTR0dEtMMXNzMklaQ1I5Um0xXC9ZVGhcL0xtKyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action 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 little perf drop with XL710 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: Tue, 10 Jul 2018 04:31:29 -0000 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 <...>