* Re: [PATCH] ipv6: fix null pointer dereference in __ip6addrlbl_add
From: Michele Baldessari @ 2013-09-03 8:04 UTC (permalink / raw)
To: netdev, Hideaki YOSHIFUJI, David S. Miller, Sasha Levin
In-Reply-To: <20130903001331.GA8820@order.stressinduktion.org>
Hi Hannes,
On Tue, Sep 03, 2013 at 02:13:31AM +0200, Hannes Frederic Sowa wrote:
> On Mon, Sep 02, 2013 at 10:31:28PM +0100, Michele Baldessari wrote:
> > with the latest linux master git tree from Linus
> > (248d296d6d9df384996c2ed95676b367d876d48c - 2 Sep) I can reproduceably oops
> > the kernel with the following commands:
> > ip addrlabel flush
> > ip addrlabel add prefix ::1/128 label 0
> > ip addrlabel add prefix ::/0 label 1
>
> Thanks for the report! This patch should fix this issue:
>
> [PATCH] ipv6: fix null pointer dereference in __ip6addrlbl_add
>
> Commit b67bfe0d42cac56c512dd5da4b1b347a23f4b70a ("hlist: drop
> the node parameter from iterators") changed the behavior of
> hlist_for_each_entry_safe to leave the p argument NULL.
>
> Fix this up by tracking the last argument.
>
> Reported-by: Michele Baldessari <michele@acksyn.org>
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> Cc: Sasha Levin <sasha.levin@oracle.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Thanks for the patch, fixes it for me.
Tested-by: Michele Baldessari <michele@acksyn.org>
^ permalink raw reply
* [PATCH net-next 8/8] net: ipv6: mld: document force_mld_version in ip-sysctl.txt
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
Document force_mld_version parameter in ip-sysctl.txt.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
Documentation/networking/ip-sysctl.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 1cb3aeb..a46d785 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1358,6 +1358,11 @@ mldv2_unsolicited_report_interval - INTEGER
MLDv2 report retransmit will take place.
Default: 1000 (1 second)
+force_mld_version - INTEGER
+ 0 - (default) No enforcement of a MLD version, MLDv1 fallback allowed
+ 1 - Enforce to use MLD version 1
+ 2 - Enforce to use MLD version 2
+
suppress_frag_ndisc - INTEGER
Control RFC 6980 (Security Implications of IPv6 Fragmentation
with IPv6 Neighbor Discovery) behavior:
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 7/8] net: ipv6: mld: introduce mld_{gq,ifc,dad}_stop_timer functions
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
We already have mld_{gq,ifc,dad}_start_timer() functions, so introduce
mld_{gq,ifc,dad}_stop_timer() functions to reduce code size and make it
more readable.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/mcast.c | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index b01aa32..a43028d 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1006,6 +1006,13 @@ static void mld_gq_start_timer(struct inet6_dev *idev)
in6_dev_hold(idev);
}
+static void mld_gq_stop_timer(struct inet6_dev *idev)
+{
+ idev->mc_gq_running = 0;
+ if (del_timer(&idev->mc_gq_timer))
+ __in6_dev_put(idev);
+}
+
static void mld_ifc_start_timer(struct inet6_dev *idev, unsigned long delay)
{
unsigned long tv = net_random() % delay;
@@ -1014,6 +1021,13 @@ static void mld_ifc_start_timer(struct inet6_dev *idev, unsigned long delay)
in6_dev_hold(idev);
}
+static void mld_ifc_stop_timer(struct inet6_dev *idev)
+{
+ idev->mc_ifc_count = 0;
+ if (del_timer(&idev->mc_ifc_timer))
+ __in6_dev_put(idev);
+}
+
static void mld_dad_start_timer(struct inet6_dev *idev, unsigned long delay)
{
unsigned long tv = net_random() % delay;
@@ -1022,6 +1036,12 @@ static void mld_dad_start_timer(struct inet6_dev *idev, unsigned long delay)
in6_dev_hold(idev);
}
+static void mld_dad_stop_timer(struct inet6_dev *idev)
+{
+ if (del_timer(&idev->mc_dad_timer))
+ __in6_dev_put(idev);
+}
+
/*
* IGMP handling (alias multicast ICMPv6 messages)
*/
@@ -1223,15 +1243,9 @@ static int mld_process_v1(struct inet6_dev *idev, struct mld_msg *mld,
mld_set_v1_mode(idev);
/* cancel MLDv2 report timer */
- idev->mc_gq_running = 0;
- if (del_timer(&idev->mc_gq_timer))
- __in6_dev_put(idev);
-
+ mld_gq_stop_timer(idev);
/* cancel the interface change timer */
- idev->mc_ifc_count = 0;
- if (del_timer(&idev->mc_ifc_timer))
- __in6_dev_put(idev);
-
+ mld_ifc_stop_timer(idev);
/* clear deleted report items */
mld_clear_delrec(idev);
@@ -2423,14 +2437,9 @@ void ipv6_mc_down(struct inet6_dev *idev)
/* Withdraw multicast list */
read_lock_bh(&idev->lock);
- idev->mc_ifc_count = 0;
- if (del_timer(&idev->mc_ifc_timer))
- __in6_dev_put(idev);
- idev->mc_gq_running = 0;
- if (del_timer(&idev->mc_gq_timer))
- __in6_dev_put(idev);
- if (del_timer(&idev->mc_dad_timer))
- __in6_dev_put(idev);
+ mld_ifc_stop_timer(idev);
+ mld_gq_stop_timer(idev);
+ mld_dad_stop_timer(idev);
for (i = idev->mc_list; i; i=i->next)
igmp6_group_dropped(i);
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 6/8] net: ipv6: mld: refactor query processing into v1/v2 functions
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
Make igmp6_event_query() a bit easier to read by refactoring code
parts into mld_process_v1() and mld_process_v2().
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/mcast.c | 89 +++++++++++++++++++++++++++++++++++---------------------
1 file changed, 56 insertions(+), 33 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 75a4324..b01aa32 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1207,6 +1207,55 @@ static void mld_update_qri(struct inet6_dev *idev,
idev->mc_qri = msecs_to_jiffies(mldv2_mrc(mlh2));
}
+static int mld_process_v1(struct inet6_dev *idev, struct mld_msg *mld,
+ unsigned long *max_delay)
+{
+ unsigned long mldv1_md;
+
+ /* Ignore v1 queries */
+ if (mld_in_v2_mode_only(idev))
+ return -EINVAL;
+
+ /* MLDv1 router present */
+ mldv1_md = ntohs(mld->mld_maxdelay);
+ *max_delay = max(msecs_to_jiffies(mldv1_md), 1UL);
+
+ mld_set_v1_mode(idev);
+
+ /* cancel MLDv2 report timer */
+ idev->mc_gq_running = 0;
+ if (del_timer(&idev->mc_gq_timer))
+ __in6_dev_put(idev);
+
+ /* cancel the interface change timer */
+ idev->mc_ifc_count = 0;
+ if (del_timer(&idev->mc_ifc_timer))
+ __in6_dev_put(idev);
+
+ /* clear deleted report items */
+ mld_clear_delrec(idev);
+
+ return 0;
+}
+
+static int mld_process_v2(struct inet6_dev *idev, struct mld2_query *mld,
+ unsigned long *max_delay)
+{
+ /* hosts need to stay in MLDv1 mode, discard MLDv2 queries */
+ if (mld_in_v1_mode(idev))
+ return -EINVAL;
+
+ *max_delay = max(msecs_to_jiffies(mldv2_mrc(mld)), 1UL);
+
+ mld_update_qrv(idev, mld);
+ mld_update_qi(idev, mld);
+ mld_update_qri(idev, mld);
+
+ idev->mc_maxdelay = *max_delay;
+
+ return 0;
+}
+
/* called with rcu_read_lock() */
int igmp6_event_query(struct sk_buff *skb)
{
@@ -1218,7 +1267,7 @@ int igmp6_event_query(struct sk_buff *skb)
struct mld_msg *mld;
int group_type;
int mark = 0;
- int len;
+ int len, err;
if (!pskb_may_pull(skb, sizeof(struct in6_addr)))
return -EINVAL;
@@ -1244,47 +1293,21 @@ int igmp6_event_query(struct sk_buff *skb)
return -EINVAL;
if (len == MLD_V1_QUERY_LEN) {
- unsigned long mldv1_md;
-
- /* Ignore v1 queries */
- if (mld_in_v2_mode_only(idev))
- return 0;
-
- /* MLDv1 router present */
- mldv1_md = ntohs(mld->mld_maxdelay);
- max_delay = max(msecs_to_jiffies(mldv1_md), 1UL);
-
- mld_set_v1_mode(idev);
-
- /* cancel MLDv2 report timer */
- idev->mc_gq_running = 0;
- if (del_timer(&idev->mc_gq_timer))
- __in6_dev_put(idev);
-
- /* cancel the interface change timer */
- idev->mc_ifc_count = 0;
- if (del_timer(&idev->mc_ifc_timer))
- __in6_dev_put(idev);
- /* clear deleted report items */
- mld_clear_delrec(idev);
+ err = mld_process_v1(idev, mld, &max_delay);
+ if (err < 0)
+ return err;
} else if (len >= MLD_V2_QUERY_LEN_MIN) {
int srcs_offset = sizeof(struct mld2_query) -
sizeof(struct icmp6hdr);
- /* hosts need to stay in MLDv1 mode, discard MLDv2 queries */
- if (mld_in_v1_mode(idev))
- return 0;
if (!pskb_may_pull(skb, srcs_offset))
return -EINVAL;
mlh2 = (struct mld2_query *)skb_transport_header(skb);
- max_delay = max(msecs_to_jiffies(mldv2_mrc(mlh2)), 1UL);
- idev->mc_maxdelay = max_delay;
-
- mld_update_qrv(idev, mlh2);
- mld_update_qi(idev, mlh2);
- mld_update_qri(idev, mlh2);
+ err = mld_process_v2(idev, mlh2, &max_delay);
+ if (err < 0)
+ return err;
if (group_type == IPV6_ADDR_ANY) { /* general query */
if (mlh2->mld2q_nsrcs)
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 5/8] net: ipv6: mld: similarly to MLDv2 have min max_delay of 1
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
Similarly as we do in MLDv2 queries, set a forged MLDv1 query with
0 ms mld_maxdelay to minimum timer shot time of 1 jiffies. This is
eventually done in igmp6_group_queried() anyway, so we can simplify
a check there.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/mcast.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 02cd0c5..75a4324 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1040,12 +1040,9 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
delay = ma->mca_timer.expires - jiffies;
}
- if (delay >= resptime) {
- if (resptime)
- delay = net_random() % resptime;
- else
- delay = 1;
- }
+ if (delay >= resptime)
+ delay = net_random() % resptime;
+
ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt);
@@ -1247,12 +1244,15 @@ int igmp6_event_query(struct sk_buff *skb)
return -EINVAL;
if (len == MLD_V1_QUERY_LEN) {
+ unsigned long mldv1_md;
+
/* Ignore v1 queries */
if (mld_in_v2_mode_only(idev))
return 0;
/* MLDv1 router present */
- max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay));
+ mldv1_md = ntohs(mld->mld_maxdelay);
+ max_delay = max(msecs_to_jiffies(mldv1_md), 1UL);
mld_set_v1_mode(idev);
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 4/8] net: ipv6: mld: implement RFC3810 MLDv2 mode only
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
RFC3810, 10. Security Considerations says under subsection 10.1.
Query Message:
A forged Version 1 Query message will put MLDv2 listeners on that
link in MLDv1 Host Compatibility Mode. This scenario can be avoided
by providing MLDv2 hosts with a configuration option to ignore
Version 1 messages completely.
Hence, implement a MLDv2-only mode that will ignore MLDv1 traffic:
echo 2 > /proc/sys/net/ipv6/conf/ethX/force_mld_version
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/mcast.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 005b22f..02cd0c5 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1112,9 +1112,21 @@ static bool mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
return true;
}
+static bool mld_in_v2_mode_only(const struct inet6_dev *idev)
+{
+ return dev_net(idev->dev)->ipv6.devconf_all->force_mld_version == 2;
+}
+
+static bool mld_in_v1_mode_only(const struct inet6_dev *idev)
+{
+ return dev_net(idev->dev)->ipv6.devconf_all->force_mld_version == 1;
+}
+
static bool mld_in_v1_mode(const struct inet6_dev *idev)
{
- if (dev_net(idev->dev)->ipv6.devconf_all->force_mld_version == 1)
+ if (mld_in_v2_mode_only(idev))
+ return false;
+ if (mld_in_v1_mode_only(idev))
return true;
if (idev->cnf.force_mld_version == 1)
return true;
@@ -1223,7 +1235,6 @@ int igmp6_event_query(struct sk_buff *skb)
return -EINVAL;
idev = __in6_dev_get(skb->dev);
-
if (idev == NULL)
return 0;
@@ -1236,6 +1247,10 @@ int igmp6_event_query(struct sk_buff *skb)
return -EINVAL;
if (len == MLD_V1_QUERY_LEN) {
+ /* Ignore v1 queries */
+ if (mld_in_v2_mode_only(idev))
+ return 0;
+
/* MLDv1 router present */
max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay));
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 3/8] net: ipv6: mld: get rid of MLDV2_MRC and simplify calculation
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
Get rid of MLDV2_MRC and use our new macros for mantisse and
exponent to calculate Maximum Response Delay out of the Maximum
Response Code.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
This will give a merge conflict in net/bridge/br_multicast.c with net tree. You can
resolve it by simply taking this version as we already do msecs_to_jiffies() here.
include/net/mld.h | 28 +++++++++++++++++++---------
net/bridge/br_multicast.c | 3 ++-
net/ipv6/mcast.c | 18 ++----------------
3 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/include/net/mld.h b/include/net/mld.h
index 2b5421f..faa1d16 100644
--- a/include/net/mld.h
+++ b/include/net/mld.h
@@ -63,15 +63,6 @@ struct mld2_query {
#define mld2q_mrc mld2q_hdr.icmp6_maxdelay
#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1]
-/* Max Response Code, TODO: transform this to use the below */
-#define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
-#define MLDV2_EXP(thresh, nbmant, nbexp, value) \
- ((value) < (thresh) ? (value) : \
- ((MLDV2_MASK(value, nbmant) | (1<<(nbmant))) << \
- (MLDV2_MASK((value) >> (nbmant), nbexp) + (nbexp))))
-
-#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value)
-
/* RFC3810, 5.1.3. Maximum Response Code:
*
* If Maximum Response Code >= 32768, Maximum Response Code represents a
@@ -97,4 +88,23 @@ struct mld2_query {
#define MLDV2_QQIC_EXP(value) (((value) >> 4) & 0x07)
#define MLDV2_QQIC_MAN(value) ((value) & 0x0f)
+static inline unsigned long mldv2_mrc(const struct mld2_query *mlh2)
+{
+ /* RFC3810, 5.1.3. Maximum Response Code */
+ unsigned long ret, mc_mrc = ntohs(mlh2->mld2q_mrc);
+
+ if (mc_mrc < 32768) {
+ ret = mc_mrc;
+ } else {
+ unsigned long mc_man, mc_exp;
+
+ mc_exp = MLDV2_MRC_EXP(mc_mrc);
+ mc_man = MLDV2_MRC_MAN(mc_mrc);
+
+ ret = (mc_man | 0x1000) << (mc_exp + 3);
+ }
+
+ return ret;
+}
+
#endif
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 08e576a..4accd0d 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1203,7 +1203,8 @@ static int br_ip6_multicast_query(struct net_bridge *br,
mld2q = (struct mld2_query *)icmp6_hdr(skb);
if (!mld2q->mld2q_nsrcs)
group = &mld2q->mld2q_mca;
- max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
+
+ max_delay = max(msecs_to_jiffies(mldv2_mrc(mld2q)), 1UL);
}
br_multicast_query_received(br, port, !ipv6_addr_any(&ip6h->saddr),
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index f86e26b..005b22f 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1195,20 +1195,7 @@ static void mld_update_qri(struct inet6_dev *idev,
* - 5.1.3. Maximum Response Code
* - 9.3. Query Response Interval
*/
- unsigned long mc_qri, mc_mrc = ntohs(mlh2->mld2q_mrc);
-
- if (mc_mrc < 32768) {
- mc_qri = mc_mrc;
- } else {
- unsigned long mc_man, mc_exp;
-
- mc_exp = MLDV2_MRC_EXP(mc_mrc);
- mc_man = MLDV2_MRC_MAN(mc_mrc);
-
- mc_qri = (mc_man | 0x1000) << (mc_exp + 3);
- }
-
- idev->mc_qri = msecs_to_jiffies(mc_qri);
+ idev->mc_qri = msecs_to_jiffies(mldv2_mrc(mlh2));
}
/* called with rcu_read_lock() */
@@ -1277,8 +1264,7 @@ int igmp6_event_query(struct sk_buff *skb)
mlh2 = (struct mld2_query *)skb_transport_header(skb);
- max_delay = max(msecs_to_jiffies(MLDV2_MRC(ntohs(mlh2->mld2q_mrc))), 1UL);
-
+ max_delay = max(msecs_to_jiffies(mldv2_mrc(mlh2)), 1UL);
idev->mc_maxdelay = max_delay;
mld_update_qrv(idev, mlh2);
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 1/8] net: ipv6: mld: fix v1/v2 switchback timeout to rfc3810, 9.12.
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, David Stevens, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
i) RFC3810, 9.2. Query Interval [QI] says:
The Query Interval variable denotes the interval between General
Queries sent by the Querier. Default value: 125 seconds. [...]
ii) RFC3810, 9.3. Query Response Interval [QRI] says:
The Maximum Response Delay used to calculate the Maximum Response
Code inserted into the periodic General Queries. Default value:
10000 (10 seconds) [...] The number of seconds represented by the
[Query Response Interval] must be less than the [Query Interval].
iii) RFC3810, 9.12. Older Version Querier Present Timeout [OVQPT] says:
The Older Version Querier Present Timeout is the time-out for
transitioning a host back to MLDv2 Host Compatibility Mode. When an
MLDv1 query is received, MLDv2 hosts set their Older Version Querier
Present Timer to [Older Version Querier Present Timeout].
This value MUST be ([Robustness Variable] times (the [Query Interval]
in the last Query received)) plus ([Query Response Interval]).
Hence, on *default* the timeout results in:
[RV] = 2, [QI] = 125sec, [QRI] = 10sec
[OVQPT] = [RV] * [QI] + [QRI] = 260sec
Having that said, we currently calculate [OVQPT] (here given as 'switchback'
variable) as ...
switchback = (idev->mc_qrv + 1) * max_delay
RFC3810, 9.12. says "the [Query Interval] in the last Query received". In
section "9.14. Configuring timers", it is said:
This section is meant to provide advice to network administrators on
how to tune these settings to their network. Ambitious router
implementations might tune these settings dynamically based upon
changing characteristics of the network. [...]
iv) RFC38010, 9.14.2. Query Interval:
The overall level of periodic MLD traffic is inversely proportional
to the Query Interval. A longer Query Interval results in a lower
overall level of MLD traffic. The value of the Query Interval MUST
be equal to or greater than the Maximum Response Delay used to
calculate the Maximum Response Code inserted in General Query
messages.
I assume that was why switchback is calculated as is (3 * max_delay), although
this setting seems to be meant for routers only to configure their [QI]
interval for non-default intervals. So usage here like this is clearly wrong.
Concluding, the current behaviour in IPv6's multicast code is not conform
to the RFC as switch back is calculated wrongly. That is, it has a too small
value, so MLDv2 hosts switch back again to MLDv2 way too early, i.e. ~30secs
instead of ~260secs on default.
Hence, introduce necessary helper functions and fix this up properly as it
should be.
Introduced in 06da92283 ("[IPV6]: Add MLDv2 support."). Credits to Hannes
Frederic Sowa who also had a hand in this as well. Also thanks to Hangbin Liu
who did initial testing.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: David Stevens <dlstevens@us.ibm.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
06da92283 is linux-history tree.
include/net/if_inet6.h | 9 +++-
include/net/mld.h | 27 +++++++++++-
net/ipv6/mcast.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 143 insertions(+), 9 deletions(-)
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 736b5fb..02ef772 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -171,12 +171,17 @@ struct inet6_dev {
struct ifmcaddr6 *mc_list;
struct ifmcaddr6 *mc_tomb;
spinlock_t mc_lock;
- unsigned char mc_qrv;
+
+ unsigned char mc_qrv; /* Query Robustness Variable */
unsigned char mc_gq_running;
unsigned char mc_ifc_count;
unsigned char mc_dad_count;
- unsigned long mc_v1_seen;
+
+ unsigned long mc_v1_seen; /* Max time we stay in MLDv1 mode */
+ unsigned long mc_qi; /* Query Interval */
+ unsigned long mc_qri; /* Query Response Interval */
unsigned long mc_maxdelay;
+
struct timer_list mc_gq_timer; /* general query timer */
struct timer_list mc_ifc_timer; /* interface change timer */
struct timer_list mc_dad_timer; /* dad complete mc timer */
diff --git a/include/net/mld.h b/include/net/mld.h
index 467143c..2b5421f 100644
--- a/include/net/mld.h
+++ b/include/net/mld.h
@@ -63,7 +63,7 @@ struct mld2_query {
#define mld2q_mrc mld2q_hdr.icmp6_maxdelay
#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1]
-/* Max Response Code */
+/* Max Response Code, TODO: transform this to use the below */
#define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
#define MLDV2_EXP(thresh, nbmant, nbexp, value) \
((value) < (thresh) ? (value) : \
@@ -72,4 +72,29 @@ struct mld2_query {
#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value)
+/* RFC3810, 5.1.3. Maximum Response Code:
+ *
+ * If Maximum Response Code >= 32768, Maximum Response Code represents a
+ * floating-point value as follows:
+ *
+ * 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |1| exp | mant |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#define MLDV2_MRC_EXP(value) (((value) >> 12) & 0x0007)
+#define MLDV2_MRC_MAN(value) ((value) & 0x0fff)
+
+/* RFC3810, 5.1.9. QQIC (Querier's Query Interval Code):
+ *
+ * If QQIC >= 128, QQIC represents a floating-point value as follows:
+ *
+ * 0 1 2 3 4 5 6 7
+ * +-+-+-+-+-+-+-+-+
+ * |1| exp | mant |
+ * +-+-+-+-+-+-+-+-+
+ */
+#define MLDV2_QQIC_EXP(value) (((value) >> 4) & 0x07)
+#define MLDV2_QQIC_MAN(value) ((value) & 0x0f)
+
#endif
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 98ead2b..8992ff2 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -108,6 +108,10 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
struct inet6_dev *idev);
#define MLD_QRV_DEFAULT 2
+/* RFC3810, 9.2. Query Interval */
+#define MLD_QI_DEFAULT (125 * HZ)
+/* RFC3810, 9.3. Query Response Interval */
+#define MLD_QRI_DEFAULT (10 * HZ)
/* RFC3810, 8.1 Query Version Distinctions */
#define MLD_V1_QUERY_LEN 24
@@ -1112,6 +1116,93 @@ static bool mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
return true;
}
+static void mld_set_v1_mode(struct inet6_dev *idev)
+{
+ /* RFC3810, relevant sections:
+ * - 9.1. Robustness Variable
+ * - 9.2. Query Interval
+ * - 9.3. Query Response Interval
+ * - 9.12. Older Version Querier Present Timeout
+ */
+ unsigned long switchback;
+
+ switchback = (idev->mc_qrv * idev->mc_qi) + idev->mc_qri;
+
+ idev->mc_v1_seen = jiffies + switchback;
+}
+
+static void mld_update_qrv(struct inet6_dev *idev,
+ const struct mld2_query *mlh2)
+{
+ /* RFC3810, relevant sections:
+ * - 5.1.8. QRV (Querier's Robustness Variable)
+ * - 9.1. Robustness Variable
+ */
+
+ /* The value of the Robustness Variable MUST NOT be zero,
+ * and SHOULD NOT be one. Catch this here if we ever run
+ * into such a case in future.
+ */
+ WARN_ON(idev->mc_qrv == 0);
+
+ if (mlh2->mld2q_qrv > 0)
+ idev->mc_qrv = mlh2->mld2q_qrv;
+
+ if (unlikely(idev->mc_qrv < 2)) {
+ net_warn_ratelimited("IPv6: MLD: clamping QRV from %u to %u!\n",
+ idev->mc_qrv, MLD_QRV_DEFAULT);
+ idev->mc_qrv = MLD_QRV_DEFAULT;
+ }
+}
+
+static void mld_update_qi(struct inet6_dev *idev,
+ const struct mld2_query *mlh2)
+{
+ /* RFC3810, relevant sections:
+ * - 5.1.9. QQIC (Querier's Query Interval Code)
+ * - 9.2. Query Interval
+ * - 9.12. Older Version Querier Present Timeout
+ * (the [Query Interval] in the last Query received)
+ */
+ unsigned long mc_qqi;
+
+ if (mlh2->mld2q_qqic < 128) {
+ mc_qqi = mlh2->mld2q_qqic;
+ } else {
+ unsigned long mc_man, mc_exp;
+
+ mc_exp = MLDV2_QQIC_EXP(mlh2->mld2q_qqic);
+ mc_man = MLDV2_QQIC_MAN(mlh2->mld2q_qqic);
+
+ mc_qqi = (mc_man | 0x10) << (mc_exp + 3);
+ }
+
+ idev->mc_qi = mc_qqi * HZ;
+}
+
+static void mld_update_qri(struct inet6_dev *idev,
+ const struct mld2_query *mlh2)
+{
+ /* RFC3810, relevant sections:
+ * - 5.1.3. Maximum Response Code
+ * - 9.3. Query Response Interval
+ */
+ unsigned long mc_qri, mc_mrc = ntohs(mlh2->mld2q_mrc);
+
+ if (mc_mrc < 32768) {
+ mc_qri = mc_mrc;
+ } else {
+ unsigned long mc_man, mc_exp;
+
+ mc_exp = MLDV2_MRC_EXP(mc_mrc);
+ mc_man = MLDV2_MRC_MAN(mc_mrc);
+
+ mc_qri = (mc_man | 0x1000) << (mc_exp + 3);
+ }
+
+ idev->mc_qri = msecs_to_jiffies(mc_qri);
+}
+
/* called with rcu_read_lock() */
int igmp6_event_query(struct sk_buff *skb)
{
@@ -1150,12 +1241,15 @@ int igmp6_event_query(struct sk_buff *skb)
return -EINVAL;
if (len == MLD_V1_QUERY_LEN) {
- int switchback;
/* MLDv1 router present */
-
max_delay = msecs_to_jiffies(ntohs(mld->mld_maxdelay));
- switchback = (idev->mc_qrv + 1) * max_delay;
- idev->mc_v1_seen = jiffies + switchback;
+
+ mld_set_v1_mode(idev);
+
+ /* cancel MLDv2 report timer */
+ idev->mc_gq_running = 0;
+ if (del_timer(&idev->mc_gq_timer))
+ __in6_dev_put(idev);
/* cancel the interface change timer */
idev->mc_ifc_count = 0;
@@ -1166,6 +1260,10 @@ int igmp6_event_query(struct sk_buff *skb)
} else if (len >= MLD_V2_QUERY_LEN_MIN) {
int srcs_offset = sizeof(struct mld2_query) -
sizeof(struct icmp6hdr);
+
+ /* hosts need to stay in MLDv1 mode, discard MLDv2 queries */
+ if (MLD_V1_SEEN(idev))
+ return 0;
if (!pskb_may_pull(skb, srcs_offset))
return -EINVAL;
@@ -1175,8 +1273,10 @@ int igmp6_event_query(struct sk_buff *skb)
idev->mc_maxdelay = max_delay;
- if (mlh2->mld2q_qrv)
- idev->mc_qrv = mlh2->mld2q_qrv;
+ mld_update_qrv(idev, mlh2);
+ mld_update_qi(idev, mlh2);
+ mld_update_qri(idev, mlh2);
+
if (group_type == IPV6_ADDR_ANY) { /* general query */
if (mlh2->mld2q_nsrcs)
return -EINVAL; /* no sources allowed */
@@ -2337,7 +2437,11 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
(unsigned long)idev);
setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire,
(unsigned long)idev);
+
idev->mc_qrv = MLD_QRV_DEFAULT;
+ idev->mc_qi = MLD_QI_DEFAULT;
+ idev->mc_qri = MLD_QRI_DEFAULT;
+
idev->mc_maxdelay = unsolicited_report_interval(idev);
idev->mc_v1_seen = 0;
write_unlock_bh(&idev->lock);
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 2/8] net: ipv6: mld: clean up MLD_V1_SEEN macro
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev, Hannes Frederic Sowa
In-Reply-To: <1378195178-21002-1-git-send-email-dborkman@redhat.com>
Replace the macro with a function to make it more readable. GCC will
eventually decide whether to inline this or not (also, that's not
fast-path anyway).
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/mcast.c | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 8992ff2..f86e26b 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -95,6 +95,7 @@ static void mld_ifc_event(struct inet6_dev *idev);
static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *pmc);
static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *addr);
static void mld_clear_delrec(struct inet6_dev *idev);
+static bool mld_in_v1_mode(const struct inet6_dev *idev);
static int sf_setstate(struct ifmcaddr6 *pmc);
static void sf_markstate(struct ifmcaddr6 *pmc);
static void ip6_mc_clear_src(struct ifmcaddr6 *pmc);
@@ -117,11 +118,6 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
#define MLD_V1_QUERY_LEN 24
#define MLD_V2_QUERY_LEN_MIN 28
-#define MLD_V1_SEEN(idev) (dev_net((idev)->dev)->ipv6.devconf_all->force_mld_version == 1 || \
- (idev)->cnf.force_mld_version == 1 || \
- ((idev)->mc_v1_seen && \
- time_before(jiffies, (idev)->mc_v1_seen)))
-
#define IPV6_MLD_MAX_MSF 64
int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
@@ -139,7 +135,7 @@ static int unsolicited_report_interval(struct inet6_dev *idev)
{
int iv;
- if (MLD_V1_SEEN(idev))
+ if (mld_in_v1_mode(idev))
iv = idev->cnf.mldv1_unsolicited_report_interval;
else
iv = idev->cnf.mldv2_unsolicited_report_interval;
@@ -695,7 +691,7 @@ static void igmp6_group_added(struct ifmcaddr6 *mc)
if (!(dev->flags & IFF_UP) || (mc->mca_flags & MAF_NOREPORT))
return;
- if (MLD_V1_SEEN(mc->idev)) {
+ if (mld_in_v1_mode(mc->idev)) {
igmp6_join_group(mc);
return;
}
@@ -1116,6 +1112,18 @@ static bool mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
return true;
}
+static bool mld_in_v1_mode(const struct inet6_dev *idev)
+{
+ if (dev_net(idev->dev)->ipv6.devconf_all->force_mld_version == 1)
+ return true;
+ if (idev->cnf.force_mld_version == 1)
+ return true;
+ if (idev->mc_v1_seen && time_before(jiffies, idev->mc_v1_seen))
+ return true;
+
+ return false;
+}
+
static void mld_set_v1_mode(struct inet6_dev *idev)
{
/* RFC3810, relevant sections:
@@ -1262,7 +1270,7 @@ int igmp6_event_query(struct sk_buff *skb)
sizeof(struct icmp6hdr);
/* hosts need to stay in MLDv1 mode, discard MLDv2 queries */
- if (MLD_V1_SEEN(idev))
+ if (mld_in_v1_mode(idev))
return 0;
if (!pskb_may_pull(skb, srcs_offset))
return -EINVAL;
@@ -1942,7 +1950,7 @@ err_out:
static void mld_resend_report(struct inet6_dev *idev)
{
- if (MLD_V1_SEEN(idev)) {
+ if (mld_in_v1_mode(idev)) {
struct ifmcaddr6 *mcaddr;
read_lock_bh(&idev->lock);
for (mcaddr = idev->mc_list; mcaddr; mcaddr = mcaddr->next) {
@@ -2006,7 +2014,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode,
else
pmc->mca_sources = psf->sf_next;
if (psf->sf_oldin && !(pmc->mca_flags & MAF_NOREPORT) &&
- !MLD_V1_SEEN(idev)) {
+ !mld_in_v1_mode(idev)) {
psf->sf_crcount = idev->mc_qrv;
psf->sf_next = pmc->mca_tomb;
pmc->mca_tomb = psf;
@@ -2306,7 +2314,7 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
static void igmp6_leave_group(struct ifmcaddr6 *ma)
{
- if (MLD_V1_SEEN(ma->idev)) {
+ if (mld_in_v1_mode(ma->idev)) {
if (ma->mca_flags & MAF_LAST_REPORTER)
igmp6_send(&ma->mca_addr, ma->idev->dev,
ICMPV6_MGM_REDUCTION);
@@ -2340,7 +2348,7 @@ static void mld_ifc_timer_expire(unsigned long data)
static void mld_ifc_event(struct inet6_dev *idev)
{
- if (MLD_V1_SEEN(idev))
+ if (mld_in_v1_mode(idev))
return;
idev->mc_ifc_count = idev->mc_qrv;
mld_ifc_start_timer(idev, 1);
@@ -2351,7 +2359,7 @@ static void igmp6_timer_handler(unsigned long data)
{
struct ifmcaddr6 *ma = (struct ifmcaddr6 *) data;
- if (MLD_V1_SEEN(ma->idev))
+ if (mld_in_v1_mode(ma->idev))
igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT);
else
mld_send_report(ma->idev, ma);
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next 0/8] IPv6 MLD updates
From: Daniel Borkmann @ 2013-09-03 7:59 UTC (permalink / raw)
To: davem; +Cc: netdev
This set contains the non-RFC version of the previous submission entitled
"[RFC PATCH net-next 0/7] IPv6 MLD updates". Most importantly it contains
a fix for MLDv1/v2 switchback timeout where hosts currently are switching
back from v1 compat mode to normal v2 too early (i.e. switchback time was
<= 30secs instead of >= 260secs on default), and the set also contains a
patch that allows for v2-only mode as per RFC recommendation. The rest is
related to cleanups that make the code more readable resp. maintainable.
Changes from RFC to non-RFC:
We ignore v2 messages now when in v1 compat mode, otherwise report timers
are reset and triggered, also stop current v2 report timer in case it is
currently running and we received a v1 query; use WARN_ON instead of BUG_ON
for RV of 0 (patch1).
Two more patches have been added that makes to code more readable, that is
"net: ipv6: mld: refactor query processing into v1/v2 functions" and
"net: ipv6: mld: introduce mld_{gq,ifc,dad}_stop_timer functions", the
sysctl patch "net: ipv6: mld: restrict min/max of sysctl force_mld_version"
has been dropped as extra1 and extra2 vars are overwritten with idev and net
anyway when addrconf sysctl is registered, hence dropped for now. The rest is
unchanged, only adapted to take changes into account.
Thanks!
Daniel Borkmann (8):
net: ipv6: mld: fix v1/v2 switchback timeout to rfc3810, 9.12.
net: ipv6: mld: clean up MLD_V1_SEEN macro
net: ipv6: mld: get rid of MLDV2_MRC and simplify calculation
net: ipv6: mld: implement RFC3810 MLDv2 mode only
net: ipv6: mld: similarly to MLDv2 have min max_delay of 1
net: ipv6: mld: refactor query processing into v1/v2 functions
net: ipv6: mld: introduce mld_{gq,ifc,dad}_stop_timer functions
net: ipv6: mld: document force_mld_version in ip-sysctl.txt
Documentation/networking/ip-sysctl.txt | 5 +
include/net/if_inet6.h | 9 +-
include/net/mld.h | 51 +++++--
net/bridge/br_multicast.c | 3 +-
net/ipv6/mcast.c | 237 ++++++++++++++++++++++++++-------
5 files changed, 248 insertions(+), 57 deletions(-)
--
1.7.11.7
^ permalink raw reply
* Re: BQL support in gianfar causes network hiccup
From: Per Dalén @ 2013-09-03 7:55 UTC (permalink / raw)
To: Claudiu Manoil; +Cc: netdev
In-Reply-To: <52258A60.8040305@freescale.com>
On 09/03/2013 09:06 AM, Claudiu Manoil wrote:
> On 9/2/2013 7:50 PM, Per Dalén wrote:
>> On 09/02/2013 05:35 PM, Claudiu Manoil wrote:
>>> On 9/2/2013 5:37 PM, Per Dalén wrote:
>>>>> The proposed fix is currently under review:
>>>>> http://patchwork.ozlabs.org/patch/271242/
>>>>> "gianfar: Fix reported number of sent bytes to BQL"
>>>>>
>>>>> Does this one work for you? You might need to pull
>>>>> one recent gianfar clean-up patch from net-next in order
>>>>> to apply this one without incidents.
>>>>>
>>>>
>>>> No, still the same error:
>>>>
>>>> NETDEV WATCHDOG: eth0 (fsl-gianfar): transmit queue 0 timed out
>>>> ------------[ cut here ]------------
>>>> WARNING: at net/sched/sch_generic.c:256
>>>> Modules linked in:
>>>> NIP: c039ce0c LR: c039ce0c CTR: c02ef578
>>>> ...
>>>> 4e800421 80fe0244 4bffff40 7fc3f378 4bfea9d1 7fc4f378 7c651b78 3c60c055
>>>> 7fe6fb78 38635304 4cc63182 480fcddd <0fe00000> 39200001 993c0a3c
>>>> 4bffffb4
>>>> ---[ end trace 5f5e1e3c30024010 ]---
>>>>
>>>>
>>>
>>> Tried to reproduce the issue with a recent net-next kernel (Linux
>>> p2020rdb 3.11.0-rc6) + BQL fix patch (http://patchwork.ozlabs.org/patc
>>> /271242/), but the iperf test finished without incidents (see log
>>> below).
>>> Will try if the problem is apparent without the fix patch, on the same
>>> net-next kernel (3.11.0-rc6).
>>>
>>
>> I was able to reproduce it on our card and the P2020RDB using 3.11.0-rc7
>> + David Miller's -next networking tree and your patch
>> (http://patchwork.ozlabs.org/patch/271242/).
>>
>> root@p2020rdb:~# iperf -s
>
> Ok, I see, iperf -s on P2020. This way I was able to get the tx timeout
> too. With iperf -c on P2020 it doesn't come up. Now it'll be
> interesting to find out what BQL/ BQL integration in gianfar has to do
> with this.
Yes, it's weird. The only reason I removed the BQL commit
(d8a0f1b0af67679bba886784de10d8c21acc4e0e) was because the error Tino
Keitel had was the similar as mine.
>
> Thanks.
> claudiu
>
>
Thanks,
Per
^ permalink raw reply
* Re: [PATCH RFC net-next 06/21] net: create sysfs symlinks for neighbour devices
From: Jiri Pirko @ 2013-09-03 7:48 UTC (permalink / raw)
To: Veaceslav Falico
Cc: netdev, Jay Vosburgh, Andy Gospodarek, David S. Miller,
Eric Dumazet, Alexander Duyck
In-Reply-To: <1378157965-17537-7-git-send-email-vfalico@redhat.com>
Mon, Sep 02, 2013 at 11:39:10PM CEST, vfalico@redhat.com wrote:
>Also, remove the same functionality from bonding - it will be already done
>for any device that links to its lower/upper neighbour.
>
>The links will be created for dev's kobject, and will look like
>slave_eth0 for lower device eth0 and upper_bridge0 for upper device
>bridge0.
The pair should be either slave/master or lower/upper. It's undesirable
to mix these two. Maybe for compatibility reasons we should leave
current bonding sysfs files and create proper new generic ones?
I think there should be directories under netdev dir like:
/sys/class/net/em1-
|-upper-
|-bond0(link)
|-vlanx(link)
/sys/class/net/bond0-
|-lower-
|-em1(link)
|-em2(link)
>
>CC: Jay Vosburgh <fubar@us.ibm.com>
>CC: Andy Gospodarek <andy@greyhouse.net>
>CC: "David S. Miller" <davem@davemloft.net>
>CC: Eric Dumazet <edumazet@google.com>
>CC: Jiri Pirko <jiri@resnulli.us>
>CC: Alexander Duyck <alexander.h.duyck@intel.com>
>Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
>---
> drivers/net/bonding/bond_main.c | 11 +----------
> drivers/net/bonding/bond_sysfs.c | 25 -------------------------
> drivers/net/bonding/bonding.h | 2 --
> net/core/dev.c | 29 +++++++++++++++++++++++++++++
> 4 files changed, 30 insertions(+), 37 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index c50679f..b0b753d 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1635,15 +1635,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>
> read_unlock(&bond->lock);
>
>- res = bond_create_slave_symlinks(bond_dev, slave_dev);
>- if (res)
>- goto err_detach;
>-
> res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
> new_slave);
> if (res) {
> pr_debug("Error %d calling netdev_rx_handler_register\n", res);
>- goto err_dest_symlinks;
>+ goto err_detach;
> }
>
> pr_info("%s: enslaving %s as a%s interface with a%s link.\n",
>@@ -1655,9 +1651,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
> return 0;
>
> /* Undo stages on error */
>-err_dest_symlinks:
>- bond_destroy_slave_symlinks(bond_dev, slave_dev);
>-
> err_detach:
> if (!USES_PRIMARY(bond->params.mode))
> bond_hw_addr_flush(bond_dev, slave_dev);
>@@ -1856,8 +1849,6 @@ static int __bond_release_one(struct net_device *bond_dev,
> bond_dev->name, slave_dev->name, bond_dev->name);
>
> /* must do this from outside any spinlocks */
>- bond_destroy_slave_symlinks(bond_dev, slave_dev);
>-
> vlan_vids_del_by_dev(slave_dev, bond_dev);
>
> /* If the mode USES_PRIMARY, then this cases was handled above by
>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>index 5715277..7b962a2 100644
>--- a/drivers/net/bonding/bond_sysfs.c
>+++ b/drivers/net/bonding/bond_sysfs.c
>@@ -168,31 +168,6 @@ static const struct class_attribute class_attr_bonding_masters = {
> .namespace = bonding_namespace,
> };
>
>-int bond_create_slave_symlinks(struct net_device *master,
>- struct net_device *slave)
>-{
>- char linkname[IFNAMSIZ+7];
>- int ret = 0;
>-
>- /* create a link from the master to the slave */
>- sprintf(linkname, "slave_%s", slave->name);
>- ret = sysfs_create_link(&(master->dev.kobj), &(slave->dev.kobj),
>- linkname);
>-
>- return ret;
>-
>-}
>-
>-void bond_destroy_slave_symlinks(struct net_device *master,
>- struct net_device *slave)
>-{
>- char linkname[IFNAMSIZ+7];
>-
>- sprintf(linkname, "slave_%s", slave->name);
>- sysfs_remove_link(&(master->dev.kobj), linkname);
>-}
>-
>-
> /*
> * Show the slaves in the current bond.
> */
>diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>index 4abc925..f7a167d 100644
>--- a/drivers/net/bonding/bonding.h
>+++ b/drivers/net/bonding/bonding.h
>@@ -455,8 +455,6 @@ int bond_create(struct net *net, const char *name);
> int bond_create_sysfs(struct bond_net *net);
> void bond_destroy_sysfs(struct bond_net *net);
> void bond_prepare_sysfs_group(struct bonding *bond);
>-int bond_create_slave_symlinks(struct net_device *master, struct net_device *slave);
>-void bond_destroy_slave_symlinks(struct net_device *master, struct net_device *slave);
> int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev);
> int bond_release(struct net_device *bond_dev, struct net_device *slave_dev);
> void bond_mii_monitor(struct work_struct *);
>diff --git a/net/core/dev.c b/net/core/dev.c
>index 7eecf35..1c3e98d 100644
>--- a/net/core/dev.c
>+++ b/net/core/dev.c
>@@ -4580,6 +4580,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
> bool upper, void *private)
> {
> struct netdev_adjacent *adj, *neigh = NULL;
>+ char linkname[IFNAMSIZ+7];
> int ret;
>
> adj = __netdev_find_adj(dev, adj_dev, upper, false);
>@@ -4628,6 +4629,16 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
> */
> if (master)
> neigh->private = private;
>+
>+ sprintf(linkname, "slave_%s", adj_dev->name);
>+ ret = sysfs_create_link(&(dev->dev.kobj),
>+ &(adj_dev->dev.kobj),
>+ linkname);
>+ if (ret) {
>+ kfree(neigh);
>+ kfree(adj);
>+ return ret;
>+ }
> list_add_tail_rcu(&neigh->list,
> &dev->neighbour_dev_list.lower);
> }
>@@ -4635,10 +4646,24 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
> return 0;
> }
>
>+ /* it's upper neighbour, we don't care if it's master or not */
>+ if (neigh) {
>+ sprintf(linkname, "upper_%s", adj_dev->name);
>+ ret = sysfs_create_link(&(dev->dev.kobj), &(adj_dev->dev.kobj),
>+ linkname);
>+ if (ret) {
>+ kfree(neigh);
>+ kfree(adj);
>+ return ret;
>+ }
>+ }
>+
> /* Ensure that master upper link is always the first item in list. */
> if (master) {
> ret = sysfs_create_link(&(dev->dev.kobj), &(adj_dev->dev.kobj), "master");
> if (ret) {
>+ if (neigh)
>+ sysfs_remove_link(&(dev->dev.kobj), linkname);
> kfree(neigh);
> kfree(adj);
> return ret;
>@@ -4678,6 +4703,7 @@ void __netdev_adjacent_dev_remove(struct net_device *dev,
> struct net_device *adj_dev, bool upper)
> {
> struct netdev_adjacent *adj, *neighbour;
>+ char linkname[IFNAMSIZ+7];
>
> if (upper) {
> adj = __netdev_find_upper(dev, adj_dev);
>@@ -4725,6 +4751,9 @@ void __netdev_adjacent_dev_remove(struct net_device *dev,
> list_del_rcu(&neighbour->list);
> if (neighbour->master && upper)
> sysfs_remove_link(&(dev->dev.kobj), "master");
>+ sprintf(linkname, "%s_%s", upper ? "upper" : "slave",
>+ adj_dev->name);
>+ sysfs_remove_link(&(dev->dev.kobj), linkname);
> dev_put(adj_dev);
> kfree_rcu(neighbour, rcu);
> }
>--
>1.8.4
>
^ permalink raw reply
* Re: [PATCH v2 net-next 0/9] set addr_assign_type when inheriting a dev_addr
From: Bjørn Mork @ 2013-09-03 7:38 UTC (permalink / raw)
To: David Miller
Cc: devel, jiri, libertas-dev, j, netdev, linux-wireless, linville,
stephen, forest, gregkh, kaber, dan.carpenter
In-Reply-To: <20130831.225057.1874268263797742541.davem@davemloft.net>
David Miller <davem@davemloft.net> writes:
> From: Bjørn Mork <bjorn@mork.no>
> Date: Fri, 30 Aug 2013 18:08:43 +0200
>
>> Copying the dev_addr from a parent device is an operation
>> common to a number of drivers. The addr_assign_type should
>> be updated accordingly, either by reusing the value from
>> the source device or explicitly indicating that the address
>> is stolen by setting addr_assign_type to NET_ADDR_STOLEN.
>>
>> This patch set adds a helper copying both the dev_addr and
>> the addr_assign_type, and use this helper in drivers which
>> don't currently set the addr_assign_type. Using NET_ADDR_STOLEN
>> might be more appropriate in some of these cases. Please
>> let me know, and I'll update the patch accordingly.
>>
>> Changes in v2:
>> - assuming addr_len == ETH_ALEN to allow optimized memcpy
>> - dropped the vt6656 patch due to addr_len being unset in that driver
>
> Looks good, series applied, thanks.
Thanks. But it doesn't look like it ended up in net-next? Or am I
missing something (again)?
Bjørn
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply
* Re: Networking problem with 3.11-rc6+
From: Chris Clayton @ 2013-09-03 7:35 UTC (permalink / raw)
To: Francois Romieu; +Cc: Chris Clayton, LKML, netdev
In-Reply-To: <20130820215419.GA29560@electric-eye.fr.zoreil.com>
On 08/20/13 22:54, Francois Romieu wrote:
> Chris Clayton <chris2553@gmail.com> :
> [...]
>> [ 0.207094] acpi PNP0A08:00: ACPI _OSC support notification failed, disabling PCIe ASPM
>> [ 0.207155] acpi PNP0A08:00: Unable to request _OSC control (_OSC support mask: 0x08)
> [...]
>> [ 5.311191] r8169 0000:07:00.0: can't disable ASPM; OS doesn't have ASPM control
> [...]
>> [ 65.181715] [<f8e38000>] rtl8169_interrupt [r8169]
>> [ 65.181717] Disabling IRQ #17
>>
>> Let me know if I can provide any additional information, although to
>> be honest, the boot completed and the KDE desktop started up OK, so
>> there may not be much else I can provide unless I find that the
>> problem is repeatable.
>
> Please don't hesitate if it happens again, even if it can't be reproduced
> on demand.
>
I've booted the kernel numerous times since the incident reported above,
but haven't encountered the problem again. If it does happen again, are
there any files from /sys or /proc that might help diagnostics?
Chris
^ permalink raw reply
* [PATCH 5/7] ixgbe: use pcie_capability_read_word() to simplify code
From: Yijing Wang @ 2013-09-03 7:35 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Gavin Shan, Bjorn Helgaas,
James E.J. Bottomley, David S. Miller
Cc: e1000-devel, linux-pci, Hanjun Guo, linux-kernel, netdev,
Yijing Wang
In-Reply-To: <1378193715-25328-1-git-send-email-wangyijing@huawei.com>
use pcie_capability_read_word() to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: e1000-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index bad8f14..bfa0b06 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -152,7 +152,6 @@ MODULE_VERSION(DRV_VERSION);
static int ixgbe_read_pci_cfg_word_parent(struct ixgbe_adapter *adapter,
u32 reg, u16 *value)
{
- int pos = 0;
struct pci_dev *parent_dev;
struct pci_bus *parent_bus;
@@ -164,11 +163,10 @@ static int ixgbe_read_pci_cfg_word_parent(struct ixgbe_adapter *adapter,
if (!parent_dev)
return -1;
- pos = pci_find_capability(parent_dev, PCI_CAP_ID_EXP);
- if (!pos)
+ if (!pci_is_pcie(parent_dev))
return -1;
- pci_read_config_word(parent_dev, pos + reg, value);
+ pcie_capability_read_word(parent_dev, reg, value);
return 0;
}
--
1.7.1
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH net] bridge: netfiler: update find_inlist_lock_noload() more accurate
From: Ding Tianhong @ 2013-09-03 7:15 UTC (permalink / raw)
To: Bart De Schuymer, Pablo Neira Ayuso, Patrick McHardy,
Jozsef Kadlecsik, Stephen Hemminger, David S. Miller, bridge,
netfilter-devel, Netdev, Baoquan He
Baoquan He <baoquan.he@gmail.com> has report a problem which occurred by the following command:
make SUBDIRS=net/bridge/netfilter/
cp /net/bridge/netfilter/ebtables.ko
/lib/modules/3.11.0-rc7+/kernel/net/bridge/netfilter/ebtables.ko
depmod
modprobe ebtables.ko
reboot
----------------------------------------------------------------------
[ 48.895000] BUG: soft lockup - CPU#1 stuck for 22s! [ebtables:444]
[ 48.901191] Modules linked in: bnep(F) bluetooth(F) ebtables(F)
ip6table_filter(F) ip6_tables(F) rfkill(F) snd_hda_intel(F+)
snd_hda_codec(F) snd_hwdep(F) snd_seq(F) sn)
[ 48.950034] CPU: 1 PID: 444 Comm: ebtables Tainted: GF D
3.11.0-rc7+ #1
[ 48.957433] Hardware name: Hewlett-Packard HP Z420 Workstation/1589,
BIOS J61 v01.02 03/09/2012
[ 48.966131] task: ffff88040c2dc650 ti: ffff8804187d2000 task.ti:
ffff8804187d2000
[ 48.973610] RIP: 0010:[<ffffffff812e57a7>] [<ffffffff812e57a7>]
strcmp+0x27/0x40
[ 48.981119] RSP: 0018:ffff8804187d3db8 EFLAGS: 00000246
[ 48.986430] RAX: 0000000000000000 RBX: 00007fffda942730 RCX:
ffff8804187d3fd8
[ 48.993566] RDX: 0000000000000000 RSI: ffff8804187d3e01 RDI:
ffffffff81cb8a39
[ 49.000707] RBP: ffff8804187d3db8 R08: 00000000fffffff2 R09:
0000000000000000
[ 49.007841] R10: 0000000000000163 R11: 0000000000000000 R12:
ffffffff8128300c
[ 49.014972] R13: ffff8804187d3d98 R14: ffff8804187d3ef4 R15:
0000000000000004
[ 49.022112] FS: 00007faab6589740(0000) GS:ffff88042fc80000(0000)
knlGS:0000000000000000
[ 49.030194] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 49.035942] CR2: 0000003f0d810414 CR3: 000000040d2cc000 CR4:
00000000000407e0
[ 49.043077] Stack:
[ 49.045096] ffff8804187d3de8 ffffffffa0249674 0000000000000080
ffffffff81cb8180
[ 49.052559] 00007fffda942730 ffff8804187d3ef4 ffff8804187d3ea0
ffffffffa02497a9
[ 49.060020] 0000000000000000 00007265746c6966 0000003f0d7b92c0
00007fffda942850
[ 49.067487] Call Trace:
[ 49.069949] [<ffffffffa0249674>]
find_inlist_lock.constprop.16+0x54/0x100 [ebtables]
[ 49.077779] [<ffffffffa02497a9>] do_ebt_get_ctl+0x89/0x1d0 [ebtables]
[ 49.084306] [<ffffffff81551ca8>] nf_getsockopt+0x68/0x90
[ 49.089717] [<ffffffff81560d40>] ip_getsockopt+0x80/0xa0
[ 49.095113] [<ffffffff815835c5>] raw_getsockopt+0x25/0x50
[ 49.100588] [<ffffffff8150ddd4>] sock_common_getsockopt+0x14/0x20
[ 49.106766] [<ffffffff8150d208>] SyS_getsockopt+0x68/0xd0
[ 49.112257] [<ffffffff8162c682>] system_call_fastpath+0x16/0x1b
[ 49.118260] Code: 00 00 00 00 55 48 89 e5 eb 0e 66 2e 0f 1f 84 00 00
00 00 00 84 c0 74 1c 48 83 c7 01 0f b6 47 ff 48 83 c6 01 3a 46 ff 74 eb
19 c0 <83> c8 01 5d c3 0f 1
[ 76.925880] BUG: soft lockup - CPU#1 stuck for 22s! [ebtables:444]
[ 76.932069] Modules linked in: bnep(F) bluetooth(F) ebtables(F)
ip6table_filter(F) ip6_tables(F) rfkill(F) snd_hda_intel(F+)
snd_hda_codec(F) snd_hwdep(F) snd_seq(F) sn)
[ 76.980847] CPU: 1 PID: 444 Comm: ebtables Tainted: GF D
3.11.0-rc7+ #1
[ 76.988245] Hardware name: Hewlett-Packard HP Z420 Workstation/1589,
BIOS J61 v01.02 03/09/2012
[ 76.996940] task: ffff88040c2dc650 ti: ffff8804187d2000 task.ti:
ffff8804187d2000
[ 77.004426] RIP: 0010:[<ffffffff812e5784>] [<ffffffff812e5784>]
strcmp+0x4/0x40
[ 77.011849] RSP: 0018:ffff8804187d3db8 EFLAGS: 00000212
[ 77.017163] RAX: 0000000000000001 RBX: 00007fffda942730 RCX:
ffff8804187d3fd8
[ 77.024304] RDX: 0000000000000000 RSI: ffff8804187d3e00 RDI:
ffffffff81cb8a38
[ 77.031434] RBP: ffff8804187d3db8 R08: 00000000fffffff2 R09:
0000000000000000
[ 77.038566] R10: 0000000000000163 R11: 0000000000000000 R12:
ffffffff8128300c
[ 77.045699] R13: ffff8804187d3d98 R14: ffff8804187d3ef4 R15:
0000000000000004
[ 77.052842] FS: 00007faab6589740(0000) GS:ffff88042fc80000(0000)
knlGS:0000000000000000
[ 77.060934] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 77.066668] CR2: 0000003f0d810414 CR3: 000000040d2cc000 CR4:
00000000000407e0
[ 77.073799] Stack:
[ 77.075818] ffff8804187d3de8 ffffffffa0249674 0000000000000080
ffffffff81cb8180
[ 77.083287] 00007fffda942730 ffff8804187d3ef4 ffff8804187d3ea0
ffffffffa02497a9
[ 77.090749] 0000000000000000 00007265746c6966 0000003f0d7b92c0
00007fffda942850
[ 77.098215] Call Trace:
[ 77.100668] [<ffffffffa0249674>]
find_inlist_lock.constprop.16+0x54/0x100 [ebtables]
[ 77.108500] [<ffffffffa02497a9>] do_ebt_get_ctl+0x89/0x1d0 [ebtables]
[ 77.115035] [<ffffffff81551ca8>] nf_getsockopt+0x68/0x90
[ 77.120438] [<ffffffff81560d40>] ip_getsockopt+0x80/0xa0
[ 77.125845] [<ffffffff815835c5>] raw_getsockopt+0x25/0x50
[ 77.131328] [<ffffffff8150ddd4>] sock_common_getsockopt+0x14/0x20
[ 77.137515] [<ffffffff8150d208>] SyS_getsockopt+0x68/0xd0
[ 77.143011] [<ffffffff8162c682>] system_call_fastpath+0x16/0x1b
[ 77.149019] Code: 0f 1f 80 00 00 00 00 48 83 c6 01 0f b6 4e ff 48 83
c2 01 84 c9 88 4a ff 75 ed 5d c3 66 66 2e 0f 1f 84 00 00 00 00 00 55 48
89 e5 <eb> 0e 66 2e 0f 1f 8
---------------------------------------------------------------------------
The find_inlist_lock did not distinguish the error whether lock failed or
module non-existent, the imperfection processing procedure may course the
problem.
Return the correct value if mutex_lock_interruptible() failed, avoid
confusion with that the modules is not exist, and deal with the return
value in right way.
After the patch, the problem didn't happened again, so I confident the bug
was fixed.
Reported-by: Baoquan He <baoquan.he@gmail.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Cc: Baoquan He <baoquan.he@gmail.com>
---
net/bridge/netfilter/ebtables.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index ac78024..e7fe9f8 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -322,17 +322,14 @@ static inline void *
find_inlist_lock_noload(struct list_head *head, const char *name, int *error,
struct mutex *mutex)
{
- struct {
- struct list_head list;
- char name[EBT_FUNCTION_MAXNAMELEN];
- } *e;
+ struct ebt_table *e;
*error = mutex_lock_interruptible(mutex);
if (*error != 0)
- return NULL;
+ return ERR_PTR(-EINTR);
list_for_each_entry(e, head, list) {
- if (strcmp(e->name, name) == 0)
+ if (strcmp(e->name, name) == 0 && try_module_get(e->me))
return e;
}
*error = -ENOENT;
@@ -1005,7 +1002,7 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
goto free_counterstmp;
t = find_table_lock(net, repl->name, &ret, &ebt_mutex);
- if (!t) {
+ if (IS_ERR_OR_NULL(t)) {
ret = -ENOENT;
goto free_iterate;
}
@@ -1284,7 +1281,7 @@ static int do_update_counters(struct net *net, const char *name,
return -ENOMEM;
t = find_table_lock(net, name, &ret, &ebt_mutex);
- if (!t)
+ if (IS_ERR_OR_NULL(t))
goto free_tmp;
if (num_counters != t->private->nentries) {
@@ -1504,7 +1501,7 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
return -EFAULT;
t = find_table_lock(net, tmp.name, &ret, &ebt_mutex);
- if (!t)
+ if (IS_ERR_OR_NULL(t))
return ret;
switch(cmd) {
@@ -2319,7 +2316,7 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd,
return -EFAULT;
t = find_table_lock(net, tmp.name, &ret, &ebt_mutex);
- if (!t)
+ if (IS_ERR_OR_NULL(t))
return ret;
xt_compat_lock(NFPROTO_BRIDGE);
--
1.8.2.1
^ permalink raw reply related
* Re: BQL support in gianfar causes network hiccup
From: Claudiu Manoil @ 2013-09-03 7:06 UTC (permalink / raw)
To: Per Dalén; +Cc: netdev
In-Reply-To: <5224C1EB.3030307@appeartv.com>
On 9/2/2013 7:50 PM, Per Dalén wrote:
> On 09/02/2013 05:35 PM, Claudiu Manoil wrote:
>> On 9/2/2013 5:37 PM, Per Dalén wrote:
>>>> The proposed fix is currently under review:
>>>> http://patchwork.ozlabs.org/patch/271242/
>>>> "gianfar: Fix reported number of sent bytes to BQL"
>>>>
>>>> Does this one work for you? You might need to pull
>>>> one recent gianfar clean-up patch from net-next in order
>>>> to apply this one without incidents.
>>>>
>>>
>>> No, still the same error:
>>>
>>> NETDEV WATCHDOG: eth0 (fsl-gianfar): transmit queue 0 timed out
>>> ------------[ cut here ]------------
>>> WARNING: at net/sched/sch_generic.c:256
>>> Modules linked in:
>>> NIP: c039ce0c LR: c039ce0c CTR: c02ef578
>>> ...
>>> 4e800421 80fe0244 4bffff40 7fc3f378 4bfea9d1 7fc4f378 7c651b78 3c60c055
>>> 7fe6fb78 38635304 4cc63182 480fcddd <0fe00000> 39200001 993c0a3c
>>> 4bffffb4
>>> ---[ end trace 5f5e1e3c30024010 ]---
>>>
>>>
>>
>> Tried to reproduce the issue with a recent net-next kernel (Linux
>> p2020rdb 3.11.0-rc6) + BQL fix patch (http://patchwork.ozlabs.org/patc
>> /271242/), but the iperf test finished without incidents (see log
>> below).
>> Will try if the problem is apparent without the fix patch, on the same
>> net-next kernel (3.11.0-rc6).
>>
>
> I was able to reproduce it on our card and the P2020RDB using 3.11.0-rc7
> + David Miller's -next networking tree and your patch
> (http://patchwork.ozlabs.org/patch/271242/).
>
> root@p2020rdb:~# iperf -s
Ok, I see, iperf -s on P2020. This way I was able to get the tx timeout
too. With iperf -c on P2020 it doesn't come up. Now it'll be
interesting to find out what BQL/ BQL integration in gianfar has to do
with this.
Thanks.
claudiu
^ permalink raw reply
* Re: [PATCH] Add WLI-UC-G300HP's Product ID.
From: Kalle Valo @ 2013-09-03 6:15 UTC (permalink / raw)
To: Masami Ichikawa
Cc: IvDoorn-Re5JQEeQqe8AvxtiuMwx3w, gwingerde-Re5JQEeQqe8AvxtiuMwx3w,
helmut.schaa-gM/Ye1E23mwN+BqQ9rBEUg,
linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
users-poMEt7QlJxcwIE2E9O76wjtx2kNaKg5H,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1377617843-28835-1-git-send-email-masami256-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Masami Ichikawa <masami256-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> Support Bufallo WLI-UC-G300HP.
>
> Signed-off-by: Masami Ichikawa <masami256-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Please add "rt2x00: " prefix to the commit title.
--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] driver:stmmac: Adjust time stamp increase for 0.465 ns accurate only when Time stamp binary rollover is set.
From: Sonic Zhang @ 2013-09-03 5:55 UTC (permalink / raw)
To: Giuseppe Cavallaro, netdev; +Cc: adi-buildroot-devel, Sonic Zhang
From: Sonic Zhang <sonic.zhang@analog.com>
The synopsys spec says When TSCRLSSR is cleard, the rollover value of
sub-second register is 0x7FFFFFFF(0.465 ns per clock).
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
index def7e75..76ad214 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
@@ -45,8 +45,8 @@ static void stmmac_config_sub_second_increment(void __iomem *ioaddr)
data = (1000000000ULL / 50000000);
/* 0.465ns accuracy */
- if (value & PTP_TCR_TSCTRLSSR)
- data = (data * 100) / 465;
+ if (!(value & PTP_TCR_TSCTRLSSR))
+ data = (data * 1000) / 465;
writel(data, ioaddr + PTP_SSIR);
}
--
1.8.2.3
^ permalink raw reply related
* Re: [PATCH v4] ipv6:introduce function to find route for redirect
From: Duan Jiong @ 2013-09-03 5:37 UTC (permalink / raw)
To: hannes; +Cc: davem, netdev
In-Reply-To: <20130902195056.GA5451@order.stressinduktion.org>
于 2013年09月03日 03:50, Hannes Frederic Sowa 写道:
> On Mon, Sep 02, 2013 at 02:14:57PM +0800, Duan Jiong wrote:
>> +static struct rt6_info *__ip6_route_redirect(struct net *net,
>> + struct fib6_table *table,
>> + struct flowi6 *fl6,
>> + int flags)
>> +{
>> + struct ip6rd_flowi *rdfl = (struct ip6rd_flowi *)fl6;
>> + struct rt6_info *rt;
>> + struct fib6_node *fn;
>> +
>> + /* Get the "current" route for this destination and
>> + * check if the redirect has come from approriate router.
>> + *
>> + * RFC 4861 specifies that redirects should only be
>> + * accepted if they come from the nexthop to the target.
>> + * Due to the way the routes are chosen, this notion
>> + * is a bit fuzzy and one might need to check all possible
>> + * routes.
>> + */
>> +
>> + read_lock_bh(&table->tb6_lock);
>> + fn = fib6_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
>> +restart:
>> + for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) {
>> + if (rt6_check_expired(rt))
>> + continue;
>> + if (rt->dst.error)
>> + continue;
>
> Sorry, I should have been more clear what I meant with failing early:
>
> I considered a setup like this:
>
> ip -6 r a default nexthop via fe80::1 dev eth0
> ip -6 r a prohibit 2002:1::/64
>
> If the kernel receives a redirect for a destination e.g. 2002:1::1 we
> would backtrack above the prohibit rule and return the dst of the default
> route and would insert a new cached route which could circumvent the
> prohibit rule. We have to try to lock down the tree below 2002:1::/64
> in that case. A possible solution for that would be to do something
> like this:
>
> /* We don't accept a redirect in case a more specific route is
> * installed with dst.error and stop backtracking.
> */
> if (rt->dst.error)
> break;
>
> Either we have to replace the rt with net->ipv6.ip6_null_entry in that
> case or check dst->error before calling rt6_do_redirect below.
>
Thanks for you comment, i understand what you mean.
>> + if (!(rt->rt6i_flags & RTF_GATEWAY))
>> + continue;
>> + if (fl6->flowi6_oif != rt->dst.dev->ifindex)
>> + continue;
>> + if (!ipv6_addr_equal(&rdfl->gateway, &rt->rt6i_gateway))
>> + continue;
>> + break;
>> + }
>> +
>> + if (!rt)
>> + rt = net->ipv6.ip6_null_entry;
>> + BACKTRACK(net, &fl6->saddr);
>> +out:
>> + dst_hold(&rt->dst);
>> +
>> + read_unlock_bh(&table->tb6_lock);
>> +
>> + return rt;
>> +};
>>
>> [...]
>>
>> @@ -1171,9 +1238,8 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
>> fl6.saddr = iph->saddr;
>> fl6.flowlabel = ip6_flowinfo(iph);
>>
>> - dst = ip6_route_output(net, NULL, &fl6);
>> - if (!dst->error)
>> - rt6_do_redirect(dst, NULL, skb);
>> + dst = ip6_route_redirect(net, &fl6, &ipv6_hdr(skb)->saddr);
>> + rt6_do_redirect(dst, NULL, skb);
>> dst_release(dst);
>> }
>> EXPORT_SYMBOL_GPL(ip6_redirect);
>> @@ -1193,9 +1259,8 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
>> fl6.daddr = msg->dest;
>> fl6.saddr = iph->daddr;
>>
>> - dst = ip6_route_output(net, NULL, &fl6);
>> - if (!dst->error)
>> - rt6_do_redirect(dst, NULL, skb);
>> + dst = ip6_route_redirect(net, &fl6, &iph->saddr);
>> + rt6_do_redirect(dst, NULL, skb);
>> dst_release(dst);
>> }
>
> Btw. I still think it should be possible to eliminate
> ip6_redirect_no_header:
>
> We could always use ip6_redirect_no_header and use the data of the redirected
> header option just for finding the socket to be notified. We can do the whole
> verification and route updating in ndisc layer and then just call into icmpv6
> layer if upper protocols need a notification of the redirect. But that should
> go into another patch. ;)
>
I think this is good, but i have a question below:
if the socket type is connection-based, the dst information is stored in related
sock struct, so there is no need to look up the route for redirect in ip6_redirect
or ip6_redirect_no_header, in this case, we do the verification and route
updating in the upper protocols' err_handler is better.
How do you think of this?
Thanks,
Duan
^ permalink raw reply
* Re: [PATCH net-next] net: make snmp_mib_free static inline
From: David Miller @ 2013-09-03 4:01 UTC (permalink / raw)
To: amwang; +Cc: netdev
In-Reply-To: <1378087613-15279-3-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Mon, 2 Sep 2013 10:06:53 +0800
> From: Cong Wang <amwang@redhat.com>
>
> Fengguang reported:
>
> net/built-in.o: In function `in6_dev_finish_destroy':
> (.text+0x4ca7d): undefined reference to `snmp_mib_free'
>
> this is due to snmp_mib_free() is defined when CONFIG_INET is enabled,
> but in6_dev_finish_destroy() is now moved to core kernel.
>
> I think snmp_mib_free() is small enough to be inlined, so just make it
> static inline.
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] vxlan: include net/ip6_checksum.h for csum_ipv6_magic()
From: David Miller @ 2013-09-03 4:01 UTC (permalink / raw)
To: amwang; +Cc: netdev
In-Reply-To: <1378087613-15279-2-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Mon, 2 Sep 2013 10:06:52 +0800
> From: Cong Wang <amwang@redhat.com>
>
> Fengguang reported a compile warning:
>
> drivers/net/vxlan.c: In function 'vxlan6_xmit_skb':
> drivers/net/vxlan.c:1352:3: error: implicit declaration of function 'csum_ipv6_magic' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
>
> this patch fixes it.
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] vxlan: fix flowi6_proto value
From: David Miller @ 2013-09-03 4:01 UTC (permalink / raw)
To: amwang; +Cc: netdev
In-Reply-To: <1378087613-15279-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Mon, 2 Sep 2013 10:06:51 +0800
> From: Cong Wang <amwang@redhat.com>
>
> It should be IPPROTO_UDP.
>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 0/8] Drop support for Renesas H8/300 architecture
From: Chen Gang F T @ 2013-09-03 3:52 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-kernel, linux-ide, netdev, linux-watchdog, Wim Van Sebroeck,
David S. Miller, Yoshinori Sato, Geert Uytterhoeven, Al Viro,
Eric Paris, Greg Kroah-Hartman, Jiang Liu, David Howells,
Thomas Gleixner, Stephen Rothwell, Linus Torvalds, Andrew Morton,
Rusty Russell, Linus Walleij
In-Reply-To: <522556D8.803@roeck-us.net>
On 09/03/2013 11:26 AM, Guenter Roeck wrote:
> On 09/02/2013 07:53 PM, Chen Gang F T wrote:
>> Hello Guenter Roeck:
>>
>>
>> I don't care about whether I am in cc mailing list, but at least,
>> please help confirm 2 things:
>>
>> Is what I had done for h8300 just making wastes and noisy in kernel and related sub-system mailing list ?
>>
>> and is the disccusion about h8300 between us also wastes and noisy in kernel mailing list ?
>>
>
> It raised my awareness of the status of h8300 maintenance,
> so I would not see it as noise or waste. I might have suggested
> a different target for your efforts, but that is your choice to make,
> not mine.
>
OK, thank you for your confirmation, I plan to scan all architectures
one by one with allmodconfig.
Hmm... if suitable, next, when I focus one of architectures, I also cc
to you, if it can be removed, please let me know in time, so can avoid
sending waste mails to mailing list.
I plan to try one of architectures within arc, hexagon, and metag. I
will begin at 2013-09-20 (or later), if some (or all) of them can be
removed, please let me know, thanks.
> On the code review side, I had suggested that you should not add new
> ifdefs into code, much less unnecessary ones. Your counter-argument
> was that you wanted to follow the existing coding style in the file
> in question. To me, that argument is along the line of "the coding
> style in this file is bad, let's do more of it".
Hmm... in fact, I will not say whether the code style is good or bad. I
mainly focus on to try to avoid multiple code styles within one file.
extreme sample: let 'kernel code style' and 'gcc code style' in one file, that will make the code very ugly.
> That doesn't make much sense to me, so I did not bother to respond.
> Setting that aside, it is not up to me to approve or reject your patches.
> Whoever does that would be the one you have to convince.
>
OK, I can understand, and now it seems it can be canceled, since h8300
has been removed.
> Guenter
>
Thanks.
--
Chen Gang
^ permalink raw reply
* Re: [PATCH] net: fec: fix the error to get the previous BD entry
From: David Miller @ 2013-09-03 3:35 UTC (permalink / raw)
To: B20596; +Cc: B38611, netdev, bhutchings, stephen
In-Reply-To: <1F990F8245A4214A8CC4BFFBD9F790F908B45F9F@039-SN1MPN1-001.039d.mgd.msft.net>
From: Li Frank-B20596 <B20596@freescale.com>
Date: Tue, 3 Sep 2013 03:00:48 +0000
> Acked
This is not the correct way to ACK a patch, the correct format is:
Acked-by: David S. Miller <davem@davemloft.net>
^ 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