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 72C69A00C4; Thu, 29 Sep 2022 08:14:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6441F40FAE; Thu, 29 Sep 2022 08:14:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C39E140E5A for ; Thu, 29 Sep 2022 08:14:36 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T5flJI029080; Wed, 28 Sep 2022 23:14:32 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2105.outbound.protection.outlook.com [104.47.70.105]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jvrvjk4up-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Sep 2022 23:14:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A+Fk/Iopw5UW0KgMpSJazFXjMI+4VBZwRrC4qL/DUqKF6QznKPw4++9KFopbENmUwJ/1YWDlJYM7onzD/LoHanLtZ2JB7oFyA48jD2Fa/XBySvxuCcmE9wuD1nxecXR2eMHjf5WtmfZf737cM8jjmJdcXIZ0b7WCSMPm/3KhEcHwxHsYG9yfHocz4wvIn9kyBUnwSRsOWMWkqVb7Tqf25cIqENgiCbd0nlwRSDGQAEMl5W0b3QK3rh9QHwRjNse+rdk18dK5lsvoHRxK1RvX9hyrIryuOK4pOD5IF78tVDKUcpP7Q/Fqn5ZyejJ33/bdCu9sbRSQfbYIAcYm54g4hQ== 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=RZ2FjJExcEeKy3K2sqvEsgZl84C/yyRUGD+90+WKYPY=; b=XkAcfpSTmwjLg55X9c8Qg/T+5wPx79d5BXHcCFQBWSYB59AngMNP8EVEPkcZw0Lj3rOpXdsQSeO0wMfqJMsjf5flujy001kz33Rw5yekieUonhkH5wLFtWpE1kqFDOkayPWB6iu73Nblt48qStqVWXrKk9jzOab/hQeDlNyGfozbyhLDHTPqdfe8mLnCRekuFQ/8RgXyrvMuwQVmBRPlP0TkpB3467uHk/gLDkIViEAxXNG6oVWW9qC+tiL8dYmWV8t+xCz2ZkjtCRz+4PUeIfbZL/TdX9RO8BooDRW2fzzNNZ7J/Xs2aLCiH9h6gD6wWAVRTFya+7AIjM9J18ca/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RZ2FjJExcEeKy3K2sqvEsgZl84C/yyRUGD+90+WKYPY=; b=ktDHzdCtLg1RLTRQd6zDY5dQre04u5yLlkJNglqdwh9LxcuTf9DEt0++OyiaTtdNYQl4UhKPj6fIG3I0ZRUDhB/WwHdTxL9zEHsnaZ2OihoPA9rCc2/0lP3u5xu+30pq5/EmmuQmWXefl7Ul4/wrEj3szfaIMgfBp6K8x9RNjoU= Received: from PH0PR18MB4425.namprd18.prod.outlook.com (2603:10b6:510:ef::13) by DM6PR18MB3506.namprd18.prod.outlook.com (2603:10b6:5:2ab::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.18; Thu, 29 Sep 2022 06:14:30 +0000 Received: from PH0PR18MB4425.namprd18.prod.outlook.com ([fe80::16f8:9275:a441:cfec]) by PH0PR18MB4425.namprd18.prod.outlook.com ([fe80::16f8:9275:a441:cfec%5]) with mapi id 15.20.5676.017; Thu, 29 Sep 2022 06:14:30 +0000 From: Shijith Thotton To: Olivier Matz CC: "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula , "Honnappa.Nagarahalli@arm.com" , "bruce.richardson@intel.com" , Jerin Jacob Kollanukkaran , "mb@smartsharesystems.com" , "stephen@networkplumber.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" Subject: RE: [EXT] Re: [PATCH v3 3/5] lib: move mbuf next pointer to first cache line Thread-Topic: [EXT] Re: [PATCH v3 3/5] lib: move mbuf next pointer to first cache line Thread-Index: AQHYzcIEqBtOcc+IiEiWsTP/4iviVq301u8AgAEisgA= Date: Thu, 29 Sep 2022 06:14:30 +0000 Message-ID: References: <20220907134340.3629224-1-sthotton@marvell.com> <7cc8107a4a83dbfe16abd1f24150b0db6cf1041b.1663767715.git.sthotton@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB4425:EE_|DM6PR18MB3506:EE_ x-ms-office365-filtering-correlation-id: 91bc4e1a-221e-438f-b90a-08daa1e1dea4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kl5/MmWCvd4ise3tjM9AwuYi72iNUTW4dtjET55W507Oap6xe9wN98QLFH4iVHrquzi9x12q55f3aMHDv9RO44nkX/861DWKVradKd6nqHtAAi+TNdhOMue6d8Z9AwOuksHLMqKovCTQCBHnIFy0uII4R4DaqJEHgya8VC3dE2P3qf3o5CoLat97lvITdaBfrXX7jWJUDZBFrQcwid26nwpJN/1Yi+OV8lOHW6yjUIu2LVDa4KayzvGdAAQJxVsE5TG8g0t+OQeOFVnf7eYwD1jcof8v/J1tt/ClVoE9okW9J/tHMb6hvacRCcSTDdOoEkBMnlvFClK6EOkixRZmkBZBsEF1nOh6tSX9ccwaarZZsIXAtu7Akln/Y3GqPGk7keMLnIeNBGm1YSAvL48VZNOUKkMcDtJvwMMdfFcd1MQD2FHW0w7XA+EeF/u/ODLCWyg0DOUAPoomFh3+x0xvRncmcTsF8DupBxlqyqtARey3s6CaXkTMWIpQIjmK+0pUmyzL7G/osYo928aS93rYOc8CX0FDJo2mzMWJfAF1uBTy8mzK0hmV+Wg4nCfy5aKssPS2bUF7uRZlz35mMPD/+067EhpzTFZ0Eos0/tZ0T4mGKJFi3qYsyguFC15aDvYqhpYVYJRsb1SmKobEdEeP9NS0FwuREhzTJwZyeuXEHlBusw6J/0JR/vrPUhAXVtZ4XreyU2M4+TgGQ3ww982F3NeVgu8c584ps4IwJTUlZDgXDgJu1HcxuKev714t2s13wATv1XkP3rPatHa93pNY3g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4425.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(39860400002)(366004)(346002)(396003)(376002)(451199015)(86362001)(2906002)(6506007)(7696005)(9686003)(26005)(38070700005)(38100700002)(122000001)(66556008)(54906003)(66946007)(316002)(83380400001)(33656002)(186003)(55016003)(71200400001)(6916009)(478600001)(66446008)(5660300002)(8936002)(76116006)(4326008)(64756008)(66476007)(8676002)(52536014)(41300700001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?t5T811W661nDBtfjn5ob6F0RXpLywfOdva73YMlQpjHYBWRquos1z2LUOMGJ?= =?us-ascii?Q?ibfzgW/nUlS8hdyZyJPHdrSlON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?= =?us-ascii?Q?LB9I6jlLtReA+jkcFJTSjH0iv3oXMNt+YOFKNWtiuNT2Bd4s+iWeOW8vNKNP?= =?us-ascii?Q?Mfa0ZjCZN63D+oUGZfxbk4IjdtLOF8av1ruvoYynZATwFdhTqGWgCbbIqh0R?= =?us-ascii?Q?t1pB7N979+s4iBM9QXk6jnrpzVb8DMK7rEkUHSVRFPAxpRsuxlIa6feKiDOv?= =?us-ascii?Q?jvvsbdBImruZgpsGDfeJxZR+dm4Dr35Z79Pzsj2YIrzHexFlrEuWi6+56XMo?= =?us-ascii?Q?iSflJwYU6hO74i+MSk3CGhHUGOSrFJ6AeFd7Vdv51q38EczybT6XOw7oed8Z?= =?us-ascii?Q?OfTqZ7hunxhoB5LuLAzOo9+oxBl3mgQe735/fAatj4CW74ajpht3dZxLU4lr?= =?us-ascii?Q?2tBniRXCCViJIraT00VkkxN6zXDKk9GMWVkJr6GLslQacsORiO4lszz60cN0?= =?us-ascii?Q?J+jfMM8E5fZVeabtPRVAqQes8iNJaXTh3fxcaPpdvNWDxpW16BQHTaw8G6nw?= =?us-ascii?Q?mLTINf7me2ZO/RQG5eRiIVdyq0GCWP68M/CEguISTcKdekRJM0ESDvdhInta?= =?us-ascii?Q?ZVMAGJUgZQ5e0G7Ibuf5n6soD+90YiXEhXZZ/GsXGxNGiuAOO4fJN0a0yl7o?= =?us-ascii?Q?EXlE/mysAMy+eXS6K9j2a0VR+kPBWKeRLEDv08Nn?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4425.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91bc4e1a-221e-438f-b90a-08daa1e1dea4 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2022 06:14:30.1084 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Lgp//iMtPQzY3PB9oCXPl7B4L4ZOEBLKv2aswL62zmzNnJFWHtul8h56HRyPZ4cOZWXxy32zkfyVCu0saAZ+ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3506 X-Proofpoint-GUID: d7sW6ETKpaOVR3hH6S-v7LpKCAYWW-SF X-Proofpoint-ORIG-GUID: d7sW6ETKpaOVR3hH6S-v7LpKCAYWW-SF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_04,2022-09-29_01,2022-06-22_01 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 >> Swapped position of mbuf next pointer and second dynamic field (dynfield= 2) >> if the build is configured to use IOVA as VA. This is to move the mbuf >> next pointer to first cache line. kni library is disabled for this >> change as it depends on the offset value of next pointer. >> >> Signed-off-by: Shijith Thotton >> --- >> lib/mbuf/rte_mbuf_core.h | 29 +++++++++++++++++++++-------- >> lib/meson.build | 3 +++ >> 2 files changed, 24 insertions(+), 8 deletions(-) >> >> diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h >> index 94907f301d..915dcd8653 100644 >> --- a/lib/mbuf/rte_mbuf_core.h >> +++ b/lib/mbuf/rte_mbuf_core.h >> @@ -590,11 +590,14 @@ struct rte_mbuf { >> * working on vector drivers easier. >> */ >> rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t)); >> +#if RTE_IOVA_AS_VA >> /** >> - * Reserved for dynamic field in builds where physical address >> - * field is invalid. >> + * Next segment of scattered packet. >> + * This field is valid when physical address field is invalid. >> + * Otherwise next pointer in the second cache line will be used. >> */ >> - uint64_t dynfield2; >> + struct rte_mbuf *next; >> +#endif >> }; >> >> /* next 8 bytes are initialised on RX descriptor rearm */ >> @@ -711,11 +714,21 @@ struct rte_mbuf { >> /* second cache line - fields only used in slow path or on TX */ >> RTE_MARKER cacheline1 __rte_cache_min_aligned; >> >> - /** >> - * Next segment of scattered packet. Must be NULL in the last segment = or >> - * in case of non-segmented packet. >> - */ >> - struct rte_mbuf *next; >> + RTE_STD_C11 >> + union { >> +#if !RTE_IOVA_AS_VA >> + /** >> + * Next segment of scattered packet. Must be NULL in the last >> + * segment or in case of non-segmented packet. >> + */ >> + struct rte_mbuf *next; >> +#endif >> + /** >> + * Reserved for dynamic field when the next pointer is in first >> + * cache line (i.e. RTE_IOVA_AS_VA is 1). >> + */ >> + uint64_t dynfield2; >> + }; > >Same comment than other patches about union vs #if. =20 Okay. Will change. > >> >> /* fields to support TX offloads */ >> RTE_STD_C11 >> diff --git a/lib/meson.build b/lib/meson.build >> index c648f7d800..73d93bc803 100644 >> --- a/lib/meson.build >> +++ b/lib/meson.build >> @@ -88,6 +88,9 @@ optional_libs =3D [ >> disabled_libs =3D [] >> opt_disabled_libs =3D run_command(list_dir_globs, get_option('disable_l= ibs'), >> check: true).stdout().split() >> +if dpdk_conf.get('RTE_IOVA_AS_VA') =3D=3D 1 >> + opt_disabled_libs +=3D ['kni'] >> +endif > >I guess this should be in the previous patch instead, since kni uses >m->buf_iova > =20 Ack. >> foreach l:opt_disabled_libs >> if not optional_libs.contains(l) >> warning('Cannot disable mandatory library "@0@"'.format(l)) > > >After this change, the documentation of RTE_IOVA_AS_VA can be enhanced to >explain that it also moves the next pointer to the first cache line, possi= bly >increasing the performance. =20 Okay.