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 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?CAae8E1ZQ1xXuAv4nEUwxO/nnF4XrLyme5lJ1iX/Jtsd+4Aw8wpzZ9xfgn20?= =?us-ascii?Q?behtyCYdCjuepegZUIZim4rNFDiMsm2zIb3DuZOQYnwNHUC1Sk60aiJaCIAC?= =?us-ascii?Q?nrzfAVyrKfUw/ymbAD0lRu+K/8uHqVXyyiahsdF8h+HJRoEU75M5gRCj+C4z?= =?us-ascii?Q?Uzn3z4RDvVGYzh62ABq6mgVqHKGeXUVfbLVrQhcgmL8MXNzT9q1V4hANaFLf?= =?us-ascii?Q?9GI+bRObDl+nc85c+QWEAdtXJdbqEeHRaKjDlsRgBBSvwX6u5u3TG1hAMZZB?= =?us-ascii?Q?SyHa3MlWgOuUMVuO0BAEbMk5XhLbux1bMsFpklOHQ5/PwoBIttCVTq7OjiY9?= =?us-ascii?Q?7ZN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hv?= =?us-ascii?Q?7ZUAG/GBbyej1wjrBMgNEAJ2Jb3gNOHnJEddF+fhzfXrbvEY6qOj0U8ndi+j?= =?us-ascii?Q?XBfaAM3VTUczzgSLm4J7/klKZqNWmqWc7dy2f3u4LaTyyw=3D=3D?= 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)(52116005)(1800799015)(366007)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ELH6Hy1V4Kar8Bx8/gCg0qOfZq8svalAhUXsa+1WEF66AyjPEAvCG2p3r2wH?= =?us-ascii?Q?ErTtmyAJaF7OcFnmA/Z4SS2IVA4WABpfMHDHYJ2ZCHNUcwIP7oZ4qrwFM5ch?= =?us-ascii?Q?f8LVN4+Y7CQIgA2374UI8GsifVjlEZjiNef0i3En8U1AsPOFaMCBvxsswOQF?= =?us-ascii?Q?VJ6r2KqNN4bb3Z2fnuV/BlGWvRjp2XJD7/+vSf1OqNs7z8L6ctxkV/gW4+sH?= =?us-ascii?Q?sSiDrXIrZh4P3TkZEesNq75gZ18oKuA20x0enRR2hkORa8KbbmFeSG9qWXXR?= =?us-ascii?Q?0erJvQN6TzxB43rhEmndgS9I9KVCfYsPJiRHGaIDB8fCQ0Ln2/QCQUmMDF5B?= =?us-ascii?Q?ck1Un+LHR01GQZHzQJOxgl+d0DpLc+Cs+mz/3+eC0/A7JagwyPBfMJOq3pmk?= =?us-ascii?Q?CD0gjL+x5ENpz1vyRfJZKSDATdTUBl23km4kMUJ0HXaLqDmIiiwXh5fR78q4?= =?us-ascii?Q?vHrWc0X+6ykl9Sl6kz5if5ck1yfOfkGix4QVXmH5wPqe66rOwg8TL12dX1of?= =?us-ascii?Q?L7GF5auza/6yre0kExvms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?us-ascii?Q?yCqQqP2royfimxqeV+vqN5OepvvOHiKIquN8H98ZYMPZktCKzNqDWdSGxdBZ?= =?us-ascii?Q?B24kcjouMgr2fzXSNMeeBa+BE/7f9+jdvXhtata8/wl9hEgKoDSEjoJ032BK?= =?us-ascii?Q?m57aDePxU0Et8Q8/fuJgL4AWRpBkAZQnxmdItq0W8ymM+EYsTJPZUpYtYH0x?= =?us-ascii?Q?nQ=3D=3D?= 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); -- 2.39.1