Skip to content

Commit 2ccb4d2

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma updates from Jason Gunthorpe: "A new Pensando ionic driver, a new Gen 3 HW support for Intel irdma, and lots of small bnxt_re improvements. - Small bug fixes and improves to hfi1, efa, mlx5, erdma, rdmarvt, siw - Allow userspace access to IB service records through the rdmacm - Optimize dma mapping for erdma - Fix shutdown of the GSI QP in mana - Support relaxed ordering MR and fix a corruption bug with mlx5 DMA Data Direct - Many improvement to bnxt_re: - Debugging features and counters - Improve performance of some commands - Change flow_label reporting in completions - Mirror vnic - RDMA flow support - New RDMA driver for Pensando Ethernet devices: ionic - Gen 3 hardware support for the Intel irdma driver - Fix rdma routing resolution with VRFs" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (85 commits) RDMA/ionic: Fix memory leak of admin q_wr RDMA/siw: Always report immediate post SQ errors RDMA/bnxt_re: improve clarity in ALLOC_PAGE handler RDMA/irdma: Remove unused struct irdma_cq fields RDMA/irdma: Fix positive vs negative error codes in irdma_post_send() RDMA/bnxt_re: Remove non-statistics counters from hw_counters RDMA/bnxt_re: Add debugfs info entry for device and resource information RDMA/bnxt_re: Fix incorrect errno used in function comments RDMA: Use %pe format specifier for error pointers RDMA/ionic: Use ether_addr_copy instead of memcpy RDMA/ionic: Fix build failure on SPARC due to xchg() operand size RDMA/rxe: Fix race in do_task() when draining IB/sa: Fix sa_local_svc_timeout_ms read race IB/ipoib: Ignore L3 master device RDMA/core: Use route entry flag to decide on loopback traffic RDMA/core: Resolve MAC of next-hop device without ARP support RDMA/core: Squash a single user static function RDMA/irdma: Update Kconfig RDMA/irdma: Extend CQE Error and Flush Handling for GEN3 Devices RDMA/irdma: Add Atomic Operations support ...
2 parents e56ebe2 + e6d736b commit 2ccb4d2

File tree

128 files changed

+16186
-1486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+16186
-1486
lines changed

Documentation/networking/device_drivers/ethernet/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Contents:
5050
neterion/s2io
5151
netronome/nfp
5252
pensando/ionic
53+
pensando/ionic_rdma
5354
qualcomm/ppe/ppe
5455
smsc/smc9
5556
stmicro/stmmac

Documentation/networking/device_drivers/ethernet/pensando/ionic.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Contents
1313
- Identifying the Adapter
1414
- Enabling the driver
1515
- Configuring the driver
16+
- RDMA Support via Auxiliary Device
1617
- Statistics
1718
- Support
1819

@@ -105,6 +106,15 @@ XDP
105106
Support for XDP includes the basics, plus Jumbo frames, Redirect and
106107
ndo_xmit. There is no current support for zero-copy sockets or HW offload.
107108

109+
RDMA Support via Auxiliary Device
110+
=================================
111+
112+
The ionic driver supports RDMA (Remote Direct Memory Access) functionality
113+
through the Linux auxiliary device framework when advertised by the firmware.
114+
RDMA capability is detected during device initialization, and if supported,
115+
the ethernet driver will create an auxiliary device that allows the RDMA
116+
driver to bind and provide InfiniBand/RoCE functionality.
117+
108118
Statistics
109119
==========
110120

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
3+
===========================================================
4+
RDMA Driver for the AMD Pensando(R) Ethernet adapter family
5+
===========================================================
6+
7+
AMD Pensando RDMA driver.
8+
Copyright (C) 2018-2025, Advanced Micro Devices, Inc.
9+
10+
Overview
11+
========
12+
13+
The ionic_rdma driver provides Remote Direct Memory Access functionality
14+
for AMD Pensando DSC (Distributed Services Card) devices. This driver
15+
implements RDMA capabilities as an auxiliary driver that operates in
16+
conjunction with the ionic ethernet driver.
17+
18+
The ionic ethernet driver detects RDMA capability during device
19+
initialization and creates auxiliary devices that the ionic_rdma driver
20+
binds to, establishing the RDMA data path and control interfaces.
21+
22+
Identifying the Adapter
23+
=======================
24+
25+
See Documentation/networking/device_drivers/ethernet/pensando/ionic.rst
26+
for more information on identifying the adapter.
27+
28+
Enabling the driver
29+
===================
30+
31+
The ionic_rdma driver depends on the ionic ethernet driver.
32+
See Documentation/networking/device_drivers/ethernet/pensando/ionic.rst
33+
for detailed information on enabling and configuring the ionic driver.
34+
35+
The ionic_rdma driver is enabled via the standard kernel configuration system,
36+
using the make command::
37+
38+
make oldconfig/menuconfig/etc.
39+
40+
The driver is located in the menu structure at:
41+
42+
-> Device Drivers
43+
-> InfiniBand support
44+
-> AMD Pensando DSC RDMA/RoCE Support
45+
46+
Support
47+
=======
48+
49+
For general Linux RDMA support, please use the RDMA mailing
50+
list, which is monitored by AMD Pensando personnel::
51+
52+

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,15 @@ F: Documentation/networking/device_drivers/ethernet/amd/pds_core.rst
11771177
F: drivers/net/ethernet/amd/pds_core/
11781178
F: include/linux/pds/
11791179

