* Re: [PATCH 0/5 for rdma-core] Five rxe_cfg patches
From: Leon Romanovsky @ 2016-10-15 9:38 UTC (permalink / raw)
To: Bart Van Assche; +Cc: Doug Ledford, Jason Gunthorpe, Moni Shoua, linux-rdma
In-Reply-To: <bf5dba39-7e14-23ee-4aa1-2a276d629fe9-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 949 bytes --]
On Fri, Oct 07, 2016 at 11:37:43AM -0700, Bart Van Assche wrote:
> Hello Doug, Jason and Moni,
>
> These five patches is what I came up with after having had a look at the
> rxe_cfg source code. It would be appreciated if these patches would be
> considered for inclusion in the rdma-core repository. The filenames of these
> patches are:
>
> 0001-rxe_cfg-Use-Perl-functions-instead-of-parsing-the-ou.patch
> 0002-rxe_cfg-Initialize-rxe_mtu-even-if-ibv_definfo-fails.patch
> 0003-rxe_cfg-Do-not-suppress-stderr.patch
> 0004-rxe_cfg-Remove-dead-code-from-show_module_status.patch
> 0005-rxe_cfg-Use-printf-instead-of-using-a-loop.patch
>
> Thanks,
Thanks, applied
https://github.com/linux-rdma/rdma-core/pull/20
>
> Bart.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-core 0/4] rdma-core infrastructure
From: Leon Romanovsky @ 2016-10-15 9:26 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161014192136.11731-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3517 bytes --]
On Fri, Oct 14, 2016 at 03:21:32PM -0400, Jarod Wilson wrote:
> This is a set of patches to make some minor changes to the stock spec file,
> add a bunch of userspace glue that Red Hat has been shipping on it's own in
> Red Hat Enterprise Linux and Fedora for a while now, and a revised split
> package spec file that we're likely to use in at least RHEL, to preserve the
> current packaging split.
Jarod,
I'm far a way from packaging, so I have very general questions.
1. You mentioned FC, but used glue/redhat/. Is it applicable for Centos?
2. Do FC and Centos need similar files in structure?
3. Does it make sense to rename glue/ to be packages/ and move debian there?
>
> Jarod Wilson (4):
> rpm spec: install documentation too
> glue/redhat: add udev/systemd/etc infrastructure bits
> glue/redhat: copy stock spec for RH customization
> glue/redhat/spec: build split rpm packages
>
> glue/redhat/ibacm.service | 12 +
> glue/redhat/iwpmd.service | 12 +
> glue/redhat/rdma-core.spec | 534 +++++++++++++++++++++++++++++++
> glue/redhat/rdma.conf | 25 ++
> glue/redhat/rdma.cxgb3.sys.modprobe | 1 +
> glue/redhat/rdma.cxgb4.sys.modprobe | 1 +
> glue/redhat/rdma.fixup-mtrr.awk | 160 +++++++++
> glue/redhat/rdma.ifdown-ib | 183 +++++++++++
> glue/redhat/rdma.ifup-ib | 308 ++++++++++++++++++
> glue/redhat/rdma.kernel-init | 262 +++++++++++++++
> glue/redhat/rdma.mlx4-setup.sh | 91 ++++++
> glue/redhat/rdma.mlx4.conf | 27 ++
> glue/redhat/rdma.mlx4.sys.modprobe | 5 +
> glue/redhat/rdma.mlx4.user.modprobe | 21 ++
> glue/redhat/rdma.modules-setup.sh | 30 ++
> glue/redhat/rdma.service | 15 +
> glue/redhat/rdma.sriov-init | 137 ++++++++
> glue/redhat/rdma.sriov-vfs | 41 +++
> glue/redhat/rdma.udev-ipoib-naming.rules | 13 +
> glue/redhat/rdma.udev-rules | 18 ++
> glue/redhat/srp_daemon.service | 17 +
> rdma-core.spec | 4 +
> 22 files changed, 1917 insertions(+)
> create mode 100644 glue/redhat/ibacm.service
> create mode 100644 glue/redhat/iwpmd.service
> create mode 100644 glue/redhat/rdma-core.spec
> create mode 100644 glue/redhat/rdma.conf
> create mode 100644 glue/redhat/rdma.cxgb3.sys.modprobe
> create mode 100644 glue/redhat/rdma.cxgb4.sys.modprobe
> create mode 100644 glue/redhat/rdma.fixup-mtrr.awk
> create mode 100644 glue/redhat/rdma.ifdown-ib
> create mode 100644 glue/redhat/rdma.ifup-ib
> create mode 100644 glue/redhat/rdma.kernel-init
> create mode 100644 glue/redhat/rdma.mlx4-setup.sh
> create mode 100644 glue/redhat/rdma.mlx4.conf
> create mode 100644 glue/redhat/rdma.mlx4.sys.modprobe
> create mode 100644 glue/redhat/rdma.mlx4.user.modprobe
> create mode 100644 glue/redhat/rdma.modules-setup.sh
> create mode 100644 glue/redhat/rdma.service
> create mode 100644 glue/redhat/rdma.sriov-init
> create mode 100644 glue/redhat/rdma.sriov-vfs
> create mode 100644 glue/redhat/rdma.udev-ipoib-naming.rules
> create mode 100644 glue/redhat/rdma.udev-rules
> create mode 100644 glue/redhat/srp_daemon.service
>
> --
> 2.10.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* [PATCH net-next 11/11] net: dev: Improve debug statements for adjacency tracking
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Adjacency code only has debugs for the insert case. Add debugs for
the remove path and make both consistently worded to make it easier
to follow the insert and removal with reference counts.
In addition, change the BUG to a WARN_ON. A missing adjacency at
removal time is not cause for a panic.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
net/core/dev.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 99a1cb432945..10fd42a833e6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5567,6 +5567,9 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
if (adj) {
adj->ref_nr += 1;
+ pr_debug("Insert adjacency: dev %s adj_dev %s adj->ref_nr %d\n",
+ dev->name, adj_dev->name, adj->ref_nr);
+
return 0;
}
@@ -5580,8 +5583,8 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
adj->private = private;
dev_hold(adj_dev);
- pr_debug("dev_hold for %s, because of link added from %s to %s\n",
- adj_dev->name, dev->name, adj_dev->name);
+ pr_debug("Insert adjacency: dev %s adj_dev %s adj->ref_nr %d; dev_hold on %s\n",
+ dev->name, adj_dev->name, adj->ref_nr, adj_dev->name);
if (netdev_adjacent_is_neigh_list(dev, adj_dev, dev_list)) {
ret = netdev_adjacent_sysfs_add(dev, adj_dev, dev_list);
@@ -5620,17 +5623,22 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev,
{
struct netdev_adjacent *adj;
+ pr_debug("Remove adjacency: dev %s adj_dev %s ref_nr %d\n",
+ dev->name, adj_dev->name, ref_nr);
+
adj = __netdev_find_adj(adj_dev, dev_list);
if (!adj) {
- pr_err("tried to remove device %s from %s\n",
+ pr_err("Adjacency does not exist for device %s from %s\n",
dev->name, adj_dev->name);
- BUG();
+ WARN_ON(1);
+ return;
}
if (adj->ref_nr > ref_nr) {
- pr_debug("%s to %s ref_nr-%d = %d\n", dev->name, adj_dev->name,
- ref_nr, adj->ref_nr-ref_nr);
+ pr_debug("adjacency: %s to %s ref_nr - %d = %d\n",
+ dev->name, adj_dev->name, ref_nr,
+ adj->ref_nr - ref_nr);
adj->ref_nr -= ref_nr;
return;
}
@@ -5642,7 +5650,7 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev,
netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list);
list_del_rcu(&adj->list);
- pr_debug("dev_put for %s, because link removed from %s to %s\n",
+ pr_debug("adjacency: dev_put for %s, because link removed from %s to %s\n",
adj_dev->name, dev->name, adj_dev->name);
dev_put(adj_dev);
kfree_rcu(adj, rcu);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 10/11] net: Add warning if any lower device is still in adjacency list
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Lower list should be empty just like upper.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
net/core/dev.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index a012c7266230..99a1cb432945 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5225,6 +5225,20 @@ struct net_device *netdev_master_upper_dev_get(struct net_device *dev)
}
EXPORT_SYMBOL(netdev_master_upper_dev_get);
+/**
+ * netdev_has_any_lower_dev - Check if device is linked to some device
+ * @dev: device
+ *
+ * Find out if a device is linked to a lower device and return true in case
+ * it is. The caller must hold the RTNL lock.
+ */
+static bool netdev_has_any_lower_dev(struct net_device *dev)
+{
+ ASSERT_RTNL();
+
+ return !list_empty(&dev->adj_list.lower);
+}
+
void *netdev_adjacent_get_private(struct list_head *adj_list)
{
struct netdev_adjacent *adj;
@@ -6622,6 +6636,7 @@ static void rollback_registered_many(struct list_head *head)
/* Notifier chain MUST detach us all upper devices. */
WARN_ON(netdev_has_any_upper_dev(dev));
+ WARN_ON(netdev_has_any_lower_dev(dev));
/* Remove entries from kobject tree */
netdev_unregister_kobject(dev);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 09/11] net: Remove all_adj_list and its references
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri, netdev, davem
Cc: dledford, sean.hefty, hal.rosenstock, linux-rdma, j.vosburgh,
vfalico, andy, jeffrey.t.kirsher, intel-wired-lan, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa@cumulusnetworks.com>
Only direct adjacencies are maintained. All upper or lower devices can
be learned via the new walk API which recursively walks the adj_list for
upper devices or lower devices.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
include/linux/netdevice.h | 25 -----
net/core/dev.c | 229 +++++-----------------------------------------
2 files changed, 21 insertions(+), 233 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a5902d995907..458c87631e7f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1456,7 +1456,6 @@ enum netdev_priv_flags {
* @ptype_specific: Device-specific, protocol-specific packet handlers
*
* @adj_list: Directly linked devices, like slaves for bonding
- * @all_adj_list: All linked devices, *including* neighbours
* @features: Currently active device features
* @hw_features: User-changeable features
*
@@ -1675,11 +1674,6 @@ struct net_device {
struct list_head lower;
} adj_list;
- struct {
- struct list_head upper;
- struct list_head lower;
- } all_adj_list;
-
netdev_features_t features;
netdev_features_t hw_features;
netdev_features_t wanted_features;
@@ -3771,13 +3765,6 @@ struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
updev; \
updev = netdev_upper_get_next_dev_rcu(dev, &(iter)))
-/* iterate through upper list, must be called under RCU read lock */
-#define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \
- for (iter = &(dev)->all_adj_list.upper, \
- updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)); \
- updev; \
- updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)))
-
int netdev_walk_all_upper_dev_rcu(struct net_device *dev,
int (*fn)(struct net_device *upper_dev,
void *data),
@@ -3817,18 +3804,6 @@ struct net_device *netdev_all_lower_get_next(struct net_device *dev,
struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
struct list_head **iter);
-#define netdev_for_each_all_lower_dev(dev, ldev, iter) \
- for (iter = (dev)->all_adj_list.lower.next, \
- ldev = netdev_all_lower_get_next(dev, &(iter)); \
- ldev; \
- ldev = netdev_all_lower_get_next(dev, &(iter)))
-
-#define netdev_for_each_all_lower_dev_rcu(dev, ldev, iter) \
- for (iter = (dev)->all_adj_list.lower.next, \
- ldev = netdev_all_lower_get_next_rcu(dev, &(iter)); \
- ldev; \
- ldev = netdev_all_lower_get_next_rcu(dev, &(iter)))
-
int netdev_walk_all_lower_dev(struct net_device *dev,
int (*fn)(struct net_device *lower_dev,
void *data),
diff --git a/net/core/dev.c b/net/core/dev.c
index 1780f94ed25f..a012c7266230 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5137,6 +5137,16 @@ static struct netdev_adjacent *__netdev_find_adj(struct net_device *adj_dev,
return NULL;
}
+static int __netdev_has_upper_dev(struct net_device *upper_dev, void *data)
+{
+ struct net_device *dev = (struct net_device *)data;
+
+ if (upper_dev == dev)
+ return 1;
+
+ return 0;
+}
+
/**
* netdev_has_upper_dev - Check if device is linked to an upper device
* @dev: device
@@ -5151,7 +5161,8 @@ bool netdev_has_upper_dev(struct net_device *dev,
{
ASSERT_RTNL();
- return __netdev_find_adj(upper_dev, &dev->all_adj_list.upper);
+ return netdev_walk_all_upper_dev_rcu(dev, __netdev_has_upper_dev,
+ upper_dev);
}
EXPORT_SYMBOL(netdev_has_upper_dev);
@@ -5165,16 +5176,6 @@ EXPORT_SYMBOL(netdev_has_upper_dev);
* The caller must hold rcu lock.
*/
-static int __netdev_has_upper_dev(struct net_device *upper_dev, void *data)
-{
- struct net_device *dev = (struct net_device *)data;
-
- if (upper_dev == dev)
- return 1;
-
- return 0;
-}
-
bool netdev_has_upper_dev_all_rcu(struct net_device *dev,
struct net_device *upper_dev)
{
@@ -5197,7 +5198,7 @@ static bool netdev_has_any_upper_dev(struct net_device *dev)
{
ASSERT_RTNL();
- return !list_empty(&dev->all_adj_list.upper);
+ return !list_empty(&dev->adj_list.upper);
}
/**
@@ -5260,32 +5261,6 @@ struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,
}
EXPORT_SYMBOL(netdev_upper_get_next_dev_rcu);
-/**
- * netdev_all_upper_get_next_dev_rcu - Get the next dev from upper list
- * @dev: device
- * @iter: list_head ** of the current position
- *
- * Gets the next device from the dev's upper list, starting from iter
- * position. The caller must hold RCU read lock.
- */
-struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
- struct list_head **iter)
-{
- struct netdev_adjacent *upper;
-
- WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());
-
- upper = list_entry_rcu((*iter)->next, struct netdev_adjacent, list);
-
- if (&upper->list == &dev->all_adj_list.upper)
- return NULL;
-
- *iter = &upper->list;
-
- return upper->dev;
-}
-EXPORT_SYMBOL(netdev_all_upper_get_next_dev_rcu);
-
static struct net_device *netdev_next_upper_dev_rcu(struct net_device *dev,
struct list_head **iter)
{
@@ -5412,31 +5387,6 @@ void *netdev_lower_get_next(struct net_device *dev, struct list_head **iter)
}
EXPORT_SYMBOL(netdev_lower_get_next);
-/**
- * netdev_all_lower_get_next - Get the next device from all lower neighbour list
- * @dev: device
- * @iter: list_head ** of the current position
- *
- * Gets the next netdev_adjacent from the dev's all lower neighbour
- * list, starting from iter position. The caller must hold RTNL lock or
- * its own locking that guarantees that the neighbour all lower
- * list will remain unchanged.
- */
-struct net_device *netdev_all_lower_get_next(struct net_device *dev, struct list_head **iter)
-{
- struct netdev_adjacent *lower;
-
- lower = list_entry(*iter, struct netdev_adjacent, list);
-
- if (&lower->list == &dev->all_adj_list.lower)
- return NULL;
-
- *iter = lower->list.next;
-
- return lower->dev;
-}
-EXPORT_SYMBOL(netdev_all_lower_get_next);
-
static struct net_device *netdev_next_lower_dev(struct net_device *dev,
struct list_head **iter)
{
@@ -5480,27 +5430,6 @@ int netdev_walk_all_lower_dev(struct net_device *dev,
}
EXPORT_SYMBOL_GPL(netdev_walk_all_lower_dev);
-/**
- * netdev_all_lower_get_next_rcu - Get the next device from all
- * lower neighbour list, RCU variant
- * @dev: device
- * @iter: list_head ** of the current position
- *
- * Gets the next netdev_adjacent from the dev's all lower neighbour
- * list, starting from iter position. The caller must hold RCU read lock.
- */
-struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
- struct list_head **iter)
-{
- struct netdev_adjacent *lower;
-
- lower = list_first_or_null_rcu(&dev->all_adj_list.lower,
- struct netdev_adjacent, list);
-
- return lower ? lower->dev : NULL;
-}
-EXPORT_SYMBOL(netdev_all_lower_get_next_rcu);
-
static struct net_device *netdev_next_lower_dev_rcu(struct net_device *dev,
struct list_head **iter)
{
@@ -5728,15 +5657,6 @@ static int __netdev_adjacent_dev_link_lists(struct net_device *dev,
return 0;
}
-static int __netdev_adjacent_dev_link(struct net_device *dev,
- struct net_device *upper_dev)
-{
- return __netdev_adjacent_dev_link_lists(dev, upper_dev,
- &dev->all_adj_list.upper,
- &upper_dev->all_adj_list.lower,
- NULL, false);
-}
-
static void __netdev_adjacent_dev_unlink_lists(struct net_device *dev,
struct net_device *upper_dev,
u16 ref_nr,
@@ -5747,40 +5667,19 @@ static void __netdev_adjacent_dev_unlink_lists(struct net_device *dev,
__netdev_adjacent_dev_remove(upper_dev, dev, ref_nr, down_list);
}
-static void __netdev_adjacent_dev_unlink(struct net_device *dev,
- struct net_device *upper_dev,
- u16 ref_nr)
-{
- __netdev_adjacent_dev_unlink_lists(dev, upper_dev, ref_nr,
- &dev->all_adj_list.upper,
- &upper_dev->all_adj_list.lower);
-}
-
static int __netdev_adjacent_dev_link_neighbour(struct net_device *dev,
struct net_device *upper_dev,
void *private, bool master)
{
- int ret = __netdev_adjacent_dev_link(dev, upper_dev);
-
- if (ret)
- return ret;
-
- ret = __netdev_adjacent_dev_link_lists(dev, upper_dev,
- &dev->adj_list.upper,
- &upper_dev->adj_list.lower,
- private, master);
- if (ret) {
- __netdev_adjacent_dev_unlink(dev, upper_dev, 1);
- return ret;
- }
-
- return 0;
+ return __netdev_adjacent_dev_link_lists(dev, upper_dev,
+ &dev->adj_list.upper,
+ &upper_dev->adj_list.lower,
+ private, master);
}
static void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev,
struct net_device *upper_dev)
{
- __netdev_adjacent_dev_unlink(dev, upper_dev, 1);
__netdev_adjacent_dev_unlink_lists(dev, upper_dev, 1,
&dev->adj_list.upper,
&upper_dev->adj_list.lower);
@@ -5791,7 +5690,6 @@ static int __netdev_upper_dev_link(struct net_device *dev,
void *upper_priv, void *upper_info)
{
struct netdev_notifier_changeupper_info changeupper_info;
- struct netdev_adjacent *i, *j, *to_i, *to_j;
int ret = 0;
ASSERT_RTNL();
@@ -5800,10 +5698,10 @@ static int __netdev_upper_dev_link(struct net_device *dev,
return -EBUSY;
/* To prevent loops, check if dev is not upper device to upper_dev. */
- if (__netdev_find_adj(dev, &upper_dev->all_adj_list.upper))
+ if (netdev_has_upper_dev(upper_dev, dev))
return -EBUSY;
- if (__netdev_find_adj(upper_dev, &dev->adj_list.upper))
+ if (netdev_has_upper_dev(dev, upper_dev))
return -EEXIST;
if (master && netdev_master_upper_dev_get(dev))
@@ -5825,80 +5723,15 @@ static int __netdev_upper_dev_link(struct net_device *dev,
if (ret)
return ret;
- /* Now that we linked these devs, make all the upper_dev's
- * all_adj_list.upper visible to every dev's all_adj_list.lower an
- * versa, and don't forget the devices itself. All of these
- * links are non-neighbours.
- */
- list_for_each_entry(i, &dev->all_adj_list.lower, list) {
- list_for_each_entry(j, &upper_dev->all_adj_list.upper, list) {
- pr_debug("Interlinking %s with %s, non-neighbour\n",
- i->dev->name, j->dev->name);
- ret = __netdev_adjacent_dev_link(i->dev, j->dev);
- if (ret)
- goto rollback_mesh;
- }
- }
-
- /* add dev to every upper_dev's upper device */
- list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) {
- pr_debug("linking %s's upper device %s with %s\n",
- upper_dev->name, i->dev->name, dev->name);
- ret = __netdev_adjacent_dev_link(dev, i->dev);
- if (ret)
- goto rollback_upper_mesh;
- }
-
- /* add upper_dev to every dev's lower device */
- list_for_each_entry(i, &dev->all_adj_list.lower, list) {
- pr_debug("linking %s's lower device %s with %s\n", dev->name,
- i->dev->name, upper_dev->name);
- ret = __netdev_adjacent_dev_link(i->dev, upper_dev);
- if (ret)
- goto rollback_lower_mesh;
- }
-
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
&changeupper_info.info);
ret = notifier_to_errno(ret);
if (ret)
- goto rollback_lower_mesh;
+ goto rollback;
return 0;
-rollback_lower_mesh:
- to_i = i;
- list_for_each_entry(i, &dev->all_adj_list.lower, list) {
- if (i == to_i)
- break;
- __netdev_adjacent_dev_unlink(i->dev, upper_dev, i->ref_nr);
- }
-
- i = NULL;
-
-rollback_upper_mesh:
- to_i = i;
- list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) {
- if (i == to_i)
- break;
- __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
- }
-
- i = j = NULL;
-
-rollback_mesh:
- to_i = i;
- to_j = j;
- list_for_each_entry(i, &dev->all_adj_list.lower, list) {
- list_for_each_entry(j, &upper_dev->all_adj_list.upper, list) {
- if (i == to_i && j == to_j)
- break;
- __netdev_adjacent_dev_unlink(i->dev, j->dev, i->ref_nr);
- }
- if (i == to_i)
- break;
- }
-
+rollback:
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
return ret;
@@ -5955,7 +5788,6 @@ void netdev_upper_dev_unlink(struct net_device *dev,
struct net_device *upper_dev)
{
struct netdev_notifier_changeupper_info changeupper_info;
- struct netdev_adjacent *i, *j;
ASSERT_RTNL();
changeupper_info.upper_dev = upper_dev;
@@ -5967,23 +5799,6 @@ void netdev_upper_dev_unlink(struct net_device *dev,
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
- /* Here is the tricky part. We must remove all dev's lower
- * devices from all upper_dev's upper devices and vice
- * versa, to maintain the graph relationship.
- */
- list_for_each_entry(i, &dev->all_adj_list.lower, list)
- list_for_each_entry(j, &upper_dev->all_adj_list.upper, list)
- __netdev_adjacent_dev_unlink(i->dev, j->dev, i->ref_nr);
-
- /* remove also the devices itself from lower/upper device
- * list
- */
- list_for_each_entry(i, &dev->all_adj_list.lower, list)
- __netdev_adjacent_dev_unlink(i->dev, upper_dev, i->ref_nr);
-
- list_for_each_entry(i, &upper_dev->all_adj_list.upper, list)
- __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
-
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
&changeupper_info.info);
}
@@ -7685,8 +7500,6 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
INIT_LIST_HEAD(&dev->link_watch_list);
INIT_LIST_HEAD(&dev->adj_list.upper);
INIT_LIST_HEAD(&dev->adj_list.lower);
- INIT_LIST_HEAD(&dev->all_adj_list.upper);
- INIT_LIST_HEAD(&dev->all_adj_list.lower);
INIT_LIST_HEAD(&dev->ptype_all);
INIT_LIST_HEAD(&dev->ptype_specific);
#ifdef CONFIG_NET_SCHED
--
2.1.4
^ permalink raw reply related
* [PATCH net-next 08/11] rocker: Flip to the new dev walk API
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri, netdev, davem
Cc: dledford, sean.hefty, hal.rosenstock, linux-rdma, j.vosburgh,
vfalico, andy, jeffrey.t.kirsher, intel-wired-lan, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa@cumulusnetworks.com>
Convert rocker to the new dev walk API. This is just a code conversion;
no functional change is intended.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
drivers/net/ethernet/rocker/rocker_main.c | 31 ++++++++++++++++++++++++-------
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 5424fb341613..9310adc0bcbb 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -2839,20 +2839,37 @@ static bool rocker_port_dev_check_under(const struct net_device *dev,
return true;
}
+struct rocker_walk_data {
+ struct rocker *rocker;
+ struct rocker_port *port;
+};
+
+static int rocker_lower_dev_walk(struct net_device *lower_dev, void *_data)
+{
+ struct rocker_walk_data *data = (struct rocker_walk_data *)_data;
+ int ret = 0;
+
+ if (rocker_port_dev_check_under(lower_dev, data->rocker)) {
+ data->port = netdev_priv(lower_dev);
+ ret = 1;
+ }
+
+ return ret;
+}
+
struct rocker_port *rocker_port_dev_lower_find(struct net_device *dev,
struct rocker *rocker)
{
- struct net_device *lower_dev;
- struct list_head *iter;
+ struct rocker_walk_data data;
if (rocker_port_dev_check_under(dev, rocker))
return netdev_priv(dev);
- netdev_for_each_all_lower_dev(dev, lower_dev, iter) {
- if (rocker_port_dev_check_under(lower_dev, rocker))
- return netdev_priv(lower_dev);
- }
- return NULL;
+ data.rocker = rocker;
+ data.port = NULL;
+ netdev_walk_all_lower_dev(dev, rocker_lower_dev_walk, &data);
+
+ return data.port;
}
static int rocker_netdevice_event(struct notifier_block *unused,
--
2.1.4
^ permalink raw reply related
* [PATCH net-next 07/11] mlxsw: Flip to the new dev walk API
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Convert mlxsw users to new dev walk API. This is just a code conversion;
no functional change is intended.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 37 ++++++++++++++++----------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 43a5eddc2c11..99805fd3d110 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3092,19 +3092,30 @@ static bool mlxsw_sp_port_dev_check(const struct net_device *dev)
return dev->netdev_ops == &mlxsw_sp_port_netdev_ops;
}
+static int mlxsw_lower_dev_walk(struct net_device *lower_dev, void *data)
+{
+ struct mlxsw_sp_port **port = data;
+ int ret = 0;
+
+ if (mlxsw_sp_port_dev_check(lower_dev)) {
+ *port = netdev_priv(lower_dev);
+ ret = 1;
+ }
+
+ return ret;
+}
+
static struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find(struct net_device *dev)
{
- struct net_device *lower_dev;
- struct list_head *iter;
+ struct mlxsw_sp_port *port;
if (mlxsw_sp_port_dev_check(dev))
return netdev_priv(dev);
- netdev_for_each_all_lower_dev(dev, lower_dev, iter) {
- if (mlxsw_sp_port_dev_check(lower_dev))
- return netdev_priv(lower_dev);
- }
- return NULL;
+ port = NULL;
+ netdev_walk_all_lower_dev(dev, mlxsw_lower_dev_walk, &port);
+
+ return port;
}
static struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev)
@@ -3117,17 +3128,15 @@ static struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev)
static struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find_rcu(struct net_device *dev)
{
- struct net_device *lower_dev;
- struct list_head *iter;
+ struct mlxsw_sp_port *port;
if (mlxsw_sp_port_dev_check(dev))
return netdev_priv(dev);
- netdev_for_each_all_lower_dev_rcu(dev, lower_dev, iter) {
- if (mlxsw_sp_port_dev_check(lower_dev))
- return netdev_priv(lower_dev);
- }
- return NULL;
+ port = NULL;
+ netdev_walk_all_lower_dev_rcu(dev, mlxsw_lower_dev_walk, &port);
+
+ return port;
}
struct mlxsw_sp_port *mlxsw_sp_port_lower_dev_hold(struct net_device *dev)
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 06/11] ixgbe: Flip to the new dev walk API
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Convert ixgbe users to new dev walk API. This is just a code conversion;
no functional change is intended.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 132 ++++++++++++++++----------
1 file changed, 82 insertions(+), 50 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 784b0b98ab2f..f380fda11eb6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5012,24 +5012,23 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev,
return err;
}
-static void ixgbe_configure_dfwd(struct ixgbe_adapter *adapter)
+static int ixgbe_upper_dev_walk(struct net_device *upper, void *data)
{
- struct net_device *upper;
- struct list_head *iter;
- int err;
-
- netdev_for_each_all_upper_dev_rcu(adapter->netdev, upper, iter) {
- if (netif_is_macvlan(upper)) {
- struct macvlan_dev *dfwd = netdev_priv(upper);
- struct ixgbe_fwd_adapter *vadapter = dfwd->fwd_priv;
+ if (netif_is_macvlan(upper)) {
+ struct macvlan_dev *dfwd = netdev_priv(upper);
+ struct ixgbe_fwd_adapter *vadapter = dfwd->fwd_priv;
- if (dfwd->fwd_priv) {
- err = ixgbe_fwd_ring_up(upper, vadapter);
- if (err)
- continue;
- }
- }
+ if (dfwd->fwd_priv)
+ ixgbe_fwd_ring_up(upper, vadapter);
}
+
+ return 0;
+}
+
+static void ixgbe_configure_dfwd(struct ixgbe_adapter *adapter)
+{
+ netdev_walk_all_upper_dev_rcu(adapter->netdev,
+ ixgbe_upper_dev_walk, NULL);
}
static void ixgbe_configure(struct ixgbe_adapter *adapter)
@@ -5448,12 +5447,25 @@ static void ixgbe_fdir_filter_exit(struct ixgbe_adapter *adapter)
spin_unlock(&adapter->fdir_perfect_lock);
}
+static int ixgbe_disable_macvlan(struct net_device *upper, void *data)
+{
+ if (netif_is_macvlan(upper)) {
+ struct macvlan_dev *vlan = netdev_priv(upper);
+
+ if (vlan->fwd_priv) {
+ netif_tx_stop_all_queues(upper);
+ netif_carrier_off(upper);
+ netif_tx_disable(upper);
+ }
+ }
+
+ return 0;
+}
+
void ixgbe_down(struct ixgbe_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
struct ixgbe_hw *hw = &adapter->hw;
- struct net_device *upper;
- struct list_head *iter;
int i;
/* signal that we are down to the interrupt handler */
@@ -5477,17 +5489,8 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
netif_tx_disable(netdev);
/* disable any upper devices */
- netdev_for_each_all_upper_dev_rcu(adapter->netdev, upper, iter) {
- if (netif_is_macvlan(upper)) {
- struct macvlan_dev *vlan = netdev_priv(upper);
-
- if (vlan->fwd_priv) {
- netif_tx_stop_all_queues(upper);
- netif_carrier_off(upper);
- netif_tx_disable(upper);
- }
- }
- }
+ netdev_walk_all_upper_dev_rcu(adapter->netdev,
+ ixgbe_disable_macvlan, NULL);
ixgbe_irq_disable(adapter);
@@ -6728,6 +6731,18 @@ static void ixgbe_update_default_up(struct ixgbe_adapter *adapter)
#endif
}
+static int ixgbe_enable_macvlan(struct net_device *upper, void *data)
+{
+ if (netif_is_macvlan(upper)) {
+ struct macvlan_dev *vlan = netdev_priv(upper);
+
+ if (vlan->fwd_priv)
+ netif_tx_wake_all_queues(upper);
+ }
+
+ return 0;
+}
+
/**
* ixgbe_watchdog_link_is_up - update netif_carrier status and
* print link up message
@@ -6737,8 +6752,6 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
struct ixgbe_hw *hw = &adapter->hw;
- struct net_device *upper;
- struct list_head *iter;
u32 link_speed = adapter->link_speed;
const char *speed_str;
bool flow_rx, flow_tx;
@@ -6809,14 +6822,8 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
/* enable any upper devices */
rtnl_lock();
- netdev_for_each_all_upper_dev_rcu(adapter->netdev, upper, iter) {
- if (netif_is_macvlan(upper)) {
- struct macvlan_dev *vlan = netdev_priv(upper);
-
- if (vlan->fwd_priv)
- netif_tx_wake_all_queues(upper);
- }
- }
+ netdev_walk_all_upper_dev_rcu(adapter->netdev,
+ ixgbe_enable_macvlan, NULL);
rtnl_unlock();
/* update the default user priority for VFs */
@@ -8350,12 +8357,38 @@ static int ixgbe_configure_clsu32_del_hnode(struct ixgbe_adapter *adapter,
}
#ifdef CONFIG_NET_CLS_ACT
+struct upper_walk_data {
+ struct ixgbe_adapter *adapter;
+ u64 action;
+ int ifindex;
+ u8 queue;
+};
+
+static int get_macvlan_queue(struct net_device *upper, void *_data)
+{
+ if (netif_is_macvlan(upper)) {
+ struct macvlan_dev *dfwd = netdev_priv(upper);
+ struct ixgbe_fwd_adapter *vadapter = dfwd->fwd_priv;
+ struct upper_walk_data *data = _data;
+ struct ixgbe_adapter *adapter = data->adapter;
+ int ifindex = data->ifindex;
+
+ if (vadapter && vadapter->netdev->ifindex == ifindex) {
+ data->queue = adapter->rx_ring[vadapter->rx_base_queue]->reg_idx;
+ data->action = data->queue;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
static int handle_redirect_action(struct ixgbe_adapter *adapter, int ifindex,
u8 *queue, u64 *action)
{
unsigned int num_vfs = adapter->num_vfs, vf;
+ struct upper_walk_data data;
struct net_device *upper;
- struct list_head *iter;
/* redirect to a SRIOV VF */
for (vf = 0; vf < num_vfs; ++vf) {
@@ -8373,17 +8406,16 @@ static int handle_redirect_action(struct ixgbe_adapter *adapter, int ifindex,
}
/* redirect to a offloaded macvlan netdev */
- netdev_for_each_all_upper_dev_rcu(adapter->netdev, upper, iter) {
- if (netif_is_macvlan(upper)) {
- struct macvlan_dev *dfwd = netdev_priv(upper);
- struct ixgbe_fwd_adapter *vadapter = dfwd->fwd_priv;
-
- if (vadapter && vadapter->netdev->ifindex == ifindex) {
- *queue = adapter->rx_ring[vadapter->rx_base_queue]->reg_idx;
- *action = *queue;
- return 0;
- }
- }
+ data.adapter = adapter;
+ data.ifindex = ifindex;
+ data.action = 0;
+ data.queue = 0;
+ if (netdev_walk_all_upper_dev_rcu(adapter->netdev,
+ get_macvlan_queue, &data)) {
+ *action = data.action;
+ *queue = data.queue;
+
+ return 0;
}
return -EINVAL;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 05/11] IB/ipoib: Flip to new dev walk API
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Convert ipoib_get_net_dev_match_addr to the new upper device walk API.
This is just a code conversion; no functional change is intended.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 37 +++++++++++++++++++++----------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 5636fc3da6b8..624855ab7205 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -292,6 +292,25 @@ static struct net_device *ipoib_get_master_net_dev(struct net_device *dev)
return dev;
}
+struct ipoib_walk_data {
+ const struct sockaddr *addr;
+ struct net_device *result;
+};
+
+static int ipoib_upper_walk(struct net_device *upper, void *_data)
+{
+ struct ipoib_walk_data *data = (struct ipoib_walk_data *)_data;
+ int ret = 0;
+
+ if (ipoib_is_dev_match_addr_rcu(data->addr, upper)) {
+ dev_hold(upper);
+ data->result = upper;
+ ret = 1;
+ }
+
+ return ret;
+}
+
/**
* Find a net_device matching the given address, which is an upper device of
* the given net_device.
@@ -304,27 +323,21 @@ static struct net_device *ipoib_get_master_net_dev(struct net_device *dev)
static struct net_device *ipoib_get_net_dev_match_addr(
const struct sockaddr *addr, struct net_device *dev)
{
- struct net_device *upper,
- *result = NULL;
- struct list_head *iter;
+ struct ipoib_walk_data data = {
+ .addr = addr,
+ };
rcu_read_lock();
if (ipoib_is_dev_match_addr_rcu(addr, dev)) {
dev_hold(dev);
- result = dev;
+ data.result = dev;
goto out;
}
- netdev_for_each_all_upper_dev_rcu(dev, upper, iter) {
- if (ipoib_is_dev_match_addr_rcu(addr, upper)) {
- dev_hold(upper);
- result = upper;
- break;
- }
- }
+ netdev_walk_all_upper_dev_rcu(dev, ipoib_upper_walk, &data);
out:
rcu_read_unlock();
- return result;
+ return data.result;
}
/* returns the number of IPoIB netdevs on top a given ipoib device matching a
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 04/11] IB/core: Flip to the new dev walk API
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri, netdev, davem
Cc: dledford, sean.hefty, hal.rosenstock, linux-rdma, j.vosburgh,
vfalico, andy, jeffrey.t.kirsher, intel-wired-lan, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa@cumulusnetworks.com>
Convert rdma_is_upper_dev_rcu, handle_netdev_upper and
ipoib_get_net_dev_match_addr to the new upper device walk API.
This is just a code conversion; no functional change is intended.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
drivers/infiniband/core/core_priv.h | 9 +------
drivers/infiniband/core/roce_gid_mgmt.c | 42 ++++++++++++++++++---------------
2 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index 19d499dcab76..0c0bea091de8 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -127,14 +127,7 @@ void ib_cache_release_one(struct ib_device *device);
static inline bool rdma_is_upper_dev_rcu(struct net_device *dev,
struct net_device *upper)
{
- struct net_device *_upper = NULL;
- struct list_head *iter;
-
- netdev_for_each_all_upper_dev_rcu(dev, _upper, iter)
- if (_upper == upper)
- break;
-
- return _upper == upper;
+ return netdev_has_upper_dev_all_rcu(dev, upper);
}
int addr_init(void);
diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c
index 06556c34606d..db759a68d948 100644
--- a/drivers/infiniband/core/roce_gid_mgmt.c
+++ b/drivers/infiniband/core/roce_gid_mgmt.c
@@ -437,6 +437,28 @@ static void callback_for_addr_gid_device_scan(struct ib_device *device,
&parsed->gid_attr);
}
+struct upper_list {
+ struct list_head list;
+ struct net_device *upper;
+};
+
+static int netdev_upper_walk(struct net_device *upper, void *data)
+{
+ struct upper_list *entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
+ struct list_head *upper_list = (struct list_head *)data;
+
+ if (!entry) {
+ pr_info("roce_gid_mgmt: couldn't allocate entry to delete ndev\n");
+ return 0;
+ }
+
+ list_add_tail(&entry->list, upper_list);
+ dev_hold(upper);
+ entry->upper = upper;
+
+ return 0;
+}
+
static void handle_netdev_upper(struct ib_device *ib_dev, u8 port,
void *cookie,
void (*handle_netdev)(struct ib_device *ib_dev,
@@ -444,30 +466,12 @@ static void handle_netdev_upper(struct ib_device *ib_dev, u8 port,
struct net_device *ndev))
{
struct net_device *ndev = (struct net_device *)cookie;
- struct upper_list {
- struct list_head list;
- struct net_device *upper;
- };
- struct net_device *upper;
- struct list_head *iter;
struct upper_list *upper_iter;
struct upper_list *upper_temp;
LIST_HEAD(upper_list);
rcu_read_lock();
- netdev_for_each_all_upper_dev_rcu(ndev, upper, iter) {
- struct upper_list *entry = kmalloc(sizeof(*entry),
- GFP_ATOMIC);
-
- if (!entry) {
- pr_info("roce_gid_mgmt: couldn't allocate entry to delete ndev\n");
- continue;
- }
-
- list_add_tail(&entry->list, &upper_list);
- dev_hold(upper);
- entry->upper = upper;
- }
+ netdev_walk_all_upper_dev_rcu(ndev, netdev_upper_walk, &upper_list);
rcu_read_unlock();
handle_netdev(ib_dev, port, ndev);
--
2.1.4
^ permalink raw reply related
* [PATCH net-next 03/11] net: bonding: Flip to the new dev walk API
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Convert alb_send_learning_packets and bond_has_this_ip to use the new
netdev_walk_all_upper_dev_rcu API. In both cases this is just a code
conversion; no functional change is intended.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
drivers/net/bonding/bond_alb.c | 82 ++++++++++++++++++++++++++---------------
drivers/net/bonding/bond_main.c | 21 +++++++----
2 files changed, 65 insertions(+), 38 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 551f0f8dead3..1ddedec61900 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -950,13 +950,61 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
dev_queue_xmit(skb);
}
+struct alb_walk_data {
+ struct bonding *bond;
+ struct slave *slave;
+ u8 *mac_addr;
+ bool strict_match;
+};
+
+static int alb_upper_dev_walk(struct net_device *upper, void *data)
+{
+ struct alb_walk_data *_data = (struct alb_walk_data *)data;
+ bool strict_match = _data->strict_match;
+ struct bonding *bond = _data->bond;
+ struct slave *slave = _data->slave;
+ u8 *mac_addr = _data->mac_addr;
+ struct bond_vlan_tag *tags;
+
+ if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) {
+ if (strict_match &&
+ ether_addr_equal_64bits(mac_addr,
+ upper->dev_addr)) {
+ alb_send_lp_vid(slave, mac_addr,
+ vlan_dev_vlan_proto(upper),
+ vlan_dev_vlan_id(upper));
+ } else if (!strict_match) {
+ alb_send_lp_vid(slave, upper->dev_addr,
+ vlan_dev_vlan_proto(upper),
+ vlan_dev_vlan_id(upper));
+ }
+ }
+
+ /* If this is a macvlan device, then only send updates
+ * when strict_match is turned off.
+ */
+ if (netif_is_macvlan(upper) && !strict_match) {
+ tags = bond_verify_device_path(bond->dev, upper, 0);
+ if (IS_ERR_OR_NULL(tags))
+ BUG();
+ alb_send_lp_vid(slave, upper->dev_addr,
+ tags[0].vlan_proto, tags[0].vlan_id);
+ kfree(tags);
+ }
+
+ return 0;
+}
+
static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[],
bool strict_match)
{
struct bonding *bond = bond_get_bond_by_slave(slave);
- struct net_device *upper;
- struct list_head *iter;
- struct bond_vlan_tag *tags;
+ struct alb_walk_data data = {
+ .strict_match = strict_match,
+ .mac_addr = mac_addr,
+ .slave = slave,
+ .bond = bond,
+ };
/* send untagged */
alb_send_lp_vid(slave, mac_addr, 0, 0);
@@ -965,33 +1013,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[],
* for that device.
*/
rcu_read_lock();
- netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) {
- if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) {
- if (strict_match &&
- ether_addr_equal_64bits(mac_addr,
- upper->dev_addr)) {
- alb_send_lp_vid(slave, mac_addr,
- vlan_dev_vlan_proto(upper),
- vlan_dev_vlan_id(upper));
- } else if (!strict_match) {
- alb_send_lp_vid(slave, upper->dev_addr,
- vlan_dev_vlan_proto(upper),
- vlan_dev_vlan_id(upper));
- }
- }
-
- /* If this is a macvlan device, then only send updates
- * when strict_match is turned off.
- */
- if (netif_is_macvlan(upper) && !strict_match) {
- tags = bond_verify_device_path(bond->dev, upper, 0);
- if (IS_ERR_OR_NULL(tags))
- BUG();
- alb_send_lp_vid(slave, upper->dev_addr,
- tags[0].vlan_proto, tags[0].vlan_id);
- kfree(tags);
- }
- }
+ netdev_walk_all_upper_dev_rcu(bond->dev, alb_upper_dev_walk, &data);
rcu_read_unlock();
}
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5fa36ebc0640..89191b019178 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2270,22 +2270,27 @@ static void bond_mii_monitor(struct work_struct *work)
}
}
+static int bond_upper_dev_walk(struct net_device *upper, void *data)
+{
+ __be32 ip = *((__be32 *)data);
+ int ret = 0;
+
+ if (ip == bond_confirm_addr(upper, 0, ip))
+ ret = 1;
+
+ return ret;
+}
+
static bool bond_has_this_ip(struct bonding *bond, __be32 ip)
{
- struct net_device *upper;
- struct list_head *iter;
bool ret = false;
if (ip == bond_confirm_addr(bond->dev, 0, ip))
return true;
rcu_read_lock();
- netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) {
- if (ip == bond_confirm_addr(upper, 0, ip)) {
- ret = true;
- break;
- }
- }
+ if (netdev_walk_all_upper_dev_rcu(bond->dev, bond_upper_dev_walk, &ip))
+ ret = true;
rcu_read_unlock();
return ret;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 02/11] net: Introduce new api for walking upper and lower devices
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
This patch introduces netdev_walk_all_upper_dev_rcu,
netdev_walk_all_lower_dev and netdev_walk_all_lower_dev_rcu. These
functions recursively walk the adj_list of devices to determine all upper
and lower devices.
The functions take a callback function that is invoked for each device
in the list. If the callback returns non-0, the walk is terminated and
the functions return that code back to callers.
v2
- fixed definition of netdev_next_lower_dev_rcu to mirror the upper_dev
version.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
include/linux/netdevice.h | 17 +++++
net/core/dev.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 178 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index bf341b65ca5e..a5902d995907 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3778,6 +3778,14 @@ struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
updev; \
updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)))
+int netdev_walk_all_upper_dev_rcu(struct net_device *dev,
+ int (*fn)(struct net_device *upper_dev,
+ void *data),
+ void *data);
+
+bool netdev_has_upper_dev_all_rcu(struct net_device *dev,
+ struct net_device *upper_dev);
+
void *netdev_lower_get_next_private(struct net_device *dev,
struct list_head **iter);
void *netdev_lower_get_next_private_rcu(struct net_device *dev,
@@ -3821,6 +3829,15 @@ struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
ldev; \
ldev = netdev_all_lower_get_next_rcu(dev, &(iter)))
+int netdev_walk_all_lower_dev(struct net_device *dev,
+ int (*fn)(struct net_device *lower_dev,
+ void *data),
+ void *data);
+int netdev_walk_all_lower_dev_rcu(struct net_device *dev,
+ int (*fn)(struct net_device *lower_dev,
+ void *data),
+ void *data);
+
void *netdev_adjacent_get_private(struct list_head *adj_list);
void *netdev_lower_get_first_private_rcu(struct net_device *dev);
struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
diff --git a/net/core/dev.c b/net/core/dev.c
index 5399af8fdac0..1780f94ed25f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5156,6 +5156,37 @@ bool netdev_has_upper_dev(struct net_device *dev,
EXPORT_SYMBOL(netdev_has_upper_dev);
/**
+ * netdev_has_upper_dev_all - Check if device is linked to an upper device
+ * @dev: device
+ * @upper_dev: upper device to check
+ *
+ * Find out if a device is linked to specified upper device and return true
+ * in case it is. Note that this checks the entire upper device chain.
+ * The caller must hold rcu lock.
+ */
+
+static int __netdev_has_upper_dev(struct net_device *upper_dev, void *data)
+{
+ struct net_device *dev = (struct net_device *)data;
+
+ if (upper_dev == dev)
+ return 1;
+
+ return 0;
+}
+
+bool netdev_has_upper_dev_all_rcu(struct net_device *dev,
+ struct net_device *upper_dev)
+{
+ if (netdev_walk_all_upper_dev_rcu(dev, __netdev_has_upper_dev,
+ upper_dev))
+ return true;
+
+ return false;
+}
+EXPORT_SYMBOL(netdev_has_upper_dev_all_rcu);
+
+/**
* netdev_has_any_upper_dev - Check if device is linked to some device
* @dev: device
*
@@ -5255,6 +5286,51 @@ struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
}
EXPORT_SYMBOL(netdev_all_upper_get_next_dev_rcu);
+static struct net_device *netdev_next_upper_dev_rcu(struct net_device *dev,
+ struct list_head **iter)
+{
+ struct netdev_adjacent *upper;
+
+ WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());
+
+ upper = list_entry_rcu((*iter)->next, struct netdev_adjacent, list);
+
+ if (&upper->list == &dev->adj_list.upper)
+ return NULL;
+
+ *iter = &upper->list;
+
+ return upper->dev;
+}
+
+int netdev_walk_all_upper_dev_rcu(struct net_device *dev,
+ int (*fn)(struct net_device *dev,
+ void *data),
+ void *data)
+{
+ struct net_device *udev;
+ struct list_head *iter;
+ int ret;
+
+ for (iter = &dev->adj_list.upper,
+ udev = netdev_next_upper_dev_rcu(dev, &iter);
+ udev;
+ udev = netdev_next_upper_dev_rcu(dev, &iter)) {
+ /* first is the upper device itself */
+ ret = fn(udev, data);
+ if (ret)
+ return ret;
+
+ /* then look at all of its upper devices */
+ ret = netdev_walk_all_upper_dev_rcu(udev, fn, data);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(netdev_walk_all_upper_dev_rcu);
+
/**
* netdev_lower_get_next_private - Get the next ->private from the
* lower neighbour list
@@ -5361,6 +5437,49 @@ struct net_device *netdev_all_lower_get_next(struct net_device *dev, struct list
}
EXPORT_SYMBOL(netdev_all_lower_get_next);
+static struct net_device *netdev_next_lower_dev(struct net_device *dev,
+ struct list_head **iter)
+{
+ struct netdev_adjacent *lower;
+
+ lower = list_entry(*iter, struct netdev_adjacent, list);
+
+ if (&lower->list == &dev->adj_list.lower)
+ return NULL;
+
+ *iter = lower->list.next;
+
+ return lower->dev;
+}
+
+int netdev_walk_all_lower_dev(struct net_device *dev,
+ int (*fn)(struct net_device *dev,
+ void *data),
+ void *data)
+{
+ struct net_device *ldev;
+ struct list_head *iter;
+ int ret;
+
+ for (iter = &dev->adj_list.lower,
+ ldev = netdev_next_lower_dev(dev, &iter);
+ ldev;
+ ldev = netdev_next_lower_dev(dev, &iter)) {
+ /* first is the lower device itself */
+ ret = fn(ldev, data);
+ if (ret)
+ return ret;
+
+ /* then look at all of its lower devices */
+ ret = netdev_walk_all_lower_dev(ldev, fn, data);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(netdev_walk_all_lower_dev);
+
/**
* netdev_all_lower_get_next_rcu - Get the next device from all
* lower neighbour list, RCU variant
@@ -5382,6 +5501,48 @@ struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
}
EXPORT_SYMBOL(netdev_all_lower_get_next_rcu);
+static struct net_device *netdev_next_lower_dev_rcu(struct net_device *dev,
+ struct list_head **iter)
+{
+ struct netdev_adjacent *lower;
+
+ lower = list_entry_rcu((*iter)->next, struct netdev_adjacent, list);
+ if (&lower->list == &dev->adj_list.lower)
+ return NULL;
+
+ *iter = &lower->list;
+
+ return lower->dev;
+}
+
+int netdev_walk_all_lower_dev_rcu(struct net_device *dev,
+ int (*fn)(struct net_device *dev,
+ void *data),
+ void *data)
+{
+ struct net_device *ldev;
+ struct list_head *iter;
+ int ret;
+
+ for (iter = &dev->adj_list.lower,
+ ldev = netdev_next_lower_dev_rcu(dev, &iter);
+ ldev;
+ ldev = netdev_next_lower_dev_rcu(dev, &iter)) {
+ /* first is the lower device itself */
+ ret = fn(ldev, data);
+ if (ret)
+ return ret;
+
+ /* then look at all of its lower devices */
+ ret = netdev_walk_all_lower_dev_rcu(ldev, fn, data);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(netdev_walk_all_lower_dev_rcu);
+
/**
* netdev_lower_get_first_private_rcu - Get the first ->private from the
* lower neighbour list, RCU
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 01/11] net: Remove refnr arg when inserting link adjacencies
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A, David Ahern
In-Reply-To: <1476494931-31813-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Commit 93409033ae65 ("net: Add netdev all_adj_list refcnt propagation to
fix panic") propagated the refnr to insert and remove functions tracking
the netdev adjacency graph. However, for the insert path the refnr can
only be 1. Accordingly, remove the refnr argument to make that clear.
ie., the refnr arg in 93409033ae65 was only needed for the remove path.
Signed-off-by: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
---
net/core/dev.c | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 6498cc2ba8f6..5399af8fdac0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5453,7 +5453,6 @@ static inline bool netdev_adjacent_is_neigh_list(struct net_device *dev,
static int __netdev_adjacent_dev_insert(struct net_device *dev,
struct net_device *adj_dev,
- u16 ref_nr,
struct list_head *dev_list,
void *private, bool master)
{
@@ -5463,7 +5462,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
adj = __netdev_find_adj(adj_dev, dev_list);
if (adj) {
- adj->ref_nr += ref_nr;
+ adj->ref_nr += 1;
return 0;
}
@@ -5473,7 +5472,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
adj->dev = adj_dev;
adj->master = master;
- adj->ref_nr = ref_nr;
+ adj->ref_nr = 1;
adj->private = private;
dev_hold(adj_dev);
@@ -5547,22 +5546,21 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev,
static int __netdev_adjacent_dev_link_lists(struct net_device *dev,
struct net_device *upper_dev,
- u16 ref_nr,
struct list_head *up_list,
struct list_head *down_list,
void *private, bool master)
{
int ret;
- ret = __netdev_adjacent_dev_insert(dev, upper_dev, ref_nr, up_list,
+ ret = __netdev_adjacent_dev_insert(dev, upper_dev, up_list,
private, master);
if (ret)
return ret;
- ret = __netdev_adjacent_dev_insert(upper_dev, dev, ref_nr, down_list,
+ ret = __netdev_adjacent_dev_insert(upper_dev, dev, down_list,
private, false);
if (ret) {
- __netdev_adjacent_dev_remove(dev, upper_dev, ref_nr, up_list);
+ __netdev_adjacent_dev_remove(dev, upper_dev, 1, up_list);
return ret;
}
@@ -5570,10 +5568,9 @@ static int __netdev_adjacent_dev_link_lists(struct net_device *dev,
}
static int __netdev_adjacent_dev_link(struct net_device *dev,
- struct net_device *upper_dev,
- u16 ref_nr)
+ struct net_device *upper_dev)
{
- return __netdev_adjacent_dev_link_lists(dev, upper_dev, ref_nr,
+ return __netdev_adjacent_dev_link_lists(dev, upper_dev,
&dev->all_adj_list.upper,
&upper_dev->all_adj_list.lower,
NULL, false);
@@ -5602,12 +5599,12 @@ static int __netdev_adjacent_dev_link_neighbour(struct net_device *dev,
struct net_device *upper_dev,
void *private, bool master)
{
- int ret = __netdev_adjacent_dev_link(dev, upper_dev, 1);
+ int ret = __netdev_adjacent_dev_link(dev, upper_dev);
if (ret)
return ret;
- ret = __netdev_adjacent_dev_link_lists(dev, upper_dev, 1,
+ ret = __netdev_adjacent_dev_link_lists(dev, upper_dev,
&dev->adj_list.upper,
&upper_dev->adj_list.lower,
private, master);
@@ -5676,7 +5673,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
list_for_each_entry(j, &upper_dev->all_adj_list.upper, list) {
pr_debug("Interlinking %s with %s, non-neighbour\n",
i->dev->name, j->dev->name);
- ret = __netdev_adjacent_dev_link(i->dev, j->dev, i->ref_nr);
+ ret = __netdev_adjacent_dev_link(i->dev, j->dev);
if (ret)
goto rollback_mesh;
}
@@ -5686,7 +5683,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) {
pr_debug("linking %s's upper device %s with %s\n",
upper_dev->name, i->dev->name, dev->name);
- ret = __netdev_adjacent_dev_link(dev, i->dev, i->ref_nr);
+ ret = __netdev_adjacent_dev_link(dev, i->dev);
if (ret)
goto rollback_upper_mesh;
}
@@ -5695,7 +5692,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
list_for_each_entry(i, &dev->all_adj_list.lower, list) {
pr_debug("linking %s's lower device %s with %s\n", dev->name,
i->dev->name, upper_dev->name);
- ret = __netdev_adjacent_dev_link(i->dev, upper_dev, i->ref_nr);
+ ret = __netdev_adjacent_dev_link(i->dev, upper_dev);
if (ret)
goto rollback_lower_mesh;
}
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH v2 net-next 00/11] net: Fix netdev adjacency tracking
From: David Ahern @ 2016-10-15 1:28 UTC (permalink / raw)
To: jiri, netdev, davem
Cc: dledford, sean.hefty, hal.rosenstock, linux-rdma, j.vosburgh,
vfalico, andy, jeffrey.t.kirsher, intel-wired-lan, David Ahern
The netdev adjacency tracking is failing to create proper dependencies
for some topologies. For example this topology
+--------+
| myvrf |
+--------+
| |
| +---------+
| | macvlan |
| +---------+
| |
+----------+
| bridge |
+----------+
|
+--------+
| bond1 |
+--------+
|
+--------+
| eth3 |
+--------+
hits 1 of 2 problems depending on the order of enslavement. The base set of
commands for both cases:
ip link add bond1 type bond
ip link set bond1 up
ip link set eth3 down
ip link set eth3 master bond1
ip link set eth3 up
ip link add bridge type bridge
ip link set bridge up
ip link add macvlan link bridge type macvlan
ip link set macvlan up
ip link add myvrf type vrf table 1234
ip link set myvrf up
ip link set bridge master myvrf
Case 1 enslave macvlan to the vrf before enslaving the bond to the bridge:
ip link set macvlan master myvrf
ip link set bond1 master bridge
Attempts to delete the VRF:
ip link delete myvrf
trigger the BUG in __netdev_adjacent_dev_remove:
[ 587.405260] tried to remove device eth3 from myvrf
[ 587.407269] ------------[ cut here ]------------
[ 587.408918] kernel BUG at /home/dsa/kernel.git/net/core/dev.c:5661!
[ 587.411113] invalid opcode: 0000 [#1] SMP
[ 587.412454] Modules linked in: macvlan bridge stp llc bonding vrf
[ 587.414765] CPU: 0 PID: 726 Comm: ip Not tainted 4.8.0+ #109
[ 587.416766] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[ 587.420241] task: ffff88013ab6eec0 task.stack: ffffc90000628000
[ 587.422163] RIP: 0010:[<ffffffff813cef03>] [<ffffffff813cef03>] __netdev_adjacent_dev_remove+0x40/0x12c
...
[ 587.446053] Call Trace:
[ 587.446424] [<ffffffff813d1542>] __netdev_adjacent_dev_unlink+0x20/0x3c
[ 587.447390] [<ffffffff813d16a3>] netdev_upper_dev_unlink+0xfa/0x15e
[ 587.448297] [<ffffffffa00003a3>] vrf_del_slave+0x13/0x2a [vrf]
[ 587.449153] [<ffffffffa00004a4>] vrf_dev_uninit+0xea/0x114 [vrf]
[ 587.450036] [<ffffffff813d19b0>] rollback_registered_many+0x22b/0x2da
[ 587.450974] [<ffffffff813d1aac>] unregister_netdevice_many+0x17/0x48
[ 587.451903] [<ffffffff813de444>] rtnl_delete_link+0x3c/0x43
[ 587.452719] [<ffffffff813dedcd>] rtnl_dellink+0x180/0x194
When the BUG is converted to a WARN_ON it shows 4 missing adjacencies:
eth3 - myvrf, mvrf - eth3, bond1 - myvrf and myvrf - bond1
All of those are because the __netdev_upper_dev_link function does not
properly link macvlan lower devices to myvrf when it is enslaved.
The second case just flips the ordering of the enslavements:
ip link set bond1 master bridge
ip link set macvlan master myvrf
Then run:
ip link delete bond1
ip link delete myvrf
The vrf delete command hangs because myvrf has a reference that has not
been released. In this case the removal code does not account for 2 paths
between eth3 and myvrf - one from bridge to vrf and the other through the
macvlan.
Rather than try to maintain a linked list of all upper and lower devices
per netdevice, only track the direct neighbors. The remaining stack can
be determined by recursively walking the neighbors.
The existing netdev_for_each_all_upper_dev_rcu,
netdev_for_each_all_lower_dev and netdev_for_each_all_lower_dev_rcu macros
are replaced with APIs that walk the upper and lower device lists. The
new APIs take a callback function and a data arg that is passed to the
callback for each device in the list. Drivers using the old macros are
converted in separate patches to make it easier on reviewers. It is an
API conversion only; no functional change is intended.
DaveM: Given the impact of this bug (both cases requiring a reboot) I
would like to get this backported to at least the 4.8 tree which as I
understand it has been targeted as the next LTS.
v2
- fixed bond0 references in cover-letter
- fixed definition of netdev_next_lower_dev_rcu to mirror the upper_dev
version.
David Ahern (11):
net: Remove refnr arg when inserting link adjacencies
net: Introduce new api for walking upper and lower devices
net: bonding: Flip to the new dev walk API
IB/core: Flip to the new dev walk API
IB/ipoib: Flip to new dev walk API
ixgbe: Flip to the new dev walk API
mlxsw: Flip to the new dev walk API
rocker: Flip to the new dev walk API
net: Remove all_adj_list and its references
net: Add warning if any lower device is still in adjacency list
net: dev: Improve debug statements for adjacency tracking
drivers/infiniband/core/core_priv.h | 9 +-
drivers/infiniband/core/roce_gid_mgmt.c | 42 +--
drivers/infiniband/ulp/ipoib/ipoib_main.c | 37 ++-
drivers/net/bonding/bond_alb.c | 82 +++---
drivers/net/bonding/bond_main.c | 21 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 132 +++++----
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 37 ++-
drivers/net/ethernet/rocker/rocker_main.c | 31 ++-
include/linux/netdevice.h | 38 ++-
net/core/dev.c | 356 ++++++++++++-------------
10 files changed, 433 insertions(+), 352 deletions(-)
--
2.1.4
^ permalink raw reply
* Re: [PATCH rdma-core 4/4] glue/redhat/spec: build split rpm packages
From: Jason Gunthorpe @ 2016-10-14 23:39 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161014192136.11731-5-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Fri, Oct 14, 2016 at 03:21:36PM -0400, Jarod Wilson wrote:
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/iwpmd-11-1.el7.x86_64.rpm
FC used to call this libiwpm for some reason..
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libibcm-11-1.el7.x86_64.rpm
Do you want to try and do as I did with debian and put the SONAME data
into the package version for the libraries? eg
libibcm1_1.0.11-1_amd64.deb
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libcxgb3-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libcxgb4-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libhfi1-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libi40iw-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libipathverbs-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libmlx4-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libmlx5-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libmthca-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libnes-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libocrdma-11-1.el7.x86_64.rpm
> Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/librxe-11-1.el7.x86_64.rpm
Does this mean RH is not going to do a single package for the
providers? You know another 5 or so are coming..
Any feedback if things build on your supported arches? I'd be
interested to see compiler log if it isn't silent.
> +install -D -m0644 Documentation/{ibacm,ibsrpdm,libibcm,libibverbs,librdmacm,rxe}.md %{buildroot}/%{_docdir}/%{name}-%{version}/
> +install -D -m0644 README.md %{buildroot}/%{_docdir}/%{name}-%{version}/
I guess README should go in that patch I sent you..
> +%{buildroot}/%{_bindir}/ib_acme -D . -O
> +# Fixup a multilib conflict in ibacm_opts.cfg:
> +sed -i -e '/^# Specifies the directory of the provider libraries$/ a\
> +# Use /usr/lib64/ibacm on 64bit, /usr/lib/libacm on 32bit.
> +' -e 's%^\(# provider_lib_path
> /usr/\)lib\(64\)\?/ibacm$%\1lib64/ibacm%' ibacm_opts.cfg
Hum? I'm pretty sure this is basically fixed in the code now, was done here
5eebdb9baaaae420a4bb16e586a96807823916a0
Adjusting the comment like that doesn't really make sense, the acm
daemon has a fixed endianness and looks in a single place to load the
plugin. If someone wants to use 32 bit plugins they have to install
the 32 bit acm daemon, which would have the 32 bit path in the sample
conf file...
> +install -D -m0644 ibacm/man/*.1 %{buildroot}/%{_mandir}/man1/
> +install -D -m0644 ibacm/man/*.7 %{buildroot}/%{_mandir}/man7/
> +sed -e 's|@ACM_PROVIDER_DIR@|%{libdir}/%{name}/|g' -e 's|@CMAKE_INSTALL_FULL_LOCALSTATEDIR@|%{_localstatedir}|g' ibacm/man/ibacm_prov.7.in > %{buildroot}/%{_mandir}/man7/ibacm_prov.7
?? cmake is supposed to install these.. Looks like it works. What did
you need done here to open code it?
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH rdma-core 2/4] glue/redhat: add udev/systemd/etc infrastructure bits
From: Jason Gunthorpe @ 2016-10-14 23:19 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford
In-Reply-To: <20161014192136.11731-3-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Fri, Oct 14, 2016 at 03:21:34PM -0400, Jarod Wilson wrote:
> Red Hat has been shipping an "rdma" package, as well as it's own systemd
> unit files for some daemons for a while now, in both Fedora and Red Hat
> Enterprise Linux. Some of these are fairly RH-specific, but might be of
> use to others, so we'd like to move them into the upstream source tree.
We have a directory called 'debian', so lets just have one called
'redhat'..
The below comments are my view on what we should try and move into
common cross-distro locations..
Common stuff should be installed via cmake
> diff --git a/glue/redhat/ibacm.service b/glue/redhat/ibacm.service
> new file mode 100644
> index 0000000..1cd031a
> +++ b/glue/redhat/ibacm.service
Can we just put this in ibacm/ ?
> +Requires=rdma.service
> +After=rdma.service opensm.service
This is the only RH specific thiing I see.. Could we standardize on
something here and use it on all distros? rdma-available.target?
> +++ b/glue/redhat/iwpmd.service
> @@ -0,0 +1,12 @@
> +[Unit]
> +Description=Starts the IWPMD daemon
> +Documentation=file:///usr/share/doc/iwpmd/README
File does not exit? There is a man page now
We already have a iwpmd/iwpmd.service that is almost identical, can you
you just update it and drop this version?
> +++ b/glue/redhat/rdma.cxgb3.sys.modprobe
> @@ -0,0 +1 @@
> +install cxgb3 /sbin/modprobe --ignore-install cxgb3 $CMDLINE_OPTS && /sbin/modprobe iw_cxgb3
> diff --git a/glue/redhat/rdma.cxgb4.sys.modprobe b/glue/redhat/rdma.cxgb4.sys.modprobe
> new file mode 100644
> index 0000000..44163ab
> +++ b/glue/redhat/rdma.cxgb4.sys.modprobe
> @@ -0,0 +1 @@
> +install cxgb4 /sbin/modprobe --ignore-install cxgb4 $CMDLINE_OPTS && /sbin/modprobe iw_cxgb4
What are these for? Should they be cross distro? Why are only a few
drivers this special?
> +++ b/glue/redhat/rdma.fixup-mtrr.awk
> @@ -0,0 +1,160 @@
> +# This is a simple script that checks the contents of /proc/mtrr to see if
> +# the BIOS maker for the computer took the easy way out in terms of
> +# specifying memory regions when there is a hole below 4GB for PCI access
> +# and the machine has 4GB or more of RAM. When the contents of /proc/mtrr
> +# show a 4GB mapping of write-back cached RAM, minus punch out hole(s) of
> +# uncacheable regions (the area reserved for PCI access), then it becomes
> +# impossible for the ib_ipath driver to set write_combining on its PIO
> +# buffers. To correct the problem, remap the lower memory region in various
> +# chunks up to the start of the punch out hole(s), then delete the punch out
> +# hole(s) entirely as they aren't needed any more. That way, ib_ipath will
> +# be able to set write_combining on its PIO memory access region.
Yuk, a thousand times yuk.
I thought the mtrr cleanup built into modern kernel took care of this?
Really though, this needs to be fixed upstream in the kernel :|
> diff --git a/glue/redhat/rdma.kernel-init b/glue/redhat/rdma.kernel-init
> new file mode 100644
> index 0000000..6cb4732
> +++ b/glue/redhat/rdma.kernel-init
I wonder if this could be split into a generic 'load the modules' part
and a distro specific part? Every distro needs systemd to load the
extra modules because out auto-loading is broken - IMHO, and that is
pretty complex unfortunately.
> +errata_58()
> +{
> + # Check AMD chipset issue Errata #58
> + if test -x /sbin/lspci && test -x /sbin/setpci; then
> + if ( /sbin/lspci -nd 1022:1100 | grep "1100" > /dev/null ) &&
> + ( /sbin/lspci -nd 1022:7450 | grep "7450" > /dev/null ) &&
> + ( /sbin/lspci -nd 15b3:5a46 | grep "5a46" > /dev/null ); then
> + CURVAL=`/sbin/setpci -d 1022:1100 69`
Another yuk. Why isn't this handled upstream in drivers/pci/quirks.c
with the rest of the 8131 errata?
Fortunately I expect all 8131 hardware is long since gone, that chip
was end-of-manufacturing'd very quickly 2003ish IIRC.
> +++ b/glue/redhat/rdma.service
> @@ -0,0 +1,15 @@
> +[Unit]
> +Description=Initialize the iWARP/InfiniBand/RDMA stack in the kernel
> +Documentation=file:/etc/rdma/rdma.conf
> +RefuseManualStop=true
> +DefaultDependencies=false
> +Conflicts=emergency.target emergency.service
> +Before=network.target remote-fs-pre.target
This is an area we really need to cross-distro standardize - we really
need a set of rdma-*.targets.
eg
rdma-available.target
- RDMA hardware is available and all prep is done
opensm (if installed) is started, etc
Use in place of rdma.service
rdma-detected.target
- udev detected rdma hardware
> +++ b/glue/redhat/rdma.udev-ipoib-naming.rules
> @@ -0,0 +1,13 @@
> +# This is a sample udev rules file that demonstrates how to get udev to
> +# set the name of IPoIB interfaces to whatever you wish. There is a
> +# 16 character limit on network device names though, so don't go too nuts
> +#
> +# Important items to note: ATTR{type}=="32" is IPoIB interfaces, and the
> +# ATTR{address} match must start with ?* and only reference the last 8
> +# bytes of the address or else the address might not match on any given
> +# start of the IPoIB stack
> +#
> +# Note: as of rhel7, udev is case sensitive on the address field match
> +# and all addresses need to be in lower case.
> +#
> +# ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="?*00:02:c9:03:00:31:78:f2", NAME="mlx4_ib3"
This should be a cross distro file.
> +++ b/glue/redhat/rdma.udev-rules
> @@ -0,0 +1,18 @@
> +# We list all the various kernel modules that drive hardware in the
> +# InfiniBand stack (and a few in the network stack that might not actually
> +# be RDMA capable, but we don't know that at this time and it's safe to
> +# enable the IB stack, so do so unilaterally) and on load of any of that
> +# hardware, we trigger the rdma.service load in systemd
> +
> +SUBSYSTEM=="module", KERNEL=="cxgb*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
> +SUBSYSTEM=="module", KERNEL=="ib_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
> +SUBSYSTEM=="module", KERNEL=="mlx*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
> +SUBSYSTEM=="module", KERNEL=="iw_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
> +SUBSYSTEM=="module", KERNEL=="be2net", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
> +SUBSYSTEM=="module", KERNEL=="enic", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
Also cross distro
> +# When we detect a new verbs device is added to the system, set the node
> +# description on that device
> +# If rdma-ndd is installed, defer the setting of the node description to it.
> +SUBSYSTEM=="infiniband", KERNEL=="*", ACTION=="add", TEST!="/usr/sbin/rdma-ndd", RUN+="/bin/bash -c 'sleep 1; echo -n `hostname -s` %k > /sys/class/infiniband/%k/node_desc'"
Shouldn't this udev drop-in by in the rdma-ndd package?
> +++ b/glue/redhat/srp_daemon.service
> @@ -0,0 +1,17 @@
> +[Unit]
> +Description=Start or stop the daemon that attaches to SRP devices
> +Documentation=file:///etc/rdma/rdma.conf file:///etc/srp_daemon.conf
> +DefaultDependencies=false
> +Conflicts=emergency.target emergency.service
> +Requires=rdma.service
> +Wants=opensm.service
> +After=rdma.service opensm.service
> +After=network.target
> +Before=remote-fs-pre.target
Also should be common, why does it reference opensm.service?
> +
> +[Service]
> +Type=simple
> +ExecStart=/usr/sbin/srp_daemon.sh
Hurm, someday we have to make better systemd integration for these
daemons..
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH rdma-core 1/4] rpm spec: install documentation too
From: Jason Gunthorpe @ 2016-10-14 22:52 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161014192136.11731-2-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Fri, Oct 14, 2016 at 03:21:33PM -0400, Jarod Wilson wrote:
> At least in the Red Hat world, we like to install the documentation files
> provided in a given source tree.
I think other distros would like to do this too, can you use this
patch instead?
>From a23838ccc05574b1975741770abcbd66f7587293 Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Fri, 14 Oct 2016 15:21:33 -0400
Subject: [PATCH] Install end user focused documentation files
We recommend that all distros ship these.
Suggested-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 3 ++-
Documentation/CMakeLists.txt | 8 ++++++++
debian/ibacm.install | 1 +
debian/ibverbs-providers.install | 1 +
debian/libibcm1.install | 1 +
debian/libibverbs1.install | 1 +
debian/librdmacm1.install | 1 +
debian/srptools.install | 1 +
rdma-core.spec | 4 +++-
9 files changed, 19 insertions(+), 2 deletions(-)
create mode 100644 Documentation/CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a23aa860e6d3f2..6d2960e22b77b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@
# Use the historical search path for providers, in the standard system library.
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
-project(RDMA C)
+project(rdma-core C)
# CMake likes to use -rdynamic too much, they fixed it in 3.4.
if(POLICY CMP0065)
@@ -321,6 +321,7 @@ configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOT
# Sub-directories
add_subdirectory(ccan)
add_subdirectory(util)
+add_subdirectory(Documentation)
# Libraries
add_subdirectory(libibumad)
add_subdirectory(libibumad/man)
diff --git a/Documentation/CMakeLists.txt b/Documentation/CMakeLists.txt
new file mode 100644
index 00000000000000..619b8587f11f11
--- /dev/null
+++ b/Documentation/CMakeLists.txt
@@ -0,0 +1,8 @@
+install(FILES
+ ibacm.md
+ ibsrpdm.md
+ libibcm.md
+ libibverbs.md
+ librdmacm.md
+ rxe.md
+ DESTINATION "${CMAKE_INSTALL_DOCDIR}")
diff --git a/debian/ibacm.install b/debian/ibacm.install
index 2bb9591c051dbe..f2a6c53eb79d02 100644
--- a/debian/ibacm.install
+++ b/debian/ibacm.install
@@ -8,3 +8,4 @@ usr/share/man/man1/ib_acme.1
usr/share/man/man1/ibacm.1
usr/share/man/man7/ibacm.7
usr/share/man/man7/ibacm_prov.7
+usr/share/doc/rdma-core/ibacm.md usr/share/doc/ibacm/
diff --git a/debian/ibverbs-providers.install b/debian/ibverbs-providers.install
index 1b4121874b2cc1..7458540b37714d 100644
--- a/debian/ibverbs-providers.install
+++ b/debian/ibverbs-providers.install
@@ -5,3 +5,4 @@ usr/lib/truescale-serdes.cmds
usr/share/man/man8/rxe_cfg.8
usr/share/man/man7/rxe.7
usr/bin/rxe_cfg
+usr/share/doc/rdma-core/rxe.md usr/share/doc/ibverbs-providers/
diff --git a/debian/libibcm1.install b/debian/libibcm1.install
index 6f270b7f3bfac3..a0ace6ebf2eac3 100644
--- a/debian/libibcm1.install
+++ b/debian/libibcm1.install
@@ -1 +1,2 @@
usr/lib/*/libibcm*.so.*
+usr/share/doc/rdma-core/libibcm.md usr/share/doc/libibcm1/
diff --git a/debian/libibverbs1.install b/debian/libibverbs1.install
index 78a7f76d39c3e4..83bdd802b48d5c 100644
--- a/debian/libibverbs1.install
+++ b/debian/libibverbs1.install
@@ -1 +1,2 @@
usr/lib/*/libibverbs*.so.*
+usr/share/doc/rdma-core/libibverbs.md usr/share/doc/libibverbs1/
diff --git a/debian/librdmacm1.install b/debian/librdmacm1.install
index c17048e6e46307..09140ab84de7dc 100644
--- a/debian/librdmacm1.install
+++ b/debian/librdmacm1.install
@@ -1,2 +1,3 @@
usr/lib/*/librdmacm*.so.*
usr/lib/*/rsocket/librspreload*.so*
+usr/share/doc/rdma-core/librdmacm.md usr/share/doc/librdmacm1/
diff --git a/debian/srptools.install b/debian/srptools.install
index 17b909d721a978..9c0701526e3cd8 100644
--- a/debian/srptools.install
+++ b/debian/srptools.install
@@ -6,3 +6,4 @@ usr/sbin/ibsrpdm
usr/sbin/srp_daemon
usr/share/man/man1/ibsrpdm.1
usr/share/man/man1/srp_daemon.1
+usr/share/doc/rdma-core/ibsrpdm.md usr/share/doc/srptools/
diff --git a/rdma-core.spec b/rdma-core.spec
index 96c86fe06f3ae9..47b7d87e403219 100644
--- a/rdma-core.spec
+++ b/rdma-core.spec
@@ -85,7 +85,8 @@ This is a simple example without the split sub packages to get things started.
-DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \
-DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=%{my_unitdir} \
-DCMAKE_INSTALL_INITDDIR:PATH=%{_initrddir} \
- -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir}
+ -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \
+ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version}
%make_jobs
%install
@@ -110,6 +111,7 @@ rm -rf %{buildroot}/%{my_unitdir}/
%{_libdir}/rsocket/*
%{_sbindir}/*
%{_libexecdir}/*
+%{_docdir}/%{name}-%{version}/*
%if 0%{?_unitdir:1}
%{_unitdir}/*
%else
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* RE: [PATCH rdma-core 8/8] Enable -Wshadow
From: Hefty, Sean @ 2016-10-14 22:50 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Christoph Hellwig
In-Reply-To: <1476483257-16308-9-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> Having multiple objects with the same name in the same scope is
> almost always confusing. Make some trivial changes to avoid those
> few cases.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH rdma-core 0/4] rdma-core infrastructure
From: Jason Gunthorpe @ 2016-10-14 22:33 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161014192136.11731-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Fri, Oct 14, 2016 at 03:21:32PM -0400, Jarod Wilson wrote:
> This is a set of patches to make some minor changes to the stock spec file,
> add a bunch of userspace glue that Red Hat has been shipping on it's own in
> Red Hat Enterprise Linux and Fedora for a while now, and a revised split
> package spec file that we're likely to use in at least RHEL, to preserve the
> current packaging split.
Is this just for EL7, or do you plan to keep going this way
indefinitely in EL8 and FC25?
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error
From: Hefty, Sean @ 2016-10-14 22:18 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Christoph Hellwig
In-Reply-To: <1476483257-16308-6-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> The arguments were swapped, and totally crash-when-run wrong.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> ---
Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH rdma-core 1/8] rdmacm: constify rdma_getaddrinfo public function
From: Hefty, Sean @ 2016-10-14 22:18 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Christoph Hellwig
In-Reply-To: <1476483257-16308-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> Like getaddrinfo most of the arguments should be const.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH rdma-core 8/8] Enable -Wshadow
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Having multiple objects with the same name in the same scope is
almost always confusing. Make some trivial changes to avoid those
few cases.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 17 +++++++++++
ibacm/prov/acmp/src/acmp.c | 10 +++----
libibverbs/examples/srq_pingpong.c | 1 -
libibverbs/examples/xsrq_pingpong.c | 6 ++--
libibverbs/verbs.h | 6 ++--
librdmacm/examples/riostream.c | 34 ++++++++++-----------
librdmacm/examples/rstream.c | 50 +++++++++++++++----------------
librdmacm/examples/udpong.c | 60 ++++++++++++++++++-------------------
providers/mthca/cq.c | 2 +-
9 files changed, 101 insertions(+), 85 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f21ba384c12..375859d04914 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,20 @@ RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarati
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WFORMAT_2 "-Wformat=2")
+# At some point after 4.4 gcc fixed shadow to ignore function vs variable
+# conflicts
+set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+ set(CMAKE_REQUIRED_FLAGS "-Wshadow")
+CHECK_C_SOURCE_COMPILES("
+ #include <unistd.h>
+ int main(int argc,const char *argv[]) { int access = 1; return access; }"
+ HAVE_C_WORKING_SHADOW
+ FAIL_REGEX "warning")
+if (HAVE_C_WORKING_SHADOW)
+ RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WORKING_SHADOW "-Wshadow")
+endif()
+set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
+
# At some point around 5.4 gcc fixed missing-field-initializers to ignore this
# common idiom we use extensively. Since this is a useful warning for
# developers try and leave it on if the compiler supports it.
@@ -372,6 +386,9 @@ endif()
if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
message(STATUS " -Wmissing-field-initializers does NOT work")
endif()
+if (NOT HAVE_C_WORKING_SHADOW)
+ message(STATUS " -Wshadow does NOT work")
+endif()
if (NOT HAVE_C_WREDUNDANT_DECLS)
message(STATUS " -Wredundant-decls does NOT work")
endif()
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index fd579dff9d4e..806320ffffd5 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -252,7 +252,7 @@ static struct acm_provider def_prov = {
static DLIST_ENTRY acmp_dev_list;
static lock_t acmp_dev_lock;
-static atomic_t tid;
+static atomic_t g_tid;
static DLIST_ENTRY timeout_list;
static event_t timeout_event;
static atomic_t wait_cnt;
@@ -787,7 +787,7 @@ static void acmp_init_path_query(struct ib_sa_mad *mad)
mad->mgmt_class = IB_MGMT_CLASS_SA;
mad->class_version = 2;
mad->method = IB_METHOD_GET;
- mad->tid = htonll((uint64_t) atomic_inc(&tid));
+ mad->tid = htonll((uint64_t) atomic_inc(&g_tid));
mad->attr_id = IB_SA_ATTR_PATH_REC;
}
@@ -1378,7 +1378,7 @@ static void acmp_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid,
mad->mgmt_class = IB_MGMT_CLASS_SA;
mad->class_version = 2;
mad->method = IB_METHOD_SET;
- mad->tid = htonll((uint64_t) atomic_inc(&tid));
+ mad->tid = htonll((uint64_t) atomic_inc(&g_tid));
mad->attr_id = IB_SA_ATTR_MC_MEMBER_REC;
mad->comp_mask =
IB_COMP_MASK_MC_MGID | IB_COMP_MASK_MC_PORT_GID |
@@ -1703,7 +1703,7 @@ acmp_send_resolve(struct acmp_ep *ep, struct acmp_dest *dest,
mad->class_version = 1;
mad->method = IB_METHOD_GET;
mad->control = ACM_CTRL_RESOLVE;
- mad->tid = htonll((uint64_t) atomic_inc(&tid));
+ mad->tid = htonll((uint64_t) atomic_inc(&g_tid));
rec = (struct acm_resolve_rec *) mad->data;
rec->src_type = (uint8_t) saddr->type;
@@ -2948,7 +2948,7 @@ static void __attribute__((constructor)) acmp_init(void)
acmp_log_options();
- atomic_init(&tid);
+ atomic_init(&g_tid);
atomic_init(&wait_cnt);
DListInit(&acmp_dev_list);
lock_init(&acmp_dev_lock);
diff --git a/libibverbs/examples/srq_pingpong.c b/libibverbs/examples/srq_pingpong.c
index e2993bfdacbf..30d81f0e4f31 100644
--- a/libibverbs/examples/srq_pingpong.c
+++ b/libibverbs/examples/srq_pingpong.c
@@ -770,7 +770,6 @@ int main(int argc, char *argv[])
return 1;
}
} else {
- int i;
for (i = 0; dev_list[i]; ++i)
if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
break;
diff --git a/libibverbs/examples/xsrq_pingpong.c b/libibverbs/examples/xsrq_pingpong.c
index b90f0eb7e27f..5fb8827579dd 100644
--- a/libibverbs/examples/xsrq_pingpong.c
+++ b/libibverbs/examples/xsrq_pingpong.c
@@ -456,13 +456,13 @@ static int recv_remote_dest(int sockfd, int index)
return 0;
}
-static void set_ah_attr(struct ibv_ah_attr *attr, struct pingpong_context *ctx,
+static void set_ah_attr(struct ibv_ah_attr *attr, struct pingpong_context *myctx,
int index)
{
attr->is_global = 1;
attr->grh.hop_limit = 5;
- attr->grh.dgid = ctx->rem_dest[index].gid;
- attr->grh.sgid_index = ctx->gidx;
+ attr->grh.dgid = myctx->rem_dest[index].gid;
+ attr->grh.sgid_index = myctx->gidx;
}
static int connect_qps(int index)
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index e994c21c267f..a2ccaaf141ab 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1459,9 +1459,9 @@ static inline struct verbs_context *verbs_get_ctx(struct ibv_context *ctx)
}
#define verbs_get_ctx_op(ctx, op) ({ \
- struct verbs_context *vctx = verbs_get_ctx(ctx); \
- (!vctx || (vctx->sz < sizeof(*vctx) - offsetof(struct verbs_context, op)) || \
- !vctx->op) ? NULL : vctx; })
+ struct verbs_context *__vctx = verbs_get_ctx(ctx); \
+ (!__vctx || (__vctx->sz < sizeof(*__vctx) - offsetof(struct verbs_context, op)) || \
+ !__vctx->op) ? NULL : __vctx; })
#define verbs_set_ctx_op(_vctx, op, ptr) ({ \
struct verbs_context *vctx = _vctx; \
diff --git a/librdmacm/examples/riostream.c b/librdmacm/examples/riostream.c
index bd8c60cdcb1d..d9e5fd6eb0a6 100644
--- a/librdmacm/examples/riostream.c
+++ b/librdmacm/examples/riostream.c
@@ -317,35 +317,35 @@ out:
return ret;
}
-static void set_options(int rs)
+static void set_options(int fd)
{
int val;
if (buffer_size) {
- rsetsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
+ rsetsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
sizeof buffer_size);
- rsetsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
+ rsetsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
sizeof buffer_size);
} else {
val = 1 << 19;
- rsetsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
- rsetsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
+ rsetsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
+ rsetsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
}
val = 1;
- rsetsockopt(rs, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
- rsetsockopt(rs, SOL_RDMA, RDMA_IOMAPSIZE, (void *) &val, sizeof val);
+ rsetsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
+ rsetsockopt(fd, SOL_RDMA, RDMA_IOMAPSIZE, (void *) &val, sizeof val);
if (flags & MSG_DONTWAIT)
- rfcntl(rs, F_SETFL, O_NONBLOCK);
+ rfcntl(fd, F_SETFL, O_NONBLOCK);
/* Inline size based on experimental data */
if (optimization == opt_latency) {
- rsetsockopt(rs, SOL_RDMA, RDMA_INLINE, &inline_size,
+ rsetsockopt(fd, SOL_RDMA, RDMA_INLINE, &inline_size,
sizeof inline_size);
} else if (optimization == opt_bandwidth) {
val = 0;
- rsetsockopt(rs, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
+ rsetsockopt(fd, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
}
}
@@ -555,10 +555,10 @@ free:
return ret;
}
-static int set_test_opt(char *optarg)
+static int set_test_opt(const char *arg)
{
- if (strlen(optarg) == 1) {
- switch (optarg[0]) {
+ if (strlen(arg) == 1) {
+ switch (arg[0]) {
case 'a':
use_async = 1;
break;
@@ -575,13 +575,13 @@ static int set_test_opt(char *optarg)
return -1;
}
} else {
- if (!strncasecmp("async", optarg, 5)) {
+ if (!strncasecmp("async", arg, 5)) {
use_async = 1;
- } else if (!strncasecmp("block", optarg, 5)) {
+ } else if (!strncasecmp("block", arg, 5)) {
flags = (flags & ~MSG_DONTWAIT) | MSG_WAITALL;
- } else if (!strncasecmp("nonblock", optarg, 8)) {
+ } else if (!strncasecmp("nonblock", arg, 8)) {
flags |= MSG_DONTWAIT;
- } else if (!strncasecmp("verify", optarg, 6)) {
+ } else if (!strncasecmp("verify", arg, 6)) {
verify = 1;
} else {
return -1;
diff --git a/librdmacm/examples/rstream.c b/librdmacm/examples/rstream.c
index 59a0d4351ef5..14799c997128 100644
--- a/librdmacm/examples/rstream.c
+++ b/librdmacm/examples/rstream.c
@@ -255,62 +255,62 @@ out:
return ret;
}
-static void set_keepalive(int rs)
+static void set_keepalive(int fd)
{
int optval;
socklen_t optlen = sizeof(optlen);
optval = 1;
- if (rs_setsockopt(rs, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen)) {
+ if (rs_setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen)) {
perror("rsetsockopt SO_KEEPALIVE");
return;
}
optval = keepalive;
- if (rs_setsockopt(rs, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen))
+ if (rs_setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen))
perror("rsetsockopt TCP_KEEPIDLE");
- if (!(rs_getsockopt(rs, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen)))
+ if (!(rs_getsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen)))
printf("Keepalive: %s\n", (optval ? "ON" : "OFF"));
- if (!(rs_getsockopt(rs, IPPROTO_TCP, TCP_KEEPIDLE, &optval, &optlen)))
+ if (!(rs_getsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &optval, &optlen)))
printf(" time: %i\n", optval);
}
-static void set_options(int rs)
+static void set_options(int fd)
{
int val;
if (buffer_size) {
- rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
+ rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
sizeof buffer_size);
- rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
+ rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
sizeof buffer_size);
} else {
val = 1 << 19;
- rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
- rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
+ rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
+ rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
}
val = 1;
- rs_setsockopt(rs, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
+ rs_setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
if (flags & MSG_DONTWAIT)
- rs_fcntl(rs, F_SETFL, O_NONBLOCK);
+ rs_fcntl(fd, F_SETFL, O_NONBLOCK);
if (use_rs) {
/* Inline size based on experimental data */
if (optimization == opt_latency) {
- rs_setsockopt(rs, SOL_RDMA, RDMA_INLINE, &inline_size,
+ rs_setsockopt(fd, SOL_RDMA, RDMA_INLINE, &inline_size,
sizeof inline_size);
} else if (optimization == opt_bandwidth) {
val = 0;
- rs_setsockopt(rs, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
+ rs_setsockopt(fd, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
}
}
if (keepalive)
- set_keepalive(rs);
+ set_keepalive(fd);
}
static int server_listen(void)
@@ -564,10 +564,10 @@ free:
return ret;
}
-static int set_test_opt(char *optarg)
+static int set_test_opt(const char *arg)
{
- if (strlen(optarg) == 1) {
- switch (optarg[0]) {
+ if (strlen(arg) == 1) {
+ switch (arg[0]) {
case 's':
use_rs = 0;
break;
@@ -594,19 +594,19 @@ static int set_test_opt(char *optarg)
return -1;
}
} else {
- if (!strncasecmp("socket", optarg, 6)) {
+ if (!strncasecmp("socket", arg, 6)) {
use_rs = 0;
- } else if (!strncasecmp("async", optarg, 5)) {
+ } else if (!strncasecmp("async", arg, 5)) {
use_async = 1;
- } else if (!strncasecmp("block", optarg, 5)) {
+ } else if (!strncasecmp("block", arg, 5)) {
flags = (flags & ~MSG_DONTWAIT) | MSG_WAITALL;
- } else if (!strncasecmp("nonblock", optarg, 8)) {
+ } else if (!strncasecmp("nonblock", arg, 8)) {
flags |= MSG_DONTWAIT;
- } else if (!strncasecmp("resolve", optarg, 7)) {
+ } else if (!strncasecmp("resolve", arg, 7)) {
use_rgai = 1;
- } else if (!strncasecmp("verify", optarg, 6)) {
+ } else if (!strncasecmp("verify", arg, 6)) {
verify = 1;
- } else if (!strncasecmp("fork", optarg, 4)) {
+ } else if (!strncasecmp("fork", arg, 4)) {
use_fork = 1;
use_rs = 0;
} else {
diff --git a/librdmacm/examples/udpong.c b/librdmacm/examples/udpong.c
index f8d56073012a..71528f226769 100644
--- a/librdmacm/examples/udpong.c
+++ b/librdmacm/examples/udpong.c
@@ -96,10 +96,10 @@ static char test_name[10] = "custom";
static const char *port = "7174";
static char *dst_addr;
static char *src_addr;
-static union socket_addr addr;
-static socklen_t addrlen;
+static union socket_addr g_addr;
+static socklen_t g_addrlen;
static struct timeval start, end;
-static struct message msg;
+static struct message g_msg;
static void show_perf(void)
{
@@ -109,7 +109,7 @@ static void show_perf(void)
int transfers;
usec = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec);
- transfers = echo ? transfer_count * 2 : ntohl(msg.data);
+ transfers = echo ? transfer_count * 2 : ntohl(g_msg.data);
bytes = (long long) transfers * transfer_size;
/* name size transfers bytes seconds Gb/sec usec/xfer */
@@ -147,23 +147,23 @@ static void init_bandwidth_test(int size)
echo = 0;
}
-static void set_options(int rs)
+static void set_options(int fd)
{
int val;
if (buffer_size) {
- rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
+ rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
sizeof buffer_size);
- rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
+ rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
sizeof buffer_size);
} else {
val = 1 << 19;
- rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
- rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
+ rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
+ rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
}
if (flags & MSG_DONTWAIT)
- rs_fcntl(rs, F_SETFL, O_NONBLOCK);
+ rs_fcntl(fd, F_SETFL, O_NONBLOCK);
}
static ssize_t svr_send(struct message *msg, size_t size,
@@ -296,12 +296,12 @@ static int svr_run(void)
ret = svr_bind();
while (!ret) {
- addrlen = sizeof addr;
- len = svr_recv(&msg, sizeof msg, &addr, &addrlen);
+ g_addrlen = sizeof g_addr;
+ len = svr_recv(&g_msg, sizeof g_msg, &g_addr, &g_addrlen);
if (len < 0)
return len;
- ret = svr_process(&msg, len, &addr, addrlen);
+ ret = svr_process(&g_msg, len, &g_addr, g_addrlen);
}
return ret;
}
@@ -375,22 +375,22 @@ static int run_test(void)
{
int ret, i;
- msg.op = msg_op_start;
- ret = client_send_recv(&msg, CTRL_MSG_SIZE, 1000);
+ g_msg.op = msg_op_start;
+ ret = client_send_recv(&g_msg, CTRL_MSG_SIZE, 1000);
if (ret != CTRL_MSG_SIZE)
goto out;
- msg.op = echo ? msg_op_echo : msg_op_data;
+ g_msg.op = echo ? msg_op_echo : msg_op_data;
gettimeofday(&start, NULL);
for (i = 0; i < transfer_count; i++) {
- ret = echo ? client_send_recv(&msg, transfer_size, 1) :
- client_send(&msg, transfer_size);
+ ret = echo ? client_send_recv(&g_msg, transfer_size, 1) :
+ client_send(&g_msg, transfer_size);
if (ret != transfer_size)
goto out;
}
- msg.op = msg_op_end;
- ret = client_send_recv(&msg, CTRL_MSG_SIZE, 1);
+ g_msg.op = msg_op_end;
+ ret = client_send_recv(&g_msg, CTRL_MSG_SIZE, 1);
if (ret != CTRL_MSG_SIZE)
goto out;
@@ -430,8 +430,8 @@ static int client_connect(void)
goto out;
}
- msg.op = msg_op_login;
- ret = client_send_recv(&msg, CTRL_MSG_SIZE, 1000);
+ g_msg.op = msg_op_login;
+ ret = client_send_recv(&g_msg, CTRL_MSG_SIZE, 1000);
if (ret == CTRL_MSG_SIZE)
ret = 0;
@@ -468,10 +468,10 @@ static int client_run(void)
return ret;
}
-static int set_test_opt(char *optarg)
+static int set_test_opt(const char *arg)
{
- if (strlen(optarg) == 1) {
- switch (optarg[0]) {
+ if (strlen(arg) == 1) {
+ switch (arg[0]) {
case 's':
use_rs = 0;
break;
@@ -491,15 +491,15 @@ static int set_test_opt(char *optarg)
return -1;
}
} else {
- if (!strncasecmp("socket", optarg, 6)) {
+ if (!strncasecmp("socket", arg, 6)) {
use_rs = 0;
- } else if (!strncasecmp("async", optarg, 5)) {
+ } else if (!strncasecmp("async", arg, 5)) {
use_async = 1;
- } else if (!strncasecmp("block", optarg, 5)) {
+ } else if (!strncasecmp("block", arg, 5)) {
flags = 0;
- } else if (!strncasecmp("nonblock", optarg, 8)) {
+ } else if (!strncasecmp("nonblock", arg, 8)) {
flags = MSG_DONTWAIT;
- } else if (!strncasecmp("echo", optarg, 4)) {
+ } else if (!strncasecmp("echo", arg, 4)) {
echo = 1;
} else {
return -1;
diff --git a/providers/mthca/cq.c b/providers/mthca/cq.c
index d71d430c6e28..aa08e065f275 100644
--- a/providers/mthca/cq.c
+++ b/providers/mthca/cq.c
@@ -294,7 +294,6 @@ static inline int mthca_poll_one(struct mthca_cq *cq,
struct mthca_cqe *cqe;
struct mthca_srq *srq;
uint32_t qpn;
- uint32_t wqe;
int wqe_index;
int is_error;
int is_send;
@@ -339,6 +338,7 @@ static inline int mthca_poll_one(struct mthca_cq *cq,
wqe_index = ((ntohl(cqe->wqe) - (*cur_qp)->send_wqe_offset) >> wq->wqe_shift);
wc->wr_id = (*cur_qp)->wrid[wqe_index + (*cur_qp)->rq.max];
} else if ((*cur_qp)->ibv_qp.srq) {
+ uint32_t wqe;
srq = to_msrq((*cur_qp)->ibv_qp.srq);
wqe = htonl(cqe->wqe);
wq = NULL;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 7/8] Enable -Wformat=2
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
This is useful to detect functions that are handling format strings but
not marked with __attribute__(format), as well as other sorts
for format related mistakes.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd58a7039618..8f21ba384c12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,7 @@ RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WARNINGS
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_PROTOTYPES "-Wmissing-prototypes")
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarations")
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WFORMAT_2 "-Wformat=2")
# At some point around 5.4 gcc fixed missing-field-initializers to ignore this
# common idiom we use extensively. Since this is a useful warning for
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 6/8] acm: Fix format string usage with acm_log
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Enable format string checking for acm_write and clean up everything.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
ibacm/include/infiniband/acm_prov.h | 3 ++-
ibacm/prov/acmp/src/acmp.c | 26 ++++++++++++++------------
ibacm/src/acm.c | 15 ++++++++-------
3 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/ibacm/include/infiniband/acm_prov.h b/ibacm/include/infiniband/acm_prov.h
index 00baf582b74e..adfcf8162b8c 100644
--- a/ibacm/include/infiniband/acm_prov.h
+++ b/ibacm/include/infiniband/acm_prov.h
@@ -85,7 +85,8 @@ int provider_query(struct acm_provider **info, uint32_t *version);
/* Functions exported from core */
#define acm_log(level, format, ...) \
acm_write(level, "%s: "format, __func__, ## __VA_ARGS__)
-extern void acm_write(int level, const char *format, ...);
+extern void acm_write(int level, const char *format, ...)
+ __attribute__((format(printf, 2, 3)));
extern void acm_format_name(int level, char *name, size_t name_size,
uint8_t addr_type, const uint8_t *addr, size_t addr_size);
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index 9ec7db44b0d1..fd579dff9d4e 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -55,6 +55,7 @@
#include <netinet/in.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
+#include <inttypes.h>
#include "acm_util.h"
#include "acm_mad.h"
@@ -383,7 +384,7 @@ acmp_acquire_dest(struct acmp_ep *ep, uint8_t addr_type, const uint8_t *addr)
acmp_remove_dest(ep, dest);
dest = NULL;
} else {
- acm_log(2, "Record valid for the next %ld minute(s)\n",
+ acm_log(2, "Record valid for the next %" PRId64 " minute(s)\n",
rec_expr_minutes);
}
}
@@ -411,7 +412,7 @@ static struct acmp_request *acmp_alloc_req(uint64_t id, struct acm_msg *msg)
req->id = id;
memcpy(&req->msg, msg, sizeof(req->msg));
- acm_log(2, "id %llu, req %p\n", id, req);
+ acm_log(2, "id %" PRIu64 ", req %p\n", id, req);
return req;
}
@@ -935,7 +936,7 @@ acmp_resolve_response(uint64_t id, struct acm_msg *req_msg,
{
struct acm_msg msg;
- acm_log(2, "client %lld, status 0x%x\n", id, status);
+ acm_log(2, "client %" PRIu64 ", status 0x%x\n", id, status);
memset(&msg, 0, sizeof msg);
if (dest) {
@@ -981,7 +982,7 @@ acmp_complete_queued_req(struct acmp_dest *dest, uint8_t status)
req = container_of(entry, struct acmp_request, entry);
lock_release(&dest->lock);
- acm_log(2, "completing request, client %d\n", req->id);
+ acm_log(2, "completing request, client %" PRIu64 "\n", req->id);
acmp_resolve_response(req->id, &req->msg, dest, status);
acmp_free_req(req);
@@ -1016,7 +1017,8 @@ acmp_dest_sa_resp(struct acm_sa_mad *mad)
acmp_init_path_av(dest->ep->port, dest);
dest->addr_timeout = time_stamp_min() + (unsigned) addr_timeout;
dest->route_timeout = time_stamp_min() + (unsigned) route_timeout;
- acm_log(2, "timeout addr %llu route %llu\n", dest->addr_timeout, dest->route_timeout);
+ acm_log(2, "timeout addr %" PRIu64 " route %" PRIu64 "\n",
+ dest->addr_timeout, dest->route_timeout);
dest->state = ACMP_READY;
} else {
dest->state = ACMP_INIT;
@@ -1726,7 +1728,7 @@ static uint8_t acmp_queue_req(struct acmp_dest *dest, uint64_t id, struct acm_ms
{
struct acmp_request *req;
- acm_log(2, "id %llu\n", id);
+ acm_log(2, "id %" PRIu64 "\n", id);
req = acmp_alloc_req(id, msg);
if (!req) {
return ACM_STATUS_ENOMEM;
@@ -2446,8 +2448,8 @@ static struct acmp_port *acmp_get_port(struct acm_endpoint *endpoint)
struct acmp_device *dev;
DLIST_ENTRY *dev_entry;
- acm_log(1, "dev 0x%llx port %d pkey 0x%x\n",
- endpoint->port->dev->dev_guid, endpoint->port->port_num,
+ acm_log(1, "dev 0x%" PRIx64 " port %d pkey 0x%x\n",
+ endpoint->port->dev->dev_guid, endpoint->port->port_num,
endpoint->pkey);
for (dev_entry = acmp_dev_list.Next; dev_entry != &acmp_dev_list;
dev_entry = dev_entry->Next) {
@@ -2466,7 +2468,7 @@ acmp_get_ep(struct acmp_port *port, struct acm_endpoint *endpoint)
struct acmp_ep *ep;
DLIST_ENTRY *entry;
- acm_log(1, "dev 0x%llx port %d pkey 0x%x\n",
+ acm_log(1, "dev 0x%" PRIx64 " port %d pkey 0x%x\n",
endpoint->port->dev->dev_guid, endpoint->port->port_num, endpoint->pkey);
for (entry = port->ep_list.Next; entry != &port->ep_list;
entry = entry->Next) {
@@ -2769,7 +2771,7 @@ static int acmp_open_dev(const struct acm_device *device, void **dev_context)
DLIST_ENTRY *dev_entry;
struct ibv_context *verbs;
- acm_log(1, "dev_guid 0x%llx %s\n", device->dev_guid,
+ acm_log(1, "dev_guid 0x%" PRIx64 " %s\n", device->dev_guid,
device->verbs->device->name);
for (dev_entry = acmp_dev_list.Next; dev_entry != &acmp_dev_list;
@@ -2777,7 +2779,7 @@ static int acmp_open_dev(const struct acm_device *device, void **dev_context)
dev = container_of(dev_entry, struct acmp_device, entry);
if (dev->guid == device->dev_guid) {
- acm_log(2, "dev_guid 0x%llx already exits\n",
+ acm_log(2, "dev_guid 0x%" PRIx64 " already exits\n",
device->dev_guid);
*dev_context = dev;
dev->device = device;
@@ -2859,7 +2861,7 @@ static void acmp_close_dev(void *dev_context)
{
struct acmp_device *dev = dev_context;
- acm_log(1, "dev_guid 0x%llx\n", dev->device->dev_guid);
+ acm_log(1, "dev_guid 0x%" PRIx64 "\n", dev->device->dev_guid);
dev->device = NULL;
}
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index 523b78082ff8..befe94203dd3 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -62,6 +62,7 @@
#include <rdma/ib_user_sa.h>
#endif
#include <poll.h>
+#include <inttypes.h>
#include "acm_mad.h"
#include "acm_util.h"
#ifdef HAVE_NETLINK
@@ -1471,7 +1472,7 @@ static int acm_nl_parse_path_attr(struct nlattr *attr,
case LS_NLA_TYPE_SERVICE_ID:
sid = (uint64_t *) NLA_DATA(attr);
if (NLA_LEN(attr) == sizeof(*sid)) {
- acm_log(2, "service_id 0x%llx\n", *sid);
+ acm_log(2, "service_id 0x%" PRIx64 "\n", *sid);
path->service_id = htonll(*sid);
} else {
ret = -1;
@@ -2207,7 +2208,7 @@ static void acm_port_get_gid_tbl(struct acmc_port *port)
&port->gid_tbl[j]);
if (ret || !port->gid_tbl[j].global.interface_id)
break;
- acm_log(2, "guid %d: 0x%llx %llx\n", j,
+ acm_log(2, "guid %d: 0x%" PRIx64 " %" PRIx64 "\n", j,
port->gid_tbl[j].global.subnet_prefix,
port->gid_tbl[j].global.interface_id);
}
@@ -2577,8 +2578,8 @@ static void acm_load_prov_config(void)
continue;
}
prefix = strtoull(p, NULL, 0);
- acm_log(2, "provider %s subnet_prefix 0x%llx\n", prov_name,
- prefix);
+ acm_log(2, "provider %s subnet_prefix 0x%" PRIx64 "\n",
+ prov_name, prefix);
/* Convert it into network byte order */
prefix = htonll(prefix);
@@ -2667,8 +2668,8 @@ static int acm_open_providers(void)
if (version != ACM_PROV_VERSION ||
provider->size != sizeof(struct acm_provider)) {
- acm_log(0, "Error -unmatched provider version 0x%08x (size %d)"
- " core 0x%08x (size %d)\n", version, provider->size,
+ acm_log(0, "Error -unmatched provider version 0x%08x (size %zd)"
+ " core 0x%08x (size %zd)\n", version, provider->size,
ACM_PROV_VERSION, sizeof(struct acm_provider));
dlclose(handle);
continue;
@@ -2863,7 +2864,7 @@ static void acmc_recv_mad(struct acmc_port *port)
}
hdr = &resp.sa_mad.mad_hdr;
- acm_log(2, "bv %x cls %x cv %x mtd %x st %d tid %llx at %x atm %x\n",
+ acm_log(2, "bv %x cls %x cv %x mtd %x st %d tid %" PRIx64 "x at %x atm %x\n",
hdr->base_version, hdr->mgmt_class, hdr->class_version,
hdr->method, hdr->status, hdr->tid, hdr->attr_id, hdr->attr_mod);
found = 0;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
The arguments were swapped, and totally crash-when-run wrong.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
ibacm/src/acm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index e512939dd765..523b78082ff8 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -2483,7 +2483,7 @@ static void acm_open_dev(struct ibv_device *ibdev)
ret = ibv_query_device(verbs, &attr);
if (ret) {
- acm_log(0, "ERROR - ibv_query_device (%s) %d\n", ret, ibdev->name);
+ acm_log(0, "ERROR - ibv_query_device (%d) %s\n", ret, ibdev->name);
goto err1;
}
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox