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 E9227A04FD; Mon, 4 Apr 2022 09:59:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 844CC40698; Mon, 4 Apr 2022 09:59:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id F12D14068C for ; Mon, 4 Apr 2022 09:59:47 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 233NRQ4R026510; Mon, 4 Apr 2022 00:59:47 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3f6p0pntpe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Apr 2022 00:59:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DSiXrWzBPoTQz/gUfd4+b6RgDpuwHBxlFwhqGyqu4IWyuwCh6zzQWqe4+ZsZqhxCISbrlUeBzXj+hRFbE/66MSCEqZWWXHJ0NvcCAiLm0JDZgq6AkYxgkWoIQlH0wDubxCx16faZaFBIBZEfzfCvTTig4622voyrF9D+MxIjkg+jGfnaE9l6xuKt2fBoDbJfT+IZCDByJXbYLOaQCK7x9Gxe8lWVvH2eVd7MYFKAbAP3pzDdDUYi2LU5BNfSUAsMmilXkc03E+KXaiLZZZ7vLPlK6LmbJF/+oy+rNaf3My2ALfnKtPEd+r8vgVkWekFGMLyrKJV4d8jXRcIP4pdSSA== 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=/8fDZog+qS/ujFFsewyXvbYYNj+kGpF93NMzGmB+CzM=; b=B028zEwgzGIVycvChj9510GN25QY+/b4dh53QNIcdSID27Z/6ol2MKSZRpenvTZpSjxR4hD+s9o/OhLkLStdvbcguilgdFVl2NCwD1ZI4JbO8vOZlDaQ8JPohb2oCqn9EEkGy1hu3LEYz9GZWHokhKmTZ+cGlA3wqTbZ1KmsHhZVNqUj58MQJYs3LZr6NdPbFesynDFI2WG3+WaUF+7GaqevD3fK3e4SB3u9abbWCDz4QiC0y0sd/UHcnhvr1YbTwd5srZPFQqrXb8ZVfH4UGqGcnqyyHCJKDzzapav7pZqaxiU6CgPzNaXyfNqr95InkRvtx4L7kuXKJM6lyuhW1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/8fDZog+qS/ujFFsewyXvbYYNj+kGpF93NMzGmB+CzM=; b=q9t24S7sXYZCjxnP0a0A2mEOnP34r3TS7HiR/8uXQsTwPByNRLlHI2hxv5fYutl5CpDDbT9w8/JNcxILTUizrYZEZ9iXx6pimiHRdMbk+hcAxa2B/MbZ/sT3M26DA87GDqMuc2HFnGsGeF2lZ2NQX/ltercHGjpBYXsN8qWF33s= Received: from PH0PR18MB4425.namprd18.prod.outlook.com (2603:10b6:510:ef::13) by PH0PR18MB5090.namprd18.prod.outlook.com (2603:10b6:510:172::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Mon, 4 Apr 2022 07:59:45 +0000 Received: from PH0PR18MB4425.namprd18.prod.outlook.com ([fe80::3967:c554:ec3e:b8a9]) by PH0PR18MB4425.namprd18.prod.outlook.com ([fe80::3967:c554:ec3e:b8a9%9]) with mapi id 15.20.5123.031; Mon, 4 Apr 2022 07:59:45 +0000 From: Shijith Thotton To: "Van Haaren, Harry" , "dev@dpdk.org" , Jerin Jacob Kollanukkaran CC: Pavan Nikhilesh Bhagavatula 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: AQHYQ26cBuh+Sfc42UifcsNqwzgKW6zXxSyAgAdmJiA= Date: Mon, 4 Apr 2022 07:59:45 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4858b89a-4032-4e2b-cc99-08da1611152d x-ms-traffictypediagnostic: PH0PR18MB5090: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: aq7SuUmNhe4Bp4DrMh9ymJd1jt5XBpt/mtrw5jwh75mqiWkeLDOnKq4fx6PiwgZoUs9sISURHtwWBDNaT6jBV/+kjXKlbKSJtvoXbTuMdUginPS+OFc1HNlSybdof5w8GKxgiDK2r6iekzf9AJvKO3na4/jnKHTlaA8J7Gjr1ZIPvbBnysjp4Pb8oDmwY4SmRsk8m6GwoA7hjNIS0gdVUuCkZpwYIPvIo7WWiWV9gbY0WjiK6GtT4IAJgAFXZrSeWvkJOb1aepVAouHkfjbV/96IkLzrHqxksZmI1+HVflu773jf3hLkYpxYE8ZJTFUqZWnNthQ/Z+ot3UgcZg/+f3R43U2BMjoYI9BBQxSWxoWf8tNCqxZ7SQvtYaUUweEPK6AWkSv3ZN9WtayXhPlXMtnlWUiToMSbmH1W4WeJmYsRjWj64oMHheeKJBfM/ykxp81MPDUjx+crY4sioC5wA52uDnWyaEZEZKMlYgOHwYQmxYdz1Ffg4eRlo5/lIaItlEGtGcz0fUC8CYm6KMEqXlsHp3eQBYli4wtIGxlHIkKNPe42rpp3A7WrglFj2YLMrOCyJegEANHWjokj9Z/0OSYODZC4EOgUAPktg9+nedSUYie+z0Fl2tXyHJygtOf85VssDAli+fEftfXJZEnts8dm8Fgqcv9jDdlbY1aZqTW7H1XjeC8w+G4vdxp8k1D7hS6krEV7Bt6n98dJMcRo0A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4425.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(110136005)(8676002)(64756008)(4326008)(316002)(6636002)(5660300002)(66946007)(66556008)(66476007)(55016003)(66446008)(52536014)(8936002)(2906002)(76116006)(508600001)(71200400001)(6506007)(33656002)(38070700005)(38100700002)(86362001)(122000001)(26005)(83380400001)(7696005)(9686003)(107886003)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8qEqdmfwZW1+aGyM+9zebwCdkZQfFkkl45OHRpqagBScYskSAlGZiX6fDUiN?= =?us-ascii?Q?0uk+2uvQgGUZo/cweSD157ShaGjuIdRhsmPiLozdVrEFAuEWQwFMwtYzMO5L?= =?us-ascii?Q?qLJ47AaJb5eGSFGmTzYzUDMUTt9gL/gM8Ks2KD/2XFrfjiXgAHVlTqvjb+cn?= =?us-ascii?Q?P1OXW1tjNmmUOREKOGwevLvnI+22HInPneGdRoBA88ETnPhZqlqEJORF+lfe?= =?us-ascii?Q?5mUNvBojxqzcofLoETDXE1qx5fLcXZ6OjUbh4BO1TpRz2QQWzmJTL1HYhFq5?= =?us-ascii?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djuNZHL88FptJyr11RQLFYqpfidil?= =?us-ascii?Q?D1sFB21dfMcL0pbl9ntn2o+nQGnfZb5T6yM9eW0JU6BIjJl9AVUaI2GPMw4/?= =?us-ascii?Q?0lO9ILABmmmXceEpLL5GbsKsNMoaQ9wKz93Xx0l15eswEKj1zzR2aAwsgQRD?= =?us-ascii?Q?JgHSalbSV+8N8qzMEBi4a77LC77fOo0LP9g6HBcJh8Td5noeTsL5J+BmxUJr?= =?us-ascii?Q?zDRXpeCOPAGNHN72j5utVk+O8kZxSYP5NnVLaBIS75lRGLYQTy1dESq8VcFc?= =?us-ascii?Q?1XHb5oiE/uB9GhnhjzufgcvUb8qLCObNrW8K9BNtM7+H6E46Ob2Fe2uD0kTQ?= =?us-ascii?Q?rMcNic1zute1Z2aH+dNeTqzAJcpbXSgXrAD5Q+JurrTkzQm2nEJhNM5X70qC?= =?us-ascii?Q?H6rH/WuCyCI+/oVnne3ArMlI3QXDExqOjhdo2SpC7UbDL3oLZtdLOAH3lKRq?= =?us-ascii?Q?+scUsQHJfI5Vaewgo4iocEgBvu1B4T8r0t7MlcmGJ3WZcfS9H5TEScz+KPcK?= =?us-ascii?Q?rmd/z9HumA0cH8Re+4ymQ+ChisSOG9hnIFeKzbqLrn8ZCm/nNVVq5ureMuNW?= =?us-ascii?Q?Wxv8U4Ne2Q=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4425.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4858b89a-4032-4e2b-cc99-08da1611152d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2022 07:59:45.1299 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xuyaL04ipb8XSEcSOneKB0o8LGYTXAPqeaLRmx84dLjUlJjVFEs787OGIRS8QC/siXYcPq5M2zRtrezrHYP6Ng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB5090 X-Proofpoint-ORIG-GUID: bCjE1yEYfbPG6UhVA5tTmnJpCrtT49kT X-Proofpoint-GUID: bCjE1yEYfbPG6UhVA5tTmnJpCrtT49kT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-04-04_02,2022-03-31_01,2022-02-23_01 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 > > >> +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 .affin= ity silently, >instead of the attr that is being requested. > >Prefer a switch(attr_id), and explicitly handle each attr_id, with a defau= lt case >to return -1, showing the PMD refusing to handle the attr requested to the= caller. > =20 Will change it similar to set(). >On reviewing the below, the set() below does this perfectly... except the = return? > >> + >> + 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 = ID. >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 = can >align on the return values, providing consistency to the application. > Will update PMD and library with error number. >