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 18B25A0562; Fri, 3 Apr 2020 13:58:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 635881C115; Fri, 3 Apr 2020 13:58:08 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id CCA0B1C0D4; Fri, 3 Apr 2020 13:58:05 +0200 (CEST) IronPort-SDR: /z2QIZdjbZ7RjbsTZSgz3lh/AMJ9pWOsX0e0Bw1JCNV1bRLzDLwQ3ACSG29JX7EsI074PjsDdV jvI9p5QQZS7A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2020 04:58:04 -0700 IronPort-SDR: EWJlh5Gm8W7zwbT7S2CbCkUDQ7DbX9exawjItB72hwusX9AlY1AFlLxCaLUm2Zuayu51zrhOCS /9ehBk3iyZ9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,339,1580803200"; d="scan'208";a="253347489" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 03 Apr 2020 04:58:03 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Apr 2020 04:58:03 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 3 Apr 2020 04:58:02 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 3 Apr 2020 04:58:02 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Apr 2020 04:58:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XMn1YU4341VVLH2zHUHFPycWG5x5/goKV8gSCnxcPvyeI9FXLE3UbCeWlpD13Cha/F6oMn6w/oztPIgwDivh7BEhl/6yAcEjAqgKmWqHuTUi+TjA0ENbszr3wkOdXJYhbG9ruO6eWdL7aCG3N9ZtCPpApOEEa/XJdun+08fAKnJnCsLH3Z2PlPTJoUi8aHWKRf83B2qo0iaoQ5aiStfgbARngpRiWG8y8efvA3acstufbu4YMg/LIlA69GucY9ewKSjDIcvdXntCs+WvcCp73CxFu5unLhbb2FBOcAYzp3jmkKWmWiuZx9cqtRddl1R/ngXzHaVHH056K0VPSU0uXA== 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=PZWtQByj4EojiGHkXMM/fdlny4Vqpq1D+6yTNKI2Sww=; b=Anbve7jFdoFaKBgs+6wUiicqt7P2BjdhMmLGxnx0r5TWNrDw9CtyxAlExB0CG8oNHw8wIK/g1CkIzYbzCSxnScZZec+WNiMKYwj7EcQhvN35HGKllQB/q2fbVStCjcvIBVGv+Iu8U1BxJGytGOdj9AsrWRnAkaIvOBOZg78bKSrCVBEQgzEfCR/pahgTgM7vN5APXhj7euYgsdKx5stwBA+mA3DOJ5L2GjSx3cDmNwPtCX8uLeKELF20q3wlV4qlpEjfI4YvppZqpQgR716mR+B8wocB4g91XR7ZOi+eAia2pdJHQc6XStrL2aSe6OkJ3xf9MoN41k/eC0unCRhWyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PZWtQByj4EojiGHkXMM/fdlny4Vqpq1D+6yTNKI2Sww=; b=DiFzPnkfYNQmIwi7XYsithd4NfuDZdwKnD8HVIWoAPVYIquOoAtfEI0N8Mk/UrJ4iIZIG11QkXAGRWWmT/wCNXfTsgUbgUIKXlhYTOOD7qt1B+kUKVSeVNzGlkhCmQnuq5SbtgN4vXgOdMA6ku7Xbvp9Yudu2qDHyCHsMz3MmcQ= Received: from BYAPR11MB3143.namprd11.prod.outlook.com (2603:10b6:a03:92::32) by BYAPR11MB3541.namprd11.prod.outlook.com (2603:10b6:a03:f5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Fri, 3 Apr 2020 11:58:01 +0000 Received: from BYAPR11MB3143.namprd11.prod.outlook.com ([fe80::5917:9757:49b0:3c49]) by BYAPR11MB3143.namprd11.prod.outlook.com ([fe80::5917:9757:49b0:3c49%5]) with mapi id 15.20.2878.014; Fri, 3 Apr 2020 11:58:01 +0000 From: "Van Haaren, Harry" To: Phil Yang , "thomas@monjalon.net" , "Ananyev, Konstantin" , "stephen@networkplumber.org" , "maxime.coquelin@redhat.com" , "dev@dpdk.org" CC: "david.marchand@redhat.com" , "jerinj@marvell.com" , "hemant.agrawal@nxp.com" , "Honnappa.Nagarahalli@arm.com" , "gavin.hu@arm.com" , "ruifeng.wang@arm.com" , "joyce.kong@arm.com" , "nd@arm.com" , "Stable@dpdk.org" Thread-Topic: [PATCH v3 08/12] service: remove redundant code Thread-Index: AQHV+/o2OwwZz6Bct0+oHm2AnX0To6hnR9IA Date: Fri, 3 Apr 2020 11:58:01 +0000 Message-ID: References: <1583999071-22872-1-git-send-email-phil.yang@arm.com> <1584407863-774-1-git-send-email-phil.yang@arm.com> <1584407863-774-9-git-send-email-phil.yang@arm.com> In-Reply-To: <1584407863-774-9-git-send-email-phil.yang@arm.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.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=harry.van.haaren@intel.com; x-originating-ip: [192.198.151.168] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 74b1030b-6dd5-43c6-0301-08d7d7c6427e x-ms-traffictypediagnostic: BYAPR11MB3541: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:256; x-forefront-prvs: 0362BF9FDB x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3143.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(396003)(136003)(376002)(346002)(366004)(39860400002)(76116006)(53546011)(8676002)(478600001)(9686003)(7696005)(66476007)(81156014)(81166006)(55016002)(5660300002)(64756008)(4326008)(66556008)(186003)(52536014)(66446008)(2906002)(66946007)(26005)(8936002)(33656002)(86362001)(110136005)(54906003)(6506007)(71200400001)(7416002)(316002); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MGxlHFK3Hao8TljPn2dG7+tnTFZ2oQgqWiFDhyxxpfFmwt5zamWWYTuSoPs1Pny98a0vS4cPbo4yfIlWdsAhBH9k8C1a4Ewdb4shLDSOHLETmIyS3G6LL13X8V6CA+SWnbNrCewDXnYt7oo8/0FAiMb3rt3EBQ1K72RrWaMIaD2WPGFChkY+Uaznf7pm/KNLnhWmuoOdLrWwSnvJExoKHmEHhWtJtlcasykmPdSIsbqHh6tyxytOUQsffiP/KD9uVXNAL44Hc9CYwNrT6GhxiwvYHwCgCyzczqcYGNqzCFzFKx5DMhmhdMgZmbhFo8c1NMgBeM7uztT26JyP+tjnMbhFIXY/5TBljYfLC2XUEl/HE2TQHmQ522m+mbeFeF6gs4L0hmBwf/BFErNtoTw9Lngul3MrnmmRRPkqvN3cJgRfXHgSEE4IFjpBhZ1FAHQA x-ms-exchange-antispam-messagedata: yDWRAUhIYHCsVrKfWgzkoTEXN0jPMlnK5jdjPU8oQ9yt/NHEQhlICqynp14QWKhuOYpuEqSz1KBxb9S19GE1J8P5zz/JT2Of59SYlEZ282dGbv/L4bf1GVWO3LjGPOz4nw+LL1cpYJjMyTf8Nwl/dA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 74b1030b-6dd5-43c6-0301-08d7d7c6427e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2020 11:58:01.4316 (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: 6vwOHNUJfemXIKE2B8SD51rpWGbge0zL0p9AEo69u5xz4/CwQdyxDXrp0laWHgGQs2FSEzBSVWu3ibaS5/VT7VhrXWqKrq8L0PERldoDLBY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3541 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 08/12] service: remove redundant code 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" > From: Phil Yang > Sent: Tuesday, March 17, 2020 1:18 AM > To: thomas@monjalon.net; Van Haaren, Harry ; > Ananyev, Konstantin ; > stephen@networkplumber.org; maxime.coquelin@redhat.com; dev@dpdk.org > Cc: david.marchand@redhat.com; jerinj@marvell.com; hemant.agrawal@nxp.com= ; > Honnappa.Nagarahalli@arm.com; gavin.hu@arm.com; ruifeng.wang@arm.com; > joyce.kong@arm.com; nd@arm.com; Stable@dpdk.org > Subject: [PATCH v3 08/12] service: remove redundant code >=20 > The service id validation is verified in the calling function, remove > the redundant code inside the service_update function. >=20 > Fixes: 21698354c832 ("service: introduce service cores concept") > Cc: Stable@dpdk.org >=20 > Signed-off-by: Phil Yang > Reviewed-by: Honnappa Nagarahalli Same comment as patch 7/12, is this really a "Fix"? This functionality is not "broken" in the current code? And is there value in porting to stable? I'd see this as unnecessary churn. As before, it is a valid cleanup (thanks), and I'd like to take it for new DPDK releases. Happy to Ack without Fixes or Cc Stable, if that's acceptable to you? > --- > lib/librte_eal/common/rte_service.c | 31 ++++++++++++------------------- > 1 file changed, 12 insertions(+), 19 deletions(-) >=20 > diff --git a/lib/librte_eal/common/rte_service.c > b/lib/librte_eal/common/rte_service.c > index 2117726..557b5a9 100644 > --- a/lib/librte_eal/common/rte_service.c > +++ b/lib/librte_eal/common/rte_service.c > @@ -552,21 +552,10 @@ rte_service_start_with_defaults(void) > } >=20 > static int32_t > -service_update(struct rte_service_spec *service, uint32_t lcore, > +service_update(uint32_t sid, uint32_t lcore, > uint32_t *set, uint32_t *enabled) > { > - uint32_t i; > - int32_t sid =3D -1; > - > - for (i =3D 0; i < RTE_SERVICE_NUM_MAX; i++) { > - if ((struct rte_service_spec *)&rte_services[i] =3D=3D service && > - service_valid(i)) { > - sid =3D i; > - break; > - } > - } > - > - if (sid =3D=3D -1 || lcore >=3D RTE_MAX_LCORE) > + if (lcore >=3D RTE_MAX_LCORE) > return -EINVAL; >=20 > if (!lcore_states[lcore].is_service_core) > @@ -598,19 +587,23 @@ service_update(struct rte_service_spec *service, > uint32_t lcore, > int32_t > rte_service_map_lcore_set(uint32_t id, uint32_t lcore, uint32_t enabled) > { > - struct rte_service_spec_impl *s; > - SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); > + /* validate ID, or return error value */ > + if (id >=3D RTE_SERVICE_NUM_MAX || !service_valid(id)) > + return -EINVAL; > + > uint32_t on =3D enabled > 0; > - return service_update(&s->spec, lcore, &on, 0); > + return service_update(id, lcore, &on, 0); > } >=20 > int32_t > rte_service_map_lcore_get(uint32_t id, uint32_t lcore) > { > - struct rte_service_spec_impl *s; > - SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); > + /* validate ID, or return error value */ > + if (id >=3D RTE_SERVICE_NUM_MAX || !service_valid(id)) > + return -EINVAL; > + > uint32_t enabled; > - int ret =3D service_update(&s->spec, lcore, 0, &enabled); > + int ret =3D service_update(id, lcore, 0, &enabled); > if (ret =3D=3D 0) > return enabled; > return ret; > -- > 2.7.4