* Re: [PATCH net-next v3.16]r8169: Correct value from speed 10 on MII_BMCR
From: Francois Romieu @ 2016-03-25 22:53 UTC (permalink / raw)
To: Phil Sutter; +Cc: Corcodel Marian, netdev
In-Reply-To: <20160325133113.3001B62813@mail.nwl.cc>
Phil Sutter <phil@nwl.cc> :
[...]
> Your patch submissions are getting better, also good to see you're
> finally using git-send-email. A few things need to be corrected though:
>
#define BMCR_RESV 0x003f /* Unused... */
#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
#define BMCR_CTST 0x0080 /* Collision test */
#define BMCR_FULLDPLX 0x0100 /* Full duplex */
#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
#define BMCR_ISOLATE 0x0400 /* Isolate data paths from MII */
#define BMCR_PDOWN 0x0800 /* Enable low power state */
#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
BMCR_SPEED100 apart, *all* these bits are now set.
It does not make much sense.
> Also detailed instructions on how to trigger the problem you are fixing
> for would be good. In detail: Which specific hardware was used, in which
> situation did the problem occur, how did it behave in that situation and
> what was the expected behaviour?
Been there. Such requests are usually left unanswered. :o(
Btw, this stuff targets 3.16 (...) and net-next is still closed.
--
Ueimor
^ permalink raw reply
* Re: [PATCH RFC 3/9] net: Add fast receive encapsulation
From: Joe Perches @ 2016-03-25 22:31 UTC (permalink / raw)
To: David Miller, tom; +Cc: netdev, kernel-team
In-Reply-To: <20160325.164042.1532577255302949895.davem@davemloft.net>
On Fri, 2016-03-25 at 16:40 -0400, David Miller wrote:
> From: Tom Herbert <tom@herbertland.com>
> Date: Wed, 23 Mar 2016 15:36:52 -0700
>
> > +{
> > + struct udp_sock *up = udp_sk(sk);
> > + int is_udplite = IS_UDPLITE(sk);
> > +
> > + int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
> > +
>
> Small nit, please put this encap_rcv function pointer declaration at
> the top of the local variable list.
It might also be nice to remove the equivalent typedef and
use the same form in udp_tunnel.h
---
include/net/udp_tunnel.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
index b831140..71885b1 100644
--- a/include/net/udp_tunnel.h
+++ b/include/net/udp_tunnel.h
@@ -62,15 +62,12 @@ static inline int udp_sock_create(struct net *net,
return -EPFNOSUPPORT;
}
-typedef int (*udp_tunnel_encap_rcv_t)(struct sock *sk, struct sk_buff *skb);
-typedef void (*udp_tunnel_encap_destroy_t)(struct sock *sk);
-
struct udp_tunnel_sock_cfg {
void *sk_user_data; /* user data used by encap_rcv call back */
/* Used for setting up udp_sock fields, see udp.h for details */
__u8 encap_type;
- udp_tunnel_encap_rcv_t encap_rcv;
- udp_tunnel_encap_destroy_t encap_destroy;
+ int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
+ void (*encap_destroy)(struct sock *sk);
};
/* Setup the given (UDP) sock to receive UDP encapsulated packets */
^ permalink raw reply related
* [RFC net-next 2/2] udp: No longer use SLAB_DESTROY_BY_RCU
From: Eric Dumazet @ 2016-03-25 22:29 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Tom Herbert
In-Reply-To: <1458944964-12890-1-git-send-email-edumazet@google.com>
Tom Herbert would like to avoid touching UDP socket refcnt for encapsulated
traffic. For this to happen, we need to use normal RCU rules, with a grace
period before freeing a socket. UDP sockets are not short lived in the
high usage case, so the added cost of call_rcu() should not be a concern.
This actually removes a lot of complexity in UDP stack
Multicast receives no longer need to hold a bucket lock.
Note that ip early demux still needs to take a reference on the socket.
Same remark for functions used by xt_socket and xt_PROXY netfilter modules,
but this might be changed later.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <tom@herbertland.com>
---
include/linux/udp.h | 8 +-
include/net/sock.h | 12 +--
include/net/udp.h | 2 +-
net/ipv4/udp.c | 290 +++++++++++++++-------------------------------------
net/ipv4/udp_diag.c | 18 ++--
net/ipv6/udp.c | 194 +++++++++++------------------------
6 files changed, 162 insertions(+), 362 deletions(-)
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 87c094961bd5..32342754643a 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -98,11 +98,11 @@ static inline bool udp_get_no_check6_rx(struct sock *sk)
return udp_sk(sk)->no_check6_rx;
}
-#define udp_portaddr_for_each_entry(__sk, node, list) \
- hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node)
+#define udp_portaddr_for_each_entry(__sk, list) \
+ hlist_for_each_entry(__sk, list, __sk_common.skc_portaddr_node)
-#define udp_portaddr_for_each_entry_rcu(__sk, node, list) \
- hlist_nulls_for_each_entry_rcu(__sk, node, list, __sk_common.skc_portaddr_node)
+#define udp_portaddr_for_each_entry_rcu(__sk, list) \
+ hlist_for_each_entry_rcu(__sk, list, __sk_common.skc_portaddr_node)
#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
diff --git a/include/net/sock.h b/include/net/sock.h
index c88785a3e76c..5b9562bc478e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -178,7 +178,7 @@ struct sock_common {
int skc_bound_dev_if;
union {
struct hlist_node skc_bind_node;
- struct hlist_nulls_node skc_portaddr_node;
+ struct hlist_node skc_portaddr_node;
};
struct proto *skc_prot;
possible_net_t skc_net;
@@ -670,18 +670,18 @@ static inline void sk_add_bind_node(struct sock *sk,
hlist_for_each_entry(__sk, list, sk_bind_node)
/**
- * sk_nulls_for_each_entry_offset - iterate over a list at a given struct offset
+ * sk_for_each_entry_offset - iterate over a list at a given struct offset
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @head: the head for your list.
* @offset: offset of hlist_node within the struct.
*
*/
-#define sk_nulls_for_each_entry_offset(tpos, pos, head, offset) \
- for (pos = (head)->first; \
- (!is_a_nulls(pos)) && \
+#define sk_for_each_entry_offset_rcu(tpos, pos, head, offset) \
+ for (pos = rcu_dereference((head)->first); \
+ pos != NULL && \
({ tpos = (typeof(*tpos) *)((void *)pos - offset); 1;}); \
- pos = pos->next)
+ pos = rcu_dereference(pos->next))
static inline struct user_namespace *sk_user_ns(struct sock *sk)
{
diff --git a/include/net/udp.h b/include/net/udp.h
index 92927f729ac8..d870ec1611c4 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -59,7 +59,7 @@ struct udp_skb_cb {
* @lock: spinlock protecting changes to head/count
*/
struct udp_hslot {
- struct hlist_nulls_head head;
+ struct hlist_head head;
int count;
spinlock_t lock;
} __attribute__((aligned(2 * sizeof(long))));
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 08eed5e16df0..3ebca8445d35 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -143,10 +143,9 @@ static int udp_lib_lport_inuse(struct net *net, __u16 num,
unsigned int log)
{
struct sock *sk2;
- struct hlist_nulls_node *node;
kuid_t uid = sock_i_uid(sk);
- sk_nulls_for_each(sk2, node, &hslot->head) {
+ sk_for_each(sk2, &hslot->head) {
if (net_eq(sock_net(sk2), net) &&
sk2 != sk &&
(bitmap || udp_sk(sk2)->udp_port_hash == num) &&
@@ -177,12 +176,11 @@ static int udp_lib_lport_inuse2(struct net *net, __u16 num,
bool match_wildcard))
{
struct sock *sk2;
- struct hlist_nulls_node *node;
kuid_t uid = sock_i_uid(sk);
int res = 0;
spin_lock(&hslot2->lock);
- udp_portaddr_for_each_entry(sk2, node, &hslot2->head) {
+ udp_portaddr_for_each_entry(sk2, &hslot2->head) {
if (net_eq(sock_net(sk2), net) &&
sk2 != sk &&
(udp_sk(sk2)->udp_port_hash == num) &&
@@ -207,11 +205,10 @@ static int udp_reuseport_add_sock(struct sock *sk, struct udp_hslot *hslot,
bool match_wildcard))
{
struct net *net = sock_net(sk);
- struct hlist_nulls_node *node;
kuid_t uid = sock_i_uid(sk);
struct sock *sk2;
- sk_nulls_for_each(sk2, node, &hslot->head) {
+ sk_for_each(sk2, &hslot->head) {
if (net_eq(sock_net(sk2), net) &&
sk2 != sk &&
sk2->sk_family == sk->sk_family &&
@@ -333,17 +330,18 @@ found:
goto fail_unlock;
}
- sk_nulls_add_node_rcu(sk, &hslot->head);
+ sk_add_node_rcu(sk, &hslot->head);
hslot->count++;
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash);
spin_lock(&hslot2->lock);
- hlist_nulls_add_head_rcu(&udp_sk(sk)->udp_portaddr_node,
+ hlist_add_head_rcu(&udp_sk(sk)->udp_portaddr_node,
&hslot2->head);
hslot2->count++;
spin_unlock(&hslot2->lock);
}
+ sock_set_flag(sk, SOCK_RCU_FREE);
error = 0;
fail_unlock:
spin_unlock_bh(&hslot->lock);
@@ -497,37 +495,27 @@ static struct sock *udp4_lib_lookup2(struct net *net,
struct sk_buff *skb)
{
struct sock *sk, *result;
- struct hlist_nulls_node *node;
int score, badness, matches = 0, reuseport = 0;
- bool select_ok = true;
u32 hash = 0;
-begin:
result = NULL;
badness = 0;
- udp_portaddr_for_each_entry_rcu(sk, node, &hslot2->head) {
+ udp_portaddr_for_each_entry_rcu(sk, &hslot2->head) {
score = compute_score2(sk, net, saddr, sport,
daddr, hnum, dif);
if (score > badness) {
- result = sk;
- badness = score;
reuseport = sk->sk_reuseport;
if (reuseport) {
hash = udp_ehashfn(net, daddr, hnum,
saddr, sport);
- if (select_ok) {
- struct sock *sk2;
-
- sk2 = reuseport_select_sock(sk, hash, skb,
+ result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
- if (sk2) {
- result = sk2;
- select_ok = false;
- goto found;
- }
- }
+ if (result)
+ return result;
matches = 1;
}
+ badness = score;
+ result = sk;
} else if (score == badness && reuseport) {
matches++;
if (reciprocal_scale(hash, matches) == 0)
@@ -535,23 +523,6 @@ begin:
hash = next_pseudo_random32(hash);
}
}
- /*
- * if the nulls value we got at the end of this lookup is
- * not the expected one, we must restart lookup.
- * We probably met an item that was moved to another chain.
- */
- if (get_nulls_value(node) != slot2)
- goto begin;
- if (result) {
-found:
- if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2)))
- result = NULL;
- else if (unlikely(compute_score2(result, net, saddr, sport,
- daddr, hnum, dif) < badness)) {
- sock_put(result);
- goto begin;
- }
- }
return result;
}
@@ -563,15 +534,12 @@ struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr,
int dif, struct udp_table *udptable, struct sk_buff *skb)
{
struct sock *sk, *result;
- struct hlist_nulls_node *node;
unsigned short hnum = ntohs(dport);
unsigned int hash2, slot2, slot = udp_hashfn(net, hnum, udptable->mask);
struct udp_hslot *hslot2, *hslot = &udptable->hash[slot];
int score, badness, matches = 0, reuseport = 0;
- bool select_ok = true;
u32 hash = 0;
- rcu_read_lock();
if (hslot->count > 10) {
hash2 = udp4_portaddr_hash(net, daddr, hnum);
slot2 = hash2 & udptable->mask;
@@ -593,35 +561,27 @@ struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr,
htonl(INADDR_ANY), hnum, dif,
hslot2, slot2, skb);
}
- rcu_read_unlock();
return result;
}
begin:
result = NULL;
badness = 0;
- sk_nulls_for_each_rcu(sk, node, &hslot->head) {
+ sk_for_each_rcu(sk, &hslot->head) {
score = compute_score(sk, net, saddr, hnum, sport,
daddr, dport, dif);
if (score > badness) {
- result = sk;
- badness = score;
reuseport = sk->sk_reuseport;
if (reuseport) {
hash = udp_ehashfn(net, daddr, hnum,
saddr, sport);
- if (select_ok) {
- struct sock *sk2;
-
- sk2 = reuseport_select_sock(sk, hash, skb,
+ result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
- if (sk2) {
- result = sk2;
- select_ok = false;
- goto found;
- }
- }
+ if (result)
+ return result;
matches = 1;
}
+ result = sk;
+ badness = score;
} else if (score == badness && reuseport) {
matches++;
if (reciprocal_scale(hash, matches) == 0)
@@ -629,25 +589,6 @@ begin:
hash = next_pseudo_random32(hash);
}
}
- /*
- * if the nulls value we got at the end of this lookup is
- * not the expected one, we must restart lookup.
- * We probably met an item that was moved to another chain.
- */
- if (get_nulls_value(node) != slot)
- goto begin;
-
- if (result) {
-found:
- if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2)))
- result = NULL;
- else if (unlikely(compute_score(result, net, saddr, hnum, sport,
- daddr, dport, dif) < badness)) {
- sock_put(result);
- goto begin;
- }
- }
- rcu_read_unlock();
return result;
}
EXPORT_SYMBOL_GPL(__udp4_lib_lookup);
@@ -663,13 +604,24 @@ static inline struct sock *__udp4_lib_lookup_skb(struct sk_buff *skb,
udptable, skb);
}
+/* Must be called under rcu_read_lock().
+ * Does increment socket refcount.
+ */
+#if IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_SOCKET) || \
+ IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY)
struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
__be32 daddr, __be16 dport, int dif)
{
- return __udp4_lib_lookup(net, saddr, sport, daddr, dport, dif,
- &udp_table, NULL);
+ struct sock *sk;
+
+ sk = __udp4_lib_lookup(net, saddr, sport, daddr, dport,
+ dif, &udp_table, NULL);
+ if (sk && !atomic_inc_not_zero(&sk->sk_refcnt))
+ sk = NULL;
+ return sk;
}
EXPORT_SYMBOL_GPL(udp4_lib_lookup);
+#endif
static inline bool __udp_is_mcast_sock(struct net *net, struct sock *sk,
__be16 loc_port, __be32 loc_addr,
@@ -771,7 +723,7 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
sk->sk_err = err;
sk->sk_error_report(sk);
out:
- sock_put(sk);
+ return;
}
void udp_err(struct sk_buff *skb, u32 info)
@@ -1474,13 +1426,13 @@ void udp_lib_unhash(struct sock *sk)
spin_lock_bh(&hslot->lock);
if (rcu_access_pointer(sk->sk_reuseport_cb))
reuseport_detach_sock(sk);
- if (sk_nulls_del_node_init_rcu(sk)) {
+ if (sk_del_node_init_rcu(sk)) {
hslot->count--;
inet_sk(sk)->inet_num = 0;
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
spin_lock(&hslot2->lock);
- hlist_nulls_del_init_rcu(&udp_sk(sk)->udp_portaddr_node);
+ hlist_del_init_rcu(&udp_sk(sk)->udp_portaddr_node);
hslot2->count--;
spin_unlock(&hslot2->lock);
}
@@ -1513,12 +1465,12 @@ void udp_lib_rehash(struct sock *sk, u16 newhash)
if (hslot2 != nhslot2) {
spin_lock(&hslot2->lock);
- hlist_nulls_del_init_rcu(&udp_sk(sk)->udp_portaddr_node);
+ hlist_del_init_rcu(&udp_sk(sk)->udp_portaddr_node);
hslot2->count--;
spin_unlock(&hslot2->lock);
spin_lock(&nhslot2->lock);
- hlist_nulls_add_head_rcu(&udp_sk(sk)->udp_portaddr_node,
+ hlist_add_head_rcu(&udp_sk(sk)->udp_portaddr_node,
&nhslot2->head);
nhslot2->count++;
spin_unlock(&nhslot2->lock);
@@ -1697,35 +1649,6 @@ drop:
return -1;
}
-static void flush_stack(struct sock **stack, unsigned int count,
- struct sk_buff *skb, unsigned int final)
-{
- unsigned int i;
- struct sk_buff *skb1 = NULL;
- struct sock *sk;
-
- for (i = 0; i < count; i++) {
- sk = stack[i];
- if (likely(!skb1))
- skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
-
- if (!skb1) {
- atomic_inc(&sk->sk_drops);
- UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
- IS_UDPLITE(sk));
- UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
- IS_UDPLITE(sk));
- }
-
- if (skb1 && udp_queue_rcv_skb(sk, skb1) <= 0)
- skb1 = NULL;
-
- sock_put(sk);
- }
- if (unlikely(skb1))
- kfree_skb(skb1);
-}
-
/* For TCP sockets, sk_rx_dst is protected by socket lock
* For UDP, we use xchg() to guard against concurrent changes.
*/
@@ -1749,14 +1672,14 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
struct udp_table *udptable,
int proto)
{
- struct sock *sk, *stack[256 / sizeof(struct sock *)];
- struct hlist_nulls_node *node;
+ struct sock *sk, *first = NULL;
unsigned short hnum = ntohs(uh->dest);
struct udp_hslot *hslot = udp_hashslot(udptable, net, hnum);
- int dif = skb->dev->ifindex;
- unsigned int count = 0, offset = offsetof(typeof(*sk), sk_nulls_node);
unsigned int hash2 = 0, hash2_any = 0, use_hash2 = (hslot->count > 10);
- bool inner_flushed = false;
+ unsigned int offset = offsetof(typeof(*sk), sk_node);
+ int dif = skb->dev->ifindex;
+ struct hlist_node *node;
+ struct sk_buff *nskb;
if (use_hash2) {
hash2_any = udp4_portaddr_hash(net, htonl(INADDR_ANY), hnum) &
@@ -1767,23 +1690,27 @@ start_lookup:
offset = offsetof(typeof(*sk), __sk_common.skc_portaddr_node);
}
- spin_lock(&hslot->lock);
- sk_nulls_for_each_entry_offset(sk, node, &hslot->head, offset) {
- if (__udp_is_mcast_sock(net, sk,
- uh->dest, daddr,
- uh->source, saddr,
- dif, hnum)) {
- if (unlikely(count == ARRAY_SIZE(stack))) {
- flush_stack(stack, count, skb, ~0);
- inner_flushed = true;
- count = 0;
- }
- stack[count++] = sk;
- sock_hold(sk);
+ sk_for_each_entry_offset_rcu(sk, node, &hslot->head, offset) {
+ if (!__udp_is_mcast_sock(net, sk, uh->dest, daddr,
+ uh->source, saddr, dif, hnum))
+ continue;
+
+ if (!first) {
+ first = sk;
+ continue;
}
- }
+ nskb = skb_clone(skb, GFP_ATOMIC);
- spin_unlock(&hslot->lock);
+ if (unlikely(!nskb)) {
+ atomic_inc(&sk->sk_drops);
+ UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
+ IS_UDPLITE(sk));
+ UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
+ IS_UDPLITE(sk));
+ continue;
+ }
+ udp_queue_rcv_skb(sk, nskb);
+ }
/* Also lookup *:port if we are using hash2 and haven't done so yet. */
if (use_hash2 && hash2 != hash2_any) {
@@ -1791,17 +1718,10 @@ start_lookup:
goto start_lookup;
}
- /*
- * do the slow work with no lock held
- */
- if (count) {
- flush_stack(stack, count, skb, count - 1);
- } else {
- if (!inner_flushed)
- UDP_INC_STATS_BH(net, UDP_MIB_IGNOREDMULTI,
- proto == IPPROTO_UDPLITE);
- consume_skb(skb);
- }
+ if (first)
+ udp_queue_rcv_skb(first, skb);
+ else
+ kfree_skb(skb);
return 0;
}
@@ -1897,7 +1817,6 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
inet_compute_pseudo);
ret = udp_queue_rcv_skb(sk, skb);
- sock_put(sk);
/* a return value > 0 means to resubmit the input, but
* it wants the return to be -protocol, or 0
@@ -1958,49 +1877,24 @@ static struct sock *__udp4_lib_mcast_demux_lookup(struct net *net,
int dif)
{
struct sock *sk, *result;
- struct hlist_nulls_node *node;
unsigned short hnum = ntohs(loc_port);
- unsigned int count, slot = udp_hashfn(net, hnum, udp_table.mask);
+ unsigned int slot = udp_hashfn(net, hnum, udp_table.mask);
struct udp_hslot *hslot = &udp_table.hash[slot];
/* Do not bother scanning a too big list */
if (hslot->count > 10)
return NULL;
- rcu_read_lock();
-begin:
- count = 0;
result = NULL;
- sk_nulls_for_each_rcu(sk, node, &hslot->head) {
- if (__udp_is_mcast_sock(net, sk,
- loc_port, loc_addr,
- rmt_port, rmt_addr,
- dif, hnum)) {
+ sk_for_each_rcu(sk, &hslot->head) {
+ if (__udp_is_mcast_sock(net, sk, loc_port, loc_addr,
+ rmt_port, rmt_addr, dif, hnum)) {
+ if (result)
+ return NULL;
result = sk;
- ++count;
}
}
- /*
- * if the nulls value we got at the end of this lookup is
- * not the expected one, we must restart lookup.
- * We probably met an item that was moved to another chain.
- */
- if (get_nulls_value(node) != slot)
- goto begin;
-
- if (result) {
- if (count != 1 ||
- unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2)))
- result = NULL;
- else if (unlikely(!__udp_is_mcast_sock(net, result,
- loc_port, loc_addr,
- rmt_port, rmt_addr,
- dif, hnum))) {
- sock_put(result);
- result = NULL;
- }
- }
- rcu_read_unlock();
+
return result;
}
@@ -2013,37 +1907,20 @@ static struct sock *__udp4_lib_demux_lookup(struct net *net,
__be16 rmt_port, __be32 rmt_addr,
int dif)
{
- struct sock *sk, *result;
- struct hlist_nulls_node *node;
unsigned short hnum = ntohs(loc_port);
unsigned int hash2 = udp4_portaddr_hash(net, loc_addr, hnum);
unsigned int slot2 = hash2 & udp_table.mask;
struct udp_hslot *hslot2 = &udp_table.hash2[slot2];
INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr);
const __portpair ports = INET_COMBINED_PORTS(rmt_port, hnum);
+ struct sock *sk;
- rcu_read_lock();
- result = NULL;
- udp_portaddr_for_each_entry_rcu(sk, node, &hslot2->head) {
+ udp_portaddr_for_each_entry_rcu(sk, &hslot2->head) {
if (INET_MATCH(sk, net, acookie,
rmt_addr, loc_addr, ports, dif))
- result = sk;
- /* Only check first socket in chain */
- break;
- }
-
- if (result) {
- if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2)))
- result = NULL;
- else if (unlikely(!INET_MATCH(sk, net, acookie,
- rmt_addr, loc_addr,
- ports, dif))) {
- sock_put(result);
- result = NULL;
- }
+ return sk;
}
- rcu_read_unlock();
- return result;
+ return NULL;
}
void udp_v4_early_demux(struct sk_buff *skb)
@@ -2051,7 +1928,7 @@ void udp_v4_early_demux(struct sk_buff *skb)
struct net *net = dev_net(skb->dev);
const struct iphdr *iph;
const struct udphdr *uh;
- struct sock *sk;
+ struct sock *sk = NULL;
struct dst_entry *dst;
int dif = skb->dev->ifindex;
int ours;
@@ -2083,11 +1960,9 @@ void udp_v4_early_demux(struct sk_buff *skb)
} else if (skb->pkt_type == PACKET_HOST) {
sk = __udp4_lib_demux_lookup(net, uh->dest, iph->daddr,
uh->source, iph->saddr, dif);
- } else {
- return;
}
- if (!sk)
+ if (!sk || !atomic_inc_not_zero_hint(&sk->sk_refcnt, 2))
return;
skb->sk = sk;
@@ -2387,14 +2262,13 @@ static struct sock *udp_get_first(struct seq_file *seq, int start)
for (state->bucket = start; state->bucket <= state->udp_table->mask;
++state->bucket) {
- struct hlist_nulls_node *node;
struct udp_hslot *hslot = &state->udp_table->hash[state->bucket];
- if (hlist_nulls_empty(&hslot->head))
+ if (hlist_empty(&hslot->head))
continue;
spin_lock_bh(&hslot->lock);
- sk_nulls_for_each(sk, node, &hslot->head) {
+ sk_for_each(sk, &hslot->head) {
if (!net_eq(sock_net(sk), net))
continue;
if (sk->sk_family == state->family)
@@ -2413,7 +2287,7 @@ static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk)
struct net *net = seq_file_net(seq);
do {
- sk = sk_nulls_next(sk);
+ sk = sk_next(sk);
} while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family));
if (!sk) {
@@ -2622,12 +2496,12 @@ void __init udp_table_init(struct udp_table *table, const char *name)
table->hash2 = table->hash + (table->mask + 1);
for (i = 0; i <= table->mask; i++) {
- INIT_HLIST_NULLS_HEAD(&table->hash[i].head, i);
+ INIT_HLIST_HEAD(&table->hash[i].head);
table->hash[i].count = 0;
spin_lock_init(&table->hash[i].lock);
}
for (i = 0; i <= table->mask; i++) {
- INIT_HLIST_NULLS_HEAD(&table->hash2[i].head, i);
+ INIT_HLIST_HEAD(&table->hash2[i].head);
table->hash2[i].count = 0;
spin_lock_init(&table->hash2[i].lock);
}
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index df1966f3b6ec..3d5ccf4b1412 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -36,10 +36,11 @@ static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb,
const struct inet_diag_req_v2 *req)
{
int err = -EINVAL;
- struct sock *sk;
+ struct sock *sk = NULL;
struct sk_buff *rep;
struct net *net = sock_net(in_skb->sk);
+ rcu_read_lock();
if (req->sdiag_family == AF_INET)
sk = __udp4_lib_lookup(net,
req->id.idiag_src[0], req->id.idiag_sport,
@@ -54,9 +55,9 @@ static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb,
req->id.idiag_dport,
req->id.idiag_if, tbl, NULL);
#endif
- else
- goto out_nosk;
-
+ if (sk && !atomic_inc_not_zero(&sk->sk_refcnt))
+ sk = NULL;
+ rcu_read_unlock();
err = -ENOENT;
if (!sk)
goto out_nosk;
@@ -96,24 +97,23 @@ static void udp_dump(struct udp_table *table, struct sk_buff *skb,
struct netlink_callback *cb,
const struct inet_diag_req_v2 *r, struct nlattr *bc)
{
- int num, s_num, slot, s_slot;
struct net *net = sock_net(skb->sk);
+ int num, s_num, slot, s_slot;
s_slot = cb->args[0];
num = s_num = cb->args[1];
for (slot = s_slot; slot <= table->mask; s_num = 0, slot++) {
- struct sock *sk;
- struct hlist_nulls_node *node;
struct udp_hslot *hslot = &table->hash[slot];
+ struct sock *sk;
num = 0;
- if (hlist_nulls_empty(&hslot->head))
+ if (hlist_empty(&hslot->head))
continue;
spin_lock_bh(&hslot->lock);
- sk_nulls_for_each(sk, node, &hslot->head) {
+ sk_for_each(sk, &hslot->head) {
struct inet_sock *inet = inet_sk(sk);
if (!net_eq(sock_net(sk), net))
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index fd25e447a5fa..eca04b25879b 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -213,37 +213,28 @@ static struct sock *udp6_lib_lookup2(struct net *net,
struct sk_buff *skb)
{
struct sock *sk, *result;
- struct hlist_nulls_node *node;
int score, badness, matches = 0, reuseport = 0;
- bool select_ok = true;
u32 hash = 0;
-begin:
result = NULL;
badness = -1;
- udp_portaddr_for_each_entry_rcu(sk, node, &hslot2->head) {
+ udp_portaddr_for_each_entry_rcu(sk, &hslot2->head) {
score = compute_score2(sk, net, saddr, sport,
daddr, hnum, dif);
if (score > badness) {
- result = sk;
- badness = score;
reuseport = sk->sk_reuseport;
if (reuseport) {
hash = udp6_ehashfn(net, daddr, hnum,
saddr, sport);
- if (select_ok) {
- struct sock *sk2;
- sk2 = reuseport_select_sock(sk, hash, skb,
+ result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
- if (sk2) {
- result = sk2;
- select_ok = false;
- goto found;
- }
- }
+ if (result)
+ return result;
matches = 1;
}
+ result = sk;
+ badness = score;
} else if (score == badness && reuseport) {
matches++;
if (reciprocal_scale(hash, matches) == 0)
@@ -251,27 +242,10 @@ begin:
hash = next_pseudo_random32(hash);
}
}
- /*
- * if the nulls value we got at the end of this lookup is
- * not the expected one, we must restart lookup.
- * We probably met an item that was moved to another chain.
- */
- if (get_nulls_value(node) != slot2)
- goto begin;
-
- if (result) {
-found:
- if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2)))
- result = NULL;
- else if (unlikely(compute_score2(result, net, saddr, sport,
- daddr, hnum, dif) < badness)) {
- sock_put(result);
- goto begin;
- }
- }
return result;
}
+/* rcu_read_lock() must be held */
struct sock *__udp6_lib_lookup(struct net *net,
const struct in6_addr *saddr, __be16 sport,
const struct in6_addr *daddr, __be16 dport,
@@ -279,15 +253,12 @@ struct sock *__udp6_lib_lookup(struct net *net,
struct sk_buff *skb)
{
struct sock *sk, *result;
- struct hlist_nulls_node *node;
unsigned short hnum = ntohs(dport);
unsigned int hash2, slot2, slot = udp_hashfn(net, hnum, udptable->mask);
struct udp_hslot *hslot2, *hslot = &udptable->hash[slot];
int score, badness, matches = 0, reuseport = 0;
- bool select_ok = true;
u32 hash = 0;
- rcu_read_lock();
if (hslot->count > 10) {
hash2 = udp6_portaddr_hash(net, daddr, hnum);
slot2 = hash2 & udptable->mask;
@@ -309,34 +280,26 @@ struct sock *__udp6_lib_lookup(struct net *net,
&in6addr_any, hnum, dif,
hslot2, slot2, skb);
}
- rcu_read_unlock();
return result;
}
begin:
result = NULL;
badness = -1;
- sk_nulls_for_each_rcu(sk, node, &hslot->head) {
+ sk_for_each_rcu(sk, &hslot->head) {
score = compute_score(sk, net, hnum, saddr, sport, daddr, dport, dif);
if (score > badness) {
- result = sk;
- badness = score;
reuseport = sk->sk_reuseport;
if (reuseport) {
hash = udp6_ehashfn(net, daddr, hnum,
saddr, sport);
- if (select_ok) {
- struct sock *sk2;
-
- sk2 = reuseport_select_sock(sk, hash, skb,
+ result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
- if (sk2) {
- result = sk2;
- select_ok = false;
- goto found;
- }
- }
+ if (result)
+ return result;
matches = 1;
}
+ result = sk;
+ badness = score;
} else if (score == badness && reuseport) {
matches++;
if (reciprocal_scale(hash, matches) == 0)
@@ -344,25 +307,6 @@ begin:
hash = next_pseudo_random32(hash);
}
}
- /*
- * if the nulls value we got at the end of this lookup is
- * not the expected one, we must restart lookup.
- * We probably met an item that was moved to another chain.
- */
- if (get_nulls_value(node) != slot)
- goto begin;
-
- if (result) {
-found:
- if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2)))
- result = NULL;
- else if (unlikely(compute_score(result, net, hnum, saddr, sport,
- daddr, dport, dif) < badness)) {
- sock_put(result);
- goto begin;
- }
- }
- rcu_read_unlock();
return result;
}
EXPORT_SYMBOL_GPL(__udp6_lib_lookup);
@@ -382,12 +326,24 @@ static struct sock *__udp6_lib_lookup_skb(struct sk_buff *skb,
udptable, skb);
}
+/* Must be called under rcu_read_lock().
+ * Does increment socket refcount.
+ */
+#if IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_SOCKET) || \
+ IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY)
struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport,
const struct in6_addr *daddr, __be16 dport, int dif)
{
- return __udp6_lib_lookup(net, saddr, sport, daddr, dport, dif, &udp_table, NULL);
+ struct sock *sk;
+
+ sk = __udp6_lib_lookup(net, saddr, sport, daddr, dport,
+ dif, &udp_table, NULL);
+ if (sk && !atomic_inc_not_zero(&sk->sk_refcnt))
+ sk = NULL;
+ return sk;
}
EXPORT_SYMBOL_GPL(udp6_lib_lookup);
+#endif
/*
* This should be easy, if there is something there we
@@ -585,7 +541,7 @@ void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
sk->sk_err = err;
sk->sk_error_report(sk);
out:
- sock_put(sk);
+ return;
}
static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
@@ -747,33 +703,6 @@ static bool __udp_v6_is_mcast_sock(struct net *net, struct sock *sk,
return true;
}
-static void flush_stack(struct sock **stack, unsigned int count,
- struct sk_buff *skb, unsigned int final)
-{
- struct sk_buff *skb1 = NULL;
- struct sock *sk;
- unsigned int i;
-
- for (i = 0; i < count; i++) {
- sk = stack[i];
- if (likely(!skb1))
- skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
- if (!skb1) {
- atomic_inc(&sk->sk_drops);
- UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
- IS_UDPLITE(sk));
- UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
- IS_UDPLITE(sk));
- }
-
- if (skb1 && udpv6_queue_rcv_skb(sk, skb1) <= 0)
- skb1 = NULL;
- sock_put(sk);
- }
- if (unlikely(skb1))
- kfree_skb(skb1);
-}
-
static void udp6_csum_zero_error(struct sk_buff *skb)
{
/* RFC 2460 section 8.1 says that we SHOULD log
@@ -792,15 +721,15 @@ static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
const struct in6_addr *saddr, const struct in6_addr *daddr,
struct udp_table *udptable, int proto)
{
- struct sock *sk, *stack[256 / sizeof(struct sock *)];
+ struct sock *sk, *first = NULL;
const struct udphdr *uh = udp_hdr(skb);
- struct hlist_nulls_node *node;
unsigned short hnum = ntohs(uh->dest);
struct udp_hslot *hslot = udp_hashslot(udptable, net, hnum);
- int dif = inet6_iif(skb);
- unsigned int count = 0, offset = offsetof(typeof(*sk), sk_nulls_node);
+ unsigned int offset = offsetof(typeof(*sk), sk_node);
unsigned int hash2 = 0, hash2_any = 0, use_hash2 = (hslot->count > 10);
- bool inner_flushed = false;
+ int dif = inet6_iif(skb);
+ struct hlist_node *node;
+ struct sk_buff *nskb;
if (use_hash2) {
hash2_any = udp6_portaddr_hash(net, &in6addr_any, hnum) &
@@ -811,27 +740,32 @@ start_lookup:
offset = offsetof(typeof(*sk), __sk_common.skc_portaddr_node);
}
- spin_lock(&hslot->lock);
- sk_nulls_for_each_entry_offset(sk, node, &hslot->head, offset) {
- if (__udp_v6_is_mcast_sock(net, sk,
- uh->dest, daddr,
- uh->source, saddr,
- dif, hnum) &&
- /* If zero checksum and no_check is not on for
- * the socket then skip it.
- */
- (uh->check || udp_sk(sk)->no_check6_rx)) {
- if (unlikely(count == ARRAY_SIZE(stack))) {
- flush_stack(stack, count, skb, ~0);
- inner_flushed = true;
- count = 0;
- }
- stack[count++] = sk;
- sock_hold(sk);
+ sk_for_each_entry_offset_rcu(sk, node, &hslot->head, offset) {
+ if (!__udp_v6_is_mcast_sock(net, sk, uh->dest, daddr,
+ uh->source, saddr, dif, hnum))
+ continue;
+ /* If zero checksum and no_check is not on for
+ * the socket then skip it.
+ */
+ if (!uh->check && !udp_sk(sk)->no_check6_rx)
+ continue;
+ if (!first) {
+ first = sk;
+ continue;
+ }
+ nskb = skb_clone(skb, GFP_ATOMIC);
+ if (unlikely(!nskb)) {
+ atomic_inc(&sk->sk_drops);
+ UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
+ IS_UDPLITE(sk));
+ UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
+ IS_UDPLITE(sk));
+ continue;
}
- }
- spin_unlock(&hslot->lock);
+ if (udpv6_queue_rcv_skb(sk, nskb) > 0)
+ kfree_skb(nskb);
+ }
/* Also lookup *:port if we are using hash2 and haven't done so yet. */
if (use_hash2 && hash2 != hash2_any) {
@@ -839,24 +773,18 @@ start_lookup:
goto start_lookup;
}
- if (count) {
- flush_stack(stack, count, skb, count - 1);
- } else {
- if (!inner_flushed)
- UDP_INC_STATS_BH(net, UDP_MIB_IGNOREDMULTI,
- proto == IPPROTO_UDPLITE);
- consume_skb(skb);
- }
+ if (!first || udpv6_queue_rcv_skb(first, skb) > 0)
+ kfree_skb(skb);
return 0;
}
int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
int proto)
{
+ const struct in6_addr *saddr, *daddr;
struct net *net = dev_net(skb->dev);
- struct sock *sk;
struct udphdr *uh;
- const struct in6_addr *saddr, *daddr;
+ struct sock *sk;
u32 ulen = 0;
if (!pskb_may_pull(skb, sizeof(struct udphdr)))
@@ -910,7 +838,6 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
int ret;
if (!uh->check && !udp_sk(sk)->no_check6_rx) {
- sock_put(sk);
udp6_csum_zero_error(skb);
goto csum_error;
}
@@ -920,7 +847,6 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
ip6_compute_pseudo);
ret = udpv6_queue_rcv_skb(sk, skb);
- sock_put(sk);
/* a return value > 0 means to resubmit the input */
if (ret > 0)
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [RFC net-next 1/2] net: add SOCK_RCU_FREE socket flag
From: Eric Dumazet @ 2016-03-25 22:29 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Tom Herbert
In-Reply-To: <1458944964-12890-1-git-send-email-edumazet@google.com>
We want a generic way to insert an RCU grace period before socket
freeing for cases where RCU_SLAB_DESTROY_BY_RCU is adding too
much overhead.
SLAB_DESTROY_BY_RCU strict rules force us to take a reference
on the socket sk_refcnt, and it is a performance problem for UDP
encapsulation, or TCP synflood behavior, as many CPUs might
attempt the atomic operations on a shared sk_refcnt
UDP sockets and TCP listeners can set SOCK_RCU_FREE so that their
lookup can use traditional RCU rules, without refcount changes.
They can set the flag only once hashed and visible by other cpus.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <tom@herbertland.com>
---
include/net/sock.h | 2 ++
net/core/sock.c | 14 +++++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 255d3e03727b..c88785a3e76c 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -438,6 +438,7 @@ struct sock {
struct sk_buff *skb);
void (*sk_destruct)(struct sock *sk);
struct sock_reuseport __rcu *sk_reuseport_cb;
+ struct rcu_head sk_rcu;
};
#define __sk_user_data(sk) ((*((void __rcu **)&(sk)->sk_user_data)))
@@ -720,6 +721,7 @@ enum sock_flags {
*/
SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */
SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */
+ SOCK_RCU_FREE, /* wait rcu grace period in sk_destruct() */
};
#define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE))
diff --git a/net/core/sock.c b/net/core/sock.c
index b67b9aedb230..238a94f879ca 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1418,8 +1418,12 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
}
EXPORT_SYMBOL(sk_alloc);
-void sk_destruct(struct sock *sk)
+/* Sockets having SOCK_RCU_FREE will call this function after one RCU
+ * grace period. This is the case for UDP sockets and TCP listeners.
+ */
+static void __sk_destruct(struct rcu_head *head)
{
+ struct sock *sk = container_of(head, struct sock, sk_rcu);
struct sk_filter *filter;
if (sk->sk_destruct)
@@ -1448,6 +1452,14 @@ void sk_destruct(struct sock *sk)
sk_prot_free(sk->sk_prot_creator, sk);
}
+void sk_destruct(struct sock *sk)
+{
+ if (sock_flag(sk, SOCK_RCU_FREE))
+ call_rcu(&sk->sk_rcu, __sk_destruct);
+ else
+ __sk_destruct(&sk->sk_rcu);
+}
+
static void __sk_free(struct sock *sk)
{
if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt))
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [RFC net-next 0/2] udp: use standard RCU rules
From: Eric Dumazet @ 2016-03-25 22:29 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Tom Herbert
Add a generic facility for sockets to be freed afer an RCU grace period.
Then UDP is changed to no longer use SLAB_DESTROY_BY_RCU,
in order to speedup rx processing for traffic encapsulated in UDP.
I prepared a patch to convert TCP listeners to this infrastructure,
but will post it later, since Tom was mostly interested in UDP.
Eric Dumazet (2):
net: add SOCK_RCU_FREE socket flag
udp: No longer use SLAB_DESTROY_BY_RCU
include/linux/udp.h | 8 +-
include/net/sock.h | 14 +--
include/net/udp.h | 2 +-
net/core/sock.c | 14 ++-
net/ipv4/udp.c | 290 +++++++++++++++-------------------------------------
net/ipv4/udp_diag.c | 18 ++--
net/ipv6/udp.c | 194 +++++++++++------------------------
7 files changed, 177 insertions(+), 363 deletions(-)
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply
* Re: [net-next RFC 0/4] SO_BINDTOSUBNET
From: Gilberto @ 2016-03-25 22:29 UTC (permalink / raw)
To: Tom Herbert; +Cc: Linux Kernel Network Developers
In-Reply-To: <CALx6S35+Lv85SQvqMOe4anj6z=qXB+5dUjhEw1x=jQRQGLjD2w@mail.gmail.com>
On 03/25/2016 12:25 AM, Tom Herbert wrote:
> On Wed, Mar 16, 2016 at 6:19 AM, Gilberto Bertin
> <gilberto.bertin@gmail.com> wrote:
>> This is my second attempt to submit an RFC for this patch.
>>
>> Some arguments for and against it since the first submission:
>> * SO_BINDTOSUBNET is an arbitrary option and can be seens as nother use
>> * case of the SO_REUSEPORT BPF patch
>> * but at the same time using BPF requires more work/code on the server
>> and since the bind to subnet use case could potentially become a
>> common one maybe there is some value in having it as an option instead
>> of having to code (either manually or with clang) an eBPF program that
>> would do the same
>
> Gilberto, I'm not sure I understand this argument. Have you
> implemented the BPF bind solution?
>
> Thanks,
> Tom
Yes, I wrote up a very basic draft for this feature (I didn't know there
was already some work going on with SO_ATTACH_REUSEPORT_[CE]BPF).
Thanks,
Gilberto
^ permalink raw reply
* Re: veth regression with "don’t modify ip_summed; doing so treats packets with bad checksums as good."
From: Cong Wang @ 2016-03-25 22:23 UTC (permalink / raw)
To: Vijay Pandurangan; +Cc: Ben Greear, netdev, Evan Jones, Cong Wang
In-Reply-To: <CAKUBDd844=BTpK2B2izzRGqwKQV5RtsFAO9nFQ5CJqDENLFW5A@mail.gmail.com>
On Fri, Mar 25, 2016 at 2:59 PM, Vijay Pandurangan <vijayp@vijayp.ca> wrote:
> consider two scenarios, where process a sends raw ethernet frames
> containing UDP packets to b
>
> I) process a --> veth --> process b
>
> II) process a -> eth -> wire -> eth -> process b
>
> I believe (I) is the simplest setup we can create that will replicate this bug.
>
> If process a sends frames that contain UDP packets to process b, what
> is the behaviour we want if the UDP packet *has an incorrect
> checksum*?
>
> It seems to me that I and II should have identical behaviour, and I
> would think that (II) would not deliver the packets to the
> application.
>
> In (I) with Cong's patch would we be delivering corrupt UDP packets to
> process b despite an incorrect checksum in (I)?
>
Right, I thought packet socket does the checksum by itself, so the
problem is: if user-space does the checksum like packet socket, its
checksum could be wrong therefore we can not trust it on RX path
once it loops back.
Let me think about it again.
^ permalink raw reply
* Re: veth regression with "don’t modify ip_summed; doing so treats packets with bad checksums as good."
From: Ben Greear @ 2016-03-25 22:23 UTC (permalink / raw)
To: Vijay Pandurangan; +Cc: Cong Wang, netdev, Evan Jones, Cong Wang
In-Reply-To: <CAKUBDd844=BTpK2B2izzRGqwKQV5RtsFAO9nFQ5CJqDENLFW5A@mail.gmail.com>
On 03/25/2016 02:59 PM, Vijay Pandurangan wrote:
> consider two scenarios, where process a sends raw ethernet frames
> containing UDP packets to b
>
> I) process a --> veth --> process b
>
> II) process a -> eth -> wire -> eth -> process b
>
> I believe (I) is the simplest setup we can create that will replicate this bug.
>
> If process a sends frames that contain UDP packets to process b, what
> is the behaviour we want if the UDP packet *has an incorrect
> checksum*?
>
> It seems to me that I and II should have identical behaviour, and I
> would think that (II) would not deliver the packets to the
> application.
>
> In (I) with Cong's patch would we be delivering corrupt UDP packets to
> process b despite an incorrect checksum in (I)?
>
> If so, I would argue that this patch isn't right.
Checksums are normally used to deal with flaky transport mechanisms,
and once a machine receives the frame, we do not keep re-calculating checksums
as we move it through various drivers and subsystems.
In particular, checksums are NOT a security mechanism and can be easily faked.
Since packets sent on one veth never actually hit any unreliable transport
before they are received on the peer veth, then there should be no need to
checksum packets whose origin is known to be on the local machine.
Any frame sent from a socket can be considered to be a local packet in my
opinion.
That is what Cong's patch does as far as I can tell.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: veth regression with "don’t modify ip_summed; doing so treats packets with bad checksums as good."
From: Cong Wang @ 2016-03-25 22:16 UTC (permalink / raw)
To: Ben Greear; +Cc: Vijay Pandurangan, netdev, Evan Jones, Cong Wang
In-Reply-To: <56F5A618.9070206@candelatech.com>
On Fri, Mar 25, 2016 at 1:56 PM, Ben Greear <greearb@candelatech.com> wrote:
> On 03/24/2016 10:33 PM, Cong Wang wrote:
>
>> Here we go:
>>
>> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
>> index 1ecfa71..ab66080 100644
>> --- a/net/packet/af_packet.c
>> +++ b/net/packet/af_packet.c
>> @@ -1925,6 +1925,7 @@ static int packet_sendmsg_spkt(struct socket
>> *sock, struct msghdr *msg,
>> goto out_unlock;
>> }
>>
>> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>> skb->protocol = proto;
>> skb->dev = dev;
>> skb->priority = sk->sk_priority;
>> @@ -2496,6 +2497,7 @@ static int tpacket_fill_skb(struct packet_sock
>> *po, struct sk_buff *skb,
>>
>> ph.raw = frame;
>>
>> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>> skb->protocol = proto;
>> skb->dev = dev;
>> skb->priority = po->sk.sk_priority;
>> @@ -2805,6 +2807,7 @@ static struct sk_buff *packet_alloc_skb(struct
>> sock *sk, size_t prepad,
>> skb_put(skb, linear);
>> skb->data_len = len - linear;
>> skb->len += len - linear;
>> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>>
>> return skb;
>> }
>
>
> I have tested UDP, TCP, TCPv6 and custom Ethernet frames across a veth pair.
>
> And, UDP, TCP, and pktgen across a pair of veth pairs
> bridged by my user-space packet filter.
>
> All of these tests work fine with your patch as far as I can tell.
>
> So, you can add:
>
> Tested-by: Ben Greear <greearb@candelatech.com>
Thanks for testing! I will send it out formally after I audit more drivers,
also let's give Tom some time to response.
>
> That said, it could easily break some drivers and/or other scenarios that I
> have not tested, so at the least it should cook a while upstream before
> going into the
> stable tree....
Yeah.
Thanks.
^ permalink raw reply
* [PATCH net] inet: add proper locking in __inet{6}_lookup()
From: Eric Dumazet @ 2016-03-25 22:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Lorenzo Colitti
From: Eric Dumazet <edumazet@google.com>
Blocking BH in __inet{6}_lookup() is not correct, as the lookups
are done using RCU protection.
It matters only starting from Lorenzo Colitti patches to destroy
a TCP socket, since rcu_read_lock() is already held by other users
of these functions.
This can be backported to all known stable versions, since TCP got RCU
lookups back in 2.6.29 : Even if iproute2 contained no code to trigger
the bug, some user programs could have used the API.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
---
include/net/inet_hashtables.h | 5 ++---
net/ipv6/inet6_hashtables.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 50f635c2c536..4575d4f9509a 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -284,7 +284,6 @@ static inline struct sock *inet_lookup_listener(struct net *net,
* Sockets in TCP_CLOSE state are _always_ taken out of the hash, so we need
* not check it for lookups anymore, thanks Alexey. -DaveM
*
- * Local BH must be disabled here.
*/
struct sock *__inet_lookup_established(struct net *net,
struct inet_hashinfo *hashinfo,
@@ -326,10 +325,10 @@ static inline struct sock *inet_lookup(struct net *net,
{
struct sock *sk;
- local_bh_disable();
+ rcu_read_lock();
sk = __inet_lookup(net, hashinfo, skb, doff, saddr, sport, daddr,
dport, dif);
- local_bh_enable();
+ rcu_read_unlock();
return sk;
}
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 70f2628be6fa..9dcd0481fae2 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -200,11 +200,10 @@ struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo,
{
struct sock *sk;
- local_bh_disable();
+ rcu_read_lock();
sk = __inet6_lookup(net, hashinfo, skb, doff, saddr, sport, daddr,
ntohs(dport), dif);
- local_bh_enable();
-
+ rcu_read_unlock();
return sk;
}
EXPORT_SYMBOL_GPL(inet6_lookup);
^ permalink raw reply related
* Re: RESEND: Easily reproducible kernel panic due to netdev all_adj_list refcnt handling
From: Andrew Collins @ 2016-03-25 22:10 UTC (permalink / raw)
To: Matthias Schiffer; +Cc: netdev
In-Reply-To: <56F5A2D9.7090700@universe-factory.net>
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
On 03/25/2016 02:43 PM, Matthias Schiffer wrote:
> We've tried your patch, and it changes the symptoms a bit, but doesn't fix
> the panic. I've attached kernel logs of the crash both before and after
> applying the patch.
>
> One note: I did not reproduce this issue myself, it was first reported in
> [1], and then forwarded to the batman-adv issue tracker [2] by me.
>
> Regards,
> Matthias
>
>
> [1] https://github.com/freifunk-gluon/gluon/issues/680
> [2] https://www.open-mesh.org/issues/247
On the off chance it helps, the version of the patch I integrated locally takes a somewhat different approach
than the one I sent to the mailing list (propagates adj_list refcnts). I've attached it in case it's useful.
I haven't submitted this upstream yet as it's still rather ugly. I'm of the opinion that the whole "every device
knows every upperdev and lowerdev in its tree" model is rather broken, and the patch is just working around
a design that needs some rework.
Thanks,
Andrew Collins
[-- Attachment #2: netdev_ref_cnt.patch --]
[-- Type: text/x-patch, Size: 8962 bytes --]
commit df318544e282c6ab5bdc4595658fc1cf8739d091
Author: Andrew Collins <acollins@cradlepoint.com>
Date: Fri Mar 25 16:04:59 2016 -0600
This fixes a relatively easily reproducible kernel panic related to the
all_adj_list handling for netdevs in recent kernels.
The following sequence of commands will reproduce the issue:
ip link add link eth0 name eth0.100 type vlan id 100
ip link add link eth0 name eth0.200 type vlan id 200
ip link add name testbr type bridge
ip link set eth0.100 master testbr
ip link set eth0.200 master testbr
ip link add link testbr mac0 type macvlan
ip link delete dev testbr
This creates an upper/lower tree of (excuse the poor ASCII art):
/---eth0.100-eth0
mac0-testbr-
\---eth0.200-eth0
When testbr is deleted, the all_adj_lists are walked, and eth0 is deleted twice from
the mac0 list. Unfortunately, during setup in __netdev_upper_dev_link, only one
reference to eth0 is added, so this results in a panic.
This change adds reference count propagation so things are handled properly.
diff --git a/net/core/dev.c b/net/core/dev.c
index b9bcbe7..4b4ef6b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5471,6 +5471,7 @@ static inline bool netdev_adjacent_is_neigh_list(struct net_device *dev,
static int __netdev_adjacent_dev_insert(struct net_device *dev,
struct net_device *adj_dev,
+ u16 ref_nr,
struct list_head *dev_list,
void *private, bool master)
{
@@ -5480,7 +5481,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
adj = __netdev_find_adj(adj_dev, dev_list);
if (adj) {
- adj->ref_nr++;
+ adj->ref_nr += ref_nr;
return 0;
}
@@ -5490,7 +5491,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
adj->dev = adj_dev;
adj->master = master;
- adj->ref_nr = 1;
+ adj->ref_nr = ref_nr;
adj->private = private;
dev_hold(adj_dev);
@@ -5529,6 +5530,7 @@ free_adj:
static void __netdev_adjacent_dev_remove(struct net_device *dev,
struct net_device *adj_dev,
+ u16 ref_nr,
struct list_head *dev_list)
{
struct netdev_adjacent *adj;
@@ -5541,10 +5543,10 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev,
BUG();
}
- if (adj->ref_nr > 1) {
- pr_debug("%s to %s ref_nr-- = %d\n", dev->name, adj_dev->name,
- adj->ref_nr-1);
- adj->ref_nr--;
+ if (adj->ref_nr > ref_nr) {
+ pr_debug("%s to %s ref_nr-%d = %d\n", dev->name, adj_dev->name,
+ ref_nr, adj->ref_nr-ref_nr);
+ adj->ref_nr -= ref_nr;
return;
}
@@ -5563,21 +5565,22 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev,
static int __netdev_adjacent_dev_link_lists(struct net_device *dev,
struct net_device *upper_dev,
+ u16 ref_nr,
struct list_head *up_list,
struct list_head *down_list,
void *private, bool master)
{
int ret;
- ret = __netdev_adjacent_dev_insert(dev, upper_dev, up_list, private,
- master);
+ ret = __netdev_adjacent_dev_insert(dev, upper_dev, ref_nr, up_list,
+ private, master);
if (ret)
return ret;
- ret = __netdev_adjacent_dev_insert(upper_dev, dev, down_list, private,
- false);
+ ret = __netdev_adjacent_dev_insert(upper_dev, dev, ref_nr, down_list,
+ private, false);
if (ret) {
- __netdev_adjacent_dev_remove(dev, upper_dev, up_list);
+ __netdev_adjacent_dev_remove(dev, upper_dev, ref_nr, up_list);
return ret;
}
@@ -5585,9 +5588,10 @@ static int __netdev_adjacent_dev_link_lists(struct net_device *dev,
}
static int __netdev_adjacent_dev_link(struct net_device *dev,
- struct net_device *upper_dev)
+ struct net_device *upper_dev,
+ u16 ref_nr)
{
- return __netdev_adjacent_dev_link_lists(dev, upper_dev,
+ return __netdev_adjacent_dev_link_lists(dev, upper_dev, ref_nr,
&dev->all_adj_list.upper,
&upper_dev->all_adj_list.lower,
NULL, false);
@@ -5595,17 +5599,19 @@ static int __netdev_adjacent_dev_link(struct net_device *dev,
static void __netdev_adjacent_dev_unlink_lists(struct net_device *dev,
struct net_device *upper_dev,
+ u16 ref_nr,
struct list_head *up_list,
struct list_head *down_list)
{
- __netdev_adjacent_dev_remove(dev, upper_dev, up_list);
- __netdev_adjacent_dev_remove(upper_dev, dev, down_list);
+ __netdev_adjacent_dev_remove(dev, upper_dev, ref_nr, up_list);
+ __netdev_adjacent_dev_remove(upper_dev, dev, ref_nr, down_list);
}
static void __netdev_adjacent_dev_unlink(struct net_device *dev,
- struct net_device *upper_dev)
+ struct net_device *upper_dev,
+ u16 ref_nr)
{
- __netdev_adjacent_dev_unlink_lists(dev, upper_dev,
+ __netdev_adjacent_dev_unlink_lists(dev, upper_dev, ref_nr,
&dev->all_adj_list.upper,
&upper_dev->all_adj_list.lower);
}
@@ -5614,17 +5620,17 @@ static int __netdev_adjacent_dev_link_neighbour(struct net_device *dev,
struct net_device *upper_dev,
void *private, bool master)
{
- int ret = __netdev_adjacent_dev_link(dev, upper_dev);
+ int ret = __netdev_adjacent_dev_link(dev, upper_dev, 1);
if (ret)
return ret;
- ret = __netdev_adjacent_dev_link_lists(dev, upper_dev,
+ ret = __netdev_adjacent_dev_link_lists(dev, upper_dev, 1,
&dev->adj_list.upper,
&upper_dev->adj_list.lower,
private, master);
if (ret) {
- __netdev_adjacent_dev_unlink(dev, upper_dev);
+ __netdev_adjacent_dev_unlink(dev, upper_dev, 1);
return ret;
}
@@ -5634,8 +5640,8 @@ static int __netdev_adjacent_dev_link_neighbour(struct net_device *dev,
static void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev,
struct net_device *upper_dev)
{
- __netdev_adjacent_dev_unlink(dev, upper_dev);
- __netdev_adjacent_dev_unlink_lists(dev, upper_dev,
+ __netdev_adjacent_dev_unlink(dev, upper_dev, 1);
+ __netdev_adjacent_dev_unlink_lists(dev, upper_dev, 1,
&dev->adj_list.upper,
&upper_dev->adj_list.lower);
}
@@ -5688,7 +5694,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
list_for_each_entry(j, &upper_dev->all_adj_list.upper, list) {
pr_debug("Interlinking %s with %s, non-neighbour\n",
i->dev->name, j->dev->name);
- ret = __netdev_adjacent_dev_link(i->dev, j->dev);
+ ret = __netdev_adjacent_dev_link(i->dev, j->dev, i->ref_nr);
if (ret)
goto rollback_mesh;
}
@@ -5698,7 +5704,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) {
pr_debug("linking %s's upper device %s with %s\n",
upper_dev->name, i->dev->name, dev->name);
- ret = __netdev_adjacent_dev_link(dev, i->dev);
+ ret = __netdev_adjacent_dev_link(dev, i->dev, i->ref_nr);
if (ret)
goto rollback_upper_mesh;
}
@@ -5707,7 +5713,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
list_for_each_entry(i, &dev->all_adj_list.lower, list) {
pr_debug("linking %s's lower device %s with %s\n", dev->name,
i->dev->name, upper_dev->name);
- ret = __netdev_adjacent_dev_link(i->dev, upper_dev);
+ ret = __netdev_adjacent_dev_link(i->dev, upper_dev, i->ref_nr);
if (ret)
goto rollback_lower_mesh;
}
@@ -5725,7 +5731,7 @@ rollback_lower_mesh:
list_for_each_entry(i, &dev->all_adj_list.lower, list) {
if (i == to_i)
break;
- __netdev_adjacent_dev_unlink(i->dev, upper_dev);
+ __netdev_adjacent_dev_unlink(i->dev, upper_dev, i->ref_nr);
}
i = NULL;
@@ -5735,7 +5741,7 @@ rollback_upper_mesh:
list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) {
if (i == to_i)
break;
- __netdev_adjacent_dev_unlink(dev, i->dev);
+ __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
}
i = j = NULL;
@@ -5747,7 +5753,7 @@ rollback_mesh:
list_for_each_entry(j, &upper_dev->all_adj_list.upper, list) {
if (i == to_i && j == to_j)
break;
- __netdev_adjacent_dev_unlink(i->dev, j->dev);
+ __netdev_adjacent_dev_unlink(i->dev, j->dev, i->ref_nr);
}
if (i == to_i)
break;
@@ -5827,16 +5833,16 @@ void netdev_upper_dev_unlink(struct net_device *dev,
*/
list_for_each_entry(i, &dev->all_adj_list.lower, list)
list_for_each_entry(j, &upper_dev->all_adj_list.upper, list)
- __netdev_adjacent_dev_unlink(i->dev, j->dev);
+ __netdev_adjacent_dev_unlink(i->dev, j->dev, i->ref_nr);
/* remove also the devices itself from lower/upper device
* list
*/
list_for_each_entry(i, &dev->all_adj_list.lower, list)
- __netdev_adjacent_dev_unlink(i->dev, upper_dev);
+ __netdev_adjacent_dev_unlink(i->dev, upper_dev, i->ref_nr);
list_for_each_entry(i, &upper_dev->all_adj_list.upper, list)
- __netdev_adjacent_dev_unlink(dev, i->dev);
+ __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
&changeupper_info.info);
^ permalink raw reply related
* [PATCH-RFC] drivers: net: ethernet: intel: e1000e: fix ethtool autoneg off for fiber
From: Daniel Walker @ 2016-03-25 21:58 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Shannon Nelson, Carolyn Wyborny,
Don Skidmore, Bruce Allan, John Ronciak, Mitch Williams
Cc: Steve Shih, danielwa, xe-kernel, intel-wired-lan, netdev,
linux-kernel
From: Steve Shih <sshih@cisco.com>
This patch fixes the issues for disabling auto-negotiation and forcing
speed and duplex settings for the fiber media.
For fiber media, e1000_get_settings should return ETH_TP_MDI_INVALID for
eth_tp_mdix_ctrl instead of ETH_TP_MDI_AUTO so subsequent e1000_set_settings
call would not fail with -EOPNOTSUPP.
e1000_set_spd_dplx should not automatically turn autoneg back on for forced
1000 Mbps full duplex settings.
Cc: danielwa@fifo99.com
Cc: xe-kernel@external.cisco.com
Signed-off-by: Steve Shih <sshih@cisco.com>
---
drivers/net/ethernet/intel/e1000e/ethtool.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index 6cab1f3..cd03dcd 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -201,6 +201,9 @@ static int e1000_get_settings(struct net_device *netdev,
else
ecmd->eth_tp_mdix_ctrl = hw->phy.mdix;
+ if (hw->phy.media_type != e1000_media_type_copper)
+ ecmd->eth_tp_mdix_ctrl = ETH_TP_MDI_INVALID;
+
return 0;
}
@@ -236,8 +239,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx)
mac->forced_speed_duplex = ADVERTISE_100_FULL;
break;
case SPEED_1000 + DUPLEX_FULL:
- mac->autoneg = 1;
- adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
+ mac->forced_speed_duplex = ADVERTISE_1000_FULL;
break;
case SPEED_1000 + DUPLEX_HALF: /* not supported */
default:
--
2.5.0
^ permalink raw reply related
* Re: veth regression with "don’t modify ip_summed; doing so treats packets with bad checksums as good."
From: Vijay Pandurangan @ 2016-03-25 21:59 UTC (permalink / raw)
To: Ben Greear; +Cc: Cong Wang, netdev, Evan Jones, Cong Wang
In-Reply-To: <56F5A618.9070206@candelatech.com>
consider two scenarios, where process a sends raw ethernet frames
containing UDP packets to b
I) process a --> veth --> process b
II) process a -> eth -> wire -> eth -> process b
I believe (I) is the simplest setup we can create that will replicate this bug.
If process a sends frames that contain UDP packets to process b, what
is the behaviour we want if the UDP packet *has an incorrect
checksum*?
It seems to me that I and II should have identical behaviour, and I
would think that (II) would not deliver the packets to the
application.
In (I) with Cong's patch would we be delivering corrupt UDP packets to
process b despite an incorrect checksum in (I)?
If so, I would argue that this patch isn't right.
On Fri, Mar 25, 2016 at 4:56 PM, Ben Greear <greearb@candelatech.com> wrote:
> On 03/24/2016 10:33 PM, Cong Wang wrote:
>
>> Here we go:
>>
>> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
>> index 1ecfa71..ab66080 100644
>> --- a/net/packet/af_packet.c
>> +++ b/net/packet/af_packet.c
>> @@ -1925,6 +1925,7 @@ static int packet_sendmsg_spkt(struct socket
>> *sock, struct msghdr *msg,
>> goto out_unlock;
>> }
>>
>> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>> skb->protocol = proto;
>> skb->dev = dev;
>> skb->priority = sk->sk_priority;
>> @@ -2496,6 +2497,7 @@ static int tpacket_fill_skb(struct packet_sock
>> *po, struct sk_buff *skb,
>>
>> ph.raw = frame;
>>
>> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>> skb->protocol = proto;
>> skb->dev = dev;
>> skb->priority = po->sk.sk_priority;
>> @@ -2805,6 +2807,7 @@ static struct sk_buff *packet_alloc_skb(struct
>> sock *sk, size_t prepad,
>> skb_put(skb, linear);
>> skb->data_len = len - linear;
>> skb->len += len - linear;
>> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>>
>> return skb;
>> }
>
>
> I have tested UDP, TCP, TCPv6 and custom Ethernet frames across a veth pair.
>
> And, UDP, TCP, and pktgen across a pair of veth pairs
> bridged by my user-space packet filter.
>
> All of these tests work fine with your patch as far as I can tell.
>
> So, you can add:
>
> Tested-by: Ben Greear <greearb@candelatech.com>
>
> That said, it could easily break some drivers and/or other scenarios that I
> have not tested, so at the least it should cook a while upstream before
> going into the
> stable tree....
>
>
> Thanks,
> Ben
>
> --
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc http://www.candelatech.com
>
^ permalink raw reply
* Re: veth regression with "don’t modify ip_summed; doing so treats packets with bad checksums as good."
From: Vijay Pandurangan @ 2016-03-25 21:51 UTC (permalink / raw)
To: Ben Greear; +Cc: Cong Wang, netdev, Evan Jones, Cong Wang
In-Reply-To: <56F54CB7.9010300@candelatech.com>
On Fri, Mar 25, 2016 at 10:35 AM, Ben Greear <greearb@candelatech.com> wrote:
>
>
> On 03/24/2016 10:24 PM, Vijay Pandurangan wrote:
>>
>> On Fri, Mar 25, 2016 at 1:07 AM, Ben Greear <greearb@candelatech.com>
>> wrote:
>>>
>>> On 03/24/2016 09:45 PM, Vijay Pandurangan wrote:
>>>>
>>>>
>>>> Actually, maybe they should be set to CHECKSUM_PARTIAL if we want veth
>>>> to drop the packets if they have bad checksums before they hit the
>>>> application level.
>>>
>>>
>>>
>>> VETH is pretty special in that when you transmit a frame on one
>>> device, it's pair receives it, and unless there is RAM corruption
>>> or bugs in the kernel, then it cannot be corrupted.
>>
>>
>> Yeah, you're right that that's an optimization. However, I think that
>> we should first ensure that
>>
>> a->veth->b
>>
>> operates exactly like:
>>
>> a->physical eth 1 -> physical eth 2->b
>>
>> in all cases. Once we have that working everywhere we could think
>> about optimizations.
>>
>>
>> If we're willing to refactor, we could implement the optimization by
>> allowing veth devices to know whether their immediate peer is. If a
>> veth knows it's talking to another veth, it could under some
>> circumstances elide checksum calculation and verification. I'm not
>> sure what abstractions that would break, though. What do you guys
>> think?
>
>
> veth ALWAYS transmits to another VETH. The problem is that when veth is
> given a packet to transmit, it is difficult to know where that packet
> came from.
Yeah you're totally right – I guess what I was trying to express (but
failed at) was that we might need to be able to track the original
source of the packet for optimizations.
>
> And, adding software checksumming to veth for every frame would be a huge
> performance hit.
>
>
> Thanks,
> Ben
>
> --
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: veth regression with "don’t modify ip_summed; doing so treats packets with bad checksums as good."
From: Ben Greear @ 2016-03-25 20:56 UTC (permalink / raw)
To: Cong Wang; +Cc: Vijay Pandurangan, netdev, Evan Jones, Cong Wang
In-Reply-To: <CAM_iQpWwch3+6u+X0DBGyVSWttd7Nz2COdmq2q=G9BxisW52bA@mail.gmail.com>
On 03/24/2016 10:33 PM, Cong Wang wrote:
> Here we go:
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index 1ecfa71..ab66080 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -1925,6 +1925,7 @@ static int packet_sendmsg_spkt(struct socket
> *sock, struct msghdr *msg,
> goto out_unlock;
> }
>
> + skb->ip_summed = CHECKSUM_UNNECESSARY;
> skb->protocol = proto;
> skb->dev = dev;
> skb->priority = sk->sk_priority;
> @@ -2496,6 +2497,7 @@ static int tpacket_fill_skb(struct packet_sock
> *po, struct sk_buff *skb,
>
> ph.raw = frame;
>
> + skb->ip_summed = CHECKSUM_UNNECESSARY;
> skb->protocol = proto;
> skb->dev = dev;
> skb->priority = po->sk.sk_priority;
> @@ -2805,6 +2807,7 @@ static struct sk_buff *packet_alloc_skb(struct
> sock *sk, size_t prepad,
> skb_put(skb, linear);
> skb->data_len = len - linear;
> skb->len += len - linear;
> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>
> return skb;
> }
I have tested UDP, TCP, TCPv6 and custom Ethernet frames across a veth pair.
And, UDP, TCP, and pktgen across a pair of veth pairs
bridged by my user-space packet filter.
All of these tests work fine with your patch as far as I can tell.
So, you can add:
Tested-by: Ben Greear <greearb@candelatech.com>
That said, it could easily break some drivers and/or other scenarios that I
have not tested, so at the least it should cook a while upstream before going into the
stable tree....
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: RESEND: Easily reproducible kernel panic due to netdev all_adj_list refcnt handling
From: Matthias Schiffer @ 2016-03-25 20:43 UTC (permalink / raw)
To: Andrew Collins; +Cc: netdev, vfalico
In-Reply-To: <56CCDD4D.4080303@cradlepoint.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 2164 bytes --]
On 02/23/2016 11:29 PM, Andrew Collins wrote:
> I'm running into a relatively easily reproducible kernel panic related to
> the all_adj_list handling for netdevs
> in recent kernels.
>
> The following sequence of commands will reproduce the issue:
>
> ip link add link eth0 name eth0.100 type vlan id 100
> ip link add link eth0 name eth0.200 type vlan id 200
> ip link add name testbr type bridge
> ip link set eth0.100 master testbr
> ip link set eth0.200 master testbr
> ip link add link testbr mac0 type macvlan
> ip link delete dev testbr
>
> This creates an upper/lower tree of (excuse the poor ASCII art):
>
> /---eth0.100-eth0
> mac0-testbr-
> \---eth0.200-eth0
>
> When testbr is deleted, the all_adj_lists are walked, and eth0 is deleted
> twice from the mac0 list.
> Unfortunately, during setup in __netdev_upper_dev_link, only one reference
> to eth0 is added,
> so this results in the following panic trace:
>
> [68235.234564] tried to remove device eth0 from mac0
Hi,
I got a similar report which looks like the same issue. Our setup is a bit
more complicated, it also involves batman-adv:
* 5 VLANs (eth0.2, eth0.3, eth0.100, eth0.101, eth0.102)
* batman-adv device bat0 is master of eth0.100, eth0.101, eth0.102
* Bridge br-wan is master of eth0.2
* Bridge br-client is master of bat0 and eth0.3
* macvlan device local-node on top of br-client
The setup is OpenWrt-based, which has a network config daemon which will in
some cases remove bridge ports/slaves when the corresponding devices lose
carrier (and I think br-client and bat0 get deleted in this case, not
completely sure about this). The crash occurs when eth0 goes down.
We've tried your patch, and it changes the symptoms a bit, but doesn't fix
the panic. I've attached kernel logs of the crash both before and after
applying the patch.
One note: I did not reproduce this issue myself, it was first reported in
[1], and then forwarded to the batman-adv issue tracker [2] by me.
Regards,
Matthias
[1] https://github.com/freifunk-gluon/gluon/issues/680
[2] https://www.open-mesh.org/issues/247
[-- Attachment #1.1.2: dmesg-after.txt --]
[-- Type: text/plain, Size: 47588 bytes --]
U-Boot SPL 2015.01 (Mar 18 2016 - 19:30:08)
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
U-Boot 2015.01 (Mar 18 2016 - 19:30:08) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
I2C: ready
DRAM: 1016 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
Reserved 8192kB of RAM for Framebuffer.
In: serial
Out: serial
Err: serial
SCSI: SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net: dwmac.1c50000
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
USB1: USB EHCI 1.00
scanning bus 1 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0...
Found U-Boot script /boot.scr
reading /boot.scr
377 bytes read in 18 ms (19.5 KiB/s)
## Executing script at 43100000
reading uImage
1981560 bytes read in 117 ms (16.2 MiB/s)
reading dtb
23549 bytes read in 30 ms (765.6 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
Image Name: ARM OpenWrt Linux-3.18.27
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1981496 Bytes = 1.9 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
Loading Kernel Image ... OK
Using Device Tree in place at 43000000, end 43008bfc
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.18.27 (julian@eclipse) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r48900) ) #1 SMP PREEMPT Fri Mar 18 19:27:10 CET 2016
[ 0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: LeMaker Banana Pi
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] PERCPU: Embedded 9 pages/cpu @eefe1000 s6272 r8192 d22400 u36864
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 258576
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk rootwait root=/dev/mmcblk0p2
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 1025188K/1040384K available (3931K kernel code, 174K rwdata, 1132K rodata, 208K init, 610K bss, 15196K reserved, 262144K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xffe00000 (2048 kB)
[ 0.000000] vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc04f9ef4 (5064 kB)
[ 0.000000] .init : 0xc04fa000 - 0xc052e000 ( 208 kB)
[ 0.000000] .data : 0xc052e000 - 0xc05598f8 ( 175 kB)
[ 0.000000] .bss : 0xc05598f8 - 0xc05f214c ( 611 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 24.00MHz (phys).
[ 0.000009] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 2863311519744ns
[ 0.000023] Switching to timer-based delay loop, resolution 41ns
[ 0.000357] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[ 0.000514] sched_clock: 32 bits at 160MHz, resolution 6ns, wraps every 26843545593ns
[ 0.000685] Console: colour dummy device 80x30
[ 0.000721] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000738] pid_max: default: 32768 minimum: 301
[ 0.000848] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000860] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001489] CPU: Testing write buffer coherency: ok
[ 0.001805] /cpus/cpu@0 missing clock-frequency property
[ 0.001823] /cpus/cpu@1 missing clock-frequency property
[ 0.001838] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.001893] Setting up static identity map for 0x40011c40 - 0x40011c74
[ 0.060450] CPU1: Booted secondary processor
[ 0.060493] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.060563] Brought up 2 CPUs
[ 0.060588] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.060594] CPU: All CPU(s) started in HYP mode.
[ 0.060599] CPU: Virtualization extensions available.
[ 0.065075] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[ 0.065484] pinctrl core: initialized pinctrl subsystem
[ 0.065886] regulator-dummy: no parameters
[ 0.071994] NET: Registered protocol family 16
[ 0.072348] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.111521] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[ 0.111557] platform usb1-vbus: Driver reg-fixed-voltage requests probe deferral
[ 0.111587] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[ 0.111602] platform usb2-vbus: Driver reg-fixed-voltage requests probe deferral
[ 0.111818] vcc3v0: 3000 mV
[ 0.112043] vcc3v3: 3300 mV
[ 0.112293] vcc5v0: 5000 mV
[ 0.112380] reg-fixed-voltage gmac-3v3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/gmac_power_pin@0, deferring probe
[ 0.112398] platform gmac-3v3: Driver reg-fixed-voltage requests probe deferral
[ 0.112849] SCSI subsystem initialized
[ 0.113247] usbcore: registered new interface driver usbfs
[ 0.113318] usbcore: registered new interface driver hub
[ 0.113433] usbcore: registered new device driver usb
[ 0.113589] Linux video capture interface: v2.00
[ 0.113668] pps_core: LinuxPPS API ver. 1 registered
[ 0.113676] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.113706] PTP clock support registered
[ 0.114774] Switched to clocksource arch_sys_counter
[ 0.121905] NET: Registered protocol family 2
[ 0.122974] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.123059] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.123181] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.123265] TCP: reno registered
[ 0.123280] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.123339] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.123623] NET: Registered protocol family 1
[ 0.125165] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.125321] audit: initializing netlink subsys (disabled)
[ 0.125405] audit: type=2000 audit(0.110:1): initialized
[ 0.134298] VFS: Disk quotas dquot_6.5.2
[ 0.134558] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.136331] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.136356] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.137079] msgmni has been set to 1490
[ 0.138111] bounce: pool size: 64 pages
[ 0.138136] io scheduler noop registered
[ 0.138151] io scheduler deadline registered
[ 0.138208] io scheduler cfq registered (default)
[ 0.138525] platform 1c13400.phy: Driver sun4i-usb-phy requests probe deferral
[ 0.141203] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.183606] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.187333] console [ttyS0] disabled
[ 0.207747] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[ 0.814490] console [ttyS0] enabled
[ 0.840993] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 36, base_baud = 1500000) is a U6_16550A
[ 0.872949] 1c29c00.serial: ttyS2 at MMIO 0x1c29c00 (irq = 52, base_baud = 1500000) is a U6_16550A
[ 0.885470] platform 1c50000.ethernet: Driver stmmaceth requests probe deferral
[ 0.892897] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.899467] ehci-platform: EHCI generic platform driver
[ 0.904865] platform 1c14000.usb: Driver ehci-platform requests probe deferral
[ 0.912159] platform 1c1c000.usb: Driver ehci-platform requests probe deferral
[ 0.919494] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.925722] ohci-platform: OHCI generic platform driver
[ 0.931062] platform 1c14400.usb: Driver ohci-platform requests probe deferral
[ 0.938376] platform 1c1c400.usb: Driver ohci-platform requests probe deferral
[ 0.945755] usbcore: registered new interface driver usb-storage
[ 0.952007] mousedev: PS/2 mouse device common for all mice
[ 0.962268] axp20x-regulator axp20x-regulator: regulators node not found
[ 0.969149] LDO1: 1300 mV
[ 0.972298] LDO2: at 3000 mV
[ 0.975698] LDO3: at 2275 mV
[ 0.978851] LDO4: at 2800 mV
[ 0.982215] LDO5: at 2800 mV
[ 0.985637] DCDC2: at 1400 mV
[ 0.989106] DCDC3: at 1250 mV
[ 0.992241] axp20x 0-0034: AXP20X driver loaded
[ 0.997829] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.006405] sunxi-mmc 1c0f000.mmc: No vqmmc regulator found
[ 1.012342] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 1.055002] sunxi-mmc 1c0f000.mmc: base:0xf00f6000 irq:64
[ 1.062779] sunxi-ss 1c15000.crypto-engine: Die ID 0
[ 1.067830] sunxi-ss: probe of 1c15000.crypto-engine failed with error -22
[ 1.075493] TCP: cubic registered
[ 1.078832] Initializing XFRM netlink socket
[ 1.083141] NET: Registered protocol family 17
[ 1.087766] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 1.100440] Bridge firewalling registered
[ 1.104463] 8021q: 802.1Q VLAN Support v1.8
[ 1.108796] Registering SWP/SWPB emulation handler
[ 1.114102] registered taskstats version 1
[ 1.119083] usb1-vbus: 5000 mV
[ 1.122663] usb2-vbus: 5000 mV
[ 1.127319] gmac-3v3: 3300 mV
[ 1.174166] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.184852] stmmaceth 1c50000.ethernet: no reset control found
[ 1.191255] Ring mode enabled
[ 1.194309] No HW DMA feature register supported
[ 1.198870] Normal descriptors
[ 1.198899] mmc0: new high speed SDHC card at address e624
[ 1.207713] TX Checksum insertion supported
[ 1.213392] mmcblk0: mmc0:e624 SD08G 7.40 GiB
[ 1.216616] libphy: stmmac: probed
[ 1.216626] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[ 1.216631] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[ 1.217010] ehci-platform 1c14000.usb: EHCI Host Controller
[ 1.217045] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[ 1.217169] ehci-platform 1c14000.usb: irq 71, io mem 0x01c14000
[ 1.234814] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[ 1.235016] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.235024] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.235029] usb usb1: Product: EHCI Host Controller
[ 1.235035] usb usb1: Manufacturer: Linux 3.18.27 ehci_hcd
[ 1.235040] usb usb1: SerialNumber: 1c14000.usb
[ 1.235628] hub 1-0:1.0: USB hub found
[ 1.235668] hub 1-0:1.0: 1 port detected
[ 1.236331] ehci-platform 1c1c000.usb: EHCI Host Controller
[ 1.236383] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 2
[ 1.236487] ehci-platform 1c1c000.usb: irq 72, io mem 0x01c1c000
[ 1.254865] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[ 1.255051] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.255058] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.255064] usb usb2: Product: EHCI Host Controller
[ 1.255069] usb usb2: Manufacturer: Linux 3.18.27 ehci_hcd
[ 1.255074] usb usb2: SerialNumber: 1c1c000.usb
[ 1.255627] hub 2-0:1.0: USB hub found
[ 1.255662] hub 2-0:1.0: 1 port detected
[ 1.256308] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[ 1.256341] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 3
[ 1.256492] ohci-platform 1c14400.usb: irq 96, io mem 0x01c14400
[ 1.318952] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.318960] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.318966] usb usb3: Product: Generic Platform OHCI controller
[ 1.318971] usb usb3: Manufacturer: Linux 3.18.27 ohci_hcd
[ 1.318976] usb usb3: SerialNumber: 1c14400.usb
[ 1.319502] hub 3-0:1.0: USB hub found
[ 1.319538] hub 3-0:1.0: 1 port detected
[ 1.320151] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[ 1.320183] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 4
[ 1.320303] ohci-platform 1c1c400.usb: irq 97, io mem 0x01c1c400
[ 1.378951] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.378959] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.378964] usb usb4: Product: Generic Platform OHCI controller
[ 1.378970] usb usb4: Manufacturer: Linux 3.18.27 ohci_hcd
[ 1.378975] usb usb4: SerialNumber: 1c1c400.usb
[ 1.379522] hub 4-0:1.0: USB hub found
[ 1.379559] hub 4-0:1.0: 1 port detected
[ 1.379962] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 1.384644] vcc5v0: disabling
[ 1.384652] vcc3v0: disabling
[ 1.488763] mmcblk0: p1 p2
[ 1.494548] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.503485] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 1.516897] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
[ 1.524433] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.531491] Freeing unused kernel memory: 208K (c04fa000 - c052e000)
[ 1.640749] init: Console is alive
[ 1.644465] init: - watchdog -
[ 2.648475] init: - preinit -
Detected bananapi // LeMaker Banana Pi
[ 2.731365] random: mktemp urandom read with 4 bits of entropy available
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 5.796138] mount_root: mounting /dev/root
[ 5.800858] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
[ 5.811354] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 5.837847] procd: - early -
[ 5.840865] procd: - watchdog -
[ 6.606054] procd: - ubus -
[ 7.609696] procd: - init -
Please press Enter to activate this console.
[ 8.232866] NET: Registered protocol family 10
[ 8.242967] tun: Universal TUN/TAP device driver, 1.6
[ 8.248889] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[ 8.259186] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 8.277084] batman_adv: B.A.T.M.A.N. advanced 2016.0 (compatibility version 15) loaded
[ 8.297752] sunxi-rtc 1c20d00.rtc: rtc core: registered rtc-sunxi as rtc0
[ 8.305320] sunxi-rtc 1c20d00.rtc: RTC enabled
[ 8.318817] u32 classifier
[ 8.321545] input device check on
[ 8.325896] Actions configured
[ 8.330868] Mirror/redirect action on
[ 8.380954] Ebtables v2.0 registered
[ 8.386278] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 8.400730] nf_conntrack version 0.5.0 (16021 buckets, 64084 max)
[ 8.513019] xt_time: kernel timezone is -0000
[ 11.937749] RX IPC Checksum Offload disabled
[ 11.952824] No MAC Management Counters available
[ 11.969175] device eth0.3 entered promiscuous mode
[ 11.974031] device eth0 entered promiscuous mode
[ 11.982173] br-client: port 1(eth0.3) entered forwarding state
[ 11.988168] br-client: port 1(eth0.3) entered forwarding state
[ 12.032478] device eth0.2 entered promiscuous mode
[ 12.049870] br-wan: port 1(eth0.2) entered forwarding state
[ 12.055544] br-wan: port 1(eth0.2) entered forwarding state
[ 12.096467] device br-client entered promiscuous mode
[ 12.319653] batman_adv: bat0: Adding interface: eth0.102
[ 12.342191] batman_adv: bat0: Interface activated: eth0.102
[ 12.368829] batman_adv: bat0: Adding interface: eth0.100
[ 12.370226] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.408061] batman_adv: bat0: Interface activated: eth0.100
[ 12.423195] batman_adv: bat0: Adding interface: eth0.101
[ 12.427478] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.437005] batman_adv: bat0: Interface activated: eth0.101
[ 12.450289] 8021q: adding VLAN 0 to HW filter on device bat0
[ 12.457783] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.476966] device bat0 entered promiscuous mode
[ 12.481729] br-client: port 2(bat0) entered forwarding state
[ 12.487551] br-client: port 2(bat0) entered forwarding state
[ 13.092033] batman_adv: bat0: Changing gw mode from: off to: client
[ 13.098739] batman_adv: bat0: gw_sel_class: Changing from: 20 to: 15
[ 13.105651] batman_adv: bat0: hop_penalty: Changing from: 30 to: 15
[ 13.112197] batman_adv: bat0: multicast_mode: Changing from: enabled to: disabled
[ 13.121181] batman_adv: bat0: orig_interval: Changing from: 1000 to: 5000
[ 13.480576] batman_adv: bat0: Adding interface: mesh-vpn
[ 13.487555] batman_adv: bat0: The MTU of interface mesh-vpn is too small (1406) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which.
[ 13.516518] batman_adv: bat0: Interface activated: mesh-vpn
[ 13.525152] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 13.932260] br-wan: port 1(eth0.2) entered disabled state
[ 13.939085] br-client: port 1(eth0.3) entered disabled state
[ 13.987370] batman_adv: bat0: Interface deactivated: eth0.100
[ 13.993137] batman_adv: bat0: Removing interface: eth0.100
[ 14.004625] batman_adv: bat0: Interface deactivated: eth0.102
[ 14.010903] batman_adv: bat0: Removing interface: eth0.102
[ 14.018061] batman_adv: bat0: Interface deactivated: eth0.101
[ 14.023825] batman_adv: bat0: Removing interface: eth0.101
[ 14.030058] tried to remove device eth0 from local-node
[ 14.035444] ------------[ cut here ]------------
[ 14.040092] kernel BUG at net/core/dev.c:4981!
[ 14.044542] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[ 14.050368] Modules linked in: iptable_nat nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE ebtable_nat ebtable_filter ebtable_broute xt_time xt_tcpudp xt_state xt_quota s
[ 14.147741] CPU: 1 PID: 1658 Comm: batadv.sh Not tainted 3.18.27 #1
[ 14.154004] task: ee8ab740 ti: edc20000 task.ti: edc20000
[ 14.159406] PC is at __netdev_adjacent_dev_remove+0x64/0x124
[ 14.165076] LR is at 0x0
[ 14.167609] pc : [<c032bbb8>] lr : [<00000000>] psr: 60000113
[ 14.167609] sp : edc21e18 ip : 00000000 fp : edc21e34
[ 14.179070] r10: edc57500 r9 : ee3fd800 r8 : ee3fd868
[ 14.184289] r7 : eebd8000 r6 : edc0d000 r5 : eebd8060 r4 : eebd8054
[ 14.190809] r3 : 00000000 r2 : 00000001 r1 : eefea24c r0 : 0000002b
[ 14.197329] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 14.204455] Control: 10c5387d Table: 6de9806a DAC: 00000015
[ 14.210194] Process batadv.sh (pid: 1658, stack limit = 0xedc20238)
[ 14.216454] Stack: (0xedc21e18 to 0xedc22000)
[ 14.220810] 1e00: eebd8000 edc0d000
[ 14.228980] 1e20: edc57060 edc57000 edc21e4c edc21e38 c032bc94 c032bb60 ee1e9040 ee3d2d00
[ 14.237149] 1e40: edc21e7c edc21e50 c032bd5c c032bc84 00000001 ee3b7600 ee3b7600 ee3b7600
[ 14.245319] 1e60: edc57000 00000001 edde2b00 edde2b18 edc21ebc edc21e80 bf0a4514 c032bcf0
[ 14.253488] 1e80: ee0ea180 edc57000 edc21eac edde2b00 c000f80c ee3b7600 ee0ea540 00000005
[ 14.261658] 1ea0: 00000000 00000005 ee0ea180 ee0ea18c edc21edc edc21ec0 bf0adfec bf0a42f4
[ 14.269827] 1ec0: ee0ea540 00000000 ee0ea540 edc21f78 edc21eec edc21ee0 c01cb49c bf0adefc
[ 14.277997] 1ee0: edc21f04 edc21ef0 c0127d0c c01cb48c c0127cc8 00000000 edc21f3c edc21f08
[ 14.286166] 1f00: c01275a0 c0127cd4 00000000 00000000 edc21f3c edc20000 00d07610 ee0c0900
[ 14.294336] 1f20: 00000005 edc21f78 00d07610 00000000 edc21f74 edc21f40 c00c827c c0127498
[ 14.302506] 1f40: edc21fa4 edc21f50 c0026498 00000000 00000000 ee0c0900 ee0c0900 00000005
[ 14.310675] 1f60: 00d07610 00000000 edc21fa4 edc21f78 c00c8818 c00c81d0 00000000 00000000
[ 14.318844] 1f80: 00081b10 00000001 00d07610 00000004 c0008fa4 edc20000 00000000 edc21fa8
[ 14.327014] 1fa0: c0008e00 c00c87e0 00081b10 00000001 00000001 00d07610 00000005 00000000
[ 14.335183] 1fc0: 00081b10 00000001 00d07610 00000004 00d19de0 00000020 00000002 00d05008
[ 14.343352] 1fe0: 00000005 be886298 00018c98 b6f130ec 60000010 00000001 00000000 00000000
[ 14.351514] Backtrace:
[ 14.353983] [<c032bb54>] (__netdev_adjacent_dev_remove) from [<c032bc94>] (__netdev_adjacent_dev_unlink+0x1c/0x30)
[ 14.364314] r7:edc57000 r6:edc57060 r5:edc0d000 r4:eebd8000
[ 14.370022] [<c032bc78>] (__netdev_adjacent_dev_unlink) from [<c032bd5c>] (netdev_upper_dev_unlink+0x78/0x120)
[ 14.380006] r5:ee3d2d00 r4:ee1e9040
[ 14.383631] [<c032bce4>] (netdev_upper_dev_unlink) from [<bf0a4514>] (batadv_hardif_disable_interface+0x22c/0x374 [batman_adv])
[ 14.395088] r9:edde2b18 r8:edde2b00 r7:00000001 r6:edc57000 r5:ee3b7600 r4:ee3b7600
[ 14.402914] [<bf0a42e8>] (batadv_hardif_disable_interface [batman_adv]) from [<bf0adfec>] (batadv_store_mesh_iface+0xfc/0x178 [batman_adv])
[ 14.415412] r10:ee0ea18c r9:ee0ea180 r8:00000005 r7:00000000 r6:00000005 r5:ee0ea540
[ 14.423295] r4:ee3b7600
[ 14.425857] [<bf0adef0>] (batadv_store_mesh_iface [batman_adv]) from [<c01cb49c>] (kobj_attr_store+0x1c/0x28)
[ 14.435755] r7:edc21f78 r6:ee0ea540 r5:00000000 r4:ee0ea540
[ 14.441468] [<c01cb480>] (kobj_attr_store) from [<c0127d0c>] (sysfs_kf_write+0x44/0x50)
[ 14.449465] [<c0127cc8>] (sysfs_kf_write) from [<c01275a0>] (kernfs_fop_write+0x114/0x18c)
[ 14.457715] r4:00000000 r3:c0127cc8
[ 14.461318] [<c012748c>] (kernfs_fop_write) from [<c00c827c>] (vfs_write+0xb8/0x1d0)
[ 14.469048] r10:00000000 r9:00d07610 r8:edc21f78 r7:00000005 r6:ee0c0900 r5:00d07610
[ 14.476930] r4:edc20000
[ 14.479481] [<c00c81c4>] (vfs_write) from [<c00c8818>] (SyS_write+0x44/0x84)
[ 14.484774] br-client: port 2(bat0) entered forwarding state
[ 14.492165] r10:00000000 r9:00d07610 r8:00000005 r7:ee0c0900 r6:ee0c0900 r5:00000000
[ 14.500049] r4:00000000
[ 14.502601] [<c00c87d4>] (SyS_write) from [<c0008e00>] (ret_fast_syscall+0x0/0x38)
[ 14.510158] r9:edc20000 r8:c0008fa4 r7:00000004 r6:00d07610 r5:00000001 r4:00081b10
[ 14.517960] Code: e1a01007 e1a02006 e34c004c ebf4a2c5 (e7f001f2)
[ 14.524052] ---[ end trace f08a7d9e1d9c2a3b ]---
U-Boot SPL 2015.01 (Mar 18 2016 - 19:30:08)
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
U-Boot 2015.01 (Mar 18 2016 - 19:30:08) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
I2C: ready
DRAM: 1016 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
Reserved 8192kB of RAM for Framebuffer.
In: serial
Out: serial
Err: serial
SCSI: SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net: dwmac.1c50000
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
USB1: USB EHCI 1.00
scanning bus 1 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0...
Found U-Boot script /boot.scr
reading /boot.scr
377 bytes read in 18 ms (19.5 KiB/s)
## Executing script at 43100000
reading uImage
1981560 bytes read in 117 ms (16.2 MiB/s)
reading dtb
23549 bytes read in 30 ms (765.6 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
Image Name: ARM OpenWrt Linux-3.18.27
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1981496 Bytes = 1.9 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
Loading Kernel Image ... OK
Using Device Tree in place at 43000000, end 43008bfc
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.18.27 (julian@eclipse) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r48900) ) #1 SMP PREEMPT Fri Mar 18 19:27:10 CET 2016
[ 0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: LeMaker Banana Pi
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] PERCPU: Embedded 9 pages/cpu @eefe1000 s6272 r8192 d22400 u36864
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 258576
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk rootwait root=/dev/mmcblk0p2
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 1025188K/1040384K available (3931K kernel code, 174K rwdata, 1132K rodata, 208K init, 610K bss, 15196K reserved, 262144K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xffe00000 (2048 kB)
[ 0.000000] vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc04f9ef4 (5064 kB)
[ 0.000000] .init : 0xc04fa000 - 0xc052e000 ( 208 kB)
[ 0.000000] .data : 0xc052e000 - 0xc05598f8 ( 175 kB)
[ 0.000000] .bss : 0xc05598f8 - 0xc05f214c ( 611 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 24.00MHz (phys).
[ 0.000009] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 2863311519744ns
[ 0.000023] Switching to timer-based delay loop, resolution 41ns
[ 0.000357] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[ 0.000514] sched_clock: 32 bits at 160MHz, resolution 6ns, wraps every 26843545593ns
[ 0.000685] Console: colour dummy device 80x30
[ 0.000721] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000738] pid_max: default: 32768 minimum: 301
[ 0.000848] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000860] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001489] CPU: Testing write buffer coherency: ok
[ 0.001805] /cpus/cpu@0 missing clock-frequency property
[ 0.001823] /cpus/cpu@1 missing clock-frequency property
[ 0.001838] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.001893] Setting up static identity map for 0x40011c40 - 0x40011c74
[ 0.060450] CPU1: Booted secondary processor
[ 0.060493] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.060563] Brought up 2 CPUs
[ 0.060588] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.060594] CPU: All CPU(s) started in HYP mode.
[ 0.060599] CPU: Virtualization extensions available.
[ 0.065075] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[ 0.065484] pinctrl core: initialized pinctrl subsystem
[ 0.065886] regulator-dummy: no parameters
[ 0.071994] NET: Registered protocol family 16
[ 0.072348] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.111521] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[ 0.111557] platform usb1-vbus: Driver reg-fixed-voltage requests probe deferral
[ 0.111587] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[ 0.111602] platform usb2-vbus: Driver reg-fixed-voltage requests probe deferral
[ 0.111818] vcc3v0: 3000 mV
[ 0.112043] vcc3v3: 3300 mV
[ 0.112293] vcc5v0: 5000 mV
[ 0.112380] reg-fixed-voltage gmac-3v3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/gmac_power_pin@0, deferring probe
[ 0.112398] platform gmac-3v3: Driver reg-fixed-voltage requests probe deferral
[ 0.112849] SCSI subsystem initialized
[ 0.113247] usbcore: registered new interface driver usbfs
[ 0.113318] usbcore: registered new interface driver hub
[ 0.113433] usbcore: registered new device driver usb
[ 0.113589] Linux video capture interface: v2.00
[ 0.113668] pps_core: LinuxPPS API ver. 1 registered
[ 0.113676] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.113706] PTP clock support registered
[ 0.114774] Switched to clocksource arch_sys_counter
[ 0.121905] NET: Registered protocol family 2
[ 0.122974] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.123059] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.123181] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.123265] TCP: reno registered
[ 0.123280] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.123339] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.123623] NET: Registered protocol family 1
[ 0.125165] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.125321] audit: initializing netlink subsys (disabled)
[ 0.125405] audit: type=2000 audit(0.110:1): initialized
[ 0.134298] VFS: Disk quotas dquot_6.5.2
[ 0.134558] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.136331] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.136356] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.137079] msgmni has been set to 1490
[ 0.138111] bounce: pool size: 64 pages
[ 0.138136] io scheduler noop registered
[ 0.138151] io scheduler deadline registered
[ 0.138208] io scheduler cfq registered (default)
[ 0.138525] platform 1c13400.phy: Driver sun4i-usb-phy requests probe deferral
[ 0.141203] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.183606] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.187333] console [ttyS0] disabled
[ 0.207747] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[ 0.814490] console [ttyS0] enabled
[ 0.840993] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 36, base_baud = 1500000) is a U6_16550A
[ 0.872949] 1c29c00.serial: ttyS2 at MMIO 0x1c29c00 (irq = 52, base_baud = 1500000) is a U6_16550A
[ 0.885470] platform 1c50000.ethernet: Driver stmmaceth requests probe deferral
[ 0.892897] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.899467] ehci-platform: EHCI generic platform driver
[ 0.904865] platform 1c14000.usb: Driver ehci-platform requests probe deferral
[ 0.912159] platform 1c1c000.usb: Driver ehci-platform requests probe deferral
[ 0.919494] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.925722] ohci-platform: OHCI generic platform driver
[ 0.931062] platform 1c14400.usb: Driver ohci-platform requests probe deferral
[ 0.938376] platform 1c1c400.usb: Driver ohci-platform requests probe deferral
[ 0.945755] usbcore: registered new interface driver usb-storage
[ 0.952007] mousedev: PS/2 mouse device common for all mice
[ 0.962268] axp20x-regulator axp20x-regulator: regulators node not found
[ 0.969149] LDO1: 1300 mV
[ 0.972298] LDO2: at 3000 mV
[ 0.975698] LDO3: at 2275 mV
[ 0.978851] LDO4: at 2800 mV
[ 0.982215] LDO5: at 2800 mV
[ 0.985637] DCDC2: at 1400 mV
[ 0.989106] DCDC3: at 1250 mV
[ 0.992241] axp20x 0-0034: AXP20X driver loaded
[ 0.997829] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.006405] sunxi-mmc 1c0f000.mmc: No vqmmc regulator found
[ 1.012342] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 1.055002] sunxi-mmc 1c0f000.mmc: base:0xf00f6000 irq:64
[ 1.062779] sunxi-ss 1c15000.crypto-engine: Die ID 0
[ 1.067830] sunxi-ss: probe of 1c15000.crypto-engine failed with error -22
[ 1.075493] TCP: cubic registered
[ 1.078832] Initializing XFRM netlink socket
[ 1.083141] NET: Registered protocol family 17
[ 1.087766] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 1.100440] Bridge firewalling registered
[ 1.104463] 8021q: 802.1Q VLAN Support v1.8
[ 1.108796] Registering SWP/SWPB emulation handler
[ 1.114102] registered taskstats version 1
[ 1.119083] usb1-vbus: 5000 mV
[ 1.122663] usb2-vbus: 5000 mV
[ 1.127319] gmac-3v3: 3300 mV
[ 1.174166] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.184852] stmmaceth 1c50000.ethernet: no reset control found
[ 1.191255] Ring mode enabled
[ 1.194309] No HW DMA feature register supported
[ 1.198870] Normal descriptors
[ 1.198899] mmc0: new high speed SDHC card at address e624
[ 1.207713] TX Checksum insertion supported
[ 1.213392] mmcblk0: mmc0:e624 SD08G 7.40 GiB
[ 1.216616] libphy: stmmac: probed
[ 1.216626] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[ 1.216631] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[ 1.217010] ehci-platform 1c14000.usb: EHCI Host Controller
[ 1.217045] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[ 1.217169] ehci-platform 1c14000.usb: irq 71, io mem 0x01c14000
[ 1.234814] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[ 1.235016] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.235024] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.235029] usb usb1: Product: EHCI Host Controller
[ 1.235035] usb usb1: Manufacturer: Linux 3.18.27 ehci_hcd
[ 1.235040] usb usb1: SerialNumber: 1c14000.usb
[ 1.235628] hub 1-0:1.0: USB hub found
[ 1.235668] hub 1-0:1.0: 1 port detected
[ 1.236331] ehci-platform 1c1c000.usb: EHCI Host Controller
[ 1.236383] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 2
[ 1.236487] ehci-platform 1c1c000.usb: irq 72, io mem 0x01c1c000
[ 1.254865] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[ 1.255051] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.255058] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.255064] usb usb2: Product: EHCI Host Controller
[ 1.255069] usb usb2: Manufacturer: Linux 3.18.27 ehci_hcd
[ 1.255074] usb usb2: SerialNumber: 1c1c000.usb
[ 1.255627] hub 2-0:1.0: USB hub found
[ 1.255662] hub 2-0:1.0: 1 port detected
[ 1.256308] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[ 1.256341] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 3
[ 1.256492] ohci-platform 1c14400.usb: irq 96, io mem 0x01c14400
[ 1.318952] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.318960] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.318966] usb usb3: Product: Generic Platform OHCI controller
[ 1.318971] usb usb3: Manufacturer: Linux 3.18.27 ohci_hcd
[ 1.318976] usb usb3: SerialNumber: 1c14400.usb
[ 1.319502] hub 3-0:1.0: USB hub found
[ 1.319538] hub 3-0:1.0: 1 port detected
[ 1.320151] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[ 1.320183] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 4
[ 1.320303] ohci-platform 1c1c400.usb: irq 97, io mem 0x01c1c400
[ 1.378951] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.378959] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.378964] usb usb4: Product: Generic Platform OHCI controller
[ 1.378970] usb usb4: Manufacturer: Linux 3.18.27 ohci_hcd
[ 1.378975] usb usb4: SerialNumber: 1c1c400.usb
[ 1.379522] hub 4-0:1.0: USB hub found
[ 1.379559] hub 4-0:1.0: 1 port detected
[ 1.379962] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 1.384644] vcc5v0: disabling
[ 1.384652] vcc3v0: disabling
[ 1.488763] mmcblk0: p1 p2
[ 1.494548] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.503485] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 1.516897] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
[ 1.524433] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.531491] Freeing unused kernel memory: 208K (c04fa000 - c052e000)
[ 1.640749] init: Console is alive
[ 1.644465] init: - watchdog -
[ 2.648475] init: - preinit -
Detected bananapi // LeMaker Banana Pi
[ 2.731365] random: mktemp urandom read with 4 bits of entropy available
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 5.796138] mount_root: mounting /dev/root
[ 5.800858] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
[ 5.811354] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 5.837847] procd: - early -
[ 5.840865] procd: - watchdog -
[ 6.606054] procd: - ubus -
[ 7.609696] procd: - init -
Please press Enter to activate this console.
[ 8.232866] NET: Registered protocol family 10
[ 8.242967] tun: Universal TUN/TAP device driver, 1.6
[ 8.248889] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[ 8.259186] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 8.277084] batman_adv: B.A.T.M.A.N. advanced 2016.0 (compatibility version 15) loaded
[ 8.297752] sunxi-rtc 1c20d00.rtc: rtc core: registered rtc-sunxi as rtc0
[ 8.305320] sunxi-rtc 1c20d00.rtc: RTC enabled
[ 8.318817] u32 classifier
[ 8.321545] input device check on
[ 8.325896] Actions configured
[ 8.330868] Mirror/redirect action on
[ 8.380954] Ebtables v2.0 registered
[ 8.386278] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 8.400730] nf_conntrack version 0.5.0 (16021 buckets, 64084 max)
[ 8.513019] xt_time: kernel timezone is -0000
[ 11.937749] RX IPC Checksum Offload disabled
[ 11.952824] No MAC Management Counters available
[ 11.969175] device eth0.3 entered promiscuous mode
[ 11.974031] device eth0 entered promiscuous mode
[ 11.982173] br-client: port 1(eth0.3) entered forwarding state
[ 11.988168] br-client: port 1(eth0.3) entered forwarding state
[ 12.032478] device eth0.2 entered promiscuous mode
[ 12.049870] br-wan: port 1(eth0.2) entered forwarding state
[ 12.055544] br-wan: port 1(eth0.2) entered forwarding state
[ 12.096467] device br-client entered promiscuous mode
[ 12.319653] batman_adv: bat0: Adding interface: eth0.102
[ 12.342191] batman_adv: bat0: Interface activated: eth0.102
[ 12.368829] batman_adv: bat0: Adding interface: eth0.100
[ 12.370226] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.408061] batman_adv: bat0: Interface activated: eth0.100
[ 12.423195] batman_adv: bat0: Adding interface: eth0.101
[ 12.427478] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.437005] batman_adv: bat0: Interface activated: eth0.101
[ 12.450289] 8021q: adding VLAN 0 to HW filter on device bat0
[ 12.457783] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.476966] device bat0 entered promiscuous mode
[ 12.481729] br-client: port 2(bat0) entered forwarding state
[ 12.487551] br-client: port 2(bat0) entered forwarding state
[ 13.092033] batman_adv: bat0: Changing gw mode from: off to: client
[ 13.098739] batman_adv: bat0: gw_sel_class: Changing from: 20 to: 15
[ 13.105651] batman_adv: bat0: hop_penalty: Changing from: 30 to: 15
[ 13.112197] batman_adv: bat0: multicast_mode: Changing from: enabled to: disabled
[ 13.121181] batman_adv: bat0: orig_interval: Changing from: 1000 to: 5000
[ 13.480576] batman_adv: bat0: Adding interface: mesh-vpn
[ 13.487555] batman_adv: bat0: The MTU of interface mesh-vpn is too small (1406) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which.
[ 13.516518] batman_adv: bat0: Interface activated: mesh-vpn
[ 13.525152] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 13.932260] br-wan: port 1(eth0.2) entered disabled state
[ 13.939085] br-client: port 1(eth0.3) entered disabled state
[ 13.987370] batman_adv: bat0: Interface deactivated: eth0.100
[ 13.993137] batman_adv: bat0: Removing interface: eth0.100
[ 14.004625] batman_adv: bat0: Interface deactivated: eth0.102
[ 14.010903] batman_adv: bat0: Removing interface: eth0.102
[ 14.018061] batman_adv: bat0: Interface deactivated: eth0.101
[ 14.023825] batman_adv: bat0: Removing interface: eth0.101
[ 14.030058] tried to remove device eth0 from local-node
[ 14.035444] ------------[ cut here ]------------
[ 14.040092] kernel BUG at net/core/dev.c:4981!
[ 14.044542] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[ 14.050368] Modules linked in: iptable_nat nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE ebtable_nat ebtable_filter ebtable_broute xt_time xt_tcpudp xt_state xt_quota s
[ 14.147741] CPU: 1 PID: 1658 Comm: batadv.sh Not tainted 3.18.27 #1
[ 14.154004] task: ee8ab740 ti: edc20000 task.ti: edc20000
[ 14.159406] PC is at __netdev_adjacent_dev_remove+0x64/0x124
[ 14.165076] LR is at 0x0
[ 14.167609] pc : [<c032bbb8>] lr : [<00000000>] psr: 60000113
[ 14.167609] sp : edc21e18 ip : 00000000 fp : edc21e34
[ 14.179070] r10: edc57500 r9 : ee3fd800 r8 : ee3fd868
[ 14.184289] r7 : eebd8000 r6 : edc0d000 r5 : eebd8060 r4 : eebd8054
[ 14.190809] r3 : 00000000 r2 : 00000001 r1 : eefea24c r0 : 0000002b
[ 14.197329] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 14.204455] Control: 10c5387d Table: 6de9806a DAC: 00000015
[ 14.210194] Process batadv.sh (pid: 1658, stack limit = 0xedc20238)
[ 14.216454] Stack: (0xedc21e18 to 0xedc22000)
[ 14.220810] 1e00: eebd8000 edc0d000
[ 14.228980] 1e20: edc57060 edc57000 edc21e4c edc21e38 c032bc94 c032bb60 ee1e9040 ee3d2d00
[ 14.237149] 1e40: edc21e7c edc21e50 c032bd5c c032bc84 00000001 ee3b7600 ee3b7600 ee3b7600
[ 14.245319] 1e60: edc57000 00000001 edde2b00 edde2b18 edc21ebc edc21e80 bf0a4514 c032bcf0
[ 14.253488] 1e80: ee0ea180 edc57000 edc21eac edde2b00 c000f80c ee3b7600 ee0ea540 00000005
[ 14.261658] 1ea0: 00000000 00000005 ee0ea180 ee0ea18c edc21edc edc21ec0 bf0adfec bf0a42f4
[ 14.269827] 1ec0: ee0ea540 00000000 ee0ea540 edc21f78 edc21eec edc21ee0 c01cb49c bf0adefc
[ 14.277997] 1ee0: edc21f04 edc21ef0 c0127d0c c01cb48c c0127cc8 00000000 edc21f3c edc21f08
[ 14.286166] 1f00: c01275a0 c0127cd4 00000000 00000000 edc21f3c edc20000 00d07610 ee0c0900
[ 14.294336] 1f20: 00000005 edc21f78 00d07610 00000000 edc21f74 edc21f40 c00c827c c0127498
[ 14.302506] 1f40: edc21fa4 edc21f50 c0026498 00000000 00000000 ee0c0900 ee0c0900 00000005
[ 14.310675] 1f60: 00d07610 00000000 edc21fa4 edc21f78 c00c8818 c00c81d0 00000000 00000000
[ 14.318844] 1f80: 00081b10 00000001 00d07610 00000004 c0008fa4 edc20000 00000000 edc21fa8
[ 14.327014] 1fa0: c0008e00 c00c87e0 00081b10 00000001 00000001 00d07610 00000005 00000000
[ 14.335183] 1fc0: 00081b10 00000001 00d07610 00000004 00d19de0 00000020 00000002 00d05008
[ 14.343352] 1fe0: 00000005 be886298 00018c98 b6f130ec 60000010 00000001 00000000 00000000
[ 14.351514] Backtrace:
[ 14.353983] [<c032bb54>] (__netdev_adjacent_dev_remove) from [<c032bc94>] (__netdev_adjacent_dev_unlink+0x1c/0x30)
[ 14.364314] r7:edc57000 r6:edc57060 r5:edc0d000 r4:eebd8000
[ 14.370022] [<c032bc78>] (__netdev_adjacent_dev_unlink) from [<c032bd5c>] (netdev_upper_dev_unlink+0x78/0x120)
[ 14.380006] r5:ee3d2d00 r4:ee1e9040
[ 14.383631] [<c032bce4>] (netdev_upper_dev_unlink) from [<bf0a4514>] (batadv_hardif_disable_interface+0x22c/0x374 [batman_adv])
[ 14.395088] r9:edde2b18 r8:edde2b00 r7:00000001 r6:edc57000 r5:ee3b7600 r4:ee3b7600
[ 14.402914] [<bf0a42e8>] (batadv_hardif_disable_interface [batman_adv]) from [<bf0adfec>] (batadv_store_mesh_iface+0xfc/0x178 [batman_adv])
[ 14.415412] r10:ee0ea18c r9:ee0ea180 r8:00000005 r7:00000000 r6:00000005 r5:ee0ea540
[ 14.423295] r4:ee3b7600
[ 14.425857] [<bf0adef0>] (batadv_store_mesh_iface [batman_adv]) from [<c01cb49c>] (kobj_attr_store+0x1c/0x28)
[ 14.435755] r7:edc21f78 r6:ee0ea540 r5:00000000 r4:ee0ea540
[ 14.441468] [<c01cb480>] (kobj_attr_store) from [<c0127d0c>] (sysfs_kf_write+0x44/0x50)
[ 14.449465] [<c0127cc8>] (sysfs_kf_write) from [<c01275a0>] (kernfs_fop_write+0x114/0x18c)
[ 14.457715] r4:00000000 r3:c0127cc8
[ 14.461318] [<c012748c>] (kernfs_fop_write) from [<c00c827c>] (vfs_write+0xb8/0x1d0)
[ 14.469048] r10:00000000 r9:00d07610 r8:edc21f78 r7:00000005 r6:ee0c0900 r5:00d07610
[ 14.476930] r4:edc20000
[ 14.479481] [<c00c81c4>] (vfs_write) from [<c00c8818>] (SyS_write+0x44/0x84)
[ 14.484774] br-client: port 2(bat0) entered forwarding state
[ 14.492165] r10:00000000 r9:00d07610 r8:00000005 r7:ee0c0900 r6:ee0c0900 r5:00000000
[ 14.500049] r4:00000000
[ 14.502601] [<c00c87d4>] (SyS_write) from [<c0008e00>] (ret_fast_syscall+0x0/0x38)
[ 14.510158] r9:edc20000 r8:c0008fa4 r7:00000004 r6:00d07610 r5:00000001 r4:00081b10
[ 14.517960] Code: e1a01007 e1a02006 e34c004c ebf4a2c5 (e7f001f2)
[ 14.524052] ---[ end trace f08a7d9e1d9c2a3b ]---
[-- Attachment #1.1.3: dmesg-before.txt --]
[-- Type: text/plain, Size: 23920 bytes --]
U-Boot SPL 2015.01 (Mar 08 2016 - 21:55:59)
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
U-Boot 2015.01 (Mar 08 2016 - 21:55:59) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
I2C: ready
DRAM: 1016 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
Reserved 8192kB of RAM for Framebuffer.
In: serial
Out: serial
Err: serial
SCSI: SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net: dwmac.1c50000
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
USB1: USB EHCI 1.00
scanning bus 1 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0...
Found U-Boot script /boot.scr
reading /boot.scr
377 bytes read in 17 ms (21.5 KiB/s)
## Executing script at 43100000
reading uImage
1981680 bytes read in 113 ms (16.7 MiB/s)
reading dtb
23549 bytes read in 27 ms (851.6 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
Image Name: ARM OpenWrt Linux-3.18.27
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1981616 Bytes = 1.9 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
Loading Kernel Image ... OK
Using Device Tree in place at 43000000, end 43008bfc
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.18.27 (julian@eclipse) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r486
[ 0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: LeMaker Banana Pi
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] PERCPU: Embedded 9 pages/cpu @eefe1000 s6272 r8192 d22400 u36864
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 258576
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk rootwait root=/dev/mmcblk0p2
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 1025188K/1040384K available (3931K kernel code, 174K rwdata, 1132K rodata, 208K init,)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xffe00000 (2048 kB)
[ 0.000000] vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc04f9ef4 (5064 kB)
[ 0.000000] .init : 0xc04fa000 - 0xc052e000 ( 208 kB)
[ 0.000000] .data : 0xc052e000 - 0xc05598f8 ( 175 kB)
[ 0.000000] .bss : 0xc05598f8 - 0xc05f214c ( 611 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 24.00MHz (phys).
[ 0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 2863311519744ns
[ 0.000021] Switching to timer-based delay loop, resolution 41ns
[ 0.000358] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[ 0.000516] sched_clock: 32 bits at 160MHz, resolution 6ns, wraps every 26843545593ns
[ 0.000679] Console: colour dummy device 80x30
[ 0.000714] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lp)
[ 0.000729] pid_max: default: 32768 minimum: 301
[ 0.000839] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000851] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001482] CPU: Testing write buffer coherency: ok
[ 0.001801] /cpus/cpu@0 missing clock-frequency property
[ 0.001819] /cpus/cpu@1 missing clock-frequency property
[ 0.001832] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.001890] Setting up static identity map for 0x40011c40 - 0x40011c74
[ 0.060445] CPU1: Booted secondary processor
[ 0.060491] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.060565] Brought up 2 CPUs
[ 0.060587] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.060594] CPU: All CPU(s) started in HYP mode.
[ 0.060599] CPU: Virtualization extensions available.
[ 0.065096] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[ 0.065505] pinctrl core: initialized pinctrl subsystem
[ 0.065908] regulator-dummy: no parameters
[ 0.072004] NET: Registered protocol family 16
[ 0.072360] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.111533] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/ue
[ 0.111569] platform usb1-vbus: Driver reg-fixed-voltage requests probe deferral
[ 0.111600] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/ue
[ 0.111615] platform usb2-vbus: Driver reg-fixed-voltage requests probe deferral
[ 0.111831] vcc3v0: 3000 mV
[ 0.112055] vcc3v3: 3300 mV
[ 0.112307] vcc5v0: 5000 mV
[ 0.112391] reg-fixed-voltage gmac-3v3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/gme
[ 0.112408] platform gmac-3v3: Driver reg-fixed-voltage requests probe deferral
[ 0.112855] SCSI subsystem initialized
[ 0.113256] usbcore: registered new interface driver usbfs
[ 0.113325] usbcore: registered new interface driver hub
[ 0.113444] usbcore: registered new device driver usb
[ 0.113601] Linux video capture interface: v2.00
[ 0.113679] pps_core: LinuxPPS API ver. 1 registered
[ 0.113687] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.113718] PTP clock support registered
[ 0.114788] Switched to clocksource arch_sys_counter
[ 0.121926] NET: Registered protocol family 2
[ 0.122992] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.123074] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.123196] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.123279] TCP: reno registered
[ 0.123294] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.123353] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.123629] NET: Registered protocol family 1
[ 0.125162] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.125320] audit: initializing netlink subsys (disabled)
[ 0.125401] audit: type=2000 audit(0.110:1): initialized
[ 0.134297] VFS: Disk quotas dquot_6.5.2
[ 0.134557] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.136338] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.136360] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, In.
[ 0.137090] msgmni has been set to 1490
[ 0.138171] bounce: pool size: 64 pages
[ 0.138196] io scheduler noop registered
[ 0.138212] io scheduler deadline registered
[ 0.138270] io scheduler cfq registered (default)
[ 0.138586] platform 1c13400.phy: Driver sun4i-usb-phy requests probe deferral
[ 0.141264] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.183844] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.187678] console [ttyS0] disabled
[ 0.208102] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[ 0.814767] console [ttyS0] enabled
[ 0.841281] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 36, base_baud = 1500000) is a U6_16550A
[ 0.873232] 1c29c00.serial: ttyS2 at MMIO 0x1c29c00 (irq = 52, base_baud = 1500000) is a U6_16550A
[ 0.885745] platform 1c50000.ethernet: Driver stmmaceth requests probe deferral
[ 0.893175] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.899752] ehci-platform: EHCI generic platform driver
[ 0.905147] platform 1c14000.usb: Driver ehci-platform requests probe deferral
[ 0.912439] platform 1c1c000.usb: Driver ehci-platform requests probe deferral
[ 0.919780] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.926008] ohci-platform: OHCI generic platform driver
[ 0.931352] platform 1c14400.usb: Driver ohci-platform requests probe deferral
[ 0.938664] platform 1c1c400.usb: Driver ohci-platform requests probe deferral
[ 0.946046] usbcore: registered new interface driver usb-storage
[ 0.952292] mousedev: PS/2 mouse device common for all mice
[ 0.962555] axp20x-regulator axp20x-regulator: regulators node not found
[ 0.969446] LDO1: 1300 mV
[ 0.972587] LDO2: at 3000 mV
[ 0.975990] LDO3: at 2275 mV
[ 0.979138] LDO4: at 2800 mV
[ 0.982495] LDO5: at 2800 mV
[ 0.985913] DCDC2: at 1400 mV
[ 0.989387] DCDC3: at 1250 mV
[ 0.992527] axp20x 0-0034: AXP20X driver loaded
[ 0.998124] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.006696] sunxi-mmc 1c0f000.mmc: No vqmmc regulator found
[ 1.012633] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 1.055070] sunxi-mmc 1c0f000.mmc: base:0xf00f6000 irq:64
[ 1.062857] sunxi-ss 1c15000.crypto-engine: Die ID 0
[ 1.067906] sunxi-ss: probe of 1c15000.crypto-engine failed with error -22
[ 1.075572] TCP: cubic registered
[ 1.078912] Initializing XFRM netlink socket
[ 1.083222] NET: Registered protocol family 17
[ 1.087852] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to .
[ 1.100523] Bridge firewalling registered
[ 1.104545] 8021q: 802.1Q VLAN Support v1.8
[ 1.108877] Registering SWP/SWPB emulation handler
[ 1.114183] registered taskstats version 1
[ 1.119143] usb1-vbus: 5000 mV
[ 1.122716] usb2-vbus: 5000 mV
[ 1.127366] gmac-3v3: 3300 mV
[ 1.174087] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.184869] stmmaceth 1c50000.ethernet: no reset control found
[ 1.191280] Ring mode enabled
[ 1.194334] No HW DMA feature register supported
[ 1.198895] Normal descriptors
[ 1.198923] mmc0: new high speed SDHC card at address aaaa
[ 1.207736] TX Checksum insertion supported
[ 1.213665] mmcblk0: mmc0:aaaa SL08G 7.40 GiB
[ 1.220788] libphy: stmmac: probed
[ 1.224196] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[ 1.230568] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[ 1.231976] mmcblk0: p1 p2
[ 1.239501] ehci-platform 1c14000.usb: EHCI Host Controller
[ 1.245145] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[ 1.253005] ehci-platform 1c14000.usb: irq 71, io mem 0x01c14000
[ 1.274810] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[ 1.281095] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.287897] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.295121] usb usb1: Product: EHCI Host Controller
[ 1.299996] usb usb1: Manufacturer: Linux 3.18.27 ehci_hcd
[ 1.305488] usb usb1: SerialNumber: 1c14000.usb
[ 1.310613] hub 1-0:1.0: USB hub found
[ 1.314409] hub 1-0:1.0: 1 port detected
[ 1.319201] ehci-platform 1c1c000.usb: EHCI Host Controller
[ 1.324844] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 2
[ 1.332692] ehci-platform 1c1c000.usb: irq 72, io mem 0x01c1c000
[ 1.354820] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[ 1.361081] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.367887] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.375112] usb usb2: Product: EHCI Host Controller
[ 1.379986] usb usb2: Manufacturer: Linux 3.18.27 ehci_hcd
[ 1.385477] usb usb2: SerialNumber: 1c1c000.usb
[ 1.390523] hub 2-0:1.0: USB hub found
[ 1.394309] hub 2-0:1.0: 1 port detected
[ 1.398857] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[ 1.405533] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 3
[ 1.413408] ohci-platform 1c14400.usb: irq 96, io mem 0x01c14400
[ 1.478981] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.485792] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.493007] usb usb3: Product: Generic Platform OHCI controller
[ 1.498939] usb usb3: Manufacturer: Linux 3.18.27 ohci_hcd
[ 1.504421] usb usb3: SerialNumber: 1c14400.usb
[ 1.509491] hub 3-0:1.0: USB hub found
[ 1.513279] hub 3-0:1.0: 1 port detected
[ 1.517834] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[ 1.524498] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 4
[ 1.532394] ohci-platform 1c1c400.usb: irq 97, io mem 0x01c1c400
[ 1.598987] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.605795] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.613011] usb usb4: Product: Generic Platform OHCI controller
[ 1.618944] usb usb4: Manufacturer: Linux 3.18.27 ohci_hcd
[ 1.624424] usb usb4: SerialNumber: 1c1c400.usb
[ 1.629485] hub 4-0:1.0: USB hub found
[ 1.633271] hub 4-0:1.0: 1 port detected
[ 1.637643] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 1.648663] vcc5v0: disabling
[ 1.651652] vcc3v0: disabling
[ 1.656923] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.665773] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 1.682643] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
[ 1.690223] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.697279] Freeing unused kernel memory: 208K (c04fa000 - c052e000)
[ 1.798252] init: Console is alive
[ 1.801965] init: - watchdog -
[ 2.806040] init: - preinit -
Detected bananapi // LeMaker Banana Pi
[ 2.879685] random: mktemp urandom read with 4 bits of entropy available
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 5.942575] mount_root: mounting /dev/root
[ 5.947358] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
[ 5.959410] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 5.984762] procd: - early -
[ 5.987972] procd: - watchdog -
[ 6.735933] procd: - ubus -
[ 7.745771] procd: - init -
Please press Enter to activate this console.
[ 8.358225] NET: Registered protocol family 10
[ 8.366943] tun: Universal TUN/TAP device driver, 1.6
[ 8.372026] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[ 8.381799] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 8.398985] batman_adv: B.A.T.M.A.N. advanced 2016.0 (compatibility version 15) loaded
[ 8.411746] sunxi-rtc 1c20d00.rtc: rtc core: registered rtc-sunxi as rtc0
[ 8.418711] sunxi-rtc 1c20d00.rtc: RTC enabled
[ 8.429943] u32 classifier
[ 8.432672] input device check on
[ 8.436488] Actions configured
[ 8.441213] Mirror/redirect action on
[ 8.479821] Ebtables v2.0 registered
[ 8.485662] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 8.499934] nf_conntrack version 0.5.0 (16021 buckets, 64084 max)
[ 8.591017] xt_time: kernel timezone is -0000
[ 12.041736] RX IPC Checksum Offload disabled
[ 12.049093] No MAC Management Counters available
[ 12.068605] device eth0.3 entered promiscuous mode
[ 12.073433] device eth0 entered promiscuous mode
[ 12.086656] br-client: port 1(eth0.3) entered forwarding state
[ 12.092607] br-client: port 1(eth0.3) entered forwarding state
[ 12.108459] device eth0.2 entered promiscuous mode
[ 12.135938] br-wan: port 1(eth0.2) entered forwarding state
[ 12.141555] br-wan: port 1(eth0.2) entered forwarding state
[ 12.202680] device br-client entered promiscuous mode
[ 12.438516] batman_adv: bat0: Adding interface: eth0.101
[ 12.443871] batman_adv: bat0: Interface activated: eth0.101
[ 12.492743] batman_adv: bat0: Adding interface: eth0.100
[ 12.498191] batman_adv: bat0: Interface activated: eth0.100
[ 12.504395] batman_adv: bat0: Adding interface: eth0.102
[ 12.509766] batman_adv: bat0: Interface activated: eth0.102
[ 12.515948] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.530593] 8021q: adding VLAN 0 to HW filter on device bat0
[ 12.538142] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.546165] batman_adv: bat0: no_rebroadcast: Changing from: disabled to: enabled
[ 12.556298] device bat0 entered promiscuous mode
[ 12.560980] br-client: port 2(bat0) entered forwarding state
[ 12.566766] br-client: port 2(bat0) entered forwarding state
[ 13.111428] batman_adv: bat0: Changing gw mode from: off to: client
[ 13.118621] batman_adv: bat0: gw_sel_class: Changing from: 20 to: 15
[ 13.125833] batman_adv: bat0: hop_penalty: Changing from: 30 to: 15
[ 13.133850] batman_adv: bat0: multicast_mode: Changing from: enabled to: disabled
[ 13.144378] batman_adv: bat0: orig_interval: Changing from: 1000 to: 5000
[ 14.055562] br-wan: port 1(eth0.2) entered disabled state
[ 14.062080] br-client: port 1(eth0.3) entered disabled state
[ 14.097557] batman_adv: bat0: Interface deactivated: eth0.100
[ 14.103345] batman_adv: bat0: Removing interface: eth0.100
[ 14.122078] batman_adv: bat0: Interface deactivated: eth0.102
[ 14.128006] batman_adv: bat0: Removing interface: eth0.102
[ 14.136070] batman_adv: bat0: Interface deactivated: eth0.101
[ 14.142480] batman_adv: bat0: Removing interface: eth0.101
[ 14.148901] tried to remove device eth0 from br-client
[ 14.154079] ------------[ cut here ]------------
[ 14.158717] kernel BUG at net/core/dev.c:4981!
[ 14.163187] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[ 14.169023] Modules linked in: iptable_nat nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipts
[ 14.266446] CPU: 0 PID: 1583 Comm: batadv.sh Not tainted 3.18.27 #1
[ 14.272712] task: edd49980 ti: eddac000 task.ti: eddac000
[ 14.278116] PC is at __netdev_adjacent_dev_remove+0x64/0x124
[ 14.283773] LR is at irq_work_queue+0x14/0xd4
[ 14.288128] pc : [<c032bbb8>] lr : [<c0083b60>] psr: 60000013
[ 14.288128] sp : eddade18 ip : 00000007 fp : eddade34
[ 14.299589] r10: edd79500 r9 : ee3db000 r8 : ee3db068
[ 14.304808] r7 : eebd8000 r6 : eea86000 r5 : eebd8060 r4 : eebd8054
[ 14.311325] r3 : 00000000 r2 : 00000001 r1 : 00000000 r0 : 0000002a
[ 14.317845] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 14.324972] Control: 10c5387d Table: 6de5006a DAC: 00000015
[ 14.330710] Process batadv.sh (pid: 1583, stack limit = 0xeddac238)
[ 14.336968] Stack: (0xeddade18 to 0xeddae000)
[ 14.341322] de00: eebd8000 eea86000
[ 14.349493] de20: edd79060 edd79000 eddade4c eddade38 c032bc94 c032bb60 edd6fa80 ee3c7c40
[ 14.357663] de40: eddade7c eddade50 c032bd5c c032bc84 00000001 ee38e400 ee38e400 ee38e400
[ 14.365834] de60: edd79000 00000001 bf0b6868 ee343480 eddadebc eddade80 bf0a4514 c032bcf0
[ 14.374003] de80: ee343480 edd79000 eddadeac bf0b6868 c000f80c ee38e400 ee343080 00000005
[ 14.382172] dea0: 00000000 00000005 ee343480 ee34348c eddadedc eddadec0 bf0adfec bf0a42f4
[ 14.390342] dec0: ee343080 00000000 ee343080 eddadf78 eddadeec eddadee0 c01cb49c bf0adefc
[ 14.398512] dee0: eddadf04 eddadef0 c0127d0c c01cb48c c0127cc8 00000000 eddadf3c eddadf08
[ 14.406681] df00: c01275a0 c0127cd4 00000000 00000000 eddadf3c eddac000 008ad610 ee00b6c0
[ 14.414851] df20: 00000005 eddadf78 008ad610 00000000 eddadf74 eddadf40 c00c827c c0127498
[ 14.423021] df40: eddadfa4 eddadf50 c0026498 00000000 00000000 ee00b6c0 ee00b6c0 00000005
[ 14.431190] df60: 008ad610 00000000 eddadfa4 eddadf78 c00c8818 c00c81d0 00000000 00000000
[ 14.439360] df80: 00081b10 00000001 008ad610 00000004 c0008fa4 eddac000 00000000 eddadfa8
[ 14.447529] dfa0: c0008e00 c00c87e0 00081b10 00000001 00000001 008ad610 00000005 00000000
[ 14.455699] dfc0: 00081b10 00000001 008ad610 00000004 008bfde0 00000020 00000002 008ab008
[ 14.463869] dfe0: 00000005 bece2298 00018c98 b6f100ec 60000010 00000001 00000000 00000000
[ 14.472031] Backtrace:
[ 14.474496] [<c032bb54>] (__netdev_adjacent_dev_remove) from [<c032bc94>] (__netdev_adjacent_dev_unlink+0)
[ 14.484827] r7:edd79000 r6:edd79060 r5:eea86000 r4:eebd8000
[ 14.490537] [<c032bc78>] (__netdev_adjacent_dev_unlink) from [<c032bd5c>] (netdev_upper_dev_unlink+0x78/0)
[ 14.500521] r5:ee3c7c40 r4:edd6fa80
[ 14.504154] [<c032bce4>] (netdev_upper_dev_unlink) from [<bf0a4514>] (batadv_hardif_disable_interface+0x2)
[ 14.515612] r9:ee343480 r8:bf0b6868 r7:00000001 r6:edd79000 r5:ee38e400 r4:ee38e400
[ 14.523437] [<bf0a42e8>] (batadv_hardif_disable_interface [batman_adv]) from [<bf0adfec>] (batadv_store_m)
[ 14.535934] r10:ee34348c r9:ee343480 r8:00000005 r7:00000000 r6:00000005 r5:ee343080
[ 14.543817] r4:ee38e400
[ 14.546379] [<bf0adef0>] (batadv_store_mesh_iface [batman_adv]) from [<c01cb49c>] (kobj_attr_store+0x1c/0)
[ 14.556277] r7:eddadf78 r6:ee343080 r5:00000000 r4:ee343080
[ 14.561986] [<c01cb480>] (kobj_attr_store) from [<c0127d0c>] (sysfs_kf_write+0x44/0x50)
[ 14.569984] [<c0127cc8>] (sysfs_kf_write) from [<c01275a0>] (kernfs_fop_write+0x114/0x18c)
[ 14.578233] r4:00000000 r3:c0127cc8
[ 14.581836] [<c012748c>] (kernfs_fop_write) from [<c00c827c>] (vfs_write+0xb8/0x1d0)
[ 14.589566] r10:00000000 r9:008ad610 r8:eddadf78 r7:00000005 r6:ee00b6c0 r5:008ad610
[ 14.597448] r4:eddac000
[ 14.599996] [<c00c81c4>] (vfs_write) from [<c00c8818>] (SyS_write+0x44/0x84)
[ 14.607032] r10:00000000 r9:008ad610 r8:00000005 r7:ee00b6c0 r6:ee00b6c0 r5:00000000
[ 14.614912] r4:00000000
[ 14.617462] [<c00c87d4>] (SyS_write) from [<c0008e00>] (ret_fast_syscall+0x0/0x38)
[ 14.625020] r9:eddac000 r8:c0008fa4 r7:00000004 r6:008ad610 r5:00000001 r4:00081b10
[ 14.632819] Code: e1a01007 e1a02006 e34c004c ebf4a2c5 (e7f001f2)
[ 14.638910] ---[ end trace 2d4f0cd805c0b722 ]---
[ 14.643947] br-client: port 2(bat0) entered forwarding state
[ 17.025141] stmmaceth 1c50000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 72.904982] random: nonblocking pool is initialized
BusyBox v1.23.2 (2016-03-08 21:57:19 CET) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
CHAOS CALMER (Chaos Calmer, r48900)
-----------------------------------------------------
* 1 1/2 oz Gin Shake with a glassful
* 1/4 oz Triple Sec of broken ice and pour
* 3/4 oz Lime Juice unstrained into a goblet.
* 1 1/2 oz Orange Juice
* 1 tsp. Grenadine Syrup
-----------------------------------------------------
root@0216088335f8:/#
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH RFC 3/9] net: Add fast receive encapsulation
From: David Miller @ 2016-03-25 20:40 UTC (permalink / raw)
To: tom; +Cc: netdev, kernel-team
In-Reply-To: <1458772618-845742-4-git-send-email-tom@herbertland.com>
From: Tom Herbert <tom@herbertland.com>
Date: Wed, 23 Mar 2016 15:36:52 -0700
> +{
> + struct udp_sock *up = udp_sk(sk);
> + int is_udplite = IS_UDPLITE(sk);
> +
> + int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
> +
Small nit, please put this encap_rcv function pointer declaration at
the top of the local variable list.
^ permalink raw reply
* Re: [PATCH] ip.7: Fix incorrect sockopt name
From: Michael Kerrisk (man-pages) @ 2016-03-25 19:36 UTC (permalink / raw)
To: Benjamin Poirier
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
Radek Pazdera
In-Reply-To: <1458592124-6208-1-git-send-email-bpoirier-IBi9RG/b67k@public.gmane.org>
Hello Benjamin,
On 03/22/2016 09:28 AM, Benjamin Poirier wrote:
> "IP_LEAVE_GROUP" does not exist. It was perhaps a confusion with
> MCAST_LEAVE_GROUP. Change the text to IP_DROP_MEMBERSHIP which has the same
> function as MCAST_LEAVE_GROUP and is documented in the ip.7 man page.
>
> Reference:
> Linux kernel net/ipv4/ip_sockglue.c do_ip_setsockopt()
Thanks! Applied.
Cheers,
Michael
> Cc: Radek Pazdera <rpazdera-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Benjamin Poirier <bpoirier-IBi9RG/b67k@public.gmane.org>
> ---
> man7/ip.7 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man7/ip.7 b/man7/ip.7
> index 3905573..37e2c86 100644
> --- a/man7/ip.7
> +++ b/man7/ip.7
> @@ -376,7 +376,7 @@ a given multicast group that come from a given source.
> If the application has subscribed to multiple sources within
> the same group, data from the remaining sources will still be delivered.
> To stop receiving data from all sources at once, use
> -.BR IP_LEAVE_GROUP .
> +.BR IP_DROP_MEMBERSHIP .
> .IP
> Argument is an
> .I ip_mreq_source
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup()
From: David Miller @ 2016-03-25 19:16 UTC (permalink / raw)
To: helgaas; +Cc: nhorman, bhelgaas, nikolay, netdev, aduyck, linux-kernel
In-Reply-To: <20160325164639.GA29822@localhost>
From: Bjorn Helgaas <helgaas@kernel.org>
Date: Fri, 25 Mar 2016 11:46:39 -0500
> You're right, there is an issue here. I reproduced a problem with a
> bond device. bond_netpoll_setup() calls __netpoll_setup() directly
> (not netpoll_setup()). I'll debug it more; just wanted to let you
> know there *is* a problem with this patch.
I bet that's why the assignment to np->dev and the reference counting
were separated in the first place :-/
Indeed, commit 30fdd8a082a00126a6feec994e43e8dc12f5bccb:
commit 30fdd8a082a00126a6feec994e43e8dc12f5bccb
Author: Jiri Pirko <jiri@resnulli.us>
Date: Tue Jul 17 05:22:35 2012 +0000
netpoll: move np->dev and np->dev_name init into __netpoll_setup()
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH net-next] net: dsa: mv88e6xxx: fix 6185 hardware bridging
From: David Miller @ 2016-03-25 19:01 UTC (permalink / raw)
To: vivien.didelot; +Cc: netdev, linux-kernel, kernel, andrew
In-Reply-To: <87r3eyscdd.fsf@ketchup.mtl.sfl>
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Fri, 25 Mar 2016 13:20:30 -0400
> David, please ignore this patch for the moment.
Ok.
^ permalink raw reply
* Re: veth regression with "don’t modify ip_summed; doing so treats packets with bad checksums as good."
From: David Miller @ 2016-03-25 19:00 UTC (permalink / raw)
To: greearb; +Cc: xiyou.wangcong, vijayp, netdev, ej, cwang, tom
In-Reply-To: <56F57206.5000701@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Date: Fri, 25 Mar 2016 10:14:46 -0700
> Anyway, you know the stack and drivers better than me, so if you
> think Cong's patch is valid, then I'll test it and make sure it
> works in my setups at least.
It probably is, I'm just waiting to see if Tom Herbert will give
some feedback or not as this is an area he understands well.
^ permalink raw reply
* Re: [PATCH 1/1] net: Add SO_REUSEPORT_LISTEN_OFF socket option as drain mode
From: Willem de Bruijn @ 2016-03-25 18:31 UTC (permalink / raw)
To: Eric Dumazet
Cc: Craig Gallek, Linux Kernel Network Developers, Alexei Starovoitov
In-Reply-To: <1458925242.6473.41.camel@edumazet-glaptop3.roam.corp.google.com>
On Fri, Mar 25, 2016 at 1:00 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2016-03-25 at 12:31 -0400, Craig Gallek wrote:
>
>> I believe the issue here is that closing the listen sockets will drop
>> any connections that are in the listen queue but have not been
>> accepted yet. In the case of reuseport, you could in theory drain
>> those queues into the non-closed sockets, but that probably has some
>> interesting consequences...
>
> It is more complicated than this.
>
> Ideally, no TCP connection should be dropped during a server change.
>
> The idea is to let old program running as long as :
> 1) It has established TCP sessions
> 2) Some SYN_RECV pseudo requests are still around
>
> Once 3WHS completes for these SYN_RECV, children are queued into
> listener accept queues.
>
> But the idea is to direct all new SYN packets to the 'new' process and
> its listeners. (New SYN_RECV should be created on behalf on the new
> listeners only)
>
>
> In some environments, the listeners are simply transfered via FD
> passing, from the 'old process' to the new one.
Right. Comparatively, one of the nice features of the BPF variant is
that the sockets in the old process can passively enter listen_off
state solely with changes initiated by the new process (change the bpf
filter for the group).
By the way, if I read correctly, the listen_off feature was already
possible without kernel changes prior to fast reuseport by changing
SO_BINDTODEVICE on the old process's sockets to effectively segment
them into a separate reuseport group. With fast reuseport,
sk_bound_dev_if state equivalence is checked on joining a group, but
the socket is not removed from the array when that syscall is made, so
this does not work.
^ permalink raw reply
* Re: netpoll rtnl_dereference() usage
From: Neil Horman @ 2016-03-25 18:16 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: David S. Miller, Nikolay Aleksandrov, netdev, Alexander Duyck,
linux-kernel
In-Reply-To: <20160325173032.GC29822@localhost>
On Fri, Mar 25, 2016 at 12:30:32PM -0500, Bjorn Helgaas wrote:
> Hi Neil,
>
> Since we're looking at netpoll, here's another question (or two).
> 0790bbb68f9d ("netpoll: cleanup sparse warnings") adds this:
>
> @@ -1236,7 +1236,11 @@ void __netpoll_cleanup(struct netpoll *np)
> struct netpoll_info *npinfo;
> unsigned long flags;
>
> - npinfo = np->dev->npinfo;
> + /* rtnl_dereference would be preferable here but
> + * rcu_cleanup_netpoll path can put us in here safely without
> + * holding the rtnl, so plain rcu_dereference it is
> + */
> + npinfo = rtnl_dereference(np->dev->npinfo);
> if (!npinfo)
> return;
>
> The comment seems to contradict the code: the comment says "we would
> like to use rtnl_dereference(), but we have to use rcu_dereference()."
> But the code in fact *does* use rtnl_dereference().
>
its the comment that went awry. I remember writing that patch, and I initially
thought we had to use rcu_derefence there, but I would up finding a way to keep
the rntl lock held, so rtnl_deref should be ok. I must have just forgotten to
fixup the comment.
> Also, "rcu_cleanup_netpoll" doesn't exist; maybe it's a typo for
> rcu_cleanup_netpoll_info()? I don't see the path that leads from
> rcu_cleanup_netpoll_info() to __netpoll_cleanup(), but I don't claim
> to understand the netpoll async subtleties.
>
Correct again, its the rcu callback rcu_cleanup_netpoll_info that I'm referring
to there, and the comment was written initially when rcu_cleanup_netpoll info
was called cleanup_netpoll_info and called forward into __netpoll_cleanup (in my
development patch versions). That comment should really just be re-written.
I'm happy to do so if you like
Best
Neil
> Bjorn
^ permalink raw reply
* Re: [RFT Patch net 1/2] ipv6: invalidate the socket cached route on pmtu events if possible
From: Eric Dumazet @ 2016-03-25 18:11 UTC (permalink / raw)
To: Cong Wang
Cc: Linux Kernel Network Developers, Wei Wang, Steffen Klassert,
Martin KaFai Lau, Hannes Frederic Sowa, Julian Anastasov
In-Reply-To: <CAM_iQpUUhMNjx6=-5HCJvJepLstFR2UQHSBb-q3RZcYaOJ6pbg@mail.gmail.com>
On Fri, 2016-03-25 at 10:17 -0700, Cong Wang wrote:
> 1) sock lock protects the whole update: the whole check, update, recheck,
> set logic, to make sure another CPU will not do the same to the same socket
> at the same time.
>
> 2) the dst itself is safe, because it is always refcounted, and we use xchg()
> to change the pointer in sk_dst_cache.
>
> Or am I still missing anything here?
As TCP always lock the socket before doing its heavy stuff,
it can use a variant of sk_dst_cache manipulations that do not use extra
atomic operations.
But UDP gets xchg() to safely exchange sk_dst_cache, because we do not
feel locking the socket is needed for UDP for typical uses (! cork)
If you hold the socket lock in ICMP handler, then it would be
inconsistent with udp sendmsg() where we do not hold the socket lock.
Since I believe udp sendmsg() is fine, I do believe you do not need to
lock the socket, and then care about socket being owned by the user.
^ permalink raw reply
* netpoll rtnl_dereference() usage
From: Bjorn Helgaas @ 2016-03-25 17:30 UTC (permalink / raw)
To: Neil Horman
Cc: David S. Miller, Nikolay Aleksandrov, netdev, Alexander Duyck,
linux-kernel
Hi Neil,
Since we're looking at netpoll, here's another question (or two).
0790bbb68f9d ("netpoll: cleanup sparse warnings") adds this:
@@ -1236,7 +1236,11 @@ void __netpoll_cleanup(struct netpoll *np)
struct netpoll_info *npinfo;
unsigned long flags;
- npinfo = np->dev->npinfo;
+ /* rtnl_dereference would be preferable here but
+ * rcu_cleanup_netpoll path can put us in here safely without
+ * holding the rtnl, so plain rcu_dereference it is
+ */
+ npinfo = rtnl_dereference(np->dev->npinfo);
if (!npinfo)
return;
The comment seems to contradict the code: the comment says "we would
like to use rtnl_dereference(), but we have to use rcu_dereference()."
But the code in fact *does* use rtnl_dereference().
Also, "rcu_cleanup_netpoll" doesn't exist; maybe it's a typo for
rcu_cleanup_netpoll_info()? I don't see the path that leads from
rcu_cleanup_netpoll_info() to __netpoll_cleanup(), but I don't claim
to understand the netpoll async subtleties.
Bjorn
^ 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