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 6150A423FD; Tue, 17 Jan 2023 14:04:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53FB1400EF; Tue, 17 Jan 2023 14:04:00 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id E6377400D4 for ; Tue, 17 Jan 2023 14:03:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673960639; x=1705496639; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=esxPic4PvjKTWBD0A/BlLY0raPYQFin70ehIFzR6/4M=; b=PjVSTLx+9jwU9guVBB9KZHovt7VnJBiRbE70LUxIN4nnnEz6DeH+RIPa BbpRNx3QJPoW/JH5Vpe0YbCDqUz/ytPucoAXJ2SGA2DFg/Kpr7gKP3ZBV mdFqFLy+qzXitxzVESsxjn3xLR0wUmwlzfbgKjq7SMgGfx8sVt1aKXRqB yZNnrfgdmB2n1g2WQGbT0rKSrcn2yKZUjAbtPnhNMApKlQ8Z2jCqWwZ// w8KHtnWwH1p3BDjOUUEnEFJkMSrnBAv7Q7/3f6esKuC57BN5vaK5VHRC+ zg16y8c8BM+EIoY1zTrJdeT6wzhoh1SKPKCxabfIjGCK7RTWOfmKUL8nD g==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="389188335" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="389188335" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 05:03:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="988114439" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="988114439" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga005.fm.intel.com with ESMTP; 17 Jan 2023 05:03:57 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 17 Jan 2023 05:03:57 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 17 Jan 2023 05:03:57 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Tue, 17 Jan 2023 05:03:57 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.174) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Tue, 17 Jan 2023 05:03:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NUq8yd0DiqmHrwRaA7i7I4OPEpsdmhmIxxG1oYWGWTPygHdCKKsO2Ya/eqMBWXPU8S1QIcNWV5q/Yr8rJPletusGX0Ze4ZYPPDGTapWdogmZPypbaBtJa41Vl4nwwQsMHmg42WvpI8HjfVBSEgFB7jgCdByw90wCT6SQTKwDFCYGrYeThRmQL8DgzRrDQgoS6hFYckwLagvZvL620sHRWUH0xNWT+cmaRWKEJPw5W9f0yspkAGgoazgA+6cJmMoPxxRmiYFH6yiDeneB7Bl2QtuSrKr4ROpqv1nbfo+8i1ym6nK3+tKmeIWCkj8ZCdx21l6aIFy/PH/2kJS+IfbOfw== 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=PV9wri/E/Di6SWUa9bB1el7X1qN4scG5wdD+ae+lPgo=; b=fFcVyOlKYNRX5txcCbEN7svjecxrsvj5Yxbe1kcFgGTmJohPaP7R25MhPraNLT8OWBeIcvH3RDyQEXnWbk9NK7l/kokH6XBJEfi6jqr+yDLAF83hf9zIChOom6Em5fZQWn+xxSXwwb9pr9LjeLLJAtJDPCMmJN81YibGiSSwvizt/+dc0BC3mBoVhT9WAVYOgzF6ejBYDsJuwYOgnnulJK2oDB8TumRLWn55q/B31O4rrIHZQ2umOvSp9k2Uvabc0cK33xBJki3OJSOlwV/3OCVMLb2zMJjhG5q2qpBdeousRpvhCIy7sQ0RpZUXP6V53I6cGvNwRNvbKXrM6WmOMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by PH7PR11MB6860.namprd11.prod.outlook.com (2603:10b6:510:200::17) 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 13:03:54 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee%7]) with mapi id 15.20.5986.023; Tue, 17 Jan 2023 13:03:54 +0000 Date: Tue, 17 Jan 2023 13:03:47 +0000 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: Didier Pallard , Akhil Goyal , Fan Zhang , Olivier Matz , , Subject: Re: [RFC] Fix cryptodev socket id for devices on unknown NUMA node Message-ID: References: <20230117101646.2521875-1-didier.pallard@6wind.com> <98CBD80474FA8B44BF855DF32C47DC35D8767D@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D8767D@smartserver.smartshare.dk> X-ClientProxiedBy: LO4P123CA0060.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:153::11) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|PH7PR11MB6860:EE_ X-MS-Office365-Filtering-Correlation-Id: 31891d28-86a0-4e67-803b-08daf88b493c X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 19anOLOJvJcUr1HWMDxz83vwjnr82jFrzsQcMroEbOhyZkxofRllovVgYaDOr/OdTt2EJaMPkSXc7hx6s8gyxICO8olaP0OOHtllFjGFUSMPkCYjkl4nRFmRTNnNbqDkjIGg/R7ankaXKgumzMTPAjpqlBYrWJRO1WJ9KBjQX4OcRBDXD0hNSSvCfCXB7IKWwLcaklTvcf5NwHSkSLZVUPnixcOIP2NN/TTCADjYY2IwSVQlbiSrYCrxgaumPDq/t6p+mtx89JpftfBJ/RBvUlCTBO69FR4yl6N/kRRw9p4WpGnzcKGOSIEgUDQMca/a5kVwonftjtCTBavRqX/lJofFumVPR48h6wVnk9R079pCFcAAJVkSft4vlwG3S9Tg1xoS9P/s4irUg6pTiwf5BkWebTs/t1iHqxQzquVJP/6pJp0nwhy3J/2mzFu1AhqPAREdJWNd9PtLa2Bo32xvmzAS/kn6F6jOVUTQhgFkYwzf40QK167BwKf7BwQza7zL0DGLOdhgqkiG2wojNWHRZ5e7Crbt/TI7JbJdU3h+eABrt/KnKA+Hx0NvClQ0erda+7oDD2HH3omnCm+x+c4TSa97a1DK7tcoM6W5RYdum5eOeoTMgL8o/O1iQrNBVG/zb44ecnn1BY1gwFf/c0++o+XL5tcktel2BQsHpY7m+/I= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(39860400002)(136003)(451199015)(86362001)(54906003)(316002)(6916009)(2906002)(6666004)(966005)(6506007)(26005)(186003)(66574015)(478600001)(83380400001)(6486002)(66556008)(4326008)(66476007)(66946007)(8936002)(41300700001)(38100700002)(6512007)(44832011)(82960400001)(5660300002)(8676002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?/CRQeE55qqdWE6W+h+s75Pfeeh9drVVI6jx2+/b8fHHQYNCpCKx76tkoYq?= =?iso-8859-1?Q?x2NsaN/fx43VFb5gCv0glGAsBoXXnMpUOIfg3xzjc92c314P6cZ2pBMYOl?= =?iso-8859-1?Q?Pfmn/DcoCC3JL2huSpGTW9GfPa3sX5AXdTlm3dZHeNrEL6OlsegVVYpOAd?= =?iso-8859-1?Q?ZfKMzK7EkhxqgKEaTjtnYpbX5QDZdL+kj9l6KDRYKT+58CTBCcWVNxAtay?= =?iso-8859-1?Q?jpr0nz4iZR4g6AmGrNXCZx57AMqWsqyj+ykXsr35X6ExNf+rAULZo60z91?= =?iso-8859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QbMl+LqjCXqYzlbbLe7F+rAuX+arQz?= =?iso-8859-1?Q?3cFdDa0VY/YNaW7on2Nj/Mc8+yolwVYi9GIo6wMQYRnmgaBCquna1vaImj?= =?iso-8859-1?Q?hBsyqFTWJn7U9mnGbqoGWwjvTXBf3bxS52Mw/Ywu8mggF4LnYLBorUzmXK?= =?iso-8859-1?Q?NXOjv5D3/nmoZsC+00tmU6ii7usT18gtI+BhhySvm+Tu99GLszNLdTe/h9?= =?iso-8859-1?Q?+Pdm6L7WFTbOgwA3mHvNJtdQpPuVanx8QkMkqJ4CAC6fIO8b1GCp+Pm9A7?= =?iso-8859-1?Q?R486z6/554ZeRWjGa+Y56hABRXi4autbUL4omJyjRAPnCL2qfGfkKCEGvS?= =?iso-8859-1?Q?HQlTTQShS1WZNdFOo3UjVq4cksM7K/VRHZXzc8Q2llkoEcussI75cY3+4O?= =?iso-8859-1?Q?ycPcPW1KUKWc6lW3l1afGaLZLp8i206jy1dd7vKa6jWaClmpH3xY/xco0f?= =?iso-8859-1?Q?cR6jE0dUD/hE6ZJSPjwTV5N6p40gXKZBpVufjYBv1m0Osp/niYNKglGQ?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 31891d28-86a0-4e67-803b-08daf88b493c X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 13:03:54.1691 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BlM/HU1Mj7Coitt/Zfj2LW2x8G6blbZFgvrbWex4Krpxba+UOqfOij41bcDf34OuPqmZm+kwQ9oLntQqZFmZFAUKK1eibeEth4b0slOv6bM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6860 X-OriginatorOrg: intel.com 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 Tue, Jan 17, 2023 at 12:32:14PM +0100, Morten Brørup wrote: > > From: Didier Pallard [mailto:didier.pallard@6wind.com] > > Sent: Tuesday, 17 January 2023 11.17 > > > > Since DPDK 22.11 and below commit: > > https://git.dpdk.org/dpdk/commit/?id=7dcd73e37965ba0bfa430efeac362fe183 > > ed0ae2 > > rte_cryptodev_socket_id() could return an incorrect value of 255. > > Problem has been seen during configuration of the qat device > > on an Atom C3000 architecture. On this arch, PCI is not depending on > > any numa socket, causing device numa_node to be equal to SOCKET_ID_ANY. > > Disclaimer: I'm not up to speed with this topic or patch, so feel free to ignore my comments here! I'm only speaking up because I fear we are increasing the risk of bugs here. But again, please bear with me, if I have totally misunderstood this! > > I was under the impression that single-socket systems used socket_id 0 as default. How can the PCI bus (or QAT device) not depend on any socket? It must be connected somewhere. > > Doesn't assigning socket_id = -1 for devices (QAT or anything else) introduce a big risk of bugs, e.g. in comparisons? The special socket_id value -1 should have only two meanings: 1) return value "error", or 2) input value "any". Now it also can mean 3) "unknown"? How do comparison functions work for that... is "any" == "unknown"? And does searching for "0" match "unknown"? It might, or might not, but searching for "any" does match "0". And how about searching for "unknown", if such a value is propagate around in the system. > > And if we started considering socket_id == -1 valid with that patch, should the return type of rte_socket_id(void) be signed instead of unsigned? > The issue here is that not all PCI endpoints connect directly to a socket, some connect to the chipset instead, and so do not have any numa affinity. That was the original meaning of the "-1" value, and it came about from an era before we had on-die PCI endpoints. /Bruce