Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull rdma fixes from Jason Gunthorpe:
"Small update, a few more merge window bugs and normal driver bug
fixes:

- Two merge window regressions in mlx5: a error path bug found by
syzkaller and some lost code during a rework preventing ipoib from
working in some configurations

- Silence clang compilation warning in OPA related code

- Fix a long standing race condition in ib_nl for ACM

- Resolve when the HFI1 is shutdown"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
RDMA/mlx5: Set PD pointers for the error flow unwind
IB/mlx5: Fix 50G per lane indication
RDMA/siw: Fix reporting vendor_part_id
IB/sa: Resolv use-after-free in ib_nl_make_request()
IB/hfi1: Do not destroy link_wq when the device is shut down
IB/hfi1: Do not destroy hfi1_wq when the device is shut down
RDMA/mlx5: Fix legacy IPoIB QP initialization
IB/hfi1: Add explicit cast OPA_MTU_8192 to 'enum ib_mtu'

+64 -37
+18 -22
drivers/infiniband/core/sa_query.c
··· 829 829 return len; 830 830 } 831 831 832 - static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask) 832 + static int ib_nl_make_request(struct ib_sa_query *query, gfp_t gfp_mask) 833 833 { 834 834 struct sk_buff *skb = NULL; 835 835 struct nlmsghdr *nlh; 836 836 void *data; 837 837 struct ib_sa_mad *mad; 838 838 int len; 839 + unsigned long flags; 840 + unsigned long delay; 841 + gfp_t gfp_flag; 842 + int ret; 843 + 844 + INIT_LIST_HEAD(&query->list); 845 + query->seq = (u32)atomic_inc_return(&ib_nl_sa_request_seq); 839 846 840 847 mad = query->mad_buf->mad; 841 848 len = ib_nl_get_path_rec_attrs_len(mad->sa_hdr.comp_mask); ··· 867 860 /* Repair the nlmsg header length */ 868 861 nlmsg_end(skb, nlh); 869 862 870 - return rdma_nl_multicast(&init_net, skb, RDMA_NL_GROUP_LS, gfp_mask); 871 - } 863 + gfp_flag = ((gfp_mask & GFP_ATOMIC) == GFP_ATOMIC) ? GFP_ATOMIC : 864 + GFP_NOWAIT; 872 865 873 - static int ib_nl_make_request(struct ib_sa_query *query, gfp_t gfp_mask) 874 - { 875 - unsigned long flags; 876 - unsigned long delay; 877 - int ret; 878 - 879 - INIT_LIST_HEAD(&query->list); 880 - query->seq = (u32)atomic_inc_return(&ib_nl_sa_request_seq); 881 - 882 - /* Put the request on the list first.*/ 883 866 spin_lock_irqsave(&ib_nl_request_lock, flags); 867 + ret = rdma_nl_multicast(&init_net, skb, RDMA_NL_GROUP_LS, gfp_flag); 868 + 869 + if (ret) 870 + goto out; 871 + 872 + /* Put the request on the list.*/ 884 873 delay = msecs_to_jiffies(sa_local_svc_timeout_ms); 885 874 query->timeout = delay + jiffies; 886 875 list_add_tail(&query->list, &ib_nl_request_list); 887 876 /* Start the timeout if this is the only request */ 888 877 if (ib_nl_request_list.next == &query->list) 889 878 queue_delayed_work(ib_nl_wq, &ib_nl_timed_work, delay); 890 - spin_unlock_irqrestore(&ib_nl_request_lock, flags); 891 879 892 - ret = ib_nl_send_msg(query, gfp_mask); 893 - if (ret) { 894 - ret = -EIO; 895 - /* Remove the request */ 896 - spin_lock_irqsave(&ib_nl_request_lock, flags); 897 - list_del(&query->list); 898 - spin_unlock_irqrestore(&ib_nl_request_lock, flags); 899 - } 880 + out: 881 + spin_unlock_irqrestore(&ib_nl_request_lock, flags); 900 882 901 883 return ret; 902 884 }
+28 -9
drivers/infiniband/hw/hfi1/init.c
··· 831 831 } 832 832 833 833 /** 834 + * destroy_workqueues - destroy per port workqueues 835 + * @dd: the hfi1_ib device 836 + */ 837 + static void destroy_workqueues(struct hfi1_devdata *dd) 838 + { 839 + int pidx; 840 + struct hfi1_pportdata *ppd; 841 + 842 + for (pidx = 0; pidx < dd->num_pports; ++pidx) { 843 + ppd = dd->pport + pidx; 844 + 845 + if (ppd->hfi1_wq) { 846 + destroy_workqueue(ppd->hfi1_wq); 847 + ppd->hfi1_wq = NULL; 848 + } 849 + if (ppd->link_wq) { 850 + destroy_workqueue(ppd->link_wq); 851 + ppd->link_wq = NULL; 852 + } 853 + } 854 + } 855 + 856 + /** 834 857 * enable_general_intr() - Enable the IRQs that will be handled by the 835 858 * general interrupt handler. 836 859 * @dd: valid devdata ··· 1126 1103 * We can't count on interrupts since we are stopping. 1127 1104 */ 1128 1105 hfi1_quiet_serdes(ppd); 1129 - 1130 - if (ppd->hfi1_wq) { 1131 - destroy_workqueue(ppd->hfi1_wq); 1132 - ppd->hfi1_wq = NULL; 1133 - } 1134 - if (ppd->link_wq) { 1135 - destroy_workqueue(ppd->link_wq); 1136 - ppd->link_wq = NULL; 1137 - } 1106 + if (ppd->hfi1_wq) 1107 + flush_workqueue(ppd->hfi1_wq); 1108 + if (ppd->link_wq) 1109 + flush_workqueue(ppd->link_wq); 1138 1110 } 1139 1111 sdma_exit(dd); 1140 1112 } ··· 1774 1756 * clear dma engines, etc. 1775 1757 */ 1776 1758 shutdown_device(dd); 1759 + destroy_workqueues(dd); 1777 1760 1778 1761 stop_timers(dd); 1779 1762
+5 -2
drivers/infiniband/hw/hfi1/qp.c
··· 195 195 { 196 196 /* Constraining 10KB packets to 8KB packets */ 197 197 if (mtu == (enum ib_mtu)OPA_MTU_10240) 198 - mtu = OPA_MTU_8192; 198 + mtu = (enum ib_mtu)OPA_MTU_8192; 199 199 return opa_mtu_enum_to_int((enum opa_mtu)mtu); 200 200 } 201 201 ··· 367 367 struct hfi1_ibport *ibp = 368 368 to_iport(qp->ibqp.device, qp->port_num); 369 369 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); 370 - struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device); 370 + struct hfi1_devdata *dd = ppd->dd; 371 + 372 + if (dd->flags & HFI1_SHUTDOWN) 373 + return true; 371 374 372 375 return iowait_schedule(&priv->s_iowait, ppd->hfi1_wq, 373 376 priv->s_sde ?
+4 -1
drivers/infiniband/hw/hfi1/tid_rdma.c
··· 5406 5406 struct hfi1_ibport *ibp = 5407 5407 to_iport(qp->ibqp.device, qp->port_num); 5408 5408 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); 5409 - struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device); 5409 + struct hfi1_devdata *dd = ppd->dd; 5410 + 5411 + if ((dd->flags & HFI1_SHUTDOWN)) 5412 + return true; 5410 5413 5411 5414 return iowait_tid_schedule(&priv->s_iowait, ppd->hfi1_wq, 5412 5415 priv->s_sde ?
+1 -1
drivers/infiniband/hw/mlx5/main.c
··· 511 511 mdev_port_num); 512 512 if (err) 513 513 goto out; 514 - ext = MLX5_CAP_PCAM_FEATURE(dev->mdev, ptys_extended_ethernet); 514 + ext = !!MLX5_GET_ETH_PROTO(ptys_reg, out, true, eth_proto_capability); 515 515 eth_prot_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper); 516 516 517 517 props->active_width = IB_WIDTH_4X;
+6 -1
drivers/infiniband/hw/mlx5/qp.c
··· 2668 2668 if (qp_type == IB_QPT_RAW_PACKET && attr->rwq_ind_tbl) 2669 2669 return (create_flags) ? -EINVAL : 0; 2670 2670 2671 + process_create_flag(dev, &create_flags, IB_QP_CREATE_NETIF_QP, 2672 + mlx5_get_flow_namespace(dev->mdev, 2673 + MLX5_FLOW_NAMESPACE_BYPASS), 2674 + qp); 2671 2675 process_create_flag(dev, &create_flags, 2672 2676 IB_QP_CREATE_INTEGRITY_EN, 2673 2677 MLX5_CAP_GEN(mdev, sho), qp); ··· 3005 3001 mlx5_ib_destroy_dct(qp); 3006 3002 } else { 3007 3003 /* 3008 - * The two lines below are temp solution till QP allocation 3004 + * These lines below are temp solution till QP allocation 3009 3005 * will be moved to be under IB/core responsiblity. 3010 3006 */ 3011 3007 qp->ibqp.send_cq = attr->send_cq; 3012 3008 qp->ibqp.recv_cq = attr->recv_cq; 3009 + qp->ibqp.pd = pd; 3013 3010 destroy_qp_common(dev, qp, udata); 3014 3011 } 3015 3012
+2 -1
drivers/infiniband/sw/siw/siw_main.c
··· 67 67 static int dev_id = 1; 68 68 int rv; 69 69 70 + sdev->vendor_part_id = dev_id++; 71 + 70 72 rv = ib_register_device(base_dev, name); 71 73 if (rv) { 72 74 pr_warn("siw: device registration error %d\n", rv); 73 75 return rv; 74 76 } 75 - sdev->vendor_part_id = dev_id++; 76 77 77 78 siw_dbg(base_dev, "HWaddr=%pM\n", sdev->netdev->dev_addr); 78 79