Skip to content

Commit 4fa56ad

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: "Nothing very exciting here, just a few small bug fixes. No red flags for this release have shown up. - Regression from the last pull request in cxgb4 related to the ipv6 fixes - KASAN crasher in rtrs - oops in hfi1 related to a buggy BIOS - Userspace could oops qedr's XRC support - Uninitialized memory when parsing a LS_NLA_TYPE_DGID netlink message" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/addr: Be strict with gid size RDMA/qedr: Fix kernel panic when trying to access recv_cq IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS RDMA/cxgb4: check for ipv6 address properly while destroying listener RDMA/rtrs-clt: Close rtrs client conn before destroying rtrs clt session files
2 parents 3fb4f97 + d1c803a commit 4fa56ad

8 files changed

Lines changed: 24 additions & 23 deletions

File tree

drivers/infiniband/core/addr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ static struct workqueue_struct *addr_wq;
7676

7777
static const struct nla_policy ib_nl_addr_policy[LS_NLA_TYPE_MAX] = {
7878
[LS_NLA_TYPE_DGID] = {.type = NLA_BINARY,
79-
.len = sizeof(struct rdma_nla_ls_gid)},
79+
.len = sizeof(struct rdma_nla_ls_gid),
80+
.validation_type = NLA_VALIDATE_MIN,
81+
.min = sizeof(struct rdma_nla_ls_gid)},
8082
};
8183

8284
static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh)

drivers/infiniband/hw/cxgb4/cm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3616,7 +3616,8 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id)
36163616
c4iw_init_wr_wait(ep->com.wr_waitp);
36173617
err = cxgb4_remove_server(
36183618
ep->com.dev->rdev.lldi.ports[0], ep->stid,
3619-
ep->com.dev->rdev.lldi.rxq_ids[0], true);
3619+
ep->com.dev->rdev.lldi.rxq_ids[0],
3620+
ep->com.local_addr.ss_family == AF_INET6);
36203621
if (err)
36213622
goto done;
36223623
err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp,

drivers/infiniband/hw/hfi1/affinity.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -632,22 +632,11 @@ static void _dev_comp_vect_cpu_mask_clean_up(struct hfi1_devdata *dd,
632632
*/
633633
int hfi1_dev_affinity_init(struct hfi1_devdata *dd)
634634
{
635-
int node = pcibus_to_node(dd->pcidev->bus);
636635
struct hfi1_affinity_node *entry;
637636
const struct cpumask *local_mask;
638637
int curr_cpu, possible, i, ret;
639638
bool new_entry = false;
640639

641-
/*
642-
* If the BIOS does not have the NUMA node information set, select
643-
* NUMA 0 so we get consistent performance.
644-
*/
645-
if (node < 0) {
646-
dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n");
647-
node = 0;
648-
}
649-
dd->node = node;
650-
651640
local_mask = cpumask_of_node(dd->node);
652641
if (cpumask_first(local_mask) >= nr_cpu_ids)
653642
local_mask = topology_core_cpumask(0);
@@ -660,7 +649,7 @@ int hfi1_dev_affinity_init(struct hfi1_devdata *dd)
660649
* create an entry in the global affinity structure and initialize it.
661650
*/
662651
if (!entry) {
663-
entry = node_affinity_allocate(node);
652+
entry = node_affinity_allocate(dd->node);
664653
if (!entry) {
665654
dd_dev_err(dd,
666655
"Unable to allocate global affinity node\n");
@@ -751,6 +740,7 @@ int hfi1_dev_affinity_init(struct hfi1_devdata *dd)
751740
if (new_entry)
752741
node_affinity_add_tail(entry);
753742

743+
dd->affinity_entry = entry;
754744
mutex_unlock(&node_affinity.lock);
755745

756746
return 0;
@@ -766,10 +756,9 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd)
766756
{
767757
struct hfi1_affinity_node *entry;
768758

769-
if (dd->node < 0)
770-
return;
771-
772759
mutex_lock(&node_affinity.lock);
760+
if (!dd->affinity_entry)
761+
goto unlock;
773762
entry = node_affinity_lookup(dd->node);
774763
if (!entry)
775764
goto unlock;
@@ -780,8 +769,8 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd)
780769
*/
781770
_dev_comp_vect_cpu_mask_clean_up(dd, entry);
782771
unlock:
772+
dd->affinity_entry = NULL;
783773
mutex_unlock(&node_affinity.lock);
784-
dd->node = NUMA_NO_NODE;
785774
}
786775

787776
/*

drivers/infiniband/hw/hfi1/hfi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ struct hfi1_devdata {
14091409
spinlock_t irq_src_lock;
14101410
int vnic_num_vports;
14111411
struct net_device *dummy_netdev;
1412+
struct hfi1_affinity_node *affinity_entry;
14121413

14131414
/* Keeps track of IPoIB RSM rule users */
14141415
atomic_t ipoib_rsm_usr_num;

drivers/infiniband/hw/hfi1/init.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,6 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev,
12771277
dd->pport = (struct hfi1_pportdata *)(dd + 1);
12781278
dd->pcidev = pdev;
12791279
pci_set_drvdata(pdev, dd);
1280-
dd->node = NUMA_NO_NODE;
12811280

12821281
ret = xa_alloc_irq(&hfi1_dev_table, &dd->unit, dd, xa_limit_32b,
12831282
GFP_KERNEL);
@@ -1287,6 +1286,15 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev,
12871286
goto bail;
12881287
}
12891288
rvt_set_ibdev_name(&dd->verbs_dev.rdi, "%s_%d", class_name(), dd->unit);
1289+
/*
1290+
* If the BIOS does not have the NUMA node information set, select
1291+
* NUMA 0 so we get consistent performance.
1292+
*/
1293+
dd->node = pcibus_to_node(pdev->bus);
1294+
if (dd->node == NUMA_NO_NODE) {
1295+
dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n");
1296+
dd->node = 0;
1297+
}
12901298

12911299
/*
12921300
* Initialize all locks for the device. This needs to be as early as

drivers/infiniband/hw/hfi1/netdev_rx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ u32 hfi1_num_netdev_contexts(struct hfi1_devdata *dd, u32 available_contexts,
173173
return 0;
174174
}
175175

176-
cpumask_and(node_cpu_mask, cpu_mask,
177-
cpumask_of_node(pcibus_to_node(dd->pcidev->bus)));
176+
cpumask_and(node_cpu_mask, cpu_mask, cpumask_of_node(dd->node));
178177

179178
available_cpus = cpumask_weight(node_cpu_mask);
180179

drivers/infiniband/hw/qedr/verbs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,8 @@ static int qedr_check_qp_attrs(struct ib_pd *ibpd, struct qedr_dev *dev,
12441244
* TGT QP isn't associated with RQ/SQ
12451245
*/
12461246
if ((attrs->qp_type != IB_QPT_GSI) && (dev->gsi_qp_created) &&
1247-
(attrs->qp_type != IB_QPT_XRC_TGT)) {
1247+
(attrs->qp_type != IB_QPT_XRC_TGT) &&
1248+
(attrs->qp_type != IB_QPT_XRC_INI)) {
12481249
struct qedr_cq *send_cq = get_qedr_cq(attrs->send_cq);
12491250
struct qedr_cq *recv_cq = get_qedr_cq(attrs->recv_cq);
12501251

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2720,8 +2720,8 @@ void rtrs_clt_close(struct rtrs_clt *clt)
27202720

27212721
/* Now it is safe to iterate over all paths without locks */
27222722
list_for_each_entry_safe(sess, tmp, &clt->paths_list, s.entry) {
2723-
rtrs_clt_destroy_sess_files(sess, NULL);
27242723
rtrs_clt_close_conns(sess, true);
2724+
rtrs_clt_destroy_sess_files(sess, NULL);
27252725
kobject_put(&sess->kobj);
27262726
}
27272727
free_clt(clt);

0 commit comments

Comments
 (0)