* linux-next: Signed-off-by missing for commits in the net tree
From: Stephen Rothwell @ 2018-09-30 1:04 UTC (permalink / raw)
To: David Miller, Networking
Cc: Linux-Next Mailing List, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
Hi all,
Commits
5f672090e44f ("qed: Fix shmem structure inconsistency between driver and the mfw.")
ce7d17d6c607 ("MAINTAINERS: change bridge maintainers")
are missing a Signed-off-by from their committers.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: pull-request: ieee802154 for net 2018-09-28
From: David Miller @ 2018-09-29 18:30 UTC (permalink / raw)
To: stefan; +Cc: linux-wpan, alex.aring, netdev
In-Reply-To: <20180928102043.25080-1-stefan@datenfreihafen.org>
From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: Fri, 28 Sep 2018 12:20:42 +0200
> An update from ieee802154 for your *net* tree.
>
> Some cleanup patches throughout the drivers from the Huawei tag team
> Yue Haibing and Zhong Jiang.
> Xue is replacing some magic numbers with defines in his mcr20a driver.
Applied, thanks.
^ permalink raw reply
* Re: [net-next 0/5] tipc: make connection setup more robust
From: David Miller @ 2018-09-29 18:25 UTC (permalink / raw)
To: jon.maloy
Cc: netdev, gordan.mihaljevic, tung.q.nguyen, hoang.h.le, canh.d.luu,
ying.xue, tipc-discussion
In-Reply-To: <1538159002-11800-1-git-send-email-jon.maloy@ericsson.com>
From: Jon Maloy <jon.maloy@ericsson.com>
Date: Fri, 28 Sep 2018 20:23:17 +0200
> In this series we make a few improvements to the connection setup and
> probing mechanism, culminating in the last commit where we make it
> possible for a client socket to make multiple setup attempts in case
> it encounters receive buffer overflow at the listener socket.
Series applied, thanks Jon.
^ permalink raw reply
* Re: [PATCH net-next v2] tcp: up initial rmem to 128KB and SYN rwin to around 64KB
From: David Miller @ 2018-09-29 18:23 UTC (permalink / raw)
To: ycheng; +Cc: edumazet, netdev, ncardwell, weiwan, soheil
In-Reply-To: <20180928200902.62121-1-ycheng@google.com>
From: Yuchung Cheng <ycheng@google.com>
Date: Fri, 28 Sep 2018 13:09:02 -0700
> Previously TCP initial receive buffer is ~87KB by default and
> the initial receive window is ~29KB (20 MSS). This patch changes
> the two numbers to 128KB and ~64KB (rounding down to the multiples
> of MSS) respectively. The patch also simplifies the calculations s.t.
> the two numbers are directly controlled by sysctl tcp_rmem[1]:
>
> 1) Initial receiver buffer budget (sk_rcvbuf): while this should
> be configured via sysctl tcp_rmem[1], previously tcp_fixup_rcvbuf()
> always override and set a larger size when a new connection
> establishes.
>
> 2) Initial receive window in SYN: previously it is set to 20
> packets if MSS <= 1460. The number 20 was based on the initial
> congestion window of 10: the receiver needs twice amount to
> avoid being limited by the receive window upon out-of-order
> delivery in the first window burst. But since this only
> applies if the receiving MSS <= 1460, connection using large MTU
> (e.g. to utilize receiver zero-copy) may be limited by the
> receive window.
>
> This patch also lowers the initial bytes expected to receive in
> the receiver buffer autotuning algorithm - otherwise the receiver
> may take two to three rounds to increase the buffer to the
> appropriate level (2x sender congestion window).
>
> With this patch TCP memory configuration is more straight-forward and
> more properly sized to modern high-speed networks by default. Several
> popular stacks have been announcing 64KB rwin in SYNs as well.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Wei Wang <weiwan@google.com>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com>
Applied, thanks.
^ permalink raw reply
* [PATCH iproute2-next 10/11] libnetlink: Rename rtnl_wilddump_* to rtnl_linkdump_*
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Rename rtnl_wilddump_req_filter to rtnl_linkdump_req_filter,
rtnl_wilddump_request to rtnl_linkdump_request and
rtnl_wilddump_req_filter_fn to rtnl_linkdump_req_filter_fn.
In all cases drop the type argument which at this point is only
RTM_GETLINK and hardcode in the functions.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
bridge/link.c | 4 ++--
bridge/vlan.c | 2 +-
include/libnetlink.h | 7 +++----
ip/ipaddress.c | 4 ++--
ip/iptoken.c | 2 +-
ip/iptuntap.c | 2 +-
ip/rtmon.c | 2 +-
ip/tunnel.c | 2 +-
lib/libnetlink.c | 12 ++++++------
lib/ll_map.c | 2 +-
misc/ifstat.c | 2 +-
11 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/bridge/link.c b/bridge/link.c
index 8557026387d2..5d4f9b525cad 100644
--- a/bridge/link.c
+++ b/bridge/link.c
@@ -502,7 +502,7 @@ static int brlink_show(int argc, char **argv)
}
if (show_details) {
- if (rtnl_wilddump_req_filter(&rth, PF_BRIDGE, RTM_GETLINK,
+ if (rtnl_linkdump_req_filter(&rth, PF_BRIDGE,
(compress_vlans ?
RTEXT_FILTER_BRVLAN_COMPRESSED :
RTEXT_FILTER_BRVLAN)) < 0) {
@@ -510,7 +510,7 @@ static int brlink_show(int argc, char **argv)
exit(1);
}
} else {
- if (rtnl_wilddump_request(&rth, PF_BRIDGE, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_request(&rth, PF_BRIDGE) < 0) {
perror("Cannon send dump request");
exit(1);
}
diff --git a/bridge/vlan.c b/bridge/vlan.c
index bdce55ae4e14..59ed1964bcd2 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -575,7 +575,7 @@ static int vlan_show(int argc, char **argv)
new_json_obj(json);
if (!show_stats) {
- if (rtnl_wilddump_req_filter(&rth, PF_BRIDGE, RTM_GETLINK,
+ if (rtnl_linkdump_req_filter(&rth, PF_BRIDGE,
(compress_vlans ?
RTEXT_FILTER_BRVLAN_COMPRESSED :
RTEXT_FILTER_BRVLAN)) < 0) {
diff --git a/include/libnetlink.h b/include/libnetlink.h
index f22c92ac03dc..29eb906ec9eb 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -66,15 +66,14 @@ int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
int rtnl_nsiddump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
-int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type)
+int rtnl_linkdump_request(struct rtnl_handle *rth, int fam)
__attribute__((warn_unused_result));
-int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask)
+int rtnl_linkdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
__attribute__((warn_unused_result));
typedef int (*req_filter_fn_t)(struct nlmsghdr *nlh, int reqlen);
-int rtnl_wilddump_req_filter_fn(struct rtnl_handle *rth, int fam, int type,
+int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int fam,
req_filter_fn_t fn)
__attribute__((warn_unused_result));
int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index f29480ce51d4..ffe1e1617cba 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1778,7 +1778,7 @@ static int iplink_filter_req(struct nlmsghdr *nlh, int reqlen)
int ip_linkaddr_list(int family, req_filter_fn_t filter_fn,
struct nlmsg_chain *linfo, struct nlmsg_chain *ainfo)
{
- if (rtnl_wilddump_req_filter_fn(&rth, preferred_family, RTM_GETLINK,
+ if (rtnl_linkdump_req_filter_fn(&rth, preferred_family,
filter_fn) < 0) {
perror("Cannot send dump request");
return 1;
@@ -2031,7 +2031,7 @@ void ipaddr_get_vf_rate(int vfnum, int *min, int *max, const char *dev)
exit(1);
}
- if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_request(&rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}
diff --git a/ip/iptoken.c b/ip/iptoken.c
index fb64da4ec262..ce0051dfdf8a 100644
--- a/ip/iptoken.c
+++ b/ip/iptoken.c
@@ -109,7 +109,7 @@ static int iptoken_list(int argc, char **argv)
argc--; argv++;
}
- if (rtnl_wilddump_request(&rth, af, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_request(&rth, af) < 0) {
perror("Cannot send dump request");
return -1;
}
diff --git a/ip/iptuntap.c b/ip/iptuntap.c
index 58996e6c5733..8c84e6206fa9 100644
--- a/ip/iptuntap.c
+++ b/ip/iptuntap.c
@@ -459,7 +459,7 @@ static int print_tuntap(const struct sockaddr_nl *who,
static int do_show(int argc, char **argv)
{
- if (rtnl_wilddump_req_filter_fn(&rth, AF_UNSPEC, RTM_GETLINK,
+ if (rtnl_linkdump_req_filter_fn(&rth, AF_UNSPEC,
tuntap_filter_req) < 0) {
perror("Cannot send dump request\n");
return -1;
diff --git a/ip/rtmon.c b/ip/rtmon.c
index 0e795f740e62..86b4fe2e448d 100644
--- a/ip/rtmon.c
+++ b/ip/rtmon.c
@@ -163,7 +163,7 @@ main(int argc, char **argv)
if (rtnl_open(&rth, groups) < 0)
exit(1);
- if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_request(&rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}
diff --git a/ip/tunnel.c b/ip/tunnel.c
index 79de7f2406f0..41ff1a686a9f 100644
--- a/ip/tunnel.c
+++ b/ip/tunnel.c
@@ -392,7 +392,7 @@ static int print_nlmsg_tunnel(const struct sockaddr_nl *who,
int do_tunnels_list(struct tnl_print_nlmsg_info *info)
{
- if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_request(&rth, preferred_family) < 0) {
perror("Cannot send dump request\n");
return -1;
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 2dd14ac5ea58..bc72272be9c4 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -346,12 +346,12 @@ int rtnl_nsiddump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
-int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
+int rtnl_linkdump_request(struct rtnl_handle *rth, int family)
{
- return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
+ return rtnl_linkdump_req_filter(rth, family, RTEXT_FILTER_VF);
}
-int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
+int rtnl_linkdump_req_filter(struct rtnl_handle *rth, int family,
__u32 filt_mask)
{
struct {
@@ -362,7 +362,7 @@ int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
__u32 ext_filter_mask;
} req = {
.nlh.nlmsg_len = sizeof(req),
- .nlh.nlmsg_type = type,
+ .nlh.nlmsg_type = RTM_GETLINK,
.nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
.nlh.nlmsg_seq = rth->dump = ++rth->seq,
.ifm.ifi_family = family,
@@ -374,7 +374,7 @@ int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
return send(rth->fd, &req, sizeof(req), 0);
}
-int rtnl_wilddump_req_filter_fn(struct rtnl_handle *rth, int family, int type,
+int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int family,
req_filter_fn_t filter_fn)
{
struct {
@@ -383,7 +383,7 @@ int rtnl_wilddump_req_filter_fn(struct rtnl_handle *rth, int family, int type,
char buf[1024];
} req = {
.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)),
- .nlh.nlmsg_type = type,
+ .nlh.nlmsg_type = RTM_GETLINK,
.nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
.nlh.nlmsg_seq = rth->dump = ++rth->seq,
.ifm.ifi_family = family,
diff --git a/lib/ll_map.c b/lib/ll_map.c
index 0afe68979283..4c3ed0d71913 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -218,7 +218,7 @@ void ll_init_map(struct rtnl_handle *rth)
if (initialized)
return;
- if (rtnl_wilddump_request(rth, AF_UNSPEC, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_request(rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 50b906e86d5d..36eba605d5ba 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -214,7 +214,7 @@ static void load_info(void)
exit(1);
}
} else {
- if (rtnl_wilddump_request(&rth, AF_INET, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_request(&rth, AF_INET) < 0) {
perror("Cannot send dump request");
exit(1);
}
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 11/11] libnetlink: Rename rtnl_wilddump_stats_req_filter to rtnl_statsdump_req_filter
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
rtnl_wilddump_stats_req_filter only takes RTM_GETSTATS as the type argument
so rename to rtnl_statsdump_req_filter for consistency with other request
functions and hardcode the type argument.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
bridge/vlan.c | 8 ++------
include/libnetlink.h | 3 +--
ip/iplink.c | 4 +---
ip/iplink_xstats.c | 4 +---
lib/libnetlink.c | 5 ++---
misc/ifstat.c | 4 ++--
6 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/bridge/vlan.c b/bridge/vlan.c
index 59ed1964bcd2..239907bdad89 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -603,9 +603,7 @@ static int vlan_show(int argc, char **argv)
__u32 filt_mask;
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
exit(1);
}
@@ -619,9 +617,7 @@ static int vlan_show(int argc, char **argv)
}
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS_SLAVE);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send slave dump request");
exit(1);
}
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 29eb906ec9eb..8655e0b75c38 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -76,8 +76,7 @@ typedef int (*req_filter_fn_t)(struct nlmsghdr *nlh, int reqlen);
int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int fam,
req_filter_fn_t fn)
__attribute__((warn_unused_result));
-int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask)
+int rtnl_statsdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
__attribute__((warn_unused_result));
int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req,
int len)
diff --git a/ip/iplink.c b/ip/iplink.c
index d99c49ed244a..50ccb49a0263 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -1601,9 +1601,7 @@ static int iplink_afstats(int argc, char **argv)
}
}
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
return 1;
}
diff --git a/ip/iplink_xstats.c b/ip/iplink_xstats.c
index 10f953bc4584..908d9228369f 100644
--- a/ip/iplink_xstats.c
+++ b/ip/iplink_xstats.c
@@ -65,9 +65,7 @@ int iplink_ifla_xstats(int argc, char **argv)
else
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
return -1;
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index bc72272be9c4..e12ce63bd05a 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -400,8 +400,7 @@ int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int family,
return send(rth->fd, &req, req.nlh.nlmsg_len, 0);
}
-int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask)
+int rtnl_statsdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
{
struct {
struct nlmsghdr nlh;
@@ -410,7 +409,7 @@ int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
memset(&req, 0, sizeof(req));
req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct if_stats_msg));
- req.nlh.nlmsg_type = type;
+ req.nlh.nlmsg_type = RTM_GETSTATS;
req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 36eba605d5ba..f12c88f295c3 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -203,8 +203,8 @@ static void load_info(void)
if (is_extended) {
ll_init_map(&rth);
filter_mask = IFLA_STATS_FILTER_BIT(filter_type);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC, RTM_GETSTATS,
- filter_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC,
+ filter_mask) < 0) {
perror("Cannot send dump request");
exit(1);
}
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 09/11] libnetlink: Convert GETNSID dumps to use rtnl_nsiddump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_nsiddump_req for namespace id dumps using the proper rtgenmsg
as the header. Convert existing RTM_GETNSID dumps to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 2 ++
ip/ipnetns.c | 2 +-
lib/libnetlink.c | 16 ++++++++++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 5ccc421b4b0e..f22c92ac03dc 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -63,6 +63,8 @@ int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_nsiddump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type)
__attribute__((warn_unused_result));
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 368be0cbc0a4..e8500c773994 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -346,7 +346,7 @@ static int netns_list_id(int argc, char **argv)
return -ENOTSUP;
}
- if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETNSID) < 0) {
+ if (rtnl_nsiddump_req(&rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index c28047e4b055..2dd14ac5ea58 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -330,6 +330,22 @@ int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_nsiddump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct rtgenmsg rtm;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETNSID,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .rtm.rtgen_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
{
return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 08/11] libnetlink: Convert GETNEIGHTBL dumps to use rtnl_neightbldump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_neightbldump_req for neighbor table dumps using the proper ndtmsg
as the header. Convert existing RTM_GETNEIGHTBL dumps to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 2 ++
ip/ipntable.c | 2 +-
lib/libnetlink.c | 16 ++++++++++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index e22ccbb82ce2..5ccc421b4b0e 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -57,6 +57,8 @@ int rtnl_ruledump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_neighdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_neightbldump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
diff --git a/ip/ipntable.c b/ip/ipntable.c
index dd4f7c2ee6d9..ce3f4614e32b 100644
--- a/ip/ipntable.c
+++ b/ip/ipntable.c
@@ -658,7 +658,7 @@ static int ipntable_show(int argc, char **argv)
argc--; argv++;
}
- if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETNEIGHTBL) < 0) {
+ if (rtnl_neightbldump_req(&rth, preferred_family) < 0) {
perror("Cannot send dump request");
exit(1);
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index fd0f95a24194..c28047e4b055 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -282,6 +282,22 @@ int rtnl_neighdump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_neightbldump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct ndtmsg ndtmsg;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETNEIGHTBL,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .ndtmsg.ndtm_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
{
struct {
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 05/11] libnetlink: Convert GETNETCONF dumps to use rtnl_netconfdump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_netconfdump_req for netconf dumps using the proper netconfmsg
as the header. Convert existing RTM_GETNETCONF dumps to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 2 ++
ip/ipnetconf.c | 3 +--
lib/libnetlink.c | 16 ++++++++++++++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 8f2b2935074a..7e9ef640c704 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -55,6 +55,8 @@ int rtnl_routedump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type)
__attribute__((warn_unused_result));
diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c
index 04c4d60807b1..21822e367e11 100644
--- a/ip/ipnetconf.c
+++ b/ip/ipnetconf.c
@@ -210,8 +210,7 @@ static int do_show(int argc, char **argv)
} else {
rth.flags = RTNL_HANDLE_F_SUPPRESS_NLERR;
dump:
- if (rtnl_wilddump_request(&rth, filter.family,
- RTM_GETNETCONF) < 0) {
+ if (rtnl_netconfdump_req(&rth, filter.family) < 0) {
perror("Cannot send dump request");
exit(1);
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 51ea457cd31a..e5cb275faf09 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -265,6 +265,22 @@ int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct netconfmsg ncm;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETNETCONF,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .ncm.ncm_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
{
return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 07/11] libnetlink: Convert GETNEIGH dumps to use rtnl_neighdump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_neighdump_req for neighbor dumps using the proper ndmsg
as the header. Convert existing rtnl_wilddump_request for RTM_GETNEIGH
to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 2 ++
lib/libnetlink.c | 16 ++++++++++++++++
misc/arpd.c | 2 +-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 5f6bbe55fe4a..e22ccbb82ce2 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -55,6 +55,8 @@ int rtnl_routedump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_ruledump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_neighdump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 89e4d6a2a662..fd0f95a24194 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -266,6 +266,22 @@ int rtnl_ruledump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_neighdump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct ndmsg ndm;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETNEIGH,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .ndm.ndm_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
{
struct {
diff --git a/misc/arpd.c b/misc/arpd.c
index 67d86b67957b..ce7c09978c2b 100644
--- a/misc/arpd.c
+++ b/misc/arpd.c
@@ -424,7 +424,7 @@ static int do_one_request(struct nlmsghdr *n)
static void load_initial_table(void)
{
- if (rtnl_wilddump_request(&rth, AF_INET, RTM_GETNEIGH) < 0) {
+ if (rtnl_neighdump_req(&rth, AF_INET) < 0) {
perror("dump request failed");
exit(1);
}
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 06/11] libnetlink: Convert GETRULE dumps to use rtnl_ruledump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_ruledump_req for fib fule dumps using the proper fib_rule_hdr
as the header. Convert existing RTM_GETRULE dumps to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 2 ++
ip/iprule.c | 2 +-
lib/libnetlink.c | 17 +++++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 7e9ef640c704..5f6bbe55fe4a 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -53,6 +53,8 @@ int rtnl_addrlbldump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_routedump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_ruledump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
diff --git a/ip/iprule.c b/ip/iprule.c
index 744d6d88e343..60fd4c7e9f93 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -615,7 +615,7 @@ static int iprule_list_flush_or_save(int argc, char **argv, int action)
argc--; argv++;
}
- if (rtnl_wilddump_request(&rth, af, RTM_GETRULE) < 0) {
+ if (rtnl_ruledump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return 1;
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index e5cb275faf09..89e4d6a2a662 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -22,6 +22,7 @@
#include <errno.h>
#include <time.h>
#include <sys/uio.h>
+#include <linux/fib_rules.h>
#include <linux/if_addrlabel.h>
#include <linux/if_bridge.h>
@@ -249,6 +250,22 @@ int rtnl_routedump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_ruledump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct fib_rule_hdr frh;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETRULE,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .frh.family = family
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
{
struct {
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 03/11] libnetlink: Convert GETADDRLABEL dumps to use rtnl_addrlbldump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_addrlbldump_req for address label dumps using the proper
ifaddrlblmsg as the header. Convert existing RTM_GETADDRALBEL dumps
to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 2 ++
ip/ipaddrlabel.c | 4 ++--
lib/libnetlink.c | 17 +++++++++++++++++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index a60af316b505..bacaec8216f7 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -49,6 +49,8 @@ void rtnl_close(struct rtnl_handle *rth);
int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_addrlbldump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_routedump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index 2f79c56dcead..845fe4c5db27 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -118,7 +118,7 @@ static int ipaddrlabel_list(int argc, char **argv)
return -1;
}
- if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+ if (rtnl_addrlbldump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return 1;
}
@@ -237,7 +237,7 @@ static int ipaddrlabel_flush(int argc, char **argv)
return -1;
}
- if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+ if (rtnl_addrlbldump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return -1;
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index fda5309ce44d..fb5f1714c2d8 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -22,6 +22,7 @@
#include <errno.h>
#include <time.h>
#include <sys/uio.h>
+#include <linux/if_addrlabel.h>
#include "libnetlink.h"
@@ -215,6 +216,22 @@ int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_addrlbldump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct ifaddrlblmsg ifal;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETADDRLABEL,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .ifal.ifal_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_routedump_req(struct rtnl_handle *rth, int family)
{
struct {
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 01/11] libnetlink: Convert GETADDR dumps to use rtnl_addrdump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_addrdump_req for address dumps using the proper ifaddrmsg
as the header. Convert existing RTM_GETADDR dumps to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 4 ++++
ip/ipaddress.c | 6 +++---
lib/libnetlink.c | 16 ++++++++++++++++
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 9d9249e634dc..2d9f6190230c 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -46,6 +46,10 @@ int rtnl_open_byproto(struct rtnl_handle *rth, unsigned int subscriptions,
__attribute__((warn_unused_result));
void rtnl_close(struct rtnl_handle *rth);
+
+int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
+
int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type)
__attribute__((warn_unused_result));
int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int fam, int type,
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 8dc6c32fd6d9..f29480ce51d4 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1698,7 +1698,7 @@ static int ipaddr_flush(void)
filter.flushe = sizeof(flushb);
while ((max_flush_loops == 0) || (round < max_flush_loops)) {
- if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) {
+ if (rtnl_addrdump_req(&rth, filter.family) < 0) {
perror("Cannot send dump request");
exit(1);
}
@@ -1790,7 +1790,7 @@ int ip_linkaddr_list(int family, req_filter_fn_t filter_fn,
}
if (ainfo) {
- if (rtnl_wilddump_request(&rth, family, RTM_GETADDR) < 0) {
+ if (rtnl_addrdump_req(&rth, family) < 0) {
perror("Cannot send dump request");
return 1;
}
@@ -1915,7 +1915,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
if (ipadd_save_prep())
exit(1);
- if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETADDR) < 0) {
+ if (rtnl_addrdump_req(&rth, preferred_family) < 0) {
perror("Cannot send dump request");
exit(1);
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index f18dceac2b5e..749cf4fbb88e 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -199,6 +199,22 @@ int rtnl_open(struct rtnl_handle *rth, unsigned int subscriptions)
return rtnl_open_byproto(rth, subscriptions, NETLINK_ROUTE);
}
+int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct ifaddrmsg ifm;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETADDR,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .ifm.ifa_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
{
return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 04/11] libnetlink: Convert GETMDB dumps to use rtnl_mdbdump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_mdbdump_req for mdb dumps using the proper br_port_msg as
the header. Convert existing RTM_GETMDB dumps to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
bridge/mdb.c | 2 +-
include/libnetlink.h | 2 ++
lib/libnetlink.c | 17 +++++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/bridge/mdb.c b/bridge/mdb.c
index 841a36123050..03fcc91f0219 100644
--- a/bridge/mdb.c
+++ b/bridge/mdb.c
@@ -293,7 +293,7 @@ static int mdb_show(int argc, char **argv)
new_json_obj(json);
/* get mdb entries*/
- if (rtnl_wilddump_request(&rth, PF_BRIDGE, RTM_GETMDB) < 0) {
+ if (rtnl_mdbdump_req(&rth, PF_BRIDGE) < 0) {
perror("Cannot send dump request");
return -1;
}
diff --git a/include/libnetlink.h b/include/libnetlink.h
index bacaec8216f7..8f2b2935074a 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -53,6 +53,8 @@ int rtnl_addrlbldump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
int rtnl_routedump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type)
__attribute__((warn_unused_result));
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index fb5f1714c2d8..51ea457cd31a 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -23,6 +23,7 @@
#include <time.h>
#include <sys/uio.h>
#include <linux/if_addrlabel.h>
+#include <linux/if_bridge.h>
#include "libnetlink.h"
@@ -248,6 +249,22 @@ int rtnl_routedump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct br_port_msg bpm;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETMDB,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .bpm.family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
{
return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 02/11] libnetlink: Convert GETROUTE dumps to use rtnl_routedump_req
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add rtnl_routedump_req for route dumps using the proper rtmsg
as the header. Convert existing RTM_GETROUTE dumps to use it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/libnetlink.h | 2 ++
ip/ipmroute.c | 2 +-
ip/iproute.c | 4 ++--
lib/libnetlink.c | 16 ++++++++++++++++
4 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 2d9f6190230c..a60af316b505 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -49,6 +49,8 @@ void rtnl_close(struct rtnl_handle *rth);
int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_routedump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type)
__attribute__((warn_unused_result));
diff --git a/ip/ipmroute.c b/ip/ipmroute.c
index bc23cfea7e8b..c5dfa9cb1538 100644
--- a/ip/ipmroute.c
+++ b/ip/ipmroute.c
@@ -283,7 +283,7 @@ static int mroute_list(int argc, char **argv)
filter.iif = idx;
}
- if (rtnl_wilddump_request(&rth, filter.af, RTM_GETROUTE) < 0) {
+ if (rtnl_routedump_req(&rth, filter.af) < 0) {
perror("Cannot send dump request");
return 1;
}
diff --git a/ip/iproute.c b/ip/iproute.c
index 398322fd1f4f..699635923764 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1645,7 +1645,7 @@ static int iproute_flush(int do_ipv6, rtnl_filter_t filter_fn)
filter.flushe = sizeof(flushb);
for (;;) {
- if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+ if (rtnl_routedump_req(&rth, do_ipv6) < 0) {
perror("Cannot send dump request");
return -2;
}
@@ -1891,7 +1891,7 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
return iproute_flush(do_ipv6, filter_fn);
if (!filter.cloned) {
- if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+ if (rtnl_routedump_req(&rth, do_ipv6) < 0) {
perror("Cannot send dump request");
return -2;
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 749cf4fbb88e..fda5309ce44d 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -215,6 +215,22 @@ int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_routedump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct rtmsg rtm;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETROUTE,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .rtm.rtm_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
{
return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
--
2.11.0
^ permalink raw reply related
* [PATCH iproute2-next 00/11] Fix dump requests to use proper header for type
From: David Ahern @ 2018-09-29 17:59 UTC (permalink / raw)
To: netdev; +Cc: stephen, christian, David Ahern
From: David Ahern <dsahern@gmail.com>
iproute2 currently uses ifinfomsg as the header for all dumps using the
wilddump headers. This is wrong as each message type actually has its own
header type. While the kernel has traditionally let it go as it for the
most part only uses the family entry, the use of kernel side filters is
increasing to alter what is returned on a request. The kernel side filters
really need to use the proper header type.
To that end, fix iproute2 to use the proper header struct for the GET type.
David Ahern (11):
libnetlink: Convert GETADDR dumps to use rtnl_addrdump_req
libnetlink: Convert GETROUTE dumps to use rtnl_routedump_req
libnetlink: Convert GETADDRLABEL dumps to use rtnl_addrlbldump_req
libnetlink: Convert GETMDB dumps to use rtnl_mdbdump_req
libnetlink: Convert GETNETCONF dumps to use rtnl_netconfdump_req
libnetlink: Convert GETRULE dumps to use rtnl_ruledump_req
libnetlink: Convert GETNEIGH dumps to use rtnl_neighdump_req
libnetlink: Convert GETNEIGHTBL dumps to use rtnl_neightbldump_req
libnetlink: Convert GETNSID dumps to use rtnl_nsiddump_req
libnetlink: Rename rtnl_wilddump_* to rtnl_linkdump_*
libnetlink: Rename rtnl_wilddump_stats_req_filter to
rtnl_statsdump_req_filter
bridge/link.c | 4 +-
bridge/mdb.c | 2 +-
bridge/vlan.c | 10 +---
include/libnetlink.h | 30 ++++++++--
ip/ipaddress.c | 10 ++--
ip/ipaddrlabel.c | 4 +-
ip/iplink.c | 4 +-
ip/iplink_xstats.c | 4 +-
ip/ipmroute.c | 2 +-
ip/ipnetconf.c | 3 +-
ip/ipnetns.c | 2 +-
ip/ipntable.c | 2 +-
ip/iproute.c | 4 +-
ip/iprule.c | 2 +-
ip/iptoken.c | 2 +-
ip/iptuntap.c | 2 +-
ip/rtmon.c | 2 +-
ip/tunnel.c | 2 +-
lib/libnetlink.c | 164 ++++++++++++++++++++++++++++++++++++++++++++++++---
lib/ll_map.c | 2 +-
misc/arpd.c | 2 +-
misc/ifstat.c | 6 +-
22 files changed, 210 insertions(+), 55 deletions(-)
--
2.11.0
^ permalink raw reply
* __nf_register_net_hook jump label splat
From: Borislav Petkov @ 2018-09-29 23:04 UTC (permalink / raw)
To: netdev
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
David S. Miller, netfilter-devel, coreteam, linux-kernel
Hi people,
this is something new I'm triggering with rc5 + tip/master while rc4 +
tip/master is fine. Any ideas?
If I had to guess, it looks like this thing:
#ifdef HAVE_JUMP_LABEL
static_key_slow_inc(&nf_hooks_needed[pf][reg->hooknum]);
#endif
[ 24.472503] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 24.497078] Bridge firewalling registered
[ 24.507989] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[ 24.517700] PGD 80284ff51067 P4D 80284ff51067 PUD 80284ff52067 PMD 0
[ 24.525895] Oops: 0000 [#1] PREEMPT SMP NOPTI
[ 24.531949] CPU: 121 PID: 4848 Comm: wickedd Not tainted 4.19.0-rc5+ #1
[ 24.549787] RIP: 0010:jump_label_update+0xa4/0xd0
[ 24.556049] Code: 73 08 48 85 f6 74 31 48 8b 43 10 48 c7 c2 60 01 f0 81 48 85 c0 74 11 8b 90 b8 02 00 00 48 c1 e2 04 48 03 90 b0 02 00 00 31 c9 <83> 38 01 48 89 ef 0f 94 c1 e8 8e fd ff ff 48 8b 1b 48 85 db 75 be
[ 24.578102] RSP: 0018:ffffc9000f783c70 EFLAGS: 00010246
[ 24.584946] RAX: 0000000000000000 RBX: ffff884045145880 RCX: 0000000000000000
[ 24.593679] RDX: ffffffff81f00160 RSI: ffffffff81efff00 RDI: ffffffff8204e220
[ 24.601575] usb 3-2.2: device not accepting address 8, error -71
[ 24.602418] RBP: ffffffff827ef800 R08: 0000000000000002 R09: 0000000000000000
[ 24.602424] R10: ffff88407ea62f48 R11: 0000000000000000 R12: ffff884033dfcdc0
[ 24.610307] usb 3-2-port2: unable to enumerate USB device
[ 24.619267] R13: ffffffff821078d0 R14: 0000000000000000 R15: 0000000000000000
[ 24.619271] FS: 00007f30357a4700(0000) GS:ffff88407ea40000(0000) knlGS:0000000000000000
[ 24.619274] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 24.619276] CR2: 0000000000000000 CR3: 0000802853e20000 CR4: 00000000003406e0
[ 24.619277] Call Trace:
[ 24.619289] static_key_slow_inc_cpuslocked+0x73/0xa0
[ 24.682426] static_key_slow_inc+0x16/0x20
[ 24.682435] __nf_register_net_hook+0x98/0x100
[ 24.682440] nf_register_net_hook+0x23/0x80
[ 24.682445] nf_register_net_hooks+0x3c/0x90
[ 24.682452] brnf_device_event+0x68/0xb0 [br_netfilter]
[ 24.682461] notifier_call_chain+0x47/0x70
[ 24.682470] register_netdevice+0x352/0x4c0
[ 24.682475] register_netdev+0x1f/0x30
[ 24.682485] br_add_bridge+0x4b/0x70 [bridge]
[ 24.682500] br_ioctl_deviceless_stub+0x112/0x250 [bridge]
[ 24.705565] usb 3-2.3: new high-speed USB device number 9 using xhci_hcd
[ 24.707752] sock_ioctl+0x250/0x320
[ 24.761176] do_vfs_ioctl+0x92/0x5e0
[ 24.761182] ? __sys_recvmsg+0x45/0x80
[ 24.761186] ksys_ioctl+0x60/0x90
[ 24.761191] __x64_sys_ioctl+0x16/0x20
[ 24.761198] do_syscall_64+0x4f/0xe0
[ 24.761206] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 24.761212] RIP: 0033:0x7f3034f62417
[ 24.761216] Code: 00 00 00 48 8b 05 71 8a 2b 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 41 8a 2b 00 f7 d8 64 89 01 48
[ 24.761224] RSP: 002b:00007ffecdc9ca08 EFLAGS: 00000246
[ 24.793641] usb 3-2.3: device descriptor read/64, error -71
[ 24.796390] ORIG_RAX: 0000000000000010
[ 24.796397] RAX: ffffffffffffffda RBX: 0000000001236ff0 RCX: 00007f3034f62417
[ 24.854147] RDX: 0000000001236ff0 RSI: 00000000000089a0 RDI: 0000000000000008
[ 24.854149] RBP: 00007ffecdc9ca48 R08: 0000000000000000 R09: 0000000001297650
[ 24.854150] R10: 000000006829aa3c R11: 0000000000000246 R12: 00000000012385f0
[ 24.854152] R13: 000000000129a840 R14: 0000000001205700 R15: 0000000001208fc0
[ 24.854156] Modules linked in: br_netfilter bridge stp llc iscsi_ibft iscsi_boot_sysfs msr ipmi_ssif nls_iso8859_1 nls_cp437 joydev amd64_edac_mod vfat edac_mce_amd fat kvm_amd hid_generic usbhid kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc e1000e aesni_intel aes_x86_64 crypto_simd cryptd ptp glue_helper pps_core sp5100_tco pcspkr ipmi_si ccp ipmi_devintf i2c_piix4 k10temp ipmi_msghandler pcc_cpufreq pinctrl_amd acpi_cpufreq button btrfs libcrc32c xor zstd_decompress zstd_compress xxhash ast i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops xhci_pci ttm xhci_hcd raid6_pq crc32c_intel drm usbcore dm_mirror dm_region_hash dm_log sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua efivarfs
[ 24.890644] CR2: 0000000000000000
[ 24.973524] ---[ end trace e5c10bd51bf12555 ]---
[ 24.973529] RIP: 0010:jump_label_update+0xa4/0xd0
[ 24.973532] Code: 73 08 48 85 f6 74 31 48 8b 43 10 48 c7 c2 60 01 f0 81 48 85 c0 74 11 8b 90 b8 02 00 00 48 c1 e2 04 48 03 90 b0 02 00 00 31 c9 <83> 38 01 48 89 ef 0f 94 c1 e8 8e fd ff ff 48 8b 1b 48 85 db 75 be
[ 24.973534] RSP: 0018:ffffc9000f783c70 EFLAGS: 00010246
[ 24.973536] RAX: 0000000000000000 RBX: ffff884045145880 RCX: 0000000000000000
[ 24.973538] RDX: ffffffff81f00160 RSI: ffffffff81efff00 RDI: ffffffff8204e220
[ 24.973539] RBP: ffffffff827ef800 R08: 0000000000000002 R09: 0000000000000000
[ 24.973541] R10: ffff88407ea62f48 R11: 0000000000000000 R12: ffff884033dfcdc0
[ 24.973542] R13: ffffffff821078d0 R14: 0000000000000000 R15: 0000000000000000
[ 24.973545] FS: 00007f30357a4700(0000) GS:ffff88407ea40000(0000) knlGS:0000000000000000
[ 24.973546] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 24.973548] CR2: 0000000000000000 CR3: 0000802853e20000 CR4: 00000000003406e0
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply
* [PATCH] net/packet: fix packet drop as of virtio gso
From: Jianfeng Tan @ 2018-09-29 15:41 UTC (permalink / raw)
To: netdev; +Cc: davem, jasowang, mst
When we use raw socket as the vhost backend, a packet from virito with
gso offloading information, cannot be sent out in later validaton at
xmit path, as we did not set correct skb->protocol which is further used
for looking up the gso function.
To fix this, we set this field according to virito hdr information.
Fixes: e858fae2b0b8f4 ("virtio_net: use common code for virtio_net_hdr and skb GSO conversion")
Cc: stable@vger.kernel.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@linux.alibaba.com>
---
include/linux/virtio_net.h | 18 ++++++++++++++++++
net/packet/af_packet.c | 11 +++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 9397628a1967..cb462f9ab7dd 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -5,6 +5,24 @@
#include <linux/if_vlan.h>
#include <uapi/linux/virtio_net.h>
+static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
+ const struct virtio_net_hdr *hdr)
+{
+ switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
+ case VIRTIO_NET_HDR_GSO_TCPV4:
+ case VIRTIO_NET_HDR_GSO_UDP:
+ skb->protocol = cpu_to_be16(ETH_P_IP);
+ break;
+ case VIRTIO_NET_HDR_GSO_TCPV6:
+ skb->protocol = cpu_to_be16(ETH_P_IPV6);
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
const struct virtio_net_hdr *hdr,
bool little_endian)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 75c92a87e7b2..d6e94dc7e290 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2715,10 +2715,12 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
}
}
- if (po->has_vnet_hdr && virtio_net_hdr_to_skb(skb, vnet_hdr,
- vio_le())) {
- tp_len = -EINVAL;
- goto tpacket_error;
+ if (po->has_vnet_hdr) {
+ if (virtio_net_hdr_to_skb(skb, vnet_hdr, vio_le())) {
+ tp_len = -EINVAL;
+ goto tpacket_error;
+ }
+ virtio_net_hdr_set_proto(skb, vnet_hdr);
}
skb->destructor = tpacket_destruct_skb;
@@ -2915,6 +2917,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
if (err)
goto out_free;
len += sizeof(vnet_hdr);
+ virtio_net_hdr_set_proto(skb, &vnet_hdr);
}
skb_probe_transport_header(skb, reserve);
--
2.17.1
^ permalink raw reply related
* [PATCHv2 net-next] geneve: allow to clear ttl inherit
From: Hangbin Liu @ 2018-09-29 15:06 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Phil Sutter, Hangbin Liu, Michal Kubecek
In-Reply-To: <1538096998-20937-1-git-send-email-liuhangbin@gmail.com>
As Michal remaind, we should allow to clear ttl inherit. Then we will
have three states:
1. set the flag, and do ttl inherit.
2. do not set the flag, use configured ttl value, or default ttl (0) if
not set.
3. disable ttl inherit, use previous configured ttl value, or default ttl (0).
Fixes: 52d0d404d39dd ("geneve: add ttl inherit support")
CC: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
drivers/net/geneve.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 6625fab..82eccc9 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1325,11 +1325,15 @@ static int geneve_nl2info(struct nlattr *tb[], struct nlattr *data[],
info->key.tun_id = tunid;
}
- if (data[IFLA_GENEVE_TTL])
+ if (data[IFLA_GENEVE_TTL_INHERIT]) {
+ if (nla_get_u8(data[IFLA_GENEVE_TTL_INHERIT]))
+ *ttl_inherit = true;
+ else
+ *ttl_inherit = false;
+ } else if (data[IFLA_GENEVE_TTL]) {
info->key.ttl = nla_get_u8(data[IFLA_GENEVE_TTL]);
-
- if (data[IFLA_GENEVE_TTL_INHERIT])
- *ttl_inherit = true;
+ *ttl_inherit = false;
+ }
if (data[IFLA_GENEVE_TOS])
info->key.tos = nla_get_u8(data[IFLA_GENEVE_TOS]);
--
2.5.5
^ permalink raw reply related
* Re: [PATCH net-next] geneve: fix ttl inherit type
From: Hangbin Liu @ 2018-09-29 15:03 UTC (permalink / raw)
To: Michal Kubecek
Cc: netdev, David Miller, Stephen Hemminger, David Ahern, Phil Sutter
In-Reply-To: <20180928234619.GA17323@unicorn.suse.cz>
On Sat, Sep 29, 2018 at 01:46:19AM +0200, Michal Kubecek wrote:
> Is it desirable to switch to a flag? If I read geneve_changelink() and
> geneve_nl2info() correctly, it allows you to set the ttl_inherit flag
> for an existing device but doesn't allow you to clear it. With NLA_U8,
> you could distinguish three cases: set the flag (non-zero value), clear
> the flag (zero value) and preserve current state (attribute not
> present).
>
> The same problem exists for vxlan but vxlan code intentionally disallows
> changing the flag value for an existing device (I'm not sure if it's
> because it's really impossible or just due to limits of the interface).
> Unfortunately it has been already released with NLA_FLAG in 4.18,
> AFAICS, so we have to live with it. But it's not too late for geneve.
>
> Michal Kubecek
Hi michal,
I thought about the vxlan issue and agree with you. TTL inherit is a way
to define the ttl number we should use. It also should be able to be changed
as the normal ttl. How about enabling clear ttl inherit flag like:
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3303,13 +3303,11 @@ static int vxlan_nl2conf(struct nlattr *tb[], struct nlattr *data[],
if (data[IFLA_VXLAN_TOS])
conf->tos = nla_get_u8(data[IFLA_VXLAN_TOS]);
- if (data[IFLA_VXLAN_TTL])
- conf->ttl = nla_get_u8(data[IFLA_VXLAN_TTL]);
-
if (data[IFLA_VXLAN_TTL_INHERIT]) {
- if (changelink)
- return -EOPNOTSUPP;
conf->flags |= VXLAN_F_TTL_INHERIT;
+ } else if (data[IFLA_VXLAN_TTL]) {
+ conf->flags &= ~VXLAN_F_TTL_INHERIT;
+ conf->ttl = nla_get_u8(data[IFLA_VXLAN_TTL]);
}
Before this fix, we disabled changing it after creating vxlan. And with this fix
we can set/unset it. I think this should not be a usage break. What do you think?
Thanks
Hangbin
^ permalink raw reply
* Re: [PATCH iproute2 net-next] ipneigh: support setting of NTF_ROUTER on neigh entries
From: Roopa Prabhu @ 2018-09-29 15:02 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
In-Reply-To: <e0455cc6-54b2-45ab-10dd-b162d9e76b3d@gmail.com>
On Fri, Sep 28, 2018 at 9:57 AM David Ahern <dsahern@gmail.com> wrote:
>
> On 9/25/18 3:15 PM, Roopa Prabhu wrote:
> > From: Roopa Prabhu <roopa@cumulusnetworks.com>
> >
> > Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> > ---
> > ip/ipneigh.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
>
> applied to iproute2-next.
>
> And then I noticed you did not update the help or the man page. Please
> send a follow up.
Oops, looks like i missed including it in this patch before sending.
will post it today.
^ permalink raw reply
* [PATCH V2 net-next 08/10] net: hns3: Change return type of hclge_tm_schd_info_update()
From: Salil Mehta @ 2018-09-29 14:56 UTC (permalink / raw)
To: davem
Cc: salil.mehta, yisen.zhuang, lipeng321, mehta.salil, netdev,
linux-kernel, linuxarm, Huazhong Tan, Yunsheng Lin
In-Reply-To: <20180929145622.5448-1-salil.mehta@huawei.com>
From: Huazhong Tan <tanhuazhong@huawei.com>
hclge_tm_schd_info_update should return an error when num_tc is greater
than alloc_tqps.
This patch changes the return type of hnae3_register_ae_algo from void
to int.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 8 ++++++--
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 9 ++++++++-
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 2 +-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index 92f19384e258..e72f724123d7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -184,7 +184,9 @@ static int hclge_ieee_setets(struct hnae3_handle *h, struct ieee_ets *ets)
if (ret)
return ret;
- hclge_tm_schd_info_update(hdev, num_tc);
+ ret = hclge_tm_schd_info_update(hdev, num_tc);
+ if (ret)
+ return ret;
ret = hclge_ieee_ets_to_tm_info(hdev, ets);
if (ret)
@@ -310,7 +312,9 @@ static int hclge_setup_tc(struct hnae3_handle *h, u8 tc, u8 *prio_tc)
return -EINVAL;
}
- hclge_tm_schd_info_update(hdev, tc);
+ ret = hclge_tm_schd_info_update(hdev, tc);
+ if (ret)
+ return ret;
ret = hclge_tm_prio_tc_info_update(hdev, prio_tc);
if (ret)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index ab7280d7f79c..aa5cb9834d73 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -1280,10 +1280,15 @@ int hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc)
return 0;
}
-void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc)
+int hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc)
{
u8 i, bit_map = 0;
+ for (i = 0; i < hdev->num_alloc_vport; i++) {
+ if (num_tc > hdev->vport[i].alloc_tqps)
+ return -EINVAL;
+ }
+
hdev->tm_info.num_tc = num_tc;
for (i = 0; i < hdev->tm_info.num_tc; i++)
@@ -1297,6 +1302,8 @@ void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc)
hdev->hw_tc_map = bit_map;
hclge_tm_schd_info_init(hdev);
+
+ return 0;
}
int hclge_tm_init_hw(struct hclge_dev *hdev)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
index e1568b826aac..25eef13a3e14 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
@@ -132,7 +132,7 @@ int hclge_tm_schd_init(struct hclge_dev *hdev);
int hclge_pause_setup_hw(struct hclge_dev *hdev);
int hclge_tm_schd_mode_hw(struct hclge_dev *hdev);
int hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc);
-void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc);
+int hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc);
int hclge_tm_dwrr_cfg(struct hclge_dev *hdev);
int hclge_tm_map_cfg(struct hclge_dev *hdev);
int hclge_tm_init_hw(struct hclge_dev *hdev);
--
2.11.0
^ permalink raw reply related
* Re: [PATCH v3] PCI: Reprogram bridge prefetch registers on resume
From: Thomas Martitz @ 2018-09-29 21:06 UTC (permalink / raw)
To: Bjorn Helgaas, Daniel Drake
Cc: bhelgaas, linux-pci, linux, nouveau, linux-pm, peter, kherbst,
andy.shevchenko, rafael.j.wysocki, keith.busch, jonathan.derrick,
davem, hkallweit1, netdev, nic_swsd, rchang, linux-kernel
In-Reply-To: <20180927205247.GA18434@bhelgaas-glaptop.roam.corp.google.com>
Am 27.09.18 um 22:52 schrieb Bjorn Helgaas:
> [+cc LKML]
>
> On Tue, Sep 18, 2018 at 04:32:44PM -0500, Bjorn Helgaas wrote:
>> On Thu, Sep 13, 2018 at 11:37:45AM +0800, Daniel Drake wrote:
>>> On 38+ Intel-based Asus products, the nvidia GPU becomes unusable
>>> after S3 suspend/resume. The affected products include multiple
>>> generations of nvidia GPUs and Intel SoCs. After resume, nouveau logs
>>> many errors such as:
>>>
>>> fifo: fault 00 [READ] at 0000005555555000 engine 00 [GR] client 04
>>> [HUB/FE] reason 4a [] on channel -1 [007fa91000 unknown]
>>> DRM: failed to idle channel 0 [DRM]
>>>
>>> Similarly, the nvidia proprietary driver also fails after resume
>>> (black screen, 100% CPU usage in Xorg process). We shipped a sample
>>> to Nvidia for diagnosis, and their response indicated that it's a
>>> problem with the parent PCI bridge (on the Intel SoC), not the GPU.
>>>
>>> Runtime suspend/resume works fine, only S3 suspend is affected.
>>>
>>> We found a workaround: on resume, rewrite the Intel PCI bridge
>>> 'Prefetchable Base Upper 32 Bits' register (PCI_PREF_BASE_UPPER32). In
>>> the cases that I checked, this register has value 0 and we just have to
>>> rewrite that value.
>>>
>>> Linux already saves and restores PCI config space during suspend/resume,
>>> but this register was being skipped because upon resume, it already
>>> has value 0 (the correct, pre-suspend value).
>>>
>>> Intel appear to have previously acknowledged this behaviour and the
>>> requirement to rewrite this register.
>>> https://bugzilla.kernel.org/show_bug.cgi?id=116851#c23
>>>
>>> Based on that, rewrite the prefetch register values even when that
>>> appears unnecessary.
>>>
>>> We have confirmed this solution on all the affected models we have
>>> in-hands (X542UQ, UX533FD, X530UN, V272UN).
>>>
>>> Additionally, this solves an issue where r8169 MSI-X interrupts were
>>> broken after S3 suspend/resume on Asus X441UAR. This issue was recently
>>> worked around in commit 7bb05b85bc2d ("r8169: don't use MSI-X on
>>> RTL8106e"). It also fixes the same issue on RTL6186evl/8111evl on an
>>> Aimfor-tech laptop that we had not yet patched. I suspect it will also
>>> fix the issue that was worked around in commit 7c53a722459c ("r8169:
>>> don't use MSI-X on RTL8168g").
>>>
>>> Thomas Martitz reports that this change also solves an issue where
>>> the AMD Radeon Polaris 10 GPU on the HP Zbook 14u G5 is unresponsive
>>> after S3 suspend/resume.
>>>
>>> Link: https://bugzilla.kernel.org/show_bug.cgi?id=201069
>>> Signed-off-by: Daniel Drake <drake@endlessm.com>
>>
>> Applied with Rafael's and Peter's reviewed-by to pci/enumeration for v4.20.
>> Thanks for the the huge investigative effort!
>
> Since this looks low-risk and fixes several painful issues, I think
> this merits a stable tag and being included in v4.19 (instead of
> waiting for v4.20).
>
> I moved it to for-linus for v4.19. Let me know if you object.
The latest iteration does not work on my HP system. The GPU fails to
power up just like the unpatched kernel.
[ 516.833580] amdgpu 0000:01:00.0: Refused to change power state,
currently in D3
[ 516.912885] amdgpu 0000:01:00.0: Refused to change power state,
currently in D3
[ 516.929175] amdgpu 0000:01:00.0: Refused to change power state,
currently in D3
[ 521.932435] [drm:atom_op_jump] *ERROR* atombios stuck in loop for
more than 5secs aborting
[ 521.932440] [drm:amdgpu_atom_execute_table_locked] *ERROR* atombios
stuck executing C392 (len 62, WS 0, PS 0) @ 0xC3AE
[ 521.932442] [drm:amdgpu_atom_execute_table_locked] *ERROR* atombios
stuck executing ADB8 (len 140, WS 0, PS 8) @ 0xADD3
[ 521.932444] [drm:amdgpu_device_resume] *ERROR* amdgpu asic init failed
[ 522.883309] amdgpu 0000:01:00.0: Wait for MC idle timedout !
[ 523.831676] amdgpu 0000:01:00.0: Wait for MC idle timedout !
[ 523.832931] [drm] PCIE GART of 256M enabled (table at
0x000000F400000000).
[ 523.836807] amdgpu: [powerplay] Failed to send Message.
[ 523.836862] amdgpu: [powerplay] SMC address must be 4 byte aligned.
[ 523.836863] amdgpu: [powerplay] [AVFS][Polaris10_SetupGfxLvlStruct]
Problems copying VRConfig value over to SMC
[ 523.836864] amdgpu: [powerplay] [AVFS][Polaris10_AVFSEventMgr] Could
not Copy Graphics Level table over to SMU
[ 523.836908] amdgpu: [powerplay]
last message was failed ret is 65535
[ 523.836924] amdgpu: [powerplay]
failed to send message 252 ret is 65535
[ 523.836949] amdgpu: [powerplay]
last message was failed ret is 65535
[ 523.836965] amdgpu: [powerplay]
failed to send message 253 ret is 65535
[ 523.836989] amdgpu: [powerplay]
last message was failed ret is 65535
[ 523.837006] amdgpu: [powerplay]
failed to send message 250 ret is 65535
[ 523.837029] amdgpu: [powerplay]
last message was failed ret is 65535
[ 523.837045] amdgpu: [powerplay]
>
>>> ---
>>> drivers/pci/pci.c | 25 +++++++++++++++++--------
>>> 1 file changed, 17 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>> index 29ff9619b5fa..5d58220b6997 100644
>>> --- a/drivers/pci/pci.c
>>> +++ b/drivers/pci/pci.c
>>> @@ -1289,12 +1289,12 @@ int pci_save_state(struct pci_dev *dev)
>>> EXPORT_SYMBOL(pci_save_state);
>>>
>>> static void pci_restore_config_dword(struct pci_dev *pdev, int offset,
>>> - u32 saved_val, int retry)
>>> + u32 saved_val, int retry, bool force)
>>> {
>>> u32 val;
>>>
>>> pci_read_config_dword(pdev, offset, &val);
>>> - if (val == saved_val)
>>> + if (!force && val == saved_val)
>>> return;
>>>
>>> for (;;) {
>>> @@ -1313,25 +1313,34 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset,
>>> }
>>>
>>> static void pci_restore_config_space_range(struct pci_dev *pdev,
>>> - int start, int end, int retry)
>>> + int start, int end, int retry,
>>> + bool force)
>>> {
>>> int index;
>>>
>>> for (index = end; index >= start; index--)
>>> pci_restore_config_dword(pdev, 4 * index,
>>> pdev->saved_config_space[index],
>>> - retry);
>>> + retry, force);
>>> }
>>>
>>> static void pci_restore_config_space(struct pci_dev *pdev)
>>> {
>>> if (pdev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
>>> - pci_restore_config_space_range(pdev, 10, 15, 0);
>>> + pci_restore_config_space_range(pdev, 10, 15, 0, false);
>>> /* Restore BARs before the command register. */
>>> - pci_restore_config_space_range(pdev, 4, 9, 10);
>>> - pci_restore_config_space_range(pdev, 0, 3, 0);
>>> + pci_restore_config_space_range(pdev, 4, 9, 10, false);
>>> + pci_restore_config_space_range(pdev, 0, 3, 0, false);
>>> + } else if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
>>> + pci_restore_config_space_range(pdev, 12, 15, 0, false);
>>> + /* Force rewriting of prefetch registers to avoid
>>> + * S3 resume issues on Intel PCI bridges that occur when
>>> + * these registers are not explicitly written.
>>> + */
>>> + pci_restore_config_space_range(pdev, 9, 11, 0, true);
>>> + pci_restore_config_space_range(pdev, 0, 8, 0, false);
>>> } else {
>>> - pci_restore_config_space_range(pdev, 0, 15, 0);
>>> + pci_restore_config_space_range(pdev, 0, 15, 0, false);
>>> }
>>> }
>>>
>>> --
>>> 2.17.1
>>>
^ permalink raw reply
* RE: [PATCH V2 net-next 00/10] Cleanups, minor additions & fixes for HNS3 driver
From: Salil Mehta @ 2018-09-29 20:43 UTC (permalink / raw)
To: David Miller
Cc: Zhuangyuzeng (Yisen), lipeng (Y), mehta.salil@opnsrc.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Linuxarm
In-Reply-To: <20180929.104644.1898007175155937602.davem@davemloft.net>
Hi David,
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Saturday, September 29, 2018 6:47 PM
> To: Salil Mehta <salil.mehta@huawei.com>
> Cc: Zhuangyuzeng (Yisen) <yisen.zhuang@huawei.com>; lipeng (Y)
> <lipeng321@huawei.com>; mehta.salil@opnsrc.net; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>
> Subject: Re: [PATCH V2 net-next 00/10] Cleanups, minor additions &
> fixes for HNS3 driver
>
> From: Salil Mehta <salil.mehta@huawei.com>
> Date: Sat, 29 Sep 2018 15:56:12 +0100
>
> > This patch-set contains cleans-ups, minor changes and fixes to the
> HNS3 driver.
> >
> > Change Summary:
> > v1->v2
> > * Fixed Kbuild error due to missed patch in the current submission.
> > For now, replaced HNAE3_REVISION_ID_21 macro with 0x21
> > * Fixed issues identified by Eric Dumazet and spelling mistakes by
> David Miller
> > Link: https://lkml.org/lkml/2018/9/28/842
> >
> > Note:
> > Hi David,
> > From v1->v2 changes only exists in below patch
> > "net: hns3: Add serdes parallel inner loopback support"
>
> I already applied v1, so you have to send me a build fix for that
> broken
> patch.
>
> Nevermind, I'll do it myself, I can't have my tree broken like this for
> days.
>
> In the future, when I've applied your changes, they cannot be reverted.
> You must send me relative fixups to what is in my tree already.
Ok sure, got it. Will take care in future.
Thanks so much for the help this time.
Best regards
Salil.
>
> Thank you.
^ permalink raw reply
* RE: [PATCH] hv_netvsc: remove ndo_poll_controller
From: Haiyang Zhang @ 2018-09-29 14:12 UTC (permalink / raw)
To: Stephen Hemminger, netdev@vger.kernel.org; +Cc: Stephen Hemminger, Eric Dumazet
In-Reply-To: <20180929125256.25994-1-sthemmin@microsoft.com>
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Saturday, September 29, 2018 8:53 AM
> To: netdev@vger.kernel.org
> Cc: Stephen Hemminger <sthemmin@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Eric Dumazet <edumazet@google.com>
> Subject: [PATCH] hv_netvsc: remove ndo_poll_controller
>
> Similar to other patches from ERic.
>
> As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on
> loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI
> contexts (for all RX/TX queues of the NIC). This capture can last for unlimited
> amount of time, since one cpu is generally not able to drain all the queues
> under load.
>
> In netvsc driver it uses NAPI for TX completions. The default poll_napi will do
> this for us now and avoid the capture.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Eric Dumazet <edumazet@google.com>
> ---
Thank you.
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
^ permalink raw reply
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