Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] phy: micrel: Add definitions for common Micrel PHY registers
From: Shawn Guo @ 2013-08-14  5:17 UTC (permalink / raw)
  To: dinguyen
  Cc: dinh.linux, Nicolas Ferre, David S. Miller, Andrew Victor,
	Jean-Christophe Plagniol-Villard, netdev, linux-arm-kernel
In-Reply-To: <1376405940-17141-1-git-send-email-dinguyen@altera.com>

On Tue, Aug 13, 2013 at 09:58:59AM -0500, dinguyen@altera.com wrote:
> From: Dinh Nguyen <dinguyen@altera.com>
> 
> Hi Shawn,
> 
> Can you apply this patch to your tree for 3.12?
> 

I need David's Ack to send the patch through IMX tree.

Shawn

> Thanks,
> 
> Dinh Nguyen (1):
>   phy: micrel: Add definitions for common Micrel PHY registers
> 
>  arch/arm/mach-at91/board-dt-sama5.c |   17 ++++++-----------
>  arch/arm/mach-imx/mach-imx6q.c      |   13 ++++++++-----
>  include/linux/micrel_phy.h          |    6 ++++++
>  3 files changed, 20 insertions(+), 16 deletions(-)
> 
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: David S. Miller <davem@davemloft.net>
> CC: Andrew Victor <linux@maxim.org.za>
> CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> 
> -- 
> 1.7.9.5
> 
> 

^ permalink raw reply

* [PATCHv3 net-next ] xfrm: Update xfrm_state lifetime expire after clock_was_set
From: Fan Du @ 2013-08-14  5:26 UTC (permalink / raw)
  To: steffen.klassert, davem; +Cc: herbert, netdev
In-Reply-To: <1375866296-15079-3-git-send-email-fan.du@windriver.com>



On 2013年08月07日 17:04, Fan Du wrote:
> After clock_was_set called to set new time or host resume from suspend
> state. Notify IKED with soft timeout for SAs which haven't reach its
> soft timeout limit. For those dying SAs, arrange them to hard expire.
>
> Signed-off-by: Fan Du<fan.du@windriver.com>
> ---
>   net/xfrm/xfrm_state.c |   40 ++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 40 insertions(+)
>
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index 78f66fa..25e808d 100644
> --- a/net/xfrm/xfrm_state.c
> +++ b/net/xfrm/xfrm_state.c
> @@ -2002,6 +2002,44 @@ int xfrm_init_state(struct xfrm_state *x)
>
>   EXPORT_SYMBOL(xfrm_init_state);
>
> +extern struct atomic_notifier_head clock_change_notifier_list;
> +static int clock_change_callback(struct notifier_block *nb,
> +                               unsigned long reason, void *arg)
> +{
> +	struct xfrm_state_walk *walk;
> +	struct xfrm_state *state;
> +	struct net *net;
> +	long next;
> +
> +	rtnl_lock();
> +	for_each_net(net) {
> +		spin_lock_bh(&xfrm_state_lock);
> +		list_for_each_entry(walk,&net->xfrm.state_all, all) {
> +			state = container_of(walk, struct xfrm_state, km);
> +			spin_lock(&state->lock);
                              ^^^^^^^^^^^^^
LOCKDEP complaint here about trying acquiring xfrm_state_lock while holding state->lock.
So fix this with below modifications.


 From bf282199fd172d1bbc6dcd0e38d1b8fc2192e5f5 Mon Sep 17 00:00:00 2001
From: Fan Du <fan.du@windriver.com>
Date: Wed, 14 Aug 2013 12:59:11 +0800
Subject: [PATCHv3 net-next ] xfrm: Update xfrm_state lifetime expire after clock_was_set

After clock_was_set called to set new time or host resume from suspend
state. Notify IKED with soft timeout for SAs which haven't reach its
soft timeout limit. For those dying SAs, arrange them to hard expire.

This modification is characterized by SA is sensible to any degree of
clock changes while as SA lifetime is marked by second.

Another point is clock_was_set is traversing all net name space to
update SA time while holding rtnl_lock, it may not scale very well.

Signed-off-by: Fan Du <fan.du@windriver.com>

v3:
   - Fix lockdep complaint about circular locking with trying to acquire
     state->clock while holding xfrm_state_lock.
v2:
   - Use notifier when clock was set, and then update SA lifetime accordingly.
---
  net/xfrm/xfrm_state.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 44 insertions(+)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 1df4436..50af80c 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -2002,6 +2002,48 @@ int xfrm_init_state(struct xfrm_state *x)

  EXPORT_SYMBOL(xfrm_init_state);

+static int clock_change_callback(struct notifier_block *nb,
+				unsigned long reason, void *arg)
+{
+	struct xfrm_state_walk *walk;
+	struct xfrm_state *state;
+	struct net *net;
+	long next;
+
+	rtnl_lock();
+	for_each_net(net) {
+		spin_lock_bh(&xfrm_state_lock);
+		list_for_each_entry(walk, &net->xfrm.state_all, all) {
+			state = container_of(walk, struct xfrm_state, km);
+			xfrm_state_hold(state);
+			spin_unlock_bh(&xfrm_state_lock);
+
+			spin_lock_bh(&state->lock);
+			if (state->km.dying) {
+				next = 0;
+			} else {
+				state->km.dying = 1;
+				km_state_expired(state, 0, 0);
+				next = state->lft.hard_add_expires_seconds -
+					state->lft.soft_add_expires_seconds;
+			}
+			state->km.state = XFRM_STATE_EXPIRED;
+			tasklet_hrtimer_start(&state->mtimer, ktime_set(next, 0), HRTIMER_MODE_REL);
+			spin_unlock_bh(&state->lock);
+			xfrm_state_put(state);
+			spin_lock_bh(&xfrm_state_lock);
+		}
+		spin_unlock_bh(&xfrm_state_lock);
+	}
+	rtnl_unlock();
+
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block clock_change_notifier = {
+	.notifier_call = clock_change_callback,
+};
+
  int __net_init xfrm_state_init(struct net *net)
  {
  	unsigned int sz;
@@ -2026,6 +2068,7 @@ int __net_init xfrm_state_init(struct net *net)
  	INIT_HLIST_HEAD(&net->xfrm.state_gc_list);
  	INIT_WORK(&net->xfrm.state_gc_work, xfrm_state_gc_task);
  	init_waitqueue_head(&net->xfrm.km_waitq);
+	register_clock_change_notifier(&clock_change_notifier);
  	return 0;

  out_byspi:
@@ -2057,6 +2100,7 @@ void xfrm_state_fini(struct net *net)
  	xfrm_hash_free(net->xfrm.state_bysrc, sz);
  	WARN_ON(!hlist_empty(net->xfrm.state_bydst));
  	xfrm_hash_free(net->xfrm.state_bydst, sz);
+	unregister_clock_change_notifier(&clock_change_notifier);
  }

  #ifdef CONFIG_AUDITSYSCALL
-- 
1.7.9.5


-- 
浮沉随浪只记今朝笑

--fan

^ permalink raw reply related

* Re: [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
From: Teco Boot @ 2013-08-14  6:40 UTC (permalink / raw)
  To: David Miller
  Cc: hannes, netdev, David Lamparter, Lorenzo Colitti, Dave Taht,
	Ole Troan
In-Reply-To: <20130813.011550.791636011692333018.davem@davemloft.net>

Thanks for status update.

For the record: yes, source address dependent routing has my interest. I'm not feeling lonely at all.
There is a draft for this: http://tools.ietf.org/html/draft-troan-homenet-sadr-00
Most (if not all) Linux implementations use the IP RULES hack to implement.
Lorenzo Colitti heard from David Lamparter the: "Linux IPv6 source routing code (the mythical CONFIG_IPV6_SUBTREES?) to work on 3.8": http://www.ietf.org/mail-archive/web/homenet/current/msg02964.html
Few follow-ups were posted, also by David: http://www.ietf.org/mail-archive/web/homenet/current/msg02966.html
This triggered me using that code. But it was broken !!! Discussed this with Matthieu Boutier and Juliusz Chroboczek, they faced same problem and therefore also used the IP RULES hack in their implementation. http://www.ietf.org/id/draft-boutier-homenet-source-specific-routing-00.txt
So I reported the bug. David Lamparter worked on a fix, Hannes completed it. So far so good.
Also, Dave Taht reported the issue and made us aware on lots of patches making the IP RULES hack less painful. 
http://www.ietf.org/mail-archive/web/homenet/current/msg03019.html

FYI, I tested the patch from Hannes on current Ubuntu with 3.8.0.28. Due to other "fixes" this kernel is broken. Bad to make this available to Ubuntu users. So yes, I understand fixes must be tested before getting into stable. Therefore I double-checked this IPV6_SUBTREES fix. 

Now we have to decide what to do. Wait to get the fix in the wild for some time and continue with the IP RULES hack, implemented in today's experimental SADR implementations. Or start using the more elegant IPV6_SUBTREES method. I vote for the latter. I cannot see a reason for delay. Current situation is bad enough.

What can I do to make progress? Spam Linus?

Thanks, Teco


Op 13 aug. 2013, om 10:15 heeft David Miller <davem@davemloft.net> het volgende geschreven:

> From: Teco Boot <teco@inf-net.nl>
> Date: Tue, 13 Aug 2013 10:02:08 +0200
> 
>> It is an important element in my work for v6 multi-homed networks
>> (IETF Homenet WG).
> 
> You are one person.  -stable inclusion is decided based how important the
> fix is to everyone in both good (fixes a bug) and bad (might cause a
> regression) terms.
> 
> So "this is important for my work" is never a good reason for a patch
> to be included into -stable.
> 
> To convince us, you're going to have to present an argument that
> exists outside the very limited scope of your own self-interests.
> And "other people might/will use my important work in the future"
> is not sufficient either.
> 
> Thanks.
> 

^ permalink raw reply

* Re: [PATCH 1/7] uio: add module owner to prevent inappropriate module unloading
From: Benedikt Spranger @ 2013-08-14  7:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: netdev, Alexander Frank, Sebastian Andrzej Siewior, Hans J. Koch,
	Holger Dengler
In-Reply-To: <20130813174814.GE4098@kroah.com>

Am Tue, 13 Aug 2013 10:48:14 -0700
schrieb Greg Kroah-Hartman <gregkh@linuxfoundation.org>:

> On Tue, Aug 13, 2013 at 11:08:36AM +0200, Benedikt Spranger wrote:
> > If an UIO device is created by another driver (MFD for instance) it has to be
> > ensured that the MFD driver isn't removed while the UIO is still in use.
> 
> Shouldn't if the MFD driver is removed, the UIO device will be cleaned
> up and also removed?
That is part of the problem:

1) MFD driver creates platform device "uio_pdrv"
2) uio_pdrv creates "UIOX"
3) userspace opens "UIOX"
4) MFD driver unload (remove platform device "uio_pdrv")
5) userspace reads from "UIOX" --> crash

