From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hunt, David" Subject: Re: [PATCH] event/sw: fix credit return on invalid queue id Date: Tue, 18 Apr 2017 11:11:31 +0100 Message-ID: References: <1492509520-31943-1-git-send-email-harry.van.haaren@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: Harry van Haaren , dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id DBF442BAE for ; Tue, 18 Apr 2017 12:11:34 +0200 (CEST) In-Reply-To: <1492509520-31943-1-git-send-email-harry.van.haaren@intel.com> 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 18/4/2017 10:58 AM, Harry van Haaren wrote: > This patch returns a credit when an rte_event is > enqueued with an invalid queue_id. Previously a > credit was leaked from the system. > > Note that the eventdev instance does not attempt > to free any resources that the rte_event owns. As > a result, resources owned by the rte_event are leaked. > Eg. if the rte_event represents an rte_mbuf, the mbuf > will not be freed, and causes a leak from the mempool. > > Fixes: 656af9180014 ("event/sw: add worker core functions") > > Signed-off-by: Harry van Haaren > --- > drivers/event/sw/sw_evdev_worker.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/event/sw/sw_evdev_worker.c b/drivers/event/sw/sw_evdev_worker.c > index b9b6f8d..9cb6bef 100644 > --- a/drivers/event/sw/sw_evdev_worker.c > +++ b/drivers/event/sw/sw_evdev_worker.c > @@ -105,9 +105,12 @@ sw_event_enqueue_burst(void *port, const struct rte_event ev[], uint16_t num) > */ > if ((new_ops[i] & QE_FLAG_COMPLETE) && outstanding) > p->outstanding_releases--; > - /* Branch to avoid touching p->stats except error case */ > - if (unlikely(invalid_qid)) > + > + /* error case: branch to avoid touching p->stats */ > + if (unlikely(invalid_qid)) { > p->stats.rx_dropped++; > + p->inflight_credits++; > + } > } > > /* returns number of events actually enqueued */ Acked-by: David Hunt