From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12885606A320 for ; Tue, 1 Dec 2026 00:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=sF0ZpMIb Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EB99402B8; Tue, 1 Dec 2026 01:59:08 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTPS id 3E83740289 for ; Tue, 1 Dec 2026 01:59:07 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2f03eeda984so60514145ad.2 for ; Mon, 30 Nov 2026 16:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796086746; x=1796691546; darn=dpdk.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=/E5wsyviPT5Hqrmb4N1Ui3VMAwYu/OzUzIoSIwMkRUg=; b=sF0ZpMIbVJsvPJnFKycY82Aj/E7eNGapkKoTaRVK57ImKOj7dizUoGkd4UdFytn0rq uZY52M0LO0SvrwY7xVtMgPquuC4Cr6lqh4Bh3R8XMCRLkeyp8mVDaPTdS2pNABQdzqu9 x2Ho0K2lP1w6ME+IMiX9hiCbzHfVgpm4HmBnvvj0SS6kLOkrFBWWs0xeX4gK3s9Grpis 8SS1cwdli6UsNGpVtOmaBTpGRuDR8CJVF2nYQpc6aj22VpkNbt95Ny7fndCIHCGRPlFj TIyA8ligZ6LBcg8C7qUwcWKO6hcz1SyH+1mVErQ/KtM/T1eAFnjpSvChNwmzp/AIHpqD wgFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796086746; x=1796691546; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/E5wsyviPT5Hqrmb4N1Ui3VMAwYu/OzUzIoSIwMkRUg=; b=0pKdDdEXc6HYvz2ucdEwgeXcH2ZIjFkCf52XsY+54Ckt3smpyUD33nzyJfelQgK7we pRJvB9JLRX6X730FcPewzYOTEHw/JzMxUQBopQt32LIdWw09xcmJkif1aXzmg1IempDn 9duFezts0oMdk4Y0e8wscykU/QmV8mxqRTkljTYNVbQmFD0yEUw80orv3GSdJJZa+wCo S/UZdsgbSaHuz1ksbXWSBN1C0vr10pvfcp8/uTcre3GpjQDBJPaZPW4q137qPoHjiV9e aceC2k5T12Qc1zXZNhoIUFIL7K6LRNmxLMLt+GXpSJ2nQbEmuF68gJSBwedLP1v5UIuO Ta4w== X-Forwarded-Encrypted: i=1; AL+hErFWPr173Yswltd0aczuNMCDB5IGWd93rp30W5Lh89YStJROrXUnO5eUNIA0S+M3lMq+2qg=@dpdk.org X-Gm-Message-State: APuU4Z/3KjyDcvC7zjy1n2NhOEmqYRUztUnjUqdQxgedeXftlNuXv33k CEm16yWQhZFonAlMi/WvmD4dNz6yxzi22VDrt9OX7MxQTdC17BtuMs+w4fx79tGiL/M= X-Gm-Gg: AZFdTZc3V7euG7tzTm3e/AQ2U5Yw699NlVBOC7FXBS2IPepB4zndNUHGW6QNvZu+LSm 2ERYFBWC9dcHAgV7XXdj8O8qd6Dpbye1kYoJXlXWMwdkaXhXMtdw4bA8gmqFN4+HSaxs/XIDRWz TUFmsIgMnCsOn5V25ctxvOtPSH5+AEHqHLOx24fynZnJmoWP6A6PeSIihuNs1MZ9dpSlfiFzzRY NtpR49jjxmPpJKjfaipD57M1y+K7Xo4CdrB6s5OXQUKvVADauxjWpoHoWJFFDog0YlZ0q1kR92p On76PZmm49J2FXfx6uMS33r2nyxQVFez2LTnis60FmyiIXzxwBM+dD5zVQ3NMX8VJ6e8Tce6PuM 2uyJc0naniKt3mgbo4zEQ66UclMuT/iwi13pYN6EimLg0L7mkWh7EZupOkzE9pTseQMV7a6jEQF AaMR2y7BxB1+W3uhitjf1nU17urhStlAWW8dpwpuT3YdJW9lZkG8IK9NG789IlfIsJ94dbiJQGy bBbv4b1ccfK7LzVkERD7I6QFQ3tDZtHOZ3C7TvhSwitN+rwUTD0+m/wocmnULDfjWu7rt3xiZ8a wBKMaKxLJwviYlNqoTk0AA/+1g4gFHC/TlqQqk1QWrlOLAAloupPBGo5Wbkeyo1aKplXLGCXPnU P4KHSS5px3jUDCjwk X-Received: by 2002:a17:903:94b:b0:2e8:93b1:49cc with SMTP id d9443c01a7336-2f03f1bf19amr381877895ad.35.1796086745644; Mon, 30 Nov 2026 16:59:05 -0800 (PST) Received: from phoenix.local (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03f1215e2sm174402885ad.63.2026.11.30.16.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 16:59:05 -0800 (PST) Date: Mon, 30 Nov 2026 16:59:03 -0800 From: Stephen Hemminger To: Dariusz Sosnowski Cc: Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad , Andrew Rybchenko , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra , Thomas Monjalon , Subject: Re: [RFC] ethdev: simplify representor info get API Message-ID: <20261130165903.3f39ce82@phoenix.local> In-Reply-To: References: <20260831162905.383162-1-dsosnowski@nvidia.com> <20260831094654.2cd73523@phoenix.local> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, 7 Sep 2026 17:31:20 +0200 Dariusz Sosnowski wrote: > On Mon, Aug 31, 2026 at 09:46:54AM -0700, Stephen Hemminger wrote: > > On Mon, 31 Aug 2026 18:29:05 +0200 > > Dariusz Sosnowski wrote: > > =20 > > > * Background on rte_eth_representor_info_get() > > >=20 > > > rte_eth_representor_info_get() experimental function was added > > > to ethdev public API in 21.05 DPDK release [1]. =20 > >=20 > > You know the API shouldn't have stayed experimental so long. > > There is no good reason for API to stay experimental across multiple LT= S releases! > >=20 > > The code would be much simpler if you use sentinel values rather than > > carrying around all the XX_valid flag values. > >=20 > > With int fields and -1 (or a named RTE_ETH_REPRESENTOR_UNSPEC), > > the whole comparator collapses to something like: > >=20 > > =EF=BF=BC > > static bool field_match(int a, int b) > > { > > return a =3D=3D -1 || b =3D=3D -1 || a =3D=3D b; > > } > >=20 > > return field_match(info.controller, other->controller) && > > field_match(info.pf, other->pf) && > > info.type =3D=3D other->type && > > (info.type !=3D RTE_ETH_REPRESENTOR_VF || field_match(info.vf, o= ther->vf)) && =20 >=20 > Ack, I can apply that in the next version of the patches. >=20 > My only worry would be that mlx5 DPDK driver gets these values > (controller numbers, VF/SF numbers) from phys_port_name > exported through sysfs. > phys_port_name is based on devlink port attributes [1] with > the following types: >=20 > - controller number - u32 > - port number - u32 > - Used for physical port representors in mlx5 DPDK driver. > These are of type RTE_ETH_REPRESENTOR_PF. > - VF number - u16 > - SF number - u32 >=20 > Using int fields would not cover values > which can be returned by kernel. >=20 > What do you think about going with int64_t for these fields? >=20 > [1]: https://github.com/torvalds/linux/blob/v7.2/include/uapi/linux/devli= nk.h#L412 > Relevant attributes are: > - DEVLINK_ATTR_PORT_CONTROLLER_NUMBER > - DEVLINK_ATTR_PORT_NUMBER > - DEVLINK_ATTR_PORT_PCI_PF_NUMBER > - DEVLINK_ATTR_PORT_PCI_VF_NUMBER > - DEVLINK_ATTR_PORT_PCI_SF_NUMBER Yes the DPDK fields need to be as wide or wider than current kernel fields but already is the case. Kernel changes to widths would break uapi so they are unlikely to change these. What does kernel use internally for unspecified? Or does unspecified even matter since driver shouldn't be getting here if it can't read sysfs