* Re: [PATCH 00/10 net-next] l2tp: misc fixes and add L2TPv3 IP encap over IPv6
From: David Miller @ 2012-04-30 17:46 UTC (permalink / raw)
To: jchapman; +Cc: netdev
In-Reply-To: <1335772135-27910-1-git-send-email-jchapman@katalix.com>
From: James Chapman <jchapman@katalix.com>
Date: Mon, 30 Apr 2012 08:48:45 +0100
> This patch series includes several L2TP fixes / cleanups and adds
> L2TPv3 IP encapsulation support for IPv6, building on the L2TP UDP
> IPv6 support recently added by Ben LaHaise.
>
> 1. l2tp: fix locking of 64-bit counters for smp
> 2. l2tp: Use ip4_datagram_connect() in l2tp_ip_connect()
> 3. l2tp: remove unused stats from l2tp_ip socket
> 4. pppox: Replace __attribute__((packed)) in if_pppox.h
> 5. l2tp: pppol2tp_connect() handles ipv6 sockaddr variants
> 6. l2tp: show IPv6 addresses in l2tp debugfs file
> 7. l2tp: netlink api for l2tpv3 ipv6 unmanaged tunnels
> 8. ipv6: export ipv6 functions for use by other protocols
> 9. l2tp: introduce L2TPv3 IP encapsulation support for IPv6
> 10. l2tp: let iproute2 create L2TPv3 IP tunnels using IPv6
>
> Patches 1-4 are fixes / cleanups.
> Patches 5-6 improve on the L2TP UDP IPv6 changes recently added.
> Patches 7-10 add functionality.
>
> A patch for iproute2 to add support for unmanaged L2TPv3 ethernet
> tunnels over IPv6 will be submitted separately.
Series applied to net-next, thanks James.
^ permalink raw reply
* Re: [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr()
From: David Miller @ 2012-04-30 17:45 UTC (permalink / raw)
To: ncardwell; +Cc: ycheng, ilpo.jarvinen, nanditad, netdev
In-Reply-To: <CADVnQymFjqqT__kCN-0vqz+jqBLez7aoQZ14KEV5=m=Ed=Nayw@mail.gmail.com>
From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 30 Apr 2012 12:25:56 -0400
> On Mon, Apr 30, 2012 at 12:00 PM, Yuchung Cheng <ycheng@google.com> wrote:
>> When the cwnd reduction is done, ssthresh may be infinite
>> if TCP enters CWR via ECN or F-RTO. If cwnd is not undone, i.e.,
>> undo_marker is set, tcp_complete_cwr() falsely set cwnd to the
>> infinite ssthresh value. The correct operation is to keep cwnd
>> intact because it has been updated in ECN or F-RTO.
>>
>> Signed-off-by: Yuchung Cheng <ycheng@google.com>
>> ---
>> ChangeLog since v1:
>> - Add snd_cwnd_stamp timestamping in CWR mode
>>
>> net/ipv4/tcp_input.c | 9 ++++++---
>> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> Acked-by: Neal Cardwell <ncardwell@google.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [REGRESSION][PATCH V5 3/3] bpf jit: Let the powerpc jit handle negative offsets
From: David Miller @ 2012-04-30 17:41 UTC (permalink / raw)
To: kaffeemonster
Cc: netdev, benh, eric.dumazet, matt, linux-kernel, linuxppc-dev
In-Reply-To: <4F9E1CDB.9020104@googlemail.com>
From: Jan Seiffert <kaffeemonster@googlemail.com>
Date: Mon, 30 Apr 2012 07:02:19 +0200
> Now the helper function from filter.c for negative offsets is exported,
> it can be used it in the jit to handle negative offsets.
>
> First modify the asm load helper functions to handle:
> - know positive offsets
> - know negative offsets
> - any offset
>
> then the compiler can be modified to explicitly use these helper
> when appropriate.
>
> This fixes the case of a negative X register and allows to lift
> the restriction that bpf programs with negative offsets can't
> be jited.
>
> Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Jan Seiffert <kaffeemonster@googlemail.com>
Applied, thanks.
^ permalink raw reply
* Re: [REGRESSION][PATCH V4 3/3] bpf jit: Let the powerpc jit handle negative offsets
From: David Miller @ 2012-04-30 17:41 UTC (permalink / raw)
To: benh; +Cc: kaffeemonster, eric.dumazet, matt, netdev, linux-kernel,
linuxppc-dev
In-Reply-To: <1335763568.20866.37.camel@pasglop>
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Mon, 30 Apr 2012 15:26:08 +1000
> David, what's the right way to fix that ?
There is no doubt that sock_fprog is the correct datastructure to use.
^ permalink raw reply
* Re: inconsistent lock/deadlock crash, vanilla 3.3.4, 32bit, tcp
From: David Miller @ 2012-04-30 17:38 UTC (permalink / raw)
To: eric.dumazet
Cc: denys, netdev, jmorris, yoshfuji, kaber, linux-kernel, glommer
In-Reply-To: <1335691316.2900.100.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 29 Apr 2012 11:21:56 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> [PATCH] net: fix sk_sockets_allocated_read_positive
>
> Denys Fedoryshchenko reported frequent crashes on a proxy server and kindly
> provided a lockdep report that explains it all :
...
> Bug is that sk_sockets_allocated_read_positive() calls
> percpu_counter_sum_positive() without BH being disabled.
>
> This bug was added in commit 180d8cd942ce33
> (foundations of per-cgroup memory pressure controlling.), since previous
> code was using percpu_counter_read_positive() which is IRQ safe.
>
> In __sk_mem_schedule() we dont need the precise count of allocated
> sockets and can revert to previous behavior.
>
> Reported-by: Denys Fedoryshchenko <denys@visp.net.lb>
> Sined-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 00/10] atl1c: update hardware settings - v4
From: David Miller @ 2012-04-30 17:35 UTC (permalink / raw)
To: xiong; +Cc: netdev, linux-kernel, qca-linux-team, nic-devel
In-Reply-To: <1335578325-21326-1-git-send-email-xiong@qca.qualcomm.com>
Please address the feedback you've received and then repost this
entire series.
BTW, this is why you should submit as few patches at a time as
possible. Because the more patches you submit at once, the more of
them you have to submit all over again when changes are requested for
even just one of them.
^ permalink raw reply
* Re: [PATCH net-next] net/l2tp: fix build error in l2tp from missing ipv6 checksum include
From: David Miller @ 2012-04-30 17:31 UTC (permalink / raw)
To: bcrl; +Cc: sfr, netdev, linux-next, linux-kernel
In-Reply-To: <20120430172402.GL17021@kvack.org>
From: Benjamin LaHaise <bcrl@kvack.org>
Date: Mon, 30 Apr 2012 13:24:02 -0400
> Can you please verify if the patch below fixes the issue? Thanks.
I already checked a fix into the tree.
^ permalink raw reply
* Re: bridge: Fix fatal typo in setup of multicast_querier_expired
From: David Miller @ 2012-04-30 17:27 UTC (permalink / raw)
To: herbert; +Cc: netdev
In-Reply-To: <20120430102256.GA32587@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.hengli.com.au>
Date: Mon, 30 Apr 2012 20:22:56 +1000
> Unfortunately it seems that I didn't properly test the case of
> an expired external querier in the recent multicast bridge series.
>
> The setup of the timer in that case is completely broken and leads
> to a NULL-pointer dereference. This patch fixes it.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
...
> - br_multicast_querier_expired, 0);
> + br_multicast_querier_expired, (unsigned long)br);
> setup_timer(&br->multicast_query_timer, br_multicast_query_expired,
> (unsigned long)br);
> }
>
> Sorry for the screw-up.
Please do not put comments after the patch, this made the second hunk
reject when I pulled it out of patchwork.
Anyways, fixed up and applied.
^ permalink raw reply
* [PATCH net-next] net/l2tp: fix build error in l2tp from missing ipv6 checksum include
From: Benjamin LaHaise @ 2012-04-30 17:24 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: David Miller, netdev, linux-next, linux-kernel
In-Reply-To: <20120430155836.44bcf3846c80cf686bb9cb77@canb.auug.org.au>
Hi Stephen,
Can you please verify if the patch below fixes the issue? Thanks.
-ben
----
net/l2tp: fix build error in l2tp from missing ipv6 checksum include
L2TP needs to ensure the IPv6 checksum helpers are included.
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
---
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index e91d559..0ca9bc3 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -56,6 +56,7 @@
#include <net/inet6_connection_sock.h>
#include <net/inet_ecn.h>
#include <net/ip6_route.h>
+#include <net/ip6_checksum.h>
#include <asm/byteorder.h>
#include <linux/atomic.h>
^ permalink raw reply related
* Re: [PATCH 0/8] netfilter updates for 3.4-rc5
From: David Miller @ 2012-04-30 17:23 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1335799015-2003-1-git-send-email-pablo@netfilter.org>
From: pablo@netfilter.org
Date: Mon, 30 Apr 2012 17:16:47 +0200
> This patchset contains the following fixes:
>
> * One fix in the initialization path of the IPVS modules spotted by
> the the trinity syscall fuzz testing tool from Sasha Levin.
>
> * Three patches to address more weak/buggy error handling in the
> initialization path of the IPVS modules from Hans Schillinstrom.
>
> * Fix a regression in the initialization path of ipvs_ctl (introduced in
> 2.6.39) due from Julian Anastasov.
>
> * A couple more initialization path robust error checkings from Julian
> Anastasov.
>
> * One silly fix for xt_CT target for the case in which the new
> cttimeout infrastructure is not used, eg. --helper or --notrack,
> by myself.
>
> You can pull these fixes from:
>
> git://1984.lsi.us.es/net master
Pulled, thanks Pablo.
^ permalink raw reply
* Re: linux-next: build failure after merge of the final tree (net-next tree related)
From: David Miller @ 2012-04-30 17:22 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, bcrl
In-Reply-To: <20120430155836.44bcf3846c80cf686bb9cb77@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 30 Apr 2012 15:58:36 +1000
> Hi all,
>
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
>
> net/l2tp/l2tp_core.c: In function 'l2tp_verify_udp_checksum':
> net/l2tp/l2tp_core.c:464:7: error: implicit declaration of function 'csum_ipv6_magic' [-Werror=implicit-function-declaration]
>
> Caused by commit d2cf3361677e ("net/l2tp: add support for L2TP over IPv6
> UDP"). Include file missing.
>
> I have reverted that commit for today.
The fix is less work than the revert on this one isn't it? :-)
Pushed to net-next, thanks Stephen:
--------------------
l2tp: Add missing net/net/ip6_checksum.h include.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/l2tp/l2tp_core.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index e91d559..0ca9bc3 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -56,6 +56,7 @@
#include <net/inet6_connection_sock.h>
#include <net/inet_ecn.h>
#include <net/ip6_route.h>
+#include <net/ip6_checksum.h>
#include <asm/byteorder.h>
#include <linux/atomic.h>
--
1.7.7.6
^ permalink raw reply related
* [PATCH] cxgb3: Don't call cxgb_vlan_mode until q locks are initialized
From: Roland Dreier @ 2012-04-30 17:15 UTC (permalink / raw)
To: Divy Le Ray, David S. Miller; +Cc: netdev, Roland Dreier
From: Roland Dreier <roland@purestorage.com>
The driver calls cxgb_vlan_mode() from init_one(). This calls into
synchronize_rx(), which locks all the q locks, but the q locks are not
initialized until cxgb_up() -> setup_sge_qsets(). So move the call to
cxgb_vlan_mode() into cxgb_up(), after the call to setup_sge_qsets().
We also move the body of these functions up higher to avoid having to
a forward declaration.
This was found because of the lockdep warning:
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
Pid: 323, comm: work_for_cpu Not tainted 3.4.0-rc5 #28
Call Trace:
[<ffffffff8106e767>] register_lock_class+0x108/0x2d0
[<ffffffff8106ff42>] __lock_acquire+0xd3/0xd06
[<ffffffff81070fd0>] lock_acquire+0xbf/0xfe
[<ffffffff813862a6>] _raw_spin_lock_irq+0x36/0x45
[<ffffffffa01e71aa>] cxgb_vlan_mode+0x96/0xcb [cxgb3]
[<ffffffffa01f90eb>] init_one+0x8c4/0x980 [cxgb3]
[<ffffffff811fcbf0>] local_pci_probe+0x3f/0x70
[<ffffffff81042206>] do_work_for_cpu+0x10/0x22
[<ffffffff810482de>] kthread+0xa1/0xa9
[<ffffffff8138e234>] kernel_thread_helper+0x4/0x10
Contrary to what lockdep says, the code is not fine: we are locking an
uninitialized spinlock.
Signed-off-by: Roland Dreier <roland@purestorage.com>
---
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 92 +++++++++++------------
1 file changed, 46 insertions(+), 46 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 63bfdd1..abb6ce7 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -1150,6 +1150,48 @@ release_tpsram:
}
/**
+ * t3_synchronize_rx - wait for current Rx processing on a port to complete
+ * @adap: the adapter
+ * @p: the port
+ *
+ * Ensures that current Rx processing on any of the queues associated with
+ * the given port completes before returning. We do this by acquiring and
+ * releasing the locks of the response queues associated with the port.
+ */
+static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
+{
+ int i;
+
+ for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) {
+ struct sge_rspq *q = &adap->sge.qs[i].rspq;
+
+ spin_lock_irq(&q->lock);
+ spin_unlock_irq(&q->lock);
+ }
+}
+
+static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
+{
+ struct port_info *pi = netdev_priv(dev);
+ struct adapter *adapter = pi->adapter;
+
+ if (adapter->params.rev > 0) {
+ t3_set_vlan_accel(adapter, 1 << pi->port_id,
+ features & NETIF_F_HW_VLAN_RX);
+ } else {
+ /* single control for all ports */
+ unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX;
+
+ for_each_port(adapter, i)
+ have_vlans |=
+ adapter->port[i]->features & NETIF_F_HW_VLAN_RX;
+
+ t3_set_vlan_accel(adapter, 1, have_vlans);
+ }
+ t3_synchronize_rx(adapter, pi);
+}
+
+/**
* cxgb_up - enable the adapter
* @adapter: adapter being enabled
*
@@ -1161,7 +1203,7 @@ release_tpsram:
*/
static int cxgb_up(struct adapter *adap)
{
- int err;
+ int i, err;
if (!(adap->flags & FULL_INIT_DONE)) {
err = t3_check_fw_version(adap);
@@ -1198,6 +1240,9 @@ static int cxgb_up(struct adapter *adap)
if (err)
goto out;
+ for_each_port(adap, i)
+ cxgb_vlan_mode(adap->port[i], adap->port[i]->features);
+
setup_rss(adap);
if (!(adap->flags & NAPI_INIT))
init_napi(adap);
@@ -2508,48 +2553,6 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
return 0;
}
-/**
- * t3_synchronize_rx - wait for current Rx processing on a port to complete
- * @adap: the adapter
- * @p: the port
- *
- * Ensures that current Rx processing on any of the queues associated with
- * the given port completes before returning. We do this by acquiring and
- * releasing the locks of the response queues associated with the port.
- */
-static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
-{
- int i;
-
- for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) {
- struct sge_rspq *q = &adap->sge.qs[i].rspq;
-
- spin_lock_irq(&q->lock);
- spin_unlock_irq(&q->lock);
- }
-}
-
-static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
-{
- struct port_info *pi = netdev_priv(dev);
- struct adapter *adapter = pi->adapter;
-
- if (adapter->params.rev > 0) {
- t3_set_vlan_accel(adapter, 1 << pi->port_id,
- features & NETIF_F_HW_VLAN_RX);
- } else {
- /* single control for all ports */
- unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX;
-
- for_each_port(adapter, i)
- have_vlans |=
- adapter->port[i]->features & NETIF_F_HW_VLAN_RX;
-
- t3_set_vlan_accel(adapter, 1, have_vlans);
- }
- t3_synchronize_rx(adapter, pi);
-}
-
static netdev_features_t cxgb_fix_features(struct net_device *dev,
netdev_features_t features)
{
@@ -3353,9 +3356,6 @@ static int __devinit init_one(struct pci_dev *pdev,
err = sysfs_create_group(&adapter->port[0]->dev.kobj,
&cxgb3_attr_group);
- for_each_port(adapter, i)
- cxgb_vlan_mode(adapter->port[i], adapter->port[i]->features);
-
print_port_info(adapter, ai);
return 0;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 06/15] batman-adv: Distributed ARP Table - add snooping functions for ARP messages
From: David Miller @ 2012-04-30 17:05 UTC (permalink / raw)
To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1335689867-8017-7-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Sun, 29 Apr 2012 10:57:38 +0200
> In case of an ARP message going in or out the soft_iface, it is intercepted and
> a special action is performed. In particular the DHT helper functions previously
> implemented are used to store all the ARP entries belonging to the network in
> order to provide a fast and unicast lookup instead of the classic broadcast
> flooding mechanism.
> Each node stores the entries it is responsible for (following the DHT rules) in
> its soft_iface ARP table. This makes it possible to reuse the kernel data
> structures and functions for ARP management.
>
> Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Sorry, I'm not letting subsystems outside of net/ipv4/arp.c and related
code make changes to the ARP table.
I plan to make major surgery to the way neighbour table entries are
handled and therefore the less people who get their grubby paws
directly in there, the better.
Find a way to propagate the ARP packet into the properl ARP receive
path to cause the state update to occur, I'm not letting you trigger
it by hand in the batman-adv code.
Sorry.
^ permalink raw reply
* Re: getting host CPU utilization (was Re: [PATCH V7 2/4 net-next] skbuff: Add userspace zero-copy buffers in skb)
From: Rick Jones @ 2012-04-30 16:54 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Shirley Ma, David Miller, eric.dumazet, avi, arnd, netdev, kvm,
linux-kernel
In-Reply-To: <20120430091246.GB5414@redhat.com>
On 04/30/2012 02:12 AM, Michael S. Tsirkin wrote:
> On Tue, Jun 28, 2011 at 10:19:48AM -0700, Rick Jones wrote:
>> one of these days I'll have to find a good way to get accurate
>> overall CPU utilization from within a guest and teach netperf about
>> it.
>
> I think the cleanest way would be to run another netperf server on the
> host. netperf would get a flag with host address and get cpu
> utilization info.
>
> This is what we currently do manually: run mpstat on the host.
>
> Thoughts?
I might be able to enhance the LOC_CPU/REM_CPU calibration tests to be
bona fide CPU utilization tests.
> By the way, could you point me to code used by netperf
> to measure CPU utilization on Linux? I'd like to figure
> out why isn't the result always consistent with e.g. mpstat.
That would be src/netcpu_procstat.c . That code is automagically
selected by the configure script when it determines the compilation is
happening under Linux. You can, if you wish, manually set it though I
suspect the only other mechanism known to netperf that would function
under Linux is the "looper" (aka CPU soaker) method.
rick
^ permalink raw reply
* Re: inconsistent lock/deadlock crash, vanilla 3.3.4, 32bit, tcp
From: David Miller @ 2012-04-30 16:49 UTC (permalink / raw)
To: glommer; +Cc: eric.dumazet, denys, netdev, jmorris, yoshfuji, kaber,
linux-kernel
In-Reply-To: <4F9E18E9.5010503@parallels.com>
From: Glauber Costa <glommer@parallels.com>
Date: Mon, 30 Apr 2012 01:45:29 -0300
> It wasn't my intent to change that, it was a mistake.
I very much regret succumbing to the unreasonable pressure to apply
your original patches.
We've come to learn that they were full of errors and that they needed
to cook for several more months before being included.
^ permalink raw reply
* [PATCH 2/2] [PATCH] sky2: fix receive length error in mixed non-VLAN/VLAN traffic
From: Stephen Hemminger @ 2012-04-30 16:47 UTC (permalink / raw)
To: Stephen Hemminger, Niccolò Belli, Mirko Lindner; +Cc: davem, netdev
In-Reply-To: <20120430154944.890709139@vyatta.com>
Bug: The VLAN bit of the MAC RX Status Word is unreliable in several older
supported chips. Sometimes the VLAN bit is not set for valid VLAN packets
and also sometimes the VLAN bit is set for non-VLAN packets that came after
a VLAN packet. This results in a receive length error when VLAN hardware
tagging is enabled.
Fix: Variation on original fix proposed by Mirko.
The VLAN information is decoded in the status loop, and can be
applied to the received SKB there. This eliminates the need for the
separate tag field in the interface data structure. The tag has to
be copied and cleared if packet is copied. This version checked out
with vlan and normal traffic.
Note: vlan_tx_tag_present should be renamed vlan_tag_present, but that
is outside scope of this.
Reported-by: Mirko Lindner <mlindner@marvell.com>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/ethernet/marvell/sky2.c 2012-04-30 08:21:05.395136397 -0700
+++ b/drivers/net/ethernet/marvell/sky2.c 2012-04-30 08:22:27.328472831 -0700
@@ -2495,9 +2495,11 @@ static struct sk_buff *receive_copy(stru
skb->ip_summed = re->skb->ip_summed;
skb->csum = re->skb->csum;
skb->rxhash = re->skb->rxhash;
+ skb->vlan_tci = re->skb->vlan_tci;
pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
length, PCI_DMA_FROMDEVICE);
+ re->skb->vlan_tci = 0;
re->skb->rxhash = 0;
re->skb->ip_summed = CHECKSUM_NONE;
skb_put(skb, length);
@@ -2583,9 +2585,6 @@ static struct sk_buff *sky2_receive(stru
struct sk_buff *skb = NULL;
u16 count = (status & GMR_FS_LEN) >> 16;
- if (status & GMR_FS_VLAN)
- count -= VLAN_HLEN; /* Account for vlan tag */
-
netif_printk(sky2, rx_status, KERN_DEBUG, dev,
"rx slot %u status 0x%x len %d\n",
sky2->rx_next, status, length);
@@ -2593,6 +2592,9 @@ static struct sk_buff *sky2_receive(stru
sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
prefetch(sky2->rx_ring + sky2->rx_next);
+ if (vlan_tx_tag_present(re->skb))
+ count -= VLAN_HLEN; /* Account for vlan tag */
+
/* This chip has hardware problems that generates bogus status.
* So do only marginal checking and expect higher level protocols
* to handle crap frames.
@@ -2650,11 +2652,8 @@ static inline void sky2_tx_done(struct n
}
static inline void sky2_skb_rx(const struct sky2_port *sky2,
- u32 status, struct sk_buff *skb)
+ struct sk_buff *skb)
{
- if (status & GMR_FS_VLAN)
- __vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag));
-
if (skb->ip_summed == CHECKSUM_NONE)
netif_receive_skb(skb);
else
@@ -2708,6 +2707,14 @@ static void sky2_rx_checksum(struct sky2
}
}
+static void sky2_rx_tag(struct sky2_port *sky2, u16 length)
+{
+ struct sk_buff *skb;
+
+ skb = sky2->rx_ring[sky2->rx_next].skb;
+ __vlan_hwaccel_put_tag(skb, be16_to_cpu(length));
+}
+
static void sky2_rx_hash(struct sky2_port *sky2, u32 status)
{
struct sk_buff *skb;
@@ -2766,8 +2773,7 @@ static int sky2_status_intr(struct sky2_
}
skb->protocol = eth_type_trans(skb, dev);
-
- sky2_skb_rx(sky2, status, skb);
+ sky2_skb_rx(sky2, skb);
/* Stop after net poll weight */
if (++work_done >= to_do)
@@ -2775,11 +2781,11 @@ static int sky2_status_intr(struct sky2_
break;
case OP_RXVLAN:
- sky2->rx_tag = length;
+ sky2_rx_tag(sky2, length);
break;
case OP_RXCHKSVLAN:
- sky2->rx_tag = length;
+ sky2_rx_tag(sky2, length);
/* fall through */
case OP_RXCHKS:
if (likely(dev->features & NETIF_F_RXCSUM))
--- a/drivers/net/ethernet/marvell/sky2.h 2012-04-30 08:19:56.000000000 -0700
+++ b/drivers/net/ethernet/marvell/sky2.h 2012-04-30 08:21:40.595714908 -0700
@@ -2241,7 +2241,6 @@ struct sky2_port {
u16 rx_pending;
u16 rx_data_size;
u16 rx_nfrags;
- u16 rx_tag;
struct {
unsigned long last;
^ permalink raw reply
* Re: [PATCH] netem: fix possible skb leak
From: Stephen Hemminger @ 2012-04-30 16:44 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Stephen Hemminger
In-Reply-To: <1335804016.2296.5.camel@edumazet-glaptop>
On Mon, 30 Apr 2012 18:40:16 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Mon, 2012-04-30 at 09:25 -0700, Stephen Hemminger wrote:
> > On Sun, 29 Apr 2012 21:08:22 +0200
> > Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >
> > > From: Eric Dumazet <edumazet@google.com>
> > >
> > > skb_checksum_help(skb) can return an error, we must free skb in this
> > > case. qdisc_drop(skb, sch) can also be feeded with a NULL skb (if
> > > skb_unshare() failed), so lets use this generic helper.
> > >
> > > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > > Cc: Stephen Hemminger <shemminger@osdl.org>
> > > ---
> > > net/sched/sch_netem.c | 6 ++----
> > > 1 file changed, 2 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
> > > index 5da548f..ebd2296 100644
> > > --- a/net/sched/sch_netem.c
> > > +++ b/net/sched/sch_netem.c
> > > @@ -408,10 +408,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> > > if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {
> > > if (!(skb = skb_unshare(skb, GFP_ATOMIC)) ||
> > > (skb->ip_summed == CHECKSUM_PARTIAL &&
> > > - skb_checksum_help(skb))) {
> > > - sch->qstats.drops++;
> > > - return NET_XMIT_DROP;
> > > - }
> > > + skb_checksum_help(skb)))
> > > + return qdisc_drop(skb, sch);
> > >
> > > skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
> > > }
> > >
> > >
> >
> > This would crater if skb_unshare() returned NULL. I think the conditional
> > needs to be split into two paths.
>
> Maybe you can read the changelog where I explained this was safe ;)
Ok, I am surprised that qdisc_drop() is safe with NULL skb, but yes.
^ permalink raw reply
* Re: [PATCH] netem: fix possible skb leak
From: Eric Dumazet @ 2012-04-30 16:40 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev, Stephen Hemminger
In-Reply-To: <20120430092509.54b89ae6@nehalam.linuxnetplumber.net>
On Mon, 2012-04-30 at 09:25 -0700, Stephen Hemminger wrote:
> On Sun, 29 Apr 2012 21:08:22 +0200
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > From: Eric Dumazet <edumazet@google.com>
> >
> > skb_checksum_help(skb) can return an error, we must free skb in this
> > case. qdisc_drop(skb, sch) can also be feeded with a NULL skb (if
> > skb_unshare() failed), so lets use this generic helper.
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Cc: Stephen Hemminger <shemminger@osdl.org>
> > ---
> > net/sched/sch_netem.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
> > index 5da548f..ebd2296 100644
> > --- a/net/sched/sch_netem.c
> > +++ b/net/sched/sch_netem.c
> > @@ -408,10 +408,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> > if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {
> > if (!(skb = skb_unshare(skb, GFP_ATOMIC)) ||
> > (skb->ip_summed == CHECKSUM_PARTIAL &&
> > - skb_checksum_help(skb))) {
> > - sch->qstats.drops++;
> > - return NET_XMIT_DROP;
> > - }
> > + skb_checksum_help(skb)))
> > + return qdisc_drop(skb, sch);
> >
> > skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
> > }
> >
> >
>
> This would crater if skb_unshare() returned NULL. I think the conditional
> needs to be split into two paths.
Maybe you can read the changelog where I explained this was safe ;)
^ permalink raw reply
* Re: [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr()
From: Neal Cardwell @ 2012-04-30 16:25 UTC (permalink / raw)
To: Yuchung Cheng; +Cc: davem, ilpo.jarvinen, nanditad, netdev
In-Reply-To: <1335801618-31498-1-git-send-email-ycheng@google.com>
On Mon, Apr 30, 2012 at 12:00 PM, Yuchung Cheng <ycheng@google.com> wrote:
> When the cwnd reduction is done, ssthresh may be infinite
> if TCP enters CWR via ECN or F-RTO. If cwnd is not undone, i.e.,
> undo_marker is set, tcp_complete_cwr() falsely set cwnd to the
> infinite ssthresh value. The correct operation is to keep cwnd
> intact because it has been updated in ECN or F-RTO.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---
> ChangeLog since v1:
> - Add snd_cwnd_stamp timestamping in CWR mode
>
> net/ipv4/tcp_input.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
Acked-by: Neal Cardwell <ncardwell@google.com>
neal
^ permalink raw reply
* Re: [PATCH] netem: fix possible skb leak
From: Stephen Hemminger @ 2012-04-30 16:25 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Stephen Hemminger
In-Reply-To: <1335726502.3897.8.camel@edumazet-glaptop>
On Sun, 29 Apr 2012 21:08:22 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> skb_checksum_help(skb) can return an error, we must free skb in this
> case. qdisc_drop(skb, sch) can also be feeded with a NULL skb (if
> skb_unshare() failed), so lets use this generic helper.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Stephen Hemminger <shemminger@osdl.org>
> ---
> net/sched/sch_netem.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
> index 5da548f..ebd2296 100644
> --- a/net/sched/sch_netem.c
> +++ b/net/sched/sch_netem.c
> @@ -408,10 +408,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {
> if (!(skb = skb_unshare(skb, GFP_ATOMIC)) ||
> (skb->ip_summed == CHECKSUM_PARTIAL &&
> - skb_checksum_help(skb))) {
> - sch->qstats.drops++;
> - return NET_XMIT_DROP;
> - }
> + skb_checksum_help(skb)))
> + return qdisc_drop(skb, sch);
>
> skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
> }
>
>
This would crater if skb_unshare() returned NULL. I think the conditional
needs to be split into two paths.
^ permalink raw reply
* Re: [RFT] sky2: fix status length check on older chips
From: Stephen Hemminger @ 2012-04-30 16:19 UTC (permalink / raw)
To: Niccolò Belli; +Cc: netdev
In-Reply-To: <4F9BC59D.80304@linuxsystems.it>
On Sat, 28 Apr 2012 12:25:33 +0200
Niccolò Belli <darkbasic@linuxsystems.it> wrote:
> Il 28/04/2012 04:46, Stephen Hemminger ha scritto:
> > Are you using VLAN's? the whole problem report only applies if using VLAN
> > on old hardware.
>
> No, I don't use VLANs. There are VLANs in my network but I simply
> connect to the default one from my laptop.
Still your laptop will receive vlan frames (even just broadcasts).
^ permalink raw reply
* Re: [PATCH] bridge: make brctl showstp display port id
From: Stephen Hemminger @ 2012-04-30 16:07 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: netdev@vger.kernel.org
In-Reply-To: <1335775148-5191-1-git-send-email-Joakim.Tjernlund@transmode.se>
On Mon, 30 Apr 2012 10:39:08 +0200
Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote:
> My brctl showstp br0 always shows a 0 port id:
> eth2 (1)
> port id 0 state disabled
> designated root 8000.00069c00b2fb path cost 100
>
> because port id is printed as a hex number in sys fs. Change the
> two hex occurrences(port no and port id) to decimal, just like all
> the other numbers in this area.
>
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
> net/bridge/br_sysfs_if.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
> index fd5799c..9c4c2eb 100644
> --- a/net/bridge/br_sysfs_if.c
> +++ b/net/bridge/br_sysfs_if.c
> @@ -86,13 +86,13 @@ static BRPORT_ATTR(designated_cost, S_IRUGO, show_designated_cost, NULL);
>
> static ssize_t show_port_id(struct net_bridge_port *p, char *buf)
> {
> - return sprintf(buf, "0x%x\n", p->port_id);
> + return sprintf(buf, "%d\n", p->port_id);
> }
> static BRPORT_ATTR(port_id, S_IRUGO, show_port_id, NULL);
>
> static ssize_t show_port_no(struct net_bridge_port *p, char *buf)
> {
> - return sprintf(buf, "0x%x\n", p->port_no);
> + return sprintf(buf, "%d\n", p->port_no);
> }
>
> static BRPORT_ATTR(port_no, S_IRUGO, show_port_no, NULL);
No. This would be a visible change to applications.
The bridge utilities should be fixed instead.
^ permalink raw reply
* Re: bridge: Fix fatal typo in setup of multicast_querier_expired
From: Stephen Hemminger @ 2012-04-30 16:04 UTC (permalink / raw)
To: Herbert Xu; +Cc: David S. Miller, netdev
In-Reply-To: <20120430102256.GA32587@gondor.apana.org.au>
On Mon, 30 Apr 2012 20:22:56 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> Unfortunately it seems that I didn't properly test the case of
> an expired external querier in the recent multicast bridge series.
>
> The setup of the timer in that case is completely broken and leads
> to a NULL-pointer dereference. This patch fixes it.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
^ permalink raw reply
* [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr()
From: Yuchung Cheng @ 2012-04-30 16:00 UTC (permalink / raw)
To: davem, ilpo.jarvinen, ncardwell; +Cc: nanditad, netdev, Yuchung Cheng
When the cwnd reduction is done, ssthresh may be infinite
if TCP enters CWR via ECN or F-RTO. If cwnd is not undone, i.e.,
undo_marker is set, tcp_complete_cwr() falsely set cwnd to the
infinite ssthresh value. The correct operation is to keep cwnd
intact because it has been updated in ECN or F-RTO.
Signed-off-by: Yuchung Cheng <ycheng@google.com>
---
ChangeLog since v1:
- Add snd_cwnd_stamp timestamping in CWR mode
net/ipv4/tcp_input.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c93b0cb..e0a9b89 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2868,11 +2868,14 @@ static inline void tcp_complete_cwr(struct sock *sk)
/* Do not moderate cwnd if it's already undone in cwr or recovery. */
if (tp->undo_marker) {
- if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR)
+ if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR) {
tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
- else /* PRR */
+ tp->snd_cwnd_stamp = tcp_time_stamp;
+ } else if (tp->snd_ssthresh < TCP_INFINITE_SSTHRESH) {
+ /* PRR algorithm. */
tp->snd_cwnd = tp->snd_ssthresh;
- tp->snd_cwnd_stamp = tcp_time_stamp;
+ tp->snd_cwnd_stamp = tcp_time_stamp;
+ }
}
tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
}
--
1.7.7.3
^ permalink raw reply related
* [PATCH 0/2] sky2 patches
From: Stephen Hemminger @ 2012-04-30 15:49 UTC (permalink / raw)
To: davem; +Cc: netdev
These are both patches against net-next but should be
applied to -net and stable as well.
^ 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