1180+
AMD PENSANDO RDMA DRIVER
1181+
M: Abhijit Gangurde <[email protected]>
1182+
M: Allen Hubbe <[email protected]>
1183+
1184+
S: Maintained
1185+
F: Documentation/networking/device_drivers/ethernet/pensando/ionic_rdma.rst
1186+
F: drivers/infiniband/hw/ionic/
1187+
F: include/uapi/rdma/ionic-abi.h
1188+
11801189
AMD PMC DRIVER
11811190
M: Shyam Sundar S K <[email protected]>
11821191

drivers/infiniband/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ source "drivers/infiniband/hw/efa/Kconfig"
8585
source "drivers/infiniband/hw/erdma/Kconfig"
8686
source "drivers/infiniband/hw/hfi1/Kconfig"
8787
source "drivers/infiniband/hw/hns/Kconfig"
88+
source "drivers/infiniband/hw/ionic/Kconfig"
8889
source "drivers/infiniband/hw/irdma/Kconfig"
8990
source "drivers/infiniband/hw/mana/Kconfig"
9091
source "drivers/infiniband/hw/mlx4/Kconfig"

drivers/infiniband/core/addr.c

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -446,63 +446,41 @@ static int addr6_resolve(struct sockaddr *src_sock,
446446
}
447447
#endif
448448

449+
static bool is_dst_local(const struct dst_entry *dst)
450+
{
451+
if (dst->ops->family == AF_INET)
452+
return !!(dst_rtable(dst)->rt_type & RTN_LOCAL);
453+
else if (dst->ops->family == AF_INET6)
454+
return !!(dst_rt6_info(dst)->rt6i_flags & RTF_LOCAL);
455+
else
456+
return false;
457+
}
458+
449459
static int addr_resolve_neigh(const struct dst_entry *dst,
450460
const struct sockaddr *dst_in,
451461
struct rdma_dev_addr *addr,
452-
unsigned int ndev_flags,
453462
u32 seq)
454463
{
455-
int ret = 0;
456-
457-
if (ndev_flags & IFF_LOOPBACK) {
464+
if (is_dst_local(dst)) {
465+
/* When the destination is local entry, source and destination
466+
* are same. Skip the neighbour lookup.
467+
*/
458468
memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN);
459-
} else {
460-
if (!(ndev_flags & IFF_NOARP)) {
461-
/* If the device doesn't do ARP internally */
462-
ret = fetch_ha(dst, addr, dst_in, seq);
463-
}
469+
return 0;
464470
}
465-
return ret;
466-
}
467-
468-
static int copy_src_l2_addr(struct rdma_dev_addr *dev_addr,
469-
const struct sockaddr *dst_in,
470-
const struct dst_entry *dst,
471-
const struct net_device *ndev)
472-
{
473-
int ret = 0;
474-
475-
if (dst->dev->flags & IFF_LOOPBACK)
476-
ret = rdma_translate_ip(dst_in, dev_addr);
477-
else
478-
rdma_copy_src_l2_addr(dev_addr, dst->dev);
479-
480-
/*
481-
* If there's a gateway and type of device not ARPHRD_INFINIBAND,
482-
* we're definitely in RoCE v2 (as RoCE v1 isn't routable) set the
483-
* network type accordingly.
484-
*/
485-
if (has_gateway(dst, dst_in->sa_family) &&
486-
ndev->type != ARPHRD_INFINIBAND)
487-
dev_addr->network = dst_in->sa_family == AF_INET ?
488-
RDMA_NETWORK_IPV4 :
489-
RDMA_NETWORK_IPV6;
490-
else
491-
dev_addr->network = RDMA_NETWORK_IB;
492471

493-
return ret;
472+
return fetch_ha(dst, addr, dst_in, seq);
494473
}
495474

