projects/linux·commit ab425feb

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

ab425feb · Linus Torvalds <[email protected]> · 2022-12-14 09:27:13 -08:00

Pull rdma updates from Jason Gunthorpe:
 "Usual size of updates, a new driver, and most of the bulk focusing on
  rxe:

   - Usual typos, style, and language updates

   - Driver updates for mlx5, irdma, siw, rts, srp, hfi1, hns, erdma,
     mlx4, srp

   - Lots of RXE updates:
      * Improve reply error handling for bad MR operations
      * Code tidying
      * Debug printing uses common loggers
      * Remove half implemented RD related stuff
      * Support IBA's recently defined Atomic Write and Flush operations

   - erdma support for atomic operations

   - New driver 'mana' for Ethernet HW available in Azure VMs. This
     driver only supports DPDK"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (122 commits)
  IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces
  RDMA: Add missed netdev_put() for the netdevice_tracker
  RDMA/rxe: Enable RDMA FLUSH capability for rxe device
  RDMA/cm: Make QP FLUSHABLE for supported device
  RDMA/rxe: Implement flush completion
  RDMA/rxe: Implement flush execution in responder side
  RDMA/rxe: Implement RC RDMA FLUSH service in requester side
  RDMA/rxe: Extend rxe packet format to support flush
  RDMA/rxe: Allow registering persistent flag for pmem MR only
  RDMA/rxe: Extend rxe user ABI to support flush
  RDMA: Extend RDMA kernel verbs ABI to support flush
  RDMA: Extend RDMA user ABI to support flush
  RDMA/rxe: Fix incorrect responder length checking
  RDMA/rxe: Fix oops with zero length reads
  RDMA/mlx5: Remove not-used IB_FLOW_SPEC_IB define
  RDMA/hns: Fix XRC caps on HIP08
  RDMA/hns: Fix error code of CMD
  RDMA/hns: Fix page size cap from firmware
  RDMA/hns: Fix PBL page MTR find
  RDMA/hns: Fix AH attr queried by query_qp
  ...
Commit
ab425febda94c7d287ea3433cbd0971771d6aeb4
Parents
08cdc215 · dbc94a0f

Merge commit. Changes below are compared with the first parent: 08cdc215.

Changes

99 files changed · +3621 −897

FileStatusAddDelContent
MAINTAINERSmodified+9−0View file
drivers/infiniband/Kconfigmodified+3−0View file
drivers/infiniband/core/cache.cmodified+1−1View file
drivers/infiniband/core/cm.cmodified+11−2View file
drivers/infiniband/core/cma.cmodified+1−1View file
drivers/infiniband/core/device.cmodified+6−4View file
drivers/infiniband/core/mad.cmodified+0−5View file
drivers/infiniband/core/nldev.cmodified+40−10View file
drivers/infiniband/core/restrack.cmodified+0−2View file
drivers/infiniband/core/sysfs.cmodified+11−6View file
drivers/infiniband/core/uverbs_std_types_qp.cmodified+1−1View file
drivers/infiniband/hw/Makefilemodified+1−0View file
drivers/infiniband/hw/erdma/erdma.hmodified+3−1View file
drivers/infiniband/hw/erdma/erdma_cq.cmodified+2−0View file
drivers/infiniband/hw/erdma/erdma_hw.hmodified+30−7View file
drivers/infiniband/hw/erdma/erdma_main.cmodified+13−2View file
drivers/infiniband/hw/erdma/erdma_qp.cmodified+57−16View file
drivers/infiniband/hw/erdma/erdma_verbs.cmodified+23−2View file
drivers/infiniband/hw/erdma/erdma_verbs.hmodified+14−5View file
drivers/infiniband/hw/hfi1/affinity.cmodified+2−0View file
drivers/infiniband/hw/hfi1/driver.cmodified+1−1View file
drivers/infiniband/hw/hfi1/firmware.cmodified+6−0View file
drivers/infiniband/hw/hfi1/mad.cmodified+11−11View file
drivers/infiniband/hw/hfi1/netdev_rx.cmodified+1−1View file
drivers/infiniband/hw/hns/hns_roce_device.hmodified+3−0View file
drivers/infiniband/hw/hns/hns_roce_hw_v2.cmodified+168−49View file
drivers/infiniband/hw/hns/hns_roce_hw_v2.hmodified+10−3View file
drivers/infiniband/hw/hns/hns_roce_main.cmodified+16−2View file
drivers/infiniband/hw/hns/hns_roce_mr.cmodified+2−2View file
drivers/infiniband/hw/hns/hns_roce_qp.cmodified+90−17View file
drivers/infiniband/hw/irdma/uk.cmodified+107−63View file
drivers/infiniband/hw/irdma/user.hmodified+3−17View file
drivers/infiniband/hw/irdma/utils.cmodified+2−0View file
drivers/infiniband/hw/irdma/verbs.cmodified+34−111View file
drivers/infiniband/hw/irdma/verbs.hmodified+53−0View file
drivers/infiniband/hw/mana/Kconfigadded+10−0View file
drivers/infiniband/hw/mana/Makefileadded+4−0View file
drivers/infiniband/hw/mana/cq.cadded+79−0View file
drivers/infiniband/hw/mana/device.cadded+117−0View file
drivers/infiniband/hw/mana/main.cadded+521−0View file
drivers/infiniband/hw/mana/mana_ib.hadded+162−0View file
drivers/infiniband/hw/mana/mr.cadded+197−0View file
drivers/infiniband/hw/mana/qp.cadded+506−0View file
drivers/infiniband/hw/mana/wq.cadded+115−0View file
drivers/infiniband/hw/mlx4/main.cmodified+4−8View file
drivers/infiniband/hw/mlx5/cq.cmodified+15−12View file
drivers/infiniband/hw/mlx5/fs.cmodified+0−1View file
drivers/infiniband/hw/mlx5/mlx5_ib.hmodified+4−0View file
drivers/infiniband/hw/mlx5/mr.cmodified+2−4View file
drivers/infiniband/hw/qedr/main.cmodified+1−1View file
drivers/infiniband/hw/qib/qib_iba6120.cmodified+2−5View file
drivers/infiniband/hw/qib/qib_tx.cmodified+1−4View file
drivers/infiniband/hw/qib/qib_user_sdma.cmodified+1−1View file
drivers/infiniband/sw/rxe/rxe.cmodified+2−2View file
drivers/infiniband/sw/rxe/rxe.hmodified+19−0View file
drivers/infiniband/sw/rxe/rxe_av.cmodified+36−7View file
drivers/infiniband/sw/rxe/rxe_comp.cmodified+31−16View file
drivers/infiniband/sw/rxe/rxe_cq.cmodified+4−4View file
drivers/infiniband/sw/rxe/rxe_hdr.hmodified+47−1View file
drivers/infiniband/sw/rxe/rxe_icrc.cmodified+2−2View file
drivers/infiniband/sw/rxe/rxe_loc.hmodified+3−6View file
drivers/infiniband/sw/rxe/rxe_mmap.cmodified+3−3View file
drivers/infiniband/sw/rxe/rxe_mr.cmodified+82−40View file
drivers/infiniband/sw/rxe/rxe_mw.cmodified+11−12View file
drivers/infiniband/sw/rxe/rxe_net.cmodified+23−19View file
drivers/infiniband/sw/rxe/rxe_opcode.cmodified+35−0View file
drivers/infiniband/sw/rxe/rxe_opcode.hmodified+12−5View file
drivers/infiniband/sw/rxe/rxe_param.hmodified+7−0View file
drivers/infiniband/sw/rxe/rxe_qp.cmodified+43−55View file
drivers/infiniband/sw/rxe/rxe_req.cmodified+37−13View file
drivers/infiniband/sw/rxe/rxe_resp.cmodified+279−50View file
drivers/infiniband/sw/rxe/rxe_srq.cmodified+10−10View file
drivers/infiniband/sw/rxe/rxe_task.cmodified+26−26View file
drivers/infiniband/sw/rxe/rxe_task.hmodified+4−15View file
drivers/infiniband/sw/rxe/rxe_verbs.cmodified+38−68View file
drivers/infiniband/sw/rxe/rxe_verbs.hmodified+6−1View file
drivers/infiniband/sw/siw/siw_cq.cmodified+22−2View file
drivers/infiniband/sw/siw/siw_verbs.cmodified+36−4View file
drivers/infiniband/ulp/ipoib/ipoib_netlink.cmodified+7−0View file
drivers/infiniband/ulp/iser/iser_verbs.cmodified+29−38View file
drivers/infiniband/ulp/isert/ib_isert.cmodified+2−3View file
drivers/infiniband/ulp/rtrs/rtrs-clt.cmodified+2−4View file
drivers/infiniband/ulp/rtrs/rtrs-pri.hmodified+0−3View file
drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.cmodified+9−4View file
drivers/infiniband/ulp/rtrs/rtrs-srv.cmodified+29−43View file
drivers/infiniband/ulp/rtrs/rtrs.cmodified+4−18View file
drivers/infiniband/ulp/srp/ib_srp.cmodified+82−14View file
drivers/net/ethernet/microsoft/mana/gdma_main.cmodified+1−2View file
include/net/mana/gdma.hmodified+14−17View file
include/net/mana/mana.hmodified+3−0View file
include/rdma/ib_pack.hmodified+5−0View file
include/rdma/ib_verbs.hmodified+22−2View file
include/rdma/opa_vnic.hmodified+1−1View file
include/trace/events/ib_mad.hmodified+4−9View file
include/uapi/rdma/hns-abi.hmodified+15−0View file
include/uapi/rdma/ib_user_ioctl_verbs.hmodified+3−0View file
include/uapi/rdma/ib_user_verbs.hmodified+21−0View file
include/uapi/rdma/mana-abi.hadded+66−0View file
include/uapi/rdma/rdma_user_rxe.hmodified+8−0View file