> You shouldn't need a module reference for this type of thing.
The driver uio_pdrv has no chance to recognize that the underlaying platform
device has gone.

Regards
    Benedikt Spranger

^ permalink raw reply

* [PATCH net v2] be2net: Clear any capability flags that driver is not interested in.
From: sarveshwar.bandi @ 2013-08-14  7:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, Sarveshwar Bandi

From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

It is possible for some versions of firmware to advertise capabilities that driver
is not ready to handle. This may lead to controller stall. Since the driver is
interested only in subset of flags, clearing the rest.

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c |    3 +++
 drivers/net/ethernet/emulex/benet/be_cmds.h |    6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 6e6e0a1..8ec5d74 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -3048,6 +3048,9 @@ int be_cmd_get_func_config(struct be_adapter *adapter)
 
 		adapter->max_event_queues = le16_to_cpu(desc->eq_count);
 		adapter->if_cap_flags = le32_to_cpu(desc->cap_flags);
+
+		/* Clear flags that driver is not interested in */
+		adapter->if_cap_flags &=  BE_IF_CAP_FLAGS_WANT;
 	}
 err:
 	mutex_unlock(&adapter->mbox_lock);
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 5228d88..1b3b9e8 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -563,6 +563,12 @@ enum be_if_flags {
 	BE_IF_FLAGS_MULTICAST = 0x1000
 };
 
+#define BE_IF_CAP_FLAGS_WANT (BE_IF_FLAGS_RSS | BE_IF_FLAGS_PROMISCUOUS |\
+			 BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_VLAN_PROMISCUOUS |\
+			 BE_IF_FLAGS_VLAN | BE_IF_FLAGS_MCAST_PROMISCUOUS |\
+			 BE_IF_FLAGS_PASS_L3L4_ERRORS | BE_IF_FLAGS_MULTICAST |\
+			 BE_IF_FLAGS_UNTAGGED)
+
 /* An RX interface is an object with one or more MAC addresses and
  * filtering capabilities. */
 struct be_cmd_req_if_create {
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH] phy: micrel: Add definitions for common Micrel PHY registers
From: David Miller @ 2013-08-14  7:51 UTC (permalink / raw)
  To: shawn.guo
  Cc: dinguyen, dinh.linux, nicolas.ferre, linux, plagnioj, netdev,
	linux-arm-kernel
In-Reply-To: <20130814051743.GG16915@S2101-09.ap.freescale.net>

From: Shawn Guo <shawn.guo@linaro.org>
Date: Wed, 14 Aug 2013 13:17:46 +0800

