* Re: [PATCH 0/9] skb fragment API: convert network drivers (part V)
From: David Miller @ 2011-10-10 18:20 UTC (permalink / raw)
To: Ian.Campbell; +Cc: netdev, linux-scsi, linux-mm
In-Reply-To: <1318245076.21903.408.camel@zakaz.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
Date: Mon, 10 Oct 2011 12:11:16 +0100
> I think "struct subpage" is a generally useful tuple I added to a
> central location (mm_types.h) rather than somewhere networking or driver
> specific but I can trivially move if preferred.
I'm fine with the patch series, but this generic datastructure
addition needs some feedback first.
^ permalink raw reply
* Re: [PATCH] isdn: add missing cast operator in drivers/isdn/sc/init.c
From: David Miller @ 2011-10-10 18:18 UTC (permalink / raw)
To: corone.il.han; +Cc: isdn, netdev
In-Reply-To: <1318244560-19213-1-git-send-email-corone.il.han@gmail.com>
From: Il Han <corone.il.han@gmail.com>
Date: Mon, 10 Oct 2011 20:02:40 +0900
> Add (void __iomem *) to convert the value to the proper type before passing it to readl().
>
> Signed-off-by: Il Han <corone.il.han@gmail.com>
I've rejected this patch already in the past, and this is because the correct
fix is to change the type of rambase and the variables and datastructures
it is initialized from.
^ permalink raw reply
* Re: [PATCH] mlx4_en: fix endianness with blue frame support
From: David Miller @ 2011-10-10 18:10 UTC (permalink / raw)
To: cascardo; +Cc: netdev, linuxppc-dev, eli, yevgenyp, benh
In-Reply-To: <20111010164654.GA3648@oc1711230544.ibm.com>
From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Date: Mon, 10 Oct 2011 13:46:54 -0300
> On Mon, Oct 10, 2011 at 01:42:23PM -0300, Thadeu Lima de Souza Cascardo wrote:
>> The doorbell register was being unconditionally swapped. In x86, that
>> meant it was being swapped to BE and written to the descriptor and to
>> memory, depending on the case of blue frame support or writing to
>> doorbell register. On PPC, this meant it was being swapped to LE and
>> then swapped back to BE while writing to the register. But in the blue
>> frame case, it was being written as LE to the descriptor.
>>
>> The fix is not to swap doorbell unconditionally, write it to the
>> register as BE and convert it to BE when writing it to the descriptor.
>>
>> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
>> Reported-by: Richard Hendrickson <richhend@us.ibm.com>
>> Cc: Eli Cohen <eli@dev.mellanox.co.il>
>> Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> ---
>
> So I tested this patch and it works for me. Thanks Ben and Eli for
> finding out the problem with doorbell in the descriptor.
Applied, thanks everyone.
^ permalink raw reply
* Prize Winner
From: Admin @ 2011-10-10 15:57 UTC (permalink / raw)
Did you receive our email ???
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply
* Re: [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
From: David Miller @ 2011-10-10 18:09 UTC (permalink / raw)
To: eric.dumazet; +Cc: danborkmann, netdev
In-Reply-To: <1318266304.3227.18.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 10 Oct 2011 19:05:04 +0200
> Le lundi 10 octobre 2011 à 18:52 +0200, danborkmann@iogearbox.net a
> écrit :
>> If skb is NULL, then stack trace is thrown anyway on dereference.
>> Therefore, the stack trace triggered by BUG_ON is duplicate.
>>
>> Signed-off-by: Daniel Borkmann <danborkmann@googlemail.com>
>> Cc: Eric Dumazet <eric.dumazet@gmail.com>
>
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, but please make patches like this against the net-next tree
in which the af_packet.c code had changed quite a bit and therefore
I had to munch your patch to get it to apply.
^ permalink raw reply
* Re: [net-next 02/11] igb: Use node specific allocations for the q_vectors and rings
From: David Miller @ 2011-10-10 17:50 UTC (permalink / raw)
To: alexander.h.duyck; +Cc: jeffrey.t.kirsher, netdev, gospo, sassmann
In-Reply-To: <4E931A06.7090805@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Mon, 10 Oct 2011 09:15:02 -0700
> Actually the main reason for having adapter->node is because in our
> out-of-tree driver we end up using it as a module parameter in the event
> that someone is running in single queue mode and wants to split up the
> ports between nodes. As such I would prefer to keep the parameter
> around and just default it to -1 as I am currently doing. However if it
> must go I guess I can work around that sync-up issue.
Please stop adding such hacks to your out-of-tree driver and add
appropriate, generic, configure mechanisms to the upstream tree.
It absolutely is not appropriate to add something which is completely
useless to the upstream tree for the sake of something being done
only externally.
You guys are the best at upstream net driver maintainence, so it
really surprises me that you continue to do completely unacceptable
crap like this. Write the necessary generic non-module-option
mechanisms to facilitate the features you need and kill your out of
tree driver _now_.
^ permalink raw reply
* Re: [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
From: Eric Dumazet @ 2011-10-10 17:05 UTC (permalink / raw)
To: danborkmann; +Cc: David S. Miller, netdev@vger.kernel.org
In-Reply-To: <20111010185246.15533bv1p3pmnba6@mail.your-server.de>
Le lundi 10 octobre 2011 à 18:52 +0200, danborkmann@iogearbox.net a
écrit :
> If skb is NULL, then stack trace is thrown anyway on dereference.
> Therefore, the stack trace triggered by BUG_ON is duplicate.
>
> Signed-off-by: Daniel Borkmann <danborkmann@googlemail.com>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Thanks
^ permalink raw reply
* Re: [net-next 02/11] igb: Use node specific allocations for the q_vectors and rings
From: Alexander Duyck @ 2011-10-10 17:02 UTC (permalink / raw)
To: Andi Kleen; +Cc: Jeff Kirsher, davem, netdev, gospo, sassmann
In-Reply-To: <20111010163228.GA14482@one.firstfloor.org>
On 10/10/2011 09:32 AM, Andi Kleen wrote:
>> The RR configuration is somewhat arbitrary. However it is still better
>> than dumping everyting on a single node, and it works with the
>> configuration when the rings numbers line up with the CPU numbers since
>> normally the CPUs are RR on the nodes. From what I have seen it does
>> work quite well and it prevents almost all cross-node memory accesses
>> when running a routing workload.
>
> Ok so it's optimized for one specific workload. I'm sure you'll
> find some other workload where it doesn't work out.
It isn't that I optimized it for one specific workload. I was just
citing that specific workload as one of the ones seeing the advantage.
> I suppose it's hard to get right in the general case, but best
> would be if ethtool had a nice and easy interface to set it at least.
The general case is never right for this it seems like. At least in
this case it becomes much easier to line up the memory and interrupts so
that they are all affinitized to the same core. From there RPS/RFS can
typically be used to spread out the work more if necessary.
> However one disadvantage of that patch over the existing state of the
> art (numactl modprobe ...) is that there's no way to override the placement
> now. So if you do the forced RR I think you need the ethtool part too,
> or at least some parameter to turn it off.
>
> -Andi
The counter argument to that though is that the approach you mention
always limits you to one node. At least with this approach we are
spread out over multiple nodes so that we can make full use of the
memory bandwidth on the system.
Thanks,
Alex
^ permalink raw reply
* [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
From: danborkmann @ 2011-10-10 16:52 UTC (permalink / raw)
To: Eric Dumazet, David S. Miller; +Cc: netdev@vger.kernel.org
If skb is NULL, then stack trace is thrown anyway on dereference.
Therefore, the stack trace triggered by BUG_ON is duplicate.
Signed-off-by: Daniel Borkmann <danborkmann@googlemail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
---
net/packet/af_packet.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index fabb4fa..886ae50 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1170,8 +1170,6 @@ static void tpacket_destruct_skb(struct sk_buff *skb)
struct packet_sock *po = pkt_sk(skb->sk);
void *ph;
- BUG_ON(skb == NULL);
-
if (likely(po->tx_ring.pg_vec)) {
ph = skb_shinfo(skb)->destructor_arg;
BUG_ON(__packet_get_status(po, ph) != TP_STATUS_SENDING);
^ permalink raw reply related
* Re: [PATCH net-next] macvlan: handle fragmented multicast frames
From: Ben Greear @ 2011-10-10 16:53 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1318264891.3227.17.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
On 10/10/2011 09:41 AM, Eric Dumazet wrote:
> Le lundi 10 octobre 2011 à 09:27 -0700, Ben Greear a écrit :
>
>> I applied this to Linus' top-of-tree this morning and it does appear
>> to fix the problem for mac-vlans.
>>
>
> Thanks for testing
>
>> I do see this error, but I doubt it has anything to do with your
>> patch:
>>
>> device eth0 entered promiscuous mode
>> device rddVR10 entered promiscuous mode
>> ADDRCONF(NETDEV_CHANGE): rddVR1b: link becomes ready
>>
>> ================================================
>> [ BUG: lock held when returning to user space! ]
>> ------------------------------------------------
>> ip/3452 is leaving the kernel with locks still held!
>> 1 lock held by ip/3452:
>> #0: (rcu_read_lock){.+.+..}, at: [<f8c5336f>] rcu_read_lock+0x0/0x26 [ipv6]
>> ADDRCONF(NETDEV_CHANGE): rddVR4b: link becomes ready
>> ADDRCONF(NETDEV_CHANGE): rddVR5b: link becomes ready
>>
>>
>> I have no idea why it doesn't print out a more useful stack
>> trace. It seems repeatable (2 of 2 reboots so far). I'm
>> configuring a pretty complex virtual network, with veth devices,
>> xorp instances running ipv4 and ipv6 routing protocols, etc.
>>
>
> Do you have LOCKDEP enabled ?
Yes, as far as I can tell:
[greearb@build-32 linux-2.6.p4s]$ grep LOCKDEP .config
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_LOCKDEP=y
And it doesn't appear to have turned itself off:
[root@lec2010-ath9k-1 ~]# dmesg|grep lockdep
RCU lockdep checking is enabled.
lockdep: fixing up alternatives.
[root@lec2010-ath9k-1 ~]#
I looked through the kernel debug section of the config, and it
seems normal enough...
But, after this splat, if I run sysrq-d, then it says sysrq is off,
maybe because the splat disabled it?
SysRq : Show Locks Held
INFO: lockdep is turned off.
sysrq-l does show backtraces, so the backtrace logic in general
seems to work fine.
>
>> This is a clean upstream kernel with no outside patches aside from your
>> own.
>
> Hmm, it seems we have an rcu_read_unlock() missing...
>
> Any idea what was done by this "ip" command ?
No, it's called multiple times by my user-space control logic. Basically,
it configures around 30 interfaces, some GRE, veth, mac-vlans, .1q vlans, normal ethernet, etc.
Also, I have some ipv6 addrs configured on many of them.
And, setting up routing rules, for ipv4 and ipv6 for the virtual routers.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: e100 + VLANs?
From: Michael Tokarev @ 2011-10-10 16:51 UTC (permalink / raw)
To: David Lamparter; +Cc: Eric Dumazet, jeffrey.t.kirsher, netdev
In-Reply-To: <20111010151343.GB3260852@jupiter.n2.diac24.net>
10.10.2011 19:13, David Lamparter wrote:
> On Mon, Oct 10, 2011 at 05:05:52PM +0200, Eric Dumazet wrote:
>>> When pinging this NIC from another machine over VLAN5, I see
>>> ARP packets coming to it, gets recognized and replies going
>>> back, all on vlan 5. But on the other side, replies comes
>>> WITHOUT a VLAN tag!
>>>
>>> From this NIC's point of view, capturing on whole ethX:
>>>
>>> 00:1f:c6:ef:e5:1b > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 5, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.48.11.2 tell 10.48.11.1, length 42
>>> 00:90:27:30:6d:1c > 00:1f:c6:ef:e5:1b, ethertype 802.1Q (0x8100), length 46: vlan 5, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.48.11.2 is-at 00:90:27:30:6d:1c, length 28
>>>
>>> From the partner point of view, also on whole ethX:
>>>
>>> 00:1f:c6:ef:e5:1b > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 5, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.48.11.2 tell 10.48.11.1, length 28
>>> 00:90:27:30:6d:1c > 00:1f:c6:ef:e5:1b, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Reply 10.48.11.2 is-at 00:90:27:30:6d:1c, length 46
>>>
>>> So, the tag gets eaten somewhere along the way... ;)
>
> Hmm. Looks like broken VLAN TX offload, but the driver doesn't even
> implement VLAN offload. Maybe it's broken in its non-implementation...
>
> Your "partner" is a known-good setup and can be assumed to be working
> correctly? This is over a crossover cable, no evil switches involved?
There are just two machines involved, both connected to the
same _switch_ - no, it is not over cross-over cable. It's a
good idea to test one, I'll try it tomorrow (will insert a
second "known good" nic into another machine).
The second machine, the "partner", has this NIC:
02:00.0 Ethernet controller: Atheros Communications L1 Gigabit Ethernet (rev b0)
and it is a known-good implementation - it worked with and without vlan
tags (we had a weird mixed tagged/untagged setup) for over 2 years without
any issues, and which works now as well - it's our main server which is
in two VLANs, connected to an interface marked as tagged in the switch.
It communicates with the other machine when that other machine uses
already mentioned VIA RhineIII NIC - which I used to replace this non-working
E100.
So it's 2 machines, one with 2 nics - VIA Rhine (working) and e100 (non-working),
both connected to two "tagged" ports in the switch. And another, with atl1 NIC,
also connected to a "tagged" port in the switch.
>>> And I can't really recreate the situation which I had - I know
>>> some packets were flowing, so at least ARP worked. Now it
>>> does not work anymore.
>>
>> What the 'partner' setup looks like ?
>>
>> ip link
>> ip addr
>> ip ro
> 'local' setup too please :)
The setup is quite complex - there are numerous tunnels and virtual
interfaces. Here are the relevant parts. (Note that `ip addr'
includes information present in `ip link'):
The "Partner" machine, with just one NIC, atl1, ip addr:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:1f:c6:ef:e5:1b brd ff:ff:ff:ff:ff:ff
3: tls-vlan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master tls-br state UP
link/ether 00:1f:c6:ef:e5:1b brd ff:ff:ff:ff:ff:ff
Our main vlan, LAN, #1.
4: tls-br: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:1f:c6:ef:e5:1b brd ff:ff:ff:ff:ff:ff
inet 192.168.177.15/26 brd 192.168.177.63 scope global tls-br
A bridge that connects this VLAN#1 and other stuff (virtual machines etc)
6: dmz-vlan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master dmz-br state UP
link/ether 00:1f:c6:ef:e5:1b brd ff:ff:ff:ff:ff:ff
That's DMZ segment, VLAN#2
...
21: test@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:1f:c6:ef:e5:1b brd ff:ff:ff:ff:ff:ff
inet 10.48.11.1/24 scope global test
This is vlan#5, my test vlan.
The machine with two (working, via-rhine, and non-working, e100):
2: ethx: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:90:27:30:6d:1c brd ff:ff:ff:ff:ff:ff
This is via-rhine, with the MAC address of E100 -- the one which works.
13: eth-tls@ethx: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:90:27:30:6d:1c brd ff:ff:ff:ff:ff:ff
inet 192.168.177.5/26 brd 192.168.177.63 scope global eth-tls
Our main VLAN#1 (here it's w/o bridge)
14: eth-dmz@ethx: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:90:27:30:6d:1c brd ff:ff:ff:ff:ff:ff
inet 192.168.177.225/29 brd 192.168.177.231 scope global eth-dmz
DMZ VLAN#2
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:90:27:30:6d:1c brd ff:ff:ff:ff:ff:ff
The non-working e100. Here it has the same MAC address as ethx above,
because I explicitly changed ethx to have this MAC, since the $ISP has
it hardcoded for our port on their side. The tests were done with the
two addresses being original as set up by the hardware, and later on
I also tried to set this MAC to be 00:90:27:30:6d:1d (note the last
digit) - all the same result, packets sent over the iface above shows
on the receiving side as having no vlan tag.
24: test@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:90:27:30:6d:1c brd ff:ff:ff:ff:ff:ff
inet 10.48.11.2/24 scope global test
And finally this is the test vlan#5.
tcpdump was run on eth2 here and on eth0 on the first machine.
On both machines tcpdump is of version 4.1.1.
Here's offload information for e100 nic:
# ethtool -k eth2
Offload parameters for eth2:
rx-checksumming: off
tx-checksumming: off
scatter-gather: off
tcp-segmentation-offload: off
udp-fragmentation-offload: off
generic-segmentation-offload: off
generic-receive-offload: off
large-receive-offload: off
ntuple-filters: off
receive-hashing: off
It supports (or appears to) some offloading, in particular I
can enable GSO offload, and it even works somehow.
Now, I enabled another pair of VLAN interfaces on these two NICs,
with VLAN#6, and configured both ports in the switch to be parts
of VLAN6 too (tagged). And voila, everything now works in there.
Two ifaces added, "partner", atl1:
22: test6@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
link/ether 00:1f:c6:ef:e5:1b brd ff:ff:ff:ff:ff:ff
inet 10.48.6.1/24 scope global test6
this e100:
25: test6@eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
link/ether 00:90:27:30:6d:1c brd ff:ff:ff:ff:ff:ff
inet 10.48.6.2/24 scope global test6
Yesterday, the vlan ID where it didn't work was #4, and in #1 it all -
apparently - worked.
I created 2 more pairs of VLAN interfaces and added to the swithc --
it all works just fine. Here:
# x=8; ip link add link eth2 name test$x type vlan id $x; ip addr add 10.48.$x.2/24 dev test$x; ip link set test$x up
(That's on the e100 side, similar was on atl1 side). x=6, x=7 and x=8
works just fine. x=5 does not, ARP replies arrives without VLAN tag
to the atl1 side.
Ok. So now I can reproduce the initial problem.
So, `ping -s 1469' from atl1 side, so that the resulting packet side
is 1497 bytes (1468 is the largest size that works) -- the packets
does not arrive at e100 side at all - it's 100% quiet in tcpdump there.
When pinging from e100 side and tcpdump'ing on atl1 side (replies does
not come back to e100):
20:49:33.322646 00:90:27:30:6d:1c > 00:1f:c6:ef:e5:1b, ethertype 802.1Q (0x8100), length 1515: vlan 8, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 1497)
10.48.8.2 > 10.48.8.1: ICMP echo request, id 5785, seq 72, length 1477
20:49:33.322691 00:1f:c6:ef:e5:1b > 00:90:27:30:6d:1c, ethertype 802.1Q (0x8100), length 1515: vlan 8, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 23781, offset 0, flags [none], proto ICMP (1), length 1497)
10.48.8.1 > 10.48.8.2: ICMP echo reply, id 5785, seq 72, length 1477
So it appears that on e100 side, the _receive_ buffer is too small
somehow.
I'll do some more experiments with VLAN#5 tomorrow, in a clean environment
(maybe using direct cable connection - not cross-over, since GigE should
autodetect this stuff (hopefully)).
Thanks!
/mjt
^ permalink raw reply
* Re: [PATCH] mlx4_en: fix endianness with blue frame support
From: Thadeu Lima de Souza Cascardo @ 2011-10-10 16:46 UTC (permalink / raw)
To: netdev; +Cc: linuxppc-dev, Eli Cohen, Yevgeny Petrilin, Benjamin Herrenschmidt
In-Reply-To: <1318264943-10009-1-git-send-email-cascardo@linux.vnet.ibm.com>
On Mon, Oct 10, 2011 at 01:42:23PM -0300, Thadeu Lima de Souza Cascardo wrote:
> The doorbell register was being unconditionally swapped. In x86, that
> meant it was being swapped to BE and written to the descriptor and to
> memory, depending on the case of blue frame support or writing to
> doorbell register. On PPC, this meant it was being swapped to LE and
> then swapped back to BE while writing to the register. But in the blue
> frame case, it was being written as LE to the descriptor.
>
> The fix is not to swap doorbell unconditionally, write it to the
> register as BE and convert it to BE when writing it to the descriptor.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
> Reported-by: Richard Hendrickson <richhend@us.ibm.com>
> Cc: Eli Cohen <eli@dev.mellanox.co.il>
> Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
So I tested this patch and it works for me. Thanks Ben and Eli for
finding out the problem with doorbell in the descriptor.
Regards,
Cascardo.
> drivers/net/mlx4/en_tx.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
> index 6e03de0..f76ab6b 100644
> --- a/drivers/net/mlx4/en_tx.c
> +++ b/drivers/net/mlx4/en_tx.c
> @@ -172,7 +172,7 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
> memset(ring->buf, 0, ring->buf_size);
>
> ring->qp_state = MLX4_QP_STATE_RST;
> - ring->doorbell_qpn = swab32(ring->qp.qpn << 8);
> + ring->doorbell_qpn = ring->qp.qpn << 8;
>
> mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn,
> ring->cqn, &ring->context);
> @@ -791,7 +791,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
> skb_orphan(skb);
>
> if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) {
> - *(u32 *) (&tx_desc->ctrl.vlan_tag) |= ring->doorbell_qpn;
> + *(__be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn);
> op_own |= htonl((bf_index & 0xffff) << 8);
> /* Ensure new descirptor hits memory
> * before setting ownership of this descriptor to HW */
> @@ -812,7 +812,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
> wmb();
> tx_desc->ctrl.owner_opcode = op_own;
> wmb();
> - writel(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL);
> + iowrite32be(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL);
> }
>
> /* Poll CQ here */
> --
> 1.7.4.4
>
^ permalink raw reply
* [PATCH] mlx4_en: fix endianness with blue frame support
From: Thadeu Lima de Souza Cascardo @ 2011-10-10 16:42 UTC (permalink / raw)
To: netdev
Cc: linuxppc-dev, Thadeu Lima de Souza Cascardo, Eli Cohen,
Yevgeny Petrilin, Benjamin Herrenschmidt
In-Reply-To: <1318231920.29415.404.camel@pasglop>
The doorbell register was being unconditionally swapped. In x86, that
meant it was being swapped to BE and written to the descriptor and to
memory, depending on the case of blue frame support or writing to
doorbell register. On PPC, this meant it was being swapped to LE and
then swapped back to BE while writing to the register. But in the blue
frame case, it was being written as LE to the descriptor.
The fix is not to swap doorbell unconditionally, write it to the
register as BE and convert it to BE when writing it to the descriptor.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Reported-by: Richard Hendrickson <richhend@us.ibm.com>
Cc: Eli Cohen <eli@dev.mellanox.co.il>
Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/net/mlx4/en_tx.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index 6e03de0..f76ab6b 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -172,7 +172,7 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
memset(ring->buf, 0, ring->buf_size);
ring->qp_state = MLX4_QP_STATE_RST;
- ring->doorbell_qpn = swab32(ring->qp.qpn << 8);
+ ring->doorbell_qpn = ring->qp.qpn << 8;
mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn,
ring->cqn, &ring->context);
@@ -791,7 +791,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
skb_orphan(skb);
if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) {
- *(u32 *) (&tx_desc->ctrl.vlan_tag) |= ring->doorbell_qpn;
+ *(__be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn);
op_own |= htonl((bf_index & 0xffff) << 8);
/* Ensure new descirptor hits memory
* before setting ownership of this descriptor to HW */
@@ -812,7 +812,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
wmb();
tx_desc->ctrl.owner_opcode = op_own;
wmb();
- writel(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL);
+ iowrite32be(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL);
}
/* Poll CQ here */
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH net-next] macvlan: handle fragmented multicast frames
From: Eric Dumazet @ 2011-10-10 16:41 UTC (permalink / raw)
To: Ben Greear; +Cc: netdev
In-Reply-To: <4E931CEC.5050404@candelatech.com>
Le lundi 10 octobre 2011 à 09:27 -0700, Ben Greear a écrit :
> I applied this to Linus' top-of-tree this morning and it does appear
> to fix the problem for mac-vlans.
>
Thanks for testing
> I do see this error, but I doubt it has anything to do with your
> patch:
>
> device eth0 entered promiscuous mode
> device rddVR10 entered promiscuous mode
> ADDRCONF(NETDEV_CHANGE): rddVR1b: link becomes ready
>
> ================================================
> [ BUG: lock held when returning to user space! ]
> ------------------------------------------------
> ip/3452 is leaving the kernel with locks still held!
> 1 lock held by ip/3452:
> #0: (rcu_read_lock){.+.+..}, at: [<f8c5336f>] rcu_read_lock+0x0/0x26 [ipv6]
> ADDRCONF(NETDEV_CHANGE): rddVR4b: link becomes ready
> ADDRCONF(NETDEV_CHANGE): rddVR5b: link becomes ready
>
>
> I have no idea why it doesn't print out a more useful stack
> trace. It seems repeatable (2 of 2 reboots so far). I'm
> configuring a pretty complex virtual network, with veth devices,
> xorp instances running ipv4 and ipv6 routing protocols, etc.
>
Do you have LOCKDEP enabled ?
> This is a clean upstream kernel with no outside patches aside from your
> own.
Hmm, it seems we have an rcu_read_unlock() missing...
Any idea what was done by this "ip" command ?
^ permalink raw reply
* Re: [PATCH net] mscan: zero accidentally copied register content
From: Oliver Hartkopp @ 2011-10-10 16:38 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: Andre Naujoks, Wolfram Sang, Linux Netdev List
In-Reply-To: <4E8DF24E.5030606@grandegger.com>
On 10/06/11 20:24, Wolfgang Grandegger wrote:
> Well, copying just the relevant bytes seem much more straight-forward
> than removing accidentally copied bytes later-on. You do not need to
> care about little endian. The MSCAN is only available on PowerPC SOCs,
> which are big endian.
>
> I'm going to test and post a patch tomorrow.
Thanks.
My patch is then superseded by this one
"mscan: too much data copied to CAN frame due to 16 bit accesses"
http://patchwork.ozlabs.org/patch/118364/
Tnx,
Oliver
^ permalink raw reply
* Re: [net-next 02/11] igb: Use node specific allocations for the q_vectors and rings
From: Andi Kleen @ 2011-10-10 16:32 UTC (permalink / raw)
To: Alexander Duyck; +Cc: Andi Kleen, Jeff Kirsher, davem, netdev, gospo, sassmann
In-Reply-To: <4E931C61.7040204@intel.com>
> The RR configuration is somewhat arbitrary. However it is still better
> than dumping everyting on a single node, and it works with the
> configuration when the rings numbers line up with the CPU numbers since
> normally the CPUs are RR on the nodes. From what I have seen it does
> work quite well and it prevents almost all cross-node memory accesses
> when running a routing workload.
Ok so it's optimized for one specific workload. I'm sure you'll
find some other workload where it doesn't work out.
I suppose it's hard to get right in the general case, but best
would be if ethtool had a nice and easy interface to set it at least.
However one disadvantage of that patch over the existing state of the
art (numactl modprobe ...) is that there's no way to override the placement
now. So if you do the forced RR I think you need the ethtool part too,
or at least some parameter to turn it off.
-Andi
^ permalink raw reply
* Re: [PATCH net-next] macvlan: handle fragmented multicast frames
From: Ben Greear @ 2011-10-10 16:27 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1317932911.3457.31.camel@edumazet-laptop>
On 10/06/2011 01:28 PM, Eric Dumazet wrote:
> Le mercredi 05 octobre 2011 à 15:35 -0700, Ben Greear a écrit :
>
>> If someone wants to cook up macvlan-ip-defrag patch I'll be happy
>> to test it. But, as far as I can tell, this problem can happen on
>> any two interfaces. The reason that some of mine work (.1q vlans)
>> and macvlan didn't is probably because those were separated by
>> some virtual network links that imparted extra delay...so the
>> vlan consumed all its fragments and passed the complete pkt up
>> the stack before the mac-vlan ever saw the initial frame.
>>
>> With this in mind, it seems that using multiple udp multicast
>> sockets bound to specific devices is fundamentally broken for
>> fragmented packets.
>>
>> I have no pressing need for this feature, so now that I better understand
>> the problem I can just document it and move on to other things.
>>
>> Thanks for all the help.
>>
>
> Please test following patch (note I had no time to test it, sorry !)
>
> Based on net-next tree, might apply on 3.0 kernel...
>
> [PATCH net-next] macvlan: handle fragmented multicast frames
>
> Fragmented multicast frames are delivered to a single macvlan port,
> because ip defrag logic considers other samples are redundant.
>
> Implement a defrag step before trying to send the multicast frame.
I applied this to Linus' top-of-tree this morning and it does appear
to fix the problem for mac-vlans.
I do see this error, but I doubt it has anything to do with your
patch:
device eth0 entered promiscuous mode
device rddVR10 entered promiscuous mode
ADDRCONF(NETDEV_CHANGE): rddVR1b: link becomes ready
================================================
[ BUG: lock held when returning to user space! ]
------------------------------------------------
ip/3452 is leaving the kernel with locks still held!
1 lock held by ip/3452:
#0: (rcu_read_lock){.+.+..}, at: [<f8c5336f>] rcu_read_lock+0x0/0x26 [ipv6]
ADDRCONF(NETDEV_CHANGE): rddVR4b: link becomes ready
ADDRCONF(NETDEV_CHANGE): rddVR5b: link becomes ready
I have no idea why it doesn't print out a more useful stack
trace. It seems repeatable (2 of 2 reboots so far). I'm
configuring a pretty complex virtual network, with veth devices,
xorp instances running ipv4 and ipv6 routing protocols, etc.
This is a clean upstream kernel with no outside patches aside from your
own.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH 1/9] mm: add a "struct subpage" type containing a page, offset and length
From: Ian Campbell @ 2011-10-10 16:27 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: linux-mm@kvack.org, linux-kernel, Jens Axboe, Christoph Hellwig
In-Reply-To: <1318245101-16890-1-git-send-email-ian.campbell@citrix.com>
(reposting including LKML to catch other potential users)
Is this structure of any use to unify other instances of a similar
tuple, e.g. biovec, pagefrag etc?
Ian.
On Mon, 2011-10-10 at 12:11 +0100, Ian Campbell wrote:
> A few network drivers currently use skb_frag_struct for this purpose but I have
> patches which add additional fields and semantics there which these other uses
> do not want.
>
> A structure for reference sub-page regions seems like a generally useful thing
> so do so instead of adding a network subsystem specific structure.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: linux-mm@kvack.org
> ---
> include/linux/mm_types.h | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 774b895..dc1d103 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -135,6 +135,17 @@ struct page {
> #endif
> ;
>
> +struct subpage {
> + struct page *page;
> +#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
> + __u32 page_offset;
> + __u32 size;
> +#else
> + __u16 page_offset;
> + __u16 size;
> +#endif
> +};
> +
> typedef unsigned long __nocast vm_flags_t;
>
> /*
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [net-next 02/11] igb: Use node specific allocations for the q_vectors and rings
From: Alexander Duyck @ 2011-10-10 16:25 UTC (permalink / raw)
To: Andi Kleen; +Cc: Jeff Kirsher, davem, netdev, gospo, sassmann
In-Reply-To: <m21uum2g28.fsf@firstfloor.org>
On 10/09/2011 11:08 AM, Andi Kleen wrote:
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> writes:
>>
>> for (i = 0; i < adapter->num_tx_queues; i++) {
>> - ring = kzalloc(sizeof(struct igb_ring), GFP_KERNEL);
>> + if (orig_node == -1) {
>> + int cur_node = next_online_node(adapter->node);
>> + if (cur_node == MAX_NUMNODES)
>> + cur_node = first_online_node;
>
> RR seems quite arbitrary. Who guarantees those nodes have any
> relationship with the CPUs submitting on those queues? Or the node
> the device is on.
>
> Anyways if it's a good idea probably need to add a
> dma_alloc_coherent_node() too
>
> -Andi
>
The RR configuration is somewhat arbitrary. However it is still better
than dumping everyting on a single node, and it works with the
configuration when the rings numbers line up with the CPU numbers since
normally the CPUs are RR on the nodes. From what I have seen it does
work quite well and it prevents almost all cross-node memory accesses
when running a routing workload.
I was thinking along the same lines for dma_alloc_coherent_node as well.
I've been meaning to get to it but I just haven't had the time. I'm
intentionally holding off on the ixgbe version of these patches until I
get the time to write up such a function. At which time I was going to
write up a patch to convert igb over to it.
Thanks,
Alex
^ permalink raw reply
* Re: [PATCH] net: ipv6: Allow netlink to set IPv6 address scope
From: Brian Haley @ 2011-10-10 16:16 UTC (permalink / raw)
To: Lorenzo Colitti; +Cc: maze, yoshfuji, netdev, c
In-Reply-To: <20111005201559.E544016A599@drone1.mtv.corp.google.com>
On 10/05/2011 04:15 PM, Lorenzo Colitti wrote:
> net: ipv6: Allow netlink to set IPv6 address scope
>
> Currently, userspace cannot specify the scope of IPv6
> addresses when creating or modifying them. Instead, the
> scope is automatically determined from the address itself.
> In IPv4, userspace can set whatever scope it likes.
>
> Allow userspace to specify the scope of IPv6 addresses in
> a backwards-compatible way: if the scope passed in is zero,
> use the old behaviour of automatically determining the
> scope based on the address.
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Hi Lorenzo,
I remember someone proposing a similar patch before and it was not accepted, do
you have a use case for doing this? It just seems like it will cause problems.
Also, there are other parts of the kernel (NFS, SCTP, IPv6 multicast) that are
still calling ipv6_addr_scope() on a plain address - won't those be broken since
they'll return the correct, RFC-implied scope?
-Brian
^ permalink raw reply
* Re: [PATCH 1/9] mm: add a "struct subpage" type containing a page, offset and length
From: Christoph Hellwig @ 2011-10-10 16:19 UTC (permalink / raw)
To: Ian Campbell
Cc: Christoph Hellwig, netdev@vger.kernel.org, linux-mm@kvack.org
In-Reply-To: <1318263059.21903.462.camel@zakaz.uk.xensource.com>
On Mon, Oct 10, 2011 at 05:10:59PM +0100, Ian Campbell wrote:
> This version sizes the fields according to page size, was there
> somewhere which wanted to use an offset > PAGE_SIZE (or size > PAGE_SIZE
> for that matter). That would be pretty odd and/or not really a candidate
> for using this datastructure?
I wasn't ever part of the fight myself and only vaguely remember it.
Try to get linux-kernel and Jens onto the Cc list to at least have the
major stakeholders informed.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [net-next 02/11] igb: Use node specific allocations for the q_vectors and rings
From: Alexander Duyck @ 2011-10-10 16:15 UTC (permalink / raw)
To: David Miller; +Cc: jeffrey.t.kirsher, netdev, gospo, sassmann
In-Reply-To: <20111008.155158.566839176815794249.davem@davemloft.net>
On 10/08/2011 12:51 PM, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Fri, 7 Oct 2011 23:47:32 -0700
>
>> From: Alexander Duyck <alexander.h.duyck@intel.com>
>>
>> This change is meant to update the ring and vector allocations so that they
>> are per node instead of allocating everything on the node that
>> ifconfig/modprobe is called on. By doing this we can cut down
>> significantly on cross node traffic.
>>
>> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
>> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> adapter->node seems superfluous.
>
> It's always "-1" when we enter the allocation functions, and we
> always restore it to it's original value upon exit from such
> functions.
>
> Just get rid of it and use a local variable in these functions
> to keep track of the current allocation node.
>
> Also, what ensures that MSI-X interrupts are targetted to a cpu
> on the the node where you've made these allocations? I was
> pretty sure Ben Hutchings added infrastructure that's usable
> to ensure this, but I can't see where you're using it.
Actually the main reason for having adapter->node is because in our
out-of-tree driver we end up using it as a module parameter in the event
that someone is running in single queue mode and wants to split up the
ports between nodes. As such I would prefer to keep the parameter
around and just default it to -1 as I am currently doing. However if it
must go I guess I can work around that sync-up issue.
In this case we don't have any guarantee other than the fact that most
people when trying to get performance will arrange their IRQs in a round
robin fashion. However this approach is still preferred over just
allocating all of the rings on one node and incurring the possible
overhead for all of the access being primarily on a single node. The
igb implementation doesn't have the code in place yet for the irq
affinity hints. It is one of the few things remaining for me to sync up
between igb and ixgbe, however it is on my list of things to do.
Thanks,
Alex
^ permalink raw reply
* Re: [PATCH 1/9] mm: add a "struct subpage" type containing a page, offset and length
From: Ian Campbell @ 2011-10-10 16:10 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: netdev@vger.kernel.org, linux-mm@kvack.org
In-Reply-To: <20111010155557.GA15503@infradead.org>
On Mon, 2011-10-10 at 16:55 +0100, Christoph Hellwig wrote:
> On Mon, Oct 10, 2011 at 12:11:33PM +0100, Ian Campbell wrote:
> > A few network drivers currently use skb_frag_struct for this purpose but I have
> > patches which add additional fields and semantics there which these other uses
> > do not want.
> >
> > A structure for reference sub-page regions seems like a generally useful thing
> > so do so instead of adding a network subsystem specific structure.
>
> Subpage seems like a fairly bad name. page_frag would fit into the
> scheme used in a few other places.
ok.
> The brings back the discussion of unifying the various incarnations we
> have of this (biovec, skb frag and there were a few more at times),
> but IIRC one of the sticking points back then was that one offset
> insistet in 32-bit offset/len and the other on 16-bit.
This version sizes the fields according to page size, was there
somewhere which wanted to use an offset > PAGE_SIZE (or size > PAGE_SIZE
for that matter). That would be pretty odd and/or not really a candidate
for using this datastructure?
Ian.
^ permalink raw reply
* Re: [PATCH] af_packet: tpacket_destruct_skb, deref skb after BUG_ON assertion
From: Eric Dumazet @ 2011-10-10 16:06 UTC (permalink / raw)
To: danborkmann; +Cc: David S. Miller, netdev
In-Reply-To: <20111010100203.15066m7nvqod58cb@webmail.your-server.de>
Le lundi 10 octobre 2011 à 10:02 +0200, danborkmann@iogearbox.net a
écrit :
> Thanks, you're absolutely right! Here's the trivial patch:
>
> af_packet: removed unnecessary BUG_ON assertion in tpacket_destruct_skb
>
OK but a proper title should be
[PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
> If skb is NULL, then stack trace is thrown on anyway on dereference.
> Therefore,
> the stack trace triggered by BUG_ON is duplicate.
>
> Signed-off-by: Daniel Borkmann <danborkmann@googlemail.com>
>
missing "---" separator
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index fabb4fa..886ae50 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -1170,8 +1170,6 @@ static void tpacket_destruct_skb(struct sk_buff *skb)
> struct packet_sock *po = pkt_sk(skb->sk);
> void *ph;
>
> - BUG_ON(skb == NULL);
> -
> if (likely(po->tx_ring.pg_vec)) {
> ph = skb_shinfo(skb)->destructor_arg;
> BUG_ON(__packet_get_status(po, ph) != TP_STATUS_SENDING);
>
>
Please send a complete new mail without any history.
^ permalink raw reply
* Re: [PATCH 1/9] mm: add a "struct subpage" type containing a page, offset and length
From: Christoph Hellwig @ 2011-10-10 15:55 UTC (permalink / raw)
To: Ian Campbell; +Cc: netdev, linux-mm
In-Reply-To: <1318245101-16890-1-git-send-email-ian.campbell@citrix.com>
On Mon, Oct 10, 2011 at 12:11:33PM +0100, Ian Campbell wrote:
> A few network drivers currently use skb_frag_struct for this purpose but I have
> patches which add additional fields and semantics there which these other uses
> do not want.
>
> A structure for reference sub-page regions seems like a generally useful thing
> so do so instead of adding a network subsystem specific structure.
Subpage seems like a fairly bad name. page_frag would fit into the
scheme used in a few other places.
The brings back the discussion of unifying the various incarnations we
have of this (biovec, skb frag and there were a few more at times),
but IIRC one of the sticking points back then was that one offset
insistet in 32-bit offset/len and the other on 16-bit.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ 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