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 1BF34A034E; Mon, 14 Feb 2022 16:24:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0A3E41144; Mon, 14 Feb 2022 16:24:02 +0100 (CET) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by mails.dpdk.org (Postfix) with ESMTP id 0E36F4067E for ; Mon, 14 Feb 2022 16:24:01 +0100 (CET) Received: by mail-io1-f41.google.com with SMTP id q204so20229192iod.8 for ; Mon, 14 Feb 2022 07:24:00 -0800 (PST) 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=/n/2vIr8O2l4jNeucm/sEX1J9phAPU1PYwi1ZYj12jw=; b=qYhUrwqMgBc1zwbt2UFs/rSVzqzjRwtJqF8OD9bHSz0b4P+upqMkpla0gU6RusLXi3 zxHGcwSZyNtmOHG/zgSNuTSKj/UkRiHuPA2vZSrOHshChrlNUIATfCqckSuu9Qray4pz 2swUxQJ5YzogekEW1D66lT93LzmhiVDcu2WD0G5/SPgK0a51M5kWUMN3CnU3po6j7frO PRrorEIXx62qe7HER3S8aiWOKdR+OCXy8yPQ/IBz+fk4v8j4s7fiu/3WSrhQOFoVTd6Q zi/NaBCqTHXoZT0a6e/xoZLHYEa+/fptYfTx855XZJseygtes80cO11KCcBDsXCmmlR6 lOUA== 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=/n/2vIr8O2l4jNeucm/sEX1J9phAPU1PYwi1ZYj12jw=; b=0ZzIcf5YHYtwPEgL87zAHoCX33KV4TnTqgAIKQXprv+OX0W0OXRPGl+GI9wmZfEZ9O GKmGapWq1Rm//HhMmreQK+NvdG/1Bt0ynKAas3OFp7OzH3N758MXR8M5MnwDZyivX1mg sNXk8IV0UIQk/MXqu1BPYkxP6vRL3T+GYxByihrBp6d5c6At9dCO6iREYOmN0i6n6hFl VE2kdU0LqG8eOoPPmmtMZyarkiow5l9TqOZYgvirMs9f3hZrW+EDuSuVzYykOyJ08D2R SUcGibq7Jw4/uMFwlHWedk7uv2rdwbPI4mAAyDzi4rV0kpuhoOxGLClbJeh7ANOQrULm u7bw== X-Gm-Message-State: AOAM531SnEdJtGWWGPzZ0cA1StDhlu4ZEKzCEuh4aqkH/q+NfCTpOyaS VE88uutrj+VJlZR9G7ne5k+gpR/03ehDJy6FIso= X-Google-Smtp-Source: ABdhPJz/axg2atxyhZ8cj+yWLdZhsAS60RKhVmmGczerhFB+qpGVZ7VPq81ssz/OWoYGC33vkD510zNmR49r2x3WIvk= X-Received: by 2002:a05:6638:3007:: with SMTP id r7mr113158jak.280.1644852240402; Mon, 14 Feb 2022 07:24:00 -0800 (PST) MIME-Version: 1.0 References: <20220209052313.1557377-1-s.v.naga.harish.k@intel.com> <20220209053151.1557961-1-s.v.naga.harish.k@intel.com> In-Reply-To: From: Jerin Jacob Date: Mon, 14 Feb 2022 20:53:34 +0530 Message-ID: Subject: Re: [PATCH v2] eventdev/eth_tx: fix queue add logic To: "Jayatheerthan, Jay" Cc: "Naga Harish K, S V" , "jerinj@marvell.com" , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" 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 On Fri, Feb 11, 2022 at 10:03 PM Jayatheerthan, Jay wrote: > > Looks good. Thanks. > > Acked-by: Jay Jayatheerthan Applied to dpdk-next-net-eventdev/for-main. Thanks > > -Jay > > > > > -----Original Message----- > > From: Naga Harish K, S V > > Sent: Wednesday, February 9, 2022 11:02 AM > > To: Jayatheerthan, Jay ; jerinj@marvell.com > > Cc: dev@dpdk.org > > Subject: [PATCH v2] eventdev/eth_tx: fix queue add logic > > > > The internal function txa_service_queue_add is returning 0 > > in case of error. correct this logic to return a negative value > > to indicate failure. > > > > Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") > > > > Signed-off-by: Naga Harish K S V > > > > --- > > v2: > > * adjust commit message line size > > --- > > lib/eventdev/rte_event_eth_tx_adapter.c | 14 +++++++++----- > > 1 file changed, 9 insertions(+), 5 deletions(-) > > > > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c > > index c17f33f098..1b304f0a73 100644 > > --- a/lib/eventdev/rte_event_eth_tx_adapter.c > > +++ b/lib/eventdev/rte_event_eth_tx_adapter.c > > @@ -806,10 +806,8 @@ txa_service_queue_add(uint8_t id, > > > > rte_spinlock_lock(&txa->tx_lock); > > > > - if (txa_service_is_queue_added(txa, eth_dev, tx_queue_id)) { > > - rte_spinlock_unlock(&txa->tx_lock); > > - return 0; > > - } > > + if (txa_service_is_queue_added(txa, eth_dev, tx_queue_id)) > > + goto ret_unlock; > > > > ret = txa_service_queue_array_alloc(txa, eth_dev->data->port_id); > > if (ret) > > @@ -821,6 +819,8 @@ txa_service_queue_add(uint8_t id, > > > > tdi = &txa->txa_ethdev[eth_dev->data->port_id]; > > tqi = txa_service_queue(txa, eth_dev->data->port_id, tx_queue_id); > > + if (tqi == NULL) > > + goto err_unlock; > > > > txa_retry = &tqi->txa_retry; > > txa_retry->id = txa->id; > > @@ -836,6 +836,10 @@ txa_service_queue_add(uint8_t id, > > tdi->nb_queues++; > > txa->nb_queues++; > > > > +ret_unlock: > > + rte_spinlock_unlock(&txa->tx_lock); > > + return 0; > > + > > err_unlock: > > if (txa->nb_queues == 0) { > > txa_service_queue_array_free(txa, > > @@ -844,7 +848,7 @@ txa_service_queue_add(uint8_t id, > > } > > > > rte_spinlock_unlock(&txa->tx_lock); > > - return 0; > > + return -1; > > } > > > > static int > > -- > > 2.23.0 >