2014-01-16 22:16:47 +07:00
|
|
|
infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_cm.o
|
2006-12-01 07:53:41 +07:00
|
|
|
user_access-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_ucm.o
|
2006-06-18 10:37:28 +07:00
|
|
|
|
2005-07-28 01:45:40 +07:00
|
|
|
obj-$(CONFIG_INFINIBAND) += ib_core.o ib_mad.o ib_sa.o \
|
2014-01-16 22:16:47 +07:00
|
|
|
ib_cm.o iw_cm.o ib_addr.o \
|
|
|
|
$(infiniband-y)
|
2005-09-08 02:43:08 +07:00
|
|
|
obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o
|
2006-12-01 07:53:41 +07:00
|
|
|
obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o ib_ucm.o \
|
|
|
|
$(user_access-y)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2015-12-12 02:53:03 +07:00
|
|
|
ib_core-y := packer.o ud_header.o verbs.o cq.o sysfs.o \
|
IB/core: Add RoCE GID table management
RoCE GIDs are based on IP addresses configured on Ethernet net-devices
which relate to the RDMA (RoCE) device port.
Currently, each of the low-level drivers that support RoCE (ocrdma,
mlx4) manages its own RoCE port GID table. As there's nothing which is
essentially vendor specific, we generalize that, and enhance the RDMA
core GID cache to do this job.
In order to populate the GID table, we listen for events:
(a) netdev up/down/change_addr events - if a netdev is built onto
our RoCE device, we need to add/delete its IPs. This involves
adding all GIDs related to this ndev, add default GIDs, etc.
(b) inet events - add new GIDs (according to the IP addresses)
to the table.
For programming the port RoCE GID table, providers must implement
the add_gid and del_gid callbacks.
RoCE GID management requires us to state the associated net_device
alongside the GID. This information is necessary in order to manage
the GID table. For example, when a net_device is removed, its
associated GIDs need to be removed as well.
RoCE mandates generating a default GID for each port, based on the
related net-device's IPv6 link local. In contrast to the GID based on
the regular IPv6 link-local (as we generate GID per IP address),
the default GID is also available when the net device is down (in
order to support loopback).
Locking is done as follows:
The patch modify the GID table code both for new RoCE drivers
implementing the add_gid/del_gid callbacks and for current RoCE and
IB drivers that do not. The flows for updating the table are
different, so the locking requirements are too.
While updating RoCE GID table, protection against multiple writers is
achieved via mutex_lock(&table->lock). Since writing to a table
requires us to find an entry (possible a free entry) in the table and
then modify it, this mutex protects both the find_gid and write_gid
ensuring the atomicity of the action.
Each entry in the GID cache is protected by rwlock. In RoCE, writing
(usually results from netdev notifier) involves invoking the vendor's
add_gid and del_gid callbacks, which could sleep.
Therefore, an invalid flag is added for each entry. Updates for RoCE are
done via a workqueue, thus sleeping is permitted.
In IB, updates are done in write_lock_irq(&device->cache.lock), thus
write_gid isn't allowed to sleep and add_gid/del_gid are not called.
When passing net-device into/out-of the GID cache, the device
is always passed held (dev_hold).
The code uses a single work item for updating all RDMA devices,
following a netdev or inet notifier.
The patch moves the cache from being a client (which was incorrect,
as the cache is part of the IB infrastructure) to being explicitly
initialized/freed when a device is registered/removed.
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-07-30 22:33:26 +07:00
|
|
|
device.o fmr_pool.o cache.o netlink.o \
|
|
|
|
roce_gid_mgmt.o
|
2007-03-05 07:15:11 +07:00
|
|
|
ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o
|
2014-12-11 22:04:18 +07:00
|
|
|
ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o umem_rbtree.o
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-07-28 01:45:37 +07:00
|
|
|
ib_mad-y := mad.o smi.o agent.o mad_rmpp.o
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2007-02-16 08:00:17 +07:00
|
|
|
ib_sa-y := sa_query.o multicast.o
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-07-28 01:45:40 +07:00
|
|
|
ib_cm-y := cm.o
|
|
|
|
|
2014-03-27 05:07:35 +07:00
|
|
|
iw_cm-y := iwcm.o iwpm_util.o iwpm_msg.o
|
2006-08-04 04:02:42 +07:00
|
|
|
|
2006-06-18 10:37:29 +07:00
|
|
|
rdma_cm-y := cma.o
|
|
|
|
|
2015-12-23 19:56:55 +07:00
|
|
|
rdma_cm-$(CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS) += cma_configfs.o
|
|
|
|
|
2006-12-01 07:53:41 +07:00
|
|
|
rdma_ucm-y := ucma.o
|
|
|
|
|
2006-06-18 10:37:28 +07:00
|
|
|
ib_addr-y := addr.o
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
ib_umad-y := user_mad.o
|
2005-07-08 07:57:14 +07:00
|
|
|
|
2005-07-28 01:45:45 +07:00
|
|
|
ib_ucm-y := ucm.o
|
|
|
|
|
2007-03-05 07:15:11 +07:00
|
|
|
ib_uverbs-y := uverbs_main.o uverbs_cmd.o uverbs_marshall.o
|