Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bef85bd7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rdma fixes from Doug Ledford:
 "First set of -rc fixes for 4.13 cycle:

   - misc iSER fixes

   - namespace fixups

   - fix the fact that IPoIB didn't use the proper API for noio mem allocs

   - rxe driver fixes

   - hns_roce fixes

   - misc core fixes

   - misc IPoIB fixes"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (27 commits)
  IB/core: Allow QP state transition from reset to error
  IB/hns: Fix for checkpatch.pl comment style warnings
  IB/hns: Fix the bug with modifying the MAC address without removing the driver
  IB/hns: Fix the bug with rdma operation
  IB/hns: Fix the bug with wild pointer when destroy rc qp
  IB/hns: Fix the bug of polling cq failed for loopback Qps
  IB/rxe: Set dma_mask and coherent_dma_mask
  IB/rxe: Fix kernel panic from skb destructor
  IB/ipoib: Let lower driver handle get_stats64 call
  IB/core: Add ordered workqueue for RoCE GID management
  IB/mlx5: Clean mr_cache debugfs in case of failure
  IB/core: Remove NOIO QP create flag
  {net, IB}/mlx4: Remove gfp flags argument
  IB/{rdmavt, qib, hfi1}: Remove gfp flags argument
  IB/IPoIB: Convert IPoIB to memalloc_noio_* calls
  IB/IPoIB: Forward MTU change to driver below
  IB: Convert msleep below 20ms to usleep_range
  IB/uverbs: Make use of ib_modify_qp variant to avoid resolving DMAC
  IB/core: Introduce modify QP operation with udata
  IB/core: Don't resolve IP address to the loopback device
  ...
parents 15b0a8d1 ebc9ca43
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -10868,6 +10868,14 @@ L: linux-scsi@vger.kernel.org
S:	Supported
F:	drivers/scsi/qedf/

QLOGIC QL4xxx RDMA DRIVER
M:	Ram Amrani <Ram.Amrani@cavium.com>
M:	Ariel Elior <Ariel.Elior@cavium.com>
L:	linux-rdma@vger.kernel.org
S:	Supported
F:	drivers/infiniband/hw/qedr/
F:	include/uapi/rdma/qedr-abi.h

QNX4 FILESYSTEM
M:	Anders Larsen <al@alarsen.net>
W:	http://www.alarsen.net/linux/qnx4fs/
+34 −12
Original line number Diff line number Diff line
@@ -268,6 +268,7 @@ int rdma_translate_ip(const struct sockaddr *addr,
			return ret;

		ret = rdma_copy_addr(dev_addr, dev, NULL);
		dev_addr->bound_dev_if = dev->ifindex;
		if (vlan_id)
			*vlan_id = rdma_vlan_dev_vlan_id(dev);
		dev_put(dev);
@@ -280,6 +281,7 @@ int rdma_translate_ip(const struct sockaddr *addr,
					  &((const struct sockaddr_in6 *)addr)->sin6_addr,
					  dev, 1)) {
				ret = rdma_copy_addr(dev_addr, dev, NULL);
				dev_addr->bound_dev_if = dev->ifindex;
				if (vlan_id)
					*vlan_id = rdma_vlan_dev_vlan_id(dev);
				break;
@@ -405,10 +407,10 @@ static int addr4_resolve(struct sockaddr_in *src_in,
	fl4.saddr = src_ip;
	fl4.flowi4_oif = addr->bound_dev_if;
	rt = ip_route_output_key(addr->net, &fl4);
	if (IS_ERR(rt)) {
		ret = PTR_ERR(rt);
		goto out;
	}
	ret = PTR_ERR_OR_ZERO(rt);
	if (ret)
		return ret;

	src_in->sin_family = AF_INET;
	src_in->sin_addr.s_addr = fl4.saddr;

@@ -423,8 +425,6 @@ static int addr4_resolve(struct sockaddr_in *src_in,

	*prt = rt;
	return 0;
out:
	return ret;
}

#if IS_ENABLED(CONFIG_IPV6)
@@ -509,6 +509,11 @@ static int addr_resolve(struct sockaddr *src_in,
	struct dst_entry *dst;
	int ret;

	if (!addr->net) {
		pr_warn_ratelimited("%s: missing namespace\n", __func__);
		return -EINVAL;
	}

	if (src_in->sa_family == AF_INET) {
		struct rtable *rt = NULL;
		const struct sockaddr_in *dst_in4 =
@@ -522,8 +527,12 @@ static int addr_resolve(struct sockaddr *src_in,
		if (resolve_neigh)
			ret = addr_resolve_neigh(&rt->dst, dst_in, addr, seq);

		if (addr->bound_dev_if) {
			ndev = dev_get_by_index(addr->net, addr->bound_dev_if);
		} else {
			ndev = rt->dst.dev;
			dev_hold(ndev);
		}

		ip_rt_put(rt);
	} else {
@@ -539,14 +548,27 @@ static int addr_resolve(struct sockaddr *src_in,
		if (resolve_neigh)
			ret = addr_resolve_neigh(dst, dst_in, addr, seq);

		if (addr->bound_dev_if) {
			ndev = dev_get_by_index(addr->net, addr->bound_dev_if);
		} else {
			ndev = dst->dev;
			dev_hold(ndev);
		}

		dst_release(dst);
	}

	if (ndev->flags & IFF_LOOPBACK) {
		ret = rdma_translate_ip(dst_in, addr, NULL);
		/*
		 * Put the loopback device and get the translated
		 * device instead.
		 */
		dev_put(ndev);
		ndev = dev_get_by_index(addr->net, addr->bound_dev_if);
	} else {
		addr->bound_dev_if = ndev->ifindex;
	addr->net = dev_net(ndev);
	}
	dev_put(ndev);

	return ret;
+3 −29
Original line number Diff line number Diff line
@@ -623,22 +623,11 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
	if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device, port))
		return ret;

	if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) {
	if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port))
		ndev = dev_get_by_index(&init_net, bound_if_index);
		if (ndev && ndev->flags & IFF_LOOPBACK) {
			pr_info("detected loopback device\n");
			dev_put(ndev);

			if (!device->get_netdev)
				return -EOPNOTSUPP;

			ndev = device->get_netdev(device, port);
			if (!ndev)
				return -ENODEV;
		}
	} else {
	else
		gid_type = IB_GID_TYPE_IB;
	}


	ret = ib_find_cached_gid_by_port(device, gid, gid_type, port,
					 ndev, NULL);
