From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60085.outbound.protection.outlook.com [40.107.6.85]) by dpdk.org (Postfix) with ESMTP id 3B9CB200 for ; Sat, 30 Dec 2017 20:04:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=thP8xDVwaaz1paSnQ59mPOV3f0Hbu9cwgtGK/UOblTQ=; b=jl6bp0ahhgD2zcrgi8A8q0gm2Mh3+PiNzqElzor01tqExuG7P/Pe9I1izhOwt/YEMinkYRapjTLqLsZXgjxHVXJDcWTfmWRPHOLdcWp88v5V7PqHeR+pzkNMOdMVUY7rtO7NWwP/qoc2Fj87LN9e0TvA20bftH6Mw9bm8gi3010= Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com (52.133.21.26) by AM6PR0502MB3799.eurprd05.prod.outlook.com (52.133.21.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Sat, 30 Dec 2017 19:04:28 +0000 Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::b4b4:7de8:cf70:aa3a]) by AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::b4b4:7de8:cf70:aa3a%13]) with mapi id 15.20.0366.007; Sat, 30 Dec 2017 19:04:28 +0000 From: Matan Azrad To: Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] ethdev: allow all ports event registration Thread-Index: AQHTbRa/J/fPsp/f2UCVtHAOhwSW/qNaWsoAgAIGylA= Date: Sat, 30 Dec 2017 19:04:28 +0000 Message-ID: References: <1512028170-18637-1-git-send-email-matan@mellanox.com> <1512402221-17630-1-git-send-email-matan@mellanox.com> <6214136.ixGVTiWP3P@xps> In-Reply-To: <6214136.ixGVTiWP3P@xps> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [85.64.136.190] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR0502MB3799; 7:B47tc1AbbYY1UO3tfSeX6q+37xOXEnuZMRHK2A/8h4r1ZCK6FvalZnRGdKGTCMW5HeQp4AITnXz+m/yf+/ZjJnErb8lwDeJiDmAhGE3RKSGMiUBEylYfTmRG8neM6gzLOqUhCGig/U3dQo3D3vQ/lHy8XjUFY37wQx9wawYB+WzgPw4VVKR5jmLTL/Aiu84CwY7WtBnP8l/Z9IW3QOZfR4VGASIOFvxCwWhIjfjodXb6Wbirez3ahm9cLW8efb7a x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 287baada-01be-407a-5839-08d54fb826c5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060); SRVR:AM6PR0502MB3799; x-ms-traffictypediagnostic: AM6PR0502MB3799: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(944501075)(3002001)(10201501046)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:AM6PR0502MB3799; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3799; x-forefront-prvs: 05373A0663 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(366004)(346002)(396003)(199004)(189003)(6116002)(102836004)(33656002)(6436002)(2906002)(53936002)(7696005)(9686003)(7736002)(3846002)(6506007)(76176011)(3280700002)(106356001)(2900100001)(59450400001)(66066001)(3660700001)(68736007)(55016002)(6916009)(8936002)(86362001)(5250100002)(316002)(305945005)(5660300001)(6246003)(99286004)(105586002)(74316002)(2950100002)(229853002)(14454004)(97736004)(4326008)(25786009)(478600001)(81156014)(8676002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3799; H:AM6PR0502MB3797.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: keEKHNXn7T24qtxBE+JGRq7PwnzZRlPPT9ynm7hkAMyB1/KeAp/SKHh+p4KgwwDu1hRTZiYwG6A7SoH5oOHykA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: 287baada-01be-407a-5839-08d54fb826c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Dec 2017 19:04:28.4743 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3799 Subject: Re: [dpdk-dev] [PATCH v2] ethdev: allow all ports event registration 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: , X-List-Received-Date: Sat, 30 Dec 2017 19:04:37 -0000 Hi Thomas From: Thomas Monjalon, December 29, 2017 > Hi Matan, >=20 > Please find some review details below. >=20 > As this patch is needed for the notification of new ports, I will re-send= them > in a patchset, with the minor modifications described below. >=20 > 04/12/2017 16:43, Matan Azrad: > > --- a/lib/librte_ether/rte_ethdev.c > > +++ b/lib/librte_ether/rte_ethdev.c > > +RTE_INIT(eth_dev_init_cb_lists); > [...] > > +static void > > +eth_dev_init_cb_lists(void) >=20 > RTE_INIT macro can be used in function definition without prior declarati= on. >=20 > This function should be moved just before the callback register/unregiste= r > functions. >=20 OK, nice. > > @@ -2827,37 +2837,59 @@ > > + uint32_t next_port; > > + uint32_t last_port; >=20 > A port id should be uint16_t. >=20 Yes, I know but please note that we use next_port variable in the while sta= tement and it can be rolled in case the max value of port id is the max va= lue of uint16_t type. This is the reason I defined it as uint32_t type. > > --- a/lib/librte_ether/rte_ethdev.h > > +++ b/lib/librte_ether/rte_ethdev.h > > /** > > - * Register a callback function for specific port id. > > + * Register a callback function for port id event. > [...] > > - * Unregister a callback function for specific port id. > > + * Unregister a callback function for port id event. >=20 > "port event" would be more appropriate than "port id event". While this change is relevant even before this patch, it is fine to add it = here. Thanks.