* [PATCH iproute2] man: update doc after support of ESN and anti-replay window
From: Nicolas Dichtel @ 2014-10-30 8:18 UTC (permalink / raw)
To: shemminger; +Cc: netdev, Nicolas Dichtel
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
man/man8/ip-xfrm.8 | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/man/man8/ip-xfrm.8 b/man/man8/ip-xfrm.8
index 2d31b4d9c5a2..c9d2a2e17c35 100644
--- a/man/man8/ip-xfrm.8
+++ b/man/man8/ip-xfrm.8
@@ -43,6 +43,10 @@ ip-xfrm \- transform configuration
.IR SEQ " ]"
.RB "[ " replay-oseq
.IR SEQ " ]"
+.RB "[ " replay-seq-hi
+.IR SEQ " ]"
+.RB "[ " replay-oseq-hi
+.IR SEQ " ]"
.RB "[ " flag
.IR FLAG-LIST " ]"
.RB "[ " sel
@@ -138,7 +142,8 @@ ip-xfrm \- transform configuration
.ti -8
.IR FLAG " :="
-.BR noecn " | " decap-dscp " | " nopmtudisc " | " wildrecv " | " icmp " | " af-unspec " | " align4
+.BR noecn " | " decap-dscp " | " nopmtudisc " | " wildrecv " | " icmp " | "
+.BR af-unspec " | " align4 " | " esn
.ti -8
.IR SELECTOR " :="
@@ -470,7 +475,7 @@ and inbound trigger
.I FLAG-LIST
contains one or more of the following optional flags:
.BR noecn ", " decap-dscp ", " nopmtudisc ", " wildrecv ", " icmp ", "
-.BR af-unspec ", or " align4 "."
+.BR af-unspec ", " align4 ", or " esn "."
.TP
.IR SELECTOR
--
2.1.0
^ permalink raw reply related
* [PATCH ipsec-next] xfrm: add XFRMA_REPLAY_VAL attribute to SA messages
From: Nicolas Dichtel @ 2014-10-30 8:39 UTC (permalink / raw)
To: steffen.klassert
Cc: davem, netdev, dingzhi, Adrien Mazarguil, Nicolas Dichtel
From: dingzhi <zhi.ding@6wind.com>
After this commit, the attribute XFRMA_REPLAY_VAL is added when no ESN replay
value is defined. Thus sequence number values are always notified to userspace.
Signed-off-by: dingzhi <zhi.ding@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
net/xfrm/xfrm_user.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index e812e988c111..8128594ab379 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -824,13 +824,15 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
ret = xfrm_mark_put(skb, &x->mark);
if (ret)
goto out;
- if (x->replay_esn) {
+ if (x->replay_esn)
ret = nla_put(skb, XFRMA_REPLAY_ESN_VAL,
xfrm_replay_state_esn_len(x->replay_esn),
x->replay_esn);
- if (ret)
- goto out;
- }
+ else
+ ret = nla_put(skb, XFRMA_REPLAY_VAL, sizeof(x->replay),
+ &x->replay);
+ if (ret)
+ goto out;
if (x->security)
ret = copy_sec_ctx(x->security, skb);
out:
@@ -2569,6 +2571,8 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
l += nla_total_size(sizeof(x->tfcpad));
if (x->replay_esn)
l += nla_total_size(xfrm_replay_state_esn_len(x->replay_esn));
+ else
+ l += nla_total_size(sizeof(struct xfrm_replay_state));
if (x->security)
l += nla_total_size(sizeof(struct xfrm_user_sec_ctx) +
x->security->ctx_len);
--
2.1.0
^ permalink raw reply related
* Re: [PATCH iproute2] ip link: Allow to filter devices by master dev
From: vadim4j @ 2014-10-30 8:54 UTC (permalink / raw)
To: netdev
In-Reply-To: <1413727488-18032-1-git-send-email-vadim4j@gmail.com>
On Sun, Oct 19, 2014 at 05:04:48PM +0300, Vadim Kochan wrote:
> Added 'master' option to 'ip link show' command
> to filter devices by master dev.
>
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> ip/ipaddress.c | 16 ++++++++++++++++
> ip/iplink.c | 2 +-
> man/man8/ip-link.8.in | 9 ++++++++-
> 3 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index 45729d8..8a0e2ab 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -56,6 +56,7 @@ static struct
> int flushp;
> int flushe;
> int group;
> + int master;
> } filter;
>
> static int do_link;
> @@ -480,6 +481,14 @@ int print_linkinfo(const struct sockaddr_nl *who,
> return -1;
> }
>
> + if (tb[IFLA_MASTER]) {
> + int master = *(int*)RTA_DATA(tb[IFLA_MASTER]);
> + if (filter.master > 0 && master != filter.master)
> + return -1;
> + }
> + else if (filter.master > 0)
> + return -1;
> +
> if (n->nlmsg_type == RTM_DELLINK)
> fprintf(fp, "Deleted ");
>
> @@ -1215,6 +1224,13 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
> NEXT_ARG();
> if (rtnl_group_a2n(&filter.group, *argv))
> invarg("Invalid \"group\" value\n", *argv);
> + } else if (strcmp(*argv, "master") == 0) {
> + int ifindex;
> + NEXT_ARG();
> + ifindex = ll_name_to_index(*argv);
> + if (!ifindex)
> + invarg("Device does not exist\n", *argv);
> + filter.master = ifindex;
> } else {
> if (strcmp(*argv, "dev") == 0) {
> NEXT_ARG();
> diff --git a/ip/iplink.c b/ip/iplink.c
> index 43b26f4..ce6eb3e 100644
> --- a/ip/iplink.c
> +++ b/ip/iplink.c
> @@ -82,7 +82,7 @@ void iplink_usage(void)
> fprintf(stderr, " [ master DEVICE ]\n");
> fprintf(stderr, " [ nomaster ]\n");
> fprintf(stderr, " [ addrgenmode { eui64 | none } ]\n");
> - fprintf(stderr, " ip link show [ DEVICE | group GROUP ] [up]\n");
> + fprintf(stderr, " ip link show [ DEVICE | group GROUP ] [up] [master DEV]\n");
>
> if (iplink_have_newlink()) {
> fprintf(stderr, " ip link help [ TYPE ]\n");
> diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
> index 383917a..279fe39 100644
> --- a/man/man8/ip-link.8.in
> +++ b/man/man8/ip-link.8.in
> @@ -144,7 +144,9 @@ ip-link \- network device configuration
> .B ip link show
> .RI "[ " DEVICE " | "
> .B group
> -.IR GROUP " ]"
> +.IR GROUP " | "
> +.B master
> +.IR DEVICE " ]"
>
> .SH "DESCRIPTION"
> .SS ip link add - add virtual link
> @@ -658,6 +660,11 @@ specifies what group of devices to show.
> .B up
> only display running interfaces.
>
> +.TP
> +.BI master " DEVICE "
> +.I DEVICE
> +specifies the master device which enslaves devices to show.
> +
> .SH "EXAMPLES"
> .PP
> ip link show
> --
> 2.1.0
>
Please reject this patch, I will send v2 because of conflicts with
'master' branch.
Regards,
^ permalink raw reply
* [PATCH RESEND v2] ipv4: Do not cache routing failures due to disabled forwarding.
From: Nicolas Cavallari @ 2014-10-30 9:09 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy
Cc: netdev, linux-kernel
In-Reply-To: <20141029.150328.530876391340346443.davem@davemloft.net>
If we cache them, the kernel will reuse them, independently of
whether forwarding is enabled or not. Which means that if forwarding is
disabled on the input interface where the first routing request comes
from, then that unreachable result will be cached and reused for
other interfaces, even if forwarding is enabled on them. The opposite
is also true.
This can be verified with two interfaces A and B and an output interface
C, where B has forwarding enabled, but not A and trying
ip route get $dst iif A from $src && ip route get $dst iif B from $src
Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Reviewed-by: Julian Anastasov <ja@ssi.bg>
---
> Sorry Nicolas, this seems to have fallen on the floor. Could you please
> resubmit your most uptodate version of this patch so I can apply it?
Here you are.
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 2d4ae46..6a2155b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1798,6 +1798,7 @@ local_input:
no_route:
RT_CACHE_STAT_INC(in_no_route);
res.type = RTN_UNREACHABLE;
+ res.fi = NULL;
goto local_input;
/*
--
2.1.1
^ permalink raw reply related
* [PATCH iproute2 v2] ip link: Allow to filter devices by master dev
From: Vadim Kochan @ 2014-10-30 9:02 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
Added 'master' option to 'ip link show' command
to filter devices by master dev.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
ip/ipaddress.c | 16 ++++++++++++++++
ip/iplink.c | 2 +-
man/man8/ip-link.8.in | 12 +++++++++---
3 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 45729d8..8a0e2ab 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -56,6 +56,7 @@ static struct
int flushp;
int flushe;
int group;
+ int master;
} filter;
static int do_link;
@@ -480,6 +481,14 @@ int print_linkinfo(const struct sockaddr_nl *who,
return -1;
}
+ if (tb[IFLA_MASTER]) {
+ int master = *(int*)RTA_DATA(tb[IFLA_MASTER]);
+ if (filter.master > 0 && master != filter.master)
+ return -1;
+ }
+ else if (filter.master > 0)
+ return -1;
+
if (n->nlmsg_type == RTM_DELLINK)
fprintf(fp, "Deleted ");
@@ -1215,6 +1224,13 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
NEXT_ARG();
if (rtnl_group_a2n(&filter.group, *argv))
invarg("Invalid \"group\" value\n", *argv);
+ } else if (strcmp(*argv, "master") == 0) {
+ int ifindex;
+ NEXT_ARG();
+ ifindex = ll_name_to_index(*argv);
+ if (!ifindex)
+ invarg("Device does not exist\n", *argv);
+ filter.master = ifindex;
} else {
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
diff --git a/ip/iplink.c b/ip/iplink.c
index 43b26f4..ce6eb3e 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -82,7 +82,7 @@ void iplink_usage(void)
fprintf(stderr, " [ master DEVICE ]\n");
fprintf(stderr, " [ nomaster ]\n");
fprintf(stderr, " [ addrgenmode { eui64 | none } ]\n");
- fprintf(stderr, " ip link show [ DEVICE | group GROUP ] [up]\n");
+ fprintf(stderr, " ip link show [ DEVICE | group GROUP ] [up] [master DEV]\n");
if (iplink_have_newlink()) {
fprintf(stderr, " ip link help [ TYPE ]\n");
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 464009d..ce00119 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -144,9 +144,10 @@ ip-link \- network device configuration
.B ip link show
.RI "[ " DEVICE " | "
.B group
-.IR GROUP " |"
-.B up
-]
+.IR GROUP " | "
+.BR up " | "
+.B master
+.IR DEVICE " ]"
.SH "DESCRIPTION"
.SS ip link add - add virtual link
@@ -660,6 +661,11 @@ specifies what group of devices to show.
.B up
only display running interfaces.
+.TP
+.BI master " DEVICE "
+.I DEVICE
+specifies the master device which enslaves devices to show.
+
.SH "EXAMPLES"
.PP
ip link show
--
2.1.0
^ permalink raw reply related
* [PATCH v3 1/1] ip-link: add switch to show human readable output
From: Christian Hesse @ 2014-10-30 9:16 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Christian Hesse
In-Reply-To: <20141029224738.263e27bd@urahara>
Byte and packet count can increase to really big numbers. This adds a
switch to show human readable output.
% ip -s link ls en
3: en: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
48494310 141370 0 196 0 0
TX: bytes packets errors dropped carrier collsns
153830639 180773 0 0 0 0
% ip -s -h link ls en
3: en: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
46.3M 138.8K 0 198 0 0
TX: bytes packets errors dropped carrier collsns
148.1M 177.7K 0 0 0 0
---
include/utils.h | 1 +
ip/ip.c | 5 +
ip/ipaddress.c | 279 ++++++++++++++++++++++++++++++++++++++------------
man/man8/ip-link.8.in | 1 +
4 files changed, 220 insertions(+), 66 deletions(-)
diff --git a/include/utils.h b/include/utils.h
index 704dc51..7bb19e9 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -11,6 +11,7 @@
#include "rtm_map.h"
extern int preferred_family;
+extern int human_readable;
extern int show_stats;
extern int show_details;
extern int show_raw;
diff --git a/ip/ip.c b/ip/ip.c
index 739b88d..6b352c8 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -24,6 +24,7 @@
#include "ip_common.h"
int preferred_family = AF_UNSPEC;
+int human_readable = 0;
int show_stats = 0;
int show_details = 0;
int resolve_hosts = 0;
@@ -47,6 +48,7 @@ static void usage(void)
" tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |\n"
" netns | l2tp | tcp_metrics | token | netconf }\n"
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
+" -h[uman-readable] |\n"
" -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |\n"
" -4 | -6 | -I | -D | -B | -0 |\n"
" -l[oops] { maximum-addr-flush-attempts } |\n"
@@ -212,6 +214,9 @@ int main(int argc, char **argv)
preferred_family = AF_DECnet;
} else if (strcmp(opt, "-B") == 0) {
preferred_family = AF_BRIDGE;
+ } else if (matches(opt, "-human") == 0 ||
+ matches(opt, "-human-readable") == 0) {
+ ++human_readable;
} else if (matches(opt, "-stats") == 0 ||
matches(opt, "-statistics") == 0) {
++show_stats;
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 45729d8..dcf31c0 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -319,107 +319,254 @@ static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
}
}
+static void print_human64(FILE *fp, int length, uint64_t count)
+{
+ int written;
+
+ if (count > 1125899906842624) /* 2**50 */
+ written = fprintf(fp, "%"PRIu64".%"PRIu64"P",
+ count / 1125899906842624,
+ count * 10 / 1125899906842624 % 10);
+ else if (count > 1099511627776) /* 2**40 */
+ written = fprintf(fp, "%"PRIu64".%"PRIu64"T",
+ count / 1099511627776,
+ count * 10 / 1099511627776 % 10);
+ else if (count > 1073741824) /* 2**30 */
+ written = fprintf(fp, "%"PRIu64".%"PRIu64"G",
+ count / 1073741824, count * 10 / 1073741824 % 10);
+ else if (count > 1048576) /* 2**20 */
+ written = fprintf(fp, "%"PRIu64".%"PRIu64"M",
+ count / 1048576, count * 10 / 1048576 % 10);
+ else if (count > 1024) /* 2**10 */
+ written = fprintf(fp, "%"PRIu64".%"PRIu64"K",
+ count / 1024, count * 10 / 1024 % 10);
+ else
+ written = fprintf(fp, "%"PRIu64, count);
+
+ do {
+ fputc(' ', fp);
+ } while (written++ < length);
+}
+
+static void print_human32(FILE *fp, int length, uint32_t count)
+{
+ int written;
+
+ if (count > 1073741824) /* 2**30 */
+ written = fprintf(fp, "%u.%uG",
+ count / 1073741824, count * 10 / 1073741824 % 10);
+ else if (count > 1048576) /* 2**20 */
+ written = fprintf(fp, "%u.%uM",
+ count / 1048576, count * 10 / 1048576 % 10);
+ else if (count > 1024) /* 2**10 */
+ written = fprintf(fp, "%u.%uK",
+ count / 1024, count * 10 / 1024 % 10);
+ else
+ written = fprintf(fp, "%u", count);
+
+ do {
+ fputc(' ', fp);
+ } while (written++ < length);
+}
+
static void print_link_stats64(FILE *fp, const struct rtnl_link_stats64 *s,
const struct rtattr *carrier_changes)
{
+ /* RX stats */
fprintf(fp, " RX: bytes packets errors dropped overrun mcast %s%s",
s->rx_compressed ? "compressed" : "", _SL_);
- fprintf(fp, " %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
- (uint64_t)s->rx_bytes,
- (uint64_t)s->rx_packets,
- (uint64_t)s->rx_errors,
- (uint64_t)s->rx_dropped,
- (uint64_t)s->rx_over_errors,
- (uint64_t)s->multicast);
- if (s->rx_compressed)
- fprintf(fp, " %-7"PRIu64"",
- (uint64_t)s->rx_compressed);
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human64(fp, 10, (uint64_t)s->rx_bytes);
+ print_human64(fp, 8, (uint64_t)s->rx_packets);
+ print_human64(fp, 7, (uint64_t)s->rx_errors);
+ print_human64(fp, 7, (uint64_t)s->rx_dropped);
+ print_human64(fp, 7, (uint64_t)s->rx_over_errors);
+ print_human64(fp, 7, (uint64_t)s->multicast);
+ if (s->rx_compressed)
+ print_human64(fp, 7, (uint64_t)s->rx_compressed);
+ } else {
+ fprintf(fp, " %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+ (uint64_t)s->rx_bytes,
+ (uint64_t)s->rx_packets,
+ (uint64_t)s->rx_errors,
+ (uint64_t)s->rx_dropped,
+ (uint64_t)s->rx_over_errors,
+ (uint64_t)s->multicast);
+ if (s->rx_compressed)
+ fprintf(fp, " %-7"PRIu64"",
+ (uint64_t)s->rx_compressed);
+ }
+
+ /* RX error stats */
if (show_stats > 1) {
fprintf(fp, "%s", _SL_);
- fprintf(fp, " RX errors: length crc frame fifo missed%s", _SL_);
- fprintf(fp, " %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
- (uint64_t)s->rx_length_errors,
- (uint64_t)s->rx_crc_errors,
- (uint64_t)s->rx_frame_errors,
- (uint64_t)s->rx_fifo_errors,
- (uint64_t)s->rx_missed_errors);
+ fprintf(fp, " RX errors: length crc frame fifo missed%s", _SL_);
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human64(fp, 8, (uint64_t)s->rx_length_errors);
+ print_human64(fp, 7, (uint64_t)s->rx_crc_errors);
+ print_human64(fp, 7, (uint64_t)s->rx_frame_errors);
+ print_human64(fp, 7, (uint64_t)s->rx_fifo_errors);
+ print_human64(fp, 7, (uint64_t)s->rx_missed_errors);
+ } else {
+ fprintf(fp, " %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+ (uint64_t)s->rx_length_errors,
+ (uint64_t)s->rx_crc_errors,
+ (uint64_t)s->rx_frame_errors,
+ (uint64_t)s->rx_fifo_errors,
+ (uint64_t)s->rx_missed_errors);
+ }
}
fprintf(fp, "%s", _SL_);
+
+ /* TX stats */
fprintf(fp, " TX: bytes packets errors dropped carrier collsns %s%s",
(uint64_t)s->tx_compressed ? "compressed" : "", _SL_);
- fprintf(fp, " %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
- (uint64_t)s->tx_bytes,
- (uint64_t)s->tx_packets,
- (uint64_t)s->tx_errors,
- (uint64_t)s->tx_dropped,
- (uint64_t)s->tx_carrier_errors,
- (uint64_t)s->collisions);
- if (s->tx_compressed)
- fprintf(fp, " %-7"PRIu64"",
- (uint64_t)s->tx_compressed);
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human64(fp, 10, (uint64_t)s->tx_bytes);
+ print_human64(fp, 8, (uint64_t)s->tx_packets);
+ print_human64(fp, 7, (uint64_t)s->tx_errors);
+ print_human64(fp, 7, (uint64_t)s->tx_dropped);
+ print_human64(fp, 7, (uint64_t)s->tx_carrier_errors);
+ print_human64(fp, 7, (uint64_t)s->collisions);
+ if (s->tx_compressed)
+ print_human64(fp, 7, (uint64_t)s->tx_compressed);
+ } else {
+ fprintf(fp, " %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+ (uint64_t)s->tx_bytes,
+ (uint64_t)s->tx_packets,
+ (uint64_t)s->tx_errors,
+ (uint64_t)s->tx_dropped,
+ (uint64_t)s->tx_carrier_errors,
+ (uint64_t)s->collisions);
+ if (s->tx_compressed)
+ fprintf(fp, " %-7"PRIu64"",
+ (uint64_t)s->tx_compressed);
+ }
+
+ /* TX error stats */
if (show_stats > 1) {
fprintf(fp, "%s", _SL_);
- fprintf(fp, " TX errors: aborted fifo window heartbeat");
+ fprintf(fp, " TX errors: aborted fifo window heartbeat");
if (carrier_changes)
fprintf(fp, " transns");
fprintf(fp, "%s", _SL_);
- fprintf(fp, " %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-8"PRIu64"",
- (uint64_t)s->tx_aborted_errors,
- (uint64_t)s->tx_fifo_errors,
- (uint64_t)s->tx_window_errors,
- (uint64_t)s->tx_heartbeat_errors);
- if (carrier_changes)
- fprintf(fp, " %-7u",
- *(uint32_t*)RTA_DATA(carrier_changes));
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human64(fp, 8, (uint64_t)s->tx_aborted_errors);
+ print_human64(fp, 7, (uint64_t)s->tx_fifo_errors);
+ print_human64(fp, 7, (uint64_t)s->tx_window_errors);
+ print_human64(fp, 7, (uint64_t)s->tx_heartbeat_errors);
+ if (carrier_changes)
+ print_human64(fp, 7, (uint64_t)*(uint32_t*)RTA_DATA(carrier_changes));
+ } else {
+ fprintf(fp, " %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+ (uint64_t)s->tx_aborted_errors,
+ (uint64_t)s->tx_fifo_errors,
+ (uint64_t)s->tx_window_errors,
+ (uint64_t)s->tx_heartbeat_errors);
+ if (carrier_changes)
+ fprintf(fp, " %-7u",
+ *(uint32_t*)RTA_DATA(carrier_changes));
+ }
}
}
static void print_link_stats32(FILE *fp, const struct rtnl_link_stats *s,
const struct rtattr *carrier_changes)
{
+ /* RX stats */
fprintf(fp, " RX: bytes packets errors dropped overrun mcast %s%s",
s->rx_compressed ? "compressed" : "", _SL_);
- fprintf(fp, " %-10u %-8u %-7u %-7u %-7u %-7u",
- s->rx_bytes, s->rx_packets, s->rx_errors,
- s->rx_dropped, s->rx_over_errors,
- s->multicast
- );
- if (s->rx_compressed)
- fprintf(fp, " %-7u", s->rx_compressed);
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human32(fp, 10, s->rx_bytes);
+ print_human32(fp, 8, s->rx_packets);
+ print_human32(fp, 7, s->rx_errors);
+ print_human32(fp, 7, s->rx_dropped);
+ print_human32(fp, 7, s->rx_over_errors);
+ print_human32(fp, 7, s->multicast);
+ if (s->rx_compressed)
+ print_human32(fp, 7, s->rx_compressed);
+ } else {
+ fprintf(fp, " %-10u %-8u %-7u %-7u %-7u %-7u",
+ s->rx_bytes, s->rx_packets, s->rx_errors,
+ s->rx_dropped, s->rx_over_errors,
+ s->multicast);
+ if (s->rx_compressed)
+ fprintf(fp, " %-7u", s->rx_compressed);
+ }
+
+ /* RX error stats */
if (show_stats > 1) {
fprintf(fp, "%s", _SL_);
- fprintf(fp, " RX errors: length crc frame fifo missed%s", _SL_);
- fprintf(fp, " %-7u %-7u %-7u %-7u %-7u",
- s->rx_length_errors,
- s->rx_crc_errors,
- s->rx_frame_errors,
- s->rx_fifo_errors,
- s->rx_missed_errors
- );
+ fprintf(fp, " RX errors: length crc frame fifo missed%s", _SL_);
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human32(fp, 8, s->rx_length_errors);
+ print_human32(fp, 7, s->rx_crc_errors);
+ print_human32(fp, 7, s->rx_frame_errors);
+ print_human32(fp, 7, s->rx_fifo_errors);
+ print_human32(fp, 7, s->rx_missed_errors);
+ } else {
+ fprintf(fp, " %-8u %-7u %-7u %-7u %-7u",
+ s->rx_length_errors,
+ s->rx_crc_errors,
+ s->rx_frame_errors,
+ s->rx_fifo_errors,
+ s->rx_missed_errors);
+ }
}
fprintf(fp, "%s", _SL_);
+
+ /* TX stats */
fprintf(fp, " TX: bytes packets errors dropped carrier collsns %s%s",
s->tx_compressed ? "compressed" : "", _SL_);
- fprintf(fp, " %-10u %-8u %-7u %-7u %-7u %-7u",
- s->tx_bytes, s->tx_packets, s->tx_errors,
- s->tx_dropped, s->tx_carrier_errors, s->collisions);
- if (s->tx_compressed)
- fprintf(fp, " %-7u", s->tx_compressed);
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human32(fp, 10, s->tx_bytes);
+ print_human32(fp, 8, s->tx_packets);
+ print_human32(fp, 7, s->tx_errors);
+ print_human32(fp, 7, s->tx_dropped);
+ print_human32(fp, 7, s->tx_carrier_errors);
+ print_human32(fp, 7, s->collisions);
+ if (s->tx_compressed)
+ print_human32(fp, 7, s->tx_compressed);
+ } else {
+ fprintf(fp, " %-10u %-8u %-7u %-7u %-7u %-7u",
+ s->tx_bytes, s->tx_packets, s->tx_errors,
+ s->tx_dropped, s->tx_carrier_errors, s->collisions);
+ if (s->tx_compressed)
+ fprintf(fp, " %-7u", s->tx_compressed);
+ }
+
+ /* TX error stats */
if (show_stats > 1) {
fprintf(fp, "%s", _SL_);
- fprintf(fp, " TX errors: aborted fifo window heartbeat");
+ fprintf(fp, " TX errors: aborted fifo window heartbeat");
if (carrier_changes)
fprintf(fp, " transns");
fprintf(fp, "%s", _SL_);
- fprintf(fp, " %-7u %-7u %-7u %-8u",
- s->tx_aborted_errors,
- s->tx_fifo_errors,
- s->tx_window_errors,
- s->tx_heartbeat_errors
- );
- if (carrier_changes)
- fprintf(fp, " %-7u",
- *(uint32_t*)RTA_DATA(carrier_changes));
+ if (human_readable) {
+ fprintf(fp, " ");
+ print_human32(fp, 8, s->tx_aborted_errors);
+ print_human32(fp, 7, s->tx_fifo_errors);
+ print_human32(fp, 7, s->tx_window_errors);
+ print_human32(fp, 7, s->tx_heartbeat_errors);
+ if (carrier_changes)
+ print_human32(fp, 7, *(uint32_t*)RTA_DATA(carrier_changes));
+ } else {
+ fprintf(fp, " %-8u %-7u %-7u %-7u",
+ s->tx_aborted_errors,
+ s->tx_fifo_errors,
+ s->tx_window_errors,
+ s->tx_heartbeat_errors);
+ if (carrier_changes)
+ fprintf(fp, " %-7u",
+ *(uint32_t*)RTA_DATA(carrier_changes));
+ }
}
}
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 464009d..b05c6d0 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -16,6 +16,7 @@ ip-link \- network device configuration
.ti -8
.IR OPTIONS " := { "
\fB\-V\fR[\fIersion\fR] |
+\fB\-h\fR[\fIuman-readable\fR] |
\fB\-s\fR[\fItatistics\fR] |
\fB\-r\fR[\fIesolve\fR] |
\fB\-f\fR[\fIamily\fR] {
--
2.1.3
^ permalink raw reply related
* [net-next 2/2] sctp: replace seq_printf with seq_puts
From: Michele Baldessari @ 2014-10-30 9:29 UTC (permalink / raw)
To: Vlad Yasevich, Neil Horman
Cc: linux-sctp, netdev, David S. Miller, Michele Baldessari
In-Reply-To: <1414661356-17255-1-git-send-email-michele@acksyn.org>
Fixes checkpatch warning:
"WARNING: Prefer seq_puts to seq_printf"
Signed-off-by: Michele Baldessari <michele@acksyn.org>
---
net/sctp/proc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index bfb242af06ab..0697eda5aed8 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -490,14 +490,14 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
* Note: We don't have a way to tally this at the moment
* so lets just leave it as zero for the moment
*/
- seq_printf(seq, "0 ");
+ seq_puts(seq, "0 ");
/*
* remote address start time (START). This is also not
* currently implemented, but we can record it with a
* jiffies marker in a subsequent patch
*/
- seq_printf(seq, "0 ");
+ seq_puts(seq, "0 ");
/*
* The current state of this destination. I.e.
--
2.1.0
^ permalink raw reply related
* [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr
From: Michele Baldessari @ 2014-10-30 9:29 UTC (permalink / raw)
To: Vlad Yasevich, Neil Horman
Cc: linux-sctp, netdev, David S. Miller, Michele Baldessari
It is often quite helpful to be able to know the state of a transport
outside of the application itself (for troubleshooting purposes or for
monitoring purposes). Add it under /proc/net/sctp/remaddr.
Signed-off-by: Michele Baldessari <michele@acksyn.org>
---
net/sctp/proc.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 34229ee7f379..bfb242af06ab 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -417,7 +417,7 @@ static void *sctp_remaddr_seq_start(struct seq_file *seq, loff_t *pos)
if (*pos == 0)
seq_printf(seq, "ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX "
- "REM_ADDR_RTX START\n");
+ "REM_ADDR_RTX START STATE\n");
return (void *)pos;
}
@@ -497,7 +497,13 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
* currently implemented, but we can record it with a
* jiffies marker in a subsequent patch
*/
- seq_printf(seq, "0");
+ seq_printf(seq, "0 ");
+
+ /*
+ * The current state of this destination. I.e.
+ * SCTP_ACTIVE, SCTP_INACTIVE, ...
+ */
+ seq_printf(seq, "%d", tsp->state);
seq_printf(seq, "\n");
}
--
2.1.0
^ permalink raw reply related
* [PATCH] stmmac: pci: set default of the filter bins
From: Andy Shevchenko @ 2014-10-30 9:39 UTC (permalink / raw)
To: Giuseppe Cavallaro, netdev, Kweh Hock Leong, David S . Miller,
Vince Bridgers
Cc: Andy Shevchenko
The commit 3b57de958e2a brought the support for a different amount of the
filter bins, but didn't update the PCI driver accordingly. This patch appends
the default values when the device is enumerated via PCI bus.
Fixes: 3b57de958e2a (net: stmmac: Support devicetree configs for mcast and ucast filter entries)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 655a23b..7fc1bbf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -32,7 +32,10 @@ static struct stmmac_dma_cfg dma_cfg;
static void stmmac_default_data(void)
{
+ struct plat_stmmacenet_data *plat = &plat_dat;
+
memset(&plat_dat, 0, sizeof(struct plat_stmmacenet_data));
+
plat_dat.bus_id = 1;
plat_dat.phy_addr = 0;
plat_dat.interface = PHY_INTERFACE_MODE_GMII;
@@ -47,6 +50,12 @@ static void stmmac_default_data(void)
dma_cfg.pbl = 32;
dma_cfg.burst_len = DMA_AXI_BLEN_256;
plat_dat.dma_cfg = &dma_cfg;
+
+ /* Set default value for multicast hash bins */
+ plat->multicast_filter_bins = HASH_TABLE_SIZE;
+
+ /* Set default value for unicast filter entries */
+ plat->unicast_filter_entries = 1;
}
/**
--
2.1.1
^ permalink raw reply related
* Re: [PATCH 0/5] stmmac: pci: various cleanups and fixes
From: Andy Shevchenko @ 2014-10-30 9:41 UTC (permalink / raw)
To: Giuseppe CAVALLARO
Cc: netdev, Kweh Hock Leong, David S. Miller, Vince Bridgers
In-Reply-To: <5451F32C.8060403@st.com>
On Thu, 2014-10-30 at 09:13 +0100, Giuseppe CAVALLARO wrote:
> On 10/21/2014 6:35 PM, Andy Shevchenko wrote:
> > There are few cleanups and fixes regarding to stmmac PCI driver.
> > This has been tested on Intel Galileo board with 3.18-rc1 kernel.
>
> Hello Andy,
>
> for your next version I think that the patches should be for net-next
> tree.
> Maybe the following for net.git: "stmmac: pci: set default filter bins"
>
> I kindly ask you to detail fix and cleanup.
I just send the fix as a separate patch.
I'm going to reshuffle the others and maybe introduce few more. I would
like to get this soon since it would be a good base to go with Quark
support further.
>
> peppe
>
> >
> > Andy Shevchenko (5):
> > stmmac: pci: convert to use dev_pm_ops
> > stmmac: pci: use managed resources
> > stmmac: pci: convert to use dev_* macros
> > stmmac: pci: set default filter bins
> > stmmac: pci: remove FSF address
> >
> > drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 92 ++++++++----------------
> > 1 file changed, 30 insertions(+), 62 deletions(-)
> >
>
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
^ permalink raw reply
* Re: [PATCH v1 1/2] dtb: xgene: fix: Disable 10GbE and SGMII based 1GbE by default
From: Arnd Bergmann @ 2014-10-30 10:13 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Iyappan Subramanian, davem, netdev, devicetree, kchudgar, patches
In-Reply-To: <1414630580-24640-2-git-send-email-isubramanian@apm.com>
On Wednesday 29 October 2014 17:56:19 Iyappan Subramanian wrote:
> @@ -621,7 +621,7 @@
> };
> };
>
> - sgenet0: ethernet@1f210000 {
> + sgenet0: sgenet@1f210000 {
> compatible = "apm,xgene-enet";
> status = "disabled";
> reg = <0x0 0x1f210000 0x0 0x10000>,
>
This looks like you accidentally reverted a bug fix made earlier.
Network devices should always have the name 'ethernet@...'.
Arnd
^ permalink raw reply
* Re: [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr
From: Neil Horman @ 2014-10-30 10:24 UTC (permalink / raw)
To: Michele Baldessari; +Cc: Vlad Yasevich, linux-sctp, netdev, David S. Miller
In-Reply-To: <1414661356-17255-1-git-send-email-michele@acksyn.org>
On Thu, Oct 30, 2014 at 10:29:15AM +0100, Michele Baldessari wrote:
> It is often quite helpful to be able to know the state of a transport
> outside of the application itself (for troubleshooting purposes or for
> monitoring purposes). Add it under /proc/net/sctp/remaddr.
>
> Signed-off-by: Michele Baldessari <michele@acksyn.org>
> ---
> net/sctp/proc.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/net/sctp/proc.c b/net/sctp/proc.c
> index 34229ee7f379..bfb242af06ab 100644
> --- a/net/sctp/proc.c
> +++ b/net/sctp/proc.c
> @@ -417,7 +417,7 @@ static void *sctp_remaddr_seq_start(struct seq_file *seq, loff_t *pos)
>
> if (*pos == 0)
> seq_printf(seq, "ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX "
> - "REM_ADDR_RTX START\n");
> + "REM_ADDR_RTX START STATE\n");
>
> return (void *)pos;
> }
> @@ -497,7 +497,13 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
> * currently implemented, but we can record it with a
> * jiffies marker in a subsequent patch
> */
> - seq_printf(seq, "0");
> + seq_printf(seq, "0 ");
> +
> + /*
> + * The current state of this destination. I.e.
> + * SCTP_ACTIVE, SCTP_INACTIVE, ...
> + */
> + seq_printf(seq, "%d", tsp->state);
>
> seq_printf(seq, "\n");
> }
> --
> 2.1.0
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* [PATCH] net: gianfar: fix dma check map error when DMA_API_DEBUG is enabled
From: Kevin Hao @ 2014-10-30 10:25 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Claudiu Manoil
We need to use dma_mapping_error() to check the dma address returned
by dma_map_single/page(). Otherwise we would get warning like this:
WARNING: at lib/dma-debug.c:1140
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.18.0-rc2-next-20141029 #196
task: c0834300 ti: effe6000 task.ti: c0874000
NIP: c02b2c98 LR: c02b2c98 CTR: c030abc4
REGS: effe7d70 TRAP: 0700 Not tainted (3.18.0-rc2-next-20141029)
MSR: 00021000 <CE,ME> CR: 22044022 XER: 20000000
GPR00: c02b2c98 effe7e20 c0834300 00000098 00021000 00000000 c030b898 00000003
GPR08: 00000001 00000000 00000001 749eec9d 22044022 1001abe0 00000020 ef278678
GPR16: ef278670 ef278668 ef278660 070a8040 c087f99c c08cdc60 00029000 c0840d44
GPR24: c08be6e8 c0840000 effe7e78 ef041340 00000600 ef114e10 00000000 c08be6e0
NIP [c02b2c98] check_unmap+0x51c/0x9e4
LR [c02b2c98] check_unmap+0x51c/0x9e4
Call Trace:
[effe7e20] [c02b2c98] check_unmap+0x51c/0x9e4 (unreliable)
[effe7e70] [c02b31d8] debug_dma_unmap_page+0x78/0x8c
[effe7ed0] [c03d1640] gfar_clean_rx_ring+0x208/0x488
[effe7f40] [c03d1a9c] gfar_poll_rx_sq+0x3c/0xa8
[effe7f60] [c04f8714] net_rx_action+0xc0/0x178
[effe7f90] [c00435a0] __do_softirq+0x100/0x1fc
[effe7fe0] [c0043958] irq_exit+0xa4/0xc8
[effe7ff0] [c000d14c] call_do_irq+0x24/0x3c
[c0875e90] [c00048a0] do_IRQ+0x8c/0xf8
[c0875eb0] [c000ed10] ret_from_except+0x0/0x18
For TX, we need to unmap the pages which has already been mapped and
free the skb before return. For RX, just let the rxbdp as unempty.
We can retry to initialize it to empty in next round.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/net/ethernet/freescale/gianfar.c | 58 ++++++++++++++++++++++++++------
1 file changed, 47 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 4fdf0aa16978..04b647c4cef6 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -117,8 +117,8 @@ static void gfar_reset_task(struct work_struct *work);
static void gfar_timeout(struct net_device *dev);
static int gfar_close(struct net_device *dev);
struct sk_buff *gfar_new_skb(struct net_device *dev);
-static void gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
- struct sk_buff *skb);
+static int gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
+ struct sk_buff *skb);
static int gfar_set_mac_address(struct net_device *dev);
static int gfar_change_mtu(struct net_device *dev, int new_mtu);
static irqreturn_t gfar_error(int irq, void *dev_id);
@@ -219,9 +219,13 @@ static int gfar_init_bds(struct net_device *ndev)
netdev_err(ndev, "Can't allocate RX buffers\n");
return -ENOMEM;
}
- rx_queue->rx_skbuff[j] = skb;
- gfar_new_rxbdp(rx_queue, rxbdp, skb);
+ if (gfar_new_rxbdp(rx_queue, rxbdp, skb)) {
+ dev_kfree_skb_any(skb);
+ skb = NULL;
+ }
+
+ rx_queue->rx_skbuff[j] = skb;
}
rxbdp++;
@@ -2290,6 +2294,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
0,
frag_len,
DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(priv->dev, bufaddr)))
+ goto dma_map_err;
/* set the TxBD length and buffer pointer */
txbdp->bufPtr = bufaddr;
@@ -2339,8 +2345,12 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
fcb->ptp = 1;
}
- txbdp_start->bufPtr = dma_map_single(priv->dev, skb->data,
- skb_headlen(skb), DMA_TO_DEVICE);
+ bufaddr = dma_map_single(priv->dev, skb->data, skb_headlen(skb),
+ DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(priv->dev, bufaddr)))
+ goto dma_map_err;
+
+ txbdp_start->bufPtr = bufaddr;
/* If time stamping is requested one additional TxBD must be set up. The
* first TxBD points to the FCB and must have a data length of
@@ -2406,6 +2416,25 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
spin_unlock_irqrestore(&tx_queue->txlock, flags);
return NETDEV_TX_OK;
+
+dma_map_err:
+ txbdp = next_txbd(txbdp_start, base, tx_queue->tx_ring_size);
+ if (do_tstamp)
+ txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size);
+ for (i = 0; i < nr_frags; i++) {
+ lstatus = txbdp->lstatus;
+ if (!(lstatus & BD_LFLAG(TXBD_READY)))
+ break;
+
+ txbdp->lstatus = lstatus & ~BD_LFLAG(TXBD_READY);
+ bufaddr = txbdp->bufPtr;
+ dma_unmap_page(priv->dev, bufaddr, txbdp->length,
+ DMA_TO_DEVICE);
+ txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size);
+ }
+ gfar_wmb();
+ dev_kfree_skb_any(skb);
+ return NETDEV_TX_OK;
}
/* Stops the kernel queue, and halts the controller */
@@ -2606,8 +2635,8 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
netdev_tx_completed_queue(txq, howmany, bytes_sent);
}
-static void gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
- struct sk_buff *skb)
+static int gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
+ struct sk_buff *skb)
{
struct net_device *dev = rx_queue->dev;
struct gfar_private *priv = netdev_priv(dev);
@@ -2615,7 +2644,11 @@ static void gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
buf = dma_map_single(priv->dev, skb->data,
priv->rx_buffer_size, DMA_FROM_DEVICE);
+ if (dma_mapping_error(priv->dev, buf))
+ return -1;
+
gfar_init_rxbdp(rx_queue, bdp, buf);
+ return 0;
}
static struct sk_buff *gfar_alloc_skb(struct net_device *dev)
@@ -2851,10 +2884,13 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
}
- rx_queue->rx_skbuff[rx_queue->skb_currx] = newskb;
-
/* Setup the new bdp */
- gfar_new_rxbdp(rx_queue, bdp, newskb);
+ if (gfar_new_rxbdp(rx_queue, bdp, newskb)) {
+ dev_kfree_skb_any(newskb);
+ newskb = NULL;
+ }
+
+ rx_queue->rx_skbuff[rx_queue->skb_currx] = newskb;
/* Update to the next pointer */
bdp = next_bd(bdp, base, rx_queue->rx_ring_size);
--
1.9.3
^ permalink raw reply related
* Re: [net-next 2/2] sctp: replace seq_printf with seq_puts
From: Neil Horman @ 2014-10-30 10:26 UTC (permalink / raw)
To: Michele Baldessari; +Cc: Vlad Yasevich, linux-sctp, netdev, David S. Miller
In-Reply-To: <1414661356-17255-2-git-send-email-michele@acksyn.org>
On Thu, Oct 30, 2014 at 10:29:16AM +0100, Michele Baldessari wrote:
> Fixes checkpatch warning:
> "WARNING: Prefer seq_puts to seq_printf"
>
> Signed-off-by: Michele Baldessari <michele@acksyn.org>
> ---
> net/sctp/proc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sctp/proc.c b/net/sctp/proc.c
> index bfb242af06ab..0697eda5aed8 100644
> --- a/net/sctp/proc.c
> +++ b/net/sctp/proc.c
> @@ -490,14 +490,14 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
> * Note: We don't have a way to tally this at the moment
> * so lets just leave it as zero for the moment
> */
> - seq_printf(seq, "0 ");
> + seq_puts(seq, "0 ");
>
> /*
> * remote address start time (START). This is also not
> * currently implemented, but we can record it with a
> * jiffies marker in a subsequent patch
> */
> - seq_printf(seq, "0 ");
> + seq_puts(seq, "0 ");
>
> /*
> * The current state of this destination. I.e.
> --
> 2.1.0
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* Re: [PATCH 0/6 3.18] Fixes for iwlwifi drivers
From: Luca Coelho @ 2014-10-30 11:08 UTC (permalink / raw)
To: Larry Finger
Cc: linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, Murilo Opsfelder Araujo
In-Reply-To: <1414642633-3700-1-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
The cover-letter subject is wrong. :) I guess you meant
s/iwlwifi/rtlwifi/ ;)
--
Luca.
On Wed, 2014-10-29 at 23:17 -0500, Larry Finger wrote:
> Some late changes to rtlwifi made some of the older drivers not start correctly.
> These patches should be applied to 3.18.
>
> Signed-off-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
> Cc: Murilo Opsfelder Araujo <mopsfelder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> Larry Finger (6):
> rtlwifi: rtl8192ce: rtl8192de: rtl8192se: Fix handling for missing
> get_btc_status
> rtlwifi: rtl8192se: Fix duplicate calls to ieee80211_register_hw()
> rtlwifi: rtl8192se: Add missing section to read descriptor setting
> rtlwifi: rtl8192ce: Add missing section to read descriptor setting
> rtlwifi: rtl8821ae: Remove extra semicolons
> rtlwifi: rtl8192se: Fix firmware loading
>
> drivers/net/wireless/rtlwifi/core.c | 6 ++++++
> drivers/net/wireless/rtlwifi/core.h | 1 +
> drivers/net/wireless/rtlwifi/rtl8192ce/def.h | 2 ++
> drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 +
> drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 3 +++
> drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 1 +
> drivers/net/wireless/rtlwifi/rtl8192se/def.h | 2 ++
> drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 22 +++-------------------
> drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 3 +++
> drivers/net/wireless/rtlwifi/rtl8821ae/phy.c | 12 ++++++------
> 10 files changed, 28 insertions(+), 25 deletions(-)
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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: TCP NewReno and single retransmit
From: Marcelo Ricardo Leitner @ 2014-10-30 11:24 UTC (permalink / raw)
To: Neal Cardwell; +Cc: netdev, Yuchung Cheng, Eric Dumazet
In-Reply-To: <CADVnQynu7+wgkNTkdY=XDBeyWjFxpYYBjx=n98g1_awdG2OpnA@mail.gmail.com>
On 30-10-2014 00:03, Neal Cardwell wrote:
> On Mon, Oct 27, 2014 at 2:49 PM, Marcelo Ricardo Leitner
> <mleitner@redhat.com> wrote:
>> Hi,
>>
>> We have a report from a customer saying that on a very calm connection, like
>> having only a single data packet within some minutes, if this packet gets to
>> be re-transmitted, retrans_stamp is only cleared when the next acked packet
>> is received. But this may make we abort the connection too soon if this next
>> packet also gets lost, because the reference for the initial loss is still
>> for a big while ago..
> ...
>> @@ -2382,31 +2382,32 @@ static inline bool tcp_may_undo(const struct
>> tcp_sock *tp)
>> static bool tcp_try_undo_recovery(struct sock *sk)
> ...
>> if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) {
>> /* Hold old state until something *above* high_seq
>> * is ACKed. For Reno it is MUST to prevent false
>> * fast retransmits (RFC2582). SACK TCP is safe. */
>> tcp_moderate_cwnd(tp);
>> + tp->retrans_stamp = 0;
>> return true;
>> }
>> tcp_set_ca_state(sk, TCP_CA_Open);
>> return false;
>> }
>>
>> We would still hold state, at least part of it.. WDYT?
>
> This approach sounds OK to me as long as we include a check of
> tcp_any_retrans_done(), as we do in the similar code paths (for
> motivation, see the comment above tcp_any_retrans_done()).
Yes, okay. I thought that this would be taken care of already by then but
reading the code again now after your comment, I can see what you're saying.
Thanks.
> So it sounds fine to me if you change that one new line to the following 2:
>
> + if (!tcp_any_retrans_done(sk))
> + tp->retrans_stamp = 0;
Will do.
> Nice catch!
A good part of it (including the diagram) was done by customer. :)
I'll post the patch as soon as we sync with them (credits).
Marcelo
^ permalink raw reply
* [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene
This series contains updates to e1000, igb and ixgbe.
Francesco Ruggeri fixes an issue with e1000 where in a VM the driver did
not support unicast filtering.
Roman Gushchin fixes an issue with igb where the driver was re-using
mapped pages so that packets were still getting dropped even if all
the memory issues are gone and there is free memory.
Junwei Zhang found where in the ixgbe_clean_rx_ring() we were repeating
the assignment of NULL to the receive buffer skb and fixes it.
Emil fixes a race condition between setup_link and SFP detection routine
in the watchdog when setting the advertised speed.
The following are changes since commit d70127e8a942364de8dd140fe73893efda363293:
inet: frags: remove the WARN_ON from inet_evict_bucket
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net master
Emil Tantilov (1):
ixgbe: fix race when setting advertised speed
Francesco Ruggeri (1):
e1000: unset IFF_UNICAST_FLT on WMware 82545EM
Junwei Zhang (1):
ixgbe: need not repeat init skb with NULL
Roman Gushchin (1):
igb: don't reuse pages with pfmemalloc flag
drivers/net/ethernet/intel/e1000/e1000_main.c | 5 ++++-
drivers/net/ethernet/intel/igb/igb_main.c | 6 +++++-
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
4 files changed, 14 insertions(+), 3 deletions(-)
--
1.9.3
^ permalink raw reply
* [net 1/4] e1000: unset IFF_UNICAST_FLT on WMware 82545EM
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
To: davem
Cc: Francesco Ruggeri, netdev, nhorman, sassmann, jogreene,
Francesco Ruggeri, Jeff Kirsher
In-Reply-To: <1414672436-20616-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Francesco Ruggeri <fruggeri@aristanetworks.com>
VMWare's e1000 implementation does not seem to support unicast filtering.
This can be observed by configuring a macvlan interface on eth0 in a VM in
VMWare Fusion 5.0.5, and trying to use that interface instead of eth0.
Tested on 3.16.
Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000/e1000_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 5f6aded..24f3986 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1075,7 +1075,10 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_HW_CSUM |
NETIF_F_SG);
- netdev->priv_flags |= IFF_UNICAST_FLT;
+ /* Do not set IFF_UNICAST_FLT for VMWare's 82545EM */
+ if (hw->device_id != E1000_DEV_ID_82545EM_COPPER ||
+ hw->subsystem_vendor_id != PCI_VENDOR_ID_VMWARE)
+ netdev->priv_flags |= IFF_UNICAST_FLT;
adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw);
--
1.9.3
^ permalink raw reply related
* [net 4/4] ixgbe: fix race when setting advertised speed
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1414672436-20616-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Emil Tantilov <emil.s.tantilov@intel.com>
Following commands:
modprobe ixgbe
ifconfig ethX up
ethtool -s ethX advertise 0x020
can lead to "setup link failed with code -14" error due to the setup_link
call racing with the SFP detection routine in the watchdog.
This patch resolves this issue by protecting the setup_link call with check
for __IXGBE_IN_SFP_INIT.
Reported-by: Scott Harrison <scoharr2@cisco.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 3ce4a25..0ae038b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -342,12 +342,16 @@ static int ixgbe_set_settings(struct net_device *netdev,
if (old == advertised)
return err;
/* this sets the link speed and restarts auto-neg */
+ while (test_and_set_bit(__IXGBE_IN_SFP_INIT, &adapter->state))
+ usleep_range(1000, 2000);
+
hw->mac.autotry_restart = true;
err = hw->mac.ops.setup_link(hw, advertised, true);
if (err) {
e_info(probe, "setup link failed with code %d\n", err);
hw->mac.ops.setup_link(hw, old, true);
}
+ clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
} else {
/* in this case we currently only support 10Gb/FULL */
u32 speed = ethtool_cmd_speed(ecmd);
--
1.9.3
^ permalink raw reply related
* [net 2/4] igb: don't reuse pages with pfmemalloc flag
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
To: davem; +Cc: Roman Gushchin, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1414672436-20616-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Roman Gushchin <klamm@yandex-team.ru>
Incoming packet is dropped silently by sk_filter(), if the skb was
allocated from pfmemalloc reserves and the corresponding socket is
not marked with the SOCK_MEMALLOC flag.
Igb driver allocates pages for DMA with __skb_alloc_page(), which
calls alloc_pages_node() with the __GFP_MEMALLOC flag. So, in case
of OOM condition, igb can get pages with pfmemalloc flag set.
If an incoming packet hits the pfmemalloc page and is large enough
(small packets are copying into the memory, allocated with
netdev_alloc_skb_ip_align(), so they are not affected), it will be
dropped.
This behavior is ok under high memory pressure, but the problem is
that the igb driver reuses these mapped pages. So, packets are still
dropping even if all memory issues are gone and there is a plenty
of free memory.
In my case, some TCP sessions hang on a small percentage (< 0.1%)
of machines days after OOMs.
Fix this by avoiding reuse of such pages.
Signed-off-by: Roman Gushchin <klamm@yandex-team.ru>
Tested-by: Aaron Brown "aaron.f.brown@intel.com"
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a21b144..a2d72a8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6537,6 +6537,9 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer,
if (unlikely(page_to_nid(page) != numa_node_id()))
return false;
+ if (unlikely(page->pfmemalloc))
+ return false;
+
#if (PAGE_SIZE < 8192)
/* if we are only owner of page we can reuse it */
if (unlikely(page_count(page) != 1))
@@ -6603,7 +6606,8 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
/* we can reuse buffer as-is, just make sure it is local */
- if (likely(page_to_nid(page) == numa_node_id()))
+ if (likely((page_to_nid(page) == numa_node_id()) &&
+ !page->pfmemalloc))
return true;
/* this page cannot be reused so discard it */
--
1.9.3
^ permalink raw reply related
* [net 3/4] ixgbe: need not repeat init skb with NULL
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
To: davem
Cc: Junwei Zhang, netdev, nhorman, sassmann, jogreene, Martin Zhang,
Jeff Kirsher
In-Reply-To: <1414672436-20616-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Junwei Zhang <linggao.zjw@alibaba-inc.com>
Signed-off-by: Martin Zhang <martinbj2008@gmail.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index fec5212..d2df4e3 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4321,8 +4321,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)
IXGBE_CB(skb)->page_released = false;
}
dev_kfree_skb(skb);
+ rx_buffer->skb = NULL;
}
- rx_buffer->skb = NULL;
if (rx_buffer->dma)
dma_unmap_page(dev, rx_buffer->dma,
ixgbe_rx_pg_size(rx_ring),
--
1.9.3
^ permalink raw reply related
* Re: [PATCH net] gre: Fix regression in gretap TSO support
From: Neal Cardwell @ 2014-10-30 13:51 UTC (permalink / raw)
To: Pravin Shelar
Cc: alexander.duyck, netdev, David Miller, H.K. Jerry Chu,
Eric Dumazet, Alexander Duyck
In-Reply-To: <CALnjE+oK-O-PJH_u50HqQQLnvh+GyeCnv6tNQf5qzL0o1RiPQg@mail.gmail.com>
On Thu, Oct 30, 2014 at 1:14 AM, Pravin Shelar <pshelar@nicira.com> wrote:
> On Wed, Oct 29, 2014 at 8:26 PM, <alexander.duyck@gmail.com> wrote:
>> From: Alexander Duyck <alexander.h.duyck@redhat.com>
>>
>> On recent kernels I found that TSO on gretap interfaces didn't work. After
>> bisecting it I found that commit b884b1a4 had introduced a regression in
>> which the Ethernet header was being included in the GRE header length.
>>
>> This change corrects that by basing the GRE header length on the inner mac
>> header in the case of GRE tunnels using transparent Ethernet bridging, and
>> uses the network header for all other GRE tunnel types.
>>
>> Fixes: b884b1a4 ("gre_offload: simplify GRE header length calculation in gre_gso_segment()")
Hmm. There may be other protocols, either now or in the future, where
we want to be able to have a mac header inside the GRE header, rather
than a network header. AFAICT it would be safer to revert b884b1a4,
and go back to the previous code (from c50cd357), where we parse the
GRE header to figure out its length.
neal
^ permalink raw reply
* [PATCH net 1/2] net/mlx4_en: Don't attempt to TX offload the outer UDP checksum for VXLAN
From: Or Gerlitz @ 2014-10-30 13:59 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Matan Barak, Amir Vadai, Saeed Mahameed, Or Gerlitz
In-Reply-To: <1414677568-28409-1-git-send-email-ogerlitz@mellanox.com>
For VXLAN/NVGRE encapsulation, the current HW doesn't support offloading
both the outer UDP TX checksum and the inner TCP/UDP TX checksum.
The driver doesn't advertize SKB_GSO_UDP_TUNNEL_CSUM, however we are wrongly
telling the HW to offload the outer UDP checksum for encapsulated packets,
fix that.
Fixes: 837052d0ccc5 ('net/mlx4_en: Add netdev support for TCP/IP
offloads of vxlan tunneling')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 34c1378..454d9fe 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -836,8 +836,11 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
* whether LSO is used */
tx_desc->ctrl.srcrb_flags = priv->ctrl_flags;
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
- tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM |
- MLX4_WQE_CTRL_TCP_UDP_CSUM);
+ if (!skb->encapsulation)
+ tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM |
+ MLX4_WQE_CTRL_TCP_UDP_CSUM);
+ else
+ tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM);
ring->tx_csum++;
}
--
1.7.1
^ permalink raw reply related
* [PATCH net 0/2] mlx4 driver encapsulation/steering fixes
From: Or Gerlitz @ 2014-10-30 13:59 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Matan Barak, Amir Vadai, Saeed Mahameed, Or Gerlitz
Hi Dave,
The 1st patch fixes a bug in the TX path that supports offloading the
TX checksum of (VXLAN) encapsulated TCP packets. It turns out that the
bug is revealed only when the receiver runs in non-offloaded mode, so
we somehow missed it so far... please queue it for -stable >= 3.14
The 2nd patch makes sure not to leak steering entry on error flow,
please queue it to 3.17-stable
thanks,
Or.
Or Gerlitz (2):
net/mlx4_en: Don't attempt to TX offload the outer UDP checksum for VXLAN
mlx4: Avoid leaking steering rules on flow creation error flow
drivers/infiniband/hw/mlx4/main.c | 10 ++++++++--
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 7 +++++--
drivers/net/ethernet/mellanox/mlx4/mcg.c | 4 ++++
3 files changed, 17 insertions(+), 4 deletions(-)
^ permalink raw reply
* [PATCH net 2/2] mlx4: Avoid leaking steering rules on flow creation error flow
From: Or Gerlitz @ 2014-10-30 13:59 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Matan Barak, Amir Vadai, Saeed Mahameed, Or Gerlitz
In-Reply-To: <1414677568-28409-1-git-send-email-ogerlitz@mellanox.com>
If mlx4_ib_create_flow() attempts to create > 1 rules with the
firmware, and one of these registrations fail, we leaked the
already created flow rules.
One example of the leak is when the registration of the VXLAN ghost
steering rule fails, we didn't unregister the original rule requested
by the user, introduced in commit d2fce8a9060d "mlx4: Set
user-space raw Ethernet QPs to properly handle VXLAN traffic".
While here, add dump of the VXLAN portion of steering rules
so it can actually be seen when flow creation fails.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
drivers/infiniband/hw/mlx4/main.c | 10 ++++++++--
drivers/net/ethernet/mellanox/mlx4/mcg.c | 4 ++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index bda5994..8b72cf3 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1173,18 +1173,24 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
err = __mlx4_ib_create_flow(qp, flow_attr, domain, type[i],
&mflow->reg_id[i]);
if (err)
- goto err_free;
+ goto err_create_flow;
i++;
}
if (i < ARRAY_SIZE(type) && flow_attr->type == IB_FLOW_ATTR_NORMAL) {
err = mlx4_ib_tunnel_steer_add(qp, flow_attr, &mflow->reg_id[i]);
if (err)
- goto err_free;
+ goto err_create_flow;
+ i++;
}
return &mflow->ibflow;
+err_create_flow:
+ while (i) {
+ (void)__mlx4_ib_destroy_flow(to_mdev(qp->device)->dev, mflow->reg_id[i]);
+ i--;
+ }
err_free:
kfree(mflow);
return ERR_PTR(err);
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index ca0f98c..8728431 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -955,6 +955,10 @@ static void mlx4_err_rule(struct mlx4_dev *dev, char *str,
cur->ib.dst_gid_msk);
break;
+ case MLX4_NET_TRANS_RULE_ID_VXLAN:
+ len += snprintf(buf + len, BUF_SIZE - len,
+ "VNID = %d ", be32_to_cpu(cur->vxlan.vni));
+ break;
case MLX4_NET_TRANS_RULE_ID_IPV6:
break;
--
1.7.1
^ 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