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 ED9C9A0C43; Wed, 20 Oct 2021 11:26:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC26F411D0; Wed, 20 Oct 2021 11:26:01 +0200 (CEST) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) by mails.dpdk.org (Postfix) with ESMTP id 6910F40142 for ; Wed, 20 Oct 2021 11:26:00 +0200 (CEST) Received: by mail-il1-f169.google.com with SMTP id x1so21352893ilv.4 for ; Wed, 20 Oct 2021 02:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gEWubj2VgRTYp6Wvt4naHVThQEbwdFOMM1/US8NAvqo=; b=Zln3Xw4k5ax/B8EZdoqGz79EKkE89d4uHNJG0Wh5T87kfuJzB7E2KNjZT28/nfVRMb TNJtKge7cJ79e4pX1rZwN6v7M+6X7/Weflbm1IPXavUO4mNd8DNkqqEMbB17oOAA+JPZ HlKK2lJ+aXX6r4wgGimgvGFs6OH/FsEdATdVOR1/s4pl1SoF1dXXCG2pckq/YDRP7EqJ QXozyqSTBqamWxrSqoPkH/gfc+sCeFFsN3DfaXfyhxD0WIKmnCvM1YrPWj6WNCIzNqSh lFdY0UYEJ5DirwPuXE/spXGi6PLThCjIcoiUDacewaSljB2nBSA97D88d1fyWL3/RxDq dH0g== 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=gEWubj2VgRTYp6Wvt4naHVThQEbwdFOMM1/US8NAvqo=; b=dDEyd1ThInJ7+gDpBnUrKrn6/r4q7mg/G26dl4Fohobf5ifwSvTqkItXUjd+/ufRph gjilofkE+aRmi3BGpCWH3ZU7eyVbvBSpF60nY5mBGl8FvXvWQc8/dSmxroqJaT+IdSlz Y1moNi3xt3pmcIEeg8Uw1jJlKHIgcOJKXibmkvU8hJwAYkzt/XcYS0Q/NpWFf1Fm4mZG iFYpE+ixOSTPNHh3kaoRcNQ5T3fGsM+nUsaUKvBmjhXYPd/XkBa0MM9KKc+vxXAzXN/f IxN++QxxgYso9Bhr3Uc4AYqg2IVHWfU19OLefP/5Ovbztq0G4tr12pz4SRb07YcEmsJu MNSw== X-Gm-Message-State: AOAM53265H62TqyeY1J7/4L1YHsI+hJ84WaoD30CYurSnrVypt5ub/Ww YI/zws33nJK63Xie9o7yqEtP+stNywuwK19yydA= X-Google-Smtp-Source: ABdhPJwqshfE/eMW1uRrjBgpJi84+i9opO90YBrHBg/POdhP8cq+KDfoFGbe2ERVjj/cpT2WHzHZSgYWiMqDRXUV2QY= X-Received: by 2002:a92:ca0f:: with SMTP id j15mr22262221ils.251.1634721959841; Wed, 20 Oct 2021 02:25:59 -0700 (PDT) MIME-Version: 1.0 References: <20211018082541.2742861-1-s.v.naga.harish.k@intel.com> In-Reply-To: From: Jerin Jacob Date: Wed, 20 Oct 2021 14:55:33 +0530 Message-ID: To: "Jayatheerthan, Jay" Cc: "Naga Harish K, S V" , "jerinj@marvell.com" , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] eventdev/rx_adapter: fix wrr buffer overrun issue 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 18, 2021 at 4:39 PM Jayatheerthan, Jay wrote: > > Acked-by: Jay Jayatheerthan Changed the subject to: eventdev/rx_adapter: fix WRR buffer overrun issue Cced stable@dpdk.org Series applied to dpdk-next-net-eventdev/for-main. Thanks > > > -----Original Message----- > > From: Naga Harish K, S V > > Sent: Monday, October 18, 2021 1:56 PM > > To: jerinj@marvell.com; Jayatheerthan, Jay > > Cc: dev@dpdk.org > > Subject: [PATCH] eventdev/rx_adapter: fix wrr buffer overrun issue > > > > when a poll queue is removed from a rx_adapter instance, the wrr poll > > array is recomputed. The wrr array length is reduced in this case. The > > next wrr position to poll is stored in wrr_pos variable of rx_adapter > > instance. This wrr_pos can become invalid in some cases after wrr is > > recomputed. Using this variable to get the next queue and device pair > > may leed to wrr buffer overruns. > > > > Resetting the wrr_pos to zero after recomputation of wrr array fixes > > the buffer overrun issue. > > > > Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation") > > > > Signed-off-by: Naga Harish K S V > > --- > > lib/eventdev/rte_event_eth_rx_adapter.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c > > index bd68b8efe1..82a652d305 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > @@ -2773,6 +2773,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, > > rx_adapter->eth_rx_poll = rx_poll; > > rx_adapter->wrr_sched = rx_wrr; > > rx_adapter->wrr_len = nb_wrr; > > + /* > > + * reset next poll start position (wrr_pos) to avoid buffer > > + * overrun when wrr_len is reduced in case of queue delete > > + */ > > + rx_adapter->wrr_pos = 0; > > rx_adapter->num_intr_vec += num_intr_vec; > > > > if (dev_info->nb_dev_queues == 0) { > > -- > > 2.25.1 >