Thursday, March 7, 2019 1:12 PM, Slava Ovsiienko: > Subject: RE: [dpdk-dev] [PATCH v2 1/1] net/mlx5: add representor > recognition on kernels 5.x > > Monday, February 25, 2019 1:01 PM, Viacheslav Ovsiienko: > > > Subject: [dpdk-dev] [PATCH v2 1/1] net/mlx5: add representor > > > recognition on kernels 5.x > > > > > > The master device and VF representors were distinguished by presence > > > of port name, master device did not have one. The new Linux kernels > > > starting from 5.0 provide the port name for master device and the > > > implemented representor recognizing method does not work. > > > The new recognizing method is based on quiering the VF number, > > > created on the base of the device. > > > > > > The IFLA_NUM_VF attribute is returned by kernel if IFLA_EXT_MASK > > > attribute is specified in the Netlink request message. > > > > > > Also the presence of device symlink in device sysfs folder is added > > > to distinguish representors with sysfs based method. > > > > w/ kernel 5.x, there is also a new naming scheme for representor, right? > > Wouldn't it be simpler to use it in order to decide uplink/regular > > representor? > > There should not be any assumption regarding port index, we can't say for > sure on which port index we have uplink representor. It is possible to > compare the port name against -1, but it is quite possible situation (old > kernels with new drivers, I had been working with such setup for a while) in > that have the multiport Infiniband device and old naming and we are unable > recognize the Uplink rep by port name.
OK understood. Out of curiosity which kernel was that? I think the safest way to detect the uplink representor is by matching on its port index. This is well defined on the PRM: "Because each PF has just one Uplink, it should access it only by vport_num = 0xffff." For this purpose matching according to the representor phys_port_name is the most straight forward. We should have a fallback for special cases (like you mentioned), and it will use the IFLA_NUM_VFS indication. Meaning your patch needs to be on top of https://patches.dpdk.org/patch/50771/ and provide a fallback detection approach in case the detection by name is not supported. > > So, it seems to me, the querying numVF/sysfs method is more reliable and > works for all settings I've tested. > > > > > There is already patch for it from Dekel: > > https://patches.dpdk.org/patch/50771/ > > Yes, It's included in RFC because patchset is not functional w/o Dekel's > patch. > The patchset will be rebased and Dekel's commit will be excluded in the next > versions. >