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 F254E423FB; Tue, 17 Jan 2023 10:13:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E5D3942D2C; Tue, 17 Jan 2023 10:13:51 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2087.outbound.protection.outlook.com [40.107.93.87]) by mails.dpdk.org (Postfix) with ESMTP id DDB3442D2A for ; Tue, 17 Jan 2023 10:13:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YZUBlZ0GFhT9v36yjYvw8KePwCbB5XAhi1/bKnLq8Xxl8VUQooE3AcvUJjz1JoGHciUUhBV7KVq/KlIeAd9K5qjeOm8NYB3dMCNTRtdFDHYsKZkLvTyijUvNcrIWM+I2zB51JT0eRRc27Jl2GdvSahdlZfZcJVgAD0P7aec8U9msSiEqViuA6YCn7Xjqr0UnUE5IkgjpHxOXnZplAb1z/gg1eBHJrHXHKTPPPlXbSbyry9BoFuc+S+Ah01qhLQNoAAhwLp2C3btBuqH4xaWR7mhNxM/PNwTur767qoUIxy8Wb/V/owa5ZgCi445mOiM+ghGxzRTgHSKFRWpmEa+3yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kwMVVoVWqqUTyDAwMSmY4Fjp3cbkryWhsEliGiW2A2M=; b=fCXo4j/3oqIyDX6wSM2H9xbYUC6dAFfWGUobVYTDXY9N7FQU6lZKB4VKy8jfdBN5rg8gZdzvPSiikIc6tUB6hBLpAqOFVY9wRxDUiVABIAD5N+mES/I8nc6YsZDF6V5I1czGS53ZHUEP6zkEsE1Y7P4iNhreTvr7Q78HRxotHQEBdc+sZA/LIbMwwAi6lvit/Og8YQHIUciZoUs0rfFni9rTJYE1eUfwNiUvhaUnZ62yuGw0Hk0eCqJiXsCC7xDo2AKMaBP2rRwQO/fjM6H3jm4QbPZrkF9xdZnWw5flgyN1y7XDWFjIGUyMaptnYOb0UwCjRdPTU1ycbYkZI752jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kwMVVoVWqqUTyDAwMSmY4Fjp3cbkryWhsEliGiW2A2M=; b=WRmygfqCF3ylOH8ajujXw6yAYCz5H0a7QGz0C03PlGbnTmPTwspbGoQbFHnk8jf13TzU67BIo/FyTeHnFv7Z/9gGEBzM0Hn453odWPrSnjyfCqRxmodqYdLORo6so0nhXV/cAzbE06oMznkBinPkRMr+oWDRa8gKOKdUunOP2mg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SJ0PR12MB5663.namprd12.prod.outlook.com (2603:10b6:a03:42a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 09:13:48 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%7]) with mapi id 15.20.5986.023; Tue, 17 Jan 2023 09:13:41 +0000 Message-ID: <1cfc600f-32c0-e839-87af-3587f9255ce5@amd.com> Date: Tue, 17 Jan 2023 09:13:35 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] net/af_xdp: parse numa node id from sysfs Content-Language: en-US To: "Du, Frank" , "Loftus, Ciara" Cc: "dev@dpdk.org" References: <20221212004857.2004805-1-frank.du@intel.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0114.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::30) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ0PR12MB5663:EE_ X-MS-Office365-Filtering-Correlation-Id: 17ab2f7d-bea0-4212-249f-08daf86b1ff6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cd+R0G8ZLNv9I0v6EwWfE7uALhyco+Bd2iUrVsQnnY0iyu/PEAk3oGILRiJh8nvcg75V+aqP+5CFUy6uXIfgHpUhUagGlYJmg0WLWqabnABTrdKkEzzVLYzuw6jbs/bDB7pGZzqflioikVo5d0ED5foHzWkzUJ8DCSv8LJHeYKMANz1V4xqAm2sLdPHbbhtoEtWVg7QnulrbKlRPY7x6fiG/9ENpv/UUv/79h1EhTlqrfmRUW/BcfYDQmV+NKBdIc6nXUNenk7w1NcYAMCadTpZgnZK2rG/gHpzw1jtgF4L5g4A6RLWuyiodUqjfnfqk7zqjWjhp3duFgG4jKj7imQOF+UGZ60ho1CYXou5dhWewvMn+mJRxAJtkL3mnmGWs04JKR5yLy5fZtFPiezr/BtnVdlPdVthMpwhL5CuG0n7U7y8o0ikwJDUVUOdlV5vuz7bNKveTDwXinSL7FWX481Ov68KGRMnJ7emmmtagTl7RASsZBWeSkyl0HOvfq2L1i2hpoQbQTHuJW6ehnjgmXk+nv8BrMlXfdB3C99C4ib9FJCbSmhOPWwto6KzBkrBinP2pyRByj3Zc7xV/iEI6Nmr2oAtQ1d+kI72M4r2oblGclR2VOA3C3RQ+W3nHOqQDr1Ni/ScfMpeMO8ZonyBkbc6azEi6cLU0jmf58dZl9TXyLO3VbXt4lhAojZUV1Q6DqVaO/rBo8TvnS5jY4aBZe0CpwieLh7jChlNtKdx7zcM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(376002)(366004)(136003)(39860400002)(451199015)(38100700002)(36756003)(31696002)(110136005)(186003)(26005)(478600001)(6512007)(86362001)(6486002)(2616005)(316002)(66946007)(31686004)(66556008)(5660300002)(44832011)(53546011)(2906002)(6506007)(83380400001)(8676002)(6666004)(8936002)(66476007)(4326008)(41300700001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b3Ivc3REQ0Q3MC9BM0tvYko4a0llQkVibEhGTmprVXBOUGNVTkplR2Zac3dZ?= =?utf-8?B?UzhXT3IrNjFiRGk1SEN6ZDBjOUsrRDVmQ04wdDR3ZGJpZXFTdTFpZS9QN211?= =?utf-8?B?ZnlnMmUvUkNhYXpHVWorZTNUR3VucURpYnFsNVRFUmVYNUlpNjlCbHkzZmdt?= =?utf-8?B?UjdLaWJOeURQZDJ5K1FGY3FwVTNMb3UvOGFMVUExV2JrK1M5MWxYN0h2SjEy?= =?utf-8?B?UHRvWEV3L0J1bVI5dzl2Wk5pcmtFamZNd2k3OEFsbWJnTTRUem5VQWx1Q1pO?= =?utf-8?B?RFgwd1krYzFDY2tROWpqTmZvZXl3aWlEQStQQTVGYXVLN1FLU0JqTFluU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edV7CQp428Zd5kcM?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17ab2f7d-bea0-4212-249f-08daf86b1ff6 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 09:13:40.9649 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RGBWRFA94D5dylHhIZ17vh7EOGo1ZKyVa7e1ggmoedbkim5ILSulMfKTOsOfI9wS X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5663 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 On 1/17/2023 1:35 AM, Du, Frank wrote: Moved down, please don't top post. >> >> -----Original Message----- >> From: Ferruh Yigit, >> Sent: Monday, January 16, 2023 9:15 PM >> To: Du, Frank ; Loftus, Ciara >> Cc: dev@dpdk.org >> Subject: Re: [PATCH] net/af_xdp: parse numa node id from sysfs >> >> On 12/12/2022 12:48 AM, Frank Du wrote: >>> Get from /sys/class/net/{if}/device/numa_node. >>> >>> Signed-off-by: Frank Du >>> --- >>> drivers/net/af_xdp/rte_eth_af_xdp.c | 17 ++++++++++++++--- >>> 1 file changed, 14 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c >>> b/drivers/net/af_xdp/rte_eth_af_xdp.c >>> index b6ec9bf490..38b9d36ab5 100644 >>> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c >>> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c >>> @@ -39,6 +39,7 @@ >>> #include >>> >>> #include "compat.h" >>> +#include "eal_filesystem.h" >>> >>> #ifndef SO_PREFER_BUSY_POLL >>> #define SO_PREFER_BUSY_POLL 69 >>> @@ -2038,9 +2039,6 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev) >>> return -EINVAL; >>> } >>> >>> - if (dev->device.numa_node == SOCKET_ID_ANY) >>> - dev->device.numa_node = rte_socket_id(); >>> - >>> if (parse_parameters(kvlist, if_name, &xsk_start_queue_idx, >>> &xsk_queue_cnt, &shared_umem, prog_path, >>> &busy_budget, &force_copy) < 0) { @@ -2053,6 +2051,19 @@ >>> rte_pmd_af_xdp_probe(struct rte_vdev_device *dev) >>> return -EINVAL; >>> } >>> >>> + /* get numa node id from net sysfs */ >>> + if (dev->device.numa_node == SOCKET_ID_ANY) { >>> + unsigned long numa = 0; >>> + char numa_path[PATH_MAX]; >>> + >>> + snprintf(numa_path, sizeof(numa_path), "/sys/class/net/%s/device/numa_node", >>> + if_name); >>> + if (eal_parse_sysfs_value(numa_path, &numa) != 0) >>> + dev->device.numa_node = rte_socket_id(); >>> + else >>> + dev->device.numa_node = numa; >>> + } >>> + >>> busy_budget = busy_budget == -1 ? ETH_AF_XDP_DFLT_BUSY_BUDGET : >>> busy_budget; >>> >> >> Hi Frank, >> >> It looks reasonable to set virtual DPDK af_xdp device socket to actual underlying device socket. And as I checked quickly, it works as expected. >> >> But what is the impact and motivation of the patch? In other words why you are doing this patch and what output you are expecting as a result? >> Did you able to do any performance testing, and are you observing any difference before and after this test? >> > > Hi ferruh, > > Our application use rte_eth_dev_socket_id to query the socket that a NIC port connected, then allocate lcore/memory according to this affinity. > > The remote memory access is really slow compared to local. > As you observing any performance gain after change? If so, how much?