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 90C32A0547; Wed, 27 Oct 2021 03:53:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 759AA410F1; Wed, 27 Oct 2021 03:53:14 +0200 (CEST) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by mails.dpdk.org (Postfix) with ESMTP id 9D43340DDA for ; Wed, 27 Oct 2021 03:53:13 +0200 (CEST) Received: by mail-il1-f180.google.com with SMTP id w10so1243836ilc.13 for ; Tue, 26 Oct 2021 18:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tqB9PXr293ur31/BzUZ8+kZY8pQjfMOEe8OiTSk75+w=; b=VGOM4+WP6HT/UZyn4pVHHi/7ZDzu68+yGx7I7gxxbfmzmGtP79HJbeXKTJHc3Fv0wd khsnbHS6yksTpZjp3zrA3VqwOD8cdtKBVe1MmIJThdTOGmdojtJKLxjUJH6dXHk2egSo nXWaJYutSQDSNn6sIXoqIeFE08RcKcE6u8VKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tqB9PXr293ur31/BzUZ8+kZY8pQjfMOEe8OiTSk75+w=; b=pXqpM8Qu1sIk4tT0Dp3QO5WIP5TUg0OhFJ3bu5ByGe13f7CiDns/hWZIoZPZz8sG3R y3wlNtUenwRHKOfn8XDiC9/OaDcMbWptEegk58PRhQy090b9H6W/wemyUBlAxTL69yvM YD0bahps8f+1kmqipgYKOrgij9W6d+8/q6sPEb7+lYDhEG8wUN0JDKTlOL2T7rOupCOs OF8xzcH7yM2ePIvTUbickPZFKZ0700A7rjpC7HaWgwHOUfNu/t+vQoMtqkDqRHQGPk+y KlnGes2Ir8bB+yLWSBFYR06EyzIHqSPpjyap0B6aOFMxgf/UUkFVjyf+/AgRzQYSsBHd wSRg== X-Gm-Message-State: AOAM530f5ytK7/Zp/KppfsrsZxwhEHR33hYF6q4Hv5nxao/gBQVDpD6F nf8uk3yvlW4LyyDwFJcj44LPhyoYk3jRjjxabWSEvdUayv8CLA== X-Google-Smtp-Source: ABdhPJwGIbCeCrNlQgMF73UYcqevE1SfPpExOa7uA/Rdhl3YH2bS0fcJplUxRVx9oToDFWJSQXF2OWuo7QFal2lZ77s= X-Received: by 2002:a92:c56e:: with SMTP id b14mr2117422ilj.255.1635299592896; Tue, 26 Oct 2021 18:53:12 -0700 (PDT) MIME-Version: 1.0 References: <20211026051455.84103-1-ajit.khaparde@broadcom.com> In-Reply-To: <20211026051455.84103-1-ajit.khaparde@broadcom.com> From: Ajit Khaparde Date: Tue, 26 Oct 2021 18:52:57 -0700 Message-ID: To: dpdk-dev Cc: Kalesh AP , Somnath Kotur Content-Type: text/plain; charset="UTF-8" Subject: Re: [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" On Mon, Oct 25, 2021 at 10:14 PM Ajit Khaparde wrote: > > 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 Patch applied to dpdk-next-net-brcm. > --- > 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) >