diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-09 12:02:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-09 12:02:46 -0400 |
commit | dce45af5c2e9e85f22578f2f8065f225f5d11764 (patch) | |
tree | e01e7a294586c3074142fb485516ce718a1a82d2 /drivers/infiniband/ulp | |
parent | 055128ee008b00fba14e3638e7e84fc2cff8d77d (diff) | |
parent | b79656ed44c6865e17bcd93472ec39488bcc4984 (diff) |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma updates from Jason Gunthorpe:
"This has been a smaller cycle than normal. One new driver was
accepted, which is unusual, and at least one more driver remains in
review on the list.
Summary:
- Driver fixes for hns, hfi1, nes, rxe, i40iw, mlx5, cxgb4,
vmw_pvrdma
- Many patches from MatthewW converting radix tree and IDR users to
use xarray
- Introduction of tracepoints to the MAD layer
- Build large SGLs at the start for DMA mapping and get the driver to
split them
- Generally clean SGL handling code throughout the subsystem
- Support for restricting RDMA devices to net namespaces for
containers
- Progress to remove object allocation boilerplate code from drivers
- Change in how the mlx5 driver shows representor ports linked to VFs
- mlx5 uapi feature to access the on chip SW ICM memory
- Add a new driver for 'EFA'. This is HW that supports user space
packet processing through QPs in Amazon's cloud"
* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (186 commits)
RDMA/ipoib: Allow user space differentiate between valid dev_port
IB/core, ipoib: Do not overreact to SM LID change event
RDMA/device: Don't fire uevent before device is fully initialized
lib/scatterlist: Remove leftover from sg_page_iter comment
RDMA/efa: Add driver to Kconfig/Makefile
RDMA/efa: Add the efa module
RDMA/efa: Add EFA verbs implementation
RDMA/efa: Add common command handlers
RDMA/efa: Implement functions that submit and complete admin commands
RDMA/efa: Add the ABI definitions
RDMA/efa: Add the com service API definitions
RDMA/efa: Add the efa_com.h file
RDMA/efa: Add the efa.h header file
RDMA/efa: Add EFA device definitions
RDMA: Add EFA related definitions
RDMA/umem: Remove hugetlb flag
RDMA/bnxt_re: Use core helpers to get aligned DMA address
RDMA/i40iw: Use core helpers to get aligned DMA address within a supported page size
RDMA/verbs: Add a DMA iterator to return aligned contiguous memory blocks
RDMA/umem: Add API to find best driver supported page size in an MR
...
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 13 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/Kconfig | 4 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 60 |
6 files changed, 41 insertions, 48 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 48eda16db1a7..9b5e11d3fb85 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -2402,7 +2402,18 @@ static ssize_t dev_id_show(struct device *dev, | |||
2402 | { | 2402 | { |
2403 | struct net_device *ndev = to_net_dev(dev); | 2403 | struct net_device *ndev = to_net_dev(dev); |
2404 | 2404 | ||
2405 | if (ndev->dev_id == ndev->dev_port) | 2405 | /* |
2406 | * ndev->dev_port will be equal to 0 in old kernel prior to commit | ||
2407 | * 9b8b2a323008 ("IB/ipoib: Use dev_port to expose network interface | ||
2408 | * port numbers") Zero was chosen as special case for user space | ||
2409 | * applications to fallback and query dev_id to check if it has | ||
2410 | * different value or not. | ||
2411 | * | ||
2412 | * Don't print warning in such scenario. | ||
2413 | * | ||
2414 | * https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L358 | ||
2415 | */ | ||
2416 | if (ndev->dev_port && ndev->dev_id == ndev->dev_port) | ||
2406 | netdev_info_once(ndev, | 2417 | netdev_info_once(ndev, |
2407 | "\"%s\" wants to know my dev_id. Should it look at dev_port instead? See Documentation/ABI/testing/sysfs-class-net for more info.\n", | 2418 | "\"%s\" wants to know my dev_id. Should it look at dev_port instead? See Documentation/ABI/testing/sysfs-class-net for more info.\n", |
2408 | current->comm); | 2419 | current->comm); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index 1e88213459f2..ba09068f6200 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c | |||
@@ -279,8 +279,7 @@ void ipoib_event(struct ib_event_handler *handler, | |||
279 | ipoib_dbg(priv, "Event %d on device %s port %d\n", record->event, | 279 | ipoib_dbg(priv, "Event %d on device %s port %d\n", record->event, |
280 | dev_name(&record->device->dev), record->element.port_num); | 280 | dev_name(&record->device->dev), record->element.port_num); |
281 | 281 | ||
282 | if (record->event == IB_EVENT_SM_CHANGE || | 282 | if (record->event == IB_EVENT_CLIENT_REREGISTER) { |
283 | record->event == IB_EVENT_CLIENT_REREGISTER) { | ||
284 | queue_work(ipoib_workqueue, &priv->flush_light); | 283 | queue_work(ipoib_workqueue, &priv->flush_light); |
285 | } else if (record->event == IB_EVENT_PORT_ERR || | 284 | } else if (record->event == IB_EVENT_PORT_ERR || |
286 | record->event == IB_EVENT_PORT_ACTIVE || | 285 | record->event == IB_EVENT_PORT_ACTIVE || |
diff --git a/drivers/infiniband/ulp/iser/Kconfig b/drivers/infiniband/ulp/iser/Kconfig index d00af71a2cfc..299268f261ee 100644 --- a/drivers/infiniband/ulp/iser/Kconfig +++ b/drivers/infiniband/ulp/iser/Kconfig | |||
@@ -4,8 +4,8 @@ config INFINIBAND_ISER | |||
4 | select SCSI_ISCSI_ATTRS | 4 | select SCSI_ISCSI_ATTRS |
5 | ---help--- | 5 | ---help--- |
6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol | 6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol |
7 | over InfiniBand. This allows you to access storage devices | 7 | over InfiniBand. This allows you to access storage devices |
8 | that speak iSCSI over iSER over InfiniBand. | 8 | that speak iSCSI over iSER over InfiniBand. |
9 | 9 | ||
10 | The iSER protocol is defined by IETF. | 10 | The iSER protocol is defined by IETF. |
11 | See <http://www.ietf.org/rfc/rfc5046.txt> | 11 | See <http://www.ietf.org/rfc/rfc5046.txt> |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 8c707accd148..9c185a8dabd3 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -763,7 +763,6 @@ static int iscsi_iser_get_ep_param(struct iscsi_endpoint *ep, | |||
763 | enum iscsi_param param, char *buf) | 763 | enum iscsi_param param, char *buf) |
764 | { | 764 | { |
765 | struct iser_conn *iser_conn = ep->dd_data; | 765 | struct iser_conn *iser_conn = ep->dd_data; |
766 | int len; | ||
767 | 766 | ||
768 | switch (param) { | 767 | switch (param) { |
769 | case ISCSI_PARAM_CONN_PORT: | 768 | case ISCSI_PARAM_CONN_PORT: |
@@ -774,12 +773,10 @@ static int iscsi_iser_get_ep_param(struct iscsi_endpoint *ep, | |||
774 | return iscsi_conn_get_addr_param((struct sockaddr_storage *) | 773 | return iscsi_conn_get_addr_param((struct sockaddr_storage *) |
775 | &iser_conn->ib_conn.cma_id->route.addr.dst_addr, | 774 | &iser_conn->ib_conn.cma_id->route.addr.dst_addr, |
776 | param, buf); | 775 | param, buf); |
777 | break; | ||
778 | default: | 776 | default: |
779 | return -ENOSYS; | 777 | break; |
780 | } | 778 | } |
781 | 779 | return -ENOSYS; | |
782 | return len; | ||
783 | } | 780 | } |
784 | 781 | ||
785 | /** | 782 | /** |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index a7aeaa0c6fbc..36d525110fd2 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
@@ -311,7 +311,7 @@ struct iser_login_desc { | |||
311 | u64 rsp_dma; | 311 | u64 rsp_dma; |
312 | struct ib_sge sge; | 312 | struct ib_sge sge; |
313 | struct ib_cqe cqe; | 313 | struct ib_cqe cqe; |
314 | } __attribute__((packed)); | 314 | } __packed; |
315 | 315 | ||
316 | struct iser_conn; | 316 | struct iser_conn; |
317 | struct ib_conn; | 317 | struct ib_conn; |
diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c index 560e4f2d466e..be5befd92d16 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | |||
@@ -51,6 +51,7 @@ | |||
51 | */ | 51 | */ |
52 | 52 | ||
53 | #include <linux/module.h> | 53 | #include <linux/module.h> |
54 | #include <linux/xarray.h> | ||
54 | #include <rdma/ib_addr.h> | 55 | #include <rdma/ib_addr.h> |
55 | #include <rdma/ib_verbs.h> | 56 | #include <rdma/ib_verbs.h> |
56 | #include <rdma/opa_smi.h> | 57 | #include <rdma/opa_smi.h> |
@@ -97,7 +98,7 @@ const char opa_vnic_driver_version[] = DRV_VERSION; | |||
97 | * @class_port_info: Class port info information. | 98 | * @class_port_info: Class port info information. |
98 | * @tid: Transaction id | 99 | * @tid: Transaction id |
99 | * @port_num: OPA port number | 100 | * @port_num: OPA port number |
100 | * @vport_idr: vnic ports idr | 101 | * @vports: vnic ports |
101 | * @event_handler: ib event handler | 102 | * @event_handler: ib event handler |
102 | * @lock: adapter interface lock | 103 | * @lock: adapter interface lock |
103 | */ | 104 | */ |
@@ -107,7 +108,7 @@ struct opa_vnic_vema_port { | |||
107 | struct opa_class_port_info class_port_info; | 108 | struct opa_class_port_info class_port_info; |
108 | u64 tid; | 109 | u64 tid; |
109 | u8 port_num; | 110 | u8 port_num; |
110 | struct idr vport_idr; | 111 | struct xarray vports; |
111 | struct ib_event_handler event_handler; | 112 | struct ib_event_handler event_handler; |
112 | 113 | ||
113 | /* Lock to query/update network adapter */ | 114 | /* Lock to query/update network adapter */ |
@@ -148,7 +149,7 @@ vema_get_vport_adapter(struct opa_vnic_vema_mad *recvd_mad, | |||
148 | { | 149 | { |
149 | u8 vport_num = vema_get_vport_num(recvd_mad); | 150 | u8 vport_num = vema_get_vport_num(recvd_mad); |
150 | 151 | ||
151 | return idr_find(&port->vport_idr, vport_num); | 152 | return xa_load(&port->vports, vport_num); |
152 | } | 153 | } |
153 | 154 | ||
154 | /** | 155 | /** |
@@ -207,8 +208,7 @@ static struct opa_vnic_adapter *vema_add_vport(struct opa_vnic_vema_port *port, | |||
207 | int rc; | 208 | int rc; |
208 | 209 | ||
209 | adapter->cport = cport; | 210 | adapter->cport = cport; |
210 | rc = idr_alloc(&port->vport_idr, adapter, vport_num, | 211 | rc = xa_insert(&port->vports, vport_num, adapter, GFP_KERNEL); |
211 | vport_num + 1, GFP_NOWAIT); | ||
212 | if (rc < 0) { | 212 | if (rc < 0) { |
213 | opa_vnic_rem_netdev(adapter); | 213 | opa_vnic_rem_netdev(adapter); |
214 | adapter = ERR_PTR(rc); | 214 | adapter = ERR_PTR(rc); |
@@ -853,36 +853,14 @@ err_exit: | |||
853 | v_err("Aborting trap\n"); | 853 | v_err("Aborting trap\n"); |
854 | } | 854 | } |
855 | 855 | ||
856 | static int vema_rem_vport(int id, void *p, void *data) | ||
857 | { | ||
858 | struct opa_vnic_adapter *adapter = p; | ||
859 | |||
860 | opa_vnic_rem_netdev(adapter); | ||
861 | return 0; | ||
862 | } | ||
863 | |||
864 | static int vema_enable_vport(int id, void *p, void *data) | ||
865 | { | ||
866 | struct opa_vnic_adapter *adapter = p; | ||
867 | |||
868 | netif_carrier_on(adapter->netdev); | ||
869 | return 0; | ||
870 | } | ||
871 | |||
872 | static int vema_disable_vport(int id, void *p, void *data) | ||
873 | { | ||
874 | struct opa_vnic_adapter *adapter = p; | ||
875 | |||
876 | netif_carrier_off(adapter->netdev); | ||
877 | return 0; | ||
878 | } | ||
879 | |||
880 | static void opa_vnic_event(struct ib_event_handler *handler, | 856 | static void opa_vnic_event(struct ib_event_handler *handler, |
881 | struct ib_event *record) | 857 | struct ib_event *record) |
882 | { | 858 | { |
883 | struct opa_vnic_vema_port *port = | 859 | struct opa_vnic_vema_port *port = |
884 | container_of(handler, struct opa_vnic_vema_port, event_handler); | 860 | container_of(handler, struct opa_vnic_vema_port, event_handler); |
885 | struct opa_vnic_ctrl_port *cport = port->cport; | 861 | struct opa_vnic_ctrl_port *cport = port->cport; |
862 | struct opa_vnic_adapter *adapter; | ||
863 | unsigned long index; | ||
886 | 864 | ||
887 | if (record->element.port_num != port->port_num) | 865 | if (record->element.port_num != port->port_num) |
888 | return; | 866 | return; |
@@ -891,10 +869,16 @@ static void opa_vnic_event(struct ib_event_handler *handler, | |||
891 | record->event, dev_name(&record->device->dev), | 869 | record->event, dev_name(&record->device->dev), |
892 | record->element.port_num); | 870 | record->element.port_num); |
893 | 871 | ||
894 | if (record->event == IB_EVENT_PORT_ERR) | 872 | if (record->event != IB_EVENT_PORT_ERR && |
895 | idr_for_each(&port->vport_idr, vema_disable_vport, NULL); | 873 | record->event != IB_EVENT_PORT_ACTIVE) |
896 | if (record->event == IB_EVENT_PORT_ACTIVE) | 874 | return; |
897 | idr_for_each(&port->vport_idr, vema_enable_vport, NULL); | 875 | |
876 | xa_for_each(&port->vports, index, adapter) { | ||
877 | if (record->event == IB_EVENT_PORT_ACTIVE) | ||
878 | netif_carrier_on(adapter->netdev); | ||
879 | else | ||
880 | netif_carrier_off(adapter->netdev); | ||
881 | } | ||
898 | } | 882 | } |
899 | 883 | ||
900 | /** | 884 | /** |
@@ -905,6 +889,8 @@ static void opa_vnic_event(struct ib_event_handler *handler, | |||
905 | */ | 889 | */ |
906 | static void vema_unregister(struct opa_vnic_ctrl_port *cport) | 890 | static void vema_unregister(struct opa_vnic_ctrl_port *cport) |
907 | { | 891 | { |
892 | struct opa_vnic_adapter *adapter; | ||
893 | unsigned long index; | ||
908 | int i; | 894 | int i; |
909 | 895 | ||
910 | for (i = 1; i <= cport->num_ports; i++) { | 896 | for (i = 1; i <= cport->num_ports; i++) { |
@@ -915,13 +901,14 @@ static void vema_unregister(struct opa_vnic_ctrl_port *cport) | |||
915 | 901 | ||
916 | /* Lock ensures no MAD is being processed */ | 902 | /* Lock ensures no MAD is being processed */ |
917 | mutex_lock(&port->lock); | 903 | mutex_lock(&port->lock); |
918 | idr_for_each(&port->vport_idr, vema_rem_vport, NULL); | 904 | xa_for_each(&port->vports, index, adapter) |
905 | opa_vnic_rem_netdev(adapter); | ||
919 | mutex_unlock(&port->lock); | 906 | mutex_unlock(&port->lock); |
920 | 907 | ||
921 | ib_unregister_mad_agent(port->mad_agent); | 908 | ib_unregister_mad_agent(port->mad_agent); |
922 | port->mad_agent = NULL; | 909 | port->mad_agent = NULL; |
923 | mutex_destroy(&port->lock); | 910 | mutex_destroy(&port->lock); |
924 | idr_destroy(&port->vport_idr); | 911 | xa_destroy(&port->vports); |
925 | ib_unregister_event_handler(&port->event_handler); | 912 | ib_unregister_event_handler(&port->event_handler); |
926 | } | 913 | } |
927 | } | 914 | } |
@@ -958,7 +945,7 @@ static int vema_register(struct opa_vnic_ctrl_port *cport) | |||
958 | cport->ibdev, opa_vnic_event); | 945 | cport->ibdev, opa_vnic_event); |
959 | ib_register_event_handler(&port->event_handler); | 946 | ib_register_event_handler(&port->event_handler); |
960 | 947 | ||
961 | idr_init(&port->vport_idr); | 948 | xa_init(&port->vports); |
962 | mutex_init(&port->lock); | 949 | mutex_init(&port->lock); |
963 | port->mad_agent = ib_register_mad_agent(cport->ibdev, i, | 950 | port->mad_agent = ib_register_mad_agent(cport->ibdev, i, |
964 | IB_QPT_GSI, ®_req, | 951 | IB_QPT_GSI, ®_req, |
@@ -969,7 +956,6 @@ static int vema_register(struct opa_vnic_ctrl_port *cport) | |||
969 | ret = PTR_ERR(port->mad_agent); | 956 | ret = PTR_ERR(port->mad_agent); |
970 | port->mad_agent = NULL; | 957 | port->mad_agent = NULL; |
971 | mutex_destroy(&port->lock); | 958 | mutex_destroy(&port->lock); |
972 | idr_destroy(&port->vport_idr); | ||
973 | vema_unregister(cport); | 959 | vema_unregister(cport); |
974 | return ret; | 960 | return ret; |
975 | } | 961 | } |