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 4250F43EA9; Fri, 19 Apr 2024 05:13:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C52940687; Fri, 19 Apr 2024 05:13:00 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2093.outbound.protection.outlook.com [40.107.237.93]) by mails.dpdk.org (Postfix) with ESMTP id 63CAE40395 for ; Fri, 19 Apr 2024 05:12:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SkMUC5HWVWZ2W5EQcapYzozMpNluPzuYCxN2RaQsCLpSTCeyDUt7wjbWcokckpl4t8OTXPGUXRhZdWfCB5Aqq/BYbJOQmMJwwbK7xBPiBnKZFEH/eYCzfztVplVM6ZPp7ibew5P0kCRmdrtHs3pMAqJQJf36WmZydA7p3/hqZClqjC6EizWsJP7ne7jYcbdoroeTPytHyBXp7ufOTXsBfFlR+w6VL1J4ug6Dhrx+J8f9jW6MGi0RM4HrLDh83S3NcxjaGQHY7GWdrmyD7ZYvD6Z6+vw/wXr9x7wavFkjLRgKhkACRRbdLq8cvmibuduHD7OYkf7SGZ2PAS87C1kGjA== 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=OjW2vQUU7HHeTLWgLM7a6YKXnuEqdNvLTxH+3eIASY/vqmjvQiChLkvf939FysuZEK1RMei6wtE0by7nkVmhXJ1okIi2CVmYNagrqK9XqPeVOSg/17Rf5f1qYS5ZNcePdY1FI1CmlTEREyNUDKkGMNRmOtKZDqo/Gw+ogXIttInj01PIcQOuIVaI5SE1ktrKKSCB0NDTmY02CKVOJmclHQXjcaN1BiEtey062M1O5f4VqP0uW6nlFT9B2YHESxlhe/cE8ripjOZP6HAUU5Ob/RiW+4O1cdSF+pkF2bHNHNvT7nG0VixUAN/eIUwd+BMF3Rb2AdMEbEWRRhdhUQOTGA== 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=s5jiARflhbIWDfOlburP00dEU+l5nM9AQZvGJia1AeL2+Fgcv/szk6iaG/RZyIe5go4pmU5PX8G5WUVD8age/0Pt+UmM83yWYvOgjfym2RigCDSla/rA31r80nr8WiBYjmzgLVJFlu3wZ/J3LAqhs74U1Hq70d9NDBEVdXmfo0E= 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 BY1PR13MB6310.namprd13.prod.outlook.com (2603:10b6:a03:52e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.38; Fri, 19 Apr 2024 03:12:55 +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 03:12:55 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 3/8] net/nfp: adjust the data field of Rx/Tx queue Date: Fri, 19 Apr 2024 11:12:21 +0800 Message-Id: <20240419031226.1191069-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240419031226.1191069-1-chaoyong.he@corigine.com> References: <20240419031226.1191069-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0044.apcprd01.prod.exchangelabs.com (2603:1096:4:193::8) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY1PR13MB6310:EE_ X-MS-Office365-Filtering-Correlation-Id: b797d433-199c-4d12-0a36-08dc601e9b2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?t9B5r5RLoJSRpCJbKw4IOS4HANPjvn0/1cEClFabxEXwVZqffDYT2CMTkv2X?= =?us-ascii?Q?G3WPCoI0JgO01b8ro7UCiV5DUMVuVqWpEyBBAMua5Em5L4UEA+kP+P+r9p+t?= =?us-ascii?Q?JgKrJ7sfXEIieTC/3HiaEUscUqii0KIwM0mVn+S+4fo/rBbXUg5H8gYTyQ64?= =?us-ascii?Q?JT27biJAtvQYlZVPCwEaVQVG15ZevK2z8ByfqGJZMtk+rrkwuVGH4DjNCcQm?= =?us-ascii?Q?pVrvF3ArIkvkUr+ve24t2cJ/c+syIivbyNR4hFEGW7Y3ueJ6CYCmo6wDNtz2?= =?us-ascii?Q?2nvm5+vVl5/t7YCjToP7NYEmC7vvwCRZEj++jap+mOd8syNgGom+A4ThR3rr?= =?us-ascii?Q?TtHIHywYK1BgIVCh2VplJL+FofJjWPz1VcecW0FdgKM94wcz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cENQDSrVxIgGZf2XAZbu2DF+S3DcK?= =?us-ascii?Q?OpRG6okOVyQtppjfQqdzw0fjxatAtA4obhJggxE8cYy8ug=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)(366007)(52116005)(376005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?K8Tv/p+VG8SwT67THZy+OsuzQRKs0IWuAWrSOocu6cs1WAhKjYsdN/OML2Jn?= =?us-ascii?Q?3WcbVQzGONFGdzlAq4RWY0GLXbNsnoM+AGXZoHMeUskI5f7bUpX9DOVBcrRR?= =?us-ascii?Q?uOKsPa+9qQUhAngjm0/ziR/1OoalHITUwZbRyj9jxSyivfuqlUBtIpqkiMtw?= =?us-ascii?Q?uaIi1ncMDQVpjcZc5OLyOFRkbJZU/6VEHXbedByo81z7U8HRwz7YPbfYmOo/?= =?us-ascii?Q?x5etYaHWg9Yrs9f1XC9Tubz78iZSlCZWcGLAH9D+8F90xT739DRdy3T5hkuC?= =?us-ascii?Q?oOPbnqtnExv5CsTrGac9BwWOfw3M8aLNM8YWtaL77r5QffQfALrYBif4qKAX?= =?us-ascii?Q?U/Ueqf7B5k0sF2YyLkctAXPHAsG2dKMS18V6H5Ik9AF9M7Wnh3670kgqkFpk?= =?us-ascii?Q?xEYdyR+qdaYm+4wfeUCX+6Ct6Hv7ck5mTYPdHV0yW0W8gGH7ifQufrlWC2PF?= =?us-ascii?Q?9RmwGx+ZCNQ2yP+rKQt6pB+0E166LaVCLrDP83Am8vj8wUFXoj6PKss+7D4G?= =?us-ascii?Q?nfxkv3ydlT9hJ2elgQF0tT19h5J7C2Qk40YPcKrtEGWYt6tDvzaZpqB/lWCP?= =?us-ascii?Q?ONhL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UcTu1lz39nx1?= =?us-ascii?Q?QkuOIHvorFt4O7TPAsrryiRPjCSRwhaurGy6eUXvyZ1kdw1+QU1vHu/cBs80?= =?us-ascii?Q?pPiln3iL5X0t55fFQVKXpnMORXqAsaJyW8sDv3jHrjSDtsehsWn2rflPFhuq?= =?us-ascii?Q?sQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: b797d433-199c-4d12-0a36-08dc601e9b2d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 03:12:54.9957 (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: 4GuIJQacAzSwNUg5hGknbp4sGvYxrUlhmMTEXIMepB3PLIebwK9nQ1j8JpJwTd6Yh3li5jm9W8JWNWyUsK/FXPRHBRoxp06zMJie3ek8ss8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR13MB6310 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