> On Tue, Aug 13, 2013 at 09:58:59AM -0500, dinguyen@altera.com wrote:
>> From: Dinh Nguyen <dinguyen@altera.com>
>> 
>> Hi Shawn,
>> 
>> Can you apply this patch to your tree for 3.12?
>> 
> 
> I need David's Ack to send the patch through IMX tree.

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* Re: [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
From: David Miller @ 2013-08-14  7:55 UTC (permalink / raw)
  To: teco; +Cc: hannes, netdev, equinox, lorenzo, dave.taht, ot
In-Reply-To: <AFA62E3B-313C-4ECD-BA28-3543635136EE@inf-net.nl>

From: Teco Boot <teco@inf-net.nl>
Date: Wed, 14 Aug 2013 08:40:46 +0200

> What can I do to make progress? Spam Linus?

Reaching past the maintainer of a subsystem is generally considered
extremely inconsiderate and rude.

I would suggest not doing something like that if you have any interest
whatsoever in working peacefully with me in the future.

It sounds like you don't want to use logical arguments to convince me
that this patch meets -stable criteria, and instead you would like to
simply force the issue.

^ permalink raw reply

* Re: [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
From: Teco Boot @ 2013-08-14  7:59 UTC (permalink / raw)
  To: David Miller; +Cc: hannes, netdev, equinox, lorenzo, dave.taht, ot
In-Reply-To: <20130814.005506.502334877600106930.davem@davemloft.net>


Op 14 aug. 2013, om 09:55 heeft David Miller <davem@davemloft.net> het volgende geschreven:

> From: Teco Boot <teco@inf-net.nl>
> Date: Wed, 14 Aug 2013 08:40:46 +0200
> 
>> What can I do to make progress? Spam Linus?
> 
> Reaching past the maintainer of a subsystem is generally considered
> extremely inconsiderate and rude.
> 
> I would suggest not doing something like that if you have any interest
> whatsoever in working peacefully with me in the future.
> 
> It sounds like you don't want to use logical arguments to convince me
> that this patch meets -stable criteria, and instead you would like to
> simply force the issue.

^ permalink raw reply

* Re: [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
From: Teco Boot @ 2013-08-14  8:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <F11B8118-B74D-4AA5-B899-0F2C8D33AA29@inf-net.nl>

Many excuses to send before adding text. Hitted wrong button.

I don't want to enforce something. Nor I want to spam. Nor I want to bypass. I just spend some cycles to get IPv6 with multi-homing work as designed. Subtrees was broken, maybe from day one. I'm glad there is progress.

I also do not want broken fixes in stable. I know what it is. As I posed, I had to deal with broken fixes when testing the subtree fix. I double checked the fix Hannes made, because Hannes asked me to do so. I'm in for doing more work here.

Teco

Op 14 aug. 2013, om 09:59 heeft Teco Boot <teco@inf-net.nl> het volgende geschreven:

> 
> Op 14 aug. 2013, om 09:55 heeft David Miller <davem@davemloft.net> het volgende geschreven:
> 
>> From: Teco Boot <teco@inf-net.nl>
>> Date: Wed, 14 Aug 2013 08:40:46 +0200
>> 
>>> What can I do to make progress? Spam Linus?
>> 
>> Reaching past the maintainer of a subsystem is generally considered
>> extremely inconsiderate and rude.
>> 
>> I would suggest not doing something like that if you have any interest
>> whatsoever in working peacefully with me in the future.
>> 
>> It sounds like you don't want to use logical arguments to convince me
>> that this patch meets -stable criteria, and instead you would like to
>> simply force the issue.
> 

^ permalink raw reply

* Re: [PATCH 4/7] mfd: add MFD based flexcard driver
From: Benedikt Spranger @ 2013-08-14  8:12 UTC (permalink / raw)
  To: Lee Jones
  Cc: netdev, Alexander Frank, Sebastian Andrzej Siewior, Samuel Ortiz,
	Holger Dengler
In-Reply-To: <20130813095508.GA5109@lee--X1>

On Tue, 13 Aug 2013 10:55:08 +0100 Lee Jones <lee.jones@linaro.org> wrote:

> Wow, this is a huge patch which is going to be an insanely long,
> laborious and complex task to review it all.
This is a card with a "insane" amount of features:

1) a Interrupt controller
2) a DMA engine
3) up to 8 CAN devices
4) up to 4 FlexRay devices
5) a dozen different trigger sources
6) timer
7) timestamp counter

> Can you split this up into many patches?
Not sure how to split this up into a smaller and workable series of patches.
Maybe rip out the header and the DMA part into a separate patch.

Regards
    Benedikt Spranger

^ permalink raw reply

* Fwd: RFC 6980 on Security Implications of IPv6 Fragmentation with IPv6 Neighbor Discovery
From: Fernando Gont @ 2013-08-14  8:19 UTC (permalink / raw)
  To: netdev
In-Reply-To: <20130813221321.AEA1AB1E003@rfc-editor.org>

Folks,

FYI. -- this is an important piece when it comes to First Hop (i.e.,
"local link") Security.

Cheers,
Fernando




-------- Original Message --------
Subject: RFC 6980 on Security Implications of IPv6 Fragmentation with
IPv6 Neighbor Discovery
Date: Tue, 13 Aug 2013 15:13:21 -0700 (PDT)
From: rfc-editor@rfc-editor.org
To: ietf-announce@ietf.org, rfc-dist@rfc-editor.org
CC: drafts-update-ref@iana.org, ipv6@ietf.org, rfc-editor@rfc-editor.org

A new Request for Comments is now available in online RFC libraries.


        RFC 6980

        Title:      Security Implications of IPv6 Fragmentation
                    with IPv6 Neighbor Discovery
        Author:     F. Gont
        Status:     Standards Track
        Stream:     IETF
        Date:       August 2013
        Mailbox:    fgont@si6networks.com
        Pages:      10
        Characters: 20850
        Updates:    RFC 3971, RFC 4861

        I-D Tag:    draft-ietf-6man-nd-extension-headers-05.txt

        URL:        http://www.rfc-editor.org/rfc/rfc6980.txt

This document analyzes the security implications of employing IPv6
fragmentation with Neighbor Discovery (ND) messages.  It updates RFC
4861 such that use of the IPv6 Fragmentation Header is forbidden in
all Neighbor Discovery messages, thus allowing for simple and
effective countermeasures for Neighbor Discovery attacks.  Finally,
it discusses the security implications of using IPv6 fragmentation
with SEcure Neighbor Discovery (SEND) and formally updates RFC 3971
to provide advice regarding how the aforementioned security
implications can be mitigated.

This document is a product of the IPv6 Maintenance Working Group of the
IETF.

This is now a Proposed Standard.

STANDARDS TRACK: This document specifies an Internet standards track
protocol for the Internet community,and requests discussion and suggestions
for improvements.  Please refer to the current edition of the Internet
Official Protocol Standards (STD 1) for the standardization state and
status of this protocol.  Distribution of this memo is unlimited.

This announcement is sent to the IETF-Announce and rfc-dist lists.
To subscribe or unsubscribe, see
  http://www.ietf.org/mailman/listinfo/ietf-announce
  http://mailman.rfc-editor.org/mailman/listinfo/rfc-dist

For searching the RFC series, see
http://www.rfc-editor.org/search/rfc_search.php
For downloading RFCs, see http://www.rfc-editor.org/rfc.html

Requests for special distribution should be addressed to either the
author of the RFC in question, or to rfc-editor@rfc-editor.org.  Unless
specifically noted otherwise on the RFC itself, all RFCs are for
unlimited distribution.


