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 CBEDC43220; Sat, 28 Oct 2023 08:54:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AC3441143; Sat, 28 Oct 2023 08:54:01 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2108.outbound.protection.outlook.com [40.107.101.108]) by mails.dpdk.org (Postfix) with ESMTP id C58F340E68 for ; Sat, 28 Oct 2023 08:53:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hOfW+PbyO6uv9WhymIbvtFcRlYIjfs0es0TGfpR9YUAslidhQWaZKFYAYcs8K9x5lcaElp7aba3N/YU3zw3N7dtUr5/Alnpv0CwUGeUsW8dBMAfkvRuXJnVABUZgKsvs7DVA7kMyer5JH1RPKL7yvRzV5sXnKpD7yo/h8mCAy8qhevP/ppLd6AYd6X0nGY5nHXNY5oD+D41136yGLuVAXtIGrgoJoy7l2/vt8lxjIqnqIJw4oUxMDmpQiYJYvbZdj71KumoGeOCl5/z/q/vGNX3VB4sGd7G+TkXG13B/fwPHlEu5s78+aBEfCx/RkyYjivOPkxZN3lYQudaj01zWMA== 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=RscUYXjAYoSl+hAw6ne3BvO3egyo3ivIVIvEHETOl24A7n5tHG1gWIkpkuB2iv325KB5EixZB1yG0Vg2H6qD2mQNdLMdHA+FqGQr4oUcxOcImLRs89dXu67mmOZQ3NtfNMk7RK03VFBf+1RzTKy9KTjj2QvYHiqYAFL8XQ0mvMPrWAHD4NmA35SJViT7pmPuHUAPQ52mLHo8aUgb5Vrakm9+fnIxNyzUKIspLnKvc1jy8MN6uEkjLeGEsEiIGK14F/wJcxArkrspJLAEs6UxSczrj4WAlg4YL9eU2e6OGBH6JQk4pXS7aG3l3I8bDLPjrPKOnkhS/MNoOaZaMWjhEQ== 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=wZ6CR33T02IDDEsK8sBSOvUH5NaveyxIHsKHt1WWfvKksds0GIUfvFmozkrwwl8wCZpo2D5Dk6ZkPnZsaBIVQ6KtG7UMZ8dCA+6AyY/y3rNgUnmFW8P7D21d7JY0tx8+8g2MEQ682Mfh7XkkwOPlycTHTGXqTao++6KDEdUrTtA= 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 SA1PR13MB6055.namprd13.prod.outlook.com (2603:10b6:806:338::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.19; Sat, 28 Oct 2023 06:53:57 +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:53:57 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Peng Zhang Subject: [PATCH v2 07/11] net/nfp: use the DPDK defined function Date: Sat, 28 Oct 2023 14:53:11 +0800 Message-Id: <20231028065315.1937188-8-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231028065315.1937188-1-chaoyong.he@corigine.com> References: <20231028061558.1842855-1-chaoyong.he@corigine.com> <20231028065315.1937188-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SA0PR11CA0020.namprd11.prod.outlook.com (2603:10b6:806:d3::25) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SA1PR13MB6055:EE_ X-MS-Office365-Filtering-Correlation-Id: 50b467de-f909-4ef5-28ce-08dbd782a805 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hlbKc9kO6lnwsNHUIsSvBR6+NsNfXnL0uRKCmKgGoY9/XnHccunv/1BCTYqU22v5ZBEfGikkSrUZhmf0cCniqWUZMEAVtRTFzfB2QsprudawN6b3zNxrS+yofYeKVgXfK+ocI9m6s2aeeAvUh2eWv7D+naKRm6bTF5dtrdZCiaGX+QYDNJq9lF2aitSI03/yEEGE2Owt0JmS8Mh0tUhXk+wveC3txaCrpDLy+yz64gpxERcxT4ibqIFUQDDSl6ve+XhN6lcEC1ZSwXeVTv74C5diNDMG0xV5WqpUfOiG+xsX/eXaGiwwUIF0G3CXkWXAG0VquTDTH+KX0jZYt9G62IsvDEQ0KFIOhAlLMsKxAeQZWYUrqPBRnYOONOwyAhSR2cG2tENCfVDImNi2Ce1+6LRLBmbSneeErJ3cOx6cQ4upLEFPcEayNpMa3Cy1cD5ZP9F1sorEY4v7Cyu/vzzFf0vuncMoJUQVZwTHx4O7Ksrxv7BvPhsQxuLjVHY4HQ3j49Xw4midfZRw4qpoQ8W1NRBvhNnWDNk7FCsDpn/lLelYtIcJf4IQOTnCiuUjRwJxj42Dfubtb4GrniHkPzCsYpMISohcuZVW75EUU8O1Nat+TmjJtmnzTWZAIP0cHqUy16URUpGu8FgD8xOt+hXBSi17VGN7x50Dr2oqpmRgYRM= 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)(346002)(136003)(396003)(366004)(39830400003)(376002)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(6486002)(8676002)(8936002)(478600001)(6666004)(54906003)(66476007)(66946007)(66556008)(86362001)(4326008)(41300700001)(5660300002)(6916009)(2906002)(44832011)(316002)(6506007)(52116002)(38100700002)(36756003)(2616005)(1076003)(107886003)(6512007)(26005)(38350700005)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/dk2tBfy6pgmY20bxPCdzil7fcnWswYa0tXSwMIu7UphhYm5evSlqfyvQCu1?= =?us-ascii?Q?TwjuwELm7lrRLlj9Re/hyujVmMEWAR95EmGReAlTUXA1zVxylGBB3F8wBqcn?= =?us-ascii?Q?MkNW3pUAPOS7g8dppGcax0DF2WYKYL5XBxj674ubvvc6YFB1ycID0Q866uGc?= =?us-ascii?Q?nymK32aUR+KzvTdBh+RLCQWslwGXWp/nTsQaB9gbu02AZ4cRhzD31r19DtCR?= =?us-ascii?Q?Bcook5FUkBFw/PTkIef8rR7KBRIfZ+3LS49gL+QruSsPjWVhcLM/nLn0/3yO?= =?us-ascii?Q?K1lsJchGrYgQvIs98e/sFX/1zZTsosevNnOZGaaQnUB/yeef31DMPoIIAG8H?= =?us-ascii?Q?dDLMT79uKiA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YQl7LrWYdG?= =?us-ascii?Q?CoZxOER4qytLs3DqZJ66kB5aey/DGK2LVRxHrEoZV5zuJLbNmi60uKOVBV4c?= =?us-ascii?Q?Lb+k+4ClHeRiLV0C8QfjjeZ+PxI4GV5cOVlA6o3z7r4PM3H9MSEUWt2QdFP1?= =?us-ascii?Q?duSsJuTw0TV4lpSaYyg5SnpsQEJmAHLDFj4V/1gQdYb0vLz0YOmXAXwioKgU?= =?us-ascii?Q?G2sZ0KZ9HlHSMn16321QGInyzuwnA9v62VvePKucwuaINm6y5xOux/VsU734?= =?us-ascii?Q?Ss1ddxbGcPXGF7Ymh37jNZtGf2dmWy89KS9D1QTpBkPgss5kcIHBP14h2v8j?= =?us-ascii?Q?zE9fCGusxYcWJqSehMxfH7LeB8+nyuE/MBuuy3FnBv73t0bAgegzXTg9+2GJ?= =?us-ascii?Q?1w=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50b467de-f909-4ef5-28ce-08dbd782a805 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:53:57.1309 (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: 3ptTnhdJK0k/PLjp8SC4fLrc2EhO/LDoU0qO/bPnQTBPdF2zeN0Xa/zZDC9HIzlW19iR582kELavwfOY2xU2EVUVD2CQ34dtPMNCiIOR19k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR13MB6055 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