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 D3719A00C5; Fri, 11 Feb 2022 17:33:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51645410E5; Fri, 11 Feb 2022 17:33:16 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 564E340140 for ; Fri, 11 Feb 2022 17:33:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644597194; x=1676133194; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=FUbtFLLQ55ilwnZDxMsxXBNtvj5BqzJeTLiUQF+PZz0=; b=Z+uZI4b9X0BcieuQP9AQH1MJXe7jDDvOVTnzYnPn4DTZ/OVMNBYVtDwi yYidedWfs4sKYFjW3YhABPK4ziXUiOhTdfk5I48ngmq0Bj3Jyy0i2YAS2 qoMmd2EhOWejhfrLz4LVpv90HeDkljywU4xlDuNc9GCCKalYL7JtgLT6c b359g6WNzkEfTfhXDyOGw1h+Ikh9awsZKg07t0cUA9g/xF05tW3O6XFo0 GkjGDM3vdzrypSctHInT7U++hhxcHs2gIl5/877v9+md3vi7DJNP7Zu7x epb2IyDR47OGpAyMyZeLCzAdfZu4TtULc2XsLEW9arvPkG7uXs7vck56q g==; X-IronPort-AV: E=McAfee;i="6200,9189,10255"; a="336184320" X-IronPort-AV: E=Sophos;i="5.88,361,1635231600"; d="scan'208";a="336184320" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 08:33:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,361,1635231600"; d="scan'208";a="537688173" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 11 Feb 2022 08:33:13 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 11 Feb 2022 08:33:12 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 11 Feb 2022 08:33:12 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Fri, 11 Feb 2022 08:33:12 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Fri, 11 Feb 2022 08:33:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GMJfl+pmWqj3Q6n7GOuK4rRPSCgUXUt3rxSX391Y9JzUdvAabXgjcblHeH/fI51REQaP3MZTDeh/pVpf5xBnpqAs0P5NFSpyUNlbMrNGw+U9dOCt2g1tFbxr19knmOWbYRW6HSFPSP7oSWJ6UT87uu91+A0HwxoREjEIHiDpF4e0+Za+SulmxuPxwEf8AbOUBF/od4MQOb66N48jYc7WJM9ALG+43dqtxeasT+pzvidBWY9T5jAUt+UiizQpl3ldG7i1QewmBLj3rGqV9BXLfIPcLnpA7Oqy0RpYm8MacPAhBrRTrEFJ4x1cAv50lN0L+ktUIfRpnmLePN2jCHMfTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LR/baPKXaMWb8gj+nuhBaRrPK2Ly/gfMvvQyrBeJG8s=; b=IkBMKbJnJP7hxGEPy+FdqVhBJkDedwzfhh1MCjGuvOPNehvMgkIU2C/Auxc1Srt2+qZiYIjApQ+n9nsJ+a8fi+U7Z7U+UL/wt5cwpsO/VI8qRey5yxRUVXIBNV9RlzmUohDPqGA43Oqs4aqGRZ1W7cpLh7PN0LjkzL29GgmUN5yjpHRh0GzsDSYFfQJJtV4zHJzKLJPE44kpLuKTyTieNf7oFmxyO+EmbwwDWwgaEF7U+rqfMLe355p0YjDlbPLLSa17VVBai4eHuIousyx6yEzDBJGIIQ0nBWqo58xVCFBUEh02lCj3AXIcCFZ1wFL7MzpU8lqquJR/3XogMosvjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DM6PR11MB4348.namprd11.prod.outlook.com (2603:10b6:5:1db::18) by PH0PR11MB5080.namprd11.prod.outlook.com (2603:10b6:510:3f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15; Fri, 11 Feb 2022 16:33:10 +0000 Received: from DM6PR11MB4348.namprd11.prod.outlook.com ([fe80::81b0:ace7:417:1c1e]) by DM6PR11MB4348.namprd11.prod.outlook.com ([fe80::81b0:ace7:417:1c1e%4]) with mapi id 15.20.4951.019; Fri, 11 Feb 2022 16:33:10 +0000 From: "Jayatheerthan, Jay" To: "Naga Harish K, S V" , "jerinj@marvell.com" CC: "dev@dpdk.org" Subject: RE: [PATCH v2] eventdev/eth_tx: fix queue add logic Thread-Topic: [PATCH v2] eventdev/eth_tx: fix queue add logic Thread-Index: AQHYHXZgVl0LkMHDqkKNrL0E+u+CxKyOhtmA Date: Fri, 11 Feb 2022 16:33:10 +0000 Message-ID: References: <20220209052313.1557377-1-s.v.naga.harish.k@intel.com> <20220209053151.1557961-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20220209053151.1557961-1-s.v.naga.harish.k@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 33ede9e0-8062-4630-c2c4-08d9ed7c315c x-ms-traffictypediagnostic: PH0PR11MB5080:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:34; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PLUfehabsa7Q3P4ps4GhHub6m8QFAjkmnyzyFkGOzK1bnBez8M7247W+WAUnBpfmN9i9bPH41k/JNRaQ79KU+drgWiSJuJtFMVkbyzAz+WnVkvV+icUZYxc4XM44YPFy0qrQjpH7niTqjMnODifdKxaBdU2L0Kx68DlM1xJC3eInaxwugB2y9OWLO+KxXYS5oXU01IX3Dfd61Q+QVpymOhx/QX0+sOOjTNz16HL1dHUZqi/PpOcuReCXo5eozLkDkySGA0QZfJELyDuntwMRcxoydRj3K514mVFvHqiOwFm/jhXJB57u6nhe81TtMeQ7NlNKWpW2Enuhr0c+AyFM6UH0fUkdBFr53w0e0dDzxjpocbIP9x+o7fm9XzWpSoWzdRFqtTDjDo/00+S7xSnPRx7/z7y8E+nda7RbTGu/8KPKW3OGyNMgVcBYxUTZUMe22BMv2iWHJBDwkX3m4HSYCzQfMKfVz6tnfrU0WGIIyZIN55hIPbumQBVMrbQVxnn5ZdCPlacexrma8WYh6+WSuKhKpzRmu5jK8kNPskuzCBMvkCgXEY6Lsj7/Nt+3yQzzDZsR+CuTpsv8LoVZduq6GB5Jn5Itj3cmMZHcobBQphAqAoBTexB1ukuuZ88lf+e9QGE7yTYXlfZZ6vcXH8N+SuxH/k1yl4o149iYULukPDcdtsBfNhif3LO/wOedVzK0HJxr6HzE27e3oaIUYViOZg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4348.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(4326008)(9686003)(66556008)(64756008)(66946007)(508600001)(76116006)(8676002)(66476007)(66446008)(8936002)(52536014)(71200400001)(2906002)(186003)(86362001)(83380400001)(26005)(53546011)(6506007)(38070700005)(7696005)(82960400001)(38100700002)(122000001)(5660300002)(316002)(33656002)(55016003)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UOPC02o/F8vyEoyUbTfAWNb+bE9wues5thESWiFW8h9JtlDuh1N9AXtzc4pk?= =?us-ascii?Q?B+JNOP/coM3q1AreLAqj8hMy/uilWtVkxL6q8K5onhf+tR3P9V3RQyvrvQmN?= =?us-ascii?Q?/l+XnTgEIsBHPAvizjFmxx3kQIF9BEZ6eIKSSYFchwYKEYkuyrs1JnmBYtvb?= =?us-ascii?Q?Ijz3IHGeoTlfL2ATjWSTpFDaAI+G89U40hLmhXyM0jOWdyiXdCf9q4EKAQXo?= =?us-ascii?Q?/ah4XSB0csv+morVJ5A/PA9Hpx290xesa6T9XgJoDbk2wJF5noogniQmu4Fy?= =?us-ascii?Q?JCICRxNrAOTG/Dewdb0s88wKfkxOnN0CE4psq4FYNe6Fh1QOU8iPv4txeXhA?= =?us-ascii?Q?4uf1vdTbLsf6ooks/ouZ5DtUMkjgBivNjvAlf9UrmEmnqPXZ/u54qgMc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QY1Gfc81dvXlGN5EFo3Z6jsP3smsWz0FD2CQ3Dfh89Jo?= =?us-ascii?Q?/f1DFB9yMhFiguFnOzgMI23G8dhR4rhrjt2rKF6PerAS5Z9hWI1REDdWasX/?= =?us-ascii?Q?lNyDExPiS53tDgQSlOxWthzKE1fPLKVNeE/Bog1xb60w0MSRAX/av0KLL9q4?= =?us-ascii?Q?XnsIGTfSgv684CmHJF44ohDir2hx3/13+GI4QbrXQ4JkKw2rvmZvD97Oauna?= =?us-ascii?Q?GvYuJV0xTgyxEJjh9JPdeZwIqVDgGzobcgnAJd1O836AaVTFD/jTiIyAJTKj?= =?us-ascii?Q?CC+bZV3052AQezjymNFuEwRlIki+zHMmjayT5I/3rq4TN+8XoM5DeL0PeIuk?= =?us-ascii?Q?cbGVW/9+Au1mRzMVHov1Lo3utjXkyLmAoBvL7FtIS+mdLQumllIkxJOreH76?= =?us-ascii?Q?1r3JFA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4348.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33ede9e0-8062-4630-c2c4-08d9ed7c315c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2022 16:33:10.8901 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wMst6RZGWr/peZSAVnZcZSu3pIr4jTGYZwkXMnyLz1ycF0iqqhWHiQqzX0U/IJ85K1BMGeht47klEChdU2t1ZLCjP6+H8k0lVmkWhTPNQhE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5080 X-OriginatorOrg: intel.com 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 Looks good. Thanks. Acked-by: Jay Jayatheerthan -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 >=20 > 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. >=20 > Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") >=20 > Signed-off-by: Naga Harish K S V >=20 > --- > v2: > * adjust commit message line size > --- > lib/eventdev/rte_event_eth_tx_adapter.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) >=20 > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_e= vent_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, >=20 > rte_spinlock_lock(&txa->tx_lock); >=20 > - 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; >=20 > ret =3D txa_service_queue_array_alloc(txa, eth_dev->data->port_id); > if (ret) > @@ -821,6 +819,8 @@ txa_service_queue_add(uint8_t id, >=20 > tdi =3D &txa->txa_ethdev[eth_dev->data->port_id]; > tqi =3D txa_service_queue(txa, eth_dev->data->port_id, tx_queue_id); > + if (tqi =3D=3D NULL) > + goto err_unlock; >=20 > txa_retry =3D &tqi->txa_retry; > txa_retry->id =3D txa->id; > @@ -836,6 +836,10 @@ txa_service_queue_add(uint8_t id, > tdi->nb_queues++; > txa->nb_queues++; >=20 > +ret_unlock: > + rte_spinlock_unlock(&txa->tx_lock); > + return 0; > + > err_unlock: > if (txa->nb_queues =3D=3D 0) { > txa_service_queue_array_free(txa, > @@ -844,7 +848,7 @@ txa_service_queue_add(uint8_t id, > } >=20 > rte_spinlock_unlock(&txa->tx_lock); > - return 0; > + return -1; > } >=20 > static int > -- > 2.23.0