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 7210742B42; Fri, 19 May 2023 05:00:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FEA142B71; Fri, 19 May 2023 05:00:18 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2113.outbound.protection.outlook.com [40.107.92.113]) by mails.dpdk.org (Postfix) with ESMTP id C02DA40A82 for ; Fri, 19 May 2023 05:00:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TCMEz2kBKKJSHT7Ep1ys6qA5NzVY11gA5RRjYyj7rCydE7SoCeBTJmUtFWSP5VwnL85PBduC8uJMB+Q/lgJtiLhm7u5Yn0bgfl8nFZrebYKb7fBw9xZyIQzX+GUJDt10srVquqwwvF8cDkidbPbhys8S5Er6pDJkRD5mndBaJqG7vS+pudhr+eqUdPJCLPos5lTZ8o2a0cDtiHIFwB7iNzCjoYB8UEBRVRGMgQheZ3eFO1ONWoK0IiiIRMTbgkm3ETRXRUvHMyy5JLjEFl23xKOxM85rGQBSo6dbCHC/DELIdLGCEpkJR9Oih7WOMe3zNB0zjKP0X9O3BQ87pUslwA== 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=qHlPrJ0wSzG1SIcBEbcoKp/gYzNgC4iZSBeJeD3xYcg=; b=AV4yPuDiwz+Yjj+aSNOmywEzyt2/t49mUHkXiMCbrlTFWh+6Mv9Jrxsh6yZ0ZAj32R9iqz4SQnJ4+Ev1c6MruQZp6LqLwI2cUmx0FAtqs6jaJdCDl3edZK3ihGa4NQHoudfhV7r9GfqFMD7L2FWD58QFrryVs8EthbI/9pI/ugfIrWxVUmym7UPd9vQJplCr2Cy24rWJF7R3evCYiLIo7LEZg6ykn5e+ERXXpqXz6qdE9VjXJ+CaY1s+m2rDcjaIaRVFutI7cxf+43l+cko8yUl9eq917/TneQxjeeePHNLOqMPUVPEUvvjjgjwfg0hZgj3zveYNGbFWLPytZBTBEw== 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=qHlPrJ0wSzG1SIcBEbcoKp/gYzNgC4iZSBeJeD3xYcg=; b=AeIxMeBmq3pxhJgL6T14467a+i93/qTt08YFSnfE33iiktmxC5Wq5/+IutkOJa9z6qJFxoep1hXt7S4co1fUQbcRc2Fymw6nqSN6hB3zClpYc0fX/gT2c2Sw7KXwgGxwVXxvF+4kiPEuwvn+HKfjPrmnCtuzVh2+gL4uTRkx1BM= 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 SJ0PR13MB5769.namprd13.prod.outlook.com (2603:10b6:a03:40c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Fri, 19 May 2023 03:00:13 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994%3]) with mapi id 15.20.6411.017; Fri, 19 May 2023 03:00:13 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 1/8] net/nfp: reuse the ring buffer struct Date: Fri, 19 May 2023 10:59:43 +0800 Message-Id: <20230519025950.1642943-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230519025950.1642943-1-chaoyong.he@corigine.com> References: <20230519025950.1642943-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0005.apcprd01.prod.exchangelabs.com (2603:1096:4:191::23) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ0PR13MB5769:EE_ X-MS-Office365-Filtering-Correlation-Id: 3647df98-6ee0-4b5f-d392-08db58152a35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nv3fKy+Q4oY7PTi5bCShMCVsI6/GDUVwztiraEoU6S/XqfakFv84qEOYBfxGv6eFn5tgsqiVgfvpVQWbON2SRKxhkFHljVx63L6eFhh5UiEWyYl9NW4s1V8AMOfebJF3nce0JLcxxxMOBR5A0qmmdKAsTfbf4zaJ4zAixKfCO0LLehaPDRmxUu5m24LIdbgAaPCXu1wCbV/lztfRuAc0Yd3sROMWKFlZHEDeaSqkFgpZ/9yO9OGUZD/UnZ/x7XP0h2pEPgyiQZhhp4gFzzJrbF0p16hcmUUuyBmNErZpWw0JuCqF82nYi2G/102QHYdKp3HaXr8ABP3mwy5Bw1fiQy0+JHveYqcspVjAOf0qGsZ3sqz0ywtQFg5zH/htbhHdQp8odmdp6pV8DhZLUqxeB2yOYkKfTreXFONy2AiGkW+002LZYaBXtMAeE866EbXyrCxUymgQ26r7YSFseawG5hGRrUKB223laxJiQiSbkW2PTHa/0ibCey3gA3MpCGpiVQ/ecWXk3SROSNWvV4iQhDy/oM1KFVCmTnVODcV1mqU+vtDqv4SDFcyinNEOXIbw8NsDilT9TGIgGPTcOmh8gHwBQt+t/n3xCwqrQ4PxQdIrRT1fevLR/+cTWnkUkgwF 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:(13230028)(4636009)(366004)(346002)(136003)(376002)(39840400004)(396003)(451199021)(6916009)(66476007)(2616005)(6666004)(6512007)(41300700001)(2906002)(6486002)(83380400001)(478600001)(66556008)(107886003)(52116002)(66946007)(26005)(6506007)(1076003)(186003)(5660300002)(4326008)(316002)(8676002)(8936002)(44832011)(86362001)(38100700002)(36756003)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aHJkWHJpSStTQ0dGalV5RmRDM21BUGxnc2ZSYmoxSC9QTjhXL0RmTlgxY082?= =?utf-8?B?MGRzdFhIa3I5cXZBNDlDMm9WYjZoVjJsQ1hlNVJ0a01tM0htNm45U21BbG1E?= =?utf-8?B?OHhyYmdacTY2cjBZb1hKek56c2NHc1dwRjVSaE0wMGR2TC9jQWcrMXZaVnl4?= =?utf-8?B?UWxVTFR5clErUDd0WFNOa3l1RS9pdHpaWTdVNmlPWGdtSnRtNGIrU093Z1Fi?= =?utf-8?B?aExLYWd4b3pMMUNMTlBnNVlINjRCS3JoT3BJNzI2QVp0enVzNVBPMWt3ZG9W?= =?utf-8?B?Um9Vb25HUStwamxTd0ZQbzl2VVlHaGZBL09iMDVFd0FaRnpTUDMzL3hRdkFX?= =?utf-8?B?WEUvSXJYUjJiYldpTnVwRDNMNEFPWDJTdWxRRlU2WkEyckVaMEdScU9GRmp1?= =?utf-8?B?SXN6S0svUUhJWTBzcXVoWnZreHR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CrossTenant-Network-Message-Id: 3647df98-6ee0-4b5f-d392-08db58152a35 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 03:00:13.1475 (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: l6NGGIPf+qxP5cQkmA1kpjloIab5uyoWqGeqqwSPS8KfUtFGEuM90mQRG6CmanJTgwPlhqjlLTRLHCmvzIx/Rprt68zoEN+kenZXOkg16CA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5769 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 Reuse the ring buffer struct, make the code more readable. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/flower/nfp_flower.c | 2 +- drivers/net/nfp/flower/nfp_flower_ctrl.c | 2 +- drivers/net/nfp/nfp_rxtx.c | 4 ++-- drivers/net/nfp/nfp_rxtx.h | 14 ++++++-------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index 159f88f5ae..4d60660a77 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -320,7 +320,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue, struct nfp_net_hw *hw; struct rte_mbuf *new_mb; struct nfp_net_rxq *rxq; - struct nfp_net_rx_buff *rxb; + struct nfp_net_dp_buf *rxb; struct nfp_net_rx_desc *rxds; struct nfp_flower_representor *repr; diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index 937829c23c..1855e73c14 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -30,7 +30,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue, struct nfp_net_hw *hw; struct nfp_net_rxq *rxq; struct rte_mbuf *new_mb; - struct nfp_net_rx_buff *rxb; + struct nfp_net_dp_buf *rxb; struct nfp_net_rx_desc *rxds; rxq = rx_queue; diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 9eaa0b89c1..190498abc7 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -28,7 +28,7 @@ static int nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) { - struct nfp_net_rx_buff *rxe = rxq->rxbufs; + struct nfp_net_dp_buf *rxe = rxq->rxbufs; uint64_t dma_addr; unsigned int i; @@ -371,7 +371,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { struct nfp_net_rxq *rxq; struct nfp_net_rx_desc *rxds; - struct nfp_net_rx_buff *rxb; + struct nfp_net_dp_buf *rxb; struct nfp_net_hw *hw; struct rte_mbuf *mb; struct rte_mbuf *new_mb; diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 4d0c88529b..235f083dcf 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -98,6 +98,10 @@ struct nfp_meta_parsed { #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +struct nfp_net_dp_buf { + struct rte_mbuf *mbuf; +}; + struct nfp_net_txq { struct nfp_net_hw *hw; /* Backpointer to nfp_net structure */ @@ -128,9 +132,7 @@ struct nfp_net_txq { * For each descriptor keep a reference to the mbuf and * DMA address used until completion is signalled. */ - struct { - struct rte_mbuf *mbuf; - } *txbufs; + struct nfp_net_dp_buf *txbufs; /* * Information about the host side queue location. @txds is @@ -210,10 +212,6 @@ struct nfp_net_rx_desc { }; }; -struct nfp_net_rx_buff { - struct rte_mbuf *mbuf; -}; - struct nfp_net_rxq { struct nfp_net_hw *hw; /* Backpointer to nfp_net structure */ @@ -238,7 +236,7 @@ struct nfp_net_rxq { * For each buffer placed on the freelist, record the * associated SKB */ - struct nfp_net_rx_buff *rxbufs; + struct nfp_net_dp_buf *rxbufs; /* * Information about the host side queue location. @rxds is -- 2.39.1