Re: [PATCH v2 07/11] IB/cm: Add network namespace support

Jason Gunthorpe
2015-04-20T17:06:59Z

On Mon, Apr 20, 2015 at 12:03:38PM +0300, Haggai Eran wrote:
> From: Guy Shapiro <guysh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Add namespace support to the IB-CM layer.

> - Each CM-ID now has a network namespace it is associated with, assigned at
> creation. This namespace is used as needed during subsequent action on the
> CM-ID or related objects.

There is really something weird about this layering. At the CM layer
there should be no concept of an IP address, it only deals with GIDs.

So how can a CM object have a network namespace associated with it?

> {
> av->port = port;
> av->pkey_index = wc->pkey_index;
> ib_init_ah_from_wc(port->cm_dev->ib_device, port->port_num, wc,
> - grh, &av->ah_attr, &init_net);
> + grh, &av->ah_attr, net);

There is something deeply wrong with adding network namespace
arguments to verbs.

For rocee the gid index clearly specifies the network namespace
to use, so much of this should go away and have rocee get the
namespace from the gid index.

Ie in ib_init_ah_from_wc we have the ib_wc which contains the sgid
index.

I'm really not excited at how many places are gaining a net when those
layers shouldn't even need to care about IP layer details. Just acting
as a pass through for rocee doesn't make sense.

Jason