@@ -2569,21 +2558,6 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
			goto err2;
		}

		if (ndev->flags & IFF_LOOPBACK) {
			dev_put(ndev);
			if (!id_priv->id.device->get_netdev) {
				ret = -EOPNOTSUPP;
				goto err2;
			}

			ndev = id_priv->id.device->get_netdev(id_priv->id.device,
							      id_priv->id.port_num);
			if (!ndev) {
				ret = -ENODEV;
				goto err2;
			}
		}

		supported_gids = roce_gid_type_mask_support(id_priv->id.device,
							    id_priv->id.port_num);
		gid_type = cma_route_gid_type(addr->dev_addr.network,
+9 −2
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@
#include <rdma/ib_cache.h>
#include <rdma/ib_addr.h>

static struct workqueue_struct *gid_cache_wq;

enum gid_op_type {
	GID_DEL = 0,
	GID_ADD
@@ -560,7 +562,7 @@ static int netdevice_queue_work(struct netdev_event_work_cmd *cmds,
	}
	INIT_WORK(&ndev_work->work, netdevice_event_work_handler);

	queue_work(ib_wq, &ndev_work->work);
	queue_work(gid_cache_wq, &ndev_work->work);

	return NOTIFY_DONE;
}
@@ -693,7 +695,7 @@ static int addr_event(struct notifier_block *this, unsigned long event,
	dev_hold(ndev);
	work->gid_attr.ndev   = ndev;

	queue_work(ib_wq, &work->work);
	queue_work(gid_cache_wq, &work->work);

	return NOTIFY_DONE;
}
@@ -740,6 +742,10 @@ static struct notifier_block nb_inet6addr = {

int __init roce_gid_mgmt_init(void)
{
	gid_cache_wq = alloc_ordered_workqueue("gid-cache-wq", 0);
	if (!gid_cache_wq)
		return -ENOMEM;

	register_inetaddr_notifier(&nb_inetaddr);
	if (IS_ENABLED(CONFIG_IPV6))
		register_inet6addr_notifier(&nb_inet6addr);
@@ -764,4 +770,5 @@ void __exit roce_gid_mgmt_cleanup(void)
	 * ib-core is removed, all physical devices have been removed,
	 * so no issue with remaining hardware contexts.
	 */
	destroy_workqueue(gid_cache_wq);
}
+4 −19
Original line number Diff line number Diff line
@@ -2005,28 +2005,13 @@ static int modify_qp(struct ib_uverbs_file *file,
	rdma_ah_set_port_num(&attr->alt_ah_attr,
			     cmd->base.alt_dest.port_num);

	if (qp->real_qp == qp) {
		if (cmd->base.attr_mask & IB_QP_AV) {
			ret = ib_resolve_eth_dmac(qp->device, &attr->ah_attr);
			if (ret)
				goto release_qp;
		}
		ret = ib_security_modify_qp(qp,
					    attr,
	ret = ib_modify_qp_with_udata(qp, attr,
				      modify_qp_mask(qp->qp_type,
						     cmd->base.attr_mask),
				      udata);
	} else {
		ret = ib_security_modify_qp(qp,
					    attr,
					    modify_qp_mask(qp->qp_type,
							   cmd->base.attr_mask),
					    NULL);
	}

release_qp:
	uobj_put_obj_read(qp);

out:
	kfree(attr);

Loading