From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6ADEA32A4 for ; Fri, 25 Oct 2019 21:01:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B70C91E53F; Fri, 25 Oct 2019 21:01:07 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by dpdk.org (Postfix) with ESMTP id 7F7B91E53A for ; Fri, 25 Oct 2019 21:01:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M0cem8Dr4lCdj1J4FDNRKLl1LCDph2qk2lhdbDAexg8hA1kveavuu1oNL8pf4CjNTtAsp1bFnNxZyP+lxfWZznChGR9/B3WoPbxDH3wNPbKjV2LgQEkF1dYwg5a6N/5BUSexxW0Cdghls3p71A4hwvN5mmzuuhtS9ZpVmQ/Uoi0MhXA5J61UXN5uHaZJNIWt4JcZ/2JLWriWiH3qFcdGX0dc6jdnvO4Ysm+9rHsrCnkqVMmfDAG0Qd5H61xmtzPRzJK18I/4Q+x065T7+99QaqlYD8V12psPsyJATgr8P6Wc7uheeD97l1ntvug5ZPkqysn1JhgbYkFQdoD6DlfJjw== 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-SenderADCheck; bh=GQHYW7dQQPDgH4dQA0GyCKAa26YEKoMFPtfvIXO+vXU=; b=WGpCNUTylHPvcubl4niw8zJUWdEQoNxhdF9dOnQqN3Xy/IgnVmwSpzk6tSRu7XRo7ZeBuf2pjOKlXdwXxR7eFoKsPzmSp31P0Fuz0xjYgG2gbf1WMyxO6EP/CE8BC5kXrxtOGUEzFv71v4L6j2sF6482XK1A5zmYelEEFvWMdNWa1BRruISaH9v83vg8ZkWctzZn829/2p1mCOciahhyMlqcPC5fCZlj+W2rVTrrWb3BbHqO7QleonEYCTFGX0zG+M9EaATrqt8QBip7yTcmzEMRwElX4ngsJubuFUTNwxVwtGmz2o0J8qyNZtTcFwtRXmm+k4Qg8h+CJr+WVxtPfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GQHYW7dQQPDgH4dQA0GyCKAa26YEKoMFPtfvIXO+vXU=; b=H2QfduDWjaHLGvJDyiH+G7lt7J2swEAzM1LEGyET5wmFqROsOvVv3lQy4DKy7lBgabA0OGV7b1/HRB9FL8bdWUeXy8NC0XeqsmnxXVAnJmd3ZGSIT5j4EpEAX5aTCQZCCqBzHpi40CjprmprgznjtwE1PIES5R3zPallYIL3h2c= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.190.15) by AM4PR05MB3153.eurprd05.prod.outlook.com (10.171.188.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.23; Fri, 25 Oct 2019 19:01:05 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::70a7:a312:cbc6:d178]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::70a7:a312:cbc6:d178%7]) with mapi id 15.20.2387.025; Fri, 25 Oct 2019 19:01:05 +0000 From: Ori Kam To: Thomas Monjalon , Andrew Rybchenko CC: "dev@dpdk.org" , Ferruh Yigit , "jingjing.wu@intel.com" , "stephen@networkplumber.org" Thread-Topic: [dpdk-dev] [PATCH v5 02/15] ethdev: add support for hairpin queue Thread-Index: AQHViacPyF+i5NmgFUGK736twBuimKdpbUMAgAAHb4CAAGwBAIAACFgAgAADgQCAAAFWgIABx+4A Date: Fri, 25 Oct 2019 19:01:05 +0000 Message-ID: References: <1569479349-36962-1-git-send-email-orika@mellanox.com> <2066428.hBRGAZJfpI@xps> <30020504-28c6-0872-77e8-a1eb6d6a134c@solarflare.com> <7486204.JcRLTtQae7@xps> In-Reply-To: <7486204.JcRLTtQae7@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [185.175.35.255] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 3ebf81ed-9760-41ce-e99f-08d7597daff7 x-ms-traffictypediagnostic: AM4PR05MB3153: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02015246A9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(376002)(366004)(136003)(13464003)(199004)(189003)(66066001)(478600001)(52536014)(229853002)(6246003)(99286004)(33656002)(8936002)(316002)(305945005)(186003)(54906003)(26005)(110136005)(6306002)(9686003)(55016002)(74316002)(3846002)(6506007)(4326008)(53546011)(6116002)(7696005)(5660300002)(76176011)(486006)(76116006)(7736002)(102836004)(14454004)(446003)(81156014)(71190400001)(86362001)(476003)(6436002)(71200400001)(8676002)(11346002)(45080400002)(2906002)(81166006)(256004)(64756008)(66446008)(66556008)(66946007)(25786009)(66476007)(966005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3153; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6ZD3Ef6hhWUO2CejtopGNp9UC23hDfngclPXnVD6kHgsc2il7yMIFu6pFfkUN2pM7hMmpfTIuTVV0Hz37U2dl1uKm4QPo5nmk7rSBOdx7aVr2BNehlrDfRQf0Kb/LDa1kRBjs3g6bdm77x3CxyTa0OhxRFIoXaqqEFJEGEMb72guz3TUfp2uWsDYWXaayixKc7FRg6shvld19r1pfHIjkhemxpfyGC+qoMg3CddHcl7fexl44RH/FnvdMctZ00QqmYv5ORjZoBTOOXN5ArdBjAOiuq7zEoL5U9Y4QzZyJQ9rbPqooB2k8D+Jahk8uHRXnsokxCrMklv5vxUFqJ5MI+17ga/Jwchbe87TSn1eOWb19xHvtpxPHSB4ceO2SFzqorBD0NF3890zKdDw0eulyM+dcwQzXVO/Un5gFdrO/g1G2iHlsZHjbGZ4LNHL6yQFKlV+inbkjU4pOkvQmGGUHI2Ptvk0/TdNL8Qe6LNb/nw= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ebf81ed-9760-41ce-e99f-08d7597daff7 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Oct 2019 19:01:05.1820 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1OToy7DQ6VaJV/p4nmS3KiVVjj+OQjxaThASR0xE4dVCuxd0XEUCgzP/g7OOC/wMAraQI9p43c07OK438inunw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3153 Subject: Re: [dpdk-dev] [PATCH v5 02/15] ethdev: add support for hairpin queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Hi Andrew, Thomas > -----Original Message----- > From: Thomas Monjalon > Sent: Thursday, October 24, 2019 6:35 PM > To: Andrew Rybchenko > Cc: dev@dpdk.org; Ori Kam ; Ferruh Yigit > ; jingjing.wu@intel.com; > stephen@networkplumber.org > Subject: Re: [dpdk-dev] [PATCH v5 02/15] ethdev: add support for hairpin = queue >=20 > 24/10/2019 17:30, Andrew Rybchenko: > > On 10/24/19 6:17 PM, Thomas Monjalon wrote: > > > 24/10/2019 16:47, Andrew Rybchenko: > > >> On 10/24/19 11:29 AM, Ori Kam wrote: > > >>> Hi Andrew, > > >>> > > >>> When writing the new function I thought about using bool, but > > >>> I decided against it for the following reasons: > > >>> 1. There is no use of bool any where in the code, and there is not = special > reason to add it now. > > >> rte_ethdev.c includes stdbool.h and uses bool > > >> > > >>> 2. Other functions of this kind already returns int. for example > (rte_eth_dev_is_valid_port / rte_eth_is_valid_owner_id) > > > I agree with Ori here for 2 reasons: > > > 1. It is better to be consistent in the API > > > 2. I remember having some issues with some drivers when introducing > stdbool in the API. > > > > > > I think it may be nice to convert all such API to bool in one patch, > > > and check if there are some remaining issues with bool usage in drive= rs or > with PPC. > > > But I suggest to do such API change in DPDK 20.11. > > > > OK, no problem. Does it prevent to avoid comparison =3D=3D 1? Just to > > avoid changes in these lines in the future. >=20 > Yes probably better to avoid explicit comparison, but prefer boolean oper= ator > (!). >=20 >=20 Thomas I understand your comments but from Andrew comment on my V2-01 patch= : " >>> + ret =3D (*dev->dev_ops->rx_hairpin_queue_setup)(dev, rx_queue_id, >>> + nb_rx_desc, conf); >>> + if (!ret) >> Please, compare with 0 >> > Will do, but again just for my knowledge why? https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdoc.dpd= k.org%2Fguides%2Fcontributing%2Fcoding_style.html%23function-calls&data= =3D02%7C01%7Corika%40mellanox.com%7C022cd953964f4a20d50508d7508a259f%7Ca652= 971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C637066426584029629&sdata=3DG8ZxE= WFFsv1kLWc6L7sKT8O6CSiBcj5ZuwQqmK0Q6nY%3D&reserved=3D0 " I don't see any relevant info in the link, but maybe I'm missing something = . What are the rules?=20 Thomas also keep in mind that in most cases the condition that is tested is= the positive, meaning it will look something like this: if (rte_eth_dev_is_rx_hairpin_queue(dev, queue_id)) { =20 rte_errno =3D EINVAL; =20 return NULL; =20 } =20 What do you think? =20