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 F3C2643220; Sat, 28 Oct 2023 08:17:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FAB140A80; Sat, 28 Oct 2023 08:16:43 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2115.outbound.protection.outlook.com [40.107.92.115]) by mails.dpdk.org (Postfix) with ESMTP id 9E5C540A6C for ; Sat, 28 Oct 2023 08:16:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Roh7/koihmxXX+91kmZR38m/pg9ccru4Tm8N3nJHjZZoap0b1r1vaHjiuA5doDvnTvqrf/dS5EB1az2h7P+DcSBTLyoETslP2mQkVyFt6VRGttrh5Mn7WvvnFPBjD3SLipwgGJuFmFQiZ90nEcYaXwlk9JBW9e1TRXl4zX5tMZKSSYL5bjNgEz7N+3F5E2NIK4gmNOVyBW26JWUTuVr+mG8V1+FGtBDht3njSXKNR36IzqdknQlpt50j46uGVa3I/iXvFk+F8m36BU+YoszHtH2xh5nIw2wYtqT3+l/mQZe46scscbXPyALaNwDgZUQWeQgN47te6beZiEDgQaqdkQ== 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=+3iF9rDG0ZZhLKn3Y1PmyGcn6LbcrzyvzQGCE7kEyb4=; b=RJRhKXo113vH2qTePPPsxX1gtSqqF1MemB4opIb2XURysHAZsiABv8mS6blP5FLhxio2Txo+pWRi611rOK51ogFIHcusyaO1QLhye/2+rQiK33K28yY6wmIP0M9JjqY3DOWLEdks/7LcK0MoD/G/NztKVkJYQC+DCh4WPlLJQ+JDIaK8peOOueeTVtlVTAqa27iRWmfuVR5jwZ4FKA6pX8bGweBunkm9UIl5abZ505T4ga+xJ2Jc0Az/E0m0zWOYstgMV9lF5f4/a3t3rTnlCgmfoTo3o0583hTCiR2wbrfrehh0oed0d9l49DfICVqX0BIp1mETSZL9fe9B/uTxEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+3iF9rDG0ZZhLKn3Y1PmyGcn6LbcrzyvzQGCE7kEyb4=; b=wC0j5+XVY7V31Vri9vTODdJIaUljeOTz7OsC8cP2wFp8d96XQkU6rRQ/emNgrWz4HkqPGsMQwNImCBhHwGs3K/OmDUZg8N76EeicfWWvZC2MhIGsup8TN3j5OfgaiJtdc+Z6NlQgj0ml3Wjl4KhH9GUpf/cOuijA0p/or78hThI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6268.namprd13.prod.outlook.com (2603:10b6:510:24f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.22; Sat, 28 Oct 2023 06:16:39 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b%6]) with mapi id 15.20.6933.022; Sat, 28 Oct 2023 06:16:39 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Peng Zhang Subject: [PATCH 07/11] net/nfp: use the DPDK defined function Date: Sat, 28 Oct 2023 14:15:54 +0800 Message-Id: <20231028061558.1842855-8-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231028061558.1842855-1-chaoyong.he@corigine.com> References: <20231028061558.1842855-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0246.namprd03.prod.outlook.com (2603:10b6:a03:3a0::11) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6268:EE_ X-MS-Office365-Filtering-Correlation-Id: 218849ca-75c2-48c2-52fd-08dbd77d7247 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HNuX/umRJs24VFOxanPpncEUE+W41dQ+2G7NaGyOUGclF6BoP4jiZPn1wm3V6RgZ7YoGSfexWTDRdNrYsJdr4KnDKg2xmQ0z6+gOIhj17RdNOiZxaguD1rFaUJEIhhxu8EE/jd4omUVkUxr8ihCdz4sH3QGhIN/HRh1WkNimwBKz5G+zPkmZWlTVbLwwajL6yLTmOfpxbQjYa6wraX+vCfVMXx16AA9AqJki+WkI11IxId04pekU+t6LpYLYZBe776audN7KV5/fd+aH5hgZVi6YicMWR22sEP0Q4Kd9ce8cdU/8upCzM27tmPby4/iD8cjppYBL4Q8MGYBkuYoivtzBiC6CBe8h0ZVqzRAoUACRjuOUkC0AXrjbrA82fu9tD67EnTGQ62U0Djxy1zf1+fAhd8UlHVn5n6ebL3LT8BgNS9N9QBSVgwIgy//u+2KTCl3Z/H/dWs9srts88Kd/R5dAwSZHoiEfg2tU10wHu8pPsFsGU6d0rsZVX8LcfrMDTjO5Gr6h47JociA7S67+ECYombbj8MincP8b8WLuG2WNg/iqxTIaWVefU21Yc+EDrDAfQL2Nztlku3IpXJvFnuLEND0DouSCkbJY0/Layv8kzCkp/tJfsC9qsfDYb0KAE+i4XdvbkNRe6CHbz9XpWBMzMiyAnIP9RiTupcdnuYA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(39830400003)(366004)(346002)(376002)(136003)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(2906002)(38100700002)(83380400001)(1076003)(107886003)(5660300002)(2616005)(86362001)(6512007)(41300700001)(44832011)(36756003)(38350700005)(66476007)(316002)(6916009)(66946007)(54906003)(66556008)(52116002)(6666004)(6506007)(6486002)(8676002)(26005)(478600001)(4326008)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?P0Ofe1lDo2BRgJBTZt8GIyPp2/t+dcEn57xmwVint0AKv/FWs07w9DKGX1/w?= =?us-ascii?Q?6lUhgTlwUSvN4nE+mb4Y4QW0nbraO46Ial+2Bbmf7tLaZRkkwvLK426FZkvo?= =?us-ascii?Q?ru/dV7a2wHEqYEvEyFAqZ/DNcG1W6KQXQ0j2Il0Fnj2v1dRpl7Wtav7HfBQG?= =?us-ascii?Q?1D2qeXNtLxbV/SjZmUQU1mWctLktdJWAMYo+BYvjX6HGx1ZynnbpYmF8Un04?= =?us-ascii?Q?NLA3v6EFl7A7Klmn3RTRwoyHPyx/uSMSVHg8ZpyZr1IVJavJBy9/jL113DIk?= =?us-ascii?Q?pL7r+NCT38MdPk9w9HK/VAl00sz2KR7E+QJVbiMfjZJ43mZQ1A8XxA1gxdjf?= =?us-ascii?Q?eOhTBRjxHLcQmFfYE7Vc0kp3CI7hCSJ7jQScI44/B2yO+Tjr0RfAlJMsfe8d?= =?us-ascii?Q?30EjJC6+lwS96GnVEWMTc1kmelOxfzn32NwHvWPexOqGi5k6jkn53aayQTrt?= =?us-ascii?Q?87luCzipcgE9B7xEAX+1XHykxnfvJCw5auqV5thk+HNTxaTETlYJxugYCjG2?= =?us-ascii?Q?E0LI+K9AmLLQyfAZLY68VDhf5QIueprx725eVlBuGQOrAM2sXxhh8+5yc9eS?= =?us-ascii?Q?HgRSQc/oiYA4aKUpz3U8p/3knd0x7zGiuuo22fBTDY+WzNknMRRS0RgQUlJU?= =?us-ascii?Q?V2N+UH/S02oGRu/g9+fRdgcKRTF4mq+ngCcIz6aN1pv13/iODyaIuLJqTmdv?= =?us-ascii?Q?Wc1vT+X8g2OBoX6O9X3SLDhc6yT/7EIOpoBJ2cjx//unlEcSI8EkmvoV9QRl?= =?us-ascii?Q?9vwf4FTIJ1fWWHylGp5gI0sJUENFab+u3dKGT+YCDgEuZUGrbXJJHdDWWO5J?= =?us-ascii?Q?52fHKu59sQTQ6F2PGoB0gTsiR4JlNdH75t+DfSuBSSRDxGu82UH7/IFnAHII?= =?us-ascii?Q?Z6bw2471wlMKX1be0CqFCBuKdtOvFUHBANBu6LpgMCUtHFDVN80VtN0MKw8c?= =?us-ascii?Q?8bflmsT7DEe7GoPFWevMyZsGoXNhNGAuv+7ya8hmc4JWsGRQNkyHc5qIxEwO?= =?us-ascii?Q?DV6YlMuHrA4+cOiclrPcK+1156zMvqb854qUp4ek3G4bZAXn4HRFTpptuXNk?= =?us-ascii?Q?aJhBLGjLiuFarIGHJPUka4wsjB+QIsknTa7XgrM1/BHIILoWLtYWvL8px6xD?= =?us-ascii?Q?cWupQlMMoBlVd0Embj8ielug6E2NVY0cU/Hdw77jojPERwbZ+BAIoHUmJi4b?= =?us-ascii?Q?QZIb+dnmK+CGyrrJ/snP5h/q19kaXbv381g+ef0SJXSJBSIizA+kbadDffH7?= =?us-ascii?Q?kqRUwFOT2vP7D2UBxOO9SNFICZO14yT79p8/GGg7A4jDUD3HgNBDC6QeNFhP?= =?us-ascii?Q?E8ynLGpRMrzmJL683PmuP6yeCznDZW8YAWaVuPxerQ4IXGiOvnIm1qxhfROj?= =?us-ascii?Q?x2LdWeOxTFjioqmOlesMiYii7kbZBwwPchqjFLGAK/lPN8+O5wF+9kSZBdM0?= =?us-ascii?Q?thkhgUBZVyf0+X05JheNoHUr8RJgDVT6PUTgEHCTBBpQUeivpQvZ5lTwRDaK?= =?us-ascii?Q?xFStESZqT8Pr/AslsmwodrdbWBhP61G8TI5x3/4x4C35eniH7bTIqWX1QULQ?= =?us-ascii?Q?M6l3GtEysM3xbLrVRdd3GP7sdDN6mnmIr1R+7auI5PlqV3J2bg0vO7bLPYuO?= =?us-ascii?Q?iQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 218849ca-75c2-48c2-52fd-08dbd77d7247 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2023 06:16:39.4024 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7MrDvEHJr98DecXaV07aMo0rjbX9QsraTRj5wDLAsX+yqROWmTxrNKElCvbz/KOq4L0X4OlFe3bo7YihbtFpOFk+K6kDBE3q5ES2Zn7OXIg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6268 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 Use the DPDK defined function to replace the user defined macro, to make the logic more standard. Signed-off-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower_ctrl.c | 2 +- drivers/net/nfp/nfp_rxtx.c | 4 ++-- drivers/net/nfp/nfp_rxtx.h | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index d19b60bc69..c25487c277 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -109,7 +109,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue, /* Now resetting and updating the descriptor */ rxds->vals[0] = 0; rxds->vals[1] = 0; - dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb)); + dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(new_mb)); rxds->fld.dd = 0; rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff; rxds->fld.dma_addr_lo = dma_addr & 0xffffffff; diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 38ce83aa46..be1ac32c73 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -184,7 +184,7 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) return -ENOMEM; } - dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(mbuf)); + dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf)); rxd = &rxq->rxds[i]; rxd->fld.dd = 0; @@ -752,7 +752,7 @@ nfp_net_recv_pkts(void *rx_queue, /* Now resetting and updating the descriptor */ rxds->vals[0] = 0; rxds->vals[1] = 0; - dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb)); + dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(new_mb)); rxds->fld.dd = 0; rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff; rxds->fld.dma_addr_lo = dma_addr & 0xffffffff; diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index ff1019b690..5695a31636 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -10,9 +10,6 @@ #define NFP_DESC_META_LEN(d) ((d)->rxd.meta_len_dd & PCIE_DESC_RX_META_LEN_MASK) -#define RTE_MBUF_DMA_ADDR_DEFAULT(mb) \ - ((uint64_t)((mb)->buf_iova + RTE_PKTMBUF_HEADROOM)) - /* Maximum number of NFP packet metadata fields. */ #define NFP_META_MAX_FIELDS 8 -- 2.39.1