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 1D0EBA0547; Thu, 16 Jun 2022 04:41:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 624C442BE8; Thu, 16 Jun 2022 04:41:19 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2122.outbound.protection.outlook.com [40.107.94.122]) by mails.dpdk.org (Postfix) with ESMTP id 8FD6F42BF2 for ; Thu, 16 Jun 2022 04:41:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KtmXoLZT5QuNPNmFX3kxHPJc1uZ1gsLqX414SYdF5eLZME/lJ5V7t0lUXC5Fjysk4/o82p4fP+ZgHers01C14QXC9uJeICztBGRIJhVq/mzIwLpubvZWL6tzSdMAN4QVS+QwlzIw/Lt64RD1Aj7c1tznFXIzD5KjB8EfmA4Uq49YoKGK4y6WUlAujAXa6dLzSuhFwQkWehm/uQEoM7XCVUPOyl2M0eDPQzsbaPnGNifUpE4aB8tdah2JfFMj0cTqSVFQQ3qr2MZ6F40MWZaHFWiQJbKdLRouQ7t3S2yrIeGnUybNkCT6HdkMkpuTMn6MhIdigEJBix+hQVRiX6zYHw== 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=T9IYLRe61eY6wqWxKPTYBPcgsF7jiIBe35R7YxQ3ADsCVihzv+UtAwbxYtJoEA823Lv7GGLPvCHqZVFuUyTgxTcozV0DdRLPW5xRVfdBFSU5pC7sa50CTsU61LIzfpTS8NDyusca6V2Hykk+6dnXoltAttXO9ZkRpW2OdTy/ziFNbtm/y+EPD+c94EIBS6LjGz8iRcAGEM0+MTknTcZymxbzGnUaEMlBd/BUyCwMSUWKJlvdO5powB3wnBH+r0qGC+pRHBl+9uf3IAeiIwo+HlYV2ps6Z8VA7HdIYHesOx0gM+CuX4QCBwV4nf/YilHj+c2OcniqrsEdj/Ukajb9tA== 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=eyT8TcuPqr1WIJyVpAC5QwIRHPemRmmp0naBsMJML3rZAvCOz3sRpAkObB2Xzbgf5dqj6yDC1kFcUsC0XsobX8kNVItTYf7wjZXqrOVoV827kMJIIJY8WxwxQFY7HjEzjdzlb/dUgJyojHYLJmhwjVRc6hHEwNVxj/cQW9cXDzE= 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 DM6PR13MB2345.namprd13.prod.outlook.com (2603:10b6:5:be::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.9; Thu, 16 Jun 2022 02:41:15 +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.5353.011; Thu, 16 Jun 2022 02:41:15 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v2 10/15] net/nfp: structure adjustment Date: Thu, 16 Jun 2022 04:39:34 +0200 Message-Id: <20220616023939.1798769-11-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220616023939.1798769-1-jin.liu@corigine.com> References: <20220602015304.710197-1-jin.liu@corigine.com> <20220616023939.1798769-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0087.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:190::20) 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: f30a4c8d-3573-4fa4-224b-08da4f41aecb X-MS-TrafficTypeDiagnostic: DM6PR13MB2345: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: 4u2Yaxt3XJlLj8//aU9dWGLe/uBah4bg3A2fQ/8iGlq6x4ucqHWen6w5AxlVg04NldCZ5HS6o7ptOZk1s/NBoExkX3qdv8Kisa+jd2YRktv0yljnv+C+LKLMcSNb74TExnpO8Ba4jz9Rq1XZtClEFlg6zkIkpq0NUQbIEvJK1WjRBS7x7P54CNdc9/e3wMo1O6woCm4276aUADqId8fK3V0qE9aWfHLbeg9keRalooJSgYfCT6YRiQZSIdELbBvV7H35lv//aBeSFPSdEGJjNcYNqtQp/9HmjC97njjpgmk+sPhhNCo8YbjTM5LfD9eDbBt3yMmkCfCdpmEYdNWyarDuOor1EdnQQjiGJikdqfaXyTT49WaBPeLB5RZD3AfQ8BVUMQRhyp3UN2d4XqPj+09BvoPAxuJwLemSWxIP5QZlGjoti24Taz+uDZdjOzfzy7WQXMc4MMZF6xIXBN0aDBJCyaF5yT/u2HVOhC0hpDjOhVw3y8TxeQA/T5AyuUoEGE5wv9oJa7xoL0UFqcnghy9SHLkBC9CA6r8EPFEhwkK2lcXCuIsszEmQuem3LMqKLByFwYjrgiMzyaaYIEf7vFGWk+KKLU6DVzwrGTiy+1j7tyJ6r4uGH+lz+VImgrSSYp9Os3eitNaoeTtcPdC8RGXPvls6fI05b9fiRKBuFtZlKOwqok/DRclrYF31vQkyUgi+L3VSqMV8cU/WB51DAQ== 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)(396003)(366004)(39830400003)(136003)(6506007)(6666004)(26005)(316002)(66574015)(186003)(107886003)(6486002)(508600001)(41300700001)(2616005)(83380400001)(1076003)(36756003)(54906003)(6916009)(66556008)(8676002)(2906002)(4326008)(44832011)(38350700002)(6512007)(52116002)(5660300002)(66476007)(66946007)(86362001)(8936002)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z2JhRXR0WVE4OFlEYmtZcmw5WHVkMUxDS2U0UEZieW4yZEZYVlFWcU5HdER4?= =?utf-8?B?dVdKTEhrYnZuN2MyUmllNEVKRW1peG9PdjZhaWF6RUlMaElsZm92a1NrOVgw?= =?utf-8?B?anZUYytUWHROcm9CSDlXTUlhcm14T3o3OEhrbEFreTgvWUJ2SGhTaUZETlpY?= =?utf-8?B?ZDkyNWpNSlczei9XQnhjZ0tWRlAvNVRnV0dlZVdMcTRPK3I2Q3BXV2tNeGhB?= =?utf-8?B?amZ1OG1pd0JRWVNtOFN4THJoa085NFJySnVRZFgrdzBWRkJNRVg3aW1PRVVk?= =?utf-8?B?cVk5dDlnNklHMFZTTmpkOEJOL0xJb3lvWVlJQnRjK2Z2aVVG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WJoL1VEVzNpcVpJMUhHVGx3K1UrZUFK?= =?utf-8?B?eC85aUhiV2FOS2hJYWpjYmMrRXRydmhjQkxBS0FtM1JVYTE0MlFQdDMxK3lm?= =?utf-8?B?QkFDdkwzZllueGdWMDYwUm5IUnpLR2hpSXpIb01LRW1BaUtGajdRNjVjQmM1?= =?utf-8?B?MTd3Ym0wdEdDMCszNmFWT1NOWHRuYVdzZUR1V1luUk15eXFmVUdldz09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: f30a4c8d-3573-4fa4-224b-08da4f41aecb X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2022 02:41:15.2863 (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: cMXJSdSsLgbPfXXF9KWMkt9uZhZ5f4HB/SHVLD/RBThIGi+2XQfTsjGKpMS4bpmie2z/4gAYIP8sHZUcfXbcRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB2345 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