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 700D0A0093; Fri, 17 Jun 2022 11:36:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55F6442B7E; Fri, 17 Jun 2022 11:35:34 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2097.outbound.protection.outlook.com [40.107.94.97]) by mails.dpdk.org (Postfix) with ESMTP id 17B52415D7 for ; Fri, 17 Jun 2022 11:35:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/Hpx1imI1QRDq9o4GhzgbTicdmvDLUX/EkO2prZpVGM9yPX/T76kUiGgNjejM2zBNxdm1c9gd7R50kUvjcStMQfTs3HIT5PGQ23OD4LQ75RFGy8VP5HUm66l8IliUR7/kIFqacMTE+TQ4i9h8WmNEa6p4csP3nlxUmkyWa6B+rxx0VmSum/vaBGuMG9TxHb817dLOsPLDH3fbzZi4JvUxcffrbHXg3cV8QA7HE+kBmfZpJqVJQUAm17i1tvMnKkQnkFO8zfyndhhSIJBojxRnUwSXqeK8LgpiemcFKQEgc2bWbmLrl1iQqRUBk5SG5cQpoOaKWMFVXwDH+CdW+qDg== 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=Cjt7IeDq2CKmNe4bfo6q0xJ/6rfvIeanQKvRwqjDELo=; b=M1ERAbDvb7oX1zrHc8j7TuXbaMZ+qVaY3xUJxblvpr9SNPDi5mDdQZ9h0sOx/+mKVr/j3uh1fij/hmBnxVoy5Q/VoevMJXXqqxs3aHm9yWe1VB/W1DkjyyEKOa8nP/ZM+RifGELmSRtZprGiT9fW5eHrTAGY73r39TGMvJclTJV4OFRm91uYlXGwMXGnfcc0BgaSKLX51RmZh38K7x2O1JGxrg9thWXBOlWVxNmYhXuAetRFaw4NMuL3m12rr26JiUhzTTaIcWMn23x8pKrU92Tpg2+xVQN+yT1HsNHMJhaA1Psxh364FUznhKfXQq3VT3vodHBv8AIhBJUhyY7bZw== 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=Cjt7IeDq2CKmNe4bfo6q0xJ/6rfvIeanQKvRwqjDELo=; b=O4LRq/EhtYmjicaB9arH1k/GeLt7Maw/6lnfIE0Nt0TnRwG34kMfJs6JPehbGrKqBX6TW1fi803zg3IWrYVBvQE0AW00kH+65ha3Qv++wZHe5t22HHMC4Zn+y18R/v2WoS81dCiZ9zOC28usJTXX4dQAB30aRQGLR2ULxvH0ehI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) by CO3PR13MB5671.namprd13.prod.outlook.com (2603:10b6:303:17a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.9; Fri, 17 Jun 2022 09:35:29 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35%7]) with mapi id 15.20.5373.009; Fri, 17 Jun 2022 09:35:29 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v3 08/13] net/nfp: structure adjustment Date: Fri, 17 Jun 2022 11:34:39 +0200 Message-Id: <20220617093444.2004000-9-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220617093444.2004000-1-jin.liu@corigine.com> References: <20220616023939.1798769-1-jin.liu@corigine.com> <20220617093444.2004000-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0192.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::17) To DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c2e1a7a-92b7-45fe-35ec-08da5044b7a0 X-MS-TrafficTypeDiagnostic: CO3PR13MB5671:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +tB2XxdsWEUGr8Mg6dyeDr6J1Wfy3E2ZSz89RM4FfGQj6wMQSw2VpNWMQsKNZydsmgvwlPhWcX7e+E3sILJ/820cL4sGGjsOCbVMCRC92Ufu3BbC3lbI/o0gQ2S3FXekgCu+6kUMmQ49NVa2ySGYo+KXueMt6FWYDRJOCOMAt8k/xURpIR7rx04J3P1yEzuHJVN4vAdrHWfvWSxsb3dhEzkHw6CkOPLAcPXwj1nCim+m+gxr8a6njFllhgLApkCYe6NgaQibYOvOtC3ag617BXFjtE+OzYBgMUTYTriIQH8NoNFBAVsnrzV7itQkdFpKx25syC0ZqLyKn0H0RBGIH+DsnSZEYb/z3EfEx4dd6ZNqdjd84EHzDkRRaY2NJBGp6Y9r1FhxXPl3GSXBZ2FumqiiclSZ76WqMhnaDH7Ky3QyjtQLEmSsi2OrXIdHf/wz5lOQHSIq5/5teoK1GIA1Abximysg77hEJBWCxV8QcD4AJ9QBzmnA0ZsOeChyGQ69cJo9a7samj77qo+gDUoXYk2eKN74Eiqr8I9cd5U8lSOoSIsT2e3RhgV8SdpQfAV7+D9vvKRbg/Wg7YvJYjJ5DYbzvMqqimh869fqn16NMi2obqdSuJL7NavwqWb9A0IJSp886ST6Em6zdEdTtxzGuGtM4vJ6w7tWVNEnbIKa2dv+Q12ub4sxQoGT1PeGJi52GL+95Puotzg4gU2E3Ig+9UGvTeVcnf2aYAQzpBx1wglL9BJaPEx0sUp/H5d/ioum X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR13MB3004.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(346002)(136003)(366004)(396003)(39840400004)(66476007)(66556008)(26005)(8676002)(66574015)(6666004)(107886003)(66946007)(6506007)(6916009)(44832011)(2906002)(316002)(4326008)(38350700002)(186003)(508600001)(54906003)(5660300002)(6486002)(6512007)(1076003)(8936002)(2616005)(36756003)(52116002)(83380400001)(86362001)(38100700002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M216TnRmbFZXN0Y0RDRZY0l6UUJoVThtRjFrd3gxa2JETUNUUXZ4aDdtYldk?= =?utf-8?B?WGZnb1V1OFMzYUJDOFpYZ2ViSi8xcFJPL2JNT2FuRy9YUnoyaXVxVFhkR3Y1?= =?utf-8?B?Y2tPMUtuOXNETi91NlZLdzhzQXlOQmhEOStlSXNVNVgySmVpUmlMWU5rWmhP?= =?utf-8?B?SDNrOHA4MlFQVisrMkhxVS9MZ3pUbXNBdUxEdmFkcGk1NGhBK2hSdUJBZVFJ?= =?utf-8?B?Y0dpNWF0clhyTHFrR21UOXVLUGhjMGdwb24rNU1scjR1YkJNbEEwUi9QQ3ZT?= =?ut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wyZmV5ejFpYloyUFRxSlZIVjZTSzArUHVI?= =?utf-8?B?VjkvTDR3V0RYNGFDS3pVaDhDRnpMbkJSVDdjWEQ2bkVsR0x6VmJ0Vm41K0Y1?= =?utf-8?B?OTBaOWxQZmpZNFB0dFhlRitBSGJOelhPVEVXRTBFL0c5d1JiWE96R0c4N2Fu?= =?utf-8?B?V05DY0NVR3doM29RaTBEQ2g2UGxOMnd3RE1qWW1mRDFDZDdVMmttWlU4aVZB?= =?utf-8?B?Z1JOUWdteUgzSk01NWxhOVN4bzlaam8wV3F4RE5rdnRWQ0lNQktwZz09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c2e1a7a-92b7-45fe-35ec-08da5044b7a0 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 09:35:29.7574 (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: zoqjfIg4pAr+zmjXTXq48Ny57pNOT/XABDSiUvZu0wwZum74Gb1d19UYByJyNmZlnjOnG6DeTMXSoQheJ2kyQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5671 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 Add and modify the nfp PMD struct and macro that will be used by firmware with NFDk. Signed-off-by: Jin Liu Signed-off-by: Diana Wang Signed-off-by: Peng Zhang Signed-off-by: Chaoyong He Signed-off-by: Niklas Söderlund --- drivers/net/nfp/nfp_rxtx.h | 58 +++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index d784f52b66..106980b9a7 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -53,6 +53,31 @@ #define PCIE_DESC_TX_ENCAP_VXLAN (1 << 1) #define PCIE_DESC_TX_ENCAP_GRE (1 << 0) +#define NFDK_TX_MAX_DATA_PER_HEAD 0x00001000 +#define NFDK_DESC_TX_DMA_LEN_HEAD 0x0fff +#define NFDK_DESC_TX_TYPE_HEAD 0xf000 +#define NFDK_DESC_TX_DMA_LEN 0x3fff +#define NFDK_TX_DESC_PER_SIMPLE_PKT 2 +#define NFDK_DESC_TX_TYPE_TSO 2 +#define NFDK_DESC_TX_TYPE_SIMPLE 8 +#define NFDK_DESC_TX_TYPE_GATHER 1 +#define NFDK_DESC_TX_EOP BIT(14) +#define NFDK_DESC_TX_L4_CSUM BIT(1) +#define NFDK_DESC_TX_L3_CSUM BIT(0) + +#define NFDK_TX_MAX_DATA_PER_DESC 0x00004000 +#define NFDK_TX_DESC_GATHER_MAX 17 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define NFDK_TX_DESC_BLOCK_SZ 256 +#define NFDK_TX_DESC_BLOCK_CNT (NFDK_TX_DESC_BLOCK_SZ / \ + sizeof(struct nfp_net_nfdk_tx_desc)) +#define NFDK_TX_DESC_STOP_CNT (NFDK_TX_DESC_BLOCK_CNT * \ + NFDK_TX_DESC_PER_SIMPLE_PKT) +#define NFDK_TX_MAX_DATA_PER_BLOCK 0x00010000 +#define D_BLOCK_CPL(idx) (NFDK_TX_DESC_BLOCK_CNT - \ + (idx) % NFDK_TX_DESC_BLOCK_CNT) +#define D_IDX(ring, idx) ((idx) & ((ring)->tx_count - 1)) + struct nfp_net_nfd3_tx_desc { union { struct { @@ -84,6 +109,33 @@ struct nfp_net_nfd3_tx_desc { }; }; +struct nfp_net_nfdk_tx_desc { + union { + struct { + __le16 dma_addr_hi; /* High bits of host buf address */ + __le16 dma_len_type; /* Length to DMA for this desc */ + __le32 dma_addr_lo; /* Low 32bit of host buf addr */ + }; + + struct { + __le16 mss; /* MSS to be used for LSO */ + uint8_t lso_hdrlen; /* LSO, TCP payload offset */ + uint8_t lso_totsegs; /* LSO, total segments */ + uint8_t l3_offset; /* L3 header offset */ + uint8_t l4_offset; /* L4 header offset */ + __le16 lso_meta_res; /* Rsvd bits in TSO metadata */ + }; + + struct { + uint8_t flags; /* TX Flags, see @NFDK_DESC_TX_* */ + uint8_t reserved[7]; /* meta byte placeholder */ + }; + + __le32 vals[2]; + __le64 raw; + }; +}; + struct nfp_net_txq { struct nfp_net_hw *hw; /* Backpointer to nfp_net structure */ @@ -124,7 +176,10 @@ struct nfp_net_txq { * of the queue and @size is the size in bytes for the queue * (needed for free) */ - struct nfp_net_nfd3_tx_desc *txds; + union { + struct nfp_net_nfd3_tx_desc *txds; + struct nfp_net_nfdk_tx_desc *ktxds; + }; /* * At this point 48 bytes have been used for all the fields in the @@ -137,6 +192,7 @@ struct nfp_net_txq { uint32_t tx_hthresh; /* not used by now. Future? */ uint32_t tx_wthresh; /* not used by now. Future? */ uint16_t port_id; + uint16_t data_pending; /* used by nfdk only */ int qidx; int tx_qcidx; __le64 dma; -- 2.27.0