* [PATCH v4 1/1] ip-link: add switch to show human readable output
From: Christian Hesse @ 2014-10-31 21:33 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Christian Hesse
In-Reply-To: <20141031123115.4cd13371@urahara>
Byte and packet count can increase to really big numbers. This adds a
switch to show human readable output.
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
1523846973 3969051 0 0 0 0
TX: bytes packets errors dropped carrier collsns
8710088361 6077735 0 0 0 0
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
1.5G 3.9M 0 0 0 0
TX: bytes packets errors dropped carrier collsns
8.7G 6.0M 0 0 0 0
---
include/utils.h | 1 +
ip/ip.c | 5 +
ip/ipaddress.c | 286 ++++++++++++++++++++++++++++++++++++++------------
man/man8/ip-link.8.in | 7 ++
4 files changed, 233 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..4b8ddca 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -319,107 +319,261 @@ static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
}
}
+
+static void print_human64(FILE *fp, int length, uint64_t count)
+{
+ char * prefix = "kMGTPE";
+ int written = 0, i;
+ uint64_t powi = 1;
+
+ if (count < 1000) {
+ /* we are below 1000, so no precision and no prefix */
+ written = fprintf(fp, "%"PRIu64, count);
+ } else {
+ /* increase value by a factor of 1000 and print
+ * if result is something a human can read */
+ for (i = 0; i < 6; i++) {
+ powi *= 1000;
+ if (count / 1000 < powi) {
+ written = fprintf(fp, "%"PRIu64".%"PRIu64"%c",
+ count / powi, count * 10 / powi % 10, *prefix);
+ break;
+ }
+ prefix++;
+ }
+ }
+
+ do {
+ fputc(' ', fp);
+ } while (written++ < length);
+}
+
+static void print_human32(FILE *fp, int length, uint32_t count)
+{
+ char * prefix = "KMG";
+ int written = 0, i;
+ uint32_t powi = 1;
+
+ if (count < 1000) {
+ /* we are below 1000, so no precision and no prefix */
+ written = fprintf(fp, "%u", count);
+ } else {
+ /* increase value by a factor of 1000 and print
+ * if result is something a human can read */
+ for (i = 0; i < 3; i++) {
+ powi *= 1000;
+ if (count / 1000 < powi) {
+ written = fprintf(fp, "%u.%u%c",
+ count / powi, count * 10 / powi % 10, *prefix);
+ break;
+ }
+ prefix++;
+ }
+ }
+
+ 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..9747c4c 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] {
@@ -660,6 +661,12 @@ specifies what group of devices to show.
.B up
only display running interfaces.
+.SH "NOTES"
+Human readable values are calculated with SI prefixes, so with a decimal
+base, not binary. (This is unlike
+.BR ifconfig (8)
+, with uses binary prefix.) 1,000 bytes are 1 kB, 1,000 kB are 1 MB, ...
+
.SH "EXAMPLES"
.PP
ip link show
--
2.1.3
^ permalink raw reply related
* Re: DMA allocations from CMA and fatal_signal_pending check
From: Maxime Bizon @ 2014-10-31 21:07 UTC (permalink / raw)
To: Joonsoo Kim
Cc: Florian Fainelli, lauraa, netdev@vger.kernel.org, linux-kernel,
mina86, linux-mm, aneesh.kumar, Gregory Fong, gioh.kim, akpm,
Brian Norris, linux-arm-kernel, m.szyprowski
In-Reply-To: <20141031082818.GB14642@js1304-P5Q-DELUXE>
On Fri, 2014-10-31 at 17:28 +0900, Joonsoo Kim wrote:
> I guess that it is okay that bcm_sysport_open() return -EINTR?
actually, since CMA alloc is hidden behind dma_alloc_coherent(), all you
get back is NULL and then return ENOMEM.
--
Maxime
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: DMA-API warning from sunhme - unchecked dma_map_single error
From: Meelis Roos @ 2014-10-31 21:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, sparclinux
In-Reply-To: <20141031205258.C3A2F7FE2E@ilves.cyber.ee>
>> It seems to be correct warning - dma_map_single is used unchecked in
>> sunhme.c. I can try fixing it - the error handling will be the only
>> problem. Is it considered worthwile?
>
> Can you test this patch?
It works fine on E3500 where I had many debugging options on and caught
it. No warnings, network still works.
--
Meelis Roos (mroos@linux.ee)
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2014-10-31 20:59 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
A bit has accumulated, but it's been a week or so since my
last batch of post-merge-window fixes, so...
1) Missing module license in netfilter reject module, from Pablo. Lots
of people ran into this.
2) Off by one in mac80211 baserate calculation, from Karl Beldan.
3) Fix incorrect return value from ax88179_178a driver's set_mac_addr
op, which broke use of it with bonding. From Ian Morgan.
4) Checking of skb_gso_segment()'s return value was not all
encompassing, it can return an SKB pointer, a pointer error, or
NULL. Fix from Florian Westphal.
This is crummy, and longer term will be fixed to just return
error pointers or a real SKB.
6) Encapsulation offloads not being handled by
skb_gso_transport_seglen(). From Florian Westphal.
7) Fix deadlock in TIPC stack, from Ying Xue.
8) Fix performance regression from using rhashtable for netlink
sockets. The problem was the synchronize_net() invoked for
every socket destroy. From Thomas Graf.
9) Fix bug in eBPF verifier, and remove the strong dependency of
BPF on NET. From Alexei Starovoitov.
10) In qdisc_create(), use the correct interface to allocate
->cpu_bstats, otherwise the u64_stats_sync member isn't
initialized properly. From Sabrina Dubroca.
11) Off by one in ip_set_nfnl_get_byindex(), from Dan Carpenter.
12) nf_tables_newchain() was erroneously expecting error pointers
from netdev_alloc_pcpu_stats(). It only returna a valid pointer
or NULL. From Sabrina Dubroca.
13) Fix use-after-free in _decode_session6(), from Li RongQing.
14) When we set the TX flow hash on a socket, we mistakenly do so
before we've nailed down the final source port. Move the setting
deeper to fix this. From Sathya Perla.
15) NAPI budget accounting in amd-xgbe driver was counting descriptors
instead of full packets, fix from Thomas Lendacky.
16) Fix total_data_buflen calculation in hyperv driver, from Haiyang
Zhang.
17) Fix bcma driver build with OF_ADDRESS disabled, from Hauke
Mehrtens.
18) Fix mis-use of per-cpu memory in TCP md5 code. The problem is that
something that ends up being vmalloc memory can't be passed to
the crypto hash routines via scatter-gather lists. From Eric
Dumazet.
19) Fix regression in promiscuous mode enabling in cdc-ether, from
Olivier Blin.
20) Bucket eviction and frag entry killing can race with eachother,
causing an unlink of the object from the wrong list. Fix from
Nikolay Aleksandrov.
21) Missing initialization of spinlock in cxgb4 driver, from Anish
Bhatt.
22) Do not cache ipv4 routing failures, otherwise if the sysctl
for forwarding is subsequently enabled this won't be seen.
From Nicolas Cavallari.
Please pull, thanks a lot!
The following changes since commit 61ed53deb1c6a4386d8710dbbfcee8779c381931:
Merge tag 'ntb-3.18' of git://github.com/jonmason/ntb (2014-10-19 12:58:22 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
for you to fetch changes up to 99a49ce613057f1934e1c378808374fd683b1541:
Merge tag 'master-2014-10-30' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-10-31 16:18:35 -0400)
----------------------------------------------------------------
Alex Gartrell (1):
ipvs: Avoid null-pointer deref in debug code
Alexei Starovoitov (2):
bpf: fix bug in eBPF verifier
bpf: split eBPF out of NET
Andrew Lunn (2):
net: dsa: Error out on tagging protocol mismatches
dsa: mv88e6171: Fix tagging protocol/Kconfig
Andy Shevchenko (1):
stmmac: pci: set default of the filter bins
Anish Bhatt (3):
cxgb4 : Improve handling of DCB negotiation or loss thereof
cxgb4 : Handle dcb enable correctly
cxgb4 : Fix missing initialization of win0_lock
Arturo Borrero (1):
netfilter: nft_compat: fix wrong target lookup in nft_target_select_ops()
Ben Hutchings (3):
drivers/net: Disable UFO through virtio
drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets
drivers/net: macvtap and tun depend on INET
Cyril Brulebois (1):
wireless: rt2x00: add new rt2800usb device
Dan Carpenter (3):
netfilter: ipset: off by one in ip_set_nfnl_get_byindex()
i40e: _MASK vs _SHIFT typo in i40e_handle_mdd_event()
ath9k: fix some debugfs output
David S. Miller (18):
Merge git://git.kernel.org/.../pablo/nf
Merge branch 'gso_encap_fixes'
Merge branch 'enic'
Merge branch 'amd-xgbe'
Merge branch 'xen-netback'
Merge branch 'mellanox'
Merge git://git.kernel.org/.../pablo/nf
Merge branch 'cxgb4-net'
Merge branch 'dsa-net'
Merge tag 'master-2014-10-27' of git://git.kernel.org/.../linville/wireless
Merge branch 'systemport-net'
Merge branch 'cdc-ether'
Merge branch 'r8152-net'
Merge branch 'master' of git://git.kernel.org/.../jkirsher/net
Merge branch 'mellanox-net'
Merge branch 'ufo-fix'
Merge git://git.kernel.org/.../pablo/nf
Merge tag 'master-2014-10-30' of git://git.kernel.org/.../linville/wireless
David Vrabel (3):
xen-netback: make feature-rx-notify mandatory
xen-netback: fix unlimited guest Rx internal queue and carrier flapping
xen-netback: reintroduce guest Rx stall detection
Eli Cohen (2):
net/mlx5_core: Call synchronize_irq() before freeing EQ buffer
net/mlx4_core: Call synchronize_irq() before freeing EQ buffer
Emil Tantilov (1):
ixgbe: fix race when setting advertised speed
Emmanuel Grumbach (6):
iwlwifi: configure the LTR
iwlwifi: mvm: BT Coex - update the MPLUT Boost register value
iwlwifi: mvm: BT coex - fix BT prio for probe requests
iwlwifi: dvm: drop non VO frames when flushing
Revert "iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate"
iwlwifi: pcie: fix polling in various places
Eric Dumazet (4):
tcp: md5: do not use alloc_percpu()
macvlan: fix a race on port dismantle and possible skb leaks
net: napi_reuse_skb() should check pfmemalloc
net: skb_fclone_busy() needs to detect orphaned skb
Fabian Frederick (1):
net: rfkill: kernel-doc warning fixes
Felix Fietkau (2):
ath: use CTL region from cfg80211 if unset in EEPROM
ath9k_common: always update value in ath9k_cmn_update_txpow
Florian Fainelli (2):
net: systemport: enable RX interrupts after NAPI
net: systemport: reset UniMAC coming out of a suspend cycle
Florian Westphal (5):
net: gso: use feature flag argument in all protocol gso handlers
net: make skb_gso_segment error handling more robust
net: core: handle encapsulation offloads when computing segment lengths
netfilter: nf_log: account for size of NLMSG_DONE attribute
netfilter: nfnetlink_log: fix maximum packet length logged to userspace
Francesco Ruggeri (1):
e1000: unset IFF_UNICAST_FLT on WMware 82545EM
Geert Uytterhoeven (1):
drivers: net: xgene: Rewrite buggy loop in xgene_enet_ecc_init()
Govindarajulu Varadarajan (2):
enic: fix possible deadlock in enic_stop/ enic_rfs_flw_tbl_free
enic: Do not call napi_disable when preemption is disabled.
Guenter Roeck (1):
net: ethtool: Return -EOPNOTSUPP if user space tries to read EEPROM with lengh 0
Haim Dreyfuss (1):
iwlwifi: mvm: Add tx power condition to bss_info_changed_ap_ibss
Haiyang Zhang (1):
hyperv: Fix the total_data_buflen in send path
Hariprasad Shenai (1):
cxgb4vf: Replace repetitive pci device ID's with right ones
Hauke Mehrtens (1):
bcma: fix build when CONFIG_OF_ADDRESS is not set
Herbert Xu (1):
bridge: Do not compile options in br_parse_ip_options
Houcheng Lin (1):
netfilter: nf_log: release skbuff on nlmsg put failure
Ian Morgan (1):
ax88179_178a: fix bonding failure
John W. Linville (2):
Merge tag 'iwlwifi-for-john-2014-10-23' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge tag 'mac80211-for-john-2014-10-23' of git://git.kernel.org/.../jberg/mac80211
Jon Cooper (1):
sfc: remove incorrect EFX_BUG_ON_PARANOID check
Junwei Zhang (1):
ixgbe: need not repeat init skb with NULL
Karl Beldan (3):
mac80211: fix typo in starting baserate for rts_cts_rate_idx
mac80211: minstrels: fix buffer overflow in HT debugfs rc_stats
net: tso: fix unaligned access to crafted TCP header in helper API
Karsten Wiese (3):
rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality
rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe
rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt
Kees Cook (1):
rtlwifi: prevent format string usage from leaking
LEROY Christophe (1):
net: fs_enet: set back promiscuity mode after restart
Larry Finger (8):
rtlwifi: rtl8192ee: Prevent log spamming for switch statements
rtlwifi: rtl8821ae: Fix possible array overrun
rtlwifi: Add check for get_btc_status callback
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: rtl8192se: Fix firmware loading
Lendacky, Thomas (2):
amd-xgbe: Properly handle feature changes via ethtool
amd-xgbe: Fix napi Rx budget accounting
Lennart Sorensen (2):
drivers: net: cpsw: Fix broken loop condition in switch mode
drivers: net: cpsw: Support ALLMULTI and fix IFF_PROMISC in switch mode
Li RongQing (1):
xfrm6: fix a potential use after free in xfrm6_policy.c
Liad Kaufman (2):
mac80211: fix warning on htmldocs for last_tdls_pkt_time
iwlwifi: 8000: fix string given to MODULE_FIRMWARE
Lubomir Rintel (1):
ipv6: notify userspace when we added or changed an ipv6 token
Luciano Coelho (2):
mac80211: return the vif's chandef in ieee80211_cfg_get_channel()
nl80211: sanity check the channel switch counter value
Marc Yang (1):
mwifiex: restart rxreorder timer correctly
Marcelo Leitner (1):
netfilter: nf_conntrack: allow server to become a client in TW handling
Matti Gottlieb (1):
iwlwifi: mvm: ROC - bug fixes around time events and locking
Mugunthan V N (1):
drivers: net:cpsw: fix probe_dt when only slave 1 is pinned out
Nicolas Cavallari (1):
ipv4: Do not cache routing failures due to disabled forwarding.
Nikolay Aleksandrov (2):
inet: frags: fix a race between inet_evict_bucket and inet_frag_kill
inet: frags: remove the WARN_ON from inet_evict_bucket
Olivier Blin (3):
usbnet: add a callback for set_rx_mode
cdc-ether: extract usbnet_cdc_update_filter function
cdc-ether: handle promiscuous mode with a set_rx_mode callback
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
Pablo Neira Ayuso (12):
netfilter: missing module license in the nf_reject_ipvX modules
netfilter: nf_tables: restrict nat/masq expressions to nat chain type
netfilter: nft_compat: fix hook validation for non-base chains
netfilter: nft_compat: validate chain type in match/target
netfilter: nft_nat: insufficient attribute validation
netfilter: nft_nat: NFTA_NAT_REG_ADDR_MAX depends on NFTA_NAT_REG_ADDR_MIN
netfilter: nft_nat: dump attributes if they are set
netfilter: nf_tables_bridge: update hook_mask to allow {pre,post}routing
netfilter: nf_reject_ipv4: split nf_send_reset() in smaller functions
netfilter: nf_reject_ipv6: split nf_send_reset6() in smaller functions
netfilter: nft_reject_bridge: don't use IP stack to reject traffic
netfilter: nft_reject_bridge: restrict reject to prerouting and input
Philipp Zabel (1):
net: fec: ptp: fix NULL pointer dereference if ptp_clock is not set
Pravin B Shelar (2):
mpls: Fix mpls_gso handler.
mpls: Allow mpls_gso to be built as module
Rafał Miłecki (1):
bcma: add another PCI ID of device with BCM43228
Randy Dunlap (1):
skbuff.h: fix kernel-doc warning for headers_end
Richard Cochran (1):
ptp: restore the makefile for building the test program.
Rickard Strandqvist (1):
brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy
Roman Gushchin (1):
igb: don't reuse pages with pfmemalloc flag
Sabrina Dubroca (2):
net: sched: initialize bstats syncp
netfilter: nf_tables: check for NULL in nf_tables_newchain pcpu stats allocation
Sathya Perla (1):
net: fix saving TX flow hash in sock for outgoing connections
Sujith Manoharan (1):
ath9k: Enable HW queue control only for MCC
Tej Parkash (1):
cnic: Update the rcu_access_pointer() usages
Thomas Graf (1):
netlink: Re-add locking to netlink_lookup() and seq walker
Tom Herbert (1):
gre: Use inner mac length when computing tunnel length
Tony Lindgren (1):
net: smc91x: Fix gpios for device tree based booting
Vince Bridgers (1):
net: phy: Add SGMII Configuration for Marvell 88E1145 Initialization
WANG Cong (1):
sch_pie: schedule the timer after all init succeed
Ying Xue (2):
tipc: fix a potential deadlock
tipc: fix lockdep warning when intra-node messages are delivered
hayeswang (4):
r8152: clear SELECTIVE_SUSPEND when autoresuming
r8152: reset tp->speed before autoresuming in open function
r8152: check WORK_ENABLE in suspend function
r8152: stop submitting intr for -EPROTO
Documentation/devicetree/bindings/net/smsc-lan91c111.txt | 2 +
Documentation/ptp/testptp.mk | 33 +++++
arch/arm/boot/dts/omap3-n900.dts | 2 +
arch/arm/mach-omap2/pdata-quirks.c | 3 -
drivers/bcma/host_pci.c | 5 +-
drivers/bcma/main.c | 2 +-
drivers/infiniband/hw/mlx4/main.c | 10 +-
drivers/net/Kconfig | 2 +
drivers/net/dsa/mv88e6171.c | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 22 +--
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c | 16 +--
drivers/net/ethernet/broadcom/bcmsysport.c | 11 +-
drivers/net/ethernet/broadcom/cnic.c | 5 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 55 +++++++-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 7 +-
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 16 +--
drivers/net/ethernet/cisco/enic/enic_clsf.c | 12 +-
drivers/net/ethernet/cisco/enic/enic_main.c | 4 +-
drivers/net/ethernet/freescale/fec_main.c | 3 +-
drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 3 +
drivers/net/ethernet/freescale/fs_enet/mac-scc.c | 3 +
drivers/net/ethernet/intel/e1000/e1000_main.c | 5 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +-
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 +-
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 7 +-
drivers/net/ethernet/mellanox/mlx4/eq.c | 1 +
drivers/net/ethernet/mellanox/mlx4/mcg.c | 4 +
drivers/net/ethernet/mellanox/mlx5/core/eq.c | 1 +
drivers/net/ethernet/sfc/tx.c | 4 -
drivers/net/ethernet/smsc/smc91x.c | 58 ++++++++
drivers/net/ethernet/smsc/smc91x.h | 3 +
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 7 +
drivers/net/ethernet/ti/cpsw.c | 48 ++++---
drivers/net/ethernet/ti/cpsw_ale.c | 29 ++++
drivers/net/ethernet/ti/cpsw_ale.h | 2 +
drivers/net/hyperv/netvsc_drv.c | 1 +
drivers/net/macvlan.c | 10 +-
drivers/net/macvtap.c | 16 +--
drivers/net/phy/marvell.c | 19 +++
drivers/net/tun.c | 25 ++--
drivers/net/usb/ax88179_178a.c | 7 +-
drivers/net/usb/cdc_ether.c | 47 +++++--
drivers/net/usb/r8152.c | 17 ++-
drivers/net/usb/usbnet.c | 20 +++
drivers/net/virtio_net.c | 24 ++--
drivers/net/wireless/ath/ath.h | 1 +
drivers/net/wireless/ath/ath9k/common.c | 8 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/init.c | 55 ++++----
drivers/net/wireless/ath/ath9k/main.c | 3 +
drivers/net/wireless/ath/ath9k/xmit.c | 10 +-
drivers/net/wireless/ath/regd.c | 14 ++
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 25 ++--
drivers/net/wireless/iwlwifi/dvm/mac80211.c | 24 ++--
drivers/net/wireless/iwlwifi/iwl-8000.c | 3 +-
drivers/net/wireless/iwlwifi/iwl-trans.h | 2 +
drivers/net/wireless/iwlwifi/mvm/coex.c | 4 +-
drivers/net/wireless/iwlwifi/mvm/coex_legacy.c | 4 +-
drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 35 ++++-
drivers/net/wireless/iwlwifi/mvm/fw-api.h | 1 +
drivers/net/wireless/iwlwifi/mvm/fw.c | 9 ++
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 32 +++--
drivers/net/wireless/iwlwifi/mvm/ops.c | 1 +
drivers/net/wireless/iwlwifi/mvm/scan.c | 3 +-
drivers/net/wireless/iwlwifi/mvm/time-event.c | 2 +-
drivers/net/wireless/iwlwifi/mvm/tx.c | 8 +-
drivers/net/wireless/iwlwifi/pcie/trans.c | 22 +--
drivers/net/wireless/mwifiex/11n_rxreorder.c | 52 ++++++--
drivers/net/wireless/mwifiex/11n_rxreorder.h | 2 +
drivers/net/wireless/mwifiex/main.h | 1 +
drivers/net/wireless/rt2x00/rt2800usb.c | 1 +
drivers/net/wireless/rtlwifi/base.c | 2 +-
drivers/net/wireless/rtlwifi/core.c | 6 +
drivers/net/wireless/rtlwifi/core.h | 1 +
drivers/net/wireless/rtlwifi/pci.c | 3 +-
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 8 +-
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h | 4 +-
drivers/net/wireless/rtlwifi/rtl8192ce/def.h | 2 +
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 2 +-
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 3 +
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 17 ++-
drivers/net/wireless/rtlwifi/rtl8192cu/hw.h | 1 -
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 7 +
drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ee/hw.c | 8 +-
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 | 15 ++-
drivers/net/wireless/rtlwifi/usb.c | 11 ++
drivers/net/xen-netback/common.h | 39 +++---
drivers/net/xen-netback/interface.c | 74 +++-------
drivers/net/xen-netback/netback.c | 319 ++++++++++++++++++++++++++++----------------
drivers/net/xen-netback/xenbus.c | 22 +--
include/linux/skbuff.h | 12 +-
include/linux/usb/usbnet.h | 4 +
include/net/ipv6.h | 2 +
include/net/netfilter/ipv4/nf_reject.h | 10 ++
include/net/netfilter/ipv6/nf_reject.h | 10 ++
include/net/netfilter/nf_tables.h | 3 +
include/net/netfilter/nft_masq.h | 3 +
init/Kconfig | 14 ++
kernel/Makefile | 2 +-
kernel/bpf/Makefile | 6 +-
kernel/bpf/core.c | 9 ++
kernel/bpf/verifier.c | 3 +-
net/Kconfig | 2 +-
net/bridge/br_forward.c | 1 +
net/bridge/br_netfilter.c | 24 +---
net/bridge/netfilter/nf_tables_bridge.c | 6 +-
net/bridge/netfilter/nft_reject_bridge.c | 296 ++++++++++++++++++++++++++++++++++++++--
net/core/dev.c | 4 +
net/core/ethtool.c | 6 +-
net/core/skbuff.c | 13 +-
net/core/tso.c | 3 +-
net/dsa/dsa.c | 5 +-
net/ipv4/af_inet.c | 2 +-
net/ipv4/gre_offload.c | 4 +-
net/ipv4/inet_fragment.c | 4 +-
net/ipv4/ip_output.c | 2 +-
net/ipv4/netfilter/nf_reject_ipv4.c | 91 +++++++++----
net/ipv4/netfilter/nft_masq_ipv4.c | 1 +
net/ipv4/route.c | 1 +
net/ipv4/tcp.c | 59 +++-----
net/ipv4/tcp_ipv4.c | 4 +-
net/ipv4/tcp_output.c | 2 +-
net/ipv4/udp_offload.c | 2 +-
net/ipv6/addrconf.c | 1 +
net/ipv6/ip6_offload.c | 2 +-
net/ipv6/netfilter/nf_reject_ipv6.c | 179 ++++++++++++++++---------
net/ipv6/netfilter/nft_masq_ipv6.c | 1 +
net/ipv6/output_core.c | 34 +++++
net/ipv6/tcp_ipv6.c | 4 +-
net/ipv6/xfrm6_policy.c | 11 +-
net/mac80211/cfg.c | 2 +-
net/mac80211/rate.c | 2 +-
net/mac80211/rc80211_minstrel_debugfs.c | 12 +-
net/mac80211/rc80211_minstrel_ht_debugfs.c | 13 +-
net/mac80211/sta_info.h | 1 +
net/mpls/Makefile | 2 +-
net/mpls/mpls_gso.c | 5 +-
net/netfilter/ipset/ip_set_core.c | 2 +-
net/netfilter/ipvs/ip_vs_xmit.c | 4 +-
net/netfilter/nf_conntrack_proto_tcp.c | 4 +-
net/netfilter/nf_tables_api.c | 18 ++-
net/netfilter/nfnetlink_log.c | 31 ++---
net/netfilter/nfnetlink_queue_core.c | 2 +-
net/netfilter/nft_compat.c | 81 +++++++++--
net/netfilter/nft_masq.c | 12 ++
net/netfilter/nft_nat.c | 86 +++++++-----
net/netlink/af_netlink.c | 37 +++--
net/openvswitch/datapath.c | 2 +
net/sched/sch_api.c | 2 +-
net/sched/sch_pie.c | 2 +-
net/tipc/node.c | 46 ++++---
net/tipc/node.h | 7 +-
net/tipc/socket.c | 6 +-
net/wireless/nl80211.c | 10 +-
net/xfrm/xfrm_output.c | 2 +
net/xfrm/xfrm_policy.c | 2 +-
samples/bpf/test_verifier.c | 11 ++
164 files changed, 1943 insertions(+), 789 deletions(-)
create mode 100644 Documentation/ptp/testptp.mk
^ permalink raw reply
* Re: DMA allocations from CMA and fatal_signal_pending check
From: Florian Fainelli @ 2014-10-31 20:58 UTC (permalink / raw)
To: Joonsoo Kim
Cc: linux-arm-kernel, Brian Norris, Gregory Fong, linux-kernel,
linux-mm, lauraa, gioh.kim, aneesh.kumar, mina86, m.szyprowski,
akpm, netdev@vger.kernel.org
In-Reply-To: <20141031082818.GB14642@js1304-P5Q-DELUXE>
Hi Joonsoo,
On 10/31/2014 01:28 AM, Joonsoo Kim wrote:
> On Tue, Oct 28, 2014 at 12:08:46PM -0700, Florian Fainelli wrote:
>> Hello,
>>
>> While debugging why some dma_alloc_coherent() allocations where
>> returning NULL on our brcmstb platform, specifically with
>> drivers/net/ethernet/broadcom/bcmcsysport.c, I came across the
>> fatal_signal_pending() check in mm/page_alloc.c which is there.
>>
>> This driver calls dma_alloc_coherent(, GFP_KERNEL) which ends up making
>> a coherent allocation from a CMA region on our platform. Since that
>> allocation is allowed to sleep, and because we are in bcm_syport_open(),
>> executed from process context, a pending signal makes
>> dma_alloc_coherent() return NULL.
>
> Hello, Florian.
>
> fatal_signal_pending means that there is SIGKILL on that process.
> I guess that caller of dma_alloc_coherent() will die soon.
> In this case, why CMA should be succeed?
I agree that the CMA allocation should not be allowed to succeed, but
the dma_alloc_coherent() allocation should succeed. If we look at the
sysport driver, there are kmalloc() calls to initialize private
structures, those will succeed (except under high memory pressure), so
by the same token, a driver expects DMA allocations to succeed (unless
we are under high memory pressure)
What are we trying to solve exactly with the fatal_signal_pending()
check here? Are we just optimizing for the case where a process has
allocated from a CMA region to allow this region to be returned to the
pool of free pages when it gets killed? Could there be another mechanism
used to reclaim those pages if we know the process is getting killed anyway?
>
>>
>> There are two ways I could fix this:
>>
>> - use a GFP_ATOMIC allocation, which would avoid this sensitivity to a
>> pending signal being fatal (we suffer from the same issue in
>> bcm_sysport_resume)
>>
>> - move the DMA coherent allocation before bcm_sysport_open(), in the
>> driver's probe function, but if the network interface is never used, we
>> would be waisting precious DMA coherent memory for nothing (it is only 4
>> bytes times 32 but still
>
> I guess that it is okay that bcm_sysport_open() return -EINTR?
Well, not really. This driver is not an isolated case, there are tons of
other networking drivers that do exactly the same thing, and we do
expect these dma_alloc_* calls to succeed.
I think we would want to ignore the fatal_signal_pending() check for
allocations coming through the dma_alloc_* API, although I agree this
could be a tough one when they are done from process context.
Updating all drivers to switch to GFP_ATOMIC allocations is not a good
idea, since that would exhaust the atomic DMA coherent pool for no good
reason.
FYI, we are hitting the same problem during suspend/resume, if you are
unlucky enough the suspending process get interrupted, you can get a lot
of crashes from drivers that do not expect their dma_alloc_coherent()
allocation to be sensible to signals.
--
Florian
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH 2/2] staging: lustre: lnet: lnet: trailing statements should be on next line
From: Greg KH @ 2014-10-31 20:50 UTC (permalink / raw)
To: Balavasu; +Cc: netdev, linux-kernel, andreas.dilger, oleg.drokin
In-Reply-To: <20141031182040.GA7916@vasu-Inspiron-3542>
On Fri, Oct 31, 2014 at 11:50:40PM +0530, Balavasu wrote:
> This patch fixes the checkpatch.pl issue
> Error: trailing statements should be on next line
>
> Signed-off-by: Balavasu <kp.balavasu@gmail.com>
> ---
> drivers/staging/lustre/lnet/lnet/router.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
Same comments as 1/2
^ permalink raw reply
* Re: [PATCH 1/2] staging: lustre: lnet: lnet: do not initialise statics to 0 or NULL
From: Greg KH @ 2014-10-31 20:50 UTC (permalink / raw)
To: Balavasu; +Cc: netdev, linux-kernel, andreas.dilger, oleg.drokin
In-Reply-To: <20141031181808.GA7830@vasu-Inspiron-3542>
On Fri, Oct 31, 2014 at 11:48:08PM +0530, Balavasu wrote:
> This patch fixes the checkpatch.pl issue
> Error: do not initialise statics to 0 or NULL for time
>
> Signed-off-by: Balavasu <kp.balavasu@gmail.com>
> ---
> drivers/staging/lustre/lnet/lnet/do not instalise 0 | 10 +++++-----
That line doesn't look right, does it?
And why netdev and not the mailing list for the drivers/staging/ tree?
And again, I need a full name.
greg k-h
^ permalink raw reply
* Re: [Patch net-next] neigh: remove dynamic neigh table registration support
From: Cong Wang @ 2014-10-31 20:39 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, David S. Miller
In-Reply-To: <1414787651-8499-1-git-send-email-xiyou.wangcong@gmail.com>
On Fri, Oct 31, 2014 at 1:34 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> + switch (family) {
> + case AF_INET:
> + tbl = neigh_tables[NEIGH_ARP_TABLE];
> + break;
> +#if IS_ENABLED(CONFIG_IPV6)
> + case AF_INET6:
> + tbl = neigh_tables[NEIGH_ND_TABLE];
> + break;
> +#endif
> +#if IS_ENABLED(CONFIG_DECNET)
> + case AF_DECnet:
> + tbl = neigh_tables[NEIGH_DN_TABLE];
> + break;
> +#endif
These #ifdef's are not necessary, I will update it after getting other
feedbacks.
^ permalink raw reply
* [Patch net-next] neigh: remove dynamic neigh table registration support
From: Cong Wang @ 2014-10-31 20:34 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Cong Wang
Currently there are only three neigh tables in the whole kernel:
arp table, ndisc table and decnet neigh table. What's more,
we don't support registering multiple tables per family.
Therefore we can just make these tables statically built-in.
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
include/net/neighbour.h | 9 +-
net/core/neighbour.c | 249 ++++++++++++++++++++++--------------------------
net/decnet/dn_neigh.c | 2 +-
net/ipv4/arp.c | 2 +-
net/ipv6/ndisc.c | 2 +-
5 files changed, 126 insertions(+), 138 deletions(-)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index dedfb18..1e65c68 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -220,6 +220,13 @@ struct neigh_table {
struct pneigh_entry **phash_buckets;
};
+enum {
+ NEIGH_ARP_TABLE = 0,
+ NEIGH_ND_TABLE = 1,
+ NEIGH_DN_TABLE = 2,
+ NEIGH_NR_TABLES,
+};
+
static inline int neigh_parms_family(struct neigh_parms *p)
{
return p->tbl->family;
@@ -240,7 +247,7 @@ static inline void *neighbour_priv(const struct neighbour *n)
#define NEIGH_UPDATE_F_ISROUTER 0x40000000
#define NEIGH_UPDATE_F_ADMIN 0x80000000
-void neigh_table_init(struct neigh_table *tbl);
+void neigh_table_init(int index, struct neigh_table *tbl);
int neigh_table_clear(struct neigh_table *tbl);
struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey,
struct net_device *dev);
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index edd0411..de6831c 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -56,7 +56,6 @@ static void __neigh_notify(struct neighbour *n, int type, int flags);
static void neigh_update_notify(struct neighbour *neigh);
static int pneigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
-static struct neigh_table *neigh_tables;
#ifdef CONFIG_PROC_FS
static const struct file_operations neigh_stat_seq_fops;
#endif
@@ -87,13 +86,8 @@ static const struct file_operations neigh_stat_seq_fops;
the most complicated procedure, which we allow is dev->hard_header.
It is supposed, that dev->hard_header is simplistic and does
not make callbacks to neighbour tables.
-
- The last lock is neigh_tbl_lock. It is pure SMP lock, protecting
- list of neighbour tables. This list is used only in process context,
*/
-static DEFINE_RWLOCK(neigh_tbl_lock);
-
static int neigh_blackhole(struct neighbour *neigh, struct sk_buff *skb)
{
kfree_skb(skb);
@@ -1520,11 +1514,15 @@ static void neigh_parms_destroy(struct neigh_parms *parms)
static struct lock_class_key neigh_table_proxy_queue_class;
-static void neigh_table_init_no_netlink(struct neigh_table *tbl)
+static struct neigh_table *neigh_tables[NEIGH_NR_TABLES] __read_mostly;
+
+void neigh_table_init(int index, struct neigh_table *tbl)
{
unsigned long now = jiffies;
unsigned long phsize;
+ neigh_tables[index] = tbl;
+
INIT_LIST_HEAD(&tbl->parms_list);
list_add(&tbl->parms.list, &tbl->parms_list);
write_pnet(&tbl->parms.net, &init_net);
@@ -1566,34 +1564,12 @@ static void neigh_table_init_no_netlink(struct neigh_table *tbl)
tbl->last_flush = now;
tbl->last_rand = now + tbl->parms.reachable_time * 20;
-}
-void neigh_table_init(struct neigh_table *tbl)
-{
- struct neigh_table *tmp;
-
- neigh_table_init_no_netlink(tbl);
- write_lock(&neigh_tbl_lock);
- for (tmp = neigh_tables; tmp; tmp = tmp->next) {
- if (tmp->family == tbl->family)
- break;
- }
- tbl->next = neigh_tables;
- neigh_tables = tbl;
- write_unlock(&neigh_tbl_lock);
-
- if (unlikely(tmp)) {
- pr_err("Registering multiple tables for family %d\n",
- tbl->family);
- dump_stack();
- }
}
EXPORT_SYMBOL(neigh_table_init);
int neigh_table_clear(struct neigh_table *tbl)
{
- struct neigh_table **tp;
-
/* It is not clean... Fix it to unload IPv6 module safely */
cancel_delayed_work_sync(&tbl->gc_work);
del_timer_sync(&tbl->proxy_timer);
@@ -1601,14 +1577,6 @@ int neigh_table_clear(struct neigh_table *tbl)
neigh_ifdown(tbl, NULL);
if (atomic_read(&tbl->entries))
pr_crit("neighbour leakage\n");
- write_lock(&neigh_tbl_lock);
- for (tp = &neigh_tables; *tp; tp = &(*tp)->next) {
- if (*tp == tbl) {
- *tp = tbl->next;
- break;
- }
- }
- write_unlock(&neigh_tbl_lock);
call_rcu(&rcu_dereference_protected(tbl->nht, 1)->rcu,
neigh_hash_free_rcu);
@@ -1626,12 +1594,36 @@ int neigh_table_clear(struct neigh_table *tbl)
}
EXPORT_SYMBOL(neigh_table_clear);
+static struct neigh_table *neigh_find_table(int family)
+{
+ struct neigh_table *tbl = NULL;
+
+ switch (family) {
+ case AF_INET:
+ tbl = neigh_tables[NEIGH_ARP_TABLE];
+ break;
+#if IS_ENABLED(CONFIG_IPV6)
+ case AF_INET6:
+ tbl = neigh_tables[NEIGH_ND_TABLE];
+ break;
+#endif
+#if IS_ENABLED(CONFIG_DECNET)
+ case AF_DECnet:
+ tbl = neigh_tables[NEIGH_DN_TABLE];
+ break;
+#endif
+ }
+
+ return tbl;
+}
+
static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
struct ndmsg *ndm;
struct nlattr *dst_attr;
struct neigh_table *tbl;
+ struct neighbour *neigh;
struct net_device *dev = NULL;
int err = -EINVAL;
@@ -1652,39 +1644,31 @@ static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh)
}
}
- read_lock(&neigh_tbl_lock);
- for (tbl = neigh_tables; tbl; tbl = tbl->next) {
- struct neighbour *neigh;
+ tbl = neigh_find_table(ndm->ndm_family);
+ if (tbl == NULL)
+ return -EAFNOSUPPORT;
- if (tbl->family != ndm->ndm_family)
- continue;
- read_unlock(&neigh_tbl_lock);
-
- if (nla_len(dst_attr) < tbl->key_len)
- goto out;
-
- if (ndm->ndm_flags & NTF_PROXY) {
- err = pneigh_delete(tbl, net, nla_data(dst_attr), dev);
- goto out;
- }
+ if (nla_len(dst_attr) < tbl->key_len)
+ goto out;
- if (dev == NULL)
- goto out;
+ if (ndm->ndm_flags & NTF_PROXY) {
+ err = pneigh_delete(tbl, net, nla_data(dst_attr), dev);
+ goto out;
+ }
- neigh = neigh_lookup(tbl, nla_data(dst_attr), dev);
- if (neigh == NULL) {
- err = -ENOENT;
- goto out;
- }
+ if (dev == NULL)
+ goto out;
- err = neigh_update(neigh, NULL, NUD_FAILED,
- NEIGH_UPDATE_F_OVERRIDE |
- NEIGH_UPDATE_F_ADMIN);
- neigh_release(neigh);
+ neigh = neigh_lookup(tbl, nla_data(dst_attr), dev);
+ if (neigh == NULL) {
+ err = -ENOENT;
goto out;
}
- read_unlock(&neigh_tbl_lock);
- err = -EAFNOSUPPORT;
+
+ err = neigh_update(neigh, NULL, NUD_FAILED,
+ NEIGH_UPDATE_F_OVERRIDE |
+ NEIGH_UPDATE_F_ADMIN);
+ neigh_release(neigh);
out:
return err;
@@ -1692,11 +1676,14 @@ static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh)
static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh)
{
+ int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE;
struct net *net = sock_net(skb->sk);
struct ndmsg *ndm;
struct nlattr *tb[NDA_MAX+1];
struct neigh_table *tbl;
struct net_device *dev = NULL;
+ struct neighbour *neigh;
+ void *dst, *lladdr;
int err;
ASSERT_RTNL();
@@ -1720,70 +1707,60 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh)
goto out;
}
- read_lock(&neigh_tbl_lock);
- for (tbl = neigh_tables; tbl; tbl = tbl->next) {
- int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE;
- struct neighbour *neigh;
- void *dst, *lladdr;
+ tbl = neigh_find_table(ndm->ndm_family);
+ if (tbl == NULL)
+ return -EAFNOSUPPORT;
- if (tbl->family != ndm->ndm_family)
- continue;
- read_unlock(&neigh_tbl_lock);
+ if (nla_len(tb[NDA_DST]) < tbl->key_len)
+ goto out;
+ dst = nla_data(tb[NDA_DST]);
+ lladdr = tb[NDA_LLADDR] ? nla_data(tb[NDA_LLADDR]) : NULL;
- if (nla_len(tb[NDA_DST]) < tbl->key_len)
- goto out;
- dst = nla_data(tb[NDA_DST]);
- lladdr = tb[NDA_LLADDR] ? nla_data(tb[NDA_LLADDR]) : NULL;
+ if (ndm->ndm_flags & NTF_PROXY) {
+ struct pneigh_entry *pn;
- if (ndm->ndm_flags & NTF_PROXY) {
- struct pneigh_entry *pn;
+ err = -ENOBUFS;
+ pn = pneigh_lookup(tbl, net, dst, dev, 1);
+ if (pn) {
+ pn->flags = ndm->ndm_flags;
+ err = 0;
+ }
+ goto out;
+ }
- err = -ENOBUFS;
- pn = pneigh_lookup(tbl, net, dst, dev, 1);
- if (pn) {
- pn->flags = ndm->ndm_flags;
- err = 0;
- }
+ if (dev == NULL)
+ goto out;
+
+ neigh = neigh_lookup(tbl, dst, dev);
+ if (neigh == NULL) {
+ if (!(nlh->nlmsg_flags & NLM_F_CREATE)) {
+ err = -ENOENT;
goto out;
}
- if (dev == NULL)
+ neigh = __neigh_lookup_errno(tbl, dst, dev);
+ if (IS_ERR(neigh)) {
+ err = PTR_ERR(neigh);
+ goto out;
+ }
+ } else {
+ if (nlh->nlmsg_flags & NLM_F_EXCL) {
+ err = -EEXIST;
+ neigh_release(neigh);
goto out;
-
- neigh = neigh_lookup(tbl, dst, dev);
- if (neigh == NULL) {
- if (!(nlh->nlmsg_flags & NLM_F_CREATE)) {
- err = -ENOENT;
- goto out;
- }
-
- neigh = __neigh_lookup_errno(tbl, dst, dev);
- if (IS_ERR(neigh)) {
- err = PTR_ERR(neigh);
- goto out;
- }
- } else {
- if (nlh->nlmsg_flags & NLM_F_EXCL) {
- err = -EEXIST;
- neigh_release(neigh);
- goto out;
- }
-
- if (!(nlh->nlmsg_flags & NLM_F_REPLACE))
- flags &= ~NEIGH_UPDATE_F_OVERRIDE;
}
- if (ndm->ndm_flags & NTF_USE) {
- neigh_event_send(neigh, NULL);
- err = 0;
- } else
- err = neigh_update(neigh, lladdr, ndm->ndm_state, flags);
- neigh_release(neigh);
- goto out;
+ if (!(nlh->nlmsg_flags & NLM_F_REPLACE))
+ flags &= ~NEIGH_UPDATE_F_OVERRIDE;
}
- read_unlock(&neigh_tbl_lock);
- err = -EAFNOSUPPORT;
+ if (ndm->ndm_flags & NTF_USE) {
+ neigh_event_send(neigh, NULL);
+ err = 0;
+ } else
+ err = neigh_update(neigh, lladdr, ndm->ndm_state, flags);
+ neigh_release(neigh);
+
out:
return err;
}
@@ -1982,7 +1959,8 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh)
struct neigh_table *tbl;
struct ndtmsg *ndtmsg;
struct nlattr *tb[NDTA_MAX+1];
- int err;
+ bool found = false;
+ int err, tidx;
err = nlmsg_parse(nlh, sizeof(*ndtmsg), tb, NDTA_MAX,
nl_neightbl_policy);
@@ -1995,19 +1973,21 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh)
}
ndtmsg = nlmsg_data(nlh);
- read_lock(&neigh_tbl_lock);
- for (tbl = neigh_tables; tbl; tbl = tbl->next) {
+
+ for (tidx = 0; tidx < NEIGH_NR_TABLES; tidx++) {
+ tbl = neigh_tables[tidx];
+ if (!tbl)
+ continue;
if (ndtmsg->ndtm_family && tbl->family != ndtmsg->ndtm_family)
continue;
-
- if (nla_strcmp(tb[NDTA_NAME], tbl->id) == 0)
+ if (nla_strcmp(tb[NDTA_NAME], tbl->id) == 0) {
+ found = true;
break;
+ }
}
- if (tbl == NULL) {
- err = -ENOENT;
- goto errout_locked;
- }
+ if (!found)
+ return -ENOENT;
/*
* We acquire tbl->lock to be nice to the periodic timers and
@@ -2118,8 +2098,6 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh)
errout_tbl_lock:
write_unlock_bh(&tbl->lock);
-errout_locked:
- read_unlock(&neigh_tbl_lock);
errout:
return err;
}
@@ -2134,10 +2112,13 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
family = ((struct rtgenmsg *) nlmsg_data(cb->nlh))->rtgen_family;
- read_lock(&neigh_tbl_lock);
- for (tbl = neigh_tables, tidx = 0; tbl; tbl = tbl->next, tidx++) {
+ for (tidx = 0; tidx < NEIGH_NR_TABLES; tidx++) {
struct neigh_parms *p;
+ tbl = neigh_tables[tidx];
+ if (!tbl)
+ continue;
+
if (tidx < tbl_skip || (family && tbl->family != family))
continue;
@@ -2168,7 +2149,6 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
neigh_skip = 0;
}
out:
- read_unlock(&neigh_tbl_lock);
cb->args[0] = tidx;
cb->args[1] = nidx;
@@ -2351,7 +2331,6 @@ static int neigh_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
int proxy = 0;
int err;
- read_lock(&neigh_tbl_lock);
family = ((struct rtgenmsg *) nlmsg_data(cb->nlh))->rtgen_family;
/* check for full ndmsg structure presence, family member is
@@ -2363,8 +2342,11 @@ static int neigh_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
s_t = cb->args[0];
- for (tbl = neigh_tables, t = 0; tbl;
- tbl = tbl->next, t++) {
+ for (t = 0; t < NEIGH_NR_TABLES; t++) {
+ tbl = neigh_tables[t];
+
+ if (!tbl)
+ continue;
if (t < s_t || (family && tbl->family != family))
continue;
if (t > s_t)
@@ -2377,7 +2359,6 @@ static int neigh_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
if (err < 0)
break;
}
- read_unlock(&neigh_tbl_lock);
cb->args[0] = t;
return skb->len;
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index c8121ce..845957a 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -591,7 +591,7 @@ static const struct file_operations dn_neigh_seq_fops = {
void __init dn_neigh_init(void)
{
- neigh_table_init(&dn_neigh_table);
+ neigh_table_init(NEIGH_DN_TABLE, &dn_neigh_table);
proc_create("decnet_neigh", S_IRUGO, init_net.proc_net,
&dn_neigh_seq_fops);
}
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 16acb59..205e147 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1292,7 +1292,7 @@ static int arp_proc_init(void);
void __init arp_init(void)
{
- neigh_table_init(&arp_tbl);
+ neigh_table_init(NEIGH_ARP_TABLE, &arp_tbl);
dev_add_pack(&arp_packet_type);
arp_proc_init();
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 4cb45c1..c67f339 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1763,7 +1763,7 @@ int __init ndisc_init(void)
/*
* Initialize the neighbour table
*/
- neigh_table_init(&nd_tbl);
+ neigh_table_init(NEIGH_ND_TABLE, &nd_tbl);
#ifdef CONFIG_SYSCTL
err = neigh_sysctl_register(NULL, &nd_tbl.parms,
^ permalink raw reply related
* [PATCH] smc91x: retrieve IRQ and trigger flags in a modern way
From: Linus Walleij @ 2014-10-31 20:32 UTC (permalink / raw)
To: netdev, Nicolas Pitre, David S. Miller; +Cc: Linus Walleij
The SMC91x is written to explicitly look up the IRQ resource
from the platform device and extract the IRQ and flags, however
the platform_get_irq() does additional things, like call
of_irq_get() in the device tree case, which will translate
the IRQ using the irqdomain and defer the probe if the
IRQ host cannot be found.
As we're not looking up the resource, this will not retrieve
the IRQ flags, but that is better done using
irqd_get_trigger_type(), as the trigger is what the driver
wants to modify. We take care to preserve the semantics that
will make the trigger type provided from the resource
override any local specifier.
Tested on the Nomadik NHK15 which has its SMC91x IRQ line
connected to a STMPE2401 GPIO expander on I2C.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/net/ethernet/smsc/smc91x.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 5e94d00b96b3..7747d506646a 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2207,9 +2207,10 @@ static int smc_drv_probe(struct platform_device *pdev)
const struct of_device_id *match = NULL;
struct smc_local *lp;
struct net_device *ndev;
- struct resource *res, *ires;
+ struct resource *res;
unsigned int __iomem *addr;
unsigned long irq_flags = SMC_IRQ_FLAGS;
+ unsigned long irq_resflags;
int ret;
ndev = alloc_etherdev(sizeof(struct smc_local));
@@ -2279,16 +2280,19 @@ static int smc_drv_probe(struct platform_device *pdev)
goto out_free_netdev;
}
- ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!ires) {
+ ndev->irq = platform_get_irq(pdev, 0);
+ if (ndev->irq <= 0) {
ret = -ENODEV;
goto out_release_io;
}
-
- ndev->irq = ires->start;
-
- if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK)
- irq_flags = ires->flags & IRQF_TRIGGER_MASK;
+ /*
+ * If this platform does not specify any special irqflags, or if
+ * the resource supplies a trigger, override the irqflags with
+ * the trigger flags from the resource.
+ */
+ irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
+ if (irq_flags == -1 || irq_resflags & IRQF_TRIGGER_MASK)
+ irq_flags = irq_resflags & IRQF_TRIGGER_MASK;
ret = smc_request_attrib(pdev, ndev);
if (ret)
--
1.9.3
^ permalink raw reply related
* Re: pull request: wireless 2014-10-31
From: David Miller @ 2014-10-31 20:18 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20141031195817.GC3768@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 31 Oct 2014 15:58:17 -0400
> Please pull this small batch of spooky fixes intended for the 3.18
> stream...boo!
Scary... but pulled.
Thanks a lot!
^ permalink raw reply
* Re: drivers: net: cpsw: Support ALLMULTI and fix IFF_PROMISC in switch mode
From: David Miller @ 2014-10-31 20:17 UTC (permalink / raw)
To: lsorense; +Cc: linux-kernel, mugunthanvnm, netdev
In-Reply-To: <20141031173852.GK24110@csclub.uwaterloo.ca>
From: "Lennart Sorensen" <lsorense@csclub.uwaterloo.ca>
Date: Fri, 31 Oct 2014 13:38:52 -0400
> The cpsw driver did not support the IFF_ALLMULTI flag which makes dynamic
> multicast routing not work. Related to this, when enabling IFF_PROMISC
> in switch mode, all registered multicast addresses are flushed, resulting
> in only broadcast and unicast traffic being received.
>
> A new cpsw_ale_set_allmulti function now scans through the ALE entry
> table and adds/removes the host port from the unregistered multicast
> port mask of each vlan entry depending on the state of IFF_ALLMULTI.
> In promiscious mode, cpsw_ale_set_allmulti is used to force reception
> of all multicast traffic in addition to the unicast and broadcast traffic.
>
> With this change dynamic multicast and promiscious mode both work in
> switch mode.
>
> Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Applied.
^ permalink raw reply
* Re: drivers: net: cpsw: Fix broken loop condition in switch mode
From: David Miller @ 2014-10-31 20:17 UTC (permalink / raw)
To: lsorense; +Cc: linux-kernel, hs, mugunthanvnm, netdev
In-Reply-To: <20141031172854.GJ24110@csclub.uwaterloo.ca>
From: "Lennart Sorensen" <lsorense@csclub.uwaterloo.ca>
Date: Fri, 31 Oct 2014 13:28:54 -0400
> 0d961b3b52f566f823070ce2366511a7f64b928c (drivers: net: cpsw: fix buggy
> loop condition) accidentally fixed a loop comparison in too many places
> while fixing a real bug.
>
> It was correct to fix the dual_emac mode section since there 'i' is used
> as an index into priv->slaves which is a 0 based array.
>
> However the other two changes (which are only used in switch mode)
> are wrong since there 'i' is actually the ALE port number, and port 0
> is the host port, while port 1 and up are the slave ports.
>
> Putting the loop condition back in the switch mode section fixes it.
>
> A comment has been added to point out the intent clearly to avoid future
> confusion. Also a comment is fixed that said the opposite of what was
> actually happening.
>
> Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
> Acked-by: Heiko Schocher <hs@denx.de>
Applied.
^ permalink raw reply
* Re: [PATCH net-next v2 2/3] r8152: clear the flag of SCHEDULE_TASKLET in tasklet
From: David Miller @ 2014-10-31 20:15 UTC (permalink / raw)
To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-81-Taiwan-albertk@realtek.com>
From: Hayes Wang <hayeswang@realtek.com>
Date: Fri, 31 Oct 2014 17:56:41 +0800
> Clear the flag of SCHEDULE_TASKLET in bottom_half() to avoid
> re-schedule the tasklet again by workqueue.
>
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
> drivers/net/usb/r8152.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index ff54098..670279a 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -1798,6 +1798,9 @@ static void bottom_half(unsigned long data)
> if (!netif_carrier_ok(tp->netdev))
> return;
>
> + if (test_bit(SCHEDULE_TASKLET, &tp->flags))
> + clear_bit(SCHEDULE_TASKLET, &tp->flags);
This is racey.
If another thread of control sets the bit between the test and the
clear, you will lose an event.
It really never makes sense to work with atomic bitops in a non-atomic
test-and-whatever manner like this, it's always a red flag and
indicates you're doing something very wrong.
^ permalink raw reply
* Re: [PATCH] net: ethtool: Return -EOPNOTSUPP if user space tries to read EEPROM with lengh 0
From: David Miller @ 2014-10-31 20:13 UTC (permalink / raw)
To: andrew; +Cc: linux, netdev, linux-kernel
In-Reply-To: <20141031035635.GC4082@lunn.ch>
From: Andrew Lunn <andrew@lunn.ch>
Date: Fri, 31 Oct 2014 04:56:35 +0100
> On Thu, Oct 30, 2014 at 08:50:15PM -0700, Guenter Roeck wrote:
>> If a driver supports reading EEPROM but no EEPROM is installed in the system,
>> the driver's get_eeprom_len function returns 0. ethtool will subsequently
>> try to read that zero-length EEPROM anyway. If the driver does not support
>> EEPROM access at all, this operation will return -EOPNOTSUPP. If the driver
>> does support EEPROM access but no EEPROM is installed, the operation will
>> return -EINVAL. Return -EOPNOTSUPP in both cases for consistency.
>>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>
> root@dir665:~# ethtool -e lan4
> Cannot get EEPROM data: Operation not supported
>
> Tested-by: Andrew Lunn <andrew@lunn.ch>
Applied, thanks everyone.
^ permalink raw reply
* Re: [PATCH net-next] ethernet: mvneta: Use PHY status standard message
From: David Miller @ 2014-10-31 20:11 UTC (permalink / raw)
To: ezequiel.garcia
Cc: thomas.petazzoni, gregory.clement, nadavh, tawfik, alior, netdev
In-Reply-To: <1414771040-7789-1-git-send-email-ezequiel.garcia@free-electrons.com>
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Date: Fri, 31 Oct 2014 12:57:20 -0300
> Use phy_print_status() to report a change in the PHY status.
> The current message is not verbose enough, so this commit improves
> it by using the generic status message.
>
> After this change, the kernel reports PHY status down and up events as:
>
> mvneta f1070000.ethernet eth0: Link is Down
> mvneta f1070000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH v2] stmmac: pci: set default of the filter bins
From: David Miller @ 2014-10-31 20:10 UTC (permalink / raw)
To: andriy.shevchenko
Cc: peppe.cavallaro, netdev, hock.leong.kweh, vbridgers2013, stable
In-Reply-To: <1414772883-29503-1-git-send-email-andriy.shevchenko@linux.intel.com>
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Fri, 31 Oct 2014 18:28:03 +0200
> 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>
> Cc: stable@vger.kernel.org
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next] bonding: add bond_tx_drop() helper
From: David Miller @ 2014-10-31 20:09 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, j.vosburgh, vfalico, andy, maheshb
In-Reply-To: <1414781274.27538.32.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 31 Oct 2014 11:47:54 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Because bonding stats are usually sum of slave stats, it was
> not easy to account for tx drops at bonding layer.
>
> We can use dev->tx_dropped for this, as this counter is later
> added to the device stats (in dev_get_stats())
>
> This extends the idea we had in commit ee6377147409a ("bonding: Simplify
> the xmit function for modes that use xmit_hash") for bond_3ad_xor_xmit()
> to other bonding modes.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Mahesh Bandewar <maheshb@google.com>
Applied, thanks Eric.
^ permalink raw reply
* pull request: wireless 2014-10-31
From: John W. Linville @ 2014-10-31 19:58 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 15517 bytes --]
Dave,
Please pull this small batch of spooky fixes intended for the 3.18
stream...boo!
Cyril Brulebois adds an rt2x00 device ID.
Dan Carpenter provides a one-line masking fix for an ath9k debugfs
entry.
Larry Finger gives us a package of small rtlwifi fixes which add some
bits that were left out of some feature updates that were included
in the merge window. Hopefully this isn't a sign that the rtlwifi
base is getting too big...
Marc Yang brings a fix for a temporary mwifiex stall when doing 11n
RX reordering.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 99c814066e75d09e6a38574c6c395f022a04b730:
Merge tag 'mac80211-for-john-2014-10-23' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 (2014-10-27 13:38:15 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git tags/master-2014-10-30
for you to fetch changes up to 75a916e1944fea8347d2245c62567187e4eff9dd:
rtlwifi: rtl8192se: Fix firmware loading (2014-10-30 15:00:23 -0400)
----------------------------------------------------------------
Cyril Brulebois (1):
wireless: rt2x00: add new rt2800usb device
Dan Carpenter (1):
ath9k: fix some debugfs output
Larry Finger (5):
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: rtl8192se: Fix firmware loading
Marc Yang (1):
mwifiex: restart rxreorder timer correctly
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/mwifiex/11n_rxreorder.c | 52 +++++++++++++++++++++-------
drivers/net/wireless/mwifiex/11n_rxreorder.h | 2 ++
drivers/net/wireless/mwifiex/main.h | 1 +
drivers/net/wireless/rt2x00/rt2800usb.c | 1 +
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 ++
14 files changed, 67 insertions(+), 32 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 46f20a309b5f..5c45e787814e 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -455,7 +455,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
"%2d %2x %1x %2x %2x\n",
i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset,
(*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3),
- val[2] & (0x7 << (i * 3)) >> (i * 3),
+ (val[2] & (0x7 << (i * 3))) >> (i * 3),
(*dcuBase & (0x1f << dcuOffset)) >> dcuOffset);
}
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index 40057079ffb9..5ef5a0eeba50 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -196,6 +196,7 @@ mwifiex_del_rx_reorder_entry(struct mwifiex_private *priv,
mwifiex_11n_dispatch_pkt_until_start_win(priv, tbl, start_win);
del_timer_sync(&tbl->timer_context.timer);
+ tbl->timer_context.timer_is_set = false;
spin_lock_irqsave(&priv->rx_reorder_tbl_lock, flags);
list_del(&tbl->list);
@@ -297,6 +298,7 @@ mwifiex_flush_data(unsigned long context)
(struct reorder_tmr_cnxt *) context;
int start_win, seq_num;
+ ctx->timer_is_set = false;
seq_num = mwifiex_11n_find_last_seq_num(ctx);
if (seq_num < 0)
@@ -385,6 +387,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
new_node->timer_context.ptr = new_node;
new_node->timer_context.priv = priv;
+ new_node->timer_context.timer_is_set = false;
init_timer(&new_node->timer_context.timer);
new_node->timer_context.timer.function = mwifiex_flush_data;
@@ -399,6 +402,22 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags);
}
+static void
+mwifiex_11n_rxreorder_timer_restart(struct mwifiex_rx_reorder_tbl *tbl)
+{
+ u32 min_flush_time;
+
+ if (tbl->win_size >= MWIFIEX_BA_WIN_SIZE_32)
+ min_flush_time = MIN_FLUSH_TIMER_15_MS;
+ else
+ min_flush_time = MIN_FLUSH_TIMER_MS;
+
+ mod_timer(&tbl->timer_context.timer,
+ jiffies + msecs_to_jiffies(min_flush_time * tbl->win_size));
+
+ tbl->timer_context.timer_is_set = true;
+}
+
/*
* This function prepares command for adding a BA request.
*
@@ -523,31 +542,31 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
u8 *ta, u8 pkt_type, void *payload)
{
struct mwifiex_rx_reorder_tbl *tbl;
- int start_win, end_win, win_size;
+ int prev_start_win, start_win, end_win, win_size;
u16 pkt_index;
bool init_window_shift = false;
+ int ret = 0;
tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta);
if (!tbl) {
if (pkt_type != PKT_TYPE_BAR)
mwifiex_11n_dispatch_pkt(priv, payload);
- return 0;
+ return ret;
}
if ((pkt_type == PKT_TYPE_AMSDU) && !tbl->amsdu) {
mwifiex_11n_dispatch_pkt(priv, payload);
- return 0;
+ return ret;
}
start_win = tbl->start_win;
+ prev_start_win = start_win;
win_size = tbl->win_size;
end_win = ((start_win + win_size) - 1) & (MAX_TID_VALUE - 1);
if (tbl->flags & RXREOR_INIT_WINDOW_SHIFT) {
init_window_shift = true;
tbl->flags &= ~RXREOR_INIT_WINDOW_SHIFT;
}
- mod_timer(&tbl->timer_context.timer,
- jiffies + msecs_to_jiffies(MIN_FLUSH_TIMER_MS * win_size));
if (tbl->flags & RXREOR_FORCE_NO_DROP) {
dev_dbg(priv->adapter->dev,
@@ -568,11 +587,14 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
if ((start_win + TWOPOW11) > (MAX_TID_VALUE - 1)) {
if (seq_num >= ((start_win + TWOPOW11) &
(MAX_TID_VALUE - 1)) &&
- seq_num < start_win)
- return -1;
+ seq_num < start_win) {
+ ret = -1;
+ goto done;
+ }
} else if ((seq_num < start_win) ||
- (seq_num > (start_win + TWOPOW11))) {
- return -1;
+ (seq_num >= (start_win + TWOPOW11))) {
+ ret = -1;
+ goto done;
}
}
@@ -601,8 +623,10 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
else
pkt_index = (seq_num+MAX_TID_VALUE) - start_win;
- if (tbl->rx_reorder_ptr[pkt_index])
- return -1;
+ if (tbl->rx_reorder_ptr[pkt_index]) {
+ ret = -1;
+ goto done;
+ }
tbl->rx_reorder_ptr[pkt_index] = payload;
}
@@ -613,7 +637,11 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
*/
mwifiex_11n_scan_and_dispatch(priv, tbl);
- return 0;
+done:
+ if (!tbl->timer_context.timer_is_set ||
+ prev_start_win != tbl->start_win)
+ mwifiex_11n_rxreorder_timer_restart(tbl);
+ return ret;
}
/*
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.h b/drivers/net/wireless/mwifiex/11n_rxreorder.h
index 3a87bb0e3a62..63ecea89b4ab 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.h
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.h
@@ -21,6 +21,8 @@
#define _MWIFIEX_11N_RXREORDER_H_
#define MIN_FLUSH_TIMER_MS 50
+#define MIN_FLUSH_TIMER_15_MS 15
+#define MWIFIEX_BA_WIN_SIZE_32 32
#define PKT_TYPE_BAR 0xE7
#define MAX_TID_VALUE (2 << 11)
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index e2635747d966..f55658d15c60 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -592,6 +592,7 @@ struct reorder_tmr_cnxt {
struct timer_list timer;
struct mwifiex_rx_reorder_tbl *ptr;
struct mwifiex_private *priv;
+ u8 timer_is_set;
};
struct mwifiex_rx_reorder_tbl {
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 573897b8e878..8444313eabe2 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -1111,6 +1111,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
/* Ovislink */
{ USB_DEVICE(0x1b75, 0x3071) },
{ USB_DEVICE(0x1b75, 0x3072) },
+ { USB_DEVICE(0x1b75, 0xa200) },
/* Para */
{ USB_DEVICE(0x20b8, 0x8888) },
/* Pegatron */
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index f6179bc06086..07dae0d44abc 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -1828,3 +1828,9 @@ const struct ieee80211_ops rtl_ops = {
.flush = rtl_op_flush,
};
EXPORT_SYMBOL_GPL(rtl_ops);
+
+bool rtl_btc_status_false(void)
+{
+ return false;
+}
+EXPORT_SYMBOL_GPL(rtl_btc_status_false);
diff --git a/drivers/net/wireless/rtlwifi/core.h b/drivers/net/wireless/rtlwifi/core.h
index 59cd3b9dca25..624e1dc16d31 100644
--- a/drivers/net/wireless/rtlwifi/core.h
+++ b/drivers/net/wireless/rtlwifi/core.h
@@ -42,5 +42,6 @@ void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
u32 mask, u32 data);
void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data);
bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb);
+bool rtl_btc_status_false(void);
#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
index 831df101d7b7..9b660df6fd71 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
@@ -114,6 +114,8 @@
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 16, 4)
#define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12)
+#define GET_RX_STATUS_DESC_BUFF_ADDR(__pdesc) \
+ SHIFT_AND_MASK_LE(__pdesc + 24, 0, 32)
#define CHIP_VER_B BIT(4)
#define CHIP_BONDING_IDENTIFIER(_value) (((_value) >> 22) & 0x3)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index d86b5b566444..46ea07605eb4 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -244,6 +244,7 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
.phy_lc_calibrate = _rtl92ce_phy_lc_calibrate,
.phy_set_bw_mode_callback = rtl92ce_phy_set_bw_mode_callback,
.dm_dynamic_txpower = rtl92ce_dm_dynamic_txpower,
+ .get_btc_status = rtl_btc_status_false,
};
static struct rtl_mod_params rtl92ce_mod_params = {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 2fb9c7acb76a..dc3d20b17a26 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -728,6 +728,9 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
case HW_DESC_RXPKT_LEN:
ret = GET_RX_DESC_PKT_LEN(pdesc);
break;
+ case HW_DESC_RXBUFF_ADDR:
+ ret = GET_RX_STATUS_DESC_BUFF_ADDR(pdesc);
+ break;
default:
RT_ASSERT(false, "ERR rxdesc :%d not process\n",
desc_name);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
index edab5a5351b5..a0aba088259a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
@@ -251,6 +251,7 @@ static struct rtl_hal_ops rtl8192de_hal_ops = {
.get_rfreg = rtl92d_phy_query_rf_reg,
.set_rfreg = rtl92d_phy_set_rf_reg,
.linked_set_reg = rtl92d_linked_set_reg,
+ .get_btc_status = rtl_btc_status_false,
};
static struct rtl_mod_params rtl92de_mod_params = {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
index 83c98674bfd3..6e7a70b43949 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
@@ -446,6 +446,8 @@
/* DWORD 6 */
#define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val) \
SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val)
+#define GET_RX_STATUS_DESC_BUFF_ADDR(__pdesc) \
+ SHIFT_AND_MASK_LE(__pdesc + 24, 0, 32)
#define SE_RX_HAL_IS_CCK_RATE(_pdesc)\
(GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M || \
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 1bff2a0f7600..aadba29c167a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -87,11 +87,8 @@ static void rtl92s_init_aspm_vars(struct ieee80211_hw *hw)
static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
{
struct ieee80211_hw *hw = context;
- struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_pci *rtlpci = rtl_pcidev(pcipriv);
struct rt_firmware *pfirmware = NULL;
- int err;
RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
"Firmware callback routine entered!\n");
@@ -112,20 +109,6 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size);
pfirmware->sz_fw_tmpbufferlen = firmware->size;
release_firmware(firmware);
-
- err = ieee80211_register_hw(hw);
- if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't register mac80211 hw\n");
- return;
- } else {
- rtlpriv->mac80211.mac80211_registered = 1;
- }
- rtlpci->irq_alloc = 1;
- set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
-
- /*init rfkill */
- rtl_init_rfkill(hw);
}
static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
@@ -226,8 +209,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
if (!rtlpriv->rtlhal.pfirmware)
return 1;
- rtlpriv->max_fw_size = RTL8190_MAX_RAW_FIRMWARE_CODE_SIZE;
-
+ rtlpriv->max_fw_size = RTL8190_MAX_FIRMWARE_CODE_SIZE*2 +
+ sizeof(struct fw_hdr);
pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n"
"Loading firmware %s\n", rtlpriv->cfg->fw_name);
/* request fw */
@@ -294,6 +277,7 @@ static struct rtl_hal_ops rtl8192se_hal_ops = {
.set_bbreg = rtl92s_phy_set_bb_reg,
.get_rfreg = rtl92s_phy_query_rf_reg,
.set_rfreg = rtl92s_phy_set_rf_reg,
+ .get_btc_status = rtl_btc_status_false,
};
static struct rtl_mod_params rtl92se_mod_params = {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index b358ebce8942..672fd3b02835 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -640,6 +640,9 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
case HW_DESC_RXPKT_LEN:
ret = GET_RX_STATUS_DESC_PKT_LEN(desc);
break;
+ case HW_DESC_RXBUFF_ADDR:
+ ret = GET_RX_STATUS_DESC_BUFF_ADDR(desc);
+ break;
default:
RT_ASSERT(false, "ERR rxdesc :%d not process\n",
desc_name);
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related
* Re: [PATCH net 2/2] mpls: Allow mpls_gso to be built as module
From: David Miller @ 2014-10-31 19:48 UTC (permalink / raw)
To: pshelar; +Cc: netdev, simon.horman
In-Reply-To: <1414655404-1572-1-git-send-email-pshelar@nicira.com>
From: Pravin B Shelar <pshelar@nicira.com>
Date: Thu, 30 Oct 2014 00:50:04 -0700
> Kconfig already allows mpls to be built as module. Following patch
> fixes Makefile to do same.
>
> CC: Simon Horman <simon.horman@netronome.com>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Applied.
^ permalink raw reply
* Re: [PATCH net 1/2] mpls: Fix mpls_gso handler.
From: David Miller @ 2014-10-31 19:47 UTC (permalink / raw)
To: pshelar; +Cc: netdev, simon.horman
In-Reply-To: <1414655397-1541-1-git-send-email-pshelar@nicira.com>
From: Pravin B Shelar <pshelar@nicira.com>
Date: Thu, 30 Oct 2014 00:49:57 -0700
> mpls gso handler needs to pull skb after segmenting skb.
>
> CC: Simon Horman <simon.horman@netronome.com>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Applied.
^ permalink raw reply
* Re: suspend/resume broken on 3.18-rc2
From: Fabio Estevam @ 2014-10-31 19:35 UTC (permalink / raw)
To: fugang.duan@freescale.com
Cc: Anson.Huang@freescale.com, Frank.Li@freescale.com, Russell King,
Shawn Guo, netdev@vger.kernel.org
In-Reply-To: <69f3cd5a2961445ebab0f2652ffa60bd@BLUPR03MB373.namprd03.prod.outlook.com>
Andy,
On Thu, Oct 30, 2014 at 1:11 AM, fugang.duan@freescale.com
<fugang.duan@freescale.com> wrote:
> I tried it yesterday with FEC close, resume cannot back.
> I will try it again.
We have a regression in 3.18-rc1: if I use the imx6sx-sdb.dtb from
3.17.1 then I get:
root@freescale /$ echo enabled > /sys/class/tty/ttymxc0/power/wakeup
root@freescale /$ echo mem > /sys/power/state
[ 13.883094] PM: Syncing filesystems ... done.
[ 13.932184] Freezing user space processes ... (elapsed 0.003 seconds) done.
[ 13.942928] Freezing remaining freezable tasks ... (elapsed 0.003 seconds) d.
[ 14.014823] PM: suspend of devices complete after 54.572 msecs
[ 14.020730] PM: suspend devices took 0.060 seconds
[ 14.035241] PM: late suspend of devices complete after 9.545 msecs
[ 14.050901] PM: noirq suspend of devices complete after 9.383 msecs
[ 14.057626] Disabling non-boot CPUs ...
[ 14.071514] PM: noirq resume of devices complete after 8.338 msecs
[ 14.085645] PM: early resume of devices complete after 6.417 msecs
[ 14.097720] fec 2188000.ethernet eth0: rcv is not +last
[ 14.187491] PM: resume of devices complete after 95.494 msecs
[ 14.199039] PM: resume devices took 0.100 seconds
[ 14.203831] Restarting tasks ... done.
[ 15.892318] fec 2188000.ethernet eth0: rcv is not +last
[ 15.897688] fec 2188000.ethernet eth0: rcv is not +last
[ 15.903010] fec 2188000.ethernet eth0: rcv is not +last
[ 15.908326] fec 2188000.ethernet eth0: rcv is not +last
[ 15.913635] fec 2188000.ethernet eth0: rcv is not +last
[ 15.918945] fec 2188000.ethernet eth0: rcv is not +last
So fec suspend/resume is broken for mx6sx.
Please take a look at it.
^ permalink raw reply
* Re: [PATCH v3 1/1] ip-link: add switch to show human readable output
From: Stephen Hemminger @ 2014-10-31 19:31 UTC (permalink / raw)
To: Christian Hesse; +Cc: netdev
In-Reply-To: <20141031111753.2b524ebb@leda.localdomain>
On Fri, 31 Oct 2014 11:17:53 +0100
Christian Hesse <mail@eworm.de> wrote:
> Stephen Hemminger <stephen@networkplumber.org> on Wed, 2014/10/29 22:47:
> > I like the idea as a concept
>
> Great! ;)
>
> > 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
>
> Removed the suffix in patch v3. Not sure if it is correct, though. I do use a
> base of 2, so K = 1024, M = 1048576, ...
No must be 1000 for communications (SI)
http://en.wikipedia.org/wiki/Binary_prefix
^ permalink raw reply
* Re: [PATCH net-next] bonding: add bond_tx_drop() helper
From: Mahesh Bandewar @ 2014-10-31 19:30 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Miller, netdev, Jay Vosburgh, Veaceslav Falico,
Andy Gospodarek
In-Reply-To: <1414781274.27538.32.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Oct 31, 2014 at 11:47 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> From: Eric Dumazet <edumazet@google.com>
>
> Because bonding stats are usually sum of slave stats, it was
> not easy to account for tx drops at bonding layer.
>
> We can use dev->tx_dropped for this, as this counter is later
> added to the device stats (in dev_get_stats())
>
> This extends the idea we had in commit ee6377147409a ("bonding: Simplify
> the xmit function for modes that use xmit_hash") for bond_3ad_xor_xmit()
> to other bonding modes.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Mahesh Bandewar <maheshb@google.com>
>
> ---
> drivers/net/bonding/bond_alb.c | 2 +-
> drivers/net/bonding/bond_main.c | 15 +++++++--------
> drivers/net/bonding/bonding.h | 6 ++++++
> 3 files changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
> index d2eadab787c55d8fc0f361755409a880d64abfb3..baa58e79256a8b804e6ab683af6665f0730b86de 100644
> --- a/drivers/net/bonding/bond_alb.c
> +++ b/drivers/net/bonding/bond_alb.c
> @@ -1326,7 +1326,7 @@ static int bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
> }
>
> /* no suitable interface, frame not sent */
> - dev_kfree_skb_any(skb);
> + bond_tx_drop(bond->dev, skb);
> out:
> return NETDEV_TX_OK;
> }
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index c9ac06cfe6b7b3a8f62568b70a6ad6d7ca9b44d0..c7520082fb0d7bfbc34ac00b4f4186a30197ad74 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -3522,7 +3522,7 @@ static void bond_xmit_slave_id(struct bonding *bond, struct sk_buff *skb, int sl
> }
> }
> /* no slave that can tx has been found */
> - dev_kfree_skb_any(skb);
> + bond_tx_drop(bond->dev, skb);
> }
>
> /**
> @@ -3584,7 +3584,7 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
> slave_id = bond_rr_gen_slave_id(bond);
> bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
> } else {
> - dev_kfree_skb_any(skb);
> + bond_tx_drop(bond_dev, skb);
> }
> }
>
> @@ -3603,7 +3603,7 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d
> if (slave)
> bond_dev_queue_xmit(bond, skb, slave->dev);
> else
> - dev_kfree_skb_any(skb);
> + bond_tx_drop(bond_dev, skb);
>
> return NETDEV_TX_OK;
> }
> @@ -3747,8 +3747,7 @@ int bond_3ad_xor_xmit(struct sk_buff *skb, struct net_device *dev)
> slave = slaves->arr[bond_xmit_hash(bond, skb) % count];
> bond_dev_queue_xmit(bond, skb, slave->dev);
> } else {
> - dev_kfree_skb_any(skb);
> - atomic_long_inc(&dev->tx_dropped);
> + bond_tx_drop(dev, skb);
> }
>
> return NETDEV_TX_OK;
> @@ -3778,7 +3777,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
> if (slave && bond_slave_is_up(slave) && slave->link == BOND_LINK_UP)
> bond_dev_queue_xmit(bond, skb, slave->dev);
> else
> - dev_kfree_skb_any(skb);
> + bond_tx_drop(bond_dev, skb);
>
> return NETDEV_TX_OK;
> }
> @@ -3858,7 +3857,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev
> /* Should never happen, mode already checked */
> netdev_err(dev, "Unknown bonding mode %d\n", BOND_MODE(bond));
> WARN_ON_ONCE(1);
> - dev_kfree_skb_any(skb);
> + bond_tx_drop(dev, skb);
> return NETDEV_TX_OK;
> }
> }
> @@ -3878,7 +3877,7 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
> if (bond_has_slaves(bond))
> ret = __bond_start_xmit(skb, dev);
> else
> - dev_kfree_skb_any(skb);
> + bond_tx_drop(dev, skb);
> rcu_read_unlock();
>
> return ret;
> diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
> index 10920f0686e2f0222203359751581d1b728c6617..bfb0b51c081a27fbbbe64deda058f70860aac49d 100644
> --- a/drivers/net/bonding/bonding.h
> +++ b/drivers/net/bonding/bonding.h
> @@ -645,4 +645,10 @@ extern struct bond_parm_tbl ad_select_tbl[];
> /* exported from bond_netlink.c */
> extern struct rtnl_link_ops bond_link_ops;
>
> +static inline void bond_tx_drop(struct net_device *dev, struct sk_buff *skb)
> +{
> + atomic_long_inc(&dev->tx_dropped);
> + dev_kfree_skb_any(skb);
> +}
> +
> #endif /* _LINUX_BONDING_H */
>
Nice and simple. Thanks Eric
Acked-by: Mahesh Bandewar <maheshb@google.com>
^ permalink raw reply
* Re: [PATCH net-next] bonding: add bond_tx_drop() helper
From: Nikolay Aleksandrov @ 2014-10-31 19:25 UTC (permalink / raw)
To: Eric Dumazet, David Miller
Cc: netdev, Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
Mahesh Bandewar
In-Reply-To: <1414781274.27538.32.camel@edumazet-glaptop2.roam.corp.google.com>
On 10/31/2014 07:47 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Because bonding stats are usually sum of slave stats, it was
> not easy to account for tx drops at bonding layer.
>
> We can use dev->tx_dropped for this, as this counter is later
> added to the device stats (in dev_get_stats())
>
> This extends the idea we had in commit ee6377147409a ("bonding: Simplify
> the xmit function for modes that use xmit_hash") for bond_3ad_xor_xmit()
> to other bonding modes.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Mahesh Bandewar <maheshb@google.com>
> ---
> drivers/net/bonding/bond_alb.c | 2 +-
> drivers/net/bonding/bond_main.c | 15 +++++++--------
> drivers/net/bonding/bonding.h | 6 ++++++
> 3 files changed, 14 insertions(+), 9 deletions(-)
>
Nice,
Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox