DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: Slava Ovsiienko <viacheslavo@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 1/1] net/mlx5: add representor recognition on	kernels 5.x
Date: Sun, 10 Mar 2019 08:59:38 +0000	[thread overview]
Message-ID: <AM0PR0502MB3795CF730E5E26EAE77FE560C34F0@AM0PR0502MB3795.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <AM4PR05MB3265FD6F574E05B0B5DA4BF9D24C0@AM4PR05MB3265.eurprd05.prod.outlook.com>

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.
> 

      reply	other threads:[~2019-03-10  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21  8:41 [dpdk-dev] [PATCH] " Viacheslav Ovsiienko
2019-02-25 11:01 ` [dpdk-dev] [PATCH v2 1/1] " Viacheslav Ovsiienko
2019-03-07  8:44   ` Shahaf Shuler
2019-03-07 11:12     ` Slava Ovsiienko
2019-03-10  8:59       ` Shahaf Shuler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR0502MB3795CF730E5E26EAE77FE560C34F0@AM0PR0502MB3795.eurprd05.prod.outlook.com \
    --to=shahafs@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=viacheslavo@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).