* [dpdk-dev] [RFC v2] net/mlx5: support new naming scheme for representors
@ 2019-03-03 7:14 Dekel Peled
2019-03-04 19:14 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Dekel Peled @ 2019-03-03 7:14 UTC (permalink / raw)
To: Shahaf Shuler, Yongseok Koh; +Cc: dev, Ori Kam, Matan Azrad
In current kernel implementation, the physical port name for representors is a numeric string (i.e. '0', '1', etc.).
Kernel patch [1] implements an updated scheme for naming of representors ports.
The new scheme gives a unique name for each port using the PF ID and the VF ID.
Uplink representors are named 'p0', 'p1', etc.
VF representors are named 'pf0vf0', 'pf0vf1', 'pf1vf0', 'pf1vf1', etc.
This RFC describes the suggested changes to MLX5 PMD, in order to support the new naming scheme, while maintaining support of the existing naming scheme.
During PCI probing, MLX5 PMD uses Netlink to query the kernel for switch information.
The response is processed by mlx5_nl_switch_info_cb().
If this query fails, MLX5 PMD attempts to use sysfs to query for switch information.
This query is implemented in mlx5_sysfs_switch_info();
The following section describes the suggested changes by pseudocode:
mlx5_nl_switch_info_cb()
{
Parse the netlink response message.
If found type IFLA_PHYS_PORT_NAME {
Convert payload string to number, store as port-name.
/* START NEW CODE */
If convert failed {
If found substring "vf" in payload string {
Convert the remainder of payload string to number
Store as port-name.
}
}
/* END OF NEW CODE */
}
}
mlx5_sysfs_switch_info()
{
Convert ifindex to ifname.
Open file /sys/class/net/<ifname>/phys_port_name
Try to convert file contents to number, if succeeded store as port-name.
/* START NEW CODE */
If convert failed {
Try to convert file contents to 'pf'/number/'vf'/number.
If succeeded, store last number as port-name.
}
/* END OF NEW CODE */
}
[1] https://github.com/torvalds/linux/commit/c12ecc2305648822970002871230979359edb2c0
---
v2: Use public link to kernel patch.
---
Signed-off-by: Dekel Peled <dekelp@mellanox.com<mailto:dekelp@mellanox.com>>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [RFC v2] net/mlx5: support new naming scheme for representors
2019-03-03 7:14 [dpdk-dev] [RFC v2] net/mlx5: support new naming scheme for representors Dekel Peled
@ 2019-03-04 19:14 ` Stephen Hemminger
2019-03-05 8:46 ` Dekel Peled
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2019-03-04 19:14 UTC (permalink / raw)
To: Dekel Peled; +Cc: Shahaf Shuler, Yongseok Koh, dev, Ori Kam, Matan Azrad
On Sun, 3 Mar 2019 07:14:07 +0000
Dekel Peled <dekelp@mellanox.com> wrote:
> In current kernel implementation, the physical port name for representors is a numeric string (i.e. '0', '1', etc.).
>
>
>
> Kernel patch [1] implements an updated scheme for naming of representors ports.
>
> The new scheme gives a unique name for each port using the PF ID and the VF ID.
>
> Uplink representors are named 'p0', 'p1', etc.
>
> VF representors are named 'pf0vf0', 'pf0vf1', 'pf1vf0', 'pf1vf1', etc.
Depending on kernel to use any particular naming policy is going to be problematic.
Users will want to run on older kernels, and many distributions rename interfaces
through udev or other mechanism.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [RFC v2] net/mlx5: support new naming scheme for representors
2019-03-04 19:14 ` Stephen Hemminger
@ 2019-03-05 8:46 ` Dekel Peled
0 siblings, 0 replies; 3+ messages in thread
From: Dekel Peled @ 2019-03-05 8:46 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Shahaf Shuler, Yongseok Koh, dev, Ori Kam, Matan Azrad
Thanks, PSB.
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, March 4, 2019 9:14 PM
> To: Dekel Peled <dekelp@mellanox.com>
> Cc: Shahaf Shuler <shahafs@mellanox.com>; Yongseok Koh
> <yskoh@mellanox.com>; dev@dpdk.org; Ori Kam <orika@mellanox.com>;
> Matan Azrad <matan@mellanox.com>
> Subject: Re: [dpdk-dev] [RFC v2] net/mlx5: support new naming scheme for
> representors
>
> On Sun, 3 Mar 2019 07:14:07 +0000
> Dekel Peled <dekelp@mellanox.com> wrote:
>
> > In current kernel implementation, the physical port name for representors
> is a numeric string (i.e. '0', '1', etc.).
> >
> >
> >
> > Kernel patch [1] implements an updated scheme for naming of
> representors ports.
> >
> > The new scheme gives a unique name for each port using the PF ID and the
> VF ID.
> >
> > Uplink representors are named 'p0', 'p1', etc.
> >
> > VF representors are named 'pf0vf0', 'pf0vf1', 'pf1vf0', 'pf1vf1', etc.
>
>
> Depending on kernel to use any particular naming policy is going to be
> problematic.
> Users will want to run on older kernels, and many distributions rename
> interfaces through udev or other mechanism.
MLX5 PMD relies on specific kernel implementation, with known scheme for representor naming.
Users running older kernels are required to install MLNX OFED, which implements the naming scheme expected by MLX5 PMD.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-05 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-03 7:14 [dpdk-dev] [RFC v2] net/mlx5: support new naming scheme for representors Dekel Peled
2019-03-04 19:14 ` Stephen Hemminger
2019-03-05 8:46 ` Dekel Peled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).