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 5AEAFA00C3; Tue, 29 Nov 2022 15:50:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 405D742D1D; Tue, 29 Nov 2022 15:50:34 +0100 (CET) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by mails.dpdk.org (Postfix) with ESMTP id 1B55142B8C for ; Tue, 29 Nov 2022 15:50:31 +0100 (CET) Received: by mail-qt1-f177.google.com with SMTP id e15so9045126qts.1 for ; Tue, 29 Nov 2022 06:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z5p1GQyxy51H5xtgKqyBGTQQpYvZ1l8Hxb5fLcjjpmU=; b=hNpJr0mrJXfmLxcVYUr5IP/ZAYeGLEdoJtkgIG1SQg+oJiIDkZk3nENH1BwfqvSjA+ 7fZv6nRnQtubeZ1a8uY10j6sa8WuPwDmSG46UQOpnS/ZxJaRbE4IPEamxF6z/29HLBIR kNuGEwrH+ls14jfFXlgWByb0GMgn5mQ6K2UhqpokUDMXlPBSgyA4jfm06oiZwQ4eQ+R7 M5QbE1/HWfs6F1KTjsVZtvlJ9ncnE+z5a2Bdz8OzMw29fUNoivFEAX+RyAdHjWFsM69s AXFtl2U3UDv0DHt64VKk3eQ4MIjC/MmYssudLRROj7HBqR+L2jvPncVFLtwris0EMQxp K/AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z5p1GQyxy51H5xtgKqyBGTQQpYvZ1l8Hxb5fLcjjpmU=; b=ynVBHZqcnt/cz+luWi6UWwEgP7jU/wCFfa/fw0HhQF+ILNT4pMcvVTZZH6k66+BLeE lrC7VZsz3AbL9UQBY21/fq3nsx/LieZWF6ZIiaPNX9wL8vR+H9hD5dXcd9Gt2mIsFNh3 6vsF7O9M0W8ku4qQNbFIhDkzcYXyBiK1MzAS5u01m3Y7kP48AnuPRevQlzKWmK2RabMm I3ophqwczi1ZNpjoWsxra0m8guVNz8qN8KIJ9EfXe35VM7suvNhr1jCc1QHln+h3RPlS jIwCkzSoIaYec+KfJIz/J8A+QsHCtIMSk7RO88aylKVr0hBh2BbPcl7+PLjXIXb5UWLG fLIA== X-Gm-Message-State: ANoB5pkQql5Z5ULHUgUVyET12BsJpmdU5TiV8VznvH6SJttyyBHShrlm ySC1qA9zk7VA2kdphSTWdDb+7xET7/w= X-Google-Smtp-Source: AA0mqf5byKqw2x/pblD0GWHO28zDNZMoKQvv6iFvmrzpVK1zmOuQMsVryiFP3AWwu6VIcK0j+lpmqg== X-Received: by 2002:a05:622a:1f0b:b0:3a6:8825:8c7b with SMTP id ca11-20020a05622a1f0b00b003a688258c7bmr1468965qtb.281.1669733430572; Tue, 29 Nov 2022 06:50:30 -0800 (PST) Received: from ubuntu.home (bras-base-hullpq2034w-grc-26-74-12-221-152.dsl.bell.ca. [74.12.221.152]) by smtp.gmail.com with ESMTPSA id y14-20020a05620a44ce00b006fb7c42e73asm11068836qkp.21.2022.11.29.06.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 06:50:30 -0800 (PST) From: Luc Pelletier To: grive@u256.net Cc: dev@dpdk.org, stephen@networkplumber.org, konstantin.ananyev@huawei.com, Luc Pelletier Subject: [PATCH v3 2/5] failsafe: use public rx/tx burst API Date: Tue, 29 Nov 2022 09:48:30 -0500 Message-Id: <20221129144832.2750-3-lucp.at.work@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110163410.12734-1-lucp.at.work@gmail.com> References: <20221110163410.12734-1-lucp.at.work@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The failsafe rx/tx functions are calling the rx/tx functions of sub-devices via the function pointers stored in the rte_eth_dev structure rather than use the public APIs (rte_eth_rx/tx_burst). Use the public API rather than access structure internals which could change in the future. Signed-off-by: Luc Pelletier --- drivers/net/failsafe/failsafe_rxtx.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c index 707fe60a36..6d8ab0a6e7 100644 --- a/drivers/net/failsafe/failsafe_rxtx.c +++ b/drivers/net/failsafe/failsafe_rxtx.c @@ -50,7 +50,6 @@ failsafe_rx_burst(void *queue, { struct sub_device *sdev; struct rxq *rxq; - void *sub_rxq; uint16_t nb_rx; rxq = queue; @@ -61,10 +60,8 @@ failsafe_rx_burst(void *queue, sdev = sdev->next; continue; } - sub_rxq = ETH(sdev)->data->rx_queues[rxq->qid]; FS_ATOMIC_P(rxq->refcnt[sdev->sid]); - nb_rx = ETH(sdev)-> - rx_pkt_burst(sub_rxq, rx_pkts, nb_pkts); + nb_rx = rte_eth_rx_burst(PORT_ID(sdev), rxq->qid, rx_pkts, nb_pkts); FS_ATOMIC_V(rxq->refcnt[sdev->sid]); sdev = sdev->next; } while (nb_rx == 0 && sdev != rxq->sdev); @@ -82,16 +79,14 @@ failsafe_tx_burst(void *queue, { struct sub_device *sdev; struct txq *txq; - void *sub_txq; uint16_t nb_tx; txq = queue; sdev = TX_SUBDEV(&rte_eth_devices[txq->priv->data->port_id]); if (unlikely(fs_tx_unsafe(sdev))) return 0; - sub_txq = ETH(sdev)->data->tx_queues[txq->qid]; FS_ATOMIC_P(txq->refcnt[sdev->sid]); - nb_tx = ETH(sdev)->tx_pkt_burst(sub_txq, tx_pkts, nb_pkts); + nb_tx = rte_eth_tx_burst(PORT_ID(sdev), txq->qid, tx_pkts, nb_pkts); FS_ATOMIC_V(txq->refcnt[sdev->sid]); return nb_tx; } -- 2.38.1