All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: denisd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Alex Vesker <valex-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH v2 net 0/2] IB/ipoib: ip link support
Date: Wed, 17 Jan 2018 21:25:49 -0700	[thread overview]
Message-ID: <20180118042549.GA11171@ziepe.ca> (raw)
In-Reply-To: <20180115.131309.1163036253579166139.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Mon, Jan 15, 2018 at 01:13:09PM -0500, David Miller wrote:
> From: Denis Drozdov <denisd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Date: Tue,  9 Jan 2018 23:42:45 +0200
> 
> > IP link was broken due to the changes in IPoIB for the rdma_netdev
> > support after commit cd565b4b51e5
> > ("IB/IPoIB: Support acceleration options callbacks").
> > 
> > This patchset restores IPoIB pkey creation and removal using rtnetlink.
> > The first patch introduces changes in the rtnetlink code in order to allow
> > IPOIB allocate and free the netdevice.
> > 
> > The second patch establishes appropriate rtnetlink callbacks for IPoIB
> > device and restores IPoIB netlink support
> > 
> > Changes since v1:
> > - Fixed double free_netdev calls in ops->free_link in netdev_run_todo 
> > - Removed priv_size from ipoib_link_ops as not required anymore.
> 
> Please fix your control flow so that the existing netlink op can do
> the right thing.

Okay. Since this bug has been outstanding in RDMA for so long, I've
looked pretty carefully at this..

This patch does go too far, but ipoib does appear to legitimately need
something special here and no amount of 'control flow fixing' in ipoib
will solve it.

The fundamental issue is that ipoib no longer has a generic software
netdev for the child interface. Instead the child interface is bound
directly to one of several *full* hardware drivers. ie the child and
the master are basically exactly the same HW dependent code.

Since the child is a full hardware netdev, it has its own HW driven
needs for priv_size, txqs, rxqs, etc. There is no 'one size fits all'
value like for all the other software based newlink users. It depends
on the HW device installed in the system (eg mlx4, mlx5, hfi1)

The only problem with rtnl newlink is that it wants to use priv_size,
txqs, and rxqs values from a singleton static global structure (eg
ipoib_link_ops) which cannot know in advance which ipoib HW driver is
in use by the specific parent the child is being created for.

This is what needs to be fixed. ipoib simply needs to have
parent-dependent inputs to the alloc_netdev_mqs in rtnl_create_link.

The patch proposes

  struct net_device *(*alloc_link)(struct net *src_net,
		 	           const char *dev_name,
				   struct nlattr *tb[]);

To let ipoib allocate the netdev, and then obviosly figure out the
right parameters internally.

This patch also adds some free related stuff, but that seems to be
going too far. ipoib can use the normal free paths. The above is all
that is necessary.

An alternative would be something like:

  struct rtnl_alloc_params {
       size_t priv_size;
       int txqs;
       int rxqs;
  };
  void (*get_alloc_parameters)(struct net_device *net,
                               struct rtnl_alloc_params *parms);

To let ipoib tell rtnl_create_link what parameters to use based on
'net' instead of taking them from the global singleton.

Do you see another choice?

Can you accept one of these options?

Thanks,
Jason
(BTW, Doug & I are now co-maintaining RDMA, so I say the above with my
 maintainer hat on. This is a serious userspace visible regression bug
 on our side, and I really want to see it fixed.)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-01-18  4:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-31 11:16 [PATCH net 0/2] IB/ipoib: ip link support Denis Drozdov
     [not found] ` <1514718983-466-1-git-send-email-denisd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-31 11:16   ` [PATCH net 1/2] rtnl: device allocation/free via rtnl_link_ops Denis Drozdov
     [not found]     ` <1514718983-466-2-git-send-email-denisd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-01-01 22:43       ` [rtnl] b1585bdfb2: kernel_BUG_at_net/core/dev.c kernel test robot
2018-01-01 22:43         ` kernel test robot
2018-01-01 22:43         ` kernel test robot
2018-01-09 21:42         ` [PATCH v2 net 0/2] IB/ipoib: ip link support Denis Drozdov
     [not found]           ` <1515534167-13062-1-git-send-email-denisd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-01-09 21:42             ` [PATCH v2 net 1/2] rtnl: device allocation/free via rtnl_link_ops Denis Drozdov
2018-01-09 21:42           ` [PATCH v2 net 2/2] IB/ipoib: Fix netlink support in IPoIB Denis Drozdov
2018-01-15 18:13           ` [PATCH v2 net 0/2] IB/ipoib: ip link support David Miller
     [not found]             ` <20180115.131309.1163036253579166139.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2018-01-18  4:25               ` Jason Gunthorpe [this message]
2018-05-07 17:29                 ` Or Gerlitz
2017-12-31 12:28   ` [PATCH " Or Gerlitz
     [not found]     ` <CAJ3xEMiVHc=E7=uKJ4cRRRDxjNDRKQ17=NxnYsEeXNe6-RUvvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-02  7:29       ` Or Gerlitz
2018-01-02  8:44         ` Erez Shitrit
2018-01-02  9:15           ` Or Gerlitz
2017-12-31 11:16 ` [PATCH net 2/2] IB/ipoib: Fix netlink support in IPoIB Denis Drozdov
     [not found]   ` <1514718983-466-3-git-send-email-denisd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-31 20:23     ` Jason Gunthorpe
     [not found]       ` <20171231202308.GA10145-uk2M96/98Pc@public.gmane.org>
2018-01-01  6:38         ` Leon Romanovsky

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=20180118042549.GA11171@ziepe.ca \
    --to=jgg-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=denisd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=valex-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.