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 B8C9DA0509; Wed, 30 Mar 2022 13:05:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1A9A428C7; Wed, 30 Mar 2022 13:05:14 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 3726F4013F for ; Wed, 30 Mar 2022 13:05:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648638313; x=1680174313; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Y39ObJJoTaN+wnQl+LjsE8au2FyJVrb/V8SmnWmZT+M=; b=YBcxsFeC1ekuBTTf0L9m9YUAvtCpqFjb92YQPKsBuA8L4zap7f9eTvI5 0VS3pidQ5hapxbvTYCFo6rFhZC75ZGJN53W4HUe3Spvhvf/lVRKcNKxks rl4OR0dE/eF+bc4hKItfrKVRIiy6Hu6yNo+8KrheDsDE1mEfg3JB3u5+t kZBc1Vg/KaLZ3pe0T+rHWBwKzILdu+9bXeTeN58FKeAgPv4Z9PW31Goez 5+YN7ABOKfZAiYkmlG9niZCIEpbpsxCCaPIFti7fLTIHSrjwreozdHY5t 23CBeNegXfWWbbRxex1h9vLcdZOvhOLvX8ldMl1fk3rrROb9evP7QyXA0 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10301"; a="259230678" X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="259230678" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 04:05:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="639693179" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by FMSMGA003.fm.intel.com with ESMTP; 30 Mar 2022 04:05:12 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) 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.27; Wed, 30 Mar 2022 04:05:11 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 30 Mar 2022 04:05:11 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) 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.21; Wed, 30 Mar 2022 04:05:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D8q7cNEbb8YtSkwtTGlfMZOFLlqrxz4CdY+dQXwrm1tKH9QC4J/kLmEhAIJkJg8cPviUqfJwSFkz8D/CQIwoFZQhEqTDW0Pa/5qQ6AAY5gxS+Faj1GFLKg7372ND6AuAS5F+53xDzptwRlOIy++sZ981UpQr73dr+eSWg9yf1APdDVYRK4aloLwT6CBM2bry0P9tLE96AAnlJX754Y0OnDL3Cgq9QgiGTjuUok+3BhvUcD1P5/VZJqgYG/5/2xblh2dKB/NyW7mLeP8nkocRKmuMMAUvYS2lNp5lkKSsDXgCjIux/CmRMgxxhWydzezgGFfBN/pIlkryb7x58Ixmxw== 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=XxqTAkg5Va654/hJZklaO5kLnQe3GlO7+s6/CKolIqQ=; b=M+s42+XtD0OWg79BS1xu2AkznxbhR+iM6rjbNdLjfwjT6Ji6rSY4fXe4sPg4ZHy4omvB3MA4Q+6BxO+WsHwokJkwJ5gH5BUaDpYp054qOt94YtghAH8zeCGNHy7tLUglatlME0jJsKCYB61eQ0ffCeea9lwwRYBt3ZLASfENU8BeqrHQ89GQTLDHhxBCOa00h/Qy4P3SmSHlnNJsUM5lMkLvwg7FgQXN1rBGxe9ArfRtJXiXbXztRmWWFgrSwqyorV3Mw9cPBY1LcguJNqGn8aXO04a4Fm/xpqoCAJDsR8wm1o/ndZCYEg7EiNrHk0zkOfOSRFNWp8V96DCeWkqpDw== 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 Received: from BN0PR11MB5712.namprd11.prod.outlook.com (2603:10b6:408:160::17) by BY5PR11MB4243.namprd11.prod.outlook.com (2603:10b6:a03:1c8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 11:05:09 +0000 Received: from BN0PR11MB5712.namprd11.prod.outlook.com ([fe80::28cf:55af:8c4b:d4d9]) by BN0PR11MB5712.namprd11.prod.outlook.com ([fe80::28cf:55af:8c4b:d4d9%3]) with mapi id 15.20.5123.021; Wed, 30 Mar 2022 11:05:09 +0000 From: "Van Haaren, Harry" To: Shijith Thotton , "dev@dpdk.org" , "jerinj@marvell.com" CC: "pbhagavatula@marvell.com" Subject: RE: [PATCH 5/6] event/cnxk: support to set runtime queue attributes Thread-Topic: [PATCH 5/6] event/cnxk: support to set runtime queue attributes Thread-Index: AQHYQ26yWZVj+PgbikyVOP8GIuUrfKzXw1lw Date: Wed, 30 Mar 2022 11:05:09 +0000 Message-ID: References: In-Reply-To: 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.401.20 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: 66a32fea-d692-4edc-7c21-08da123d2785 x-ms-traffictypediagnostic: BY5PR11MB4243:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: F9SZwCjzH2BV6IcBtYlzo2Mz1bkqvX8LO9q8rxdZoZ7/s5+fl9MbWnu2bqOmBpb9T494F9MEMfWm3Khpw20wURXE8PPZh6IZ8RgSPs/A/qkKIFvRu74Kd/Z4V2if9L9CikaYEYrUBuep0ZesPrVK8N4x0tBNWWlkxEgFevu/ZVIUjr/mD/6perq4lodT5plOR6DNqOq1U5yNY144xjSAPOG/x8wrzM5roGtoc07rCuLe/1AVggKPJ+IE96C6m+MQlUajKK/TK8UeCuFtwVuEi00rB64oln2PJ+3c7tKBWqgbk6wuKuI/mwgQGU1sc0jxTojKaiICFrtjCWJ5AdHRcbpXdiDb3/J5/TObMmEOAXnmOGKnAYvB8ddAlvl37HRbqrKORwy27GjQnlp7CXApDlc85MhmCXqUX0GdMp0y6mso4tS1n6vKMf8KtfpZskv+Lvy7e2ZBDT1Ea8lWeeJRJbnmidLhADqxrrJmFesAnnELMCFYqmtxqCiN1EIHx5wEmJpIid5sqWixevj069sQ28f+hb2yRP/H2YENl8OYklZG/VMlb5CdWpIVQxjavsCIh8CZZ2Y/u2qn6xKmJ7EWc4lJFq5HuX4Pi63FVJhvdNWbmn7TkLjsnWL/WR+fQHOy7+ReJuLWk8FdgcWMiPvIYD/Ty+jvU7YdDJcc9ypwv0jR4RrSKuNc+z8ILTxcaYY5vU3o0i0jdsPRJFO7l1Z+3w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN0PR11MB5712.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(55016003)(83380400001)(26005)(186003)(2906002)(33656002)(82960400001)(71200400001)(64756008)(76116006)(66556008)(66476007)(66446008)(66946007)(86362001)(8676002)(4326008)(8936002)(9686003)(52536014)(53546011)(122000001)(7696005)(5660300002)(6506007)(38100700002)(508600001)(38070700005)(316002)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?l2DbKBO//VHj2QHDLDOSoI2xT2WETAKEbNMk1/rxaOL516WMzRfPmGlvvaD3?= =?us-ascii?Q?9E8H+jlN19nUFbHoYJ332GjRDKY1UgFYT9zu/syyC7N2BOdDPXZl68kCz/kF?= =?us-ascii?Q?VqSb98OkKrL2MRxCSH/6R3zfuR7D/nvVxHOg+oMSsyFnj1/qbsYx+7R5pjAM?= =?us-ascii?Q?qX5VZoWhzrhkSyCXWCtlU9q0hmKlftl9/XgI4oeogZWD9BoSjDoH/jdDOdIg?= =?us-ascii?Q?oN2IfMLKY7IQWfj//VG/FzocW41Ij2/xvDt07bb2Bjg/nhARGOC16d5xbiE9?= =?us-ascii?Q?N6twrKL0/FTv/2oGGXvdn9M8svLGFM3abBiRIMd+IWxgzGEQTBp4ayws2s63?= =?us-ascii?Q?nfsrjvw+JwOs4HKDloZXKWbDdTL7tQ+jVzCP43hQVYrtQLkFGm6KjhMI2Mo9?= =?us-ascii?Q?ubsJ+9lY42pnpXyyJ3PQ8i8fukLoeTFiSigp/glrz6Z9fi2o+QmUF+0QHh5g?= =?us-ascii?Q?7oBDjpVIECyhAkG4hQd49rT/fFQAmmsPc0PtAXUDTrmdVi8m/EpWbK8wm270?= =?us-ascii?Q?nYJvCcUnY7j+vveEF/ee90eXmHF9Mcd+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PbvodYbAD0hZmJZeW9M+ut7AHlsaw/7gh07sO8bqslB4ym3bZLlkvtp?= =?us-ascii?Q?D26OD3D9aib1VK9+92K5SjrWMS+RIrXr1F/CxyGW0yrh/zVLpJMII0QYc1kV?= =?us-ascii?Q?4T8FvGAKm+NH0qpEYcA+XxXGBg90eyozvy+rvh4q0FWEGLtIgwjXS/SxdC5k?= =?us-ascii?Q?IlJGwkP9a5vx6I/btpDYE7Fu4vXlWT0MwQolE+6rDHBNJjp3930gt+2Peucr?= =?us-ascii?Q?D88TBadVT05lAZ3RR0Lcpv9oMZ15/QoNAKikLSdbgiJwFNrPq0cR25q4cKyt?= =?us-ascii?Q?0+k7Uq+KlBuTlbSuSspcwZzbTaYhL08=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: BN0PR11MB5712.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66a32fea-d692-4edc-7c21-08da123d2785 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2022 11:05:09.0448 (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: 0qDJbRewwpJJjISVHnRKJ9gsTnkFFZN4ndayUeTRQ1/hwZqgMeDlvO8E5Gt+QimPl9nOFPPG+BFHNi753yICUeS9AVBqGeJHLyDv6EgdxLo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4243 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 > -----Original Message----- > From: Shijith Thotton > Sent: Tuesday, March 29, 2022 2:11 PM > To: dev@dpdk.org; jerinj@marvell.com > Cc: Shijith Thotton ; pbhagavatula@marvell.com > Subject: [PATCH 5/6] event/cnxk: support to set runtime queue attributes > +int > +cnxk_sso_queue_attribute_get(struct rte_eventdev *event_dev, uint8_t > queue_id, > + uint32_t attr_id, uint32_t *attr_value) > +{ > + struct cnxk_sso_evdev *dev =3D cnxk_sso_pmd_priv(event_dev); > + > + *attr_value =3D attr_id =3D=3D RTE_EVENT_QUEUE_ATTR_WEIGHT ? > + dev->mlt_prio[queue_id].weight : > + dev->mlt_prio[queue_id].affinity; This is future-bug prone, as adding a new Eventdev attr will return .affini= ty silently, instead of the attr that is being requested. Prefer a switch(attr_id), and explicitly handle each attr_id, with a defaul= t case to return -1, showing the PMD refusing to handle the attr requested to the = caller. On reviewing the below, the set() below does this perfectly... except the r= eturn? > + > + return 0; > +} > + > +int > +cnxk_sso_queue_attribute_set(struct rte_eventdev *event_dev, uint8_t > queue_id, > + uint32_t attr_id, uint32_t attr_value) > +{ > + struct cnxk_sso_evdev *dev =3D cnxk_sso_pmd_priv(event_dev); > + uint8_t priority, weight, affinity; > + struct rte_event_queue_conf *conf; > + > + conf =3D &event_dev->data->queues_cfg[queue_id]; > + > + switch (attr_id) { > + case RTE_EVENT_QUEUE_ATTR_PRIORITY: > + conf->priority =3D attr_value; > + break; > + case RTE_EVENT_QUEUE_ATTR_WEIGHT: > + dev->mlt_prio[queue_id].weight =3D attr_value; > + break; > + case RTE_EVENT_QUEUE_ATTR_AFFINITY: > + dev->mlt_prio[queue_id].affinity =3D attr_value; > + break; > + default: > + plt_sso_dbg("Ignored setting attribute id %u", attr_id); > + return 0; > + } Why return 0 here? This is a failure, the PMD did *not* set the attribute I= D. Make the user aware of that fact, return -1; or -EINVAL or something. Document the explicit return values at Eventdev header level, so all PMDs c= an align on the return values, providing consistency to the application.