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 9BFE3A034E; Fri, 21 Jan 2022 10:59:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E1CE4273C; Fri, 21 Jan 2022 10:59:03 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 9EA3840042 for ; Fri, 21 Jan 2022 10:59:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642759141; x=1674295141; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=B8E38CDO+nD1q2zSQwL+vUANdqiIg3qs/mjktklfGS8=; b=T4/vNrck/j84+fvhGLCLh8pup+SFjhLRDQB9Qi/chltzp6y3b9pkKZFt mcBSoukB/WVC83q9YO+75kkHbTCIIfA8Qc6xnEDctrcJuvd+N0Fojvs6Z TTqPm1YqTCTXboro0Hdqb+A61OUrUCM197X3IM7lF7VhoqaUacRjxONbh 6qCPy5dnfLdzyn5UK0ZkiU5M2Lq3xpAePyK6Bvc4DBMkeJApOhTS2Pf+V 0VjS9OEcVDJW2KaSqIevQHwJxNLTTtty4XMbxWKwIp3vV/nxVdp4Yjs4Q nTTiz4QWjV+ribdFVgwgJtJkd2fAgi0amkgSKxUnOn9ecqsAPXUOsOz2w A==; X-IronPort-AV: E=McAfee;i="6200,9189,10233"; a="226292067" X-IronPort-AV: E=Sophos;i="5.88,304,1635231600"; d="scan'208";a="226292067" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2022 01:59:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,304,1635231600"; d="scan'208";a="623266898" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 21 Jan 2022 01:59:00 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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.2308.20; Fri, 21 Jan 2022 01:59:00 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 21 Jan 2022 01:58:59 -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.2308.20 via Frontend Transport; Fri, 21 Jan 2022 01:58:59 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) 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.2308.20; Fri, 21 Jan 2022 01:58:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kIqzZtzat7QTORLjBlSSCulPVYKnhgUXQbNMC+9e4U+0Qu0/Z16XfjH+1jRhvdoTWuPMkHvuG5NdnVRypGD9MD4HWkWDHN0WZrwgZ2Cn4l8tZsLEpx/Ge8QiXZtme3vegPf3YssYgBKHQvuIGSl1qNV9mQgi6OR4EWlQZdvQu/lBHc3TfoZ4M67S/PEML1HnuCVNK9EF3BzMcCZdA3hOKFl2ajeEpvXraAL78ldQnmJyYda+0rbbz2Kqrfe27N+s5Hb7RCu2404N66a2ki9Bv0Y7lGR6yzeUZeznJ0evR0DJY3cZ4zDrJbZOoHQTzYhPLvvS/+flhuAiDiv0K+Yz1A== 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=B8E38CDO+nD1q2zSQwL+vUANdqiIg3qs/mjktklfGS8=; b=JsrW4yRztgbIH8IT6mQUKk/y6297+zlIHjU3KhDjC/G7PtnUMUWQo4nyHKIM8/HzxjKRIBpbAvpEAVPHVCnh2b4SlPRLUahKg9eL01k1sD28AJ12LlsUAXEEAGQyYPg/q3S9iyUXrzBiDUg0jRcs/a0vLOANCX6bIHJQA8d+KJQn6WUTmgnxlg7nX74O2iSZW8qLqhe9gUGo00Hxp+QZN4QWWBPiPho2M4lhCjJuISTPvOAu0cG2Fq8NorYRrC1NPHQY64dvPAYgqaMFhhyOvFSS/EciAGFirXNAIbYzqnZWeeSn5vAkvsBZrbpxjjTkvg8mpD/KKL4/CDvnknDEWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by BN6PR11MB3938.namprd11.prod.outlook.com (2603:10b6:405:79::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7; Fri, 21 Jan 2022 09:58:56 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2%3]) with mapi id 15.20.4909.010; Fri, 21 Jan 2022 09:58:56 +0000 From: "Ananyev, Konstantin" To: =?iso-8859-1?Q?Morten_Br=F8rup?= , Olivier Matz , Andrew Rybchenko , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , "Zhang, Qi Z" , Honnappa Nagarahalli , Thomas Monjalon , "Richardson, Bruce" CC: "dev@dpdk.org" Subject: RE: [RFC] mempool: cache preparation Thread-Topic: [RFC] mempool: cache preparation Thread-Index: AdgOpT9GczmQt2GwSFu4FwqncsOxNAAB1qIQ Date: Fri, 21 Jan 2022 09:58:56 +0000 Message-ID: References: <98CBD80474FA8B44BF855DF32C47DC35D86E1A@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D86E1A@smartserver.smartshare.dk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 74cc2913-fbc4-4357-6e05-08d9dcc4a375 x-ms-traffictypediagnostic: BN6PR11MB3938:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Z3p8dVyYQa1eToAAQGRxUVdF9wygSvy8cZwhvhEzD6QoiOCw4a4EV0/v0Yr9yyw7Z5lVgKLG5i1W4D/+8JNNzddaTAxUBA5ityxXmc7H9utdY3EQQ7ekxlGSC37sgx0moK6rNA5JYtnGXt0dDksV3zosU0X6WMgJHo8eCU4SbSy6TZiI2PvE4W9igOjyk4skJLkNRDugFXcWcXXA+b5BKoSe/oPLfcaz70VPFXlS1aYlrbyOSU/cv1jpIkOCHx1NFcaarMs+TG7Mz78akAe4/4xjnuUoRAqtReURe6l2X+YJ2DFVtiQEP4J3mZcofezDUvqjx3wNgGiXSHSjvI5AGlZTzHfBSyscKRfOdwoujOCWOt+vtPod3rx8y1K1CbKHP/Jq/2fDpOVFG/reptqqJtIY+9B8xddYVJYAGLWU0JPL9QJyUeuLMOHgbbxZWrYklI87fVCkd6oAIGgIWADTpRQDNrz9NQ/Lj+6l2ed0XhK6ExDfwsYRNRVMj/SKVxRXJt0AXWC5mwLBqyVwd69DgX8VfwfJRvqdhOxrccirwAZnuteysOpMc/KIoBfXkrbCp7u54jUaysLhV3IGfHwqcs7fzXXHfEXa9DCHvB6NTB1q227AmG/5/nkzbSowX5iZHM2yYtpTG8+SYLh44kxq3zhne3PK9n6/CQW/H6Di0OdQvugnNVo2cM2lfrHgjkk92NuNsAn+fiUs/qdkx7UYeUSiDeHxK5bOfAqE3U11fC+ZVg25rcHUwRSy/qFQpgVlhHYScfxyOUp8rikRwc9HBuZ0nA5cC3nYLuWgeGuYjC5/Wd5oOyKdd0TmMn+0xub+ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(316002)(71200400001)(110136005)(7696005)(966005)(82960400001)(38070700005)(4326008)(921005)(33656002)(122000001)(38100700002)(8676002)(26005)(6636002)(66446008)(64756008)(6506007)(66556008)(66476007)(76116006)(66946007)(186003)(2906002)(8936002)(508600001)(5660300002)(83380400001)(52536014)(55016003)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?eKxqAUgtNT+Wgz6/mTFeAl5vozG9uwzDGEp3M1XwT9PKTkdNNCll7y8lRZ?= =?iso-8859-1?Q?4bFQOsejk89H4SIzFa9gN7a8r1np7ZOOMEAUeLpSC8MgGj8hQbzS9DDSlj?= =?iso-8859-1?Q?jd5l0HbwzNWmTtz5LLJp8Ka7OWLs1yVW4qNVARl/IuMCT4lmwYfrROXCAg?= =?iso-8859-1?Q?ey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2lEQQMAl+gb7Mep8Fy+9?= =?iso-8859-1?Q?QIaOa+KRfVbKo1pN7khDN4Gn/xLBKNQcfVIrQO53bVuY7DNZ2uaY4+DLA2?= =?iso-8859-1?Q?N00vD7IBU7nke1679Bhy+XLGY37okmjdR6LjYFZdAr8IX/pXy1wKQX6iq6?= =?iso-8859-1?Q?wIo2kxPG+EjEWbBoP661oLeMr7SBqQEUu0Cp3hKB1CzVG8mVPOMcX274Uk?= =?iso-8859-1?Q?C/ueaZLvRV1c8j3VIvu6HsNWKyPMMMp/ag7LSgo8/he17VWqIvBy5OK7jB?= =?iso-8859-1?Q?GkitHC9luScP8DlpUw7ReFxGhydf6cri5SqG/EX2cHKS1oerTrEKA9Rm9b?= =?iso-8859-1?Q?Y+QpajxuS2OoctZ6VW/RM/CwYloOomoET7LLFV4FOWyUPPrUWy/YGCE+n7?= =?iso-8859-1?Q?7hRBpP5PZHPno97Qjx3JKViVVGEbyD3Kuf2/3ID32719og/HcgqZFUpwGz?= =?iso-8859-1?Q?DfCkS5b1fPSyZ/T1NFrz2oJs0Whbeibuh86LShT00PeUHp+2Gz0YBavwTT?= =?iso-8859-1?Q?kxccITAOvjne0NyY4q4RhU2ULUq4pHNVUBfwIt7hWo7cZJirNcjmTboz3b?= =?iso-8859-1?Q?fYoj2gU0frx7L3RNRhU7oszOulTjApmYLvkvHFnIL2X4+Rmc2msBrDhy+l?= =?iso-8859-1?Q?3KBudiGTCUFkjEq7tqUJ0FpGy8cjvZwtHJnI9zWaBLT9v0uaYBGwuPUrWE?= =?iso-8859-1?Q?eovw=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74cc2913-fbc4-4357-6e05-08d9dcc4a375 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2022 09:58:56.2312 (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: TD3FmAQ1uqFOADnEJ8q7fAjE/8L/7ttuXxEll48Oua6Vp1BWJ4szFOdb27vEL0sIZuYPHiXZMxRZ8RiFRFm+u9Yl1dFHcnaBNCZ9Y6LJcMA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3938 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 >=20 > Some drivers bypass the mbuf/mempool library functions, to manipulate the= mempool cache directly for improved performance. >=20 > Specifically, the AVX512 implementation of some of the Intel PMDs copy an= array of objects from the cache to a field in an array of some > structure, i.e. it is not a 1:1 memcpy. This method avoids having to copy= the array of pointers into a temporary array before copying them > into the fields of the target array, and thus improves performance and re= duces CPU cache pollution. >=20 > For such purposes, the mempool API could provide functions to prepare the= mempool cache for a direct access operation, and commit the > transaction: > 1. Prepare the cache for getting N objects directly from the objs array. = This function returns the address of the position in the cache array, > from where the objects can be read, or NULL if failed. > 2. Commit after getting the N objects. > 3. Prepare the cache for putting N objects directly into the objs array. = This function returns the address of the position in the cache array, to > where the objects can be written, or NULL if failed. > 4. Commit after putting the N objects. >=20 > The functions only need to support getting/putting exactly N objects; i.e= . the "prepare" functions do not need return a value indicating > some number less than N is available. Likewise, the "commit" functions do= not need to support any N other than the N in the preceding > "prepare" function. >=20 > This API extension would provide a clean interface to directly access the= mempool cache with high performance, so copy-pasting the > mempool's cache handling logic can be avoided, and bugs like [1] would no= t survive. >=20 > Would this be useful? >=20 > [1]: https://bugs.dpdk.org/show_bug.cgi?id=3D923 >=20 I think it is a very good idea, definitely worth to try. I am also a bit worried that we have some PMD code that bypasses existing m= empool cache functions, so if we can close the gap here while keeping the perf we have - would be g= reat. Thanks Konstantin