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 ABBFBA034C; Tue, 30 Aug 2022 10:36:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D34740F18; Tue, 30 Aug 2022 10:36:46 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E40D440F17 for ; Tue, 30 Aug 2022 10:36:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661848604; x=1693384604; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=lZEgUjR20I1ln8FqW5TXeZv7pNZ949wSSgS0QusW1To=; b=mlabUewl5dbcD17jV543ulz4ZBypQ1x4nWa6F1e8DBEbUX9pjLiEmjyp +xDXCU4F2/7FzG20xwza1dg99qFFeyzYtwa1dlk1/HT4pw2rq9h44jIEL nOnXiIG69VSa2cRPCkAp5mqXfxSagqIu6wKY2eTcUWmt1cs9IrrLmYNKx eQADoRj1fOBlTLNZ1xH5Bp4N0hITdHCp8qC6rfprpj2Gar6EkjFKwkqOQ EluwWWr9lGiNo97EFK41t3ikqTkGEHcrhmsOH3q4mptXmzp5eZvwFbV8J 8/i4fxUAZyDpxo2J/48LHElbMVepA6j+vwNlW/Gy6o5Dtin0cVOF63HaE Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="295120984" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="295120984" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 01:36:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="715221782" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 30 Aug 2022 01:36:04 -0700 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.2375.31; Tue, 30 Aug 2022 01:36:04 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) 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.2375.31; Tue, 30 Aug 2022 01:36:04 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 30 Aug 2022 01:36:04 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 30 Aug 2022 01:36:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EdYmZf8hps0TXwpsNPDnAyF87OML+VS3SuTkBnA2/TkhMeOSZP6uxY7vXXshWUfXjUj7z5WWTuAc1AgDbpJLicesKSxDUF6G05r2Om5yir+gNyv9rymsArCeEi7s9qp8FPIqn6GJXsEP2ScUfzajcsxbsx5YsxnLVDT3kpaMNiPt02Y1nx489CkI50+A1Etbp+1BSiekqn/shQwkDm9kUhEfT7YQAGWvEyVp/l0QVz25WQrmmA6mcFOb0+OoJ8j3ZIRhSR28DDSvQ4rbt8QciCgMmD3tBG5Zli1UifmqUdwOjp7zw7W8UWRhRsW7Lb4eRBcuGY55doG0CvohOixQvg== 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=p3OjOMnTj8fzEO80XB5IJMIPxUhIXI1ANrI60FRzELc=; b=MGJidXHTPnrf8vK+kLclTfmim0iGzk/BxFosL/qW+c8RUT3MvAFFUhGX59LZJJ93g1ZzexTnsMzZpraYWp1WoDyPxc+SIj2MUtz6inEjhUFAnTCfJw10kbplLPk1z8GmFVyfCiF/OHYYTHKQKY/TyeSm989nDkrFOD8yJ6K6DFON1e2tgQwDKLTqJF8Mwe/NcSTa1P1L0ktU2XGNL62X8OqEURC2sq2ocLE5Ah9XynVgy605PN16bnMIOSvu9eeN57qyrLV8gv7Q1Q7zmyMK03uZj604QXQFmdYPNDWOP7uQPzr4fnswXjCu6uwk4sG8WNJTI/uVjntbJEt082OloQ== 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 MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by SN6PR11MB3119.namprd11.prod.outlook.com (2603:10b6:805:cc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Tue, 30 Aug 2022 08:36:01 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2%6]) with mapi id 15.20.5566.021; Tue, 30 Aug 2022 08:36:01 +0000 Date: Tue, 30 Aug 2022 09:35:54 +0100 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: Shijith Thotton , , , , , , , Subject: Re: [PATCH v1 2/4] mbuf: add second dynamic field member for VA only build Message-ID: References: <20220829151626.2101336-3-sthotton@marvell.com> <98CBD80474FA8B44BF855DF32C47DC35D872D1@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D872D1@smartserver.smartshare.dk> X-ClientProxiedBy: DB8PR04CA0022.eurprd04.prod.outlook.com (2603:10a6:10:110::32) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9cc92f37-fb76-4659-1b50-08da8a62ab38 X-MS-TrafficTypeDiagnostic: SN6PR11MB3119:EE_ 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: E8s6mJI6wNeIElqLStak4aCPjAFgLaTSjnkliu46hpFJ5OgRSAU+jXMw2AOcmqlwsrN8JPUZuxsEJ5EQEK/Nap6c93egkivJVfVtmqXaENGV/MBvvsD8eetdNg/cCDkDUVlOxkRMXmGJq3FG4lVH81MNOt9HPc/R7E/+FjdJFNHetFQWzT3EG61De74ZuVugmA8hzS3PFvhAghTaiYL8Q93oGNorMSKl9WfqqncVYK1ACC734dcsjwJy1B/knTAev0i3l2RcgMkCrIP4DkCkmrmbpOGWSPW96zZJu1O3eCAv5SUTvMHTeC9D6a6q+oOu3E5rdEiFGdOpiUpajQrJTHN0yUOcfLhH0PFQOl2FaCKCLlpJ8kjmd1p3nNQqZUXIeI8b2xKkcQotm8sPXPdBryaRjSfa5CANGsMSxJUMR1ExUsvkeoULPQJ5fIhlObmc+wqolcJsXA53wrjl7DiGN/63J6igWcXYEUeL6jvtFi3UCfzUp9xHcIcQQXvWBRtsdblc5gD1U7GyT51zIJ+BpCzCv6qM5FUObILiOFhgFdd0n389RoD5EKkQ48RAZNGYOsyPQsQME27mxOSDVbtsT+1TO4sdJ4wXp/H4JuPIgbl4cgmGLz8KCjAmSYOzc45ZEWFkTJnAT+fO5PBnQDvUu5gfX6ADPCeqyNKkjEtFa7nom1HxtY+bVBdeKQpix7y+YS7qhr/2klSM1JnTTCTWUw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(366004)(396003)(136003)(376002)(39860400002)(478600001)(8936002)(6512007)(41300700001)(86362001)(6486002)(6916009)(316002)(5660300002)(82960400001)(26005)(66476007)(8676002)(66946007)(4326008)(6666004)(6506007)(66556008)(186003)(83380400001)(2906002)(66574015)(38100700002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?teva37ydro58NDfG1zDwRkbDZ2ENHOO1Dx1Ps0uzwtCDPo4hDc79yrRUXo?= =?iso-8859-1?Q?0FZHDbZli0gdy2nQjA2dAh2LDtst8LWU60hqQU5d+KZZ2hi7EAiCfX583k?= =?iso-8859-1?Q?iMvc3FJPx6yKmY+bzZ7cFPTtbm/73uiIbNYRyvJFEuu4qrvgx+srYohgVL?= =?iso-8859-1?Q?scGjXI2RF90AXPcOzBC6H7LReibrve9aoFNiOMm4P7vMMgRXhaEmEOrhhn?= =?iso-8859-1?Q?iXS14UcVxFjfvn8/M/k684dsDmJTUqjVa+e0fvvKlYaQIl/wEUpfLDb2wr?= =?iso-8859-1?Q?9Vv++39WMLvmmATRNKfGNNxoE6QrFkH/sEPGrm5pTGbf2PL412rScyqHMx?= =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MvPn19KDD5Pj4ig8/qAsrhM6zxGvr5EfQtREfVXWAXDi?= =?iso-8859-1?Q?SHtvF462Au9+YeTqqT3uaJvfUO87XbPNkl23ymy0NtIH7i5beqwXPDSsgm?= =?iso-8859-1?Q?dY/LwxiMZFUe4eaJ/mVI6teJoF3idnqJLx6aBwaxuj2vBTjLSFIgGDdR7r?= =?iso-8859-1?Q?RgAvvSL5DbhGhAznawfjFNyP9khpVWtdMJvufp3XtiXqRqJDrEzT9diZjZ?= =?iso-8859-1?Q?AA/kuLxvn3XKhM3a3UG45DtYrd0APHv/TANrkvKg5qt9lExgtnUBFgWfGA?= =?iso-8859-1?Q?Mh0Ag+MMsiT/piwTiOBaOg0SQck/bffddh2z71DF/rdzi/fEJsxNbKxIgA?= =?iso-8859-1?Q?ujcaLxN+DmlUrly2PCw0Su0z3602nVMWs43l0DEwqv5aD302m0bCRgIzh9?= =?iso-8859-1?Q?nfQ1SlIG30IbKn9aje3SJ74vOKpnlI5FWcuFMoeAeniMTHtwJYx2s1Cg?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 9cc92f37-fb76-4659-1b50-08da8a62ab38 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2022 08:36:01.4261 (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: wV+uzlcE6RgBSoOhUFNSblAmm9tYpdgFeYVrAzlAimkx/vgd+Pu5yy17ghawEhHmMwB2JrWUexEQWBoKcqO6l4ri+YjF0NqXzX27fEQOTAo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3119 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 Mon, Aug 29, 2022 at 08:32:20PM +0200, Morten Brørup wrote: > > > From: Shijith Thotton [mailto:sthotton@marvell.com] > > Sent: Monday, 29 August 2022 17.16 > > > > mbuf physical address field is not used in builds which only uses VA. > > It is used to expand the dynamic field area. > > > > Signed-off-by: Shijith Thotton > > --- > > lib/mbuf/rte_mbuf_core.h | 26 +++++++++++++++++--------- > > lib/mbuf/rte_mbuf_dyn.c | 2 ++ > > 2 files changed, 19 insertions(+), 9 deletions(-) > > > > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h > > index 81cb07c2e4..98ce62fd6a 100644 > > --- a/lib/mbuf/rte_mbuf_core.h > > +++ b/lib/mbuf/rte_mbuf_core.h > > @@ -579,15 +579,23 @@ struct rte_mbuf { > > RTE_MARKER cacheline0; > > > > void *buf_addr; /**< Virtual address of segment buffer. > > */ > > - /** > > - * Physical address of segment buffer. > > - * This field is invalid if the build is configured to use only > > - * virtual address as IOVA (i.e. RTE_IOVA_AS_VA is defined). > > - * Force alignment to 8-bytes, so as to ensure we have the exact > > - * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes > > - * working on vector drivers easier. > > - */ > > - rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t)); > > + RTE_STD_C11 > > + union { > > + /** > > + * Physical address of segment buffer. > > + * This field is invalid if the build is configured to use > > only > > + * virtual address as IOVA (i.e. RTE_IOVA_AS_VA is > > defined). > > + * Force alignment to 8-bytes, so as to ensure we have the > > exact > > + * same mbuf cacheline0 layout for 32-bit and 64-bit. This > > makes > > + * working on vector drivers easier. > > + */ > > + rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t)); > > + /** > > + * Reserved for dynamic field in builds where physical > > address > > + * field is invalid. > > + */ > > + uint64_t dynfield2; > > + }; > > > > /* next 8 bytes are initialised on RX descriptor rearm */ > > RTE_MARKER64 rearm_data; > > I know that the intention here is to keep the rte_mbuf structure intact, which will certainly improve the probability of getting this patch series into DPDK. > > So, I will add a comment for the benefit of the other participants in the discussion: > > With this patch, and in RTE_IOVA_AS_VA mode, it becomes possible to move m->next into the first cache line, so rte_pktmbuf_prefree_seg() does not have to touch the second cache line, thus potentially improving performance by eliminating one cache miss per freed packet segment. (I also recall someone mentioning that some PMDs set m->next on RX... If that is the case, a cache miss per packet might also be avoidable in those PMDs.) > > Obviously, moving m->next to the first cache line is not related to this patch series, but would belong in a completely different patch. > +1 to that, with the exception that if it is decided to move the next pointer rather than use this as dynamic space, I think it *should* be in this patch series, rather than mucking about with mbuf twice. :-)