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 8EC04A0C47; Tue, 26 Oct 2021 07:15:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 779C840E0F; Tue, 26 Oct 2021 07:15:00 +0200 (CEST) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id 0F44D4003E for ; Tue, 26 Oct 2021 07:15:00 +0200 (CEST) Received: by mail-pg1-f175.google.com with SMTP id e65so12960977pgc.5 for ; Mon, 25 Oct 2021 22:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=Prgz8etBx4uOmxdCesMS6wbnQQkCoL25d+n/s3Cy9Qo=; b=BEGWQEm5/taE20jGqjP/0nSKX4CcRmBhvI4PrfT0Z0Q72H5SjaC3BjYcz/6B8uab1Q 5LuMs2FWLmhr/aEK2oU6bwX2kNWHs3SAuoJq9p+Ee9GnThG1fcZneMt2bxBnMOAcOa6N N9cJ42wa6WQEJdiLJjq9e2ZP9p4tY/gqQqIBM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=Prgz8etBx4uOmxdCesMS6wbnQQkCoL25d+n/s3Cy9Qo=; b=UYLedbUMhTpqetpmXHyuaNCfdZ5Z1cie2LyvRFN6dM8LEJiMx/o3yNYYMY2qqyejhb nQZ1sE3x072AsLEhaGdPoT/6F+dSXTL4NViBPry0h7iJfMM5dAS1OZzzijBu4W8dQLH0 sBcbJaTo0MlEkPXZI+fAgylUc/NifIquNrzo0s4ra8wctFyZ7b+pjh2s5w+yNyVYrVdH C3zZ5o1IOkn8vFGgLjtZceN8LaV1uVvWTwfanP2fyDmPtJ/IJa0dIOcGTg4oI+8O5dq/ YtduwYw93kUbvcgx5q1bEMZ+dZEacwbDEQG+65fuS7W4lHltmK5w2Bn2M6GbvoIMfgcm M53g== X-Gm-Message-State: AOAM533amvqxzuBZVds3UYe0XaokByPfP5WRXGgMqVNdokH0TBUWfj0f 1XCEX6pKcFnPpK4KHEARIPUAU/F0pfyYVOUfzgGkFXIyOyn3eWxDuEootDnew3ZpO0aGFkmd8XI oyVy2EDL6MgRWOeMJtcCgEgsm1B1VNkN4KR578Z0SqqYglt2l8QO/6rlt5TA3NNw= X-Google-Smtp-Source: ABdhPJz3GoU3577yLpY1xuEhP2SE8PrdZFgZ+TgVGPziUs5fSvNlge0LpLhiPRCOTyZtwfV0Qa/Rfg== X-Received: by 2002:a05:6a00:a10:b0:412:448c:89c7 with SMTP id p16-20020a056a000a1000b00412448c89c7mr22855041pfh.83.1635225298918; Mon, 25 Oct 2021 22:14:58 -0700 (PDT) Received: from localhost.localdomain ([136.52.99.246]) by smtp.gmail.com with ESMTPSA id f4sm17685629pgn.93.2021.10.25.22.14.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Oct 2021 22:14:58 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Kalesh AP , Somnath Kotur Date: Mon, 25 Oct 2021 22:14:55 -0700 Message-Id: <20211026051455.84103-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000191ed405cf3a8f8b" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH] net/bnxt: refactor Rx ring cleanup for representors 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 Sender: "dev" --000000000000191ed405cf3a8f8b Content-Transfer-Encoding: 8bit Rx ring for representors does not use aggregation rings for Rx. Instead they use simple software buffers for handling Rx packets. So there is no need to use the same cleanup routine as done by the non-representor code path. Signed-off-by: Ajit Khaparde Acked-by: Kalesh AP Acked-by: Somnath Kotur --- drivers/net/bnxt/bnxt_reps.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index 1c07db3ca9..92beea3558 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -386,6 +386,26 @@ static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev) return rc; } +static void bnxt_vfr_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq) +{ + struct rte_mbuf **sw_ring; + unsigned int i; + + if (!rxq || !rxq->rx_ring) + return; + + sw_ring = rxq->rx_ring->rx_buf_ring; + if (sw_ring) { + for (i = 0; i < rxq->rx_ring->rx_ring_struct->ring_size; i++) { + if (sw_ring[i]) { + if (sw_ring[i] != &rxq->fake_mbuf) + rte_pktmbuf_free_seg(sw_ring[i]); + sw_ring[i] = NULL; + } + } + } +} + static void bnxt_rep_free_rx_mbufs(struct bnxt_representor *rep_bp) { struct bnxt_rx_queue *rxq; @@ -393,7 +413,7 @@ static void bnxt_rep_free_rx_mbufs(struct bnxt_representor *rep_bp) for (i = 0; i < rep_bp->rx_nr_rings; i++) { rxq = rep_bp->rx_queues[i]; - bnxt_rx_queue_release_mbufs(rxq); + bnxt_vfr_rx_queue_release_mbufs(rxq); } } -- 2.30.1 (Apple Git-130) --000000000000191ed405cf3a8f8b--