The RFC Editor Team
Association Management Solutions, LLC
--------------------------------------------------------------------
IETF IPv6 working group mailing list
ipv6@ietf.org
Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
--------------------------------------------------------------------


-- 
Fernando Gont
e-mail: fernando@gont.com.ar || fgont@si6networks.com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1






-- 
Fernando Gont
e-mail: fernando@gont.com.ar || fgont@si6networks.com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1

^ permalink raw reply

* Re: [PATCH] phy: micrel: Add definitions for common Micrel PHY registers
From: Shawn Guo @ 2013-08-14  8:45 UTC (permalink / raw)
  To: David Miller
  Cc: dinguyen, dinh.linux, nicolas.ferre, linux, plagnioj, netdev,
	linux-arm-kernel
In-Reply-To: <20130814.005154.348348186882819546.davem@davemloft.net>

On Wed, Aug 14, 2013 at 12:51:54AM -0700, David Miller wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
> Date: Wed, 14 Aug 2013 13:17:46 +0800
> 
> > On Tue, Aug 13, 2013 at 09:58:59AM -0500, dinguyen@altera.com wrote:
> >> From: Dinh Nguyen <dinguyen@altera.com>
> >> 
> >> Hi Shawn,
> >> 
> >> Can you apply this patch to your tree for 3.12?
> >> 
> > 
> > I need David's Ack to send the patch through IMX tree.
> 
> Acked-by: David S. Miller <davem@davemloft.net>

Okay, applied with David's ACK.

Shawn

^ permalink raw reply

* Re: [PATCH 1/2] netfilter: export xt_rpfilter.h to userland
From: Pablo Neira Ayuso @ 2013-08-14  8:50 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netfilter-devel, netdev
In-Reply-To: <1376399139-4181-1-git-send-email-nicolas.dichtel@6wind.com>

On Tue, Aug 13, 2013 at 03:05:38PM +0200, Nicolas Dichtel wrote:
> This file contains the API for the match "rpfilter", hence it should be exported
> to userland.

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 2/2] netfilter: export xt_HMARK.h to userland
From: Pablo Neira Ayuso @ 2013-08-14  8:50 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netfilter-devel, netdev
In-Reply-To: <1376399139-4181-2-git-send-email-nicolas.dichtel@6wind.com>

On Tue, Aug 13, 2013 at 03:05:39PM +0200, Nicolas Dichtel wrote:
> This file contains the API for the target "HMARK", hence it should be exported
> to userland.

Also applied, thanks.

^ permalink raw reply

* [PATCHv3 linux-next] hrtimer: Add notifier when clock_was_set was called
From: Fan Du @ 2013-08-14  8:52 UTC (permalink / raw)
  To: tglx, Steffen Klassert, David Miller
  Cc: Herbert Xu, Daniel Borkmann, LKML, netdev
In-Reply-To: <520214C6.6000307@redhat.com>

 From e3929d4fdfad5b40fd8cad0e217597670d1aef54 Mon Sep 17 00:00:00 2001
From: Fan Du <fan.du@windriver.com>
Date: Wed, 14 Aug 2013 16:39:23 +0800
Subject: [PATCHv3 linux-next] hrtimer: Add notifier when clock_was_set was called

When clock_was_set is called in case of system wall time change
or host resume from suspend state, use this notifier for places
where interested in this action, e.g Ipsec SA lifetime management.

Signed-off-by: Fan Du <fan.du@windriver.com>

v3:
   -Beautify notifier with register/unregister API exported for other subsystem.

---
  include/linux/hrtimer.h |    3 +++
  kernel/hrtimer.c        |   19 +++++++++++++++++++
  2 files changed, 22 insertions(+)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index d19a5c2..f0404e4 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -461,4 +461,7 @@ extern u64 ktime_divns(const ktime_t kt, s64 div);
  /* Show pending timers: */
  extern void sysrq_timer_list_show(void);

+extern int register_clock_change_notifier(struct notifier_block *nb);
+extern int unregister_clock_change_notifier(struct notifier_block *nb);
+
  #endif
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 383319b..c6e6405 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -755,6 +755,24 @@ static inline void retrigger_next_event(void *arg) { }

  #endif /* CONFIG_HIGH_RES_TIMERS */

+static ATOMIC_NOTIFIER_HEAD(clock_change_notifier_list);
+static int call_clock_change_notifiers(void)
+{
+	return atomic_notifier_call_chain(&clock_change_notifier_list, 0, 0);
+}
+
+int register_clock_change_notifier(struct notifier_block *nb)
+{
+	return atomic_notifier_chain_register(&clock_change_notifier_list, nb);
+}
+EXPORT_SYMBOL_GPL(register_clock_change_notifier);
+
+int unregister_clock_change_notifier(struct notifier_block *nb)
+{
+	return atomic_notifier_chain_unregister(&clock_change_notifier_list, nb);
+}
+EXPORT_SYMBOL_GPL(unregister_clock_change_notifier);
+
  /*
   * Clock realtime was set
   *
@@ -773,6 +791,7 @@ void clock_was_set(void)
  	on_each_cpu(retrigger_next_event, NULL, 1);
  #endif
  	timerfd_clock_was_set();
+	call_clock_change_notifiers();
  }

  /*
-- 
1.7.9.5


-- 
浮沉随浪只记今朝笑

--fan

^ permalink raw reply related

* [PATCH 3/3 v4] ipv6: fix checkpatch errors in net/ipv6/addrconf.c
From: Ding Tianhong @ 2013-08-14  9:07 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, Netdev

ERROR: code indent should use tabs where possible: fix 2.
ERROR: do not use assignment in if condition: fix 5.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 net/ipv6/addrconf.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 734724c..00e3fdc 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1105,8 +1105,8 @@ retry:
 	spin_unlock_bh(&ifp->lock);
 
 	regen_advance = idev->cnf.regen_max_retry *
-	                idev->cnf.dad_transmits *
-	                idev->nd_parms->retrans_time / HZ;
+			idev->cnf.dad_transmits *
+			idev->nd_parms->retrans_time / HZ;
 	write_unlock(&idev->lock);
 
 	/* A temporary address is created only if this calculated Preferred
@@ -2514,7 +2514,8 @@ static int inet6_addr_del(struct net *net, int ifindex, const struct in6_addr *p
 	if (!dev)
 		return -ENODEV;
 
-	if ((idev = __in6_dev_get(dev)) == NULL)
+	idev = __in6_dev_get(dev);
+	if (!idev)
 		return -ENXIO;
 
 	read_lock_bh(&idev->lock);
@@ -2653,7 +2654,8 @@ static void init_loopback(struct net_device *dev)
 
 	ASSERT_RTNL();
 
-	if ((idev = ipv6_find_idev(dev)) == NULL) {
+	idev = ipv6_find_idev(dev);
+	if (!idev) {
 		pr_debug("%s: add_dev failed\n", __func__);
 		return;
 	}
@@ -2751,7 +2753,8 @@ static void addrconf_sit_config(struct net_device *dev)
 	 * our v4 addrs in the tunnel
 	 */
 
