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 E56DDA0545; Thu, 23 Jun 2022 04:27:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 225B242B80; Thu, 23 Jun 2022 04:27:21 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2129.outbound.protection.outlook.com [40.107.94.129]) by mails.dpdk.org (Postfix) with ESMTP id 9A8FC4069C for ; Thu, 23 Jun 2022 04:27:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YuedeGBevvv9mKsL2HBVDa5iMgABBYgaLRbyjCXTPWwZOVE/da++rn022UmuuR1q5eUxSGQaCDMBC1c1R9U+mMZtN3HsLeFU9+vQK8FkbgRRcUi87aBJ+2jXB+gvErbYVL0B0qNYM1yMwHTuKzp5WqTTiDL0CBZD6MyjSX957coyBF0wEmvEiLop5tCq4m5jvyYlT4Evp7C7z5QFW1GU3AIxuqkFCPVSJjRJYBB8nl/Xrk2q0IXx9AbNVBazcrRJna/AMWigIWeeg5tpOfeEpztH2S3mMumM1T3W3BxT1j4Oj9TLSgqMX8hjFD9xBExVSjSOZ1Fv3a1CM60gpyzE2A== 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=PeiNp0BFgmrbI+YqDS1HRD0mhWzLkkAoYSteOHU1VzkUi0VZLhHdKzFDD7eKDzjtXYkQ2faChtwsIgeesZaYOBG6eCa86+JWPWvEuL9pqLXRJ+ArrW3TMFJw1+EMEgp2k5Fmw1rZUaSJJ0iDXubUAmT1luel+lRlysSZG8JpRLjGEslT4477cCTVdWrciFLbau7ynFAISKnzZONLVi14W2AsweKyDl8b6moFeGNVi1JEjdgIy1xkuW/pxuJWA+b7UwlBdQXjS9E4w7tfLLP8PtaDHDwwsrBJe74TKC7ZukVgTI5RdG6i/CIPDXo7TT5hTjTx3KyJN88VHwb8zNNrsw== 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=MOCBm7b+ON8pnBcN1UftSaeC/pVIdAkyqdQrGzlnASX9Dc0+sfybGc0lOsPxt0MyKai4/jBZCA5hB/tuKWEODOHdvc7cBQ8wH3HyaLV7b5BJAQx6fwfSMlkHVsIhYIW4kAbUr25gCRoj6StfICnOTaA3iolGI4ttxjGn7VxCN+A= 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 MN2PR13MB3535.namprd13.prod.outlook.com (2603:10b6:208:169::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15; Thu, 23 Jun 2022 02:27:13 +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.015; Thu, 23 Jun 2022 02:27:13 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v4 08/13] net/nfp: structure adjustment Date: Thu, 23 Jun 2022 04:26:10 +0200 Message-Id: <20220623022615.3628093-9-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220623022615.3628093-1-jin.liu@corigine.com> References: <20220617093444.2004000-1-jin.liu@corigine.com> <20220623022615.3628093-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0222.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:33a::10) 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: 31ab9d58-158d-4fb7-26d8-08da54bfe1b9 X-MS-TrafficTypeDiagnostic: MN2PR13MB3535: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: KZM99Zn33Q10yRcmMO3vbgGoA/HKzTmFD2YGwyrh0QSTyOVuPehrcyLj+ah/GLOMZq9/PrrC7fVONW8qG7X+AzmjVtDb+xBpAq72bzqCK8mwaaYMRjEVQa5vRU7BabbothDDwZQ+jKKvZjQyfiX9OetZOEiTtq9OLo0CJM/q96tUxIGOJTiKsRqJREL5aLo4y/Hnef53D4WYVxMYypeUoOVceVP+QQ9zFNNk7ajlXYHDE5rEv+65bFROpfbsKxhybwoUUMgB7KchBIpHbC5Pvxbu1wyGgmqwdEeZvku+LAKrLsaA21gpWeNleExmgsBGYh4E6QkO+KdxI4ipnLbhDOwLjykjlqeOxxhEoEcMzIkwHONJMhZK0LpHNFpI4v9UrBgXD+t7HxEKfu3+PJw2T0Z2GbK9Q8XgplTv+xj3c5wz7yrjc1P6FQ4ddqadpdO+h84ZAzNiJhgQLzIBWRJOWi/qmKlQkMAXuQbww8PoC0CeKXtSHfO/vNWm4cUMxKh7j/7GlDIptUdeL/gyoBLTrwV9iNyL1tVNWcCh5/CA6JtLJWmIbWqQTG+6KMaiulBmddZW7M64LrLevnGT1IZrGtUIeTjcMdkYkJ/AZcKeGLnipa/C820cNbz2Nrl+6lr3++TiE8Kx4GM/Sm0EaCplt9S7ElOoadQXUTqwjNd0UOv0faoDXTNJZNDm9pryNBOSeOeHYxPNQuOCYF5oQw8Im0vO/Fa01Z/Dg91qKy7JDm1qp8PA5pqZ+fzdO8MIQPT3YCKz/HMzFpWgMk7jMu1p+AjLHyUTh9dypk7IeSr4pG+NV59ScvxhEdKfR247Jmkx 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)(376002)(366004)(346002)(136003)(396003)(39830400003)(107886003)(1076003)(38100700002)(38350700002)(6486002)(36756003)(66574015)(8936002)(54906003)(2616005)(6916009)(5660300002)(316002)(66556008)(52116002)(6506007)(186003)(66946007)(8676002)(4326008)(66476007)(41300700001)(86362001)(6512007)(26005)(83380400001)(478600001)(2906002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bkM2enJhbWI4dXdKK3lDL0lQaE9OdXI5b1ZXcytMZzlPKzFsVVRDWEZIR2Js?= =?utf-8?B?ZWlMSndGSFNFSTVqY2ZoZ3Nod25RMjBncWZBM1hjdTdDU1VpL3FMRTlHZUFF?= =?utf-8?B?Wk1zeW42QjJHcTZmeGNYNmFyZE9hKzN1RXNaQmxoL29wSGk2bElxY2g1VDJ6?= =?utf-8?B?ckJnUWhOU1h6d0RScVhkOHU4QXJnQkpVc0pQZ21vckh3b0dYR3hKQlNwaUhU?= =?utf-8?B?Q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cm1waWNaRldsbUNkOGlVdkJpbEZo?= =?utf-8?B?T2VvL2ZEWjlKZW9nMk9SbFF2Zmc1U2tjenpMZWdwb0IwV2cxVjdWUktZRGth?= =?utf-8?Q?nJyZ3lFeG6iYkPCX0QVoQSXef?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31ab9d58-158d-4fb7-26d8-08da54bfe1b9 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2022 02:27:13.1184 (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: 5KULBCti671cCB0DLU5UTAUS2QeHNGOeKcTf404kw8uh6AM1VMP0D7RJrMZ5xw7bc9jocZAKGdbTedyMzeYGyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3535 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