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 5F030A00C3; Tue, 29 Nov 2022 16:25:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE69F42D18; Tue, 29 Nov 2022 16:25:32 +0100 (CET) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by mails.dpdk.org (Postfix) with ESMTP id 0742C42686 for ; Tue, 29 Nov 2022 16:25:30 +0100 (CET) Received: by mail-qv1-f47.google.com with SMTP id n12so9890605qvr.11 for ; Tue, 29 Nov 2022 07:25:29 -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=nIF+D861s3HItaV6qVLX2Ujczyta/P1cBDczt7cAaljwqsWwhfA7DYzfHPvi+EUZqy s6p7tuxabgl5JsTb2Y49EYmp2tTzFcdNqyVfN+WPB+HnAZgXk2EmhMsidN2hVIXJWF3l QY42VyT5nsqzwR1TMkrGv9PDSusFWEzDrgoKwXZulSJpJf5N1zhKLZ+aHb+4RcLjVz2z oLZmyWc+rvaoBYeCjQ3JBR4zCxPglJB+HFCIuhT3Hycup8cRazhjZw+BeH/gTZFAoJ7f Svghckz8+XE6BWApzmRq6fJGk1v09Ie6x4BGbXmuN0jWD/MUiIqAO3Z04E05qdnjt8OL tvfA== 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=5ZuVNx2qpWBMIDZ0Q+UXVDJ5Zywpy4rV80y4zZ3QLMOa3Zi5XFLlnm2aeUs2z7XaWA bjRGPe8VqTUeioHqOAhvFXT/1dTQXcLLyl649/jFcy/yIL2o+X95t7x0YroUalCexxVp CxRndhtKkBcZuhVHsGGbd4S4OvJjZ9xCE8Z7xWo8s6DETU1G7lDlVja2v51LVBLNaNrF wCm6QgWEc5lUQxeULPmJ1QN+m5QLeX0EPZ5NJPXTiS17bWBX5PyQNoAVSovFO41iwsal KxcmH384rybYnKbj29EB2lGhGGFUcCljdiPde12r26feYe2MSNNOOwXuGJUi8FFUAk+N CYow== X-Gm-Message-State: ANoB5pm/QJ/O7mK5HsW59P6C5ujwrtIwJFpy/2gbBX3LtvaPbIkFsxoy Tj9Iew9sYGr4V7e2425bT8g= X-Google-Smtp-Source: AA0mqf63PIs0BtHaBBrVvdgh+1QLavkAUcBwtilUj6upQ3gEb5SalwwgTSwCIBENfBtHtWC3H0y16w== X-Received: by 2002:a0c:90f1:0:b0:4b1:8788:21ff with SMTP id p104-20020a0c90f1000000b004b1878821ffmr54584399qvp.16.1669735528395; Tue, 29 Nov 2022 07:25:28 -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 r2-20020ae9d602000000b006fb11eee465sm10663412qkk.64.2022.11.29.07.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 07:25:27 -0800 (PST) From: Luc Pelletier To: grive@u256.net Cc: dev@dpdk.org, stephen@networkplumber.org, konstantin.ananyev@huawei.com, Luc Pelletier Subject: [PATCH v4 2/5] failsafe: use public rx/tx burst API Date: Tue, 29 Nov 2022 10:25:14 -0500 Message-Id: <20221129152516.4513-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