-	if ((idev = ipv6_find_idev(dev)) == NULL) {
+	idev = ipv6_find_idev(dev);
+	if (!idev) {
 		pr_debug("%s: add_dev failed\n", __func__);
 		return;
 	}
@@ -2783,7 +2786,8 @@ static void addrconf_gre_config(struct net_device *dev)
 
 	ASSERT_RTNL();
 
-	if ((idev = ipv6_find_idev(dev)) == NULL) {
+	idev = ipv6_find_idev(dev);
+	if (!idev) {
 		pr_debug("%s: add_dev failed\n", __func__);
 		return;
 	}
@@ -2814,11 +2818,11 @@ static void ip6_tnl_add_linklocal(struct inet6_dev *idev)
 	struct net *net = dev_net(idev->dev);
 
 	/* first try to inherit the link-local address from the link device */
-	if (idev->dev->iflink &&
-	    (link_dev = __dev_get_by_index(net, idev->dev->iflink))) {
-		if (!ipv6_inherit_linklocal(idev, link_dev))
+	if (idev->dev->iflink)
+		link_dev = __dev_get_by_index(net, idev->dev->iflink);
+		if (link_dev && !ipv6_inherit_linklocal(idev, link_dev))
 			return;
-	}
+
 	/* then try to inherit it from any device */
 	for_each_netdev(net, link_dev) {
 		if (!ipv6_inherit_linklocal(idev, link_dev))
-- 
1.8.2.1

^ permalink raw reply related

* [PATCH 1/3 v4] ipv6: do not disable temp_address when reaching max_address
From: Ding Tianhong @ 2013-08-14  9:06 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, Jon Maloy, Eric Dumazet,
	Netdev

A LAN user can remotely disable temporary address which may lead
to privacy violatins and information disclosure.

The reason is that the linux kernel uses the 'ipv6.max_addresses'
option to specify how many ipv6 addresses and interface may have.
The 'ipv6.regen_max_retry' (default value 3) option specifies
how many times the kernel will try to create a new address.

But the kernel is not distinguish between the event of reaching
max_addresses for an interface and failing to generate a new address.
the kernel disable the temporary address after regenerate a new
address 'regen_max_retry' times.

According RFC4941 3.3.7:

---------------------------------------

If DAD indicates the address is already in use,
the node must generate a new randomized interface
identifier as described in section 3.2 above, and
repeat the previous steps as appropriate up to
TEMP_IDGEN_RETRIES times.

If after TEMP_IDGEN_RETRIES consecutive attempts no
non-unique address was generated, the node must log
a system error and must not attempt to generate
temporary address for that interface.

------------------------------------------

RFC4941 3.3.7 specifies that disabling the temp_address must happen
upon the address is already in use, not reach the max_address,
So we have to check the return err and distinguish the correct retry path.

This fixes CVE-2013-0343

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Tested-by: Wang Weidong <wangweidong1@huawei.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/addrconf.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index da4241c..7b55464 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1134,10 +1134,28 @@ retry:
 	if (IS_ERR_OR_NULL(ift)) {
 		in6_ifa_put(ifp);
 		in6_dev_put(idev);
-		pr_info("%s: retry temporary address regeneration\n", __func__);
-		tmpaddr = &addr;
-		write_lock(&idev->lock);
-		goto retry;
+
+		/* According RFC4941 3.3.7:
+		 * If DAD indicates the address is already in use,
+		 * the node must generate a new randomized interface
+		 * identifier as described in section 3.2 above, and
+		 * repeat the previous steps as appropriate up to
+		 * TEMP_IDGEN_RETRIES times.
+		 * If after TEMP_IDGEN_RETRIES consecutive attempts no
+		 * non-unique address was generated, the node must log
+		 * a system error and must not attempt to generate
+		 * temporary address for that interface.
+		 * So we have to check the return err and distinguish
+		 * the correct retry path.
+		 */
+		if (PTR_ERR(ift) == -EEXIST) {
+			pr_info("%s: retry temporary address regeneration\n", __func__);
+			tmpaddr = &addr;
+			write_lock(&idev->lock);
+			goto retry;
+		}
+		/* do not retry if the err code is not -EEXIST */
+		goto out;
 	}
 
 	spin_lock_bh(&ift->lock);
-- 
1.8.2.1

^ permalink raw reply related

* [PATCH 2/3 v4] ipv6: convert the uses of ADBG and remove the superfluous parentheses
From: Ding Tianhong @ 2013-08-14  9:07 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, Joe Perches, Netdev

Just follow the Joe Perches's opinion, it is a better way to fix the
style errors.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Cc: Joe Perches <joe@perches.com>
---
 net/ipv6/addrconf.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7b55464..734724c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -99,9 +99,9 @@
 #define ACONF_DEBUG 2
 
 #if ACONF_DEBUG >= 3
-#define ADBG(x) printk x
+#define ADBG(fmt, ...) printk(fmt, ##__VA_ARGS__)
 #else
-#define ADBG(x)
+#define ADBG(fmt, ...) do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
 #endif
 
 #define	INFINITY_LIFE_TIME	0xFFFFFFFF
@@ -369,9 +369,9 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 	dev_hold(dev);
 
 	if (snmp6_alloc_dev(ndev) < 0) {
-		ADBG((KERN_WARNING
+		ADBG(KERN_WARNING
 			"%s: cannot allocate memory for statistics; dev=%s.\n",
-			__func__, dev->name));
+			__func__, dev->name);
 		neigh_parms_release(&nd_tbl, ndev->nd_parms);
 		dev_put(dev);
 		kfree(ndev);
@@ -379,9 +379,9 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 	}
 
 	if (snmp6_register_dev(ndev) < 0) {
-		ADBG((KERN_WARNING
+		ADBG(KERN_WARNING
 			"%s: cannot create /proc/net/dev_snmp6/%s\n",
-			__func__, dev->name));
+			__func__, dev->name);
 		neigh_parms_release(&nd_tbl, ndev->nd_parms);
 		ndev->dead = 1;
 		in6_dev_finish_destroy(ndev);
@@ -844,7 +844,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
 
 	/* Ignore adding duplicate addresses on an interface */
 	if (ipv6_chk_same_addr(dev_net(idev->dev), addr, idev->dev)) {
-		ADBG(("ipv6_add_addr: already assigned\n"));
+		ADBG("ipv6_add_addr: already assigned\n");
 		err = -EEXIST;
 		goto out;
 	}
@@ -852,7 +852,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
 	ifa = kzalloc(sizeof(struct inet6_ifaddr), GFP_ATOMIC);
 
 	if (ifa == NULL) {
-		ADBG(("ipv6_add_addr: malloc failed\n"));
+		ADBG("ipv6_add_addr: malloc failed\n");
 		err = -ENOBUFS;
 		goto out;
 	}
@@ -2070,7 +2070,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
 	pinfo = (struct prefix_info *) opt;
 
 	if (len < sizeof(struct prefix_info)) {
-		ADBG(("addrconf: prefix option too short\n"));
+		ADBG("addrconf: prefix option too short\n");
 		return;
 	}
 
@@ -3650,8 +3650,8 @@ restart:
 	if (time_before(next_sched, jiffies + ADDRCONF_TIMER_FUZZ_MAX))
 		next_sched = jiffies + ADDRCONF_TIMER_FUZZ_MAX;
 
-	ADBG((KERN_DEBUG "now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
-	      now, next, next_sec, next_sched));
+	ADBG(KERN_DEBUG "now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
+	      now, next, next_sec, next_sched);
 
 	addr_chk_timer.expires = next_sched;
 	add_timer(&addr_chk_timer);
-- 
1.8.2.1

^ permalink raw reply related

* [PATCH] Revert "cxgb3: Check and handle the dma mapping errors"
From: Alexey Kardashevskiy @ 2013-08-14  9:19 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Alexey Kardashevskiy, Divy Le Ray, netdev, linux-kernel,
	Linus Torvalds, Santosh Rastapur, Jay Fenlason, David S. Miller

This reverts commit f83331bab149e29fa2c49cf102c0cd8c3f1ce9f9.

As the tests PPC64 (powernv platform) show, IOMMU pages are leaking
when transferring big amount of small packets (<=64 bytes),
"ping -f" and waiting for 15 seconds is the simplest way to confirm the bug.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Santosh Rastapur <santosh@chelsio.com>
Cc: Jay Fenlason <fenlason@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Divy Le ray <divy@chelsio.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 drivers/net/ethernet/chelsio/cxgb3/sge.c | 107 +++++++------------------------
 1 file changed, 24 insertions(+), 83 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
index 687ec4a..9c89dc8 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
@@ -455,11 +455,6 @@ static int alloc_pg_chunk(struct adapter *adapter, struct sge_fl *q,
 		q->pg_chunk.offset = 0;
 		mapping = pci_map_page(adapter->pdev, q->pg_chunk.page,
 				       0, q->alloc_size, PCI_DMA_FROMDEVICE);
-		if (unlikely(pci_dma_mapping_error(adapter->pdev, mapping))) {
-			__free_pages(q->pg_chunk.page, order);
-			q->pg_chunk.page = NULL;
-			return -EIO;
-		}
 		q->pg_chunk.mapping = mapping;
 	}
 	sd->pg_chunk = q->pg_chunk;
@@ -954,75 +949,40 @@ static inline unsigned int calc_tx_descs(const struct sk_buff *skb)
 	return flits_to_desc(flits);
 }
 
-
-/*	map_skb - map a packet main body and its page fragments
- *	@pdev: the PCI device
- *	@skb: the packet
- *	@addr: placeholder to save the mapped addresses
- *
- *	map the main body of an sk_buff and its page fragments, if any.
- */
-static int map_skb(struct pci_dev *pdev, const struct sk_buff *skb,
-		   dma_addr_t *addr)
-{
-	const skb_frag_t *fp, *end;
-	const struct skb_shared_info *si;
-
-	*addr = pci_map_single(pdev, skb->data, skb_headlen(skb),
-			       PCI_DMA_TODEVICE);
-	if (pci_dma_mapping_error(pdev, *addr))
-		goto out_err;
-
-	si = skb_shinfo(skb);
-	end = &si->frags[si->nr_frags];
-
-	for (fp = si->frags; fp < end; fp++) {
-		*++addr = skb_frag_dma_map(&pdev->dev, fp, 0, skb_frag_size(fp),
-					   DMA_TO_DEVICE);
-		if (pci_dma_mapping_error(pdev, *addr))
-			goto unwind;
-	}
-	return 0;
-
-unwind:
-	while (fp-- > si->frags)
-		dma_unmap_page(&pdev->dev, *--addr, skb_frag_size(fp),
-			       DMA_TO_DEVICE);
-
-	pci_unmap_single(pdev, addr[-1], skb_headlen(skb), PCI_DMA_TODEVICE);
-out_err:
-	return -ENOMEM;
-}
-
 /**
- *	write_sgl - populate a scatter/gather list for a packet
+ *	make_sgl - populate a scatter/gather list for a packet
  *	@skb: the packet
  *	@sgp: the SGL to populate
  *	@start: start address of skb main body data to include in the SGL
  *	@len: length of skb main body data to include in the SGL
- *	@addr: the list of the mapped addresses
+ *	@pdev: the PCI device
  *
- *	Copies the scatter/gather list for the buffers that make up a packet
+ *	Generates a scatter/gather list for the buffers that make up a packet
  *	and returns the SGL size in 8-byte words.  The caller must size the SGL
  *	appropriately.
  */
-static inline unsigned int write_sgl(const struct sk_buff *skb,
+static inline unsigned int make_sgl(const struct sk_buff *skb,
 				    struct sg_ent *sgp, unsigned char *start,
-				    unsigned int len, const dma_addr_t *addr)
+				    unsigned int len, struct pci_dev *pdev)
 {
-	unsigned int i, j = 0, k = 0, nfrags;
+	dma_addr_t mapping;
+	unsigned int i, j = 0, nfrags;
 
 	if (len) {
+		mapping = pci_map_single(pdev, start, len, PCI_DMA_TODEVICE);
 		sgp->len[0] = cpu_to_be32(len);
-		sgp->addr[j++] = cpu_to_be64(addr[k++]);
+		sgp->addr[0] = cpu_to_be64(mapping);
+		j = 1;
 	}
 
 	nfrags = skb_shinfo(skb)->nr_frags;
 	for (i = 0; i < nfrags; i++) {
 		const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
 
+		mapping = skb_frag_dma_map(&pdev->dev, frag, 0, skb_frag_size(frag),
+					   DMA_TO_DEVICE);
 		sgp->len[j] = cpu_to_be32(skb_frag_size(frag));
-		sgp->addr[j] = cpu_to_be64(addr[k++]);
+		sgp->addr[j] = cpu_to_be64(mapping);
 		j ^= 1;
 		if (j == 0)
 			++sgp;
@@ -1178,7 +1138,7 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
 			    const struct port_info *pi,
 			    unsigned int pidx, unsigned int gen,
 			    struct sge_txq *q, unsigned int ndesc,
-			    unsigned int compl, const dma_addr_t *addr)
+			    unsigned int compl)
 {
 	unsigned int flits, sgl_flits, cntrl, tso_info;
 	struct sg_ent *sgp, sgl[MAX_SKB_FRAGS / 2 + 1];
@@ -1236,7 +1196,7 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
 	}
 
 	sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
-	sgl_flits = write_sgl(skb, sgp, skb->data, skb_headlen(skb), addr);
+	sgl_flits = make_sgl(skb, sgp, skb->data, skb_headlen(skb), adap->pdev);
 
 	write_wr_hdr_sgl(ndesc, skb, d, pidx, q, sgl, flits, sgl_flits, gen,
 			 htonl(V_WR_OP(FW_WROPCODE_TUNNEL_TX_PKT) | compl),
@@ -1267,7 +1227,6 @@ netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct netdev_queue *txq;
 	struct sge_qset *qs;
 	struct sge_txq *q;
-	dma_addr_t addr[MAX_SKB_FRAGS + 1];
 
 	/*
 	 * The chip min packet length is 9 octets but play safe and reject
@@ -1296,11 +1255,6 @@ netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 		return NETDEV_TX_BUSY;
 	}
 
-	if (unlikely(map_skb(adap->pdev, skb, addr) < 0)) {
-		dev_kfree_skb(skb);
-		return NETDEV_TX_OK;
-	}
-
 	q->in_use += ndesc;
 	if (unlikely(credits - ndesc < q->stop_thres)) {
 		t3_stop_tx_queue(txq, qs, q);
@@ -1358,7 +1312,7 @@ netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (likely(!skb_shared(skb)))
 		skb_orphan(skb);
 
-	write_tx_pkt_wr(adap, skb, pi, pidx, gen, q, ndesc, compl, addr);
+	write_tx_pkt_wr(adap, skb, pi, pidx, gen, q, ndesc, compl);
 	check_ring_tx_db(adap, q);
 	return NETDEV_TX_OK;
 }
@@ -1623,8 +1577,7 @@ static void setup_deferred_unmapping(struct sk_buff *skb, struct pci_dev *pdev,
  */
 static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
 			  struct sge_txq *q, unsigned int pidx,
-			  unsigned int gen, unsigned int ndesc,
-			  const dma_addr_t *addr)
+			  unsigned int gen, unsigned int ndesc)
 {
 	unsigned int sgl_flits, flits;
 	struct work_request_hdr *from;
@@ -1645,9 +1598,9 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
 
 	flits = skb_transport_offset(skb) / 8;
 	sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
-	sgl_flits = write_sgl(skb, sgp, skb_transport_header(skb),
-			     skb_tail_pointer(skb) -
-			     skb_transport_header(skb), addr);
+	sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb),
+			     skb->tail - skb->transport_header,
+			     adap->pdev);
 	if (need_skb_unmap()) {
 		setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);
 		skb->destructor = deferred_unmap_destructor;
@@ -1705,11 +1658,6 @@ again:	reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
 		goto again;
 	}
 
