From patchwork Fri Oct 7 17:43:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Boyer, Andrew" X-Patchwork-Id: 117595 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 03BE8A04FD; Fri, 7 Oct 2022 19:46:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1008A42BB9; Fri, 7 Oct 2022 19:44:47 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2078.outbound.protection.outlook.com [40.107.95.78]) by mails.dpdk.org (Postfix) with ESMTP id 7C64A42BAD for ; Fri, 7 Oct 2022 19:44:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AWbKlKXb1XanufCELeOkBPw/gfJn5FmOSrByAqjjih6BllAO9Ubdw+W0ZDaV6KmGk0Ne9PAZSFR9dWYtHy3eXYXXd5AUXYAj/SUVh537afOLeezQhxNrm/aJMdrumW1gUW8Aknmz+wlQwQIyMQgRMmcoe9yUTI2rBR+/TBrMrM/Y11on9x6lQuPuHiWSAkqGJkf4Dm8LbTZ9wZnBMFHXl8eUl8UfUG6jIqKN/Ouxrzd/erJOqKbqnscSSek1jSNx0AY3bCRWcdfnUF7VuD7c9wwEAvdnDbghcEKXq+7TYB9sQY6/1PiCayJa3hxUkIPgS8imVPn7Pj34LX5MIDED9w== 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=7RhvggWNLzhmXCqos9vjFZxKP84MIXmmsJ55mHfxVG0=; b=J7tbXNoqsIzUEsHV58U69WIWMJNBMDgPW2EwpCtQHN8cNojkEk2oIISpwdR5Gois1dEzvDgc9j4vgTzhuFyfhnwB4c0p1+XpnmqkbmHLWmTq5qY8fhzT3o9FXozIPzV/iMIyJGr+5hVCR2z3DM75vuP8oFk6jdZWBMu+N21qLYZNhzN2C6BmnEO/GtpPaLA+mGIIp+5SAB3U7ttG5JP+diSjOf7snzHQNABr7Gsp8gr596iW29JGaI1dTCmCEWpE2QD6uQKaM6lSbjPLZMkoLTHa0T4tuyD8NA6tbBAwHRTRLImuxQ4Xmv/ofj2csMGlvqC2c7ft14voMsV3KUmH8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7RhvggWNLzhmXCqos9vjFZxKP84MIXmmsJ55mHfxVG0=; b=4t5tUfTLnD3mjhWA09fdTG7M5QhkaKuKv+BrgO87CjD8U7QU6we35+q0FZPWYebXnR3yuAtmP84bygksKoACMX7BBHC2U9wQ6AgFLMCsqrb12mv2QnCOGJN+V/XXJODCFRqhuhHxsRJhAoeQ/61v/VoAgX6n40D2U9rsdpDDIyU= Received: from MW4PR03CA0005.namprd03.prod.outlook.com (2603:10b6:303:8f::10) by SN7PR12MB6864.namprd12.prod.outlook.com (2603:10b6:806:263::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Fri, 7 Oct 2022 17:44:41 +0000 Received: from CO1NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::8c) by MW4PR03CA0005.outlook.office365.com (2603:10b6:303:8f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24 via Frontend Transport; Fri, 7 Oct 2022 17:44:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT055.mail.protection.outlook.com (10.13.175.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Fri, 7 Oct 2022 17:44:40 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 7 Oct 2022 12:44:39 -0500 From: Andrew Boyer To: CC: Andrew Boyer Subject: [PATCH 15/35] net/ionic: free all buffers during Rx queue stop Date: Fri, 7 Oct 2022 10:43:16 -0700 Message-ID: <20221007174336.54354-16-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007174336.54354-1-andrew.boyer@amd.com> References: <20221007174336.54354-1-andrew.boyer@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT055:EE_|SN7PR12MB6864:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f48798a-dc68-4cbe-3335-08daa88b9ccc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XIk0nswQ5wphB5OlfZkN5SRRQRJ1RXRf7bFw3KoeU5kY4O502g/2TpNYpZaKZ3wCGAA+0LViHgH+vmaecK21Dl+v9o7neuNSWp1ylnoK4lIgjEfgkzKXrJLtqXMzzNedk1LYguIMtpcFELzxnGdrYsovQUzkSyBvwDJ/2UHbkto1i5bTw+hgTFEzwW4ht4tP6D4kA4aDp3m/pBFzFspKtOQg5pNq4vBCjV0Gd/VlJuhBmQkfPggelxolVdA8faRequJZFP7uSjn5x4ASMJ8i5wr/tXXkX0w3tsAmZNVMOXhrY/Uh8oTsV/HQBhvSMvExIQPfIuYSJsYbkX5vd9yiyin3iFmpWFyhwcq+DYLTKrsKjLUHgpeGmZpBR6O0GJ42Fns6mCuAI8uGKvpOUREcGpO/BJFYpFyg8SPap5oZ+wc89flwa+paN75G3hWr6uvPL/J2u84rwjVInXbji033DnS57oAriFQ4E1U5aL9riZ6Fu/0U9pSd98pcp6TGZvp5dvnwOC2uFMVBVm0xCOXSpkpkyu7cZHm0H39gPVBXHA+LtdDRF9nYaOtaO/UWYyHOAr7wQJlkwDX3UKeTgAJ5bl3259QosMNI2zZi9ypuG2T42zmZAxNx/COBJtdIEM6N+KzeTQNm+J9DcEEa2hb/FyAZG7Ke4xJf6acl+32st8a3End8vy5u5H3w9ps+xm2l7AFTfiDBTrsTYlhXTGsUfu8c7iJrfUn7UFFyW2KwG29BKVEjerEjVthrLDUyCSzgv8/YSt6raETLPvRE+756+u0EbrAfRVcnRTd6ye49Qn2TTZID4sqhPu6EseTfL5J+ X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199015)(40470700004)(46966006)(36840700001)(70206006)(1076003)(356005)(336012)(81166007)(2616005)(82740400003)(186003)(47076005)(36860700001)(426003)(83380400001)(44832011)(26005)(5660300002)(82310400005)(16526019)(40480700001)(8936002)(478600001)(2906002)(40460700003)(41300700001)(6666004)(8676002)(70586007)(316002)(4326008)(30864003)(6916009)(36756003)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2022 17:44:40.9176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f48798a-dc68-4cbe-3335-08daa88b9ccc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6864 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 Free all of the mbufs in the receive queue when the queue is stopped. This will allow them to be resized when the MTU is changed. Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_dev.c | 16 +++++ drivers/net/ionic/ionic_dev.h | 2 + drivers/net/ionic/ionic_lif.c | 32 ++++----- drivers/net/ionic/ionic_lif.h | 4 -- drivers/net/ionic/ionic_rxtx.c | 116 +++++++++++++++------------------ 5 files changed, 81 insertions(+), 89 deletions(-) diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c index d0d2ab1b17..e31ce4b2ef 100644 --- a/drivers/net/ionic/ionic_dev.c +++ b/drivers/net/ionic/ionic_dev.c @@ -317,6 +317,15 @@ ionic_cq_init(struct ionic_cq *cq, uint16_t num_descs) return 0; } +void +ionic_cq_reset(struct ionic_cq *cq) +{ + cq->tail_idx = 0; + cq->done_color = 1; + + memset(cq->base, 0, sizeof(struct ionic_nop_comp) * cq->num_descs); +} + void ionic_cq_map(struct ionic_cq *cq, void *base, rte_iova_t base_pa) { @@ -379,3 +388,10 @@ ionic_q_sg_map(struct ionic_queue *q, void *base, rte_iova_t base_pa) q->sg_base = base; q->sg_base_pa = base_pa; } + +void +ionic_q_reset(struct ionic_queue *q) +{ + q->head_idx = 0; + q->tail_idx = 0; +} diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h index 3b8e9fc3c2..f72c05342c 100644 --- a/drivers/net/ionic/ionic_dev.h +++ b/drivers/net/ionic/ionic_dev.h @@ -225,6 +225,7 @@ struct ionic_doorbell __iomem *ionic_db_map(struct ionic_lif *lif, struct ionic_queue *q); int ionic_cq_init(struct ionic_cq *cq, uint16_t num_descs); +void ionic_cq_reset(struct ionic_cq *cq); void ionic_cq_map(struct ionic_cq *cq, void *base, rte_iova_t base_pa); typedef bool (*ionic_cq_cb)(struct ionic_cq *cq, uint16_t cq_desc_index, void *cb_arg); @@ -232,6 +233,7 @@ uint32_t ionic_cq_service(struct ionic_cq *cq, uint32_t work_to_do, ionic_cq_cb cb, void *cb_arg); int ionic_q_init(struct ionic_queue *q, uint32_t index, uint16_t num_descs); +void ionic_q_reset(struct ionic_queue *q); void ionic_q_map(struct ionic_queue *q, void *base, rte_iova_t base_pa); void ionic_q_sg_map(struct ionic_queue *q, void *base, rte_iova_t base_pa); diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c index 220a4fdacb..578e36e60c 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -30,25 +30,7 @@ static const uint8_t ionic_qtype_vers[IONIC_QTYPE_MAX] = { static int ionic_lif_addr_add(struct ionic_lif *lif, const uint8_t *addr); static int ionic_lif_addr_del(struct ionic_lif *lif, const uint8_t *addr); -int -ionic_qcq_enable(struct ionic_qcq *qcq) -{ - struct ionic_queue *q = &qcq->q; - struct ionic_lif *lif = qcq->lif; - struct ionic_admin_ctx ctx = { - .pending_work = true, - .cmd.q_control = { - .opcode = IONIC_CMD_Q_CONTROL, - .type = q->type, - .index = rte_cpu_to_le_32(q->index), - .oper = IONIC_Q_ENABLE, - }, - }; - - return ionic_adminq_post_wait(lif, &ctx); -} - -int +static int ionic_qcq_disable(struct ionic_qcq *qcq) { struct ionic_queue *q = &qcq->q; @@ -133,7 +115,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats for (i = 0; i < lif->nrxqcqs; i++) { struct ionic_rx_stats *rx_stats = &lif->rxqcqs[i]->stats; stats->ierrors += - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len; @@ -154,7 +135,6 @@ ionic_lif_get_abs_stats(const struct ionic_lif *lif, struct rte_eth_stats *stats stats->q_ipackets[i] = rx_stats->packets; stats->q_ibytes[i] = rx_stats->bytes; stats->q_errors[i] = - rx_stats->no_cb_arg + rx_stats->bad_cq_status + rx_stats->no_room + rx_stats->bad_len; @@ -1146,12 +1126,16 @@ ionic_lif_rss_teardown(struct ionic_lif *lif) void ionic_lif_txq_deinit(struct ionic_tx_qcq *txq) { + ionic_qcq_disable(&txq->qcq); + txq->flags &= ~IONIC_QCQ_F_INITED; } void ionic_lif_rxq_deinit(struct ionic_rx_qcq *rxq) { + ionic_qcq_disable(&rxq->qcq); + rxq->flags &= ~IONIC_QCQ_F_INITED; } @@ -1488,6 +1472,9 @@ ionic_lif_txq_init(struct ionic_tx_qcq *txq) ctx.cmd.q_init.ring_size); IONIC_PRINT(DEBUG, "txq_init.ver %u", ctx.cmd.q_init.ver); + ionic_q_reset(q); + ionic_cq_reset(cq); + err = ionic_adminq_post_wait(lif, &ctx); if (err) return err; @@ -1536,6 +1523,9 @@ ionic_lif_rxq_init(struct ionic_rx_qcq *rxq) ctx.cmd.q_init.ring_size); IONIC_PRINT(DEBUG, "rxq_init.ver %u", ctx.cmd.q_init.ver); + ionic_q_reset(q); + ionic_cq_reset(cq); + err = ionic_adminq_post_wait(lif, &ctx); if (err) return err; diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h index c3ae96d25b..b3f0ce720b 100644 --- a/drivers/net/ionic/ionic_lif.h +++ b/drivers/net/ionic/ionic_lif.h @@ -39,7 +39,6 @@ struct ionic_tx_stats { struct ionic_rx_stats { uint64_t packets; uint64_t bytes; - uint64_t no_cb_arg; uint64_t bad_cq_status; uint64_t no_room; uint64_t bad_len; @@ -207,9 +206,6 @@ int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, struct ionic_tx_qcq **qcq_out); void ionic_qcq_free(struct ionic_qcq *qcq); -int ionic_qcq_enable(struct ionic_qcq *qcq); -int ionic_qcq_disable(struct ionic_qcq *qcq); - int ionic_lif_rxq_init(struct ionic_rx_qcq *rxq); void ionic_lif_rxq_deinit(struct ionic_rx_qcq *rxq); diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 440e655e63..17ffaf6aac 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -47,6 +47,34 @@ #include "ionic_lif.h" #include "ionic_rxtx.h" +static void +ionic_empty_array(void **array, uint32_t cnt, uint16_t idx) +{ + uint32_t i; + + for (i = idx; i < cnt; i++) + if (array[i]) + rte_pktmbuf_free_seg(array[i]); + + memset(array, 0, sizeof(void *) * cnt); +} + +static void __rte_cold +ionic_tx_empty(struct ionic_tx_qcq *txq) +{ + struct ionic_queue *q = &txq->qcq.q; + + ionic_empty_array(q->info, q->num_descs, 0); +} + +static void __rte_cold +ionic_rx_empty(struct ionic_rx_qcq *rxq) +{ + struct ionic_queue *q = &rxq->qcq.q; + + ionic_empty_array(q->info, q->num_descs, 0); +} + /********************************************************************* * * TX functions @@ -121,21 +149,16 @@ void __rte_cold ionic_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid) { struct ionic_tx_qcq *txq = dev->data->tx_queues[qid]; - struct ionic_tx_stats *stats = &txq->stats; IONIC_PRINT_CALL(); - IONIC_PRINT(DEBUG, "TX queue %u pkts %ju tso %ju", - txq->qcq.q.index, stats->packets, stats->tso); - - ionic_lif_txq_deinit(txq); - ionic_qcq_free(&txq->qcq); } int __rte_cold ionic_dev_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id) { + struct ionic_tx_stats *stats; struct ionic_tx_qcq *txq; IONIC_PRINT(DEBUG, "Stopping TX queue %u", tx_queue_id); @@ -150,9 +173,14 @@ ionic_dev_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id) * before disabling Tx queue */ - ionic_qcq_disable(&txq->qcq); + ionic_lif_txq_deinit(txq); - ionic_tx_flush(txq); + /* Free all buffers from descriptor ring */ + ionic_tx_empty(txq); + + stats = &txq->stats; + IONIC_PRINT(DEBUG, "TX queue %u pkts %ju tso %ju", + txq->qcq.q.index, stats->packets, stats->tso); return 0; } @@ -236,13 +264,9 @@ ionic_dev_tx_queue_start(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id) IONIC_PRINT(DEBUG, "Starting TX queue %u, %u descs", tx_queue_id, txq->qcq.q.num_descs); - if (!(txq->flags & IONIC_QCQ_F_INITED)) { - err = ionic_lif_txq_init(txq); - if (err) - return err; - } else { - ionic_qcq_enable(&txq->qcq); - } + err = ionic_lif_txq_init(txq); + if (err) + return err; tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED; @@ -648,42 +672,16 @@ ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads; } -static void __rte_cold -ionic_rx_empty(struct ionic_rx_qcq *rxq) -{ - struct ionic_queue *q = &rxq->qcq.q; - struct rte_mbuf *mbuf; - void **info; - - while (q->tail_idx != q->head_idx) { - info = IONIC_INFO_PTR(q, q->tail_idx); - mbuf = info[0]; - rte_mempool_put(rxq->mb_pool, mbuf); - - q->tail_idx = Q_NEXT_TO_SRVC(q, 1); - } -} - void __rte_cold ionic_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid) { struct ionic_rx_qcq *rxq = dev->data->rx_queues[qid]; - struct ionic_rx_stats *stats; if (!rxq) return; IONIC_PRINT_CALL(); - stats = &rxq->stats; - - IONIC_PRINT(DEBUG, "RX queue %u pkts %ju mtod %ju", - rxq->qcq.q.index, stats->packets, stats->mtods); - - ionic_rx_empty(rxq); - - ionic_lif_rxq_deinit(rxq); - ionic_qcq_free(&rxq->qcq); } @@ -787,17 +785,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm = info[0]; - if (!rx_svc) { - stats->no_cb_arg++; - /* Flush */ - rte_pktmbuf_free(rxm); - /* - * Note: rte_mempool_put is faster with no segs - * rte_mempool_put(rxq->mb_pool, rxm); - */ - return; - } - if (cq_desc->status) { stats->bad_cq_status++; ionic_rx_recycle(q, q_desc_index, rxm); @@ -1028,13 +1015,9 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) IONIC_PRINT(DEBUG, "Starting RX queue %u, %u descs, size %u", rx_queue_id, rxq->qcq.q.num_descs, rxq->frame_size); - if (!(rxq->flags & IONIC_QCQ_F_INITED)) { - err = ionic_lif_rxq_init(rxq); - if (err) - return err; - } else { - ionic_qcq_enable(&rxq->qcq); - } + err = ionic_lif_rxq_init(rxq); + if (err) + return err; /* Allocate buffers for descriptor rings */ if (ionic_rx_fill(rxq) != 0) { @@ -1103,19 +1086,24 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do, int __rte_cold ionic_dev_rx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) { + uint8_t *rx_queue_state = eth_dev->data->rx_queue_state; + struct ionic_rx_stats *stats; struct ionic_rx_qcq *rxq; IONIC_PRINT(DEBUG, "Stopping RX queue %u", rx_queue_id); rxq = eth_dev->data->rx_queues[rx_queue_id]; - eth_dev->data->rx_queue_state[rx_queue_id] = - RTE_ETH_QUEUE_STATE_STOPPED; + rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED; + + ionic_lif_rxq_deinit(rxq); - ionic_qcq_disable(&rxq->qcq); + /* Free all buffers from descriptor ring */ + ionic_rx_empty(rxq); - /* Flush */ - ionic_rxq_service(rxq, -1, NULL); + stats = &rxq->stats; + IONIC_PRINT(DEBUG, "RX queue %u pkts %ju mtod %ju", + rxq->qcq.q.index, stats->packets, stats->mtods); return 0; }