OSDN Git Service

net/smc: Introduce net namespace support for linkgroup
authorTony Lu <tonylu@linux.alibaba.com>
Tue, 28 Dec 2021 13:06:09 +0000 (21:06 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Jan 2022 12:07:39 +0000 (12:07 +0000)
commit0237a3a683e4844ddc52782d83d439d6192e11f9
treef31c1820d9158bee3ff826d6b83350517fc672e8
parente63a02348958cd7cc8c8401c94de57ad97b5d06c
net/smc: Introduce net namespace support for linkgroup

Currently, rdma device supports exclusive net namespace isolation,
however linkgroup doesn't know and support ibdev net namespace.
Applications in the containers don't want to share the nics if we
enabled rdma exclusive mode. Every net namespaces should have their own
linkgroups.

This patch introduce a new field net for linkgroup, which is standing
for the ibdev net namespace in the linkgroup. The net in linkgroup is
initialized with the net namespace of link's ibdev. It compares the net
of linkgroup and sock or ibdev before choose it, if no matched, create
new one in current net namespace. If rdma net namespace exclusive mode
is not enabled, it behaves as before.

Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_core.c
net/smc/smc_core.h
net/smc/smc_ib.h
net/smc/smc_pnet.c