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 A4599A0548; Thu, 2 Jun 2022 03:55:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCE9542B70; Thu, 2 Jun 2022 03:54:57 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2126.outbound.protection.outlook.com [40.107.223.126]) by mails.dpdk.org (Postfix) with ESMTP id E78B9427F9 for ; Thu, 2 Jun 2022 03:54:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dxZahbbbx8SL/vdRCB+4+lc6IprOi1yyFc4HJZfWNEitYx1RUouDdF0iokLd5Yv0Fm+Izn81Jm5kh+oIyhS4gPQQZwfCy04bvxrNkwgiRZPtWLGmAjhfZ1Uea0DKQUIP8b7/fdphDQlje1G5uP9UleOfVE+7QmhPuUfnre2SHmPse20RqeURSq7/Qe1PZORY0JIC92rOpzQ5Fx3047qnSN8p/tH+2Mk1bgtw5uqozf0AjfdHJgB+qhEVKgq2FjqU+V1HGaodLbYV2a6y42huA2cLQrVDQGuCy3lBoESFKiQKFwLtIlCS1DzXvlo2H6sLelZ6LFhaIax6/+k4B3rX4g== 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=a6ZPD1WuwS/LCmRCXYwMwzh1AbaquzRwNQ0QjKmaFQY=; b=hB/7ICsf4e7lmaJvJUUaciXtjt2xf7p4Um/kzf1z1SAdFJci/svjB0UZFBde/UJkLYYtT11+JF3IAQGkNZUUsnbG3uYzkhJbKfgGdV8S48M/DuVJcCNrPLhGEzQl6DRrKl02U37jfIV+SlZkP5g5j4zJpGu5rtJStqygB/igj3B2HwT9pq3tyQaO7ysBl2Ip6MwFC/L3F93TUjyczK5ggunyuqkI9eB7zUS+wc2qX3+jhWiZ9gE/0sRXVeW6M0ZTFaOt4ej6F3KCo/Ad/mEqlzVczCytu8EE15QysXaKu9BI7xKnck7JYmfiE842dDYoNJSTKHBS4s28TU8632IXwQ== 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=a6ZPD1WuwS/LCmRCXYwMwzh1AbaquzRwNQ0QjKmaFQY=; b=QXBWf77Kob6KgbN/6cK+VOhF725XnDFsz9XRnYwAGaAE4r2KM2VpvXuuKyzKZeAYxM3imwnpsfEw0Wym7x56rd2nBPHnHFf9Cr3QkdcPWU+SJ4cLLS+M+v7gkwqYdk3iRFkulPgmRDnKROnXs0ZZj77vz9Clth5bLYeNUeDD0DM= 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 DM4PR13MB5858.namprd13.prod.outlook.com (2603:10b6:8:46::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.11; Thu, 2 Jun 2022 01:54:54 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753%4]) with mapi id 15.20.5314.013; Thu, 2 Jun 2022 01:54:54 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH 08/14] net/nfp: structure adjustment Date: Thu, 2 Jun 2022 03:52:58 +0200 Message-Id: <20220602015304.710197-9-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220602015304.710197-1-jin.liu@corigine.com> References: <20220602015304.710197-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0457.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::12) 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: 8c2aae55-9734-498d-75ab-08da443ae357 X-MS-TrafficTypeDiagnostic: DM4PR13MB5858: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: Mt1aAFK/gy7SK/mTxCoIZUqCDfUSaWwRDDRWIO97rCuYUXxJ8krqVow7V4FGpLkETV/YeL3oFOhAmo+HVkGbZO+xERH+P3OLA9wbX8/xcyoyrIFB/5WmaseTVZdyaE1QXL9bfcZLgX4SjnoG57/5iusMjHl4+OymLwKu8hnQk8iI2JT9GoTwFRHlx21yiFcG3UkT2dXLuMhOZxA6+eQYAguvkB+l7MdXc75LTzsEtoQlyjhk6JpshicwLx8+JVsBcIVBRa5DFdolKNDmowxPj5020vDmnSBHEkx1VLdTH1owJHXt/c5TUQAERGh4obb0EiFP4b2v8WrA57TkRShJ8c55x3ZetV4KDfbchihbylG4qPBpxNbvNh5sEsVKR50AuzMcWE8z5qHEVkWo2uOCAaervZ/5UXvtofNLzbdgDO6qRHn4ja7QQ4LWmtHM8X4XYVzrpBPizbaKB96Lwd9v6dEPKtEyxeEps/Hni6cI6es1cuNy+u3nGyOQeLCbOiMafRFfEkKToBl2cz8QzZmvEwhaHrRPHZOhaCMGooGgYGf4ZcaDKKS5k+Ccvexd6tO1l4bYGTDdc2JB6cW18LDnY4KD3SyBUJiD14wlFLl1NWesrwpljqXU2dfaIcxH2qBhZrCT7lgnoAQY66Tm+60sHAzvGwhWqUK6a8lxC2N5AIxrvOsSwRi/ZtRE1pMeDthwNais81izvBFAmhokiuWmGg== 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:(13230001)(4636009)(346002)(366004)(396003)(136003)(376002)(39840400004)(36756003)(186003)(66574015)(83380400001)(5660300002)(4326008)(44832011)(8936002)(2906002)(6916009)(54906003)(1076003)(107886003)(6506007)(316002)(2616005)(41300700001)(8676002)(66946007)(66476007)(66556008)(26005)(6512007)(52116002)(38100700002)(38350700002)(86362001)(6486002)(508600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RFM3ZUhtMWRvR3pmVWNJVnVZOVVPWkVZL0hBT3ZDZnVLQmFNUjgwQjcyUi8v?= =?utf-8?B?N2tqVURvWmlIR2N4TmRjQ09BWFpiSGxsTjlrMVdQemh0c0xqbVFLaFF5TFRC?= =?utf-8?B?MU0xcDdmTzBXM1NIUUJIeExnU1hXS2dEenljRFdGMmtOSE1nckxwNnNJby92?= =?utf-8?B?K2NpSC9sckczUS9uaEp6dW84RVpKbjVya25zd1k5c1Q4WmI0c2U1R2pxS0RU?= =?utf-8?B?Nmd0REgwRDlwd0l3NW9pcmVhc2JzUE9EZmQyK2RJQUNDSlQ5VTh3RHF5alJi?= =?utf-8?B?VWhHbktjd2s3ZEJ4dFNxR01WQmFvZFdrZDhkZWQ1QitGZUtLWStXVGg2cUVI?= =?utf-8?B?TTZsQnN5bjBUblpMZVg4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Tk3VHk0ak9RQVVsSVk2S3doa3V6RTE4Nm80OFFDd1ZWd0FIYmli?= =?utf-8?B?VjlzZFNmZFRuZGtvZzZKZ0c0dW1LTWdvT2FZWUkvSTRsNS9tdHZrUXN3Mzlq?= =?utf-8?B?aytBNEFydkNJcU5GelV6c1VWVEJwVWMvVTIzZHJURmNFRzN0RWhzZz09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c2aae55-9734-498d-75ab-08da443ae357 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 01:54:54.1954 (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: zpGOyWrUik9eKSAo6H2ChkdejYUVHLf/LDdYSG1shakWmlg3Q9TJMYlkaD9cDvoIXN/FohA6tvhuBIYgCzrVpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR13MB5858 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 NFDK firmware. 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 | 69 +++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 87a9c59b3b..81e2f7560b 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 */ @@ -114,9 +166,14 @@ struct nfp_net_txq { * For each descriptor keep a reference to the mbuf and * DMA address used until completion is signalled. */ - struct { - struct rte_mbuf *mbuf; - } *txbufs; + union { + struct { + struct rte_mbuf *mbuf; + } *txbufs; + struct { + struct rte_mbuf *mbuf; + } *ktxbufs; + }; /* * Information about the host side queue location. @txds is @@ -124,7 +181,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 +197,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