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 C5429423F0; Mon, 16 Jan 2023 14:15:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9BF440691; Mon, 16 Jan 2023 14:15:33 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2053.outbound.protection.outlook.com [40.107.92.53]) by mails.dpdk.org (Postfix) with ESMTP id 8DB4C40042 for ; Mon, 16 Jan 2023 14:15:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mN3qEHcaScy4h5uRNzek0AKX/6kGQBBXjtqZF2bJSOVq9drrle5t3G2FT2/qMcaBfhXzxx+5nAgnFM17fyI5x52pxFM3A73f7IbYCwnZ0QZnWH2HddS9DcdYiNWYvZ2gKvdnRnuf8cEj4mLmSbOpA48iofgs1RyXxaPZhBNCEu0O1qJ3yDAqI2zyCCSG+WRc5mDB1suX2D+yJCe5TdThLv9ZhSFP56buYXqITNqCqNOWb6BFGRzGUB3l0X/LLvsuRxcPmVZTgl/5zfjKPp61DPR5k/BPU5G9HTi2qocf+srerTM/b8bNJ+eNpedit4iVDnonNwL+fqk3t64Z5UIBmg== 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=n4SRKZPO4gRF6C6B+dvUMsDai9RRThzRc4uDP6Q0heU=; b=PwWan94wcgv0xpz1aC47CUwL7Gb9+cN2VlQ6BRRsg9I8OjzFJX2ZF0fXokSRpPQnwLJjuQPgL5Tg3NA29ZeEQX+mQrGb0DInTqAwjqLOmSz/vIk4MNhVnm1VaT1OIftxmE3NzEj9Hpz9aFa7ES2wEwUxzlsYXoSf5e1DUzjS9grPW12pWArRjV6eyupF6+xINTCjvhseriGcjw7IzkZQ4UgfpEIg7C9HrySKEA/52uhKcmviLsJQxnmgWXQXr9Tb0aZQ/dGGY/nCL57KL/wjgzqBj0uof1gEELtM6x6hddoLjnVChil9kzzupeM09OFoWmeKlO2DuiJwALmdSqH9OA== 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=n4SRKZPO4gRF6C6B+dvUMsDai9RRThzRc4uDP6Q0heU=; b=Mq3kXYrScAUFOEPZbJdPD37TR9u5/xtTbYR2ZAweWpiQvTAtmuzPo2BpLwGVzF0165GDjxEQ+qQ02V5vuU2HAOR445akeXm39qSsDPFa2UHl/Wmh69fvJ71IgElOuwdsCfsFBE3384LSuPQs4LurTX9hK/r19NRcH2zi447lcR4= 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 SJ2PR12MB7868.namprd12.prod.outlook.com (2603:10b6:a03:4cd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Mon, 16 Jan 2023 13:15:30 +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; Mon, 16 Jan 2023 13:15:30 +0000 Message-ID: Date: Mon, 16 Jan 2023 13:15:25 +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: Frank Du , Ciara Loftus References: <20221212004857.2004805-1-frank.du@intel.com> Cc: dev@dpdk.org From: Ferruh Yigit In-Reply-To: <20221212004857.2004805-1-frank.du@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P123CA0032.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600::20) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ2PR12MB7868:EE_ X-MS-Office365-Filtering-Correlation-Id: eccf4ccd-99df-44dd-6e5d-08daf7c3bded X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m/sLh6TQQ37xfjOLzToBPGz+rauZMUTnswFYPM0IRqlrmigZ3JTuQyJTqhqDrqhGs1V6ejtCKtbgZE+epxZjsNVZXSG1PZyOtXpfYxenGnmsvYaWn0dDJcXUpcx2kQPzlPhgV2xxfmU8rSeVK04FCwXDs9Oe+6rdZ8j4WjG1EPCAxLHPVu4oVCSDytB+7IDeHzfn+NeWUrJ0fk8aKu/E/pi03mw5mQz6wN0WONBbVHJg1nnAZ/RvJuMYPv7gTFfMBOK6wtCcQbt1T0Cz8BvG4owci6TdwwRd5zWcf3nQ8/hTDFHq3AA7XwggD1BKvsnY0V+tRNHW8WQNpC4qIXsa3LetJnJiiaQdSPRTUkKIUntThLrtw93SfYbwHPauobyLc3Ivk32KXMrPejz7+4XQUj2ukNPU46YCCf4cHelBYl9HhkjK/xBRSSX+SNy0/hj8n1PFSkc5aejtYXrok7Uh1yu31fCNUZyMIJTZbGyoZlt0Ug95Fm2WkXBwRfZn0Ct5lB9UuDrgV526FpaKX0A45F2ybqwsgIMiESAgAhXXeXeNhwdg1PO7dt54pFAR5Da/DAJhTxfY7/k8tNVX/0F0SRCkVmV4daldPQNB7iad5KTyXu0S6NhrUqd2Hbt8/pon/GB6ncaWn2YLVqDZMLS/0awIlkZ39GccY8pu/RvVSVb60oPAN8Qx7p+KyRbhMSx9GgCEUnntgSsAxR4eRIwIc0Y9NV36WWe+h7FPX91etOE8j2MfOn3Lp0ULFXM4Px8qQrROHwKpbwNB/lmW4g0dNRl3A+/DdRklhSyoggIQ060= 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)(376002)(346002)(39860400002)(366004)(136003)(396003)(451199015)(31686004)(36756003)(86362001)(4326008)(8936002)(31696002)(8676002)(66556008)(66946007)(66476007)(44832011)(2906002)(83380400001)(38100700002)(5660300002)(110136005)(316002)(6666004)(6486002)(41300700001)(478600001)(2616005)(53546011)(6512007)(26005)(186003)(6506007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?STN1RWExUzF4eTF4QUJsL21YRDk3WU1FU0dRMC9qcGFsMWhGeVg2K3MyUWZO?= =?utf-8?B?MTZ1allJaDErOEhxU29MTXB5eHVWSWIwbHYzcnk3aGtFeUgyS2xrdDdyYjFN?= =?utf-8?B?bjhYRWVqNTNtRmZwUjFlbEhmUHhzRkc2L2ppY1lQcWZnak1aQW12RlFlNUhO?= =?utf-8?B?ZmJqOFYwNEgyY0czL1Z0MHE0RCtEM043SXNSUU0vUk9sTmdaKzA0RUhTMlRT?= =?utf-8?B?LzRZc2NsdUJtVVJ1SThqMWk0WmlvdGp6S2JHVDhzMUx0bHlrTzRtKzFnT09K?= =?utf-8?B?QU9VSEVQRUJOS2RyMUI5V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dLdEQxY0FtajZx?= =?utf-8?Q?5Jv1NlPVA/rcJpt6OAmsUw3CC?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: eccf4ccd-99df-44dd-6e5d-08daf7c3bded X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 13:15:30.5983 (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: Wz2/fo9fNujRbrnz7KrEexYkk5vih0twuYYa43ntJ74K4z9StZinyJFUBH0Ww6BX X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7868 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 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? Thanks, ferruh