Only the first 600 diff lines are shown. Download the complete patch.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index abb08d7..73bd43e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13806,6 +13806,15 @@ F: drivers/scsi/smartpqi/smartpqi*.[ch]
F: include/linux/cciss*.h
F: include/uapi/linux/cciss*.h
+MICROSOFT MANA RDMA DRIVER
+M: Long Li <[email protected]>
+M: Ajay Sharma <[email protected]>
+S: Supported
+F: drivers/infiniband/hw/mana/
+F: include/net/mana
+F: include/uapi/rdma/mana-abi.h
+
MICROSOFT SURFACE AGGREGATOR TABLET-MODE SWITCH
M: Maximilian Luz <[email protected]>

drivers/infiniband/Kconfig

View file
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig
index aa36ac6..a5827d1 100644
--- a/drivers/infiniband/Kconfig
+++ b/drivers/infiniband/Kconfig
@@ -78,6 +78,7 @@ config INFINIBAND_VIRT_DMA
def_bool !HIGHMEM
if INFINIBAND_USER_ACCESS || !INFINIBAND_USER_ACCESS
+if !UML
source "drivers/infiniband/hw/bnxt_re/Kconfig"
source "drivers/infiniband/hw/cxgb4/Kconfig"
source "drivers/infiniband/hw/efa/Kconfig"
@@ -85,6 +86,7 @@ source "drivers/infiniband/hw/erdma/Kconfig"
source "drivers/infiniband/hw/hfi1/Kconfig"
source "drivers/infiniband/hw/hns/Kconfig"
source "drivers/infiniband/hw/irdma/Kconfig"
+source "drivers/infiniband/hw/mana/Kconfig"
source "drivers/infiniband/hw/mlx4/Kconfig"
source "drivers/infiniband/hw/mlx5/Kconfig"
source "drivers/infiniband/hw/mthca/Kconfig"
@@ -94,6 +96,7 @@ source "drivers/infiniband/hw/qib/Kconfig"
source "drivers/infiniband/hw/usnic/Kconfig"
source "drivers/infiniband/hw/vmw_pvrdma/Kconfig"
source "drivers/infiniband/sw/rdmavt/Kconfig"
+endif # !UML
source "drivers/infiniband/sw/rxe/Kconfig"
source "drivers/infiniband/sw/siw/Kconfig"
endif

drivers/infiniband/core/cache.c