-	if (map_skb(adap->pdev, skb, (dma_addr_t *)skb->head)) {
-		spin_unlock(&q->lock);
-		return NET_XMIT_SUCCESS;
-	}
-
 	gen = q->gen;
 	q->in_use += ndesc;
 	pidx = q->pidx;
@@ -1720,7 +1668,7 @@ again:	reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
 	}
 	spin_unlock(&q->lock);
 
-	write_ofld_wr(adap, skb, q, pidx, gen, ndesc, (dma_addr_t *)skb->head);
+	write_ofld_wr(adap, skb, q, pidx, gen, ndesc);
 	check_ring_tx_db(adap, q);
 	return NET_XMIT_SUCCESS;
 }
@@ -1738,7 +1686,6 @@ static void restart_offloadq(unsigned long data)
 	struct sge_txq *q = &qs->txq[TXQ_OFLD];
 	const struct port_info *pi = netdev_priv(qs->netdev);
 	struct adapter *adap = pi->adapter;
-	unsigned int written = 0;
 
 	spin_lock(&q->lock);
 again:	reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
@@ -1758,14 +1705,10 @@ again:	reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
 			break;
 		}
 
-		if (map_skb(adap->pdev, skb, (dma_addr_t *)skb->head))
-			break;
-
 		gen = q->gen;
 		q->in_use += ndesc;
 		pidx = q->pidx;
 		q->pidx += ndesc;
-		written += ndesc;
 		if (q->pidx >= q->size) {
 			q->pidx -= q->size;
 			q->gen ^= 1;
@@ -1773,8 +1716,7 @@ again:	reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
 		__skb_unlink(skb, &q->sendq);
 		spin_unlock(&q->lock);
 
-		write_ofld_wr(adap, skb, q, pidx, gen, ndesc,
-			     (dma_addr_t *)skb->head);
+		write_ofld_wr(adap, skb, q, pidx, gen, ndesc);
 		spin_lock(&q->lock);
 	}
 	spin_unlock(&q->lock);
@@ -1784,9 +1726,8 @@ again:	reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);
 	set_bit(TXQ_LAST_PKT_DB, &q->flags);
 #endif
 	wmb();
-	if (likely(written))
-		t3_write_reg(adap, A_SG_KDOORBELL,
-			     F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
+	t3_write_reg(adap, A_SG_KDOORBELL,
+		     F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
 }
 
 /**
-- 
1.8.3.2

^ permalink raw reply related

* Re: r8169 OOPSen in rtl_rx
From: Peter Zijlstra @ 2013-08-14  9:29 UTC (permalink / raw)
  To: Francois Romieu; +Cc: nic_swsd, netdev
In-Reply-To: <20130813211534.GA5635@electric-eye.fr.zoreil.com>

[-- Attachment #1: Type: text/plain, Size: 2937 bytes --]

On Tue, Aug 13, 2013 at 11:15:34PM +0200, Francois Romieu wrote:
> Peter Zijlstra <peterz@infradead.org> :
> [...]
> > I've got an AMD x86_64 machine with two realtek NICs:
> > 
> > 01:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)
> > 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
> 
> Which XID (see kernel dmesg) ?

$ dmesg | grep -i xid
[    1.706427] r8169 0000:01:08.0 eth0: RTL8110s at 0xffffc9000063ac00, 00:0e:2e:87:8b:70, XID 04000000 IRQ 18
[    1.717012] r8169 0000:03:00.0 eth1: RTL8168e/8111e at 0xffffc90000646000, a0:f3:c1:00:74:a3, XID 0c200000 IRQ 43

> > So all I've got to offer currently is a partial backtrace -- see
> > attached image.
> 
> (no attachment)

Oh, duh.. 

> > Partial transcribe:
> > 
> >   ? rtl8169_try_rx_copy.isra.77
> 
> /me scratches head.
> 
> You may check that pkt_size is > 0, <= ETH_FRAME_LEN (no jumbo ?) and
> see if it helps.

So eth0 runs at 1000Mb/s but has a MTU:1500, eth1 runs at 100Mb/s also
MTU:1500.

I'll try a kernel with the below. Hopefully the change in dumpstack_64.c
will avoid printing the 'process' stack and give a little more useful
information.

Will let you know.

Thanks

---
 arch/x86/kernel/dumpstack_64.c       | 7 ++++---
 drivers/net/ethernet/realtek/r8169.c | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index addb207..f76e98f 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -182,7 +182,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
 				stack = (unsigned long *) (irq_stack_end[-1]);
 				irq_stack_end = NULL;
 				ops->stack(data, "EOI");
-				continue;
+				goto out;
 			}
 		}
 		break;
@@ -192,6 +192,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
 	 * This handles the process stack:
 	 */
 	bp = ops->walk_stack(tinfo, stack, bp, ops, data, NULL, &graph);
+out:
 	put_cpu();
 }
 EXPORT_SYMBOL(dump_trace);
@@ -231,8 +232,8 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
 				pr_cont(" <EOI> ");
 			}
 		} else {
-		if (((long) stack & (THREAD_SIZE-1)) == 0)
-			break;
+			if (((long) stack & (THREAD_SIZE-1)) == 0)
+				break;
 		}
 		if (i && ((i % STACKSLOTS_PER_LINE) == 0))
 			pr_cont("\n");
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 393f961..76d1c18 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6185,6 +6185,8 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
 			else
 				pkt_size = status & 0x00003fff;
 
+			WARN_ON(!(pkt_size > 0 && pkt_size <= ETH_FRAME_LEN));
+
 			/*
 			 * The driver does not support incoming fragmented
 			 * frames. They are seen as a symptom of over-mtu

[-- Attachment #2: IMG_20130810_195601.jpg --]
[-- Type: image/jpeg, Size: 301515 bytes --]

^ permalink raw reply related

* [patch] rtnetlink: remove an unneeded test
From: Dan Carpenter @ 2013-08-14  9:35 UTC (permalink / raw)
  To: David S. Miller
  Cc: John Fastabend, Jiri Pirko, Vlad Yasevich, Eric W. Biederman,
	netdev, kernel-janitors

We know that "dev" is a valid pointer at this point, so we can remove
the test and clean up a little.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 618dbe4..e7e058e 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1867,10 +1867,10 @@ replay:
 		else
 			err = register_netdevice(dev);
 
-		if (err < 0 && !IS_ERR(dev))
+		if (err < 0) {
 			free_netdev(dev);
-		if (err < 0)
 			goto out;
+		}
 
 		err = rtnl_configure_link(dev, ifm);
 		if (err < 0)

^ permalink raw reply related

* Re: [PATCH 4/7] mfd: add MFD based flexcard driver
From: Lee Jones @ 2013-08-14  9:45 UTC (permalink / raw)
  To: Benedikt Spranger
  Cc: netdev, Alexander Frank, Sebastian Andrzej Siewior, Samuel Ortiz,
	Holger Dengler
In-Reply-To: <20130814101247.3ad43494@mitra.spranger.biz>

> > Wow, this is a huge patch which is going to be an insanely long,
> > laborious and complex task to review it all.
> This is a card with a "insane" amount of features:
> 
> 1) a Interrupt controller
> 2) a DMA engine
> 3) up to 8 CAN devices
> 4) up to 4 FlexRay devices
> 5) a dozen different trigger sources
> 6) timer
> 7) timestamp counter

Right. Even more reason for the the patch to be broken up into many.

> > Can you split this up into many patches?
> Not sure how to split this up into a smaller and workable series of patches.
> Maybe rip out the header and the DMA part into a separate patch.

I was thinking more along the lines of:

    Patch 1: Basic compilation support
     - Core driver Kconfig entry
     - Introduction of the core driver
       - Basic probe(): memory allocation, register as MFD device
       - Basic remove(): unregister as MFD device
    
    Patch 2: Basic PCI support
     - pci_enable_device()
     - pci_request_regions()
     - Memory mapping
    
    Patch 3:
     - fc_init_dma()
    
    Patch 4:
     - fc_init_uio()
    
    Patch 5:
     - fc_init_event()
    
    Patch 6:
     - fc_init_clk()
    
    Patch 7:
     - fc_init_bus()
    
    Patch 8 - 8+n: Start adding sysfs entries
    
    Patch 8+n+1: Basic IRQ support
    
    Etc etc etc

Remember, the smaller the patches, the more chance that they'll be
accepted. I already see quite a few issues with this patch. Breaking
it up will allow for more thorough review and finer grain feedback.

Issues I see after first glance:

  - Lack of Device Tree support
  - Lack of documentation for new sysfs entries
  - Different IRQs with same .name property
  - Memory allocations and mapping should be managed (devm_*)

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: r8169 OOPSen in rtl_rx
From: Peter Zijlstra @ 2013-08-14  9:52 UTC (permalink / raw)
  To: Francois Romieu; +Cc: nic_swsd, netdev
In-Reply-To: <20130814092915.GF24092@twins.programming.kicks-ass.net>

On Wed, Aug 14, 2013 at 11:29:15AM +0200, Peter Zijlstra wrote:
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 393f961..76d1c18 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -6185,6 +6185,8 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
>  			else
>  				pkt_size = status & 0x00003fff;
>  
> +			WARN_ON(!(pkt_size > 0 && pkt_size <= ETH_FRAME_LEN));
> +
>  			/*
>  			 * The driver does not support incoming fragmented
>  			 * frames. They are seen as a symptom of over-mtu

OK, I changed that to:

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 393f961..81e0bf4 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6185,6 +6185,12 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
 			else
 				pkt_size = status & 0x00003fff;
 
+			if (!(pkt_size > 0 && pkt_size <= ETH_FRAME_LEN)) {
+				dev->stats.rx_dropped++;
+				printk("%s Funny sized packet: %d\n", dev->name, pkt_size);
+				goto release_descriptor;
+			}
+
 			/*
 			 * The driver does not support incoming fragmented
 			 * frames. They are seen as a symptom of over-mtu

^ permalink raw reply related

* Configuring and using RIPngd
From: Ale Lampro @ 2013-08-14 10:02 UTC (permalink / raw)
  To: netdev

Hi,

I am new to the list and I am trying to achieve something that I think
should be relatively easy with RIPngd and Quagga, but I am new to all
this so I have some issues.

I have two computers connected by a Serial link. I use "tunslip" which
creates a slip connection between them and mounts a tap0 interface in
my ubuntu linux computer.
The other computer generates a Response RIPng message advertising
ADDR1 (ipv6 address) in a given moment, which arrives to the linux
computer by the tap0 interface.
What I would like to do is to run ripng in this computer so that it
adds ADDR1 to its routing table but I am not able to do it.

The configuration for zebra and ripngd are the following.
ripngd: http://pastebin.com/Y8GHkcDB (link to the conf file)
zebra: http://pastebin.com/ZEVRfLx0 (link to the conf file)

As I was not sure at all of how I should configure them I just reused
a few things that I found on the internet but I guess it may not be
enough.

I would really appreciate if someone could give me a hint with this.

Thanks a lot.

Best regards,

Alejandro

^ permalink raw reply

* Re: [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
From: Hannes Frederic Sowa @ 2013-08-14 10:06 UTC (permalink / raw)
  To: Teco Boot; +Cc: David Miller, netdev
In-Reply-To: <64621FDB-9618-40A7-82EE-6056156580F6@inf-net.nl>

On Wed, Aug 14, 2013 at 10:06:23AM +0200, Teco Boot wrote:
> Many excuses to send before adding text. Hitted wrong button.
> 
> I don't want to enforce something. Nor I want to spam. Nor I want to bypass. I just spend some cycles to get IPv6 with multi-homing work as designed. Subtrees was broken, maybe from day one. I'm glad there is progress.
> 
> I also do not want broken fixes in stable. I know what it is. As I posed, I had to deal with broken fixes when testing the subtree fix. I double checked the fix Hannes made, because Hannes asked me to do so. I'm in for doing more work here.

Teco, I don't see the problem. The patch is on its way. It is in stable and
will be included in the next kernel, 3.11. That is all the luxus a patch can
possibly have.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox