Skip to content

Commit 97e5c94

Browse files
TaeheeYoogregkh
authored andcommitted
net: export netdev_next_lower_dev_rcu()
[ Upstream commit 7151aff ] netdev_next_lower_dev_rcu() will be used to implement a function, which is to walk all lower interfaces. There are already functions that they walk their lower interface. (netdev_walk_all_lower_dev_rcu, netdev_walk_all_lower_dev()). But, there would be cases that couldn't be covered by given netdev_walk_all_lower_dev_{rcu}() function. So, some modules would want to implement own function, which is to walk all lower interfaces. In the next patch, netdev_next_lower_dev_rcu() will be used. In addition, this patch removes two unused prototypes in netdevice.h. Signed-off-by: Taehee Yoo <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d59a701 commit 97e5c94

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

include/linux/netdevice.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ void netdev_set_default_ethtool_ops(struct net_device *dev,
7272
#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
7373
#define NET_RX_DROP 1 /* packet dropped */
7474

75+
#define MAX_NEST_DEV 8
76+
7577
/*
7678
* Transmit return codes: transmit return codes originate from three different
7779
* namespaces:
@@ -4294,11 +4296,8 @@ void *netdev_lower_get_next(struct net_device *dev,
42944296
ldev; \
42954297
ldev = netdev_lower_get_next(dev, &(iter)))
42964298

4297-
struct net_device *netdev_all_lower_get_next(struct net_device *dev,
4299+
struct net_device *netdev_next_lower_dev_rcu(struct net_device *dev,
42984300
struct list_head **iter);
4299-
struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
4300-
struct list_head **iter);
4301-
43024301
int netdev_walk_all_lower_dev(struct net_device *dev,
43034302
int (*fn)(struct net_device *lower_dev,
43044303
void *data),

net/core/dev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@
146146
#include "net-sysfs.h"
147147

148148
#define MAX_GRO_SKBS 8
149-
#define MAX_NEST_DEV 8
150149

151150
/* This should be increased if a protocol with a bigger head is added. */
152151
#define GRO_MAX_HEAD (MAX_HEADER + 128)
@@ -6914,8 +6913,8 @@ static int __netdev_walk_all_lower_dev(struct net_device *dev,
69146913
return 0;
69156914
}
69166915

6917-
static struct net_device *netdev_next_lower_dev_rcu(struct net_device *dev,
6918-
struct list_head **iter)
6916+
struct net_device *netdev_next_lower_dev_rcu(struct net_device *dev,
6917+
struct list_head **iter)
69196918
{
69206919
struct netdev_adjacent *lower;
69216920

@@ -6927,6 +6926,7 @@ static struct net_device *netdev_next_lower_dev_rcu(struct net_device *dev,
69276926

69286927
return lower->dev;
69296928
}
6929+
EXPORT_SYMBOL(netdev_next_lower_dev_rcu);
69306930

69316931
static u8 __netdev_upper_depth(struct net_device *dev)
69326932
{

0 commit comments

Comments
 (0)