View file
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 4084d05..2e91d88 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -1422,7 +1422,7 @@ int rdma_read_gid_l2_fields(const struct ib_gid_attr *attr,
*vlan_id = vlan_dev_vlan_id(ndev);
} else {
/* If the netdev is upper device and if it's lower
- * device is vlan device, consider vlan id of the
+ * device is vlan device, consider vlan id of
* the lower vlan device for this gid entry.
*/
netdev_walk_all_lower_dev_rcu(attr->ndev,

drivers/infiniband/core/cm.c

View file
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 1f9938a..603c0ae 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -4094,9 +4094,18 @@ static int cm_init_qp_init_attr(struct cm_id_private *cm_id_priv,
*qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS |
IB_QP_PKEY_INDEX | IB_QP_PORT;
qp_attr->qp_access_flags = IB_ACCESS_REMOTE_WRITE;
- if (cm_id_priv->responder_resources)
+ if (cm_id_priv->responder_resources) {
+ struct ib_device *ib_dev = cm_id_priv->id.device;
+ u64 support_flush = ib_dev->attrs.device_cap_flags &
+ (IB_DEVICE_FLUSH_GLOBAL | IB_DEVICE_FLUSH_PERSISTENT);
+ u32 flushable = support_flush ?
+ (IB_ACCESS_FLUSH_GLOBAL |
+ IB_ACCESS_FLUSH_PERSISTENT) : 0;
+
qp_attr->qp_access_flags |= IB_ACCESS_REMOTE_READ |
- IB_ACCESS_REMOTE_ATOMIC;
+ IB_ACCESS_REMOTE_ATOMIC |
+ flushable;
+ }
qp_attr->pkey_index = cm_id_priv->av.pkey_index;
if (cm_id_priv->av.port)
qp_attr->port_num = cm_id_priv->av.port->port_num;

drivers/infiniband/core/cma.c

View file
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index aacd625..68721ff 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -47,7 +47,7 @@ MODULE_LICENSE("Dual BSD/GPL");
#define CMA_CM_RESPONSE_TIMEOUT 20
#define CMA_MAX_CM_RETRIES 15
#define CMA_CM_MRA_SETTING (IB_CM_MRA_FLAG_DELAY | 24)
-#define CMA_IBOE_PACKET_LIFETIME 18
+#define CMA_IBOE_PACKET_LIFETIME 16
#define CMA_PREFERRED_ROCE_GID_TYPE IB_GID_TYPE_ROCE_UDP_ENCAP
static const char * const cma_events[] = {

drivers/infiniband/core/device.c

View file
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index b69e2c4..894c068 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -2159,14 +2159,16 @@ int ib_device_set_netdev(struct ib_device *ib_dev, struct net_device *ndev,
return 0;
}
+ if (old_ndev)
+ netdev_tracker_free(ndev, &pdata->netdev_tracker);
if (ndev)
- dev_hold(ndev);
+ netdev_hold(ndev, &pdata->netdev_tracker, GFP_ATOMIC);
rcu_assign_pointer(pdata->netdev, ndev);
spin_unlock_irqrestore(&pdata->netdev_lock, flags);
add_ndev_hash(pdata);
if (old_ndev)
- dev_put(old_ndev);
+ __dev_put(old_ndev);
return 0;
}
@@ -2199,7 +2201,7 @@ static void free_netdevs(struct ib_device *ib_dev)
* comparisons after the put
*/
rcu_assign_pointer(pdata->netdev, NULL);
- dev_put(ndev);
+ netdev_put(ndev, &pdata->netdev_tracker);
}
spin_unlock_irqrestore(&pdata->netdev_lock, flags);
}
@@ -2851,8 +2853,8 @@ err:
static void __exit ib_core_cleanup(void)
{
roce_gid_mgmt_cleanup();
- nldev_exit();
rdma_nl_unregister(RDMA_NL_LS);
+ nldev_exit();
unregister_pernet_device(&rdma_dev_net_ops);
unregister_blocking_lsm_notifier(&ibdev_lsm_nb);
ib_sa_cleanup();

drivers/infiniband/core/mad.c

View file
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 1893aa6..674344e 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -59,9 +59,6 @@ static void create_mad_addr_info(struct ib_mad_send_wr_private *mad_send_wr,
struct ib_mad_qp_info *qp_info,
struct trace_event_raw_ib_mad_send_template *entry)
{
- u16 pkey;
- struct ib_device *dev = qp_info->port_priv->device;
- u32 pnum = qp_info->port_priv->port_num;
struct ib_ud_wr *wr = &mad_send_wr->send_wr;
struct rdma_ah_attr attr = {};
@@ -69,8 +66,6 @@ static void create_mad_addr_info(struct ib_mad_send_wr_private *mad_send_wr,
/* These are common */
entry->sl = attr.sl;
- ib_query_pkey(dev, pnum, wr->pkey_index, &pkey);
- entry->pkey = pkey;
entry->rqpn = wr->remote_qpn;
entry->rqkey = wr->remote_qkey;
entry->dlid = rdma_ah_get_dlid(&attr);

drivers/infiniband/core/nldev.c

View file
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 12dc970..d5d3e4f 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -513,7 +513,7 @@ static int fill_res_qp_entry(struct sk_buff *msg, bool has_cap_net_admin,
/* In create_qp() port is not set yet */
if (qp->port && nla_put_u32(msg, RDMA_NLDEV_ATTR_PORT_INDEX, qp->port))
- return -EINVAL;
+ return -EMSGSIZE;
ret = nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_LQPN, qp->qp_num);
if (ret)
@@ -552,7 +552,7 @@ static int fill_res_cm_id_entry(struct sk_buff *msg, bool has_cap_net_admin,
struct rdma_cm_id *cm_id = &id_priv->id;
if (port && port != cm_id->port_num)
- return 0;
+ return -EAGAIN;
if (cm_id->port_num &&
nla_put_u32(msg, RDMA_NLDEV_ATTR_PORT_INDEX, cm_id->port_num))
@@ -894,6 +894,8 @@ static int fill_stat_counter_qps(struct sk_buff *msg,
int ret = 0;
table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_RES_QP);
+ if (!table_attr)
+ return -EMSGSIZE;
rt = &counter->device->res[RDMA_RESTRACK_QP];
xa_lock(&rt->xa);
@@ -1041,6 +1043,10 @@ static int nldev_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV, RDMA_NLDEV_CMD_GET),
0, 0);
+ if (!nlh) {
+ err = -EMSGSIZE;
+ goto err_free;
+ }
err = fill_dev_info(msg, device);
if (err)
@@ -1126,7 +1132,7 @@ static int _nldev_get_dumpit(struct ib_device *device,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV, RDMA_NLDEV_CMD_GET),
0, NLM_F_MULTI);
- if (fill_dev_info(skb, device)) {
+ if (!nlh || fill_dev_info(skb, device)) {
nlmsg_cancel(skb, nlh);
goto out;
}
@@ -1185,6 +1191,10 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV, RDMA_NLDEV_CMD_GET),
0, 0);
+ if (!nlh) {
+ err = -EMSGSIZE;
+ goto err_free;
+ }
err = fill_port_info(msg, device, port, sock_net(skb->sk));
if (err)
@@ -1246,7 +1256,7 @@ static int nldev_port_get_dumpit(struct sk_buff *skb,
RDMA_NLDEV_CMD_PORT_GET),
0, NLM_F_MULTI);
- if (fill_port_info(skb, device, p, sock_net(skb->sk))) {
+ if (!nlh || fill_port_info(skb, device, p, sock_net(skb->sk))) {
nlmsg_cancel(skb, nlh);
goto out;
}
@@ -1288,6 +1298,10 @@ static int nldev_res_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV, RDMA_NLDEV_CMD_RES_GET),
0, 0);
+ if (!nlh) {
+ ret = -EMSGSIZE;
+ goto err_free;
+ }
ret = fill_res_info(msg, device);
if (ret)
@@ -1319,7 +1333,7 @@ static int _nldev_res_get_dumpit(struct ib_device *device,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV, RDMA_NLDEV_CMD_RES_GET),
0, NLM_F_MULTI);
- if (fill_res_info(skb, device)) {
+ if (!nlh || fill_res_info(skb, device)) {
nlmsg_cancel(skb, nlh);
goto out;
}
@@ -1454,7 +1468,7 @@ static int res_get_common_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
RDMA_NL_GET_OP(nlh->nlmsg_type)),
0, 0);
- if (fill_nldev_handle(msg, device)) {
+ if (!nlh || fill_nldev_handle(msg, device)) {
ret = -EMSGSIZE;
goto err_free;
}
@@ -1533,7 +1547,7 @@ static int res_get_common_dumpit(struct sk_buff *skb,
RDMA_NL_GET_OP(cb->nlh->nlmsg_type)),
0, NLM_F_MULTI);
- if (fill_nldev_handle(skb, device)) {
+ if (!nlh || fill_nldev_handle(skb, device)) {
ret = -EMSGSIZE;
goto err;
}
@@ -1795,6 +1809,10 @@ static int nldev_get_chardev(struct sk_buff *skb, struct nlmsghdr *nlh,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV,
RDMA_NLDEV_CMD_GET_CHARDEV),
0, 0);
+ if (!nlh) {
+ err = -EMSGSIZE;
+ goto out_nlmsg;
+ }
data.nl_msg = msg;
err = ib_get_client_nl_info(ibdev, client_name, &data);
@@ -1852,6 +1870,10 @@ static int nldev_sys_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV,
RDMA_NLDEV_CMD_SYS_GET),
0, 0);
+ if (!nlh) {
+ nlmsg_free(msg);
+ return -EMSGSIZE;
+ }
err = nla_put_u8(msg, RDMA_NLDEV_SYS_ATTR_NETNS_MODE,
(u8)ib_devices_shared_netns);
@@ -2032,7 +2054,7 @@ static int nldev_stat_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV,
RDMA_NLDEV_CMD_STAT_SET),
0, 0);
- if (fill_nldev_handle(msg, device) ||
+ if (!nlh || fill_nldev_handle(msg, device) ||
nla_put_u32(msg, RDMA_NLDEV_ATTR_PORT_INDEX, port)) {
ret = -EMSGSIZE;
goto err_free_msg;
@@ -2101,6 +2123,10 @@ static int nldev_stat_del_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV,
RDMA_NLDEV_CMD_STAT_SET),
0, 0);
+ if (!nlh) {
+ ret = -EMSGSIZE;
+ goto err_fill;
+ }
cntn = nla_get_u32(tb[RDMA_NLDEV_ATTR_STAT_COUNTER_ID]);
qpn = nla_get_u32(tb[RDMA_NLDEV_ATTR_RES_LQPN]);
@@ -2171,7 +2197,7 @@ static int stat_get_doit_default_counter(struct sk_buff *skb,
RDMA_NLDEV_CMD_STAT_GET),
0, 0);
- if (fill_nldev_handle(msg, device) ||
+ if (!nlh || fill_nldev_handle(msg, device) ||
nla_put_u32(msg, RDMA_NLDEV_ATTR_PORT_INDEX, port)) {
ret = -EMSGSIZE;
goto err_msg;
@@ -2259,6 +2285,10 @@ static int stat_get_doit_qp(struct sk_buff *skb, struct nlmsghdr *nlh,
RDMA_NL_GET_TYPE(RDMA_NL_NLDEV,
RDMA_NLDEV_CMD_STAT_GET),
0, 0);
+ if (!nlh) {
+ ret = -EMSGSIZE;
+ goto err_msg;
+ }
ret = rdma_counter_get_mode(device, port, &mode, &mask);
if (ret)
@@ -2391,7 +2421,7 @@ static int nldev_stat_get_counter_status_doit(struct sk_buff *skb,
0, 0);
ret = -EMSGSIZE;
- if (fill_nldev_handle(msg, device) ||
+ if (!nlh || fill_nldev_handle(msg, device) ||
nla_put_u32(msg, RDMA_NLDEV_ATTR_PORT_INDEX, port))
goto err_msg;

drivers/infiniband/core/restrack.c

View file
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index 1f935d9..01a499a 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -343,8 +343,6 @@ void rdma_restrack_del(struct rdma_restrack_entry *res)
rt = &dev->res[res->type];
old = xa_erase(&rt->xa, res->id);
- if (res->type == RDMA_RESTRACK_MR)
- return;
WARN_ON(old != res);
out:

drivers/infiniband/core/sysfs.c

View file
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 84c53bd..ee59d73 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -1213,6 +1213,9 @@ static struct ib_port *setup_port(struct ib_core_device *coredev, int port_num,
p->port_num = port_num;
kobject_init(&p->kobj, &port_type);
+ if (device->port_data && is_full_dev)
+ device->port_data[port_num].sysfs = p;
+
cur_group = p->groups_list;
ret = alloc_port_table_group("gids", &p->groups[0], p->attrs_list,
attr->gid_tbl_len, show_port_gid);
@@ -1258,9 +1261,6 @@ static struct ib_port *setup_port(struct ib_core_device *coredev, int port_num,
}
list_add_tail(&p->kobj.entry, &coredev->port_list);
- if (device->port_data && is_full_dev)
- device->port_data[port_num].sysfs = p;
-
return p;
err_groups:
@@ -1268,6 +1268,8 @@ err_groups:
err_del:
kobject_del(&p->kobj);
err_put:
+ if (device->port_data && is_full_dev)
+ device->port_data[port_num].sysfs = NULL;
kobject_put(&p->kobj);
return ERR_PTR(ret);
}
@@ -1276,14 +1278,17 @@ static void destroy_port(struct ib_core_device *coredev, struct ib_port *port)
{
bool is_full_dev = &port->ibdev->coredev == coredev;
- if (port->ibdev->port_data &&
- port->ibdev->port_data[port->port_num].sysfs == port)
- port->ibdev->port_data[port->port_num].sysfs = NULL;
list_del(&port->kobj.entry);
if (is_full_dev)
sysfs_remove_groups(&port->kobj, port->ibdev->ops.port_groups);
+
sysfs_remove_groups(&port->kobj, port->groups_list);
kobject_del(&port->kobj);
+
+ if (port->ibdev->port_data &&
+ port->ibdev->port_data[port->port_num].sysfs == port)
+ port->ibdev->port_data[port->port_num].sysfs = NULL;
+
kobject_put(&port->kobj);
}

drivers/infiniband/core/uverbs_std_types_qp.c

View file
diff --git a/drivers/infiniband/core/uverbs_std_types_qp.c b/drivers/infiniband/core/uverbs_std_types_qp.c
index dd10754..7b4773f 100644
--- a/drivers/infiniband/core/uverbs_std_types_qp.c
+++ b/drivers/infiniband/core/uverbs_std_types_qp.c
@@ -163,7 +163,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_QP_CREATE)(
UVERBS_ATTR_CREATE_QP_SRQ_HANDLE))
return -EINVAL;
- /* send_cq is optinal */
+ /* send_cq is optional */
if (cap.max_send_wr) {
send_cq = uverbs_attr_get_obj(attrs,
UVERBS_ATTR_CREATE_QP_SEND_CQ_HANDLE);

drivers/infiniband/hw/Makefile

View file
diff --git a/drivers/infiniband/hw/Makefile b/drivers/infiniband/hw/Makefile
index 6b3a880..1211f43 100644
--- a/drivers/infiniband/hw/Makefile
+++ b/drivers/infiniband/hw/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_INFINIBAND_QIB) += qib/
obj-$(CONFIG_INFINIBAND_CXGB4) += cxgb4/
obj-$(CONFIG_INFINIBAND_EFA) += efa/
obj-$(CONFIG_INFINIBAND_IRDMA) += irdma/
+obj-$(CONFIG_MANA_INFINIBAND) += mana/
obj-$(CONFIG_MLX4_INFINIBAND) += mlx4/
obj-$(CONFIG_MLX5_INFINIBAND) += mlx5/
obj-$(CONFIG_INFINIBAND_OCRDMA) += ocrdma/

drivers/infiniband/hw/erdma/erdma.h

View file
diff --git a/drivers/infiniband/hw/erdma/erdma.h b/drivers/infiniband/hw/erdma/erdma.h
index 730783f..3d8c11a 100644
--- a/drivers/infiniband/hw/erdma/erdma.h
+++ b/drivers/infiniband/hw/erdma/erdma.h
@@ -124,6 +124,7 @@ struct erdma_devattr {
u32 fw_version;
unsigned char peer_addr[ETH_ALEN];
+ unsigned long cap_flags;
int numa_node;
enum erdma_cc_alg cc;
@@ -189,6 +190,7 @@ struct erdma_dev {
struct net_device *netdev;
struct pci_dev *pdev;
struct notifier_block netdev_nb;
+ struct workqueue_struct *reflush_wq;
resource_size_t func_bar_addr;
resource_size_t func_bar_len;
@@ -218,7 +220,7 @@ struct erdma_dev {
DECLARE_BITMAP(sdb_page, ERDMA_DWQE_TYPE0_CNT);
/*
* We provide max 496 uContexts that each has one SQ normal Db,
- * and one directWQE db。
+ * and one directWQE db.
*/
DECLARE_BITMAP(sdb_entry, ERDMA_DWQE_TYPE1_CNT);

drivers/infiniband/hw/erdma/erdma_cq.c

View file
diff --git a/drivers/infiniband/hw/erdma/erdma_cq.c b/drivers/infiniband/hw/erdma/erdma_cq.c
index 58e0dc5..cabd867 100644
--- a/drivers/infiniband/hw/erdma/erdma_cq.c
+++ b/drivers/infiniband/hw/erdma/erdma_cq.c
@@ -64,6 +64,8 @@ static const enum ib_wc_opcode wc_mapping_table[ERDMA_NUM_OPCODES] = {
[ERDMA_OP_REG_MR] = IB_WC_REG_MR,
[ERDMA_OP_LOCAL_INV] = IB_WC_LOCAL_INV,
[ERDMA_OP_READ_WITH_INV] = IB_WC_RDMA_READ,
+ [ERDMA_OP_ATOMIC_CAS] = IB_WC_COMP_SWAP,
+ [ERDMA_OP_ATOMIC_FAD] = IB_WC_FETCH_ADD,
};
static const struct {

drivers/infiniband/hw/erdma/erdma_hw.h

View file
diff --git a/drivers/infiniband/hw/erdma/erdma_hw.h b/drivers/infiniband/hw/erdma/erdma_hw.h
index e788887..ab371fe 100644
--- a/drivers/infiniband/hw/erdma/erdma_hw.h
+++ b/drivers/infiniband/hw/erdma/erdma_hw.h
@@ -145,6 +145,7 @@ enum CMDQ_RDMA_OPCODE {
CMDQ_OPCODE_MODIFY_QP = 3,
CMDQ_OPCODE_CREATE_CQ = 4,
CMDQ_OPCODE_DESTROY_CQ = 5,
+ CMDQ_OPCODE_REFLUSH = 6,
CMDQ_OPCODE_REG_MR = 8,
CMDQ_OPCODE_DEREG_MR = 9
};
@@ -224,8 +225,7 @@ struct erdma_cmdq_create_cq_req {
/* regmr cfg1 */
#define ERDMA_CMD_REGMR_PD_MASK GENMASK(31, 12)
#define ERDMA_CMD_REGMR_TYPE_MASK GENMASK(7, 6)
-#define ERDMA_CMD_REGMR_RIGHT_MASK GENMASK(5, 2)
-#define ERDMA_CMD_REGMR_ACC_MODE_MASK GENMASK(1, 0)
+#define ERDMA_CMD_REGMR_RIGHT_MASK GENMASK(5, 1)
/* regmr cfg2 */
#define ERDMA_CMD_REGMR_PAGESIZE_MASK GENMASK(31, 27)
@@ -302,8 +302,16 @@ struct erdma_cmdq_destroy_qp_req {
u32 qpn;
};
+struct erdma_cmdq_reflush_req {
+ u64 hdr;
+ u32 qpn;
+ u32 sq_pi;
+ u32 rq_pi;
+};
+
/* cap qword 0 definition */
#define ERDMA_CMD_DEV_CAP_MAX_CQE_MASK GENMASK_ULL(47, 40)
+#define ERDMA_CMD_DEV_CAP_FLAGS_MASK GENMASK_ULL(31, 24)
#define ERDMA_CMD_DEV_CAP_MAX_RECV_WR_MASK GENMASK_ULL(23, 16)
#define ERDMA_CMD_DEV_CAP_MAX_MR_SIZE_MASK GENMASK_ULL(7, 0)
@@ -315,6 +323,10 @@ struct erdma_cmdq_destroy_qp_req {
#define ERDMA_NQP_PER_QBLOCK 1024
+enum {
+ ERDMA_DEV_CAP_FLAGS_ATOMIC = 1 << 7,
+};
+
#define ERDMA_CMD_INFO0_FW_VER_MASK GENMASK_ULL(31, 0)
/* CQE hdr */
@@ -340,9 +352,9 @@ struct erdma_cqe {
};
struct erdma_sge {
- __aligned_le64 laddr;
+ __aligned_le64 addr;
__le32 length;
- __le32 lkey;
+ __le32 key;
};
/* Receive Queue Element */
@@ -370,8 +382,7 @@ struct erdma_rqe {
#define ERDMA_SQE_HDR_WQEBB_INDEX_MASK GENMASK_ULL(15, 0)
/* REG MR attrs */
-#define ERDMA_SQE_MR_MODE_MASK GENMASK(1, 0)
-#define ERDMA_SQE_MR_ACCESS_MASK GENMASK(5, 2)
+#define ERDMA_SQE_MR_ACCESS_MASK GENMASK(5, 1)
#define ERDMA_SQE_MR_MTT_TYPE_MASK GENMASK(7, 6)
#define ERDMA_SQE_MR_MTT_CNT_MASK GENMASK(31, 12)
@@ -410,6 +421,16 @@ struct erdma_readreq_sqe {
__le32 rsvd;
};
+struct erdma_atomic_sqe {
+ __le64 hdr;
+ __le64 rsvd;
+ __le64 fetchadd_swap_data;
+ __le64 cmp_data;
+
+ struct erdma_sge remote;
+ struct erdma_sge sgl;
+};
+
struct erdma_reg_mr_sqe {
__le64 hdr;
__le64 addr;
@@ -469,7 +490,9 @@ enum erdma_opcode {
ERDMA_OP_REG_MR = 14,
ERDMA_OP_LOCAL_INV = 15,
ERDMA_OP_READ_WITH_INV = 16,
- ERDMA_NUM_OPCODES = 17,
+ ERDMA_OP_ATOMIC_CAS = 17,
+ ERDMA_OP_ATOMIC_FAD = 18,
+ ERDMA_NUM_OPCODES = 19,
ERDMA_OP_INVALID = ERDMA_NUM_OPCODES + 1
};

drivers/infiniband/hw/erdma/erdma_main.c

View file
diff --git a/drivers/infiniband/hw/erdma/erdma_main.c b/drivers/infiniband/hw/erdma/erdma_main.c
index 49778bb..5dc31e5 100644
--- a/drivers/infiniband/hw/erdma/erdma_main.c
+++ b/drivers/infiniband/hw/erdma/erdma_main.c
@@ -374,6 +374,7 @@ static int erdma_dev_attrs_init(struct erdma_dev *dev)
dev->attrs.max_qp = ERDMA_NQP_PER_QBLOCK * ERDMA_GET_CAP(QBLOCK, cap1);
dev->attrs.max_mr = dev->attrs.max_qp << 1;
dev->attrs.max_cq = dev->attrs.max_qp << 1;
+ dev->attrs.cap_flags = ERDMA_GET_CAP(FLAGS, cap0);
dev->attrs.max_send_wr = ERDMA_MAX_SEND_WR;
dev->attrs.max_ord = ERDMA_MAX_ORD;
@@ -520,13 +521,22 @@ static int erdma_ib_device_add(struct pci_dev *pdev)
u64_to_ether_addr(mac, dev->attrs.peer_addr);
+ dev->reflush_wq = alloc_workqueue("erdma-reflush-wq", WQ_UNBOUND,
+ WQ_UNBOUND_MAX_ACTIVE);
+ if (!dev->reflush_wq) {
+ ret = -ENOMEM;
+ goto err_alloc_workqueue;
+ }

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/erdma/erdma_qp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/erdma/erdma_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/erdma/erdma_verbs.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hfi1/affinity.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hfi1/driver.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hfi1/firmware.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hfi1/mad.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hfi1/netdev_rx.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hns/hns_roce_device.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hns/hns_roce_hw_v2.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hns/hns_roce_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hns/hns_roce_mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hns/hns_roce_qp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/irdma/uk.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/irdma/user.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/irdma/utils.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/irdma/verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/irdma/verbs.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/cq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/device.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/mana_ib.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/qp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mana/wq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx4/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/cq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/fs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/mlx5_ib.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qedr/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_iba6120.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_tx.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_user_sdma.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_av.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_comp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_cq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_hdr.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_icrc.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_loc.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_mmap.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_mw.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_net.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_opcode.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_opcode.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_param.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_qp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_req.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_resp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_srq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_task.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_task.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/rxe/rxe_verbs.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/siw/siw_cq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/siw/siw_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/ipoib/ipoib_netlink.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/iser/iser_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/isert/ib_isert.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/rtrs/rtrs-clt.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/rtrs/rtrs-pri.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/rtrs/rtrs-srv.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/rtrs/rtrs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/srp/ib_srp.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/microsoft/mana/gdma_main.c

View file

This diff is incomplete. Download the complete patch.

include/net/mana/gdma.h

View file

This diff is incomplete. Download the complete patch.

include/net/mana/mana.h

View file

This diff is incomplete. Download the complete patch.

include/rdma/ib_pack.h

View file

This diff is incomplete. Download the complete patch.

include/rdma/ib_verbs.h

View file

This diff is incomplete. Download the complete patch.

include/rdma/opa_vnic.h

View file

This diff is incomplete. Download the complete patch.

include/trace/events/ib_mad.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/rdma/hns-abi.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/rdma/ib_user_ioctl_verbs.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/rdma/ib_user_verbs.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/rdma/mana-abi.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/rdma/rdma_user_rxe.h

View file

This diff is incomplete. Download the complete patch.