* 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
* [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
* [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
* [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
* [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
* [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 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
* 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 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
* [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
* Re: [PATCH 0/5] stmmac: pci: various cleanups and fixes
From: Giuseppe CAVALLARO @ 2014-10-30 8:13 UTC (permalink / raw)
To: Andy Shevchenko, netdev, Kweh Hock Leong, David S. Miller,
Vince Bridgers
In-Reply-To: <1413909333-16380-1-git-send-email-andriy.shevchenko@linux.intel.com>
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.
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(-)
>
^ permalink raw reply
* Re: [PATCH 2/5] stmmac: pci: use managed resources
From: Andy Shevchenko @ 2014-10-30 8:05 UTC (permalink / raw)
To: Giuseppe CAVALLARO
Cc: Sergei Shtylyov, netdev, Kweh Hock Leong, David S. Miller,
Vince Bridgers, Rayagond K
In-Reply-To: <544E6486.6040502@st.com>
On Mon, 2014-10-27 at 16:28 +0100, Giuseppe CAVALLARO wrote:
> On 10/22/2014 10:36 AM, Andy Shevchenko wrote:
> > So, I was trying to find any specification on public regarding to boards
> > that have this IP, no luck so far. I guess that that code was created
> > due to XILINX FPGA usage which probably can provide any BAR user wants
> > to. Thus, I imply that in real applications the BAR most probably will
> > be 0. However, I left variable which can be overridden in future
> > (regarding to PCI ID).
> >
> > It would be nice to hear someone from ST about this. Giuseppe?
>
> Hello Andy
>
> this chip is on ST SoCs since long time but embedded. I have no PCI
> card. Added Rayagond on copy too
Rayagond, what do you think about changing an approach that is used to
get resources from PCI?
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
^ permalink raw reply
* Re: [patch] Bluetooth: 6lowpan: use after free in disconnect_devices()
From: Jukka Rissanen @ 2014-10-30 7:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, David S. Miller,
linux-bluetooth, netdev, linux-kernel, kernel-janitors
In-Reply-To: <20141029161057.GF5290@mwanda>
Hi Dan,
On ke, 2014-10-29 at 19:10 +0300, Dan Carpenter wrote:
> This was accidentally changed from list_for_each_entry_safe() to
> list_for_each_entry() so now it has a use after free bug. I've changed
> it back.
Good catch! Thanks for the patch.
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
>
> Fixes: 90305829635d ('Bluetooth: 6lowpan: Converting rwlocks to use RCU')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index 7254bdd..eef298d 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -1383,7 +1383,7 @@ static const struct file_operations lowpan_control_fops = {
>
> static void disconnect_devices(void)
> {
> - struct lowpan_dev *entry, *new_dev;
> + struct lowpan_dev *entry, *tmp, *new_dev;
> struct list_head devices;
>
> INIT_LIST_HEAD(&devices);
> @@ -1408,7 +1408,7 @@ static void disconnect_devices(void)
>
> rcu_read_unlock();
>
> - list_for_each_entry(entry, &devices, list) {
> + list_for_each_entry_safe(entry, tmp, &devices, list) {
> ifdown(entry->netdev);
> BT_DBG("Unregistering netdev %s %p",
> entry->netdev->name, entry->netdev);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Cheers,
Jukka
^ permalink raw reply
* Re: [PATCH net-next] mlx4: use napi_schedule_irqoff()
From: Amir Vadai @ 2014-10-30 7:30 UTC (permalink / raw)
To: Eric Dumazet, David Miller; +Cc: netdev
In-Reply-To: <1414626885.631.102.camel@edumazet-glaptop2.roam.corp.google.com>
On 10/30/2014 1:54 AM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> mlx4_en_rx_irq() and mlx4_en_tx_irq() run from hard interrupt context.
>
> They can use napi_schedule_irqoff() instead of napi_schedule()
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 ++--
> drivers/net/ethernet/mellanox/mlx4/en_tx.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
Acked-By: Amir Vadai <amirv@mellanox.com>
Thanks,
Amir
^ permalink raw reply
* Re: net: fec: fix regression on i.MX28 introduced by rx_copybreak support
From: Lothar Waßmann @ 2014-10-30 6:51 UTC (permalink / raw)
To: David Miller
Cc: netdev, rmk+kernel, Frank.Li, fabio.estevam, linux-kernel,
linux-arm-kernel
In-Reply-To: <20141029.153430.1036004676442879956.davem@davemloft.net>
Hi,
David Miller wrote:
> From: Lothar Waßmann <LW@KARO-electronics.de>
> Date: Tue, 28 Oct 2014 14:22:55 +0100
>
> > Changes wrt. v1:
> > - added some cleanup patches
> > - simplify handling of 'quirks' flags as suggested by Russell King.
> > - remove DIV_ROUND_UP() from byte swapping loop as suggested by
> > Eric Dumazet
> >
> > Changes wrt. v2:
> > - rebased against next-20141028
> > - added some more cleanups in fec.h
> > - removed unused return value from swap_buffer()
> > - fixed messed swab32s() call in swap_buffer2()
> > - fixed messed up setup of fep->quirks
> >
>
> It is not appropriate to mix cleanups and bonafide bug fixes.
>
> I want to see only bug fixes targetted at 'net'. You can later
> submit the cleanups to 'net-next'.
>
OK.
> Also, I don't thnk your DIV_ROUND_UP() eliminate for the loop
> in swap_buffer() is valid. The whole point is that the current
> code handles buffers which have a length which is not a multiple
> of 4 properly, after your change it will no longer do so.
>
Do you really think so?
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
^ permalink raw reply
* [PATCH v2] PPC: bpf_jit_comp: add SKF_AD_PKTTYPE instruction
From: Denis Kirjanov @ 2014-10-30 6:12 UTC (permalink / raw)
To: netdev
Cc: linuxppc-dev, Denis Kirjanov, Alexei Starovoitov,
Michael Ellerman, Matt Evans
Add BPF extension SKF_AD_PKTTYPE to ppc JIT to load
skb->pkt_type field.
Before:
[ 88.262622] test_bpf: #11 LD_IND_NET 86 97 99 PASS
[ 88.265740] test_bpf: #12 LD_PKTTYPE 109 107 PASS
After:
[ 80.605964] test_bpf: #11 LD_IND_NET 44 40 39 PASS
[ 80.607370] test_bpf: #12 LD_PKTTYPE 9 9 PASS
CC: Alexei Starovoitov<alexei.starovoitov@gmail.com>
CC: Michael Ellerman<mpe@ellerman.id.au>
Cc: Matt Evans <matt@ozlabs.org>
Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
v2: Added test rusults
---
arch/powerpc/include/asm/ppc-opcode.h | 1 +
arch/powerpc/net/bpf_jit.h | 7 +++++++
arch/powerpc/net/bpf_jit_comp.c | 5 +++++
3 files changed, 13 insertions(+)
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 6f85362..1a52877 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -204,6 +204,7 @@
#define PPC_INST_ERATSX_DOT 0x7c000127
/* Misc instructions for BPF compiler */
+#define PPC_INST_LBZ 0x88000000
#define PPC_INST_LD 0xe8000000
#define PPC_INST_LHZ 0xa0000000
#define PPC_INST_LHBRX 0x7c00062c
diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index 9aee27c..c406aa9 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -87,6 +87,9 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
#define PPC_STD(r, base, i) EMIT(PPC_INST_STD | ___PPC_RS(r) | \
___PPC_RA(base) | ((i) & 0xfffc))
+
+#define PPC_LBZ(r, base, i) EMIT(PPC_INST_LBZ | ___PPC_RT(r) | \
+ ___PPC_RA(base) | IMM_L(i))
#define PPC_LD(r, base, i) EMIT(PPC_INST_LD | ___PPC_RT(r) | \
___PPC_RA(base) | IMM_L(i))
#define PPC_LWZ(r, base, i) EMIT(PPC_INST_LWZ | ___PPC_RT(r) | \
@@ -96,6 +99,10 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
#define PPC_LHBRX(r, base, b) EMIT(PPC_INST_LHBRX | ___PPC_RT(r) | \
___PPC_RA(base) | ___PPC_RB(b))
/* Convenience helpers for the above with 'far' offsets: */
+#define PPC_LBZ_OFFS(r, base, i) do { if ((i) < 32768) PPC_LBZ(r, base, i); \
+ else { PPC_ADDIS(r, base, IMM_HA(i)); \
+ PPC_LBZ(r, r, IMM_L(i)); } } while(0)
+
#define PPC_LD_OFFS(r, base, i) do { if ((i) < 32768) PPC_LD(r, base, i); \
else { PPC_ADDIS(r, base, IMM_HA(i)); \
PPC_LD(r, r, IMM_L(i)); } } while(0)
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index cbae2df..d110e28 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -407,6 +407,11 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
PPC_LHZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
queue_mapping));
break;
+ case BPF_ANC | SKF_AD_PKTTYPE:
+ PPC_LBZ_OFFS(r_A, r_skb, PKT_TYPE_OFFSET());
+ PPC_ANDI(r_A, r_A, PKT_TYPE_MAX);
+ PPC_SRWI(r_A, r_A, 5);
+ break;
case BPF_ANC | SKF_AD_CPU:
#ifdef CONFIG_SMP
/*
--
2.1.0
^ permalink raw reply related
* [PATCH net-next] tipc: spelling errors
From: Stephen Hemminger @ 2014-10-30 5:58 UTC (permalink / raw)
To: Jon Maloy, Allan Stephens; +Cc: netdev
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/tipc/msg.c | 4 ++--
net/tipc/socket.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--- a/net/tipc/socket.c 2014-10-27 21:06:04.243288996 -0700
+++ b/net/tipc/socket.c 2014-10-27 21:06:04.239288981 -0700
@@ -1556,7 +1556,7 @@ static void tipc_data_ready(struct sock
* @tsk: TIPC socket
* @msg: message
*
- * Returns 0 (TIPC_OK) if everyting ok, -TIPC_ERR_NO_PORT otherwise
+ * Returns 0 (TIPC_OK) if everything ok, -TIPC_ERR_NO_PORT otherwise
*/
static int filter_connect(struct tipc_sock *tsk, struct sk_buff **buf)
{
--- a/net/tipc/msg.c 2014-10-27 21:06:04.243288996 -0700
+++ b/net/tipc/msg.c 2014-10-27 21:06:04.239288981 -0700
@@ -91,7 +91,7 @@ struct sk_buff *tipc_msg_create(uint use
* @*headbuf: in: NULL for first frag, otherwise value returned from prev call
* out: set when successful non-complete reassembly, otherwise NULL
* @*buf: in: the buffer to append. Always defined
- * out: head buf after sucessful complete reassembly, otherwise NULL
+ * out: head buf after successful complete reassembly, otherwise NULL
* Returns 1 when reassembly complete, otherwise 0
*/
int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
@@ -311,7 +311,7 @@ bool tipc_msg_bundle(struct sk_buff *bbu
* @mtu: max allowable size for the bundle buffer, inclusive header
* @dnode: destination node for message. (Not always present in header)
* Replaces buffer if successful
- * Returns true if sucess, otherwise false
+ * Returns true if success, otherwise false
*/
bool tipc_msg_make_bundle(struct sk_buff **buf, u32 mtu, u32 dnode)
{
^ permalink raw reply
* Re: [PATCH iproute2] xfrm: add support of ESN and anti-replay window
From: Stephen Hemminger @ 2014-10-30 5:54 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: shemminger, netdev, dingzhi, Adrien Mazarguil
In-Reply-To: <1413796984-9867-1-git-send-email-nicolas.dichtel@6wind.com>
On Mon, 20 Oct 2014 11:23:04 +0200
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
> From: dingzhi <zhi.ding@6wind.com>
>
> This patch allows to configure ESN and anti-replay window.
>
> 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>
Applied, but please also send patch to ma
^ permalink raw reply
* Re: [PATCH iproute2-next] ss: output dctcp diag information
From: Stephen Hemminger @ 2014-10-30 5:53 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: netdev, Florian Westphal
In-Reply-To: <1411980452-4669-1-git-send-email-dborkman@redhat.com>
On Mon, 29 Sep 2014 10:47:32 +0200
Daniel Borkmann <dborkman@redhat.com> wrote:
> Dump useful DCTCP state/debug information gathered from diag.
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied, I had already got the header files from regular kernel headers update.
^ permalink raw reply
* Re: [PATCH iproute2] netlink: extend buffers to 16K
From: Stephen Hemminger @ 2014-10-30 5:52 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1413045793.9362.48.camel@edumazet-glaptop2.roam.corp.google.com>
On Sat, 11 Oct 2014 09:43:13 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
> lengths"), kernel is able to send up to 16K in netlink replies.
>
> This change enables iproute2 commands to get bigger chunks,
> without breaking compatibility with old kernels.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH iproute2] xfrm: add support of ESN and anti-replay window
From: Stephen Hemminger @ 2014-10-30 5:51 UTC (permalink / raw)
To: Nicolas Dichtel; +Cc: shemminger, netdev, dingzhi, Adrien Mazarguil
In-Reply-To: <1413796984-9867-1-git-send-email-nicolas.dichtel@6wind.com>
On Mon, 20 Oct 2014 11:23:04 +0200
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
> From: dingzhi <zhi.ding@6wind.com>
>
> This patch allows to configure ESN and anti-replay window.
>
> 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>
Applied, but please also send patch to manual.
^ permalink raw reply
* Re: [PATCH iproute2] ss: Identify a lot of netlink protocol names
From: Stephen Hemminger @ 2014-10-30 5:49 UTC (permalink / raw)
To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1413478018-12373-1-git-send-email-vadim4j@gmail.com>
On Thu, 16 Oct 2014 19:46:58 +0300
Vadim Kochan <vadim4j@gmail.com> wrote:
> There were only few Netlink protocol names:
>
> rtnl, fw, tcpdiag
>
> which were printed on output.
> So added the other ones.
>
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Please make this driven off of a file in /etc/iproute2/ rather than
hard coding a big switch in the code.
^ permalink raw reply
* Re: [PATCHv2 1/1] ip-link: add switch to show human readable output
From: Stephen Hemminger @ 2014-10-30 5:47 UTC (permalink / raw)
To: Christian Hesse; +Cc: netdev
In-Reply-To: <1412980056-7643-1-git-send-email-mail@eworm.de>
On Sat, 11 Oct 2014 00:27:36 +0200
Christian Hesse <mail@eworm.de> wrote:
> Byte and packet count can increase to really big numbers. This adds a
> switch to show human readable output.
>
> % ip -s link ls wl
> 4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT 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
> 113570876 156975 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 27290790 94313 0 0 0 0
> % ip -s -h link ls wl
> 4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT 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
> 122368888 169840 0 0 0 0
> 116.7Mi 165.8Ki 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 29087507 102309 0 0 0 0
> 27.7Mi 99.9Ki 0 0 0 0
> ---
I like the idea as a concept but there are two issues:
1. The IEC suffix is a rarely used thing and is non-standard
for communications where K = 1000 M = 1000000 etc.
Please just use standard suffices
2. Don't double print the data, if the user asks for human
format, only show the human format.
^ permalink raw reply
* Re: [PATCH net] gre: Fix regression in gretap TSO support
From: Pravin Shelar @ 2014-10-30 5:14 UTC (permalink / raw)
To: alexander.duyck
Cc: netdev, David Miller, H.K. Jerry Chu, Eric Dumazet,
Alexander Duyck, Neal Cardwell
In-Reply-To: <20141030032430.4452.46388.stgit@ahduyck-workstation.home>
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()")
> Cc: Neal Cardwell <ncardwell@google.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: H.K. Jerry Chu <hkchu@google.com>
> Cc: Pravin B Shelar <pshelar@nicira.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Patch also fixed problem with ovs-gre.
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Thanks.
> ---
> net/ipv4/gre_offload.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
> index f6e345c..67a1f66 100644
> --- a/net/ipv4/gre_offload.c
> +++ b/net/ipv4/gre_offload.c
> @@ -47,7 +47,10 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
>
> greh = (struct gre_base_hdr *)skb_transport_header(skb);
>
> - ghl = skb_inner_network_header(skb) - skb_transport_header(skb);
> + if (greh->protocol == htons(ETH_P_TEB))
> + ghl = skb_inner_mac_header(skb) - skb_transport_header(skb);
> + else
> + ghl = skb_inner_network_header(skb) - skb_transport_header(skb);
> if (unlikely(ghl < sizeof(*greh)))
> goto out;
>
>
^ permalink raw reply
* Re: [PATCH] PPC: bpf_jit_comp: add SKF_AD_PKTTYPE instruction
From: Michael Ellerman @ 2014-10-30 4:44 UTC (permalink / raw)
To: Denis Kirjanov; +Cc: linuxppc-dev, netdev, Matt Evans
In-Reply-To: <CAOJe8K0t3G-bHm_24GjrTp9mmKnYZS1_bdGgrwQBLjC_s5is6w@mail.gmail.com>
On Wed, 2014-10-29 at 13:21 +0400, Denis Kirjanov wrote:
> Any feedback from PPC folks?
Hi Denis,
I had a look at this, but I don't know enough about BPF to comment.
Maybe you can explain what a BPF_ANC | SKF_AD_PKTTYPE means and perhaps then we
can guess if the code is correct.
I think testing it is the best option :)
cheers
^ 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