496475
static int rdma_set_src_addr_rcu(struct rdma_dev_addr *dev_addr,
497-
unsigned int *ndev_flags,
498476
const struct sockaddr *dst_in,
499477
const struct dst_entry *dst)
500478
{
501479
struct net_device *ndev = READ_ONCE(dst->dev);
502480

503-
*ndev_flags = ndev->flags;
504481
/* A physical device must be the RDMA device to use */
505-
if (ndev->flags & IFF_LOOPBACK) {
482+
if (is_dst_local(dst)) {
483+
int ret;
506484
/*
507485
* RDMA (IB/RoCE, iWarp) doesn't run on lo interface or
508486
* loopback IP address. So if route is resolved to loopback
@@ -512,9 +490,27 @@ static int rdma_set_src_addr_rcu(struct rdma_dev_addr *dev_addr,
512490
ndev = rdma_find_ndev_for_src_ip_rcu(dev_net(ndev), dst_in);
513491
if (IS_ERR(ndev))
514492
return -ENODEV;
493+
ret = rdma_translate_ip(dst_in, dev_addr);
494+
if (ret)
495+
return ret;
496+
} else {
497+
rdma_copy_src_l2_addr(dev_addr, dst->dev);
515498
}
516499

517-
return copy_src_l2_addr(dev_addr, dst_in, dst, ndev);
500+
/*
501+
* If there's a gateway and type of device not ARPHRD_INFINIBAND,
502+
* we're definitely in RoCE v2 (as RoCE v1 isn't routable) set the
503+
* network type accordingly.
504+
*/
505+
if (has_gateway(dst, dst_in->sa_family) &&
506+
ndev->type != ARPHRD_INFINIBAND)
507+
dev_addr->network = dst_in->sa_family == AF_INET ?
508+
RDMA_NETWORK_IPV4 :
509+
RDMA_NETWORK_IPV6;
510+
else
511+
dev_addr->network = RDMA_NETWORK_IB;
512+
513+
return 0;
518514
}
519515

520516
static int set_addr_netns_by_gid_rcu(struct rdma_dev_addr *addr)
@@ -551,7 +547,6 @@ static int addr_resolve(struct sockaddr *src_in,
551547
u32 seq)
552548
{
553549
struct dst_entry *dst = NULL;
554-
unsigned int ndev_flags = 0;
555550
struct rtable *rt = NULL;
556551
int ret;
557552

@@ -588,15 +583,15 @@ static int addr_resolve(struct sockaddr *src_in,
588583
rcu_read_unlock();
589584
goto done;
590585
}
591-
ret = rdma_set_src_addr_rcu(addr, &ndev_flags, dst_in, dst);
586+
ret = rdma_set_src_addr_rcu(addr, dst_in, dst);
592587
rcu_read_unlock();
593588

594589
/*
595590
* Resolve neighbor destination address if requested and
596591
* only if src addr translation didn't fail.
597592
*/
598593
if (!ret && resolve_neigh)
599-
ret = addr_resolve_neigh(dst, dst_in, addr, ndev_flags, seq);
594+
ret = addr_resolve_neigh(dst, dst_in, addr, seq);
600595

601596
if (src_in->sa_family == AF_INET)
602597
ip_rt_put(rt);

drivers/infiniband/core/agent.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ void agent_send_response(const struct ib_mad_hdr *mad_hdr, const struct ib_grh *
110110
agent = port_priv->agent[qpn];
111111
ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num);
112112
if (IS_ERR(ah)) {
113-
dev_err(&device->dev, "ib_create_ah_from_wc error %ld\n",
114-
PTR_ERR(ah));
113+
dev_err(&device->dev, "ib_create_ah_from_wc error %pe\n", ah);
115114
return;
116115
}
117116

drivers/infiniband/core/cm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,8 +1049,8 @@ static noinline void cm_destroy_id_wait_timeout(struct ib_cm_id *cm_id,
10491049
struct cm_id_private *cm_id_priv;
10501050

10511051
cm_id_priv = container_of(cm_id, struct cm_id_private, id);
1052-
pr_err("%s: cm_id=%p timed out. state %d -> %d, refcnt=%d\n", __func__,
1053-
cm_id, old_state, cm_id->state, refcount_read(&cm_id_priv->refcount));
1052+
pr_err_ratelimited("%s: cm_id=%p timed out. state %d -> %d, refcnt=%d\n", __func__,
1053+
cm_id, old_state, cm_id->state, refcount_read(&cm_id_priv->refcount));
10541054
}
10551055

10561056
static void cm_destroy_id(struct ib_cm_id *cm_id, int err)

0 commit comments

Comments
 (0)