From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA75EA0548; Tue, 27 Apr 2021 14:23:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AB8D40150; Tue, 27 Apr 2021 14:23:11 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 6F4914014E for ; Tue, 27 Apr 2021 14:23:09 +0200 (CEST) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FV16k5tyszPtDP; Tue, 27 Apr 2021 20:19:58 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Tue, 27 Apr 2021 20:23:00 +0800 To: "Iremonger, Bernard" , Thomas Monjalon CC: "dev@dpdk.org" , "Yigit, Ferruh" , "Kantecki, Tomasz" , "Richardson, Bruce" , "Burakov, Anatoly" , "david.marchand@redhat.com" References: <1616830818-3127-1-git-send-email-humin29@huawei.com> <1675114.mf6Gbu22uX@thomas> <7cd793c6-7a1e-f3dd-cf53-9b399ca03068@huawei.com> <7295111.aNunrXP4Or@thomas> From: "Min Hu (Connor)" Message-ID: <0d828361-15ae-6bb4-4d70-f25543b37f90@huawei.com> Date: Tue, 27 Apr 2021 20:23:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ÔÚ 2021/4/27 19:51, Iremonger, Bernard дµÀ: > Hi Min, > >> -----Original Message----- >> From: Thomas Monjalon >> Sent: Tuesday, April 20, 2021 10:41 AM >> To: Min Hu (Connor) >> Cc: dev@dpdk.org; Yigit, Ferruh ; Iremonger, >> Bernard ; Kantecki, Tomasz >> ; Richardson, Bruce >> ; Burakov, Anatoly >> ; david.marchand@redhat.com >> Subject: Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of >> port and core >> >> 20/04/2021 04:26, Min Hu (Connor): >>> 2021/4/20 9:08, Thomas Monjalon: >>>> 27/03/2021 08:40, Min Hu (Connor): >>>>> fix check of port and core in flow_classify example. >>>>> >>>>> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample >>>>> application") >>>>> Cc: stable@dpdk.org >>>>> >>>>> Signed-off-by: Min Hu (Connor) >>>>> --- >>>>> RTE_ETH_FOREACH_DEV(port) >>>>> - if (rte_eth_dev_socket_id(port) > 0 && >>>>> + if (rte_eth_dev_socket_id(port) >= 0 && > > This fix works (I have tested it on my system) > However a cleaner fix would be to drop the above line and add the if on the next line instead (also tested on my system). > Hi, 'rte_eth_dev_socket_id(port)' may return -1, we should avoid this situation. > If (rte_eth_dev_socket_id(port) != (int)rte_socket_id()) > >>>>> rte_eth_dev_socket_id(port) != (int)rte_socket_id()) >> { >>>>> printf("\n\n"); >>>>> printf("WARNING: port %u is on remote NUMA >> node\n", >>>> >>>> Please explain which case is broken and why. >>>> If I understand well, we don't detect remote NUMA if not running on first >> socket. >>>> >>> Hi, the code is this: >>> >> ********************************************************** >> *************** >>> /* >>> * Check that the port is on the same NUMA node as the polling >> thread >>> * for best performance. >>> */ >>> RTE_ETH_FOREACH_DEV(port) >>> if (rte_eth_dev_socket_id(port) > 0 && >>> rte_eth_dev_socket_id(port) != (int)rte_socket_id()) >> { >>> printf("\n\n"); >>> printf("WARNING: port %u is on remote NUMA >> node\n", >>> port); >>> printf("to polling thread.\n"); >>> printf("Performance will not be optimal.\n"); >>> } >>> printf("\nCore %u forwarding packets. ", rte_lcore_id()); >>> printf("[Ctrl+C to quit]\n"); >>> >> ********************************************************** >> ************ >>> *** >>> >>> According to the comments and logging, the author just hope user to >>> use the core and device which are in the same numa node for optimal >>> performance. If not, A warning gives out. >>> >>> For example in flow_classify: >>> ./build/flow_classify -w 0000:7d:00.1 -l 93 >>> Here: >>> 0000:7d:00.1 is on numa node 0. >>> core 93 is on numa node 3. >>> >>> the two are not in same numa node, but no warning gives out in old codes. >>> >>> Well, using this patch, we can get the waring. >> >> You need to explain which case was broken in the commit log. >> Thanks >> >> > Regards, > > Bernard. > . >