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 E6D5C45710; Thu, 1 Aug 2024 12:54:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 463E6433A5; Thu, 1 Aug 2024 12:53:39 +0200 (CEST) Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011025.outbound.protection.outlook.com [52.101.65.25]) by mails.dpdk.org (Postfix) with ESMTP id 0D7C4433A4 for ; Thu, 1 Aug 2024 12:53:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=a7iPiafPbk2GEmidt2ztSHGKu/djjz1/B3U0sk9LJGl3pIal9XmmwsKh9a4zeONiKjPis4ttJxTTjX8Dy2+BncXXztoaVHJIBtuIrqB+kkVt+8msywE3xO5qajWZc6lMMfFGEQmV16c227ElCQBy1fLauecicJOks03xHoiF+RBXlfguwntI5gTlmvBDDIlQ1oD0B/seZSBUEtbnqIs5ZsSlhVKPj6xCdaZn0dOZcGJ0/7aOBTiBTcuEgvco6sdOQwGoT04lfPdIUtCOTNryLSp5HJhnOm+Dt2gRkPLVngZJYJ+XlvLuiKZ3/ckl3TIfmx9F8HBVlZEA1hjIpSUHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/GO86gKT/3toxGxo54TpeNb/URjZ8J6EZlEB6PiMPSY=; b=Kidtsx0RNoYzEzDl6rlUGsh6Bl0UHx/xBHG7c2K5tzdxc3TB7XQSdYkds1cFWzMnjKtM5fEJHbqQfPdgiJ2izBu6YyF8valO9cHm8nhyGyVcqnyAB6+wxRrognPeckvRtoH/Y8mU7pLYjKZEgEh5XHESAVSjPTqs9Md9mvImtjaUepjQUlaqcjHenT1Xw8YTC5K+Bscy2V1f5MAA7Mqx6qhQLz12EdKJRelKGa8TuL2Ffov3cQFc0JiaWtCVZLqFH5yzhO4HqA96aLDvhnaxAYJ3eqFmEt93TxaPt9QkNvS2vawslj8z2KSm1pJiQ7nfacHTm1FEMVW9YfF5Hcj/0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/GO86gKT/3toxGxo54TpeNb/URjZ8J6EZlEB6PiMPSY=; b=LiSMlAkQPGkjZcxrZQuvY0pHItighMpkkZz7S9YUCt7FUtYoRSOcdMN3P9wGU58T6oxZk9lB6WXrT7LHhzX3V5yStCxOntuRg6baI6UkmYU8YYDg976rYFMvM9XJfmFjHyaOTERr7qKQHlQgE0uilxRkMpRaHFJtvvNNB96toQ4r9wEfcI+VSaxhTEejiUA3BO2hPOof6etUlfF5kxTgrgSbJc1pwnNzpecQZDn/j3lIrR+B247blLWoueQE9hkuSJV9siXuhHExU/YjKWrjM8EtZDl4aZ4MJg6vI5zLK5MjwYO9H3MWsSJmrUHU1DOp9jA3rkVszW2Aq6rV23PMpw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by AS8PR04MB8433.eurprd04.prod.outlook.com (2603:10a6:20b:407::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Thu, 1 Aug 2024 10:53:35 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%3]) with mapi id 15.20.7828.021; Thu, 1 Aug 2024 10:53:35 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Vanshika Shukla Subject: [PATCH 05/17] net/dpaa: support Tx confirmation to enable PTP Date: Thu, 1 Aug 2024 16:23:01 +0530 Message-Id: <20240801105313.630280-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240801105313.630280-1-hemant.agrawal@nxp.com> References: <20240801105313.630280-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0026.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::13) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AS8PR04MB8433:EE_ X-MS-Office365-Filtering-Correlation-Id: 8fb82040-5c75-4d56-274e-08dcb21830f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?er4SGo62bGpj8FFceHvXlycs778Q1oj3HzGiMeUjPnY6THgb+H3w11N/Jug9?= =?us-ascii?Q?7NVmEqRbrvQ+3BTtLaHr00V0/naEnbsuxkkQgRP4D/fGi0xa+B+Z9YhMb0dN?= =?us-ascii?Q?Z64n+413lR3xiHJXl5O9EQF1uHAnZAHgYwQ/m2/W8MJ3hKEaMxeyCJNvDj89?= =?us-ascii?Q?QhkZeWCg8CE5E+qZyErUCcYGcmP1DPtq6lylBYK/Kdlu/alnIrUcjOiLE4ru?= =?us-ascii?Q?OLaRr5AIgkoOguJZvBJ5HnxjY9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q?NRvFqWK5LN+zFPs0984qPutxKGkfglt8hTOfE9XR+I3RT+eEAskdPpV++HgG?= =?us-ascii?Q?eKtNi54OLFoPanbQBpuGi8ic6F7HvQlDtzAKxKdAB0YdQEafhxItk6nbQLzP?= =?us-ascii?Q?pk1g90n8v3OfVl2ci6cupeiBui0RQTr9ZhRIIrSntri/63R7FRjC3xl/MFIL?= =?us-ascii?Q?QufbD0jWXyeVa+iIwZKjyYN7XoWIbBIVkB6p7IsavnVMax8CJKyDwQJ57XfM?= =?us-ascii?Q?GJuqgDH7gBHn6/jsrd64XBYmA9bpb3kCmRXua5YVjnJW//dWNw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?r8I52CIaOxE09EpfQfsRtYuPvKy4ooQ+XDypMr2iQvrbr6S2GruWauscPKlm?= =?us-ascii?Q?mG5m+oM+o6D9z0SgQAQvw3FVMry3aled897dPNglqEHo03zh+vdbqaBxtX+C?= =?us-ascii?Q?qHOWk62paNnjgiFhFjaDuNxKEaaGMVDmX56Pzj+STJaXp+mmuGs81ijphIRl?= =?us-ascii?Q?UdDQWQF2RdLComj4GBilgR+V2QRgs0oGwNKFVk8hwJx97Y5qwC4C6AvhU4Zj?= =?us-ascii?Q?3y+nosIKvXH0M3Gahn7orWfRI9xOSr3vf1xo7X8gYHbzLLHEPWPq0payhtcz?= =?us-ascii?Q?OLXwFpPHGFfgUSRXUfA7XspxWNdnEfl1tVUrOSEdekFFcVO/6EExId7hTkwn?= =?us-ascii?Q?YncY5k0z/H4veDLQ/9stsYSlUZwn2VuOLzEegBstDWw4Mi5hMhP8AQhXPhPI?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oIM1aRZ9JhPWyyWMmm1JejuDXRtufSmO?= =?us-ascii?Q?wnNjtgts7TVY2o72QcbC8aXtt4yTWYgqURRNgU4iJumKjDsqNZaCgNI8n35u?= =?us-ascii?Q?PVbgGk9Xyqx1MZub7VdBDoJ8e60UZmO6XsIHqkJrvrZuJsOObe1j9NtCfcXn?= =?us-ascii?Q?HAnMD0VNLc4X8y/fn2+GKgbS7RBGnwnH69kz7eI3zEvhZrGvN6KXViY823IG?= =?us-ascii?Q?KBExb4BYAK+8iuvnRvV0DvsSWvPK9rIiSwdTSUgwnwdpxSewV1kFYlvkBQER?= =?us-ascii?Q?lBWLmikL+wwCSIIQ+h5TqFpac0pBi5Hog5njaJj6u/CYOcy/1Z/kxp8Jyh22?= =?us-ascii?Q?wQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fb82040-5c75-4d56-274e-08dcb21830f6 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 10:53:35.1990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B0D2JJKMOJVACYR6XXkhDY+VPheA6glO4Q6irG93G0QsTLbqv8mATO7S9q1NLv3/E5CCCqK3P/8V3tAGPrMnDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8433 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 From: Vanshika Shukla TX confirmation provides dedicated confirmation queues for transmitted packets. These queues are used by software to get the status and release transmitted packets buffers. Signed-off-by: Vanshika Shukla Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 45 ++++++++++++++++++++++------- drivers/net/dpaa/dpaa_ethdev.h | 3 +- drivers/net/dpaa/dpaa_rxtx.c | 52 ++++++++++++++++++++++++++++++++++ drivers/net/dpaa/dpaa_rxtx.h | 2 ++ 4 files changed, 90 insertions(+), 12 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 90b34e42f2..9ffb8c578c 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1826,9 +1826,15 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, opts.fqd.dest.wq = DPAA_IF_TX_PRIORITY; opts.fqd.fq_ctrl = QM_FQCTRL_PREFERINCACHE; opts.fqd.context_b = 0; +#if defined(RTE_LIBRTE_IEEE1588) + opts.fqd.context_a.lo = 0; + opts.fqd.context_a.hi = fman_dealloc_bufs_mask_hi; +#else /* no tx-confirmation */ - opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi; opts.fqd.context_a.lo = 0 | fman_dealloc_bufs_mask_lo; + opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi; +#endif + if (fman_ip_rev >= FMAN_V3) { /* Set B0V bit in contextA to set ASPID to 0 */ opts.fqd.context_a.hi |= 0x04000000; @@ -1861,9 +1867,11 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, return ret; } -#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER -/* Initialise a DEBUG FQ ([rt]x_error, rx_default). */ -static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid) +#if defined(RTE_LIBRTE_DPAA_DEBUG_DRIVER) || defined(RTE_LIBRTE_IEEE1588) +/* Initialise a DEBUG FQ ([rt]x_error, rx_default) and DPAA TX CONFIRM queue + * to support PTP + */ +static int dpaa_def_queue_init(struct qman_fq *fq, uint32_t fqid) { struct qm_mcc_initfq opts = {0}; int ret; @@ -1872,15 +1880,15 @@ static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid) ret = qman_reserve_fqid(fqid); if (ret) { - DPAA_PMD_ERR("Reserve debug fqid %d failed with ret: %d", + DPAA_PMD_ERR("Reserve fqid %d failed with ret: %d", fqid, ret); return -EINVAL; } /* "map" this Rx FQ to one of the interfaces Tx FQID */ - DPAA_PMD_DEBUG("Creating debug fq %p, fqid %d", fq, fqid); + DPAA_PMD_DEBUG("Creating fq %p, fqid %d", fq, fqid); ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); if (ret) { - DPAA_PMD_ERR("create debug fqid %d failed with ret: %d", + DPAA_PMD_ERR("create fqid %d failed with ret: %d", fqid, ret); return ret; } @@ -1888,7 +1896,7 @@ static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid) opts.fqd.dest.wq = DPAA_IF_DEBUG_PRIORITY; ret = qman_init_fq(fq, 0, &opts); if (ret) - DPAA_PMD_ERR("init debug fqid %d failed with ret: %d", + DPAA_PMD_ERR("init fqid %d failed with ret: %d", fqid, ret); return ret; } @@ -2079,6 +2087,14 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) goto free_rx; } + dpaa_intf->tx_conf_queues = rte_zmalloc(NULL, sizeof(struct qman_fq) * + MAX_DPAA_CORES, MAX_CACHELINE); + if (!dpaa_intf->tx_conf_queues) { + DPAA_PMD_ERR("Failed to alloc mem for TX conf queues\n"); + ret = -ENOMEM; + goto free_rx; + } + /* If congestion control is enabled globally*/ if (td_tx_threshold) { dpaa_intf->cgr_tx = rte_zmalloc(NULL, @@ -2115,21 +2131,28 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } dpaa_intf->nb_tx_queues = MAX_DPAA_CORES; -#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER - ret = dpaa_debug_queue_init(&dpaa_intf->debug_queues +#if defined(RTE_LIBRTE_DPAA_DEBUG_DRIVER) || defined(RTE_LIBRTE_IEEE1588) + ret = dpaa_def_queue_init(&dpaa_intf->debug_queues [DPAA_DEBUG_FQ_RX_ERROR], fman_intf->fqid_rx_err); if (ret) { DPAA_PMD_ERR("DPAA RX ERROR queue init failed!"); goto free_tx; } dpaa_intf->debug_queues[DPAA_DEBUG_FQ_RX_ERROR].dpaa_intf = dpaa_intf; - ret = dpaa_debug_queue_init(&dpaa_intf->debug_queues + ret = dpaa_def_queue_init(&dpaa_intf->debug_queues [DPAA_DEBUG_FQ_TX_ERROR], fman_intf->fqid_tx_err); if (ret) { DPAA_PMD_ERR("DPAA TX ERROR queue init failed!"); goto free_tx; } dpaa_intf->debug_queues[DPAA_DEBUG_FQ_TX_ERROR].dpaa_intf = dpaa_intf; + ret = dpaa_def_queue_init(dpaa_intf->tx_conf_queues, + fman_intf->fqid_tx_confirm); + if (ret) { + DPAA_PMD_ERR("DPAA TX CONFIRM queue init failed!"); + goto free_tx; + } + dpaa_intf->tx_conf_queues->dpaa_intf = dpaa_intf; #endif DPAA_PMD_DEBUG("All frame queues created"); diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 261a5a3ca7..6aced9d5e9 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2014-2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017-2019 NXP + * Copyright 2017-2021 NXP * */ #ifndef __DPAA_ETHDEV_H__ @@ -131,6 +131,7 @@ struct dpaa_if { struct qman_fq *rx_queues; struct qman_cgr *cgr_rx; struct qman_fq *tx_queues; + struct qman_fq *tx_conf_queues; struct qman_cgr *cgr_tx; struct qman_fq debug_queues[2]; uint16_t nb_rx_queues; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index c2579d65ee..189af748e9 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -1082,6 +1082,11 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) uint32_t seqn, index, flags[DPAA_TX_BURST_SIZE] = {0}; struct dpaa_sw_buf_free buf_to_free[DPAA_MAX_SGS * DPAA_MAX_DEQUEUE_NUM_FRAMES]; uint32_t free_count = 0; +#if defined(RTE_LIBRTE_IEEE1588) + struct qman_fq *fq = q; + struct dpaa_if *dpaa_intf = fq->dpaa_intf; + struct qman_fq *fq_txconf = dpaa_intf->tx_conf_queues; +#endif if (unlikely(!DPAA_PER_LCORE_PORTAL)) { ret = rte_dpaa_portal_init((void *)0); @@ -1162,6 +1167,10 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) mbuf = temp_mbuf; realloc_mbuf = 0; } + +#if defined(RTE_LIBRTE_IEEE1588) + fd_arr[loop].cmd |= DPAA_FD_CMD_FCO | qman_fq_fqid(fq_txconf); +#endif indirect_buf: state = tx_on_dpaa_pool(mbuf, bp_info, &fd_arr[loop], @@ -1190,6 +1199,10 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) sent += frames_to_send; } +#if defined(RTE_LIBRTE_IEEE1588) + dpaa_eth_tx_conf(fq_txconf); +#endif + DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", sent, q); for (loop = 0; loop < free_count; loop++) { @@ -1200,6 +1213,45 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) return sent; } +void +dpaa_eth_tx_conf(void *q) +{ + struct qman_fq *fq = q; + struct qm_dqrr_entry *dq; + int num_tx_conf, ret, dq_num; + uint32_t vdqcr_flags = 0; + + if (unlikely(rte_dpaa_bpid_info == NULL && + rte_eal_process_type() == RTE_PROC_SECONDARY)) + rte_dpaa_bpid_info = fq->bp_array; + + if (unlikely(!DPAA_PER_LCORE_PORTAL)) { + ret = rte_dpaa_portal_init((void *)0); + if (ret) { + DPAA_PMD_ERR("Failure in affining portal"); + return; + } + } + + num_tx_conf = DPAA_MAX_DEQUEUE_NUM_FRAMES - 2; + + do { + dq_num = 0; + ret = qman_set_vdq(fq, num_tx_conf, vdqcr_flags); + if (ret) + return; + do { + dq = qman_dequeue(fq); + if (!dq) + continue; + dq_num++; + dpaa_display_frame_info(&dq->fd, fq->fqid, true); + qman_dqrr_consume(fq, dq); + dpaa_free_mbuf(&dq->fd); + } while (fq->flags & QMAN_FQ_STATE_VDQCR); + } while (dq_num == num_tx_conf); +} + uint16_t dpaa_eth_queue_tx_slow(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) { diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index b2d7c0f2a3..042602e087 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -281,6 +281,8 @@ uint16_t dpaa_eth_queue_tx_slow(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs); uint16_t dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs); +void dpaa_eth_tx_conf(void *q); + uint16_t dpaa_eth_tx_drop_all(void *q __rte_unused, struct rte_mbuf **bufs __rte_unused, uint16_t nb_bufs __rte_unused); -- 2.25.1