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 0889EA054F; Wed, 7 Sep 2022 15:44:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F61B42829; Wed, 7 Sep 2022 15:44:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 428AD42802 for ; Wed, 7 Sep 2022 15:44:25 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 287ABlYb029526; Wed, 7 Sep 2022 06:44:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=2nUuCDtTXMoEJN84mfMuYrYBh9t/921LN9+rum/iD+Y=; b=GiD3CJwPgcy1jSrFoiY9zqmcCfVsUSSK8eLQFy54DAGYtkh8tUbGcyvXIYf3FyDbJFJt nA1z74fiuZAtsbFxX2g5D1+4Lyqx3T6zmAKlHrEK32MDvHqoX+Sd5adgTec/Q0kN33IU FIX4dCmTnlOjnXBdSDcZ7EfxH6OtZPbU+kKlCHVXWfQSYQ2UeqS6VdKcrlrbimQ+JAm8 5kWahBIk4IF5T19/ao3oMEEdZb1+hnTmyueneO2Xo1y89egv6OyQzQlgFFLjEGXqAFBD j9yR3W66lwVvLD8JBL8totFV3Y8g8Jmv4g3VK3pNVIGcjHaOhM0aO+fft35noY0Mfq5f Ag== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jc6epxg6m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 07 Sep 2022 06:44:21 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 7 Sep 2022 06:44:19 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 7 Sep 2022 06:44:19 -0700 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id 3D34A3F70EF; Wed, 7 Sep 2022 06:44:16 -0700 (PDT) From: Shijith Thotton To: CC: , Shijith Thotton , , , , , , , , Subject: [PATCH v2 3/5] lib: move mbuf next pointer to first cache line Date: Wed, 7 Sep 2022 19:13:38 +0530 Message-ID: <20220907134340.3629224-4-sthotton@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829151626.2101336-1-sthotton@marvell.com> References: <20220829151626.2101336-1-sthotton@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: c9rTy--aaZ7P9nXuh80eVY-Fmsajx3ME X-Proofpoint-GUID: c9rTy--aaZ7P9nXuh80eVY-Fmsajx3ME 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-07_08,2022-09-07_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 (dynfield2) 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; + }; /* 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 = [ disabled_libs = [] opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split() +if dpdk_conf.get('RTE_IOVA_AS_VA') == 1 + opt_disabled_libs += ['kni'] +endif foreach l:opt_disabled_libs if not optional_libs.contains(l) warning('Cannot disable mandatory library "@0@"'.format(l)) -- 2.25.1