From patchwork Fri Apr 19 05:23:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 139528 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 75FC643EAA; Fri, 19 Apr 2024 07:24:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 148F040273; Fri, 19 Apr 2024 07:24:20 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2117.outbound.protection.outlook.com [40.107.237.117]) by mails.dpdk.org (Postfix) with ESMTP id 4D5E0402F2 for ; Fri, 19 Apr 2024 07:24:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KHxg34T8qRTjDClUARc68rHE92X1S9HWw6ja2dJJZ+bzJq0ctkngYoyItDo4kft3qIe/nF63WuT9TIzuSrOXtfhvIR8CdfSLkXquGRejJMQg2TTtlghEwPeqaFFH6pwETdOuPa/lT5873Ki+BaWoaWR4Rc+cdvqtpxofczQlKXeSm2eoaYyi2lZuw6zrWZOpf/GMFm72IH5eyutnL0lpMg6tDrQzvzcbcl7eRauD5/RYuO/ARB2LT7AqA5sFYEwCSBaoXpMmgM7Rtt29zRiTcq5lg4WuIO9aYXen93PAyMyw7JXaIkbD/3IvLxEOKnnafNzrAHd9TCVLCAoXDPExGA== 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=qLrU4LDRZRZFvGKPWtuEx+PpBj+Wc6LuAtSEPf/cUb0=; b=ClG87oNsF1TXbK6Jmj15O8mQp/EoThamV+wR7EeAt94H31/h1PxLA1pvCqzdhcpyoIw8s4spPVMSPTkDmzycMFVp6hKCBGAIbl8Ae6kSdvPdHalGN0IWopjTM/4acynPR2bgRaWipMJEiWrr3Oa9QcaHyvG1GyEt12SFd7hhSoyOtBXMkkZzkNDdahNnRZBcCWKh/bzUk7O6ofQiGf38uKR8vjTpJ7GZLeRblUKcFMJwP8VbxH2+/khfw05iifhcQmm5VgaFh6mxQSb0KywQLjVJOKiyO8/zm6K9jv6C6fFU1EpQRFohq5fiQ89f/uUVgjwspr/Ij+fEXlVRyLcCWw== 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=qLrU4LDRZRZFvGKPWtuEx+PpBj+Wc6LuAtSEPf/cUb0=; b=jQ/9jrfdzoJtiYbVniuYEzOw4BJ1wHYujqi5Y0jxtSRU3NTPVwQrdvpVxqA/vESsBXJzjaw8VTUV3hRdAirMcK4Fo7y8XBUYt+5DxBwf3NN5VmQpqefnQSUG0BnrP1yD+qJZ0S9hHz8kwUU3Hqeqwjjyuk0RGoghOA0mKASciC8= 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 MW3PR13MB3961.namprd13.prod.outlook.com (2603:10b6:303:2c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.42; Fri, 19 Apr 2024 05:24:15 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e%5]) with mapi id 15.20.7472.042; Fri, 19 Apr 2024 05:24:15 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH v2 3/8] net/nfp: adjust the data field of Rx/Tx queue Date: Fri, 19 Apr 2024 13:23:44 +0800 Message-Id: <20240419052349.1294696-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240419052349.1294696-1-chaoyong.he@corigine.com> References: <20240419031226.1191069-1-chaoyong.he@corigine.com> <20240419052349.1294696-1-chaoyong.he@corigine.com> X-ClientProxiedBy: SG2PR03CA0087.apcprd03.prod.outlook.com (2603:1096:4:7c::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB3961:EE_ X-MS-Office365-Filtering-Correlation-Id: 191a63ca-8c92-4db5-1598-08dc6030f475 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CAae8E1ZQ1xXuAv4nEUwxO/nnF4XrLyme5lJ1iX/Jtsd+4Aw8wpzZ9xfgn20behtyCYdCjuepegZUIZim4rNFDiMsm2zIb3DuZOQYnwNHUC1Sk60aiJaCIACnrzfAVyrKfUw/ymbAD0lRu+K/8uHqVXyyiahsdF8h+HJRoEU75M5gRCj+C4zUzn3z4RDvVGYzh62ABq6mgVqHKGeXUVfbLVrQhcgmL8MXNzT9q1V4hANaFLf9GI+bRObDl+nc85c+QWEAdtXJdbqEeHRaKjDlsRgBBSvwX6u5u3TG1hAMZZBSyHa3MlWgOuUMVuO0BAEbMk5XhLbux1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RV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(366007)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ELH6Hy1V4Kar8Bx8/gCg0qOfZq8svalAhUXsa+1WEF66AyjPEAvCG2p3r2wHErTtmyAJaF7OcFnmA/Z4SS2IVA4WABpfMHDHYJ2ZCHNUcwIP7oZ4qrwFM5chf8LVN4+Y7CQIgA2374UI8GsifVjlEZjiNef0i3En8U1AsPOFaMCBvxsswOQFVJ6r2KqNN4bb3Z2fnuV/BlGWvRjp2XJD7/+vSf1OqNs7z8L6ctxkV/gW4+sHsSiDrXIrZh4P3TkZEesNq75gZ18oKuA20x0enRR2hkORa8KbbmFeSG9qWXXR0erJvQN6TzxB43rhEmndgS9I9KVCfYsPJiRHGaIDB8fCQ0Ln2/QCQUmMDF5Bck1Un+LHR01GQZHzQJOxgl+d0DpLc+Cs+mz/3+eC0/A7JagwyPBfMJOq3pmkCD0gjL+x5ENpz1vyRfJZKSDATdTUBl23km4kMUJ0HXaLqDmIiiwXh5fR78q4vHrWc0X+6ykl9Sl6kz5if5ck1yfOfkGix4QVXmH5wPqe66rOwg8TL12dX1ofL7GF5auza/6yre0kExvmsZC3Vgab2GQvP0ofk52K+E2O0fi+rcHoj77NtmDa+kSZxf5w3Yrx+I+dLOVoekqwx2mFsVQftuFmDcDVCby+VFaqjCUWTC5sUZuBk9cnm69UfcUpmOC4M0ymxNAu1DMCloKSB4DH4GvK9hKwvmyih95sCo4N0qMz6bD9tl9/fC/PMhrJuhLOW0bOcYWaMXyteM2B7G71fUymtjHnqqbRgJy5eCX1AcarIDp0O0xIjo7KOvGgHwBHtqw0D5OYqc9c0q0XQ2Qi1P6OamuUPIxCDJQ/qtR6qLAqntRMIfAoXzOm2tXE/UAjVpEbchLVY3W2tdjjyF7XwdI9ldsFeGuqkmV9Yx0XaZvtby299Pc5ELYQsZVDRwjaUEzIFs//QTBYfnonHrFJ9pLvzJw2TAqceexchkPu2mpNW3L8otya9Id9FbVPhtNMSUHRhJTFdhAQ0RGOkXQUo31SUT3q0QtWldrJYbhw7nOOEicH1N9UDsDFy6QyW2dTP4XcLbw32S40Dp098QXaa08MhW+v91HtUQ7vLbLaLauuXHXCKFbTnnXPqOxtX7Fc/08hZ3GQ1A6gTRV5q7S+fl4oo/+RoZNNFoyIJpZjKpmUf/HsgyWQazRSVzCvM9gnvfDEv9NO5WK11ran6aG9Mx/cKL0tVoMNFd1QfvxziENDZ287+YYkdulxTQ0nsckclbmGzsa88/eC0bBJ1cscJEIBYBcI5RoUf9A74PTNTBENsM1wpDxNDoT2ewKNrMem8pxhy157E4LVd3501wpd7wXanJA3jvtnUqjAI04FyuRATnuIXPuaExYJ1HX9Pt3NycB9Azt3Lmy1VpudgfbHOsYmPlz+SmeIKkpwb8fSi146Fmh2xF4Af+LY3C4SyCqQqP2royfimxqeV+vqN5OepvvOHiKIquN8H98ZYMPZktCKzNqDWdSGxdBZB24kcjouMgr2fzXSNMeeBa+BE/7f9+jdvXhtata8/wl9hEgKoDSEjoJ032BKm57aDePxU0Et8Q8/fuJgL4AWRpBkAZQnxmdItq0W8ymM+EYsTJPZUpYtYH0xnQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 191a63ca-8c92-4db5-1598-08dc6030f475 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 05:24:15.7143 (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: YpqP9oUK5ktEukldSAzYlM1kVdQFZEkY3LwO1Jhk+vHwSgfe3jrAtDzCwzqNtPPwDcwLlzO/RNADRQhyqpc9pBD+eOEjyXddZhlllOq5WaA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3961 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 Adjust the data field of Rx/Tx queue structure, move the cold data back and hold position for hot data. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_rxtx.h | 71 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index f463b9cf75..0aa73a6432 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -31,21 +31,6 @@ struct nfp_net_txq { /** Backpointer to nfp_net structure */ struct nfp_net_hw *hw; - /** Point to the base of the queue structure on the NFP. */ - uint8_t *qcp_q; - - /** - * Host side read and write pointer, they are free running and - * have little relation to the QCP pointers. - */ - uint32_t wr_p; - uint32_t rd_p; - - /** The size of the queue in number of descriptors. */ - uint32_t tx_count; - - uint32_t tx_free_thresh; - /** * For each descriptor keep a reference to the mbuf and * DMA address used until completion is signalled. @@ -61,6 +46,18 @@ struct nfp_net_txq { struct nfp_net_nfdk_tx_desc *ktxds; }; + /** + * Host side read and write pointer, they are free running and + * have little relation to the QCP pointers. + */ + uint32_t wr_p; + uint32_t rd_p; + + /** The size of the queue in number of descriptors. */ + uint32_t tx_count; + + uint32_t tx_free_thresh; + /** The index of the QCP queue relative to the TX queue BAR. */ uint32_t tx_qcidx; @@ -72,8 +69,8 @@ struct nfp_net_txq { uint16_t data_pending; /** - * At this point 58 bytes have been used for all the fields in the - * TX critical path. We have room for 6 bytes and still all placed + * At this point 50 bytes have been used for all the fields in the + * TX critical path. We have room for 14 bytes and still all placed * in a cache line. */ uint64_t dma; @@ -83,6 +80,9 @@ struct nfp_net_txq { /** TX pointer ring write back area DMA address */ uint64_t txrwb_dma; + + /** Point to the base of the queue structure on the NFP. */ + uint8_t *qcp_q; } __rte_aligned(64); /* RX and freelist descriptor format */ @@ -145,19 +145,6 @@ struct nfp_net_rxq { */ uint8_t *qcp_fl; - /** - * Host side read pointer, free running and have little relation - * to the QCP pointers. It is where the driver start reading - * descriptors for newly arrive packets from. - */ - uint32_t rd_p; - - /** - * The index of the QCP queue relative to the RX queue BAR - * used for the freelist. - */ - uint32_t fl_qcidx; - /** * For each buffer placed on the freelist, record the * associated mbuf. @@ -177,6 +164,14 @@ struct nfp_net_rxq { * safely copied to the mbuf using the NFP_NET_RX_OFFSET. */ struct rte_mempool *mem_pool; + + /** + * Host side read pointer, free running and have little relation + * to the QCP pointers. It is where the driver start reading + * descriptors for newly arrive packets from. + */ + uint32_t rd_p; + uint16_t mbuf_size; /** @@ -186,9 +181,6 @@ struct nfp_net_rxq { uint16_t rx_free_thresh; uint16_t nb_rx_hold; - /** The size of the queue in number of descriptors */ - uint16_t rx_count; - /** Referencing dev->data->port_id */ uint16_t port_id; @@ -196,11 +188,20 @@ struct nfp_net_rxq { uint16_t qidx; /** - * At this point 60 bytes have been used for all the fields in the - * RX critical path. We have room for 4 bytes and still all placed + * At this point 54 bytes have been used for all the fields in the + * RX critical path. We have room for 10 bytes and still all placed * in a cache line. */ + /** The size of the queue in number of descriptors */ + uint16_t rx_count; + + /** + * The index of the QCP queue relative to the RX queue BAR + * used for the freelist. + */ + uint32_t fl_qcidx; + /** DMA address of the queue */ uint64_t dma; } __rte_aligned(64);