From patchwork Wed Sep 21 13:56:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shijith Thotton X-Patchwork-Id: 116558 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87CCFA00C3; Wed, 21 Sep 2022 15:57:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8227042905; Wed, 21 Sep 2022 15:57:02 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id E4442427FF for ; Wed, 21 Sep 2022 15:57:00 +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 28LBPhTp032185; Wed, 21 Sep 2022 06:56:57 -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=JspPPgQc2C/YicU+ojPvvRHHC76spGCQQzjjhRza35hV/oNbrLA1qDctT5nURoxN79W8 I95JY0qcaZWukX9w69/sp4O3ZfJAArlvlOzwXA5JWJjgIwXCJKC+mGgb2e64ECEne+uK cCbLshx1d3SNWl+jdK+377KGM77nNQLZ9W7eMEIVpHEzyjob1Uqg5SJmLkpf451QRpQ0 ynHm2SPzN1fU5S2BFawXM9pNiRsf6/FLLfdFR3jgYW2iqH9kPnbd1FeWvkOrvoDKBU+X uJJo9H5U0iaSBQJ++wUOqVb7x0biUeGv8xmHyTSuduv2srvxvjsWMiSE7QoAZh3KRngR xw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jr1qmgghy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Sep 2022 06:56:57 -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, 21 Sep 2022 06:56:56 -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, 21 Sep 2022 06:56:56 -0700 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id A8BF83F7051; Wed, 21 Sep 2022 06:56:52 -0700 (PDT) From: Shijith Thotton To: CC: , Shijith Thotton , , , , , , , , Subject: [PATCH v3 3/5] lib: move mbuf next pointer to first cache line Date: Wed, 21 Sep 2022 19:26:19 +0530 Message-ID: <7cc8107a4a83dbfe16abd1f24150b0db6cf1041b.1663767715.git.sthotton@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: <20220907134340.3629224-1-sthotton@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: BWIkTDHhnHqkAgBoDxtGq76iek0QP5iU X-Proofpoint-ORIG-GUID: BWIkTDHhnHqkAgBoDxtGq76iek0QP5iU 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-21_08,2022-09-20_02,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))