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 E9901A0A0B; Mon, 1 Feb 2021 13:49:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C79640693; Mon, 1 Feb 2021 13:49:40 +0100 (CET) Received: from ebb09.tieto.com (ebb09.tieto.com [131.207.176.19]) by mails.dpdk.org (Postfix) with ESMTP id 0484540687 for ; Mon, 1 Feb 2021 13:49:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; d=tietoevry.com; s=s1; c=relaxed/simple; q=dns/txt; i=@tietoevry.com; t=1612183777; x=1614775777; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KZP90zhc8S/K21RPor6/OQS7/kM2Zgj5FSCf0dxZJBI=; b=TNqCc/VnnGgmsxqKaiBFh+ZAVb8KauNmqJ7a+tIvDxh1B/Ry0pxRF7AdpXz14wQU dW5P0ywAYzSpZGtsEsNEx+gAlMv4IgPmuU35lXC6qQuN74Mwsu/s4PlXN6CzjYM8 LZxk8UDMA9XMZcaIEu5wJrLrPn1ciG5ulthdEyhaQao=; X-AuditID: 83cfb013-41dff700000018b3-d8-6017f8e034cb Received: from C105S135VM015.eu.tieto.com ( [10.34.8.53]) (using TLS with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by ebb09.tieto.com (SMTP Mailer) with SMTP id A1.84.06323.0E8F7106; Mon, 1 Feb 2021 14:49:36 +0200 (EET) Received: from C105S135VM014.eu.tieto.com (10.34.8.52) by C105S135VM015.eu.tieto.com (10.34.8.53) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 1 Feb 2021 14:49:36 +0200 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (131.207.56.46) by C105S135VM014.eu.tieto.com (10.34.8.52) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 1 Feb 2021 14:49:36 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5iR5x1+sC9+9+Kcx3/EMTa7w+LiZgFWeLYNIaBT737c+KLvYcd7GtKiEROKvOh3EjLP4koRsumsfCacu8BGmCutqCwSR5KbYRHNoMtFkoxsKq2g0bsVWUdwgpk6qFRZX/zxKnAqOHe3CD6pDhYJFXJDfjqNTjhMbA0katkGHKCJ+60RdRbWtj4HxkTY9WZ9i8xoAEv/TNmix8SnddostZUbOetvAi/t3QtkM/dDknoerpm6BsoG8MptyI+UYTKviO5bB3Awfe88Pw7S+4ieJH/+HFvQYG+cL90jC23Xmd+zke8kY6IOWuCgrNtm3zHE74GTg+B0Ogn//4xrqfln1g== 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=b5ZsCzvcjwHy7s3WS3fSDiemZeaoRAxGPV3UmNwUeys=; b=kD16Z3elkkRQvLbmL7cSpN16ogDH+EuWpdriZZENwntxrWH4EoraBPbY3YIUf0k6Ah9zY7YdPecoHgO3WMXO4XEso6HvXR0h7I8XqrRdH6gBr6yGMrJX/35LqEjFCm98TsXmzkzyHoIK1Jz5B2nJGs/8NYdsRhoB2uxuk6dmUrgDuTljVifD/+JyoquENbPqIlOHl+FMLUBd5HXIHxPtgdMqsqlFDl0FgPbpWWAq/pmJmfgn5e1qFqOd1BzWJYMDCpyHtimwEQjx/rkQ+x2JDgqyhs/Sosjn5/7cADC5Tib5FRKCf7NIoJp8zsBv0NuAaD9dynbqb+Zj2vHieYTQeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=tieto.com; dmarc=pass action=none header.from=tieto.com; dkim=pass header.d=tieto.com; arc=none Received: from VI1PR04MB4303.eurprd04.prod.outlook.com (2603:10a6:803:3d::20) by VI1PR04MB5727.eurprd04.prod.outlook.com (2603:10a6:803:e4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.17; Mon, 1 Feb 2021 12:49:34 +0000 Received: from VI1PR04MB4303.eurprd04.prod.outlook.com ([fe80::e8c9:b286:cf3f:e069]) by VI1PR04MB4303.eurprd04.prod.outlook.com ([fe80::e8c9:b286:cf3f:e069%5]) with mapi id 15.20.3805.027; Mon, 1 Feb 2021 12:49:34 +0000 From: "Fredrik A Lindgren" To: "Van Haaren, Harry" , "dev@dpdk.org" Thread-Topic: Question: typedef of eventdev_info_get_t bug? Thread-Index: Adb4en0LIeGDpUGTRpesaiMx8+RA6gAA5+4QAACUs+AAARiigAAEs6+A Date: Mon, 1 Feb 2021 12:49:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=tieto.com; x-originating-ip: [92.35.187.108] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b3c6a96e-75c1-438d-0c6b-08d8c6afd3c8 x-ms-traffictypediagnostic: VI1PR04MB5727: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CEJ7AaFAFrdEzNea/VLE89shzsP1gadzDLkk7qWoOS98gq+Z99rud8TPTRmJoLbS7S42uQAmQS32RrfypRldlRxsLb9hFcmIG+8iZrz7Dc2g1AQlefpasDWcArmD9aDdliTQQTUeIIcbLvRbvH3skUdFlIAFh5Ab9aFccCRRsMQkifflvnSs2HuShlPv5J7CvXFwmpdVBVYUOhI0zFMu/IpPglSG8bKE+HBpxlFR+cGA/uvvDgJ6jCthGz8da6riFYPTvEU6N6dqvIiBCllSsVcEY+3RnaSZy3+O5an72pj4htMXlEQDrvH4c+XqOsPBY/xYoQxcB0pe0xAfQBg4hRWllpf10W9GMmMAwZU01fF+SO3iH/XR7EMCFioxJreD/D8TzzJUWiMysIu2uMNOpSSX77uQngRMwVHJQyKYgij0ljBn62Xz5RKzda77rME6+9xGdOav+l8ftuA4hdbR1/OnE6pc4NQIgsWsydxyBnpvC3eOoyKmz02+XjZhPxfXZRX18FbnuzC83COV1KHnWZh8TQu7yy4/YHkGvJj6/ArmUClVBteWUDWJv5S2REcOX3Y1V68jrz6PQHpvU0OriisMS9A3fJzjX+bIZickpsY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB4303.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(53546011)(86362001)(966005)(5660300002)(8676002)(2906002)(498600001)(71200400001)(9686003)(7696005)(8936002)(33656002)(66446008)(66946007)(64756008)(52536014)(186003)(6506007)(83380400001)(76116006)(110136005)(66476007)(66556008)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?odZPvqC16DIDUHjbwcuRCQDmFMTjr20XjUN/IH+nQsLvmxmtJcu2boDA7QC3?= =?us-ascii?Q?1uf+SHezzkRHfkhgEy2UZMbp4EZJaT0iGlpdssdAc+YES1QI/HaGjYQCxJ61?= =?us-ascii?Q?7WnSOoRd2DwKVB7klrcSLpl04DGlFc/Gwqxq/S9SywMcdRdYVR9kVa6JLpnO?= =?us-ascii?Q?prAbkfj9JjG8YzUs2s5QauS0mDVNX6Z8i3oXuJG9JZ9ylvQT7503ZE4BnzfB?= =?us-ascii?Q?s3C6EhHGM+0iVTGxSkm9i0T493QaNRxy7smeLYlCO6wwkfdMGy7FtQID3yvz?= =?us-ascii?Q?Ems3cBb65Ftn7q166QXOs7deKTvAC9wU5Wb1NA/s4Ct8aZLJXlwcqMPB2Zsz?= =?us-ascii?Q?a9jDGMy8iyZfujMNLLlxQhyjAU2yw+odjQP1kAyUxLhwKoH+IdTEo+bxndSf?= =?us-ascii?Q?J+eHltGsHci6NO0IPNTMSi5/bqOe8gI15FEwp7c7H6BJSa0HWRWcWSsdMRyO?= =?us-ascii?Q?pDOWqPWgcidAF+WNaFHzZdRrbxTZWPnmVszGwOCxBf+5UE4HyswSQrRdW60+?= =?us-ascii?Q?98YvlP2AEG0Ys76iWf/TgL+JszhoRVm4M6BG0aQL1YFvDleMFGE/d6vb5qYn?= =?us-ascii?Q?tx9UBa6i2hqzKm/CngWeU8/RhAmYaNCdd4QNodRY1VQO6TRtz/k+NPMqgoEK?= =?us-ascii?Q?RfoLMs58Kc24JfxYaDozDT2JRhibCVu/439HjJ8mESG+TZNloqCpySn+dkDj?= =?us-ascii?Q?03S+8zuU3Tgrt6gWO7tvQfTMn4BTlwNq4bvB03vyrlZKaq6sxnbxPjYjJkdu?= =?us-ascii?Q?08qnCmcOSfEpEm5IQhi883yI2sjF/S8NZGzPQBJxW7hem+msVuJo+7K4XKDp?= =?us-ascii?Q?LywCjj9CAt9X/d5aWrcEdRQQ/MaO0MggRtvwKjdQKP7arNdUjgg02Z+YYFjE?= =?us-ascii?Q?gS5SRJuR3GBpSotV0mfbCvejsii5AJfkc9qMBF3CZHLhiC9BBG/l5Zoxjna8?= =?us-ascii?Q?hPYypeIAbo8gZA2WFu1G0cgeSEaea/USI1tyudkudgxYKzJYalv48OHCQYGN?= =?us-ascii?Q?Sinaosy4hsktg5tWeA8Y5Y9+173D0wgpk4rQ3Ze5m0UWxL5tdmHcLfLcKJtM?= =?us-ascii?Q?UtMSwxw0?= x-ms-exchange-transport-forked: True 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: VI1PR04MB4303.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3c6a96e-75c1-438d-0c6b-08d8c6afd3c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Feb 2021 12:49:34.6585 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: cbede638-a3d9-459f-8f4e-24ced73b4e5e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MTpYnuu+jP1EAcOaHHEOkPyb+yUJmo8mSMni/CGM6hvQSDISOilh6dNb/m0dVA4Hiy2sijAuh7izPyj3JbF4fr/p2S0yxCaIWUfvBz+d+Ds= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5727 X-OriginatorOrg: tieto.com X-Brightmail-Tracker: H4sIAAAAAAAAA11UfUwTZxzee72Wo+PF80rb1w4MXIiL6PBjIwGd02DmWLJFYzISzZwtcGs7 Sot3V6VbtsEWFlMVOodx4AwU/EpJmHOD+sHUlJmwzqWbm9OZwQBtxkeCwhTMMnT3Vbzuv+d9 nvf3e37P794coaE69RbC6eYZ1m1z0To9rqeJgueGHpqtK4cDBYWT02GssK5xBt+AlfzTdlxb 0tE7hm3BtutfrGBczt0Mu+Ilq97R2tCvrf4kt2Y65k+pBX2ZfpBKIPIFdKN3WucHeoIiGzE0 dbpZKx+6AYrFelLkwwhAX88ckRRAntCgkxfjKfIhiqPJz7oxsRkgvwSo5W6pXNKOocOPDynN hgH6198k2BCEjlyH6s6liTCDfAPdmCgVaw3kGhT4ZS8u4gxyLQp/fhnIeBPaP3hc4nEyF136 9UfJC5Jvor++6MLk9tcxdP/isFSQSu5AfXeHdPJAWejP2UGpWEOa0a07rZicmkTHemMaGRvR 2O1HWvm+H6DReLbM56BL7VO4jLPQtdZ9QMavo8sdfVoZ56GB4CmdjCvRR7//rPRfgs582qPw i1HowLDSJxMN3QxL20ZkoxbNHgxpA2B1i2o+GS9HbRemdTJehk4EJzQtUuiF6PvmO3gbwENg AVNWtrIon3cyvCe/3FN1Bgjv4uPYacNZsLdpYwSQBKDT4P5xs5XS2nZzvqoIqCQw2gjvTRqt VHqZp8LnsHGOnazXxXB0Bix5INyE83SZ11VJW+DWWYE1zLNuZg/nYnjhIdKLYUXYZKXM8xrn 5aqd5U6Pl9vpZV0RgAiN0DZ6ULgEK2y+dxnWI5tFwDMETpshf5KyUqTdxjOVDFPNsAl1D0HQ CG6bEZwXsoydqXnb6eITslA3kC0opFqRhs2CXw0IXia1oJo3B9pDGVbKopb/PzJGpEaAnUgT 5j4lBodcta2Kc9oVawPsENm0BCvZLoITIkklSJVlFvSJKzIlpGS7KKgHRGDsaLuGwt0eN2Mx w9tiZlK87vC65yNbTHBws/DNFqgE0dqSCR90CgVGFf/E3ZINMz8Q1EUqNXkAWnowhfnjoFx4 Kwb4oRRO+M08SUzBb0XyaYWUAiO45qH4aRROlTcT2sS8RkVJdhsXFosJi53qFh8Ex9t49WL3 9ZjExSqssti3xG5Ugkxa7Dl5sYqU7GSpBek1gZzwhvoVx8i/j+j7l42cZ/m573Jefly0af3h pfdH8rYdiNeNXthxNPgTi6+Nto+W/vZe7rjvldorq+pXv7NEG/dc7+pcXpxeN/JDCDx7hYh/ E32/YVekdm7dery/4Ob54PaNux4Fi8+6Di19raGvqflay9XiouevvvpU69y9P7ZQXbdonHPY VuVpWM72H6RLk6y+BQAA Subject: Re: [dpdk-dev] Question: typedef of eventdev_info_get_t bug? 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 Sender: "dev" I'm not 100% familiar with contribution guidelines of DPDK community and si= nce I'm doing this on work hours Corporate praxis is to get legal approval = to provide contributions to opensource So if you have the time and already are familiar with contributing to DPDK = feel free to submit such patch Yes gotten around at least that issue, have other suspect behaviors when tr= ying to use it though. But those are most likely related to driver and as such probably for a disc= ussion outside this mailing list with Xilinx Br, Fredrik -----Original Message----- From: Van Haaren, Harry =20 Sent: den 1 februari 2021 11:31 To: Fredrik A Lindgren ; dev@dpdk.org Subject: RE: Question: typedef of eventdev_info_get_t bug? > -----Original Message----- > From: Fredrik A Lindgren > Sent: Monday, February 1, 2021 10:02 AM > To: Van Haaren, Harry ; dev@dpdk.org > Subject: RE: Question: typedef of eventdev_info_get_t bug? >=20 > Hi Harry, >=20 > You are correct, multiple structs with dev_infos_get defined in them=20 > caused me to jump to wrong implementation. No problem. > Still a bit "wrong" that comment for eventdev_info_get_t for event=20 > setup states returns 0 on success. Agreed, a patch would be welcome to remove the "@return" bit of the docs. I can send it if you say you're not planning to, its a small/easy patch. > Using older version of > https://github.com/Xilinx/dma_ip_drivers/tree/master/QDMA/DPDK=20 > targeting dpdk- > 19.11 for a corporate internal project as such can't give much details. > That version had a issue with no return statements in the infos_get=20 > function which was causing me issues. Sounds like you've root-caused and know of a solution. > Br, > Fredrik Regards, -Harry > -----Original Message----- > From: Van Haaren, Harry > Sent: den 1 februari 2021 10:44 > To: Fredrik A Lindgren ; dev@dpdk.org > Subject: RE: Question: typedef of eventdev_info_get_t bug? >=20 > > -----Original Message----- > > From: dev On Behalf Of Fredrik A Lindgren > > Sent: Monday, February 1, 2021 9:22 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] Question: typedef of eventdev_info_get_t bug? > > > > While debugging a driver I was looking at the code and realized that=20 > > eventdev_info_get_t typedef is defined with void return value but=20 > > documentation for it says it should return 0 >=20 > Hi Fredrik, >=20 > Be aware that your snippets of code below is mixing Event-dev and Eth-dev= . > This is likely the cause of confusion. >=20 >=20 > > lib/librte_eventdev/eventdev_pmd.h: > > > > ... > > * @return > > * Returns 0 on success > > */ > > typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev, > > struct=20 > > rte_event_dev_info *dev_info); ... > > struct rte_eventdev_ops { > > eventdev_info_get_t dev_infos_get; = /**< Get device info. > */ > > ... > > > > While return value from it is used in lib/librte_ethdev/rte_ethdev.c: > > > > int > > rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info > > *dev_info) ... > > diag =3D (*dev->dev_ops->dev_infos_get)(dev, dev_info); > > if (diag !=3D 0) { > > ... >=20 > At the Eventdev layer, info_get() can return int (particularly 0 on=20 > success, or -ERROR values). > At the Eventdev PMD layer, info_get() has a return void (the PMD=20 > cannot indicate failure on providing its info) >=20 > Hence, the info_get() typedef (for the PMD) is void, but the Eventdev=20 > layer itself checks some dev_id values etc, and can return -EINVAL or=20 > -ENOTSUP in case the PMD doesn't support info_get(). >=20 >=20 > > Driver I'm debugging doesn't have any return statement in it's=20 > > dev_infos_get function which seems to cause it to have "result" of=20 > > last operation done in that function as return value. > > Though this behavior may be compiler specific but it should probably=20 > > be clarified and updated (change prototype of stop using return=20 > > value) to avoid > issue with it. >=20 > Perhaps provide some more detail on Eventdev/Ethdev that you're=20 > debugging a driver on, provide some links to specific parts of the=20 > code? It seems like (from Eventdev anyway) its meant to work this way. >=20 > > Br, > > Fredrik >=20 > Regards, -Harry