* [PATCH 0/3] mlx4_en: loopback support + RSS TCP improve + bug fix
From: Amir Vadai @ 2011-11-15 9:14 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Oren Duer, Yevgeny Petrilin, Or Gerlitz, Amir Vadai
From: Amir Vadai <amirv@mellanox.co.il>
Amir Vadai (3):
net/mlx4_en: allow setting number of rx rings for RSS/TCP
net/mlx4_en: adding loopback support
net/mlx4_en: bug fix for the case of vlan id 0 and UP 0
drivers/net/ethernet/mellanox/mlx4/en_main.c | 7 ++++---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 9 ++++++++-
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 6 ++++--
include/linux/mlx4/qp.h | 1 +
5 files changed, 18 insertions(+), 7 deletions(-)
--
1.7.5.4
^ permalink raw reply
* [PATCH 1/3] net/mlx4_en: allow setting number of rx rings for RSS/TCP
From: Amir Vadai @ 2011-11-15 9:14 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Oren Duer, Yevgeny Petrilin, Or Gerlitz, Amir Vadai
In-Reply-To: <1321348446-29605-1-git-send-email-amirv@mellanox.com>
From: Amir Vadai <amirv@mellanox.co.il>
Make RSS TCP divert packets only to part of the rx rings, other could be
accessed by using flow steering or RFS acceleration
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
---
drivers/net/ethernet/mellanox/mlx4/en_main.c | 7 ++++---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 9 ++++++++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c
index a06096f..f70bafb 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c
@@ -63,9 +63,10 @@ static const char mlx4_en_version[] =
*/
-/* Enable RSS TCP traffic */
-MLX4_EN_PARM_INT(tcp_rss, 1,
- "Enable RSS for incomming TCP traffic or disabled (0)");
+/* RSS TCP usage */
+MLX4_EN_PARM_INT(tcp_rss, -1,
+ "0 to disable RSS TCP, if n > 0, use n rx rings by RSS TCP. -1 "
+ "for all rx rings");
/* Enable RSS UDP traffic */
MLX4_EN_PARM_INT(udp_rss, 1,
"Enable RSS for incomming UDP traffic or disabled (0)");
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index b89c36d..17c7062 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -834,6 +834,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
struct mlx4_en_rss_map *rss_map = &priv->rss_map;
struct mlx4_qp_context context;
struct mlx4_en_rss_context *rss_context;
+ int tcp_rss_table_size;
void *ptr;
u8 rss_mask = 0x3f;
int i, qpn;
@@ -873,9 +874,15 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
mlx4_en_fill_qp_context(priv, 0, 0, 0, 1, priv->base_qpn,
priv->rx_ring[0].cqn, &context);
+ if (priv->mdev->profile.tcp_rss == -1 ||
+ priv->mdev->profile.tcp_rss > priv->rx_ring_num)
+ tcp_rss_table_size = priv->rx_ring_num;
+ else
+ tcp_rss_table_size = max(1, priv->mdev->profile.tcp_rss);
+
ptr = ((void *) &context) + 0x3c;
rss_context = ptr;
- rss_context->base_qpn = cpu_to_be32(ilog2(priv->rx_ring_num) << 24 |
+ rss_context->base_qpn = cpu_to_be32(ilog2(tcp_rss_table_size) << 24 |
(rss_map->base_qpn));
rss_context->default_qpn = cpu_to_be32(rss_map->base_qpn);
rss_context->flags = rss_mask;
--
1.7.5.4
^ permalink raw reply related
* [PATCH 2/3] net/mlx4_en: adding loopback support
From: Amir Vadai @ 2011-11-15 9:14 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Oren Duer, Yevgeny Petrilin, Or Gerlitz, Amir Vadai
In-Reply-To: <1321348446-29605-1-git-send-email-amirv@mellanox.com>
From: Amir Vadai <amirv@mellanox.co.il>
Device must be in promiscious mode or DMAC must be same as the host MAC, or
else packet will be dropped by the HW rx filtering.
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 ++
include/linux/mlx4/qp.h | 1 +
3 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 78d776b..55f88a7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1084,7 +1084,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
dev->vlan_features = dev->hw_features;
- dev->hw_features |= NETIF_F_RXCSUM | NETIF_F_RXHASH;
+ dev->hw_features |= NETIF_F_RXCSUM | NETIF_F_RXHASH | NETIF_F_LOOPBACK;
dev->features = dev->hw_features | NETIF_F_HIGHDMA |
NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index d901b42..9b4ca4c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -680,6 +680,8 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
tx_desc->ctrl.srcrb_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE |
MLX4_WQE_CTRL_SOLICITED);
+ if (dev->features & NETIF_F_LOOPBACK)
+ tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK);
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM |
MLX4_WQE_CTRL_TCP_UDP_CSUM);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 48cc4cb..804a738 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -183,6 +183,7 @@ struct mlx4_wqe_ctrl_seg {
* [4] IP checksum
* [3:2] C (generate completion queue entry)
* [1] SE (solicited event)
+ * [0] FL (force loopback)
*/
__be32 srcrb_flags;
/*
--
1.7.5.4
^ permalink raw reply related
* [PATCH 3/3] net/mlx4_en: bug fix for the case of vlan id 0 and UP 0
From: Amir Vadai @ 2011-11-15 9:14 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Oren Duer, Yevgeny Petrilin, Or Gerlitz, Amir Vadai
In-Reply-To: <1321348446-29605-1-git-send-email-amirv@mellanox.com>
From: Amir Vadai <amirv@mellanox.co.il>
When using vlan 0 and UP 0, vlan header wasn't placed.
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
---
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 9b4ca4c..150383e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -565,7 +565,7 @@ static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk
inl->byte_count = cpu_to_be32(1 << 31 | (skb->len - spc));
}
tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag);
- tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!(*vlan_tag);
+ tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * (!!vlan_tx_tag_present(skb));
tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
}
@@ -676,7 +676,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
/* Prepare ctrl segement apart opcode+ownership, which depends on
* whether LSO is used */
tx_desc->ctrl.vlan_tag = cpu_to_be16(vlan_tag);
- tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!vlan_tag;
+ tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!vlan_tx_tag_present(skb);
tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
tx_desc->ctrl.srcrb_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE |
MLX4_WQE_CTRL_SOLICITED);
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH -next 0/4] netfilter reverse path filter matches
From: Pablo Neira Ayuso @ 2011-11-15 9:58 UTC (permalink / raw)
To: David Miller; +Cc: fw, netfilter-devel, netdev
In-Reply-To: <20111114.004716.1099241210794134345.davem@davemloft.net>
On Mon, Nov 14, 2011 at 12:47:16AM -0500, David Miller wrote:
> From: Florian Westphal <fw@strlen.de>
> Date: Wed, 9 Nov 2011 23:19:44 +0100
>
> > Version 3 of the ipv4/v6 reverse path filter matches discussed
> > during nfws 2011.
>
> I fully support these changes, please feel free to merge them in
> via the netfilter tree and to add my ack:
>
> Acked-by: David S. Miller <davem@davemloft.net>
Thanks for taking the time to review this, I need some time to test it
here but I think we'll get it into net-next soon.
^ permalink raw reply
* Re: [PATCH 2/4] ipv4: Update pmtu informations on inetpeer only for output routes
From: Steffen Klassert @ 2011-11-15 10:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20111114.143320.773675445837769668.davem@davemloft.net>
On Mon, Nov 14, 2011 at 02:33:20PM -0500, David Miller wrote:
> From: Steffen Klassert <steffen.klassert@secunet.com>
> Date: Mon, 14 Nov 2011 11:12:44 +0100
>
> > So for the moment I'm thinking about adding an ip_dst_mtu()
> > function that returns dst->ops->default_mtu() for input routes
> > and dst_mtu() for output routes. Then we could convert the
> > dst_mtu() users in net/ipv4/ over to this one.
>
> We'll need something similar for ipv6 eventually...
Well, probaply. I did not test with ipv6 yet, so I focused to
fix the ipv4 part in the first place.
>
> I would suggest that we do away with dst_ops->default_mtu() and just
> have dst_ops->mtu() which gets invoked unconditionally by dst_mtu().
>
> You can integrate the ->default_mtu() handling and the input route
> check into this new method. Then IPv6 can be fixed in a
> straightforward manner later.
Ok, I'll look into this.
^ permalink raw reply
* Re: [v2 PATCH 1/2] NETFILTER module xt_hmark new target for HASH based fw
From: Pablo Neira Ayuso @ 2011-11-15 10:01 UTC (permalink / raw)
To: Jan Engelhardt
Cc: Hans Schillstrom, Hans Schillstrom, kaber, netfilter-devel,
netdev
In-Reply-To: <alpine.LNX.2.01.1111141237410.26961@frira.zrqbmnf.qr>
On Mon, Nov 14, 2011 at 12:38:28PM +0100, Jan Engelhardt wrote:
> On Monday 2011-11-14 10:19, Hans Schillstrom wrote:
>
> >
> >On Sunday, November 13, 2011 18:05:28 Pablo Neira Ayuso wrote:
> >> BTW, I think you should split xt_HMARK to ipt_HMARK and ip6t_HMARK
> >> (see recent Florian Westphal patches regarding reserve lookup for
> >> instance).
> >>
> >> The IPv4 and IPv6 parts for HMARK look so different that I don't think
> >> it makes sense to keep them into one single xt_HMARK thing with all
> >> those conditional ifdefs for IPV6.
> >>
> >Ok I'll do that, for some reason a thought it was better with one module.
>
> So do I. The module overhead is so much larger.
Yes, it will if both modules are loaded.
I think it depends, if you only load IPv4 support, the overhead will
be smaller than having everything into one module.
But I'm open to more discussion on this, of course.
^ permalink raw reply
* re: IPv6 routing, NLM_F_* flag support: REPLACE and EXCL
From: Matti Vaittinen @ 2011-11-15 10:26 UTC (permalink / raw)
To: ext Dan Carpenter; +Cc: netdev
In-Reply-To: <20111115090107.GA18307@elgon.mountain>
On Tue, 2011-11-15 at 12:01 +0300, ext Dan Carpenter wrote:
> flags support, warn about missing CREATE flag
>
> Hello Matti Vaittinen,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 4a287eba2de3: "IPv6 routing, NLM_F_* flag support: REPLACE
> and EXCL flags support, warn about missing CREATE flag" from Nov 14,
> 2011, leads to the following Smatch complaint:
>
> net/ipv6/ip6_fib.c +656 fib6_add_rt2node()
> error: we previously assumed 'info' could be null (see line 641)
>
> net/ipv6/ip6_fib.c
> 640 (info->nlh->nlmsg_flags&NLM_F_REPLACE));
> 641 int add = ((NULL == info || NULL == info->nlh) ||
> ^^^^^^^^^^^^
> Checked here.
>
> 642 (info->nlh->nlmsg_flags&NLM_F_CREATE));
> 656 if (NULL != info->nlh &&
> ^^^^^^^^^
> Not checked here. Btw, I looked at the callers and info is always
> a valid pointer.
Yes. It really seems the info is always a valid pointer.
I could find only two places where this info can come from.
First is ip6_ins_rt at route.c where info is allocated from stack.
Second is ip6_route_add, where info is part of the
fib6_config struct - and already assumed to be valid.
I'll prepare a patch which removes these unnecessary checks.
--
Matti Vaittinen
+358 504863070
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Told a UDP joke the other night...
...but I'm not sure everyone got it...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply
* Re: sky2 hw csum failure
From: Yan, Zheng @ 2011-11-15 10:28 UTC (permalink / raw)
To: Martin Volf
Cc: shemminger@linux-foundation.org,
bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
davem@davemloft.net, wcang@sfc.wide.ad.jp
In-Reply-To: <CAM1AHpSuruDx3CxzK=Med0iyxxwu7wxgRZib7yhBMiCVKXqzeA@mail.gmail.com>
On 11/15/2011 05:05 PM, Martin Volf wrote:
> Hello,
>
> since 3.0.6 I get many "eth0: hw csum failure" messages in dmesg
> followed by a call trace (see at the end). 3.0.4 is OK, 3.1.1 is not.
>
> When I revert the "bridge: Pseudo-header required for the checksum of
> ICMPv6" commit, 4b275d7efa1c4412f0d572fcd7f78ed0919370b3, in 3.1.1,
> the messages would not occur.
>
> I have two sky2 interfaces bridged together and I use IPv6, but not
> MLD. Most of the time only one interface is connected, the message
> occurs for either of them. Another machine with bridged e1000 and
> r8169 interfaces is OK even without the revert.
>
> Let me know, if more information is needed to create the correct fix.
>
> Martin Volf
>
> --
>
> HW info from 3.1.1 with the commit reverted:
>
> uname -mp
>
> x86_64 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
>
> dmesg | fgrep sky2
>
> [ 11.226565] sky2: driver version 1.29
> [ 11.226601] sky2 0000:04:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
> [ 11.226614] sky2 0000:04:00.0: setting latency timer to 64
> [ 11.226644] sky2 0000:04:00.0: Yukon-2 EC Ultra chip revision 3
> [ 11.226719] sky2 0000:04:00.0: irq 47 for MSI/MSI-X
> [ 11.227327] sky2 0000:04:00.0: eth0: addr 00:22:15:98:82:ae
> [ 11.227338] sky2 0000:03:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
> [ 11.227346] sky2 0000:03:00.0: setting latency timer to 64
> [ 11.227366] sky2 0000:03:00.0: Yukon-2 EC Ultra chip revision 3
> [ 11.227436] sky2 0000:03:00.0: irq 48 for MSI/MSI-X
> [ 11.227625] sky2 0000:03:00.0: eth1: addr 00:22:15:98:92:e1
> [ 31.809358] sky2 0000:03:00.0: eth1: enabling interface
> [ 31.816587] sky2 0000:04:00.0: eth0: enabling interface
> [ 34.196835] sky2 0000:04:00.0: eth0: Link is up at 1000 Mbps, full
> duplex, flow control both
>
> ethtool -k eth0 (same for eth1)
>
> Offload parameters for eth0:
> rx-checksumming: on
> tx-checksumming: on
> scatter-gather: on
> tcp-segmentation-offload: on
> udp-fragmentation-offload: off
> generic-segmentation-offload: on
> generic-receive-offload: on
> large-receive-offload: off
> rx-vlan-offload: on
> tx-vlan-offload: on
> ntuple-filters: off
> receive-hashing: on
>
> lspci -vvvxxx
> 03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056
> PCI-E Gigabit Ethernet Controller (rev 12)
> Subsystem: ASUSTeK Computer Inc. Device 81f8
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
> Interrupt: pin A routed to IRQ 48
> Region 0: Memory at fe9fc000 (64-bit, non-prefetchable) [size=16K]
> Region 2: I/O ports at c800 [size=256]
> Expansion ROM at fe9c0000 [disabled] [size=128K]
> Capabilities: [48] Power Management version 3
> Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
> Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
> Capabilities: [50] Vital Product Data
> Product Name: Marvell Yukon 88E8056 Gigabit Ethernet Controller
> Read-only fields:
> [PN] Part number: Yukon 88E8056
> [EC] Engineering changes: Rev. 1.2
> [MN] Manufacture ID: 4d 61 72 76 65 6c 6c
> [SN] Serial number: AbCdEfG9892E1
> [CP] Extended capability: 01 10 cc 03
> [RV] Reserved: checksum good, 9 byte(s) reserved
> Read/write fields:
> [RW] Read-write area: 121 byte(s) free
> End
> Capabilities: [5c] MSI: Enable+ Count=1/1 Maskable- 64bit+
> Address: 00000000fee0300c Data: 4199
> Capabilities: [e0] Express (v1) Legacy Endpoint, MSI 00
> DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
> unlimited, L1 unlimited
> ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
> DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
> RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
> MaxPayload 128 bytes, MaxReadReq 512 bytes
> DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+
> AuxPwr+ TransPend-
> LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1,
> Latency L0 <256ns, L1 unlimited
> ClockPM+ Surprise- LLActRep- BwNot-
> LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- Retrain- CommClk-
> ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train-
> SlotClk+ DLActive- BWMgmt- ABWMgmt-
> Capabilities: [100 v1] Advanced Error Reporting
> UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
> CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
> CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
> AERCap: First Error Pointer: 1f, GenCap- CGenEn- ChkCap- ChkEn-
> Kernel driver in use: sky2
> Kernel modules: sky2
> 00: ab 11 64 43 07 04 10 00 12 00 00 02 08 00 00 00
> 10: 04 c0 9f fe 00 00 00 00 01 c8 00 00 00 00 00 00
> 20: 00 00 00 00 00 00 00 00 00 00 00 00 43 10 f8 81
> 30: 00 00 9c fe 48 00 00 00 00 00 00 00 05 01 00 00
> 40: 00 00 f0 01 00 80 a0 01 01 50 03 fe 00 20 00 13
> 50: 03 5c fc 80 00 00 00 78 00 00 00 01 05 e0 81 00
> 60: 0c 30 e0 fe 00 00 00 00 99 41 00 00 00 00 00 00
> 70: 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 80: 00 00 00 00 00 70 00 00 00 00 00 00 82 a8 e8 00
> 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 10 00 11 00 c0 8f 28 00 00 20 19 00 11 ac 07 00
> f0: 08 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
>
> Call trace:
>
> [ 64.240856] eth1: hw csum failure.
> [ 64.240860] Pid: 0, comm: swapper Not tainted 3.1.1 #1
> [ 64.240862] Call Trace:
> [ 64.240864] <IRQ> [<ffffffff812acebf>] ? netdev_rx_csum_fault+0x29/0x31
> [ 64.240875] [<ffffffff812a8e42>] ? __skb_checksum_complete_head+0x44/0x59
> [ 64.240884] [<ffffffffa0174ea7>] ? br_multicast_rcv+0x7fc/0xc3f [bridge]
> [ 64.240888] [<ffffffff81095c16>] ? dma_pool_alloc+0x267/0x279
> [ 64.240893] [<ffffffff8102177d>] ? check_preempt_curr+0x38/0x61
> [ 64.240898] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
> [ 64.240903] [<ffffffff812d1472>] ? nf_hook_slow+0x73/0x111
> [ 64.240908] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
> [ 64.240914] [<ffffffffa0172706>] ? br_nf_forward_finish+0x95/0x95 [bridge]
> [ 64.240919] [<ffffffffa016e205>] ?
> br_handle_frame_finish+0x7e/0x1f3 [bridge]
> [ 64.240925] [<ffffffffa017278f>] ?
> br_nf_pre_routing_finish_ipv6+0x89/0x92 [bridge]
> [ 64.240931] [<ffffffffa0171efe>] ? setup_pre_routing+0x38/0x5d [bridge]
> [ 64.240936] [<ffffffffa0172f65>] ? br_nf_pre_routing+0x3bb/0x3cb [bridge]
> [ 64.240940] [<ffffffff81026f31>] ? find_busiest_group+0x1fc/0x851
> [ 64.240943] [<ffffffff810242c4>] ? enqueue_task_fair+0x126/0x219
> [ 64.240947] [<ffffffff812d13c9>] ? nf_iterate+0x41/0x77
> [ 64.240952] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
> [ 64.240957] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
> [ 64.240961] [<ffffffff812d1472>] ? nf_hook_slow+0x73/0x111
> [ 64.240966] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
> [ 64.240971] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
> [ 64.240976] [<ffffffffa016e16d>] ? NF_HOOK.clone.4+0x3c/0x56 [bridge]
> [ 64.240982] [<ffffffffa016e529>] ? br_handle_frame+0x1af/0x1c6 [bridge]
> [ 64.240987] [<ffffffffa016e37a>] ?
> br_handle_frame_finish+0x1f3/0x1f3 [bridge]
> [ 64.240990] [<ffffffff812af07b>] ? __netif_receive_skb+0x26a/0x3b1
> [ 64.240994] [<ffffffff812af34e>] ? netif_receive_skb+0x52/0x58
> [ 64.240997] [<ffffffff812af7fe>] ? napi_gro_receive+0x1f/0x2f
> [ 64.241000] [<ffffffff812af425>] ? napi_skb_finish+0x1c/0x31
> [ 64.241011] [<ffffffffa001459e>] ? sky2_poll+0x784/0x999 [sky2]
> [ 64.241015] [<ffffffff812af8da>] ? net_rx_action+0x61/0x117
> [ 64.241019] [<ffffffff81031164>] ? __do_softirq+0x7f/0x106
> [ 64.241023] [<ffffffff8135af8c>] ? call_softirq+0x1c/0x30
> [ 64.241027] [<ffffffff8100365a>] ? do_softirq+0x31/0x67
> [ 64.241030] [<ffffffff81031390>] ? irq_exit+0x3f/0xa3
> [ 64.241033] [<ffffffff810033b7>] ? do_IRQ+0x85/0x9e
> [ 64.241036] [<ffffffff813597ab>] ? common_interrupt+0x6b/0x6b
> [ 64.241038] <EOI> [<ffffffff810081c1>] ? mwait_idle+0x59/0x5c
> [ 64.241044] [<ffffffff8100098a>] ? cpu_idle+0x5c/0x7e
> [ 64.241047] [<ffffffff8166f886>] ? start_kernel+0x304/0x30f
Hi,
I re-tested the checksum code, both CHECKSUM_NONE and CHECKSUM_COMPLETE
cases are OK. Maybe the bug is related to sky2.
Regards
Yan, Zheng
^ permalink raw reply
* [PATCH net-next] IPv6: Removing unnecessary NULL checks introduced in 4a287eba2de395713d8b2b2aeaa69fa086832d34.
From: Matti Vaittinen @ 2011-11-15 10:58 UTC (permalink / raw)
To: davem; +Cc: netdev
This patch removes unnecessary NULL checks noticed by Dan Carpenter.
Checks were introduced in commit
4a287eba2de395713d8b2b2aeaa69fa086832d34 to net-next.
Signed-off-by: Matti Vaittinen <Mazziesaccount@gmail.com>
--
diff -uNr commit4a287eba2de395713d8b2b2aeaa69fa086832d34.orig/net/ipv6/ip6_fib.c commit4a287eba2de395713d8b2b2aeaa69fa086832d34.new/net/ipv6/ip6_fib.c
--- commit4a287eba2de395713d8b2b2aeaa69fa086832d34.orig/net/ipv6/ip6_fib.c 2011-11-15 12:17:37.000000000 +0200
+++ commit4a287eba2de395713d8b2b2aeaa69fa086832d34.new/net/ipv6/ip6_fib.c 2011-11-15 12:25:59.000000000 +0200
@@ -635,10 +635,9 @@
{
struct rt6_info *iter = NULL;
struct rt6_info **ins;
- int replace = (NULL != info &&
- NULL != info->nlh &&
+ int replace = (NULL != info->nlh &&
(info->nlh->nlmsg_flags&NLM_F_REPLACE));
- int add = ((NULL == info || NULL == info->nlh) ||
+ int add = (NULL == info->nlh ||
(info->nlh->nlmsg_flags&NLM_F_CREATE));
int found = 0;
@@ -755,7 +754,7 @@
int err = -ENOMEM;
int allow_create = 1;
int replace_required = 0;
- if (NULL != info && NULL != info->nlh) {
+ if (NULL != info->nlh) {
if (!(info->nlh->nlmsg_flags&NLM_F_CREATE))
allow_create = 0;
if ((info->nlh->nlmsg_flags&NLM_F_REPLACE))
--
Matti Vaittinen
+358 504863070
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Told a UDP joke the other night...
...but I'm not sure everyone got it...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply
* Re: [PATCH Kernel-3.1.0] mdio-gpio: Add reset functionality to mdio-gpio driver.
From: Srinivas KANDAGATLA @ 2011-11-15 12:07 UTC (permalink / raw)
To: David Miller; +Cc: netdev, stuart.menefy
In-Reply-To: <20111114.144222.2216968580935980384.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
Hi Dave,
Thanks for the comments,
David Miller wrote:
> From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
> Date: Wed, 9 Nov 2011 13:38:51 +0000
>
>> + mdio_gpio_ops.reset = pdata->reset;
>
> What if I have multiple types of devices backing a mdio_gpio, each using
> different reset operations?
>
> You can't write this variable method into a globally used set of ops.
I agree with your comment.
Here is the modified patch, which moves the reset function pointer to
mdiobb_ctrl struct.
Thanks
srini
[-- Attachment #2: 0001-mdio-gpio-Add-reset-functionality-to-mdio-gpio-drive.patch --]
[-- Type: text/x-patch, Size: 2918 bytes --]
>From ea136182ac86535252bed85b1c465ff8cf586f60 Mon Sep 17 00:00:00 2001
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Date: Tue, 15 Nov 2011 11:54:15 +0000
Subject: [PATCH Kernel-3.1.0] mdio-gpio: Add reset functionality to mdio-gpio driver(v2).
This patch adds phy reset functionality to mdio-gpio driver. Now
mdio_gpio_platform_data has new member as function pointer which can be
filled at the bsp level for a callback from phy infrastructure. Also the
mdio-bitbang driver fills-in the reset function of mii_bus structure.
Without this patch the bsp level code has to takecare of the reseting
PHY's on the bus, which become bit hacky for every bsp and
phy-infrastructure is ignored aswell.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
drivers/net/phy/mdio-bitbang.c | 9 +++++++++
drivers/net/phy/mdio-gpio.c | 1 +
include/linux/mdio-bitbang.h | 2 ++
include/linux/mdio-gpio.h | 2 ++
4 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c
index 6539189..daec9b0 100644
--- a/drivers/net/phy/mdio-bitbang.c
+++ b/drivers/net/phy/mdio-bitbang.c
@@ -202,6 +202,14 @@ static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
return 0;
}
+static int mdiobb_reset(struct mii_bus *bus)
+{
+ struct mdiobb_ctrl *ctrl = bus->priv;
+ if (ctrl->reset)
+ ctrl->reset(bus);
+ return 0;
+}
+
struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl)
{
struct mii_bus *bus;
@@ -214,6 +222,7 @@ struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl)
bus->read = mdiobb_read;
bus->write = mdiobb_write;
+ bus->reset = mdiobb_reset;
bus->priv = ctrl;
return bus;
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 2843c90..89c5a3e 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -95,6 +95,7 @@ static struct mii_bus * __devinit mdio_gpio_bus_init(struct device *dev,
goto out;
bitbang->ctrl.ops = &mdio_gpio_ops;
+ bitbang->ctrl.reset = pdata->reset;
bitbang->mdc = pdata->mdc;
bitbang->mdio = pdata->mdio;
diff --git a/include/linux/mdio-bitbang.h b/include/linux/mdio-bitbang.h
index 8ea9a42..e8e7e1d 100644
--- a/include/linux/mdio-bitbang.h
+++ b/include/linux/mdio-bitbang.h
@@ -31,6 +31,8 @@ struct mdiobb_ops {
struct mdiobb_ctrl {
const struct mdiobb_ops *ops;
+ /* reset callback */
+ int (*reset)(struct mii_bus *bus);
};
/* The returned bus is not yet registered with the phy layer. */
diff --git a/include/linux/mdio-gpio.h b/include/linux/mdio-gpio.h
index e9d3fdf..7c9fe3c 100644
--- a/include/linux/mdio-gpio.h
+++ b/include/linux/mdio-gpio.h
@@ -20,6 +20,8 @@ struct mdio_gpio_platform_data {
unsigned int phy_mask;
int irqs[PHY_MAX_ADDR];
+ /* reset callback */
+ int (*reset)(struct mii_bus *bus);
};
#endif /* __LINUX_MDIO_GPIO_H */
--
1.6.3.3
^ permalink raw reply related
* [patch 5/5] [PATCH] qeth: Reduce CPU consumption through less SIGA-r calls
From: frank.blaschka @ 2011-11-15 12:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Einar Lueck
In-Reply-To: <20111115123111.128739986@de.ibm.com>
[-- Attachment #1: 623-qeth-reduce-siga.diff --]
[-- Type: text/plain, Size: 1166 bytes --]
From: Einar Lueck <elelueck@de.ibm.com>
Patch avoids SIGA-r calls in case of SIGA-r required. It only calls
SIGA-r if a threshold of free buffer is reached. CPU consumption is
reduced as a consequence.
Signed-off-by: Einar Lueck <elelueck@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff -urpN linux-2.6/drivers/s390/net/qeth_core.h linux-2.6-patched/drivers/s390/net/qeth_core.h
--- linux-2.6/drivers/s390/net/qeth_core.h 2011-11-14 18:26:56.000000000 +0100
+++ linux-2.6-patched/drivers/s390/net/qeth_core.h 2011-11-14 18:27:18.000000000 +0100
@@ -236,8 +236,7 @@ static inline int qeth_is_ipa_enabled(st
#define QETH_IN_BUF_COUNT_MAX 128
#define QETH_MAX_BUFFER_ELEMENTS(card) ((card)->qdio.in_buf_size >> 12)
#define QETH_IN_BUF_REQUEUE_THRESHOLD(card) \
- ((card)->ssqd.qdioac1 & AC1_SIGA_INPUT_NEEDED ? 1 : \
- ((card)->qdio.in_buf_pool.buf_count / 2))
+ ((card)->qdio.in_buf_pool.buf_count / 2)
/* buffers we have to be behind before we get a PCI */
#define QETH_PCI_THRESHOLD_A(card) ((card)->qdio.in_buf_pool.buf_count+1)
^ permalink raw reply
* [patch 0/5] s390: network driver bug fixes for 3.2.0 next rc
From: frank.blaschka @ 2011-11-15 12:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
Hi Dave,
here are a couple of s390 network driver bug fixes for 3.2.0 next rc
shortlog:
Ursula Braun (2)
qeth: return with -EPERM if sniffing is not enabled
netiucv: reinsert dev_alloc_name for device naming
Frank Blaschka (1)
qeth: l3 fix rcu splat in xmit
Christian Borntraeger (1)
qeth: remove WARN_ON leftover
Einar Lueck (1)
qeth: Reduce CPU consumption through less SIGA-r calls
Thanks,
Frank
^ permalink raw reply
* [patch 1/5] [PATCH] qeth: return with -EPERM if sniffing is not enabled
From: frank.blaschka @ 2011-11-15 12:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula Braun
In-Reply-To: <20111115123111.128739986@de.ibm.com>
[-- Attachment #1: 619-qeth-eperm-hs.diff --]
[-- Type: text/plain, Size: 956 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
Without appropriate configuration at the SE, a HiperSockets device
cannot be used for sniffing. Setting the sniffer attribute is rejected
with -EPERM.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_l3_sys.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_sys.c linux-2.6-patched/drivers/s390/net/qeth_l3_sys.c
--- linux-2.6/drivers/s390/net/qeth_l3_sys.c 2011-11-14 18:26:56.000000000 +0100
+++ linux-2.6-patched/drivers/s390/net/qeth_l3_sys.c 2011-11-14 18:27:16.000000000 +0100
@@ -335,10 +335,10 @@ static ssize_t qeth_l3_dev_sniffer_store
QETH_IN_BUF_COUNT_MAX)
qeth_realloc_buffer_pool(card,
QETH_IN_BUF_COUNT_MAX);
- break;
} else
rc = -EPERM;
- default: /* fall through */
+ break;
+ default:
rc = -EINVAL;
}
out:
^ permalink raw reply
* [patch 3/5] [PATCH] netiucv: reinsert dev_alloc_name for device naming
From: frank.blaschka @ 2011-11-15 12:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula Braun
In-Reply-To: <20111115123111.128739986@de.ibm.com>
[-- Attachment #1: 621-netiucv-dev-alloc-name.diff --]
[-- Type: text/plain, Size: 957 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
Invocation of dev_alloc_name() is re-inserted, because the created
net_device name is used to create the device name for the iucv bus.
This device is created before the register_netdev call.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/netiucv.c | 2 ++
1 file changed, 2 insertions(+)
diff -urpN linux-2.6/drivers/s390/net/netiucv.c linux-2.6-patched/drivers/s390/net/netiucv.c
--- linux-2.6/drivers/s390/net/netiucv.c 2011-10-24 09:10:05.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/netiucv.c 2011-11-14 18:27:17.000000000 +0100
@@ -1994,6 +1994,8 @@ static struct net_device *netiucv_init_n
netiucv_setup_netdevice);
if (!dev)
return NULL;
+ if (dev_alloc_name(dev, dev->name) < 0)
+ goto out_netdev;
privptr = netdev_priv(dev);
privptr->fsm = init_fsm("netiucvdev", dev_state_names,
^ permalink raw reply
* [patch 2/5] [PATCH] qeth: remove WARN_ON leftover
From: frank.blaschka @ 2011-11-15 12:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Christian Borntraeger
In-Reply-To: <20111115123111.128739986@de.ibm.com>
[-- Attachment #1: 620-qeth-warnon.diff --]
[-- Type: text/plain, Size: 1052 bytes --]
From: Christian Borntraeger <borntraeger@de.ibm.com>
The patch "qeth: exploit asynchronous delivery of storage blocks"
added a WARN_ON in qeth_schedule_recovery. A device recovery should
not cause a kernel warning. This is obviously a debugging left-over
that we forgot to remove.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 1 -
1 file changed, 1 deletion(-)
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
--- linux-2.6/drivers/s390/net/qeth_core_main.c 2011-11-14 18:26:56.000000000 +0100
+++ linux-2.6-patched/drivers/s390/net/qeth_core_main.c 2011-11-14 18:27:17.000000000 +0100
@@ -881,7 +881,6 @@ EXPORT_SYMBOL_GPL(qeth_do_run_thread);
void qeth_schedule_recovery(struct qeth_card *card)
{
QETH_CARD_TEXT(card, 2, "startrec");
- WARN_ON(1);
if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0)
schedule_work(&card->kernel_thread_starter);
}
^ permalink raw reply
* [patch 4/5] [PATCH] qeth: l3 fix rcu splat in xmit
From: frank.blaschka @ 2011-11-15 12:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
In-Reply-To: <20111115123111.128739986@de.ibm.com>
[-- Attachment #1: 622-qeth-rcu-xmit-splat.diff --]
[-- Type: text/plain, Size: 2689 bytes --]
From: Frank Blaschka <frank.blaschka@de.ibm.com>
when use dst_get_neighbour to get neighbour, we need
rcu_read_lock to protect, since dst_get_neighbour uses
rcu_dereference.
===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
include/net/dst.h:91 invoked rcu_dereference_check() without protection!
...
Call Trace:
([<0000000000011ad8>] show_trace+0x158/0x15c)
[<00000000003c395a>] qeth_l3_hard_start_xmit+0x212/0xb2c
[<00000000004006ac>] dev_hard_start_xmit+0x444/0x9bc
[<000000000041effa>] sch_direct_xmit+0xd2/0x328
[<000000000041f32a>] __qdisc_run+0xda/0x198
[<00000000003f84b6>] net_tx_action+0x152/0x360
[<000000000005798e>] __do_softirq+0xee/0x3b0
[<0000000000021330>] do_softirq+0xac/0x100
([<00000000000212f2>] do_softirq+0x6e/0x100)
[<0000000000057142>] local_bh_enable_ip+0x11a/0x120
[<000000000043ff50>] tcp_sendmsg+0x21c/0xe08
[<00000000003dfcdc>] sock_sendmsg+0xc8/0x100
[<00000000003e3d98>] SyS_sendto+0x108/0x140
[<00000000003e3e1c>] SyS_send+0x4c/0x5c
[<00000000003e4b62>] SyS_socketcall+0x206/0x348
[<00000000004e95ca>] sysc_noemu+0x16/0x1c
[<0000004a2a87dbb0>] 0x4a2a87dbb0
INFO: lockdep is turned off.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_l3_main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_main.c linux-2.6-patched/drivers/s390/net/qeth_l3_main.c
--- linux-2.6/drivers/s390/net/qeth_l3_main.c 2011-11-14 18:26:56.000000000 +0100
+++ linux-2.6-patched/drivers/s390/net/qeth_l3_main.c 2011-11-14 18:27:18.000000000 +0100
@@ -2756,11 +2756,13 @@ int inline qeth_l3_get_cast_type(struct
struct neighbour *n = NULL;
struct dst_entry *dst;
+ rcu_read_lock();
dst = skb_dst(skb);
if (dst)
n = dst_get_neighbour(dst);
if (n) {
cast_type = n->type;
+ rcu_read_unlock();
if ((cast_type == RTN_BROADCAST) ||
(cast_type == RTN_MULTICAST) ||
(cast_type == RTN_ANYCAST))
@@ -2768,6 +2770,8 @@ int inline qeth_l3_get_cast_type(struct
else
return RTN_UNSPEC;
}
+ rcu_read_unlock();
+
/* try something else */
if (skb->protocol == ETH_P_IPV6)
return (skb_network_header(skb)[24] == 0xff) ?
@@ -2847,6 +2851,8 @@ static void qeth_l3_fill_header(struct q
}
hdr->hdr.l3.length = skb->len - sizeof(struct qeth_hdr);
+
+ rcu_read_lock();
dst = skb_dst(skb);
if (dst)
n = dst_get_neighbour(dst);
@@ -2893,6 +2899,7 @@ static void qeth_l3_fill_header(struct q
QETH_CAST_UNICAST | QETH_HDR_PASSTHRU;
}
}
+ rcu_read_unlock();
}
static inline void qeth_l3_hdr_csum(struct qeth_card *card,
^ permalink raw reply
* [PATCH V2] vlan:return error when real dev is enslaved
From: Weiping Pan @ 2011-11-15 12:44 UTC (permalink / raw)
Cc: Weiping Pan, Patrick McHardy, David S. Miller,
open list:VLAN (802.1Q), open list
In-Reply-To: <CAM_iQpXCtH1cSJFsWVGrdreyhBgAjujLygktQGrK7iP-zyhN5g@mail.gmail.com>
Qinhuibin reported a kernel panic when he do some operation about vlan.
https://lkml.org/lkml/2011/11/6/218
The operation is as below:
ifconfig eth2 up
modprobe bonding
modprobe 8021q
ifconfig bond0 up
ifenslave bond0 eth2
vconfig add eth2 3300
vconfig add bond0 33
vconfig rem eth2.3300
the panic stack is as below:
[<ffffffffa002f1c9>] panic_event+0x49/0x70 [ipmi_msghandler]
[<ffffffff80378917>] notifier_call_chain+0x37/0x70
[<ffffffff80372122>] panic+0xa2/0x195
[<ffffffff80376ed8>] oops_end+0xd8/0x140
[<ffffffff8001bea7>] no_context+0xf7/0x280
[<ffffffff8001c1a5>] __bad_area_nosemaphore+0x175/0x250
[<ffffffff80376318>] page_fault+0x28/0x30
[<ffffffffa039dabd>] igb_vlan_rx_kill_vid+0x4d/0x100 [igb]
[<ffffffffa044045f>] bond_vlan_rx_kill_vid+0x9f/0x290 [bonding]
[<ffffffffa047e636>] unregister_vlan_dev+0x136/0x180 [8021q]
[<ffffffffa047ed20>] vlan_ioctl_handler+0x170/0x3f0 [8021q]
[<ffffffff802c1d3f>] sock_ioctl+0x21f/0x280
[<ffffffff800e6d7f>] vfs_ioctl+0x2f/0xb0
[<ffffffff800e726b>] do_vfs_ioctl+0x3cb/0x5a0
[<ffffffff800e74e1>] sys_ioctl+0xa1/0xb0
[<ffffffff80007388>] system_call_fastpath+0x16/0x1b
[<00007f108a2b8bd7>] 0x7f108a2b8bd7
And the nic is as below:
[root@localhost ~]# ethtool -i eth2
driver: igb
version: 3.0.6-k2
firmware-version: 1.2-1
bus-info: 0000:04:00.0
kernel version:
2.6.32.12-0.7 also happen in 2.6.32-131
For kernel 2.6.32, the reason of this bug is that when we do "vconfig add bond0 33",
adapter->vlgrp is overwritten in igb_vlan_rx_register. So when we do "vconfig rem
eth2.3300", it can't find the correct vlgrp.
And this bug is avoided by vlan cleanup patchset from Jiri Pirko
<jpirko@redhat.com>, especially commit b2cb09b1a772(igb: do vlan cleanup).
But it is not a correct operation to creat a vlan interface on eth2
when it have been enslaved by bond0, so this patch is to return error
when the real dev is already enslaved.
Changelog:
V2: use pr_err instead of pr_info
Signed-off-by: Weiping Pan <wpan@redhat.com>
---
net/8021q/vlan.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 5471628..7ce50ba 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -148,6 +148,11 @@ int vlan_check_real_dev(struct net_device *real_dev, u16 vlan_id)
const char *name = real_dev->name;
const struct net_device_ops *ops = real_dev->netdev_ops;
+ if (real_dev->flags & IFF_SLAVE) {
+ pr_err("Error, %s was already enslaved\n", name);
+ return -EOPNOTSUPP;
+ }
+
if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
pr_info("VLANs not supported on %s\n", name);
return -EOPNOTSUPP;
--
1.7.4.4
^ permalink raw reply related
* [PATCH] mlx4_en: using non collapsed CQ on TX
From: Yevgeny Petrilin @ 2011-11-15 10:27 UTC (permalink / raw)
To: davem; +Cc: netdev, yevgenyp
Moving to regular Completion Queue implementation (not collapsed)
Completion for each transmitted packet is written to new entry.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
---
drivers/net/ethernet/mellanox/mlx4/en_cq.c | 7 +--
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 65 ++++++++++++++--------------
2 files changed, 35 insertions(+), 37 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
index 227997d..2d1a342 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
@@ -51,10 +51,7 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv,
int err;
cq->size = entries;
- if (mode == RX)
- cq->buf_size = cq->size * sizeof(struct mlx4_cqe);
- else
- cq->buf_size = sizeof(struct mlx4_cqe);
+ cq->buf_size = cq->size * sizeof(struct mlx4_cqe);
cq->ring = ring;
cq->is_tx = mode;
@@ -120,7 +117,7 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
cq->size = priv->rx_ring[cq->ring].actual_size;
err = mlx4_cq_alloc(mdev->dev, cq->size, &cq->wqres.mtt, &mdev->priv_uar,
- cq->wqres.db.dma, &cq->mcq, cq->vector, cq->is_tx);
+ cq->wqres.db.dma, &cq->mcq, cq->vector, 0);
if (err)
return err;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index d901b42..3094f94 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -307,59 +307,60 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
return cnt;
}
-
static void mlx4_en_process_tx_cq(struct net_device *dev, struct mlx4_en_cq *cq)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_cq *mcq = &cq->mcq;
struct mlx4_en_tx_ring *ring = &priv->tx_ring[cq->ring];
- struct mlx4_cqe *cqe = cq->buf;
+ struct mlx4_cqe *cqe;
u16 index;
- u16 new_index;
+ u16 new_index, ring_index;
u32 txbbs_skipped = 0;
- u32 cq_last_sav;
-
- /* index always points to the first TXBB of the last polled descriptor */
- index = ring->cons & ring->size_mask;
- new_index = be16_to_cpu(cqe->wqe_index) & ring->size_mask;
- if (index == new_index)
- return;
+ u32 cons_index = mcq->cons_index;
+ int size = cq->size;
+ u32 size_mask = ring->size_mask;
+ struct mlx4_cqe *buf = cq->buf;
if (!priv->port_up)
return;
- /*
- * We use a two-stage loop:
- * - the first samples the HW-updated CQE
- * - the second frees TXBBs until the last sample
- * This lets us amortize CQE cache misses, while still polling the CQ
- * until is quiescent.
- */
- cq_last_sav = mcq->cons_index;
- do {
+ index = cons_index & size_mask;
+ cqe = &buf[index];
+ ring_index = ring->cons & size_mask;
+
+ /* Process all completed CQEs */
+ while (XNOR(cqe->owner_sr_opcode & MLX4_CQE_OWNER_MASK,
+ cons_index & size)) {
+ /*
+ * make sure we read the CQE after we read the
+ * ownership bit
+ */
+ rmb();
+
+ /* Skip over last polled CQE */
+ new_index = be16_to_cpu(cqe->wqe_index) & size_mask;
+
do {
- /* Skip over last polled CQE */
- index = (index + ring->last_nr_txbb) & ring->size_mask;
txbbs_skipped += ring->last_nr_txbb;
-
- /* Poll next CQE */
+ ring_index = (ring_index + ring->last_nr_txbb) & size_mask;
+ /* free next descriptor */
ring->last_nr_txbb = mlx4_en_free_tx_desc(
- priv, ring, index,
- !!((ring->cons + txbbs_skipped) &
- ring->size));
- ++mcq->cons_index;
+ priv, ring, ring_index,
+ !!((ring->cons + txbbs_skipped) &
+ ring->size));
+ } while (ring_index != new_index);
- } while (index != new_index);
+ ++cons_index;
+ index = cons_index & size_mask;
+ cqe = &buf[index];
+ }
- new_index = be16_to_cpu(cqe->wqe_index) & ring->size_mask;
- } while (index != new_index);
- AVG_PERF_COUNTER(priv->pstats.tx_coal_avg,
- (u32) (mcq->cons_index - cq_last_sav));
/*
* To prevent CQ overflow we first update CQ consumer and only then
* the ring consumer.
*/
+ mcq->cons_index = cons_index;
mlx4_cq_set_ci(mcq);
wmb();
ring->cons += txbbs_skipped;
--
1.7.7
^ permalink raw reply related
* Re: [PATCH 2/3] MIPS: Octeon: Update bootloader board type constants.
From: Ralf Baechle @ 2011-11-15 14:08 UTC (permalink / raw)
To: ddaney.cavm; +Cc: linux-mips, netdev, gregkh, devel, David Daney
In-Reply-To: <1320971387-29343-3-git-send-email-ddaney.cavm@gmail.com>
Queued for 3.3. Thanks,
Ralf
^ permalink raw reply
* Re: [PATCH 1/3] MIPS: Octeon: Move some Ethernet support files out of staging.
From: Ralf Baechle @ 2011-11-15 14:08 UTC (permalink / raw)
To: ddaney.cavm; +Cc: linux-mips, netdev, gregkh, devel, David Daney
In-Reply-To: <1320971387-29343-2-git-send-email-ddaney.cavm@gmail.com>
Queued for 3.3. Thanks,
Ralf
^ permalink raw reply
* Re: [PATCH 3/3] MIPS: Octeon: Rearrange CVMX files in preperation for device tree
From: Ralf Baechle @ 2011-11-15 14:08 UTC (permalink / raw)
To: ddaney.cavm; +Cc: linux-mips, netdev, gregkh, devel, David Daney
In-Reply-To: <1320971387-29343-4-git-send-email-ddaney.cavm@gmail.com>
Queued for 3.3. Thanks,
Ralf
^ permalink raw reply
* [PATCN net-next] net: use jump_label for netstamp_needed
From: Eric Dumazet @ 2011-11-15 14:12 UTC (permalink / raw)
To: David Miller; +Cc: netdev
netstamp_needed seems a good candidate to jump_label conversion.
This avoids 3 conditional branches per incoming packet in fast path.
No measurable difference, given that these conditional branches are
predicted on modern cpus. Only a small icache reduction, thanks to the
unlikely() stuff.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/core/dev.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 6ba50a1..51f89cd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -137,6 +137,7 @@
#include <linux/if_pppox.h>
#include <linux/ppp_defs.h>
#include <linux/net_tstamp.h>
+#include <linux/jump_label.h>
#include "net-sysfs.h"
@@ -1449,34 +1450,32 @@ int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
}
EXPORT_SYMBOL(call_netdevice_notifiers);
-/* When > 0 there are consumers of rx skb time stamps */
-static atomic_t netstamp_needed = ATOMIC_INIT(0);
+static struct jump_label_key netstamp_needed __read_mostly;
void net_enable_timestamp(void)
{
- atomic_inc(&netstamp_needed);
+ jump_label_inc(&netstamp_needed);
}
EXPORT_SYMBOL(net_enable_timestamp);
void net_disable_timestamp(void)
{
- atomic_dec(&netstamp_needed);
+ jump_label_dec(&netstamp_needed);
}
EXPORT_SYMBOL(net_disable_timestamp);
static inline void net_timestamp_set(struct sk_buff *skb)
{
- if (atomic_read(&netstamp_needed))
+ skb->tstamp.tv64 = 0;
+ if (static_branch(&netstamp_needed))
__net_timestamp(skb);
- else
- skb->tstamp.tv64 = 0;
}
-static inline void net_timestamp_check(struct sk_buff *skb)
-{
- if (!skb->tstamp.tv64 && atomic_read(&netstamp_needed))
- __net_timestamp(skb);
-}
+#define net_timestamp_check(COND, SKB) \
+ if (static_branch(&netstamp_needed)) { \
+ if ((COND) && !(SKB)->tstamp.tv64) \
+ __net_timestamp(SKB); \
+ } \
static int net_hwtstamp_validate(struct ifreq *ifr)
{
@@ -2997,8 +2996,7 @@ int netif_rx(struct sk_buff *skb)
if (netpoll_rx(skb))
return NET_RX_DROP;
- if (netdev_tstamp_prequeue)
- net_timestamp_check(skb);
+ net_timestamp_check(netdev_tstamp_prequeue, skb);
trace_netif_rx(skb);
#ifdef CONFIG_RPS
@@ -3230,8 +3228,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
int ret = NET_RX_DROP;
__be16 type;
- if (!netdev_tstamp_prequeue)
- net_timestamp_check(skb);
+ net_timestamp_check(!netdev_tstamp_prequeue, skb);
trace_netif_receive_skb(skb);
@@ -3362,8 +3359,7 @@ out:
*/
int netif_receive_skb(struct sk_buff *skb)
{
- if (netdev_tstamp_prequeue)
- net_timestamp_check(skb);
+ net_timestamp_check(netdev_tstamp_prequeue, skb);
if (skb_defer_rx_timestamp(skb))
return NET_RX_SUCCESS;
^ permalink raw reply related
* Re: [PATCH] net: fsl_pq_mdio: fix non tbi phy access
From: Andy Fleming @ 2011-11-15 15:06 UTC (permalink / raw)
To: Baruch Siach; +Cc: netdev@vger.kernel.org, linuxppc-dev
In-Reply-To: <20111115051713.GA4052@sapphire.tkos.co.il>
On Nov 14, 2011, at 11:17 PM, Baruch Siach wrote:
> Hi Andy,
>
> On Mon, Nov 14, 2011 at 09:04:47PM +0000, Fleming Andy-AFLEMING wrote:
>> Well, this got applied quickly, so I guess I can't NAK, but this requires discussion.
>>
>> On Nov 14, 2011, at 0:22, "Baruch Siach" <baruch@tkos.co.il> wrote:
>>
>>> Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address configuration) .probe returns
>>> -EBUSY when the "tbi-phy" node is missing. Fix this.
>>
>> It returns an error because it finds no tbi node. Because without the tbi
>> node, there is no way for the driver to determine which address to set.
>>
>> Your solution is to ignore the error, and hope. That's a broken approach.
>> The real solution for a p1010 should be to have a tbi node in the dts.
>
> Can you elaborate a bit on why this approach is broken? The PHY used to work
> for me until 952c5ca1, and with this applied.
Yes, well, just because a problem goes away when a patch is applied does not mean that the patch is correct, or that it made things work.
An explanation:
In order to support certain types of serial data interfaces with external PHYs (like SGMII), it is necessary to translate the MAC's data signaling into the serialized signaling. On Freescale parts, this is done via a SerDes block, but the SerDes link needs a small amount of management. To perform this management, we have an onboard "TBI" PHY. This PHY is highly integrated with the MAC and MDIO devices. Each MAC has two relevant components:
1) a TBIPA register, which declares the address of the TBI PHY
2) an associated MDIO controller.
In order to configure the SerDes link, it is necessary to communicate via the "local" MDIO controller with the TBI PHY. For most of the MACs, this is simple: Choose an address for TBIPA, and then use that address to communicate with the TBI PHY. However, the *first* MDIO controller is also used to communicate with external PHYs. On this controller, we have to be fairly particular about which address we put in TBIPA, because all transactions to that address will go to the TBI PHY. On older parts, this value defaulted to "0", but it now defaults to "31", I believe.
Ok, so now we're at this code. The of_mdiobus_register() function will parse the device tree, and find all of the PHYs on the MDIO bus, and register them as devices. In order to ensure that all of those PHYs are accessible, we *MUST* set TBIPA to something that won't conflict with any existing addresses. The mechanism we have chosen for this is to assign the address in the device tree, via a tbi-phy node.
My recent patch changed the behavior, because we used to try to find a free address via scanning, but this was somewhat ugly, and failed (as you noticed) due to uninitialized mutexes.
The reason your latest patch is wrong is because it doesn't set the TBIPA register at all if there is no tbi-phy node. Instead, it just relies on luck, hoping that the TBIPA register was set to something that doesn't conflict already. It will work if 0x1f or 0 aren't necessary PHY addresses for your board, or if the firmware set it to something sensible.
>
>> And looking at the p1010si.dtsi, I see that it's automatically there for
>> you.
>>
>> How were you breaking?
>
> Adding linuxppc to Cc.
>
> My board is P1011 based, the single core version of P1020, not P1010. In
> p1020si.dtsi I see no tbi node. In p1020rdb.dts I see a tbi node but only for
> mdio@25000, not mdio@24000, which is what I'm using.
>
> Am I missing something?
Well, that's a bug. In truth, the silicon dtsi trees should not have tbi nodes, as that's highly machine-specific. The p1020rdb is apparently relying on the old behavior, which is broken, and due to the fact that the first ethernet interface doesn't *use* the TBI PHY.
You should add this to your board tree:
mdio@24000 {
tbi0: tbi-phy@11 {
reg = <0x11>;
device_type = "tbi-phy";
};
};
And add the PHYs you use, as well as set reg (and the value after the "@") to something that makes sense for your board.
I am going to go right now, and add tbi nodes for all of the Freescale platforms. I will also modify the fsl_pq_mdio code to be more explicit about its reason for failure.
Andy
^ permalink raw reply
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
From: Mark Lord @ 2011-11-15 15:19 UTC (permalink / raw)
To: David Miller; +Cc: grundler, netdev, linux-kernel, allan, freddy
In-Reply-To: <20111114.214542.1423779515286773837.davem@davemloft.net>
On 11-11-14 09:45 PM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Mon, 14 Nov 2011 21:41:51 -0500 (EST)
>
>> Come on man... are you kidding me?
>
> Want to know what really pisses me off about this?
>
> All of Mark Lord's hard work to bring the entire vendor driver over
> was thrown out.
Well, ASIX and I appear to be back on track again.
So once the dust settles in net-dev with Grant's patches,
I will take over development of the asix driver,
and start sending you (Dave) patches to merge the
rest of the vendor's driver code.
With luck, it might all make it in there in time for the next (3.3) merge.
Cheers
^ 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