public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Dennis Dalessandro <dennis.dalessandro@intel.com>
Cc: "Goldman, Adam" <adam.goldman@intel.com>,
	linux-rdma@vger.kernel.org, mike.marciniszyn@intel.com
Subject: Re: [PATCH] kernel-boot: Do not perform device rename on OPA devices
Date: Thu, 6 Feb 2020 14:22:53 -0400	[thread overview]
Message-ID: <20200206182253.GI25297@ziepe.ca> (raw)
In-Reply-To: <0706151d-836d-c1e3-6cfb-d10d6eb7d2f1@intel.com>

On Thu, Feb 06, 2020 at 12:51:58PM -0500, Dennis Dalessandro wrote:
> On 2/6/2020 8:52 AM, Jason Gunthorpe wrote:
> > On Wed, Feb 05, 2020 at 04:59:11PM -0500, Dennis Dalessandro wrote:
> > > > I would actively block an attempt to try and do an end-run around
> > > > upstream like this. rdma-core is supposed to be the defacto
> > > > configuration, not be modified randomly by distros as before.
> > > 
> > > No but users should be free to name their devices how they want should they
> > > not?
> > 
> > Isn't that exactly why PSM is broken?
> > 
> > These days I can do
> > 
> > $ rdma link add hfi1_0 type siw netdev eth0
> > 
> > and PSM will become very confused.
> > 
> > This is why keying off the device name was *never* OK.
> > 
> > > > Why isn't psm keying off it's own chardev anyhow? There should be back
> > > > links to the RDMA device in sysfs from there.
> > > 
> > > No arguments here. No sense in going down this road though at this point in
> > > the game.
> > 
> > I'm not sure what these means? Are you saying you won't be fixing PSM? Why?
> > 
> 
> It's not worth going through the same to have a cdev or not argument over
> again.

What do you mean? You already have the extra cdev. It has a stable
name - I see hfi1_%d used as the pattern.

It even creates a class called hfi1

If you want to enumerate devices of this class readdir on
/sys/class/hfi1. This is yours, it will have only your devices. This
is what should have been done from the beginning.

If you want to find the RDMA parent then
readlink("/sys/class/hfi1/hfi1_xx/") + "/../.." should give it to you

Assuming the driver doesn't screw up the usage of sysfs.. Oh, right,
it does, and that never did get fixed.

The struct hfi1_devdata can not have both a struct kobj and a struct
ib_device as inline members. It *should not* have a kobject at all, it
should be using cdev_device_add() and specifying the ib_device as the
parent. Due to these mistakes I suppose the hfi1_x chardev is placed
incorrectly in sysfs.

So you fix it all up. Fix the kernel, fix the psm, etc. You insistend
on this extra char dev, you need to take responsibility to make sure
it is done properly and doesn't interfere with the rest of the system.

Jason

      reply	other threads:[~2020-02-06 18:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 13:55 [PATCH] kernel-boot: Do not perform device rename on OPA devices Goldman, Adam
2020-02-04 14:14 ` Honggang LI
2020-02-04 14:53   ` Leon Romanovsky
2020-02-04 14:59   ` Gal Pressman
2020-02-04 15:51     ` Leon Romanovsky
2020-02-04 14:56 ` Leon Romanovsky
2020-02-04 15:26   ` Dennis Dalessandro
2020-02-04 15:53     ` Leon Romanovsky
2020-02-05 19:12 ` Jason Gunthorpe
2020-02-05 19:22   ` Leon Romanovsky
2020-02-05 20:35   ` Dennis Dalessandro
2020-02-05 20:54     ` Jason Gunthorpe
2020-02-05 21:59       ` Dennis Dalessandro
2020-02-06 13:52         ` Jason Gunthorpe
2020-02-06 17:51           ` Dennis Dalessandro
2020-02-06 18:22             ` Jason Gunthorpe [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=20200206182253.GI25297@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=adam.goldman@intel.com \
    --cc=dennis.dalessandro@intel.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@intel.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