* Re: [PATCH v3 02/22] netconsole: Introduce locking over the netpoll fields
From: Michał Mirosław @ 2010-12-14 23:15 UTC (permalink / raw)
To: Mike Waychison
Cc: simon.kagstrom-vI6UBbBVNY+JA8cjQkG2/g,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, nhorman-2XuSBdqkA4R54TAoqtyWWQ,
Matt Mackall, adurbin-hpIqsD4AKlfQT0dZR+AlfA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
chavey-hpIqsD4AKlfQT0dZR+AlfA, Greg KH,
netdev-u79uwXL29TY76Z2rM5mHXA, Américo Wang,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
linux-api-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20101214212904.17022.16604.stgit-tzAwxxnF6Tt6FDdRrpk8kO4/NqBCd+6Q@public.gmane.org>
2010/12/14 Mike Waychison <mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>:
> The netconsole driver currently doesn't do any locking over its
> configuration fields. This can cause problems if we were to ever have
> concurrent writing to fields while somebody is enabling the service.
>
> For simplicity, this patch extends targets_list_lock to cover all
> configuration fields within the targets. Macros are also added here to
> wrap accessors so that we check whether the target has been enabled with
> locking handled.
>
> Signed-off-by: Mike Waychison <mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> Acked-by: Matt Mackall <mpm-VDJrAJ4Gl5ZBDgjK7y7TUQ@public.gmane.org>
> ---
> drivers/net/netconsole.c | 114 ++++++++++++++++++++++++++--------------------
> 1 files changed, 64 insertions(+), 50 deletions(-)
>
> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> index c87a49e..6e16888 100644
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
> @@ -327,6 +327,7 @@ static ssize_t store_enabled(struct netconsole_target *nt,
> const char *buf,
> size_t count)
> {
> + unsigned long flags;
> int err;
> long enabled;
>
> @@ -335,6 +336,10 @@ static ssize_t store_enabled(struct netconsole_target *nt,
> return enabled;
>
> if (enabled) { /* 1 */
> + spin_lock_irqsave(&target_list_lock, flags);
> + if (nt->enabled)
> + goto busy;
> + spin_unlock_irqrestore(&target_list_lock, flags);
>
This looks wrong. Unless there is another lock or mutex covering this
function, at this point (after spin_unlock_irqrestore()) another
thread might set nt->enabled = 1.
Best Regards,
Michał Mirosław
^ permalink raw reply
* Re: [PATCH v3 21/22] netoops: Add user-programmable boot_id
From: Mike Waychison @ 2010-12-14 23:19 UTC (permalink / raw)
To: Matt Mackall
Cc: simon.kagstrom-vI6UBbBVNY+JA8cjQkG2/g,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, nhorman-2XuSBdqkA4R54TAoqtyWWQ,
adurbin-hpIqsD4AKlfQT0dZR+AlfA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
chavey-hpIqsD4AKlfQT0dZR+AlfA, Greg KH,
netdev-u79uwXL29TY76Z2rM5mHXA, Américo Wang,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
linux-api-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1292366864.3446.875.camel@calx>
On Tue, Dec 14, 2010 at 2:47 PM, Matt Mackall <mpm-VDJrAJ4Gl5ZBDgjK7y7TUQ@public.gmane.org> wrote:
> On Tue, 2010-12-14 at 14:33 -0800, Mike Waychison wrote:
>> On Tue, Dec 14, 2010 at 2:06 PM, Matt Mackall <mpm-VDJrAJ4Gl5ZBDgjK7y7TUQ@public.gmane.org> wrote:
>> > What happens if you oops before userspace is available?
>> >
>>
>> Either one of two general cases:
>> - The crash is a one-off and the machine comes back. The boot
>> number sequence will see a hole in it, which is a clue that something
>> bad happened.
>> - The machine is in a crash loop. This has the same failure mode
>> for us as if the machine never made it onto the network due to
>> whatever reason: bad cables, bad firmware, bad ram, ...
>>
>> In both cases, we can detect that something is wrong and handle it.
>> Note that our firmware is responsible for incrementing the boot
>> sequence at bootup, which is why the above works. In general though,
>> our machines do make it up to userland -- staying alive once booted is
>> the hard part ;)
>
> Interesting. Is this Google-specific firmware magic?
Ya, this is a Google-ism. I'd be surprised if there weren't other
platforms that had the same thing though (though I don't know of
anything standard on x86).
> I'd probably accept
> a hook in random.c to fold a number into the UUID, which would unify
> things.
I'm not sure there is a _good_ way to support this, is there? I just
read through RFC 4122 and UUIDs seem to be pretty well structured;
it's probably not such a great idea to allow folks to override
portions of it. Like I mentioned in my last email though, I'm okay
pushing this boot sequence ID down into the user blob which acts like
a place for "vendor extensions" if there isn't a good place for it in
the kernel.
^ permalink raw reply
* Re: [PATCH v3 03/22] netconsole: Introduce 'enabled' state-machine
From: Michał Mirosław @ 2010-12-14 23:21 UTC (permalink / raw)
To: Mike Waychison
Cc: simon.kagstrom-vI6UBbBVNY+JA8cjQkG2/g,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, nhorman-2XuSBdqkA4R54TAoqtyWWQ,
Matt Mackall, adurbin-hpIqsD4AKlfQT0dZR+AlfA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
chavey-hpIqsD4AKlfQT0dZR+AlfA, Greg KH,
netdev-u79uwXL29TY76Z2rM5mHXA, Américo Wang,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
linux-api-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20101214212909.17022.96801.stgit-tzAwxxnF6Tt6FDdRrpk8kO4/NqBCd+6Q@public.gmane.org>
2010/12/14 Mike Waychison <mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>:
> Representing the internal state within netconsole isn't really a boolean
> value, but rather a state machine with transitions.
[...]
> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> index 6e16888..288a025 100644
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
[...]
> @@ -350,9 +362,9 @@ static ssize_t store_enabled(struct netconsole_target *nt,
> err = netpoll_setup(&nt->np);
> spin_lock_irqsave(&target_list_lock, flags);
> if (err)
> - nt->enabled = 0;
> + nt->np_state = NETPOLL_DISABLED;
> else
> - nt->enabled = 1;
> + nt->np_state = NETPOLL_ENABLED;
> spin_unlock_irqrestore(&target_list_lock, flags);
> if (err)
> return err;
[...]
Since the spinlock protects only nt->np_state setting, you might be
able to remove it altogether and use cmpxchg() where nt->np_state
transitions from enabled or disabled state.
Maybe the locking scheme just needs more thought altogether?
Best Regards,
Michał Mirosław
^ permalink raw reply
* Re: [PATCH v3 02/22] netconsole: Introduce locking over the netpoll fields
From: Mike Waychison @ 2010-12-14 23:30 UTC (permalink / raw)
To: Michał Mirosław
Cc: simon.kagstrom, davem, nhorman, Matt Mackall, adurbin,
linux-kernel, chavey, Greg KH, netdev, Américo Wang, akpm,
linux-api
In-Reply-To: <AANLkTi=reqRMrv4k5EZKdj7pmsomApw9=Kwh9nxfKCuJ@mail.gmail.com>
2010/12/14 Michał Mirosław <mirqus@gmail.com>:
> 2010/12/14 Mike Waychison <mikew@google.com>:
>> The netconsole driver currently doesn't do any locking over its
>> configuration fields. This can cause problems if we were to ever have
>> concurrent writing to fields while somebody is enabling the service.
>>
>> For simplicity, this patch extends targets_list_lock to cover all
>> configuration fields within the targets. Macros are also added here to
>> wrap accessors so that we check whether the target has been enabled with
>> locking handled.
>>
>> Signed-off-by: Mike Waychison <mikew@google.com>
>> Acked-by: Matt Mackall <mpm@selenic.com>
>> ---
>> drivers/net/netconsole.c | 114 ++++++++++++++++++++++++++--------------------
>> 1 files changed, 64 insertions(+), 50 deletions(-)
>>
>> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
>> index c87a49e..6e16888 100644
>> --- a/drivers/net/netconsole.c
>> +++ b/drivers/net/netconsole.c
>> @@ -327,6 +327,7 @@ static ssize_t store_enabled(struct netconsole_target *nt,
>> const char *buf,
>> size_t count)
>> {
>> + unsigned long flags;
>> int err;
>> long enabled;
>>
>> @@ -335,6 +336,10 @@ static ssize_t store_enabled(struct netconsole_target *nt,
>> return enabled;
>>
>> if (enabled) { /* 1 */
>> + spin_lock_irqsave(&target_list_lock, flags);
>> + if (nt->enabled)
>> + goto busy;
>> + spin_unlock_irqrestore(&target_list_lock, flags);
>>
>
> This looks wrong. Unless there is another lock or mutex covering this
> function, at this point (after spin_unlock_irqrestore()) another
> thread might set nt->enabled = 1.
>
Agreed that this looks wrong :)
It is fixed in the next patch where a state machine is introduced to
replace the binary flag nt->enabled. The code before this patch had
the a very similar problem in that a target could be enabled twice.
store_enabled() would call netpoll_setup() the second time without
checking to see if it was already enabled.
^ permalink raw reply
* Re: [PATCH v3 03/22] netconsole: Introduce 'enabled' state-machine
From: Mike Waychison @ 2010-12-14 23:33 UTC (permalink / raw)
To: Michał Mirosław
Cc: simon.kagstrom, davem, nhorman, Matt Mackall, adurbin,
linux-kernel, chavey, Greg KH, netdev, Américo Wang, akpm,
linux-api
In-Reply-To: <AANLkTik8wzDPPtMM+YPoOSojiW_Nev-KDkAg8dtDV=g1@mail.gmail.com>
2010/12/14 Michał Mirosław <mirqus@gmail.com>:
> 2010/12/14 Mike Waychison <mikew@google.com>:
>> Representing the internal state within netconsole isn't really a boolean
>> value, but rather a state machine with transitions.
> [...]
>> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
>> index 6e16888..288a025 100644
>> --- a/drivers/net/netconsole.c
>> +++ b/drivers/net/netconsole.c
> [...]
>> @@ -350,9 +362,9 @@ static ssize_t store_enabled(struct netconsole_target *nt,
>> err = netpoll_setup(&nt->np);
>> spin_lock_irqsave(&target_list_lock, flags);
>> if (err)
>> - nt->enabled = 0;
>> + nt->np_state = NETPOLL_DISABLED;
>> else
>> - nt->enabled = 1;
>> + nt->np_state = NETPOLL_ENABLED;
>> spin_unlock_irqrestore(&target_list_lock, flags);
>> if (err)
>> return err;
> [...]
>
> Since the spinlock protects only nt->np_state setting, you might be
> able to remove it altogether and use cmpxchg() where nt->np_state
> transitions from enabled or disabled state.
>
> Maybe the locking scheme just needs more thought altogether?
The target_list_lock protects the list, as well as the state
transitions. This makes iterating through the list and getting a
consistent view of the targets a lot easier when it comes time to
transmitting packets we are guaranteed that nobody is changing the
target state underneath us if nt->np_state == NETPOLL_ENABLED while we
hold the lock.
^ permalink raw reply
* Re: [*v2 PATCH 00/22] IPVS, Network Name Space aware
From: Julian Anastasov @ 2010-12-14 23:43 UTC (permalink / raw)
To: Hans Schillstrom
Cc: horms, daniel.lezcano, wensong, lvs-devel, netdev,
netfilter-devel, hans
In-Reply-To: <1292247510-753-1-git-send-email-hans.schillstrom@ericsson.com>
Hello,
On Mon, 13 Dec 2010, Hans Schillstrom wrote:
> This patch series adds network name space support to the LVS.
>
> REVISION
>
> This is version 2
>
> OVERVIEW
>
> The patch doesn't remove or add any functionality except for netns.
> For users that don't use network name space (netns) this patch is
> completely transparent.
>
> Now it's possible to run LVS in a Linux container (see lxc-tools)
> i.e. a light weight visualization. For example it's possible to run
> one or several lvs on a real server in their own network name spaces.
>> From the LVS point of view it looks like it runs on it's own machine.
>
> IMPLEMENTATION
> Basic requirements for netns awareness
> - Global variables has to be moved to dyn. allocated memory.
> - No or very little performance loss
>
> Large hash tables connection hash and service hashes still resides in
> global memory with net ptr added in hash key.
> Most global variables now resides in a struct ipvs { } in netns/ip_vs.h.
> The size of per name space is 2004 bytes (for x86_64) and a little bit less
> for 32 bit archs.
>
> Statistics counters is now lock-free i.e. incremented per CPU,
> The estimator does a sum when using it.
>
> Procfs ip_vs_stats is also changed to reflect the "per cpu"
> ex.
> # cat /proc/net/ip_vs_stats
> Total Incoming Outgoing Incoming Outgoing
> CPU Conns Packets Packets Bytes Bytes
> 0 0 3 1 9D 34
> 1 0 1 2 49 70
> 2 0 1 2 34 76
> 3 1 2 2 70 74
> ~ 1 7 7 18A 18E
>
> Conns/s Pkts/s Pkts/s Bytes/s Bytes/s
> 0 0 0 0 0
>
> Algorithm files are untouched except for lblc and lblcr.
Great! I have some small comments after first look:
v2 PATCH 01/22 - basic init
- first change in ip_vs_conn.c adds existing code:
/* Compute size and mask */
v2 PATCH 02/22 - services part 1
- net = skb_net(skb) in ip_vs_out must be after
check for skb_dst. The skb_dst checks are in ip_vs_in and
ip_vs_out, so skb_net() can be used only after these checks.
- __ip_vs_service_find and __ip_vs_svc_fwm_find are fast path,
may be net_eq(svc->net, net) check can be last, I assume
the different netns will use different VIPs and VPORTs?
- ip_vs_svc_table and ip_vs_svc_fwm_table are not per-ns,
so we can not use per-ns mutex in patch 17
v2 PATCH 03/22 - lblcr
v2 PATCH 04/22 - lblc
v2 PATCH 05/22 - prepare protocol
v2 PATCH 06/22 - tcp
v2 PATCH 07/22 - udp
v2 PATCH 08/22 - sctp
v2 PATCH 09/22 - AH, ESP
v2 PATCH 10/22 - use ip_vs_proto_data as param
- update_defense_level: are per-ns memory stats/limits possible?
- The pp -> pd conversion should start from functions like
ip_vs_out() that use pp = ip_vs_proto_get(iph.protocol),
now they should use
ip_vs_proto_data_get(net, iph.protocol). If
pp is needed, it is available from pd->pp. Many functions
that provide pp as argument should now provide pd.
Then 2nd lookups for proto like in ip_vs_set_state should
disappear.
- copy-and-paste bug in ip_vs_ctl.c:ip_vs_set_timeout():
pd = ip_vs_proto_data_get(net, IPPROTO_TCP)
should be IPPROTO_UDP
- may be ip_vs_protocol_timeout_change should propagate
event to all pd, not all pp?
v2 PATCH 11/22 - appcnt
v2 PATCH 12/22 - apps
v2 PATCH 13/22 - ip_vs_est
- estimation_timer: what protection is needed for for_each_net?
It is rtnl for user context and RCU for softirq?
May be est_timer must be per NS? Now may be rcu_read_lock is
needed before for_each_net_rcu ? for_each_net can be called
only under rtnl_lock?
v2 PATCH 14/22 - ip_vs_sync
v2 PATCH 15/22 - ip_vs_stats
- This was one of the hurdles for IPVS RCU conversion, the others
being dest->svc->stats and scheduler state. But can this
change break some scripts that parse /proc/net/ip_vs_stats ?
v2 PATCH 16/22 - connection hash
v2 PATCH 17/22 - ip_vs_ctl local vars
- I hope it is not fatal if __ip_vs_mutex remains global
because svc lists are global in patch 2
v2 PATCH 18/22 - defense work
v2 PATCH 19/22 - trash
v2 PATCH 20/22 - global svc counters
v2 PATCH 21/22 - init_net removal
v2 PATCH 22/22 - enable netns
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: [PATCH update 3] firewire: net: add carrier detection
From: Maxim Levitsky @ 2010-12-14 23:46 UTC (permalink / raw)
To: Stefan Richter; +Cc: Ben Hutchings, Peter Stuge, linux1394-devel, netdev
In-Reply-To: <20101214000154.06ec5153@stein>
On Tue, 2010-12-14 at 00:01 +0100, Stefan Richter wrote:
> From: Maxim Levitsky <maximlevitsky@gmail.com>
>
> To make userland, e.g. NetworkManager work with firewire, we need to
> detect whether cable is plugged or not. Simple and correct way of doing
> that is just counting number of peers. No peers - no link and vice
> versa.
>
> (Stefan R.: Combined peer_count inc/dec with tests, added link-down
> recognition in fwnet_open, added include.)
>
> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
> ---
> Update 3: added fwnet_open (ifup) hunk
Thank you very much.
I tested this just in case, and it works just fine.
Especially thanks for the missing carrier state initialization,
Just one note, since you pretty much rewrite that little patch, it would
be correct to attribute you as an author of it.
I was recently (and still am) busy with my DVB card, so I didn't test my
original patch enough.
Beyond this patch, firewire networking is pretty much complete.
The only missing parts are IPV6 and multicast, and the latter works by
using broadcast which for all means is enough.
>
> drivers/firewire/net.c | 29 +++++++++++++++++++++++++----
> 1 file changed, 25 insertions(+), 4 deletions(-)
>
> Index: b/drivers/firewire/net.c
> ===================================================================
> --- a/drivers/firewire/net.c
> +++ b/drivers/firewire/net.c
> @@ -9,6 +9,7 @@
> #include <linux/bug.h>
> #include <linux/delay.h>
> #include <linux/device.h>
> +#include <linux/ethtool.h>
> #include <linux/firewire.h>
> #include <linux/firewire-constants.h>
> #include <linux/highmem.h>
> @@ -179,6 +180,7 @@ struct fwnet_device {
> /* Number of tx datagrams that have been queued but not yet acked */
> int queued_datagrams;
>
> + int peer_count;
> struct list_head peer_list;
> struct fw_card *card;
> struct net_device *netdev;
> @@ -1234,6 +1236,13 @@ static int fwnet_open(struct net_device
> }
> netif_start_queue(net);
>
> + mutex_lock(&fwnet_device_mutex);
> + if (dev->peer_count > 1)
> + netif_carrier_on(net);
> + else
> + netif_carrier_off(net);
> + mutex_unlock(&fwnet_device_mutex);
> +
> return 0;
> }
>
> @@ -1412,6 +1421,10 @@ static const struct net_device_ops fwnet
> .ndo_change_mtu = fwnet_change_mtu,
> };
>
> +static const struct ethtool_ops fwnet_ethtool_ops = {
> + .get_link = ethtool_op_get_link,
> +};
> +
> static void fwnet_init_dev(struct net_device *net)
> {
> net->header_ops = &fwnet_header_ops;
> @@ -1423,6 +1436,7 @@ static void fwnet_init_dev(struct net_de
> net->hard_header_len = FWNET_HLEN;
> net->type = ARPHRD_IEEE1394;
> net->tx_queue_len = FWNET_TX_QUEUE_LEN;
> + net->ethtool_ops = &fwnet_ethtool_ops;
> }
>
> /* caller must hold fwnet_device_mutex */
> @@ -1465,6 +1479,10 @@ static int fwnet_add_peer(struct fwnet_d
> list_add_tail(&peer->peer_link, &dev->peer_list);
> spin_unlock_irq(&dev->lock);
>
> + /* serialized by fwnet_device_mutex */
> + if (++dev->peer_count > 1)
> + netif_carrier_on(dev->netdev);
> +
> return 0;
> }
>
> @@ -1543,13 +1561,16 @@ static int fwnet_probe(struct device *_d
> return ret;
> }
>
> -static void fwnet_remove_peer(struct fwnet_peer *peer)
> +static void fwnet_remove_peer(struct fwnet_peer *peer, struct fwnet_device *dev)
> {
> struct fwnet_partial_datagram *pd, *pd_next;
>
> - spin_lock_irq(&peer->dev->lock);
> + if (--dev->peer_count == 1)
> + netif_carrier_off(dev->netdev);
> +
> + spin_lock_irq(&dev->lock);
> list_del(&peer->peer_link);
> - spin_unlock_irq(&peer->dev->lock);
> + spin_unlock_irq(&dev->lock);
>
> list_for_each_entry_safe(pd, pd_next, &peer->pd_list, pd_link)
> fwnet_pd_delete(pd);
> @@ -1566,7 +1587,7 @@ static int fwnet_remove(struct device *_
>
> mutex_lock(&fwnet_device_mutex);
>
> - fwnet_remove_peer(peer);
> + fwnet_remove_peer(peer, dev);
>
> if (list_empty(&dev->peer_list)) {
> net = dev->netdev;
>
>
^ permalink raw reply
* Re: [PATCH v3 14/22] netpoll: Move target code into netpoll_targets.c
From: Mike Waychison @ 2010-12-15 0:07 UTC (permalink / raw)
To: simon.kagstrom, davem, nhorman, Matt Mackall
Cc: adurbin, linux-kernel, chavey, Greg KH, netdev, Américo Wang,
akpm, linux-api
In-Reply-To: <20101214213010.17022.54049.stgit@mike.mtv.corp.google.com>
Ugh. I just realized that I was missing a MODULE_LICENSE("GPL"); for
this new module, otherwise module load fails to find the link for
cancel_work_sync.
---
netpoll: Add missing module license for netpoll_targets
Add a missing module license declaration to netpoll_targets that allows
it to use exported symbols (cancel_work_sync).
Signed-off-by: Mike Waychison <mikew@google.com>
diff --git a/net/core/netpoll_targets.c b/net/core/netpoll_targets.c
index 5fc84f8c..0887268 100644
--- a/net/core/netpoll_targets.c
+++ b/net/core/netpoll_targets.c
@@ -747,3 +747,4 @@ void unregister_netpoll_targets(struct netpoll_targets *nts)
}
EXPORT_SYMBOL_GPL(unregister_netpoll_targets);
+MODULE_LICENSE("GPL");
^ permalink raw reply related
* Re: [PATCH 4/5 v2] ifb: add multiqueue support
From: Changli Gao @ 2010-12-15 0:20 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <1292342358.5934.10.camel@edumazet-laptop>
On Tue, Dec 14, 2010 at 11:59 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
>
> There is a problem here.
>
> You should sum in the loop rx_counters only, (the counters syncp
> protected), and use dev_txq_stats_fold() to get the tx_counters from
> core network.
Hmm, in ifb, txq->tx_counters aren't used in ifb_xmit() but
ri_tasklet(). IOW, rx and tx are reversed. Here I use txq->tx_counters
to reduce duplicate counters in ifb_q_private. Unless these variables
might be accessed outside of ifb, I can use them freely? Thanks.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Michael Leun @ 2010-12-15 0:24 UTC (permalink / raw)
To: Matt Carlson
Cc: Jesse Gross, Michael Chan, Eric Dumazet, David Miller, Ben Greear,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <20101214191500.GD19951@mcarlson.broadcom.com>
On Tue, 14 Dec 2010 11:15:00 -0800
"Matt Carlson" <mcarlson@broadcom.com> wrote:
> On Mon, Dec 13, 2010 at 08:07:20PM -0800, Jesse Gross wrote:
> > On Mon, Dec 13, 2010 at 2:45 PM, Matt Carlson
> > <mcarlson@broadcom.com> wrote:
> > > On Sun, Dec 12, 2010 at 04:11:13PM -0800, Jesse Gross wrote:
> > >> On Mon, Dec 6, 2010 at 1:27 PM, Michael Leun
> > >> <lkml20101129@newton.leun.net> wrote:
> > >> > On Mon, 6 Dec 2010 12:04:48 -0800
> > >> > Jesse Gross <jesse@nicira.com> wrote:
> > >> >
> > >> >> On Mon, Dec 6, 2010 at 11:34 AM, Michael Leun
> > >> >> <lkml20101129@newton.leun.net> wrote:
> > >> >> > On Mon, 6 Dec 2010 10:14:55 -0800
> > >> >> > Jesse Gross <jesse@nicira.com> wrote:
> > >> >> >
> > >> >> >> On Sun, Dec 5, 2010 at 2:44 AM, Michael Leun
> > >> >> >> <lkml20101129@newton.leun.net> wrote:
> > >> >> >> > Hi Jesse,
> > >> >> >> >
> > >> >> >> > On Sun, 5 Dec 2010 10:55:28 +0100
> > >> >> >> > Michael Leun <lkml20101129@newton.leun.net> wrote:
> > >> >> >> >
> > >> >> >> >> On Sun, 05 Dec 2010 09:03:53 +0100
> > >> >> >> >> Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > >> >> >> >>
> > >> >> >> >> > > But on
> > >> >> >> >> > >
> > >> >> >> >> > > hpdl320g5:/home/ml # lspci | grep Eth
> > >> >> >> >> > > 03:04.0 Ethernet controller: Broadcom Corporation
> > >> >> >> >> > > NetXtreme BCM5714 Gigabit Ethernet (rev a3) 03:04.1
> > >> >> >> >> > > Ethernet controller: Broadcom Corporation NetXtreme
> > >> >> >> >> > > BCM5714 Gigabit Ethernet (rev a3)
> > >> >> >> >> > >
> > >> >> >> >> > > the good message is that it also does not crash,
> > >> >> >> >> > > but with tcpdump I see vlan tags when no vlan
> > >> >> >> >> > > devices configured on the respective eth, if so I
> > >> >> >> >> > > do not see tags anymore vlan tags on the trunk
> > >> >> >> >> > > interface.
> > >> >> >> >> > >
> > >> >> >> >> >
> > >> >> >> >> > For all these very specific needs, you'll have to try
> > >> >> >> >> > 2.6.37 I am afraid. Jesse did huge changes to exactly
> > >> >> >> >> > make this working, we wont backport this to 2.6.36,
> > >> >> >> >> > but only avoid crashes.
> > >> >> >> >>
> > >> >> >> >> OK, I'm perfectly fine with that, of course, actually
> > >> >> >> >> nice to hear that the issue already is addressed.
> > >> >> >> >>
> > >> >> >> >> Likely I'll give some rc an shot on this machine (maybe
> > >> >> >> >> over christmas), but it is an production machine
> > >> >> >> >> (acutally testing other devices is the "product"
> > >> >> >> >> produced on this machine), so unfortunately I'm not
> > >> >> >> >> that free in when and what I can do (but the
> > >> >> >> >> possibility to, for example, bridge the trunk interface
> > >> >> >> >> would make testing easier, that justifies something...).
> > >> >> >> >>
> > >> >> >> >> Thank you all very much for your work.
> > >> >> >> >
> > >> >> >> > Are these changes already in 2.6.37-rc4? Or, if not are
> > >> >> >> > they somewhere publically available already?
> > >> >> >> >
> > >> >> >> > I looked into various changelogs but have some
> > >> >> >> > difficulties to identify them...
> > >> >> >> >
> > >> >> >> > Maybe I have some time next days to give them an try...
> > >> >> >>
> > >> >> >> Yes, all of the existing vlan changes are in
> > >> >> >> 2.6.37-rc4. ?There were a number of patches but the main
> > >> >> >> one was 3701e51382a026cba10c60b03efabe534fba4ca4
> > >> >> >
> > >> >> > Then, I'm afraid, this (seeing vlan tags even if vlan
> > >> >> > interfaces are configured) does not work on HP DL320G5 (for
> > >> >> > exact description and examples please see my mail a few
> > >> >> > days ago).
> > >> >>
> > >> >> What driver are you using? ?Is it tg3?
> > >> >>
> > >> >> The vlan changes that I made unfortunately require updating
> > >> >> drivers to get the full benefit. ?I've been busy lately so
> > >> >> tg3 hasn't yet been updated.
> > >> >>
> > >> >> I know that tg3 does some things differently depending on
> > >> >> whether a vlan group is configured, so that would likely be
> > >> >> the cause of what you are seeing. ?I'd have to look at it in
> > >> >> more detail to be sure though.
> > >> >>
> > >> >> You said that everything works on the other Broadcom NIC that
> > >> >> you tested? ?Maybe it uses bnx2 instead?
> > >> >>
> > >> >
> > >> > Both machines use tg3 / 2.6.36.1 - one is opensuse, one ubuntu
> > >> > (but this should not matter, I think).
> > >> >
> > >> > If I can do anything to support your investigations / work
> > >> > (most likely testing / providing information) please let me
> > >> > know.
> > >>
> > >> Unfortunately, I probably won't have time to look at this in the
> > >> near future. ?Given that the test works on one NIC but not
> > >> another that strongly suggests that it is a driver problem, even
> > >> if both NICs use the same driver. ?I see tg3 can do different
> > >> things with vlans depending on the model and what features are
> > >> enabled. ?I also ran a quick test on some of my machines and I
> > >> didn't experience this issue. They are running net-next with
> > >> ixgbe.
> > >>
> > >> One of the main goals of my general vlan changes was to remove
> > >> as much logic as possible from the drivers and put it in the
> > >> networking core, so we should in theory see consistent
> > >> behavior. ?However, in 2.6.36 and earlier, each driver knows
> > >> about what vlan devices are configured and does different things
> > >> with that information.
> > >>
> > >> Given all of that, the most logical step to me is simply to
> > >> convert tg3 to use the new vlan infrastructure. ?It should be
> > >> done regardless and it will probably solve this problem. ?Maybe
> > >> you can convince the Broadcom guys to do that? ?It would be a
> > >> lot faster for them to do it than me.
> > >
> > > Below is the patch that converts the tg3 driver over to the new
> > > API. ?I don't see how it could fix the problem though. ?Maybe the
> > > presence of NETIF_F_HW_VLAN_TX changes things.
> >
> > Thanks Matt.
> >
> > There's actually a little bit more that needs to be done for
> > conversion. All references to the vlan group should be gone since
> > that logic has been moved to the networking core.
> > tg3_vlan_rx_register() completely disappears and all other code
> > contained in TG3_VLAN_TAG_USED is unconditionally active. Ideally,
> > there would be an Ethtool set_flags function so that the vlan
> > offloading features could be enabled/disabled for situations like
> > this to help with debugging.
> >
> > The reason why I think that this might help is that the problem
> > manifests when a vlan group is configured, even if that vlan isn't
> > used. Since this removes all logic about vlan groups from the
> > driver, it should avoid any problems in that area. It's possible
> > that the actual issue is somewhere else but then it should be
> > easier to find since we can separate out the different components.
>
> Thanks for the comments Jesse. Below is an updated patch.
>
> Michael, I'm wondering if the difference in behavior can be explained
> by the presence or absence of management firmware. Can you look at
> the driver sign-on messages in your syslogs for ASF[]? I'm half
> expecting the 5752 to show "ASF[0]" and the 5714 to show "ASF[1]".
> If you see this, and the below patch doesn't fix the problem, let me
> know. I have another test I'd like you to run.
Do I understand this correct? "Management firmware" or ASF is some
feature, vendor decides to built into network card (firmware) or not?
If so, would'nt one expect two oneboard network cards in one server
to look alike?
HP Proliant DL320G5
<6>tg3.c:v3.113 (August 2, 2010)
<6>tg3 0000:03:04.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
<6>tg3 0000:03:04.0: eth0: Tigon3 [partno(N/A) rev 9003] (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx
<6>tg3 0000:03:04.0: eth0: attached PHY is 5714 (10/100/1000Base-T Ethernet) (WireSpeed[1])
<6>tg3 0000:03:04.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] TSOcap[1]
<6>tg3 0000:03:04.0: eth0: dma_rwctrl[76148000] dma_mask[64-bit]
<6>tg3 0000:03:04.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
<6>tg3 0000:03:04.1: eth1: Tigon3 [partno(N/A) rev 9003] (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx
<6>tg3 0000:03:04.1: eth1: attached PHY is 5714 (10/100/1000Base-T Ethernet) (WireSpeed[1])
<6>tg3 0000:03:04.1: eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
<6>tg3 0000:03:04.1: eth1: dma_rwctrl[76148000] dma_mask[64-bit]
Lenovo ThinkPad z61m
[ 2.679130] tg3.c:v3.113 (August 2, 2010)
[ 2.679176] tg3 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 2.679188] tg3 0000:02:00.0: setting latency timer to 64
[ 2.728572] tg3 0000:02:00.0: eth0: Tigon3 [partno(BCM95752m) rev 6002] (PCI Express) MAC address xx:xx:xx:xx:xx:xx
[ 2.728577] tg3 0000:02:00.0: eth0: attached PHY is 5752 (10/100/1000Base-T Ethernet) (WireSpeed[1])
[ 2.728581] tg3 0000:02:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
[ 2.728585] tg3 0000:02:00.0: eth0: dma_rwctrl[76180000]
dma_mask[64-bit]
> ----
>
> [PATCH] tg3: Use new VLAN code
Unfortunately had'nt time to try much now, but with 2.6.37-rc5 / your
patch on the DL320, single user mode (nothing configured on eth) just
after ifconfig eth0/eth1 up I see NO vlan tags on eth0 but I see vlan
tags on eth1, so there clearly is a difference.
I should have checked if I still see vlan tags on eth1 if I configure
some vlan there - if helpful maybe I can do this (have to look, when I
can effort another downtime).
I wonder, if the difference in that both onboard cards is really there
or if there is some malfunction in detecion?
--
MfG,
Michael Leun
^ permalink raw reply
* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2010-12-15 0:45 UTC (permalink / raw)
To: David Miller, netdev; +Cc: linux-next, linux-kernel, Vladislav Zolotarov
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
Hi all,
Today's linux-next merge of the net tree got a conflict in
drivers/net/bnx2x/bnx2x.h between commit
9f5449611c9d6d7bdcae8020a197d8b4d9b6443c ("bnx2x: Advance a version
number to 1.60.01-0") from the net-current tree and commit
f404c2fea37e02bec7c8b6edddf5edd22ca60505 ("bnx2x: Update version number
and a date") from the net tree.
So the net tree one has a later date, but a lower version number ... I
just used the version from the net tree.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: [PATCH 1/9] drivers/net: remove unnecessary flush_scheduled_work() calls
From: Jon Mason @ 2010-12-15 0:54 UTC (permalink / raw)
To: Tejun Heo
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net, Wolfgang Grandegger, Stephen Hemminger,
Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur
In-Reply-To: <1292169185-10579-2-git-send-email-tj@kernel.org>
On Sun, Dec 12, 2010 at 07:52:57AM -0800, Tejun Heo wrote:
> janz-ican3, sh_eth, skge and vxge don't use workqueue at all and there
> is no reason to flush the system_wq. Drop flush_scheduled_work()
> calls and references to workqueue.
I believe you were referencing an older version of the vxge driver.
These is now a reset task that runs on the system workqueue. Based on
your other patches, the flush_scheduled_work should be replaced with a
cancel_delayed_work_sync(&vdev->reset_task)
Thanks,
Jon
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
> Cc: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
> Cc: Sivakumar Subramani <sivakumar.subramani@exar.com>
> Cc: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
> Cc: Jon Mason <jon.mason@exar.com>
> Cc: netdev@vger.kernel.org
> ---
> drivers/net/can/janz-ican3.c | 9 ---------
> drivers/net/sh_eth.c | 1 -
> drivers/net/sh_eth.h | 1 -
> drivers/net/skge.c | 2 --
> drivers/net/vxge/vxge-main.c | 2 --
> 5 files changed, 0 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
> index 6e533dc..b9a6d7a 100644
> --- a/drivers/net/can/janz-ican3.c
> +++ b/drivers/net/can/janz-ican3.c
> @@ -1114,11 +1114,6 @@ static bool ican3_txok(struct ican3_dev *mod)
> /*
> * Recieve one CAN frame from the hardware
> *
> - * This works like the core of a NAPI function, but is intended to be called
> - * from workqueue context instead. This driver already needs a workqueue to
> - * process control messages, so we use the workqueue instead of using NAPI.
> - * This was done to simplify locking.
> - *
> * CONTEXT: must be called from user context
> */
> static int ican3_recv_skb(struct ican3_dev *mod)
> @@ -1251,7 +1246,6 @@ static irqreturn_t ican3_irq(int irq, void *dev_id)
> * Reset an ICAN module to its power-on state
> *
> * CONTEXT: no network device registered
> - * LOCKING: work function disabled
> */
> static int ican3_reset_module(struct ican3_dev *mod)
> {
> @@ -1262,9 +1256,6 @@ static int ican3_reset_module(struct ican3_dev *mod)
> /* disable interrupts so no more work is scheduled */
> iowrite8(1 << mod->num, &mod->ctrl->int_disable);
>
> - /* flush any pending work */
> - flush_scheduled_work();
> -
> /* the first unallocated page in the DPM is #9 */
> mod->free_page = DPM_FREE_START;
>
> diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
> index b12660d..819c175 100644
> --- a/drivers/net/sh_eth.c
> +++ b/drivers/net/sh_eth.c
> @@ -1552,7 +1552,6 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
>
> sh_mdio_release(ndev);
> unregister_netdev(ndev);
> - flush_scheduled_work();
> pm_runtime_disable(&pdev->dev);
> free_netdev(ndev);
> platform_set_drvdata(pdev, NULL);
> diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h
> index 8b47763..efa6422 100644
> --- a/drivers/net/sh_eth.h
> +++ b/drivers/net/sh_eth.h
> @@ -26,7 +26,6 @@
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/spinlock.h>
> -#include <linux/workqueue.h>
> #include <linux/netdevice.h>
> #include <linux/phy.h>
>
> diff --git a/drivers/net/skge.c b/drivers/net/skge.c
> index 220e039..8c1404b 100644
> --- a/drivers/net/skge.c
> +++ b/drivers/net/skge.c
> @@ -4012,8 +4012,6 @@ static void __devexit skge_remove(struct pci_dev *pdev)
> if (!hw)
> return;
>
> - flush_scheduled_work();
> -
> dev1 = hw->dev[1];
> if (dev1)
> unregister_netdev(dev1);
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index b771e4b..537ad87 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
> @@ -3439,8 +3439,6 @@ static void vxge_device_unregister(struct __vxge_hw_device *hldev)
>
> strncpy(buf, dev->name, IFNAMSIZ);
>
> - flush_scheduled_work();
> -
> /* in 2.6 will call stop() if device is up */
> unregister_netdev(dev);
>
> --
> 1.7.1
>
The information and any attached documents contained in this message
may be confidential and/or legally privileged. The message is
intended solely for the addressee(s). If you are not the intended
recipient, you are hereby notified that any use, dissemination, or
reproduction is strictly prohibited and may be unlawful. If you are
not the intended recipient, please contact the sender immediately by
return e-mail and destroy all copies of the original message.
^ permalink raw reply
* Re: [PATCHv2] fragment locally-generated IPsec6 packets that need it
From: Herbert Xu @ 2010-12-15 0:59 UTC (permalink / raw)
To: David L Stevens; +Cc: davem, netdev
In-Reply-To: <1292351554.4720.7.camel@IBM-1B506CFC885>
On Tue, Dec 14, 2010 at 10:32:34AM -0800, David L Stevens wrote:
>
> @@ -88,8 +89,17 @@ static int xfrm6_output_finish(struct sk
> return xfrm_output(skb);
> }
>
> -int xfrm6_output(struct sk_buff *skb)
> +static int __xfrm6_output(struct sk_buff *skb)
> {
> return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL,
> skb_dst(skb)->dev, xfrm6_output_finish);
> }
> +
> +int xfrm6_output(struct sk_buff *skb)
> +{
> + if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
> + dst_allfrag(skb_dst(skb))) {
> + return ip6_fragment(skb, __xfrm6_output);
> + }
> + return __xfrm6_output(skb);
> +}
Oops, I didn't notice this the first time around. The fragmentation
call should occur after POST_ROUTING.
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH] fix IPv6 queries for bridge multicast snooping
From: Herbert Xu @ 2010-12-15 1:00 UTC (permalink / raw)
To: David L Stevens; +Cc: davem, netdev
In-Reply-To: <1292352136.4720.11.camel@IBM-1B506CFC885>
On Tue, Dec 14, 2010 at 10:42:16AM -0800, David L Stevens wrote:
> This patch fixes a missing ntohs() for bridge IPv6 multicast snooping.
>
> Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
I had wanted to fix this but forgot :)
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* [PATCH 3/3] net: Fix drivers advertising HW_CSUM feature to use csum_start
From: Michał Mirosław @ 2010-12-15 1:24 UTC (permalink / raw)
To: netdev
Cc: Roopa Prabhu, Eric Dumazet, Jiri Pirko, e1000-devel,
Shreyas Bhatewara, Jie Yang, Vasanthy Kolluri, VMware, Inc.,
Brice Goglin, Andrew Gallatin, Joe Perches, David Wang,
Stephen Hemminger, David S. Miller, H Hartley Sweeten
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>
Some drivers are using skb_transport_offset(skb) instead of skb->csum_start
for NETIF_F_HW_CSUM offload. This does not matter now, but if someone
implements checksumming of encapsulated packets then this will break silently.
TSO output paths are left as they are, since they are for IP+TCP only
(might be worth converting though).
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/atl1c/atl1c_main.c | 2 +-
drivers/net/atl1e/atl1e_main.c | 2 +-
drivers/net/cassini.c | 2 +-
drivers/net/e1000/e1000_main.c | 2 +-
drivers/net/e1000e/netdev.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/ixgb/ixgb_main.c | 2 +-
drivers/net/ll_temac_main.c | 2 +-
drivers/net/myri10ge/myri10ge.c | 2 +-
drivers/net/niu.c | 2 +-
drivers/net/skge.c | 2 +-
drivers/net/sungem.c | 2 +-
drivers/net/sunhme.c | 2 +-
drivers/net/vmxnet3/vmxnet3_drv.c | 4 ++--
14 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index 09b099b..e48ea95 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -2078,7 +2078,7 @@ static int atl1c_tso_csum(struct atl1c_adapter *adapter,
check_sum:
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
u8 css, cso;
- cso = skb_transport_offset(skb);
+ cso = skb_checksum_start_offset(skb);
if (unlikely(cso & 0x1)) {
if (netif_msg_tx_err(adapter))
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index ef6349b..e28f8ba 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -1649,7 +1649,7 @@ check_sum:
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
u8 css, cso;
- cso = skb_transport_offset(skb);
+ cso = skb_checksum_start_offset(skb);
if (unlikely(cso & 0x1)) {
netdev_err(adapter->netdev,
"payload offset should not ant event number\n");
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index a8a32bc..73502fe 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -2788,7 +2788,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
ctrl = 0;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- const u64 csum_start_off = skb_transport_offset(skb);
+ const u64 csum_start_off = skb_checksum_start_offset(skb);
const u64 csum_stuff_off = csum_start_off + skb->csum_offset;
ctrl = TX_DESC_CSUM_EN |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 491bf2a..340e12d 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2726,7 +2726,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter,
break;
}
- css = skb_transport_offset(skb);
+ css = skb_checksum_start_offset(skb);
i = tx_ring->next_to_use;
buffer_info = &tx_ring->buffer_info[i];
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 02d093d..a45dafd 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4473,7 +4473,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
break;
}
- css = skb_transport_offset(skb);
+ css = skb_checksum_start_offset(skb);
i = tx_ring->next_to_use;
buffer_info = &tx_ring->buffer_info[i];
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 77d9138..9710047 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -702,7 +702,7 @@ static inline void enic_queue_wq_skb_csum_l4(struct enic *enic,
{
unsigned int head_len = skb_headlen(skb);
unsigned int len_left = skb->len - head_len;
- unsigned int hdr_len = skb_transport_offset(skb);
+ unsigned int hdr_len = skb_checksum_start_offset(skb);
unsigned int csum_offset = hdr_len + skb->csum_offset;
int eop = (len_left == 0);
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index b021798..5639ccc 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1262,7 +1262,7 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
struct ixgb_buffer *buffer_info;
- css = skb_transport_offset(skb);
+ css = skb_checksum_start_offset(skb);
cso = css + skb->csum_offset;
i = adapter->tx_ring.next_to_use;
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index 9f8e702..e2c2a72 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -692,7 +692,7 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
cur_p->app0 = 0;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- unsigned int csum_start_off = skb_transport_offset(skb);
+ unsigned int csum_start_off = skb_checksum_start_offset(skb);
unsigned int csum_index_off = csum_start_off + skb->csum_offset;
cur_p->app0 |= 1; /* TX Checksum Enabled */
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 1ce0207..a37fcf1 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -2736,7 +2736,7 @@ again:
odd_flag = 0;
flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST);
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
- cksum_offset = skb_transport_offset(skb);
+ cksum_offset = skb_checksum_start_offset(skb);
pseudo_hdr_offset = cksum_offset + skb->csum_offset;
/* If the headers are excessively large, then we must
* fall back to a software checksum */
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f64c424..2541321 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6589,7 +6589,7 @@ static u64 niu_compute_tx_flags(struct sk_buff *skb, struct ethhdr *ehdr,
(ip_proto == IPPROTO_UDP ?
TXHDR_CSUM_UDP : TXHDR_CSUM_SCTP));
- start = skb_transport_offset(skb) -
+ start = skb_checksum_start_offset(skb) -
(pad_bytes + sizeof(struct tx_pkt_hdr));
stuff = start + skb->csum_offset;
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8c1404b..50815fb 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2764,7 +2764,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
td->dma_hi = map >> 32;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- const int offset = skb_transport_offset(skb);
+ const int offset = skb_checksum_start_offset(skb);
/* This seems backwards, but it is what the sk98lin
* does. Looks like hardware is wrong?
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 9e992ca..1c5408f 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1004,7 +1004,7 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
ctrl = 0;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- const u64 csum_start_off = skb_transport_offset(skb);
+ const u64 csum_start_off = skb_checksum_start_offset(skb);
const u64 csum_stuff_off = csum_start_off + skb->csum_offset;
ctrl = (TXDCTRL_CENAB |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 5e28c41..55bbb9c 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2266,7 +2266,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb,
tx_flags = TXFLAG_OWN;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- const u32 csum_start_off = skb_transport_offset(skb);
+ const u32 csum_start_off = skb_checksum_start_offset(skb);
const u32 csum_stuff_off = csum_start_off + skb->csum_offset;
tx_flags = (TXFLAG_OWN | TXFLAG_CSENABLE |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 0169be7..d87a230 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -798,7 +798,7 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
{
struct Vmxnet3_TxDataDesc *tdd;
- if (ctx->mss) {
+ if (ctx->mss) { /* TSO */
ctx->eth_ip_hdr_size = skb_transport_offset(skb);
ctx->l4_hdr_size = ((struct tcphdr *)
skb_transport_header(skb))->doff * 4;
@@ -807,7 +807,7 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
unsigned int pull_size;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- ctx->eth_ip_hdr_size = skb_transport_offset(skb);
+ ctx->eth_ip_hdr_size = skb_checksum_start_offset(skb);
if (ctx->ipv4) {
struct iphdr *iph = (struct iphdr *)
--
1.7.2.3
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
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 1/3] net: Introduce skb_checksum_start_offset()
From: Michał Mirosław @ 2010-12-15 1:24 UTC (permalink / raw)
To: netdev
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>
Introduce skb_checksum_start_offset() to replace repetitive calculation.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
include/linux/skbuff.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 19f37a6..0491da5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1355,6 +1355,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
}
#endif /* NET_SKBUFF_DATA_USES_OFFSET */
+static inline int skb_checksum_start_offset(const struct sk_buff *skb)
+{
+ return skb->csum_start - skb_headroom(skb);
+}
+
static inline int skb_transport_offset(const struct sk_buff *skb)
{
return skb_transport_header(skb) - skb->data;
--
1.7.2.3
^ permalink raw reply related
* [PATCH 0/3] Fix NETIF_F_HW_CSUM implementations [v2]
From: Michał Mirosław @ 2010-12-15 1:24 UTC (permalink / raw)
To: netdev
This is a split version of a patch fixing NETIF_F_HW_CSUM implementations
in network drivers. For easier review, this is split into three patches:
1. introduce skb_checksum_start_offset() helper
2. convert correct implementations to use the helper from #1
3. fix bad uses of skb_transport_offset() using helper from #1
Patches are against net-next, commit 0dbaee3b37e118a96bb7b8eb0d9bbaeeb46264be
net: Abstract default ADVMSS behind an accessor.
Best Regards,
Michał Mirosław
---
Michał Mirosław (3):
net: Introduce skb_checksum_start_offset()
net: Use skb_checksum_start_offset()
net: Fix drivers advertising HW_CSUM feature to use csum_start
drivers/net/atl1c/atl1c_main.c | 2 +-
drivers/net/atl1e/atl1e_main.c | 2 +-
drivers/net/atlx/atl1.c | 2 +-
drivers/net/cassini.c | 2 +-
drivers/net/e1000/e1000_main.c | 2 +-
drivers/net/e1000e/netdev.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/ixgb/ixgb_main.c | 2 +-
drivers/net/ll_temac_main.c | 2 +-
drivers/net/macvtap.c | 3 +--
drivers/net/myri10ge/myri10ge.c | 2 +-
drivers/net/niu.c | 2 +-
drivers/net/skge.c | 2 +-
drivers/net/sungem.c | 2 +-
drivers/net/sunhme.c | 2 +-
drivers/net/tun.c | 2 +-
drivers/net/usb/smsc95xx.c | 7 +++----
drivers/net/virtio_net.c | 2 +-
drivers/net/vmxnet3/vmxnet3_drv.c | 4 ++--
include/linux/skbuff.h | 5 +++++
net/core/dev.c | 6 +++---
net/core/skbuff.c | 2 +-
net/ipv4/udp.c | 2 +-
net/packet/af_packet.c | 3 +--
24 files changed, 33 insertions(+), 31 deletions(-)
--
1.7.2.3
^ permalink raw reply
* [PATCH 2/3] net: Use skb_checksum_start_offset()
From: Michał Mirosław @ 2010-12-15 1:24 UTC (permalink / raw)
To: netdev
Cc: Jay Cliburn, Chris Snook, Jie Yang, Steve Glendinning,
Greg Kroah-Hartman, Patrick McHardy, David S. Miller,
Alexey Kuznetsov, James Morris
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>
Replace skb->csum_start - skb_headroom(skb) with skb_checksum_start_offset().
Note for usb/smsc95xx: skb->data - skb->head == skb_headroom(skb).
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/atlx/atl1.c | 2 +-
drivers/net/macvtap.c | 3 +--
drivers/net/tun.c | 2 +-
drivers/net/usb/smsc95xx.c | 7 +++----
drivers/net/virtio_net.c | 2 +-
net/core/dev.c | 6 +++---
net/core/skbuff.c | 2 +-
net/ipv4/udp.c | 2 +-
net/packet/af_packet.c | 3 +--
9 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 5336310..def8df8 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2174,7 +2174,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
u8 css, cso;
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
- css = (u8) (skb->csum_start - skb_headroom(skb));
+ css = skb_checksum_start_offset(skb);
cso = css + (u8) skb->csum_offset;
if (unlikely(css & 0x1)) {
/* L1 hardware requires an even number here */
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 4256727..21845af 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -504,8 +504,7 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
if (skb->ip_summed == CHECKSUM_PARTIAL) {
vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
- vnet_hdr->csum_start = skb->csum_start -
- skb_headroom(skb);
+ vnet_hdr->csum_start = skb_checksum_start_offset(skb);
vnet_hdr->csum_offset = skb->csum_offset;
} /* else everything is zero */
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 55f3a3e..7599c45 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -757,7 +757,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
if (skb->ip_summed == CHECKSUM_PARTIAL) {
gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
- gso.csum_start = skb->csum_start - skb_headroom(skb);
+ gso.csum_start = skb_checksum_start_offset(skb);
gso.csum_offset = skb->csum_offset;
} /* else everything is zero */
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 65cb1ab..bc86f4b 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1163,9 +1163,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb)
{
- int len = skb->data - skb->head;
- u16 high_16 = (u16)(skb->csum_offset + skb->csum_start - len);
- u16 low_16 = (u16)(skb->csum_start - len);
+ u16 low_16 = (u16)skb_checksum_start_offset(skb);
+ u16 high_16 = low_16 + skb->csum_offset;
return (high_16 << 16) | low_16;
}
@@ -1193,7 +1192,7 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
if (skb->len <= 45) {
/* workaround - hardware tx checksum does not work
* properly with extremely small packets */
- long csstart = skb->csum_start - skb_headroom(skb);
+ long csstart = skb_checksum_start_offset(skb);
__wsum calc = csum_partial(skb->data + csstart,
skb->len - csstart, 0);
*((__sum16 *)(skb->data + csstart
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b6d4028..90a23e4 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -519,7 +519,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
if (skb->ip_summed == CHECKSUM_PARTIAL) {
hdr->hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
- hdr->hdr.csum_start = skb->csum_start - skb_headroom(skb);
+ hdr->hdr.csum_start = skb_checksum_start_offset(skb);
hdr->hdr.csum_offset = skb->csum_offset;
} else {
hdr->hdr.flags = 0;
diff --git a/net/core/dev.c b/net/core/dev.c
index d28b3a0..f937726 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1761,7 +1761,7 @@ int skb_checksum_help(struct sk_buff *skb)
goto out_set_summed;
}
- offset = skb->csum_start - skb_headroom(skb);
+ offset = skb_checksum_start_offset(skb);
BUG_ON(offset >= skb_headlen(skb));
csum = skb_checksum(skb, offset, skb->len - offset, 0);
@@ -2058,8 +2058,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
* checksumming here.
*/
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- skb_set_transport_header(skb, skb->csum_start -
- skb_headroom(skb));
+ skb_set_transport_header(skb,
+ skb_checksum_start_offset(skb));
if (!dev_can_checksum(dev, skb) &&
skb_checksum_help(skb))
goto out_kfree_skb;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 8814a9a..19d6c21 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1824,7 +1824,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
long csstart;
if (skb->ip_summed == CHECKSUM_PARTIAL)
- csstart = skb->csum_start - skb_headroom(skb);
+ csstart = skb_checksum_start_offset(skb);
else
csstart = skb_headlen(skb);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b37181d..1198adf 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2226,7 +2226,7 @@ struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features)
/* Do software UFO. Complete and fill in the UDP checksum as HW cannot
* do checksum of UDP packets sent as multiple IP fragments.
*/
- offset = skb->csum_start - skb_headroom(skb);
+ offset = skb_checksum_start_offset(skb);
csum = skb_checksum(skb, offset, skb->len - offset, 0);
offset += skb->csum_offset;
*(__sum16 *)(skb->data + offset) = csum_fold(csum);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index e79efaf..91cb1d7 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1650,8 +1650,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
if (skb->ip_summed == CHECKSUM_PARTIAL) {
vnet_hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
- vnet_hdr.csum_start = skb->csum_start -
- skb_headroom(skb);
+ vnet_hdr.csum_start = skb_checksum_start_offset(skb);
vnet_hdr.csum_offset = skb->csum_offset;
} /* else everything is zero */
--
1.7.2.3
^ permalink raw reply related
* Re: [PATCH 0/3] Fix NETIF_F_HW_CSUM implementations [v2]
From: David Miller @ 2010-12-15 1:29 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>
From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Wed, 15 Dec 2010 02:24:08 +0100 (CET)
> This is a split version of a patch fixing NETIF_F_HW_CSUM implementations
> in network drivers. For easier review, this is split into three patches:
>
> 1. introduce skb_checksum_start_offset() helper
> 2. convert correct implementations to use the helper from #1
> 3. fix bad uses of skb_transport_offset() using helper from #1
I don't have any idea why you'd CC: as the networking maintainer only
on some of these patches.
That doesn't make any sense at all.
Either CC: me on all of them, or none. Don't partially CC: as that
makes it painful for me to manage my inbox.
Thank you.
^ permalink raw reply
* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Matt Carlson @ 2010-12-15 1:34 UTC (permalink / raw)
To: Michael Leun
Cc: Matthew Carlson, Jesse Gross, Michael Chan, Eric Dumazet,
David Miller, Ben Greear, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
In-Reply-To: <20101215012430.120fd47f@xenia.leun.net>
On Tue, Dec 14, 2010 at 04:24:30PM -0800, Michael Leun wrote:
> On Tue, 14 Dec 2010 11:15:00 -0800
> "Matt Carlson" <mcarlson@broadcom.com> wrote:
> > Michael, I'm wondering if the difference in behavior can be explained
> > by the presence or absence of management firmware. Can you look at
> > the driver sign-on messages in your syslogs for ASF[]? I'm half
> > expecting the 5752 to show "ASF[0]" and the 5714 to show "ASF[1]".
> > If you see this, and the below patch doesn't fix the problem, let me
> > know. I have another test I'd like you to run.
>
> Do I understand this correct? "Management firmware" or ASF is some
> feature, vendor decides to built into network card (firmware) or not?
Right.
> If so, would'nt one expect two oneboard network cards in one server
> to look alike?
Mostly, yes. Except for.....
> HP Proliant DL320G5
>
> <6>tg3.c:v3.113 (August 2, 2010)
> <6>tg3 0000:03:04.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> <6>tg3 0000:03:04.0: eth0: Tigon3 [partno(N/A) rev 9003] (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx
> <6>tg3 0000:03:04.0: eth0: attached PHY is 5714 (10/100/1000Base-T Ethernet) (WireSpeed[1])
> <6>tg3 0000:03:04.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] TSOcap[1]
This => ^^^^^^
> <6>tg3 0000:03:04.0: eth0: dma_rwctrl[76148000] dma_mask[64-bit]
> <6>tg3 0000:03:04.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
> <6>tg3 0000:03:04.1: eth1: Tigon3 [partno(N/A) rev 9003] (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx
> <6>tg3 0000:03:04.1: eth1: attached PHY is 5714 (10/100/1000Base-T Ethernet) (WireSpeed[1])
> <6>tg3 0000:03:04.1: eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
And this => ^^^^^^
> <6>tg3 0000:03:04.1: eth1: dma_rwctrl[76148000] dma_mask[64-bit]
So management firmware is turned off on the second port.
> Lenovo ThinkPad z61m
>
> [ 2.679130] tg3.c:v3.113 (August 2, 2010)
> [ 2.679176] tg3 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> [ 2.679188] tg3 0000:02:00.0: setting latency timer to 64
> [ 2.728572] tg3 0000:02:00.0: eth0: Tigon3 [partno(BCM95752m) rev 6002] (PCI Express) MAC address xx:xx:xx:xx:xx:xx
> [ 2.728577] tg3 0000:02:00.0: eth0: attached PHY is 5752 (10/100/1000Base-T Ethernet) (WireSpeed[1])
> [ 2.728581] tg3 0000:02:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
^^^^^^
And it isn't present on the 5752.
> [ 2.728585] tg3 0000:02:00.0: eth0: dma_rwctrl[76180000]
> dma_mask[64-bit]
>
>
> > ----
> >
> > [PATCH] tg3: Use new VLAN code
>
> Unfortunately had'nt time to try much now, but with 2.6.37-rc5 / your
> patch on the DL320, single user mode (nothing configured on eth) just
> after ifconfig eth0/eth1 up I see NO vlan tags on eth0 but I see vlan
> tags on eth1, so there clearly is a difference.
>
> I should have checked if I still see vlan tags on eth1 if I configure
> some vlan there - if helpful maybe I can do this (have to look, when I
> can effort another downtime).
This would be helpful, just to solidify our findings.
> I wonder, if the difference in that both onboard cards is really there
> or if there is some malfunction in detecion?
Please run the above test first, but afterwards, can you apply the below
patch on top of your current sources. I suspect eth1 will begin to act
like eth0.
This patch is just a test.
[PATCH] tg3: Always strip VLAN tags
This patch configures the hardware to always strip VLAN tags from
incoming packets.
---
drivers/net/tg3.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 3682205..964293f 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9505,8 +9505,10 @@ static void __tg3_set_rx_mode(struct net_device *dev)
/* When ASF is in use, we always keep the RX_MODE_KEEP_VLAN_TAG
* flag clear.
*/
+#if 0
if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
rx_mode |= RX_MODE_KEEP_VLAN_TAG;
+#endif
if (dev->flags & IFF_PROMISC) {
/* Promiscuous mode. */
--
1.7.2.2
^ permalink raw reply related
* [PATCH] sctp: fix the return value of getting the sctp partial delivery point
From: Wei Yongjun @ 2010-12-15 2:10 UTC (permalink / raw)
To: Vlad Yasevich, David Miller; +Cc: linux-sctp, netdev@vger.kernel.org
Get the sctp partial delivery point using SCTP_PARTIAL_DELIVERY_POINT
socket option should return 0 if success, not -ENOTSUPP.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
net/sctp/socket.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 1bc5203..8628e8e 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5050,7 +5050,7 @@ static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len,
if (copy_to_user(optval, &val, len))
return -EFAULT;
- return -ENOTSUPP;
+ return 0;
}
/*
--
1.6.5.2
^ permalink raw reply related
* Re: [PATCH v3 21/22] netoops: Add user-programmable boot_id
From: Ted Ts'o @ 2010-12-15 2:16 UTC (permalink / raw)
To: Mike Waychison
Cc: Matt Mackall, simon.kagstrom-vI6UBbBVNY+JA8cjQkG2/g,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, nhorman-2XuSBdqkA4R54TAoqtyWWQ,
adurbin-hpIqsD4AKlfQT0dZR+AlfA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
chavey-hpIqsD4AKlfQT0dZR+AlfA, Greg KH,
netdev-u79uwXL29TY76Z2rM5mHXA, Américo Wang,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
linux-api-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <AANLkTinugLaeuHjOAY6s=Vhwo-VOYr9dz7OE7GZFH+xK-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, Dec 14, 2010 at 03:19:50PM -0800, Mike Waychison wrote:
>
> I'm not sure there is a _good_ way to support this, is there? I just
> read through RFC 4122 and UUIDs seem to be pretty well structured;
> it's probably not such a great idea to allow folks to override
> portions of it. Like I mentioned in my last email though, I'm okay
> pushing this boot sequence ID down into the user blob which acts like
> a place for "vendor extensions" if there isn't a good place for it in
> the kernel.
If you really wanted to do it I could imagine using a time-based UUID
(see RFC 4122, section 4.2), where the boot sequence number could be
mapped into the 14-bit clock sequence, and using the time read from
the hardware counter and the ethernet MAC address from... umm the
"first" ethernet port (depending on how you define that) to form a
UUID. I'm not convinced it's really worth it, though, unless someone
really wants a good per-boot session UUID generated some other way
than a random number generator that may not be all that adequately
seed at the time when you first sample the boot session UUID.
I suspect pushing the boot sequence ID into its own special field with
the semantics that you want is probably the better way to go.
- Ted
^ permalink raw reply
* Re: [PATCH 5/5] net: add skb.old_queue_mapping
From: Changli Gao @ 2010-12-15 2:59 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <AANLkTinz-3HWnin8OhxxLuCncKgU_Fh8Wq9CcGe2jjXE@mail.gmail.com>
On Tue, Dec 14, 2010 at 7:58 AM, Changli Gao <xiaosuo@gmail.com> wrote:
>
> skb->cb can only be used in the same layer, so we can't use it to save
> a value crossing layers. A quick grep finds sch_netem just uses
> skb->cb. Maybe we can put all the skb->cb in the qdisc layer and
> old_queue_mapping in a structure as a new skb->cb. Is it OK? Thanks.
>
I can't do that. Below the qdisc layer, there is another user of
skb->cb GSO. Though we can set the GSO features of ifb to skip
gso_segments(), it is too tricky and weak.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH 3/3] net: Fix drivers advertising HW_CSUM feature to use csum_start
From: Stephen Hemminger @ 2010-12-15 3:07 UTC (permalink / raw)
To: Michał Mirosław
Cc: Roopa Prabhu, Dumazet, Jiri Pirko, e1000-devel, netdev, Vasanthy,
Jie Yang, Eric, Kolluri, VMware, Inc., Brice Goglin, H,
Andrew Gallatin, Joe Perches, David Wang, Shreyas Bhatewara,
David S. Miller, Sweeten
In-Reply-To: <aa9d85fa4961e87c38aec922913cbc95465fc082.1292372504.git.mirq-linux@rere.qmqm.pl>
On Wed, 15 Dec 2010 02:24:08 +0100 (CET)
Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
> Some drivers are using skb_transport_offset(skb) instead of skb->csum_start
> for NETIF_F_HW_CSUM offload. This does not matter now, but if someone
> implements checksumming of encapsulated packets then this will break silently.
>
> TSO output paths are left as they are, since they are for IP+TCP only
> (might be worth converting though).
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Which if any of these drivers did you test on real hardware?
--
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
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
* Re: [PATCH v2] kptr_restrict for hiding kernel pointers from unprivileged users
From: Eugene Teo @ 2010-12-15 4:18 UTC (permalink / raw)
To: Dan Rosenberg
Cc: netdev, linux-security-module, David S. Miller, Ingo Molnar,
Kees Cook, Eugene Teo, James Morris
In-Reply-To: <1292385983.9764.5.camel@Dan>
On 12/15/2010 12:06 PM, Dan Rosenberg wrote:
> The below patch adds the %pK format specifier, the
> CONFIG_SECURITY_KPTR_RESTRICT configuration option, and the
> kptr_restrict sysctl.
>
> The %pK format specifier is designed to hide exposed kernel pointers
> from unprivileged users, specifically via /proc interfaces. Its
> behavior depends on the kptr_restrict sysctl, whose default value
> depends on CONFIG_SECURITY_KPTR_RESTRICT. If kptr_restrict is set to 0,
> no deviation from the standard %p behavior occurs. If kptr_restrict is
> set to 1, if the current user (intended to be a reader via seq_printf(),
> etc.) does not have CAP_SYSLOG (which is currently in the LSM tree),
> kernel pointers using %pK are printed as 0's. This was chosen over the
> default "(null)", which cannot be parsed by userland %p, which expects
> "(nil)".
>
> v2 improves checking for inappropriate context, on suggestion by Peter
> Zijlstra. Thanks to Thomas Graf for suggesting use of a centralized
> format specifier.
>
> Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
> CC: James Morris <jmorris@namei.org>
> CC: Eugene Teo <eugeneteo@kernel.org>
> CC: Kees Cook <kees.cook@canonical.com>
> CC: Ingo Molnar <mingo@elte.hu>
> CC: David S. Miller <davem@davemloft.net>
> CC: linux-security-module@vger.kernel.org
> CC: netdev@vger.kernel.org
Acked-by: Eugene Teo <eugeneteo@kernel.org>
Eugene
^ 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