Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] xfrm: make local error reporting more robust
From: Hannes Frederic Sowa @ 2013-08-13  0:48 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: Eric Dumazet, netdev, vi0oss
In-Reply-To: <20130812055414.GK25511@secunet.com>

On Mon, Aug 12, 2013 at 07:54:14AM +0200, Steffen Klassert wrote:
> On Sat, Aug 10, 2013 at 06:16:29PM +0200, Hannes Frederic Sowa wrote:
> > 
> > Seems skb->encapsulated helps, but I still have to wire it up for the ipv6
> > tunnels.
> > 
> > I just prototyped this patch, but I fear I now introduced a dependency
> > from core xfrm to ipv6, which I would like to have prevented (this would
> > even happen if I put xfrm_local_error in a header file). Is this actually
> > a problem? I fear so. The other way would be to put the local_error
> > handler as function pointers somewhere reachable from struct sock.
> > 
> 
> Maybe we should put a local_error() function pointer to struct
> xfrm_state_afinfo and call it via inner_mode->afinfo->local_error().
> 
> This should always call the right local_error function and we
> would not need to touch generic networking code to fix it.

afinfo was a great hint. But I could not use inner_mode, because it
would still point to the wrong afinfo instance.

I tested this patch with vi0ss's great test script:
<https://gist.github.com/vi/5640512>

I will look at the skb->encapsulation for IPv6 logic again, as soon
as I understand the side effects when I introduce this. This will then
correct the destination address when sending back ipv6 errors.

Steffen, if you are fine with this patch, do you think it is a candidate
for stable?

[PATCH net-next] xfrm: make local error reporting more robust

In xfrm4 and xfrm6 we need to take care about sockets of the other
address family. This could happen because a 6in4 or 4in6 tunnel could
get protected by ipsec.

Because we don't want to have a run-time dependency on ipv6 when only
using ipv4 xfrm we have to embed a pointer to the correct local_error
function in xfrm_state_afinet and look it up when returning an error
depending on the socket address family.

Thanks to vi0ss for the great bug report:
<https://bugzilla.kernel.org/show_bug.cgi?id=58691>

Reported-by: <vi0oss@gmail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 include/net/xfrm.h      |  6 ++++++
 net/ipv4/xfrm4_output.c | 12 ++++++++++--
 net/ipv4/xfrm4_state.c  |  1 +
 net/ipv6/xfrm6_output.c |  4 ++--
 net/ipv6/xfrm6_state.c  |  1 +
 net/xfrm/xfrm_output.c  | 12 ++++++++++++
 net/xfrm/xfrm_state.c   |  7 ++-----
 7 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 94ce082..e823786 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -341,10 +341,13 @@ struct xfrm_state_afinfo {
 						  struct sk_buff *skb);
 	int			(*transport_finish)(struct sk_buff *skb,
 						    int async);
+	void			(*local_error)(struct sk_buff *skb, u32 mtu);
 };
 
 extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
 extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
+extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family);
+extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
 
 extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
 
@@ -1477,6 +1480,7 @@ extern int xfrm_input_resume(struct sk_buff *skb, int nexthdr);
 extern int xfrm_output_resume(struct sk_buff *skb, int err);
 extern int xfrm_output(struct sk_buff *skb);
 extern int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb);
+extern void xfrm_local_error(struct sk_buff *skb, int mtu);
 extern int xfrm4_extract_header(struct sk_buff *skb);
 extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb);
 extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
@@ -1497,6 +1501,7 @@ extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short fam
 extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
 extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler);
 extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler);
+extern void xfrm4_local_error(struct sk_buff *skb, u32 mtu);
 extern int xfrm6_extract_header(struct sk_buff *skb);
 extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb);
 extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);
@@ -1514,6 +1519,7 @@ extern int xfrm6_output(struct sk_buff *skb);
 extern int xfrm6_output_finish(struct sk_buff *skb);
 extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
 				 u8 **prevhdr);
+extern void xfrm6_local_error(struct sk_buff *skb, u32 mtu);
 
 #ifdef CONFIG_XFRM
 extern int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb);
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index 327a617..7a5491f 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -33,8 +33,7 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
 	mtu = dst_mtu(dst);
 	if (skb->len > mtu) {
 		if (skb->sk)
-			ip_local_error(skb->sk, EMSGSIZE, ip_hdr(skb)->daddr,
-				       inet_sk(skb->sk)->inet_dport, mtu);
+			xfrm_local_error(skb, mtu);
 		else
 			icmp_send(skb, ICMP_DEST_UNREACH,
 				  ICMP_FRAG_NEEDED, htonl(mtu));
@@ -99,3 +98,12 @@ int xfrm4_output(struct sk_buff *skb)
 			    x->outer_mode->afinfo->output_finish,
 			    !(IPCB(skb)->flags & IPSKB_REROUTED));
 }
+
+void xfrm4_local_error(struct sk_buff *skb, u32 mtu)
+{
+	struct iphdr *hdr;
+
+	hdr = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb);
+	ip_local_error(skb->sk, EMSGSIZE, hdr->daddr,
+		       inet_sk(skb->sk)->inet_dport, mtu);
+}
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index 9258e75..0b2a064 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -83,6 +83,7 @@ static struct xfrm_state_afinfo xfrm4_state_afinfo = {
 	.extract_input		= xfrm4_extract_input,
 	.extract_output		= xfrm4_extract_output,
 	.transport_finish	= xfrm4_transport_finish,
+	.local_error		= xfrm4_local_error,
 };
 
 void __init xfrm4_state_init(void)
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index 8755a30..f6f9110 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -54,7 +54,7 @@ static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
 	ipv6_local_rxpmtu(sk, &fl6, mtu);
 }
 
-static void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
+void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
 {
 	struct flowi6 fl6;
 	struct sock *sk = skb->sk;
@@ -80,7 +80,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
 		if (xfrm6_local_dontfrag(skb))
 			xfrm6_local_rxpmtu(skb, mtu);
 		else if (skb->sk)
-			xfrm6_local_error(skb, mtu);
+			xfrm_local_error(skb, mtu);
 		else
 			icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
 		ret = -EMSGSIZE;
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index d8c70b8..3fc9701 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -183,6 +183,7 @@ static struct xfrm_state_afinfo xfrm6_state_afinfo = {
 	.extract_input		= xfrm6_extract_input,
 	.extract_output		= xfrm6_extract_output,
 	.transport_finish	= xfrm6_transport_finish,
+	.local_error		= xfrm6_local_error,
 };
 
 int __init xfrm6_state_init(void)
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index eb4a842..c445a2f 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -214,5 +214,17 @@ int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb)
 	return inner_mode->afinfo->extract_output(x, skb);
 }
 
+void xfrm_local_error(struct sk_buff *skb, int mtu)
+{
+	struct xfrm_state_afinfo *afinfo;
+
+	afinfo = xfrm_state_get_afinfo(skb->sk->sk_family);
+	if (!afinfo)
+		return;
+
+	afinfo->local_error(skb, mtu);
+	xfrm_state_put_afinfo(afinfo);
+}
+
 EXPORT_SYMBOL_GPL(xfrm_output);
 EXPORT_SYMBOL_GPL(xfrm_inner_extract_output);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 78f66fa..54c0acd 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -39,9 +39,6 @@ static DEFINE_SPINLOCK(xfrm_state_lock);
 
 static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024;
 
-static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family);
-static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
-
 static inline unsigned int xfrm_dst_hash(struct net *net,
 					 const xfrm_address_t *daddr,
 					 const xfrm_address_t *saddr,
@@ -1860,7 +1857,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo)
 }
 EXPORT_SYMBOL(xfrm_state_unregister_afinfo);
 
-static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family)
+struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family)
 {
 	struct xfrm_state_afinfo *afinfo;
 	if (unlikely(family >= NPROTO))
@@ -1872,7 +1869,7 @@ static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family)
 	return afinfo;
 }
 
-static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo)
+void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo)
 {
 	rcu_read_unlock();
 }
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH net v5 1/5] bnx2x: protect different statistics flows
From: Stephen Hemminger @ 2013-08-13  0:12 UTC (permalink / raw)
  To: Dmitry Kravkov; +Cc: davem, netdev, eilong, Ariel Elior
In-Reply-To: <1376349903-3461-2-git-send-email-dmitry@broadcom.com>

On Tue, 13 Aug 2013 02:24:59 +0300
"Dmitry Kravkov" <dmitry@broadcom.com> wrote:

> +	bool					stats_started;
> +	struct semaphore			stats_sema;

Is there a reason to use a counting semaphore? Do you expect it to
be held across user process boundary? or want count > 1?

Use of semaphores as a locking primitive is discouraged,
instead us a mutex.

^ permalink raw reply

* [PATCH net-next] tcp: reset reordering est. selectively on timeout
From: Yuchung Cheng @ 2013-08-12 23:41 UTC (permalink / raw)
  To: davem, ncardwell, edumazet, mattmathis; +Cc: netdev, Yuchung Cheng

On timeout the TCP sender unconditionally reset the estimated
degree of network reordering (tp->reordering). This idea behind
is that the estimate is too large to trigger fast recovery
(e.g., due to a IP path change).

But for example if the sender only had 2 packets outstanding,
then a timeout doesn't tell much about reordering. A sender that
learns about reordering on big writes and lose packets on small
writes will end up falsely retransmit again and again, especially
when reordering is more likely on big writes.

Therefore the sender should only suspects tp->reordering is too
high if it could have gone into fast recovery with the (lower)
default estimate.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
---
 net/ipv4/tcp_input.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index b61274b..e965cc7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1877,8 +1877,13 @@ void tcp_enter_loss(struct sock *sk, int how)
 	}
 	tcp_verify_left_out(tp);
 
-	tp->reordering = min_t(unsigned int, tp->reordering,
-			       sysctl_tcp_reordering);
+	/* Timeout in disordered state after receiving substantial DUPACKs
+	 * suggests that the degree of reordering is over-estimated.
+	 */
+	if (icsk->icsk_ca_state <= TCP_CA_Disorder &&
+	    tp->sacked_out >= sysctl_tcp_reordering)
+		tp->reordering = min_t(unsigned int, tp->reordering,
+				       sysctl_tcp_reordering);
 	tcp_set_ca_state(sk, TCP_CA_Loss);
 	tp->high_seq = tp->snd_nxt;
 	TCP_ECN_queue_cwr(tp);
-- 
1.8.3

^ permalink raw reply related

* [PATCH net v5 5/5] bnx2x: prevent crash in shutdown flow with CNIC
From: Dmitry Kravkov @ 2013-08-12 23:25 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, Yuval Mintz, Dmitry Kravkov, Ariel Elior
In-Reply-To: <1376349903-3461-1-git-send-email-dmitry@broadcom.com>

From: Yuval Mintz <yuvalmin@broadcom.com>

There might be a crash as during shutdown flow CNIC might try
to access resources already freed by bnx2x.
Change bnx2x_close() into dev_close() in __bnx2x_remove (shutdown flow)
to guarantee CNIC is notified of the device's change of status.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 339c388..955d6cf 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12838,8 +12838,7 @@ static void __bnx2x_remove(struct pci_dev *pdev,
 		unregister_netdev(dev);
 	} else {
 		rtnl_lock();
-		if (netif_running(dev))
-			bnx2x_close(dev);
+		dev_close(dev);
 		rtnl_unlock();
 	}
 
-- 
1.8.1.4

^ permalink raw reply related

* [PATCH net v5 3/5] bnx2x: fix memory leak in VF
From: Dmitry Kravkov @ 2013-08-12 23:25 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, Ariel Elior, Dmitry Kravkov
In-Reply-To: <1376349903-3461-1-git-send-email-dmitry@broadcom.com>

From: Ariel Elior <ariele@broadcom.com>

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 95861ef..44104fb 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -3463,7 +3463,7 @@ int bnx2x_vf_pci_alloc(struct bnx2x *bp)
 alloc_mem_err:
 	BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->vf2pf_mbox_mapping,
 		       sizeof(struct bnx2x_vf_mbx_msg));
-	BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->vf2pf_mbox_mapping,
+	BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->pf2vf_bulletin_mapping,
 		       sizeof(union pf_vf_bulletin));
 	return -ENOMEM;
 }
-- 
1.8.1.4

^ permalink raw reply related

* [PATCH net v5 4/5] bnx2x: fix PTE write access error
From: Dmitry Kravkov @ 2013-08-12 23:25 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, Barak Witkowsky, Dmitry Kravkov, Ariel Elior
In-Reply-To: <1376349903-3461-1-git-send-email-dmitry@broadcom.com>

From: Barak Witkowsky <barak@broadcom.com>

PTE write access error  might occur in MF_ALLOWED mode when IOMMU
is active. The patch adds rmmod HSI indicating to MFW to stop
running queries which might trigger this failure.

Signed-off-by: Barak Witkowsky <barak@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x.h      | 1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h  | 5 +++++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 +++++++++
 3 files changed, 15 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index f07a7ff..ce9b387 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1502,6 +1502,7 @@ struct bnx2x {
 #define BC_SUPPORTS_DCBX_MSG_NON_PMF	(1 << 21)
 #define IS_VF_FLAG			(1 << 22)
 #define INTERRUPTS_ENABLED_FLAG		(1 << 23)
+#define BC_SUPPORTS_RMMOD_CMD		(1 << 24)
 
 #define BP_NOMCP(bp)			((bp)->flags & NO_MCP_FLAG)
 
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
index 5018e52..32767f6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
@@ -1300,6 +1300,9 @@ struct drv_func_mb {
 
 	#define DRV_MSG_CODE_EEE_RESULTS_ACK            0xda000000
 
+	#define DRV_MSG_CODE_RMMOD                      0xdb000000
+	#define REQ_BC_VER_4_RMMOD_CMD                  0x0007080f
+
 	#define DRV_MSG_CODE_SET_MF_BW                  0xe0000000
 	#define REQ_BC_VER_4_SET_MF_BW                  0x00060202
 	#define DRV_MSG_CODE_SET_MF_BW_ACK              0xe1000000
@@ -1372,6 +1375,8 @@ struct drv_func_mb {
 
 	#define FW_MSG_CODE_EEE_RESULS_ACK              0xda100000
 
+	#define FW_MSG_CODE_RMMOD_ACK                   0xdb100000
+
 	#define FW_MSG_CODE_SET_MF_BW_SENT              0xe0000000
 	#define FW_MSG_CODE_SET_MF_BW_DONE              0xe1000000
 
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 78b7195..339c388 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10368,6 +10368,10 @@ static void bnx2x_get_common_hwinfo(struct bnx2x *bp)
 
 	bp->flags |= (val >= REQ_BC_VER_4_DCBX_ADMIN_MSG_NON_PMF) ?
 			BC_SUPPORTS_DCBX_MSG_NON_PMF : 0;
+
+	bp->flags |= (val >= REQ_BC_VER_4_RMMOD_CMD) ?
+			BC_SUPPORTS_RMMOD_CMD : 0;
+
 	boot_mode = SHMEM_RD(bp,
 			dev_info.port_feature_config[BP_PORT(bp)].mba_config) &
 			PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK;
@@ -12824,6 +12828,11 @@ static void __bnx2x_remove(struct pci_dev *pdev,
 	bnx2x_dcbnl_update_applist(bp, true);
 #endif
 
+	if (IS_PF(bp) &&
+	    !BP_NOMCP(bp) &&
+	    (bp->flags & BC_SUPPORTS_RMMOD_CMD))
+		bnx2x_fw_command(bp, DRV_MSG_CODE_RMMOD, 0);
+
 	/* Close the interface - either directly or implicitly */
 	if (remove_netdev) {
 		unregister_netdev(dev);
-- 
1.8.1.4

^ permalink raw reply related

* [PATCH net v5 2/5] bnx2x: update fairness parameters following DCB negotiation
From: Dmitry Kravkov @ 2013-08-12 23:25 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, Dmitry Kravkov, Ariel Elior
In-Reply-To: <1376349903-3461-1-git-send-email-dmitry@broadcom.com>

ETS can be enabled as a result of DCB negotiation, then
fairness must be recalculated after each negotiation.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x.h      |  2 ++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c  |  4 ++++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 30 ++++++++++++++----------
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 98be67f..f07a7ff 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -2453,4 +2453,6 @@ enum bnx2x_pci_bus_speed {
 	BNX2X_PCI_LINK_SPEED_5000 = 5000,
 	BNX2X_PCI_LINK_SPEED_8000 = 8000
 };
+
+void bnx2x_set_local_cmng(struct bnx2x *bp);
 #endif /* bnx2x.h */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
index 0c94df4..f9122f2 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
@@ -753,6 +753,10 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
 		bnx2x_pfc_set_pfc(bp);
 
 		bnx2x_dcbx_update_ets_params(bp);
+
+		/* ets may affect cmng configuration: reinit it in hw */
+		bnx2x_set_local_cmng(bp);
+
 		bnx2x_dcbx_resume_hw_tx(bp);
 
 		return;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 6e1e9e7..78b7195 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -2476,7 +2476,7 @@ static void bnx2x_cmng_fns_init(struct bnx2x *bp, u8 read_cfg, u8 cmng_type)
 
 	input.port_rate = bp->link_vars.line_speed;
 
-	if (cmng_type == CMNG_FNS_MINMAX) {
+	if (cmng_type == CMNG_FNS_MINMAX && input.port_rate) {
 		int vn;
 
 		/* read mf conf from shmem */
@@ -2533,6 +2533,21 @@ static void storm_memset_cmng(struct bnx2x *bp,
 	}
 }
 
+/* init cmng mode in HW according to local configuration */
+void bnx2x_set_local_cmng(struct bnx2x *bp)
+{
+	int cmng_fns = bnx2x_get_cmng_fns_mode(bp);
+
+	if (cmng_fns != CMNG_FNS_NONE) {
+		bnx2x_cmng_fns_init(bp, false, cmng_fns);
+		storm_memset_cmng(bp, &bp->cmng, BP_PORT(bp));
+	} else {
+		/* rate shaping and fairness are disabled */
+		DP(NETIF_MSG_IFUP,
+		   "single function mode without fairness\n");
+	}
+}
+
 /* This function is called upon link interrupt */
 static void bnx2x_link_attn(struct bnx2x *bp)
 {
@@ -2568,17 +2583,8 @@ static void bnx2x_link_attn(struct bnx2x *bp)
 			bnx2x_stats_handle(bp, STATS_EVENT_LINK_UP);
 	}
 
-	if (bp->link_vars.link_up && bp->link_vars.line_speed) {
-		int cmng_fns = bnx2x_get_cmng_fns_mode(bp);
-
-		if (cmng_fns != CMNG_FNS_NONE) {
-			bnx2x_cmng_fns_init(bp, false, cmng_fns);
-			storm_memset_cmng(bp, &bp->cmng, BP_PORT(bp));
-		} else
-			/* rate shaping and fairness are disabled */
-			DP(NETIF_MSG_IFUP,
-			   "single function mode without fairness\n");
-	}
+	if (bp->link_vars.link_up && bp->link_vars.line_speed)
+		bnx2x_set_local_cmng(bp);
 
 	__bnx2x_link_report(bp);
 
-- 
1.8.1.4

^ permalink raw reply related

* [PATCH net v5 1/5] bnx2x: protect different statistics flows
From: Dmitry Kravkov @ 2013-08-12 23:24 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, Dmitry Kravkov, Ariel Elior
In-Reply-To: <1376349903-3461-1-git-send-email-dmitry@broadcom.com>

Add locking to protect different statistics flows from
running simultaneously.
This in order to serialize statistics requests sent to FW,
otherwise two outstanding queries may cause FW assert.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x.h       |  2 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  |  1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 66 ++++++++++++++++++-----
 3 files changed, 57 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index d80e34b..98be67f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1830,6 +1830,8 @@ struct bnx2x {
 
 	int fp_array_size;
 	u32 dump_preset_idx;
+	bool					stats_started;
+	struct semaphore			stats_sema;
 };
 
 /* Tx queues may be less or equal to Rx queues */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index e06186c..6e1e9e7 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -11524,6 +11524,7 @@ static int bnx2x_init_bp(struct bnx2x *bp)
 	mutex_init(&bp->port.phy_mutex);
 	mutex_init(&bp->fw_mb_mutex);
 	spin_lock_init(&bp->stats_lock);
+	sema_init(&bp->stats_sema, 1);
 
 	INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);
 	INIT_DELAYED_WORK(&bp->sp_rtnl_task, bnx2x_sp_rtnl_task);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index 98366ab..d63d132 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -221,7 +221,8 @@ static int bnx2x_stats_comp(struct bnx2x *bp)
  * Statistics service functions
  */
 
-static void bnx2x_stats_pmf_update(struct bnx2x *bp)
+/* should be called under stats_sema */
+static void __bnx2x_stats_pmf_update(struct bnx2x *bp)
 {
 	struct dmae_command *dmae;
 	u32 opcode;
@@ -518,7 +519,8 @@ static void bnx2x_func_stats_init(struct bnx2x *bp)
 	*stats_comp = 0;
 }
 
-static void bnx2x_stats_start(struct bnx2x *bp)
+/* should be called under stats_sema */
+static void __bnx2x_stats_start(struct bnx2x *bp)
 {
 	/* vfs travel through here as part of the statistics FSM, but no action
 	 * is required
@@ -534,13 +536,34 @@ static void bnx2x_stats_start(struct bnx2x *bp)
 
 	bnx2x_hw_stats_post(bp);
 	bnx2x_storm_stats_post(bp);
+
+	bp->stats_started = true;
+}
+
+static void bnx2x_stats_start(struct bnx2x *bp)
+{
+	if (down_timeout(&bp->stats_sema, HZ/10))
+		BNX2X_ERR("Unable to acquire stats lock\n");
+	__bnx2x_stats_start(bp);
+	up(&bp->stats_sema);
 }
 
 static void bnx2x_stats_pmf_start(struct bnx2x *bp)
 {
+	if (down_timeout(&bp->stats_sema, HZ/10))
+		BNX2X_ERR("Unable to acquire stats lock\n");
 	bnx2x_stats_comp(bp);
-	bnx2x_stats_pmf_update(bp);
-	bnx2x_stats_start(bp);
+	__bnx2x_stats_pmf_update(bp);
+	__bnx2x_stats_start(bp);
+	up(&bp->stats_sema);
+}
+
+static void bnx2x_stats_pmf_update(struct bnx2x *bp)
+{
+	if (down_timeout(&bp->stats_sema, HZ/10))
+		BNX2X_ERR("Unable to acquire stats lock\n");
+	__bnx2x_stats_pmf_update(bp);
+	up(&bp->stats_sema);
 }
 
 static void bnx2x_stats_restart(struct bnx2x *bp)
@@ -550,8 +573,11 @@ static void bnx2x_stats_restart(struct bnx2x *bp)
 	 */
 	if (IS_VF(bp))
 		return;
+	if (down_timeout(&bp->stats_sema, HZ/10))
+		BNX2X_ERR("Unable to acquire stats lock\n");
 	bnx2x_stats_comp(bp);
-	bnx2x_stats_start(bp);
+	__bnx2x_stats_start(bp);
+	up(&bp->stats_sema);
 }
 
 static void bnx2x_bmac_stats_update(struct bnx2x *bp)
@@ -888,9 +914,7 @@ static int bnx2x_storm_stats_validate_counters(struct bnx2x *bp)
 	/* Make sure we use the value of the counter
 	 * used for sending the last stats ramrod.
 	 */
-	spin_lock_bh(&bp->stats_lock);
 	cur_stats_counter = bp->stats_counter - 1;
-	spin_unlock_bh(&bp->stats_lock);
 
 	/* are storm stats valid? */
 	if (le16_to_cpu(counters->xstats_counter) != cur_stats_counter) {
@@ -1227,12 +1251,18 @@ static void bnx2x_stats_update(struct bnx2x *bp)
 {
 	u32 *stats_comp = bnx2x_sp(bp, stats_comp);
 
-	if (bnx2x_edebug_stats_stopped(bp))
+	/* we run update from timer context, so give up
+	 * if somebody is in the middle of transition
+	 */
+	if (down_trylock(&bp->stats_sema))
 		return;
 
+	if (bnx2x_edebug_stats_stopped(bp) || !bp->stats_started)
+		goto out;
+
 	if (IS_PF(bp)) {
 		if (*stats_comp != DMAE_COMP_VAL)
-			return;
+			goto out;
 
 		if (bp->port.pmf)
 			bnx2x_hw_stats_update(bp);
@@ -1242,7 +1272,7 @@ static void bnx2x_stats_update(struct bnx2x *bp)
 				BNX2X_ERR("storm stats were not updated for 3 times\n");
 				bnx2x_panic();
 			}
-			return;
+			goto out;
 		}
 	} else {
 		/* vf doesn't collect HW statistics, and doesn't get completions
@@ -1256,7 +1286,7 @@ static void bnx2x_stats_update(struct bnx2x *bp)
 
 	/* vf is done */
 	if (IS_VF(bp))
-		return;
+		goto out;
 
 	if (netif_msg_timer(bp)) {
 		struct bnx2x_eth_stats *estats = &bp->eth_stats;
@@ -1267,6 +1297,9 @@ static void bnx2x_stats_update(struct bnx2x *bp)
 
 	bnx2x_hw_stats_post(bp);
 	bnx2x_storm_stats_post(bp);
+
+out:
+	up(&bp->stats_sema);
 }
 
 static void bnx2x_port_stats_stop(struct bnx2x *bp)
@@ -1332,6 +1365,11 @@ static void bnx2x_stats_stop(struct bnx2x *bp)
 {
 	int update = 0;
 
+	if (down_timeout(&bp->stats_sema, HZ/10))
+		BNX2X_ERR("Unable to acquire stats lock\n");
+
+	bp->stats_started = false;
+
 	bnx2x_stats_comp(bp);
 
 	if (bp->port.pmf)
@@ -1348,6 +1386,8 @@ static void bnx2x_stats_stop(struct bnx2x *bp)
 		bnx2x_hw_stats_post(bp);
 		bnx2x_stats_comp(bp);
 	}
+
+	up(&bp->stats_sema);
 }
 
 static void bnx2x_stats_do_nothing(struct bnx2x *bp)
@@ -1376,15 +1416,17 @@ static const struct {
 void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event)
 {
 	enum bnx2x_stats_state state;
+	void (*action)(struct bnx2x *bp);
 	if (unlikely(bp->panic))
 		return;
 
 	spin_lock_bh(&bp->stats_lock);
 	state = bp->stats_state;
 	bp->stats_state = bnx2x_stats_stm[state][event].next_state;
+	action = bnx2x_stats_stm[state][event].action;
 	spin_unlock_bh(&bp->stats_lock);
 
-	bnx2x_stats_stm[state][event].action(bp);
+	action(bp);
 
 	if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))
 		DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
-- 
1.8.1.4

^ permalink raw reply related

* [PATCH net v5 0/5] bnx2x: fixes
From: Dmitry Kravkov @ 2013-08-12 23:24 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, Dmitry Kravkov

Hello Dave

Please consider applying the series of bnx2x fixes to net:
	* statistics may cause FW assert
	* missing fairness configuration in DCB flow
	* memory leak in sriov related part
	* Illegal PTE access
	* Pagefault crash in shutdown flow with cnic
v1->v2
	* fixed sparse error pointed by Joe Perches
	* added missing signed-off from Sergei Shtylyov
v2->v3
	* added missing signed-off from Sergei Shtylyov
	* fixed formatting from Sergei Shtylyov
v3->v4
	* patch 1/6: fixed declaration order
	* patch 2/6 replaced with: protect flows using set_bit constraints
v4->v5
	* patch 2/6: replace proprietary locking with semaphore
	* droped 1/6: since adds redundant code from Benjamin Poirier

Thanks
Dmitry 

^ permalink raw reply

* RE: [PATCH net v4 1/6] bnx2x: properly initialize statistic counters
From: Dmitry Kravkov @ 2013-08-12 22:48 UTC (permalink / raw)
  To: Benjamin Poirier
  Cc: davem@davemloft.net, netdev@vger.kernel.org, Eilon Greenstein,
	Ariel Elior
In-Reply-To: <20130812200818.GA20031@d2.synalogic.ca>

> -----Original Message-----
> From: Benjamin Poirier [mailto:benjamin.poirier@gmail.com]
> Sent: Monday, August 12, 2013 11:08 PM
> To: Dmitry Kravkov
> Cc: davem@davemloft.net; netdev@vger.kernel.org; Eilon Greenstein;
> Ariel Elior
> Subject: Re: [PATCH net v4 1/6] bnx2x: properly initialize statistic counters
> 
> On 2013/08/06 00:35, Dmitry Kravkov wrote:
> > This prevent second statistics query be sent before first one is complete.
> > This is required since two outstanding queries may cause FW assert.
> >
> > Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> > Signed-off-by: Ariel Elior <ariele@broadcom.com>
> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> > ---
> >  drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> > b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> > index 98366ab..a22ad61 100644
> > --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> > +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> > @@ -1589,12 +1589,17 @@ void bnx2x_memset_stats(struct bnx2x *bp)
> >
> >  void bnx2x_stats_init(struct bnx2x *bp)  {
> > -	int /*abs*/port = BP_PORT(bp);
> > +	struct stats_counter *counters = &bp->fw_stats_data-
> >storm_counters;
> >  	int mb_idx = BP_FW_MB_IDX(bp);
> > +	int port = BP_PORT(bp);
> >
> >  	bp->stats_pending = 0;
> >  	bp->executer_idx = 0;
> >  	bp->stats_counter = 0;
> > +	counters->xstats_counter = cpu_to_le16(0xFFFF);
> > +	counters->tstats_counter = cpu_to_le16(0xFFFF);
> > +	counters->ustats_counter = cpu_to_le16(0xFFFF);
> > +	counters->cstats_counter = cpu_to_le16(0xFFFF);
> 
> I think the following code executed a little later becomes redundant:
> 
> static void bnx2x_prep_fw_stats_req(struct bnx2x *bp) { [...]
> 	/* prepare to the first stats ramrod (will be completed with
> 	 * the counters equal to zero) - init counters to somethig different.
> 	 */
> 	memset(&bp->fw_stats_data->storm_counters, 0xff,
> 	       sizeof(struct stats_counter));

You absolutely right. Thanks!

^ permalink raw reply

* Re: [patch net] ipv6: do not create neighbor entries for local delivery
From: Hannes Frederic Sowa @ 2013-08-12 22:26 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner
  Cc: Debabrata Banerjee, Jiri Pirko, davem@davemloft.net,
	netdev@vger.kernel.org, Alexey Kuznetsov, jmorris@namei.org,
	yoshfuji@linux-ipv6.org, Patrick McHardy, Banerjee, Debabrata,
	Joshua Hunt
In-Reply-To: <520924CF.6000805@redhat.com>

Hi Marcelo!

On Mon, Aug 12, 2013 at 03:09:19PM -0300, Marcelo Ricardo Leitner wrote:
> Hannes, would something like this be acceptable? I'm hoping it's not too 
> ugly/hacky... as far as I could track back, input and output routines were 
> merged mainly due code similarity.

Your idea seems sound and I don't think it is very ugly or hacky. It's
as minimal as a stable-only patch should be. But we could simplify the
logic a bit. ;) See below.

> TPROXY scenario needs to not create this neighbor entries on INPUT path, 
> while Debabrata ping test needs it on OUTPUT path. This patch limits my 
> previous patch to INPUT only then.

Yes, agreed. I don't see anything which could break because of this patch.
So I would go with it.

> Initial testing here seems good, TPROXY seems to be working as expected and 
> also the ping6 test.
> 
> What do you think?


> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 18ea73c..603f9d9 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -791,7 +791,7 @@ static struct rt6_info *rt6_alloc_clone(struct rt6_info *ort,
>  }
>  
>  static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, int oif,
> -				      struct flowi6 *fl6, int flags)
> +				      struct flowi6 *fl6, int flags, int output)

								     bool input

>  {
>  	struct fib6_node *fn;
>  	struct rt6_info *rt, *nrt;
> @@ -799,8 +799,11 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
>  	int attempts = 3;
>  	int err;
>  	int reachable = net->ipv6.devconf_all->forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
> +	int local = RTF_NONEXTHOP;
>  
>  	strict |= flags & RT6_LOOKUP_F_IFACE;
> +	if (!output)
> +			local |= RTF_LOCAL;


	if (input)
			local |= RTF_LOCAL;

>  
>  relookup:
>  	read_lock_bh(&table->tb6_lock);
> @@ -820,7 +823,7 @@ restart:
>  	read_unlock_bh(&table->tb6_lock);
>  
>  	if (!dst_get_neighbour_raw(&rt->dst)
> -	    && !(rt->rt6i_flags & (RTF_NONEXTHOP | RTF_LOCAL)))
> +	    && !(rt->rt6i_flags & local))
>  		nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr);
>  	else if (!(rt->dst.flags & DST_HOST))
>  		nrt = rt6_alloc_clone(rt, &fl6->daddr);
> @@ -864,7 +867,7 @@ out2:
>  static struct rt6_info *ip6_pol_route_input(struct net *net, struct fib6_table *table,
>  					    struct flowi6 *fl6, int flags)
>  {
> -	return ip6_pol_route(net, table, fl6->flowi6_iif, fl6, flags);
> +	return ip6_pol_route(net, table, fl6->flowi6_iif, fl6, flags, 0);

								      true);


>  }
>  
>  void ip6_route_input(struct sk_buff *skb)
> @@ -890,7 +893,7 @@ void ip6_route_input(struct sk_buff *skb)
>  static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table,
>  					     struct flowi6 *fl6, int flags)
>  {
> -	return ip6_pol_route(net, table, fl6->flowi6_oif, fl6, flags);
> +	return ip6_pol_route(net, table, fl6->flowi6_oif, fl6, flags, 1);

								      false);

>  }
>  
>  struct dst_entry * ip6_route_output(struct net *net, const struct sock *sk,

Thanks,

  Hannes

^ permalink raw reply

* [PATCH] SolutionEngine SH771x: remove Ether support
From: Sergei Shtylyov @ 2013-08-12 22:17 UTC (permalink / raw)
  To: linux-sh, lethal, netdev

The 'sh_eth' driver's probe will crash as the platform code is hopelessly behind
the platform data -- it passes PHY ID instead of 'struct sh_eth_plat_data *'.
Even if it's fixed, the driver probe will fail as the 'struct sh_eth_cpu_data'
indicates presence of TSU but the platform device resource  for it is absent.
Since I have no data to fix it, I think it's best to remove the erratic code.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against Paul Mundt's 'linux-sh.git' repo, 'sh-latest' branch.
Paul, could you update your tree, it's still at 3.9-rc1? The code being removed
has changed upstream...

 arch/sh/boards/mach-se/770x/setup.c |   55 ------------------------------------
 arch/sh/include/mach-se/mach/se.h   |   15 ---------
 2 files changed, 70 deletions(-)

Index: linux-sh/arch/sh/boards/mach-se/770x/setup.c
===================================================================
--- linux-sh.orig/arch/sh/boards/mach-se/770x/setup.c
+++ linux-sh/arch/sh/boards/mach-se/770x/setup.c
@@ -111,64 +111,9 @@ static struct platform_device heartbeat_
 	.resource	= &heartbeat_resource,
 };
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
-	defined(CONFIG_CPU_SUBTYPE_SH7712)
-/* SH771X Ethernet driver */
-static struct resource sh_eth0_resources[] = {
-	[0] = {
-		.start = SH_ETH0_BASE,
-		.end = SH_ETH0_BASE + 0x1B8,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = SH_ETH0_IRQ,
-		.end = SH_ETH0_IRQ,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct platform_device sh_eth0_device = {
-	.name = "sh-eth",
-	.id	= 0,
-	.dev = {
-		.platform_data = PHY_ID,
-	},
-	.num_resources = ARRAY_SIZE(sh_eth0_resources),
-	.resource = sh_eth0_resources,
-};
-
-static struct resource sh_eth1_resources[] = {
-	[0] = {
-		.start = SH_ETH1_BASE,
-		.end = SH_ETH1_BASE + 0x1B8,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = SH_ETH1_IRQ,
-		.end = SH_ETH1_IRQ,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct platform_device sh_eth1_device = {
-	.name = "sh-eth",
-	.id	= 1,
-	.dev = {
-		.platform_data = PHY_ID,
-	},
-	.num_resources = ARRAY_SIZE(sh_eth1_resources),
-	.resource = sh_eth1_resources,
-};
-#endif
-
 static struct platform_device *se_devices[] __initdata = {
 	&heartbeat_device,
 	&cf_ide_device,
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
-	defined(CONFIG_CPU_SUBTYPE_SH7712)
-	&sh_eth0_device,
-	&sh_eth1_device,
-#endif
 };
 
 static int __init se_devices_setup(void)
Index: linux-sh/arch/sh/include/mach-se/mach/se.h
===================================================================
--- linux-sh.orig/arch/sh/include/mach-se/mach/se.h
+++ linux-sh/arch/sh/include/mach-se/mach/se.h
@@ -95,21 +95,6 @@
 #define IRQ_CFCARD	evt2irq(0x2e0)
 #endif
 
-/* SH Ether support (SH7710/SH7712) */
-/* Base address */
-#define SH_ETH0_BASE 0xA7000000
-#define SH_ETH1_BASE 0xA7000400
-/* PHY ID */
-#if defined(CONFIG_CPU_SUBTYPE_SH7710)
-# define PHY_ID 0x00
-#elif defined(CONFIG_CPU_SUBTYPE_SH7712)
-# define PHY_ID 0x01
-#endif
-/* Ether IRQ */
-#define SH_ETH0_IRQ	evt2irq(0xc00)
-#define SH_ETH1_IRQ	evt2irq(0xc20)
-#define SH_TSU_IRQ	evt2irq(0xc40)
-
 void init_se_IRQ(void);
 
 #define __IO_PREFIX	se

^ permalink raw reply

* Re: ipsec smp scalability and cpu use fairness (softirqs)
From: Andrew Collins @ 2013-08-12 21:58 UTC (permalink / raw)
  To: Timo Teras; +Cc: netdev
In-Reply-To: <20130812160142.71737a95@vostro>

On Mon, Aug 12, 2013 at 7:01 AM, Timo Teras <timo.teras@iki.fi> wrote:
> 1. Single core systems that are going out of cpu power, are
> overwhelmed in uncontrollable manner. As softirq is doing the heavy
> lifting, the user land processes are starved first. This can cause
> userland IKE daemon to starve and lose tunnels when it is unable to
> answer liveliness checks. The quick workaround is to setup traffic
> shaping for the encrypted traffic.

Which kernel version are you on?  I've found I've had better behavior since:

commit c10d73671ad30f54692f7f69f0e09e75d3a8926a
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Jan 10 15:26:34 2013 -0800

    softirq: reduce latencies

as it bails from lengthy softirq processing much earlier, along with
tuning "netdev_budget" to avoid cycling for too long in the NAPI poll.

> 2. On multicore (6-12 cores) systems, it would appear that it is not
> easy to distribute the ipsec to multiple cores. as softirq is sticky to
> the cpu where it was raised. The ipsec decryption/encryption is done
> synchronously in the napi poll loop, and the throughput is limited by
> one cpu. If the NIC supports multiple queues and balancing with ESP
> SPI, we can use that to get some parallelism.

Although it's highly usecase dependent, I've had good luck using
RPS.  I'm testing as an ipsec router however, not with an endpoint
on the host itself, so it processes nearly all ipsec traffic in receive
context.

Andrew Collins

^ permalink raw reply

* Re: [PATCH V2 0/4] Enable bus master till the FLR completes for Chelsio T4
From: Bjorn Helgaas @ 2013-08-12 21:17 UTC (permalink / raw)
  To: Vipul Pandya
  Cc: linux-pci@vger.kernel.org, Casey Leedom, tomreu, divy, dm,
	nirranjan, eilong, netdev
In-Reply-To: <1375784319-25760-1-git-send-email-vipul@chelsio.com>

On Tue, Aug 6, 2013 at 4:18 AM, Vipul Pandya <vipul@chelsio.com> wrote:
> This patch series adds device specific reset method for Chelsio T4 adapters.
>
> The series also adds new routine, pci_wait_for_pending_transaction, to wait for
> pending pci transaction. There are few places where waiting for pending pci
> transaction code was duplicated. This patch series also replaces occurances of
> duplicate code.
>
> This patch series is built against Bjorn Helgaas pci tree next branch. We would
> like to merge this series via the same.
>
> I have Cced respective maintainers of the modified drivers. Kindly review and
> let us know in case of any review comments.
>
> Thanks,
> Vipul Pandya
>
> V2: Added pci_wait_for_pending_transaction routine and replaced it at respective
> places. Made the patch series for the same.
> V2: Used dev->msix_cap directly for capability offset
> V2: Removed use of 'rc' variable.
>
> Casey Leedom (4):
>   pci: Add pci_wait_for_pending_transaction to wait for pending pci
>     transaction
>   pci: Enable bus master till the FLR completes
>   bnx2x: Use pci_wait_for_pending_transaction instead of for loop
>   pci: Use pci_wait_for_pending_transaction instead of for loop
>
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 18 +----
>  drivers/pci/pci.c                                | 38 ++++++----
>  drivers/pci/quirks.c                             | 97 ++++++++++++++++++++----
>  include/linux/pci.h                              |  1 +
>  4 files changed, 109 insertions(+), 45 deletions(-)

Applied to my "next" branch for v3.12, thanks!

Bjorn

^ permalink raw reply

* Re: [PATCH net] bnx2x: guard stats_pending with stats_lock in all cases
From: Dmitry Kravkov @ 2013-08-12 20:52 UTC (permalink / raw)
  To: Neal Cardwell
  Cc: David Miller, netdev@vger.kernel.org, Eilon Greenstein,
	Vladislav Zolotarov, Yaniv Rosner, Merav Sicron, Eric Dumazet,
	Tom Herbert, Havard Skinnemoen, Sanjay Hortikar, Dmitry Kravkov
In-Reply-To: <1376334499-25192-1-git-send-email-ncardwell@google.com>

On Mon, Aug 12, 2013 at 10:08 PM, Neal Cardwell <ncardwell@google.com> wrote:
>
> As 9bcb8018cf ("bnx2x: Fix the race on bp->stats_pending") noted, we
> can have a race on bp->stats_pending between the timer and a
> STATS_EVENT_LINK_UP event handler.
>
> But it seems we can also have the following two races on
> bp->stats_pending between the timer and a STATS_EVENT_STOP handler:
>
> Scenario A:
> -----------
>
> thread 1:  bnx2x_timer() thread in bnx2x_storm_stats_post():
>                 /* send FW stats ramrod */
>                 rc = bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_STAT_QUERY, 0,
>                                    U64_HI(bp->fw_stats_req_mapping),
>                                    U64_LO(bp->fw_stats_req_mapping),
>                                    NONE_CONNECTION_TYPE);
>                 if (rc == 0)
>
> thread 2: ethtool thread:
> bnx2x_stats_handle(bp, STATS_EVENT_STOP)
>   -> bnx2x_stats_stop()
>     -> bnx2x_storm_stats_update()
>         bp->stats_pending = 0;
>
> thread 1:  bnx2x_timer() thread in bnx2x_storm_stats_post():
>                         bp->stats_pending = 1;
>
> If the action interleaves in this way we end up with a
> bp->stats_pending value of 1 when there are no stats pending.
>
> Scenario B:
> -----------
> thread 1:  bnx2x_timer() thread in bnx2x_stats_update():
>                 if (bnx2x_storm_stats_update(bp)) {
>                         if (bp->stats_pending == 3) { // false
>                         reg1 = bp->stats_pending      // reg1=1
>
> thread 2: ethtool thread:
> bnx2x_stats_handle(bp, STATS_EVENT_STOP)
>   -> bnx2x_stats_stop()
>     -> bnx2x_storm_stats_update()
>         bp->stats_pending = 0;
>
> thread 1:  bnx2x_timer() thread in bnx2x_stats_update():
>                         reg1++                          // reg1=2
>                         bp->stats_pending = reg1;       // stats_pending=2
>                         return;
>
> If the action interleaves in this way we end up with a non-zero
> bp->stats_pending value when there are no stats pending.
>
> -----------
>
> These are suspected as possible contributors to occasional
> bnx2x_panic() dumps we see of the form:
>
>  storm stats were not updated for 3 times
>
> When these panic messages happen we see the NIC hang.
>
> The proposed fix is for all, not just some, of the reads and writes to
> stats_pending to be guarded by stats_lock. So now all accesses to
> stats_pending and stats_couner are guarded by stats_lock.
>
Neal, thanks for looking into this.

There's another race, where two flows
stats_update() and stats_start() may send two queries in parallel
which will cause FW to assert.

I'm preparing the set for net, which includes the fix  for this race
also(will be out in a couple of hours)

I will be more than happy if you will take a look.

Thanks
Dmitry


> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Cc: Eilon Greenstein <eilong@broadcom.com>
> Cc: Vladislav Zolotarov <vladz@broadcom.com>
> Cc: Yaniv Rosner <yanivr@broadcom.com>
> Cc: Merav Sicron <meravs@broadcom.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Tom Herbert <therbert@google.com>
> Cc: Havard Skinnemoen <hskinnemoen@google.com>
> Cc: Sanjay Hortikar <horti@google.com>
> Change-Id: Ic389c4355ef4a3e01da8f1f4c2019e75dbb5ddf6
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 47 +++++++++++++----------
>  1 file changed, 27 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> index 98366ab..d72a630 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> @@ -123,16 +123,11 @@ static void bnx2x_dp_stats(struct bnx2x *bp)
>   */
>  static void bnx2x_storm_stats_post(struct bnx2x *bp)
>  {
> +       spin_lock_bh(&bp->stats_lock);
> +
>         if (!bp->stats_pending) {
>                 int rc;
>
> -               spin_lock_bh(&bp->stats_lock);
> -
> -               if (bp->stats_pending) {
> -                       spin_unlock_bh(&bp->stats_lock);
> -                       return;
> -               }
> -
>                 bp->fw_stats_req->hdr.drv_stats_counter =
>                         cpu_to_le16(bp->stats_counter++);
>
> @@ -151,8 +146,9 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
>                 if (rc == 0)
>                         bp->stats_pending = 1;
>
> -               spin_unlock_bh(&bp->stats_lock);
>         }
> +
> +       spin_unlock_bh(&bp->stats_lock);
>  }
>
>  static void bnx2x_hw_stats_post(struct bnx2x *bp)
> @@ -888,9 +884,7 @@ static int bnx2x_storm_stats_validate_counters(struct bnx2x *bp)
>         /* Make sure we use the value of the counter
>          * used for sending the last stats ramrod.
>          */
> -       spin_lock_bh(&bp->stats_lock);
>         cur_stats_counter = bp->stats_counter - 1;
> -       spin_unlock_bh(&bp->stats_lock);
>
>         /* are storm stats valid? */
>         if (le16_to_cpu(counters->xstats_counter) != cur_stats_counter) {
> @@ -923,7 +917,8 @@ static int bnx2x_storm_stats_validate_counters(struct bnx2x *bp)
>         return 0;
>  }
>
> -static int bnx2x_storm_stats_update(struct bnx2x *bp)
> +static int bnx2x_storm_stats_update(struct bnx2x *bp,
> +                                   bool track_pending)
>  {
>         struct tstorm_per_port_stats *tport =
>                                 &bp->fw_stats_data->port.tstorm_port_statistics;
> @@ -934,9 +929,24 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
>         struct bnx2x_eth_stats_old *estats_old = &bp->eth_stats_old;
>         int i;
>
> +       spin_lock_bh(&bp->stats_lock);
> +
>         /* vfs stat counter is managed by pf */
> -       if (IS_PF(bp) && bnx2x_storm_stats_validate_counters(bp))
> +       if (IS_PF(bp) && bnx2x_storm_stats_validate_counters(bp)) {
> +               bool pending_timeout = false;
> +
> +               if (track_pending && (bp->stats_pending++ == 3))
> +                       pending_timeout = true;
> +
> +               spin_unlock_bh(&bp->stats_lock);
> +
> +               if (pending_timeout) {
> +                       BNX2X_ERR("storm stats were not updated for 3 times\n");
> +                       bnx2x_panic();
> +               }
> +
>                 return -EAGAIN;
> +       }
>
>         estats->error_bytes_received_hi = 0;
>         estats->error_bytes_received_lo = 0;
> @@ -1118,6 +1128,8 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
>
>         bp->stats_pending = 0;
>
> +       spin_unlock_bh(&bp->stats_lock);
> +
>         return 0;
>  }
>
> @@ -1237,18 +1249,13 @@ static void bnx2x_stats_update(struct bnx2x *bp)
>                 if (bp->port.pmf)
>                         bnx2x_hw_stats_update(bp);
>
> -               if (bnx2x_storm_stats_update(bp)) {
> -                       if (bp->stats_pending++ == 3) {
> -                               BNX2X_ERR("storm stats were not updated for 3 times\n");
> -                               bnx2x_panic();
> -                       }
> +               if (bnx2x_storm_stats_update(bp, true))
>                         return;
> -               }
>         } else {
>                 /* vf doesn't collect HW statistics, and doesn't get completions
>                  * perform only update
>                  */
> -               bnx2x_storm_stats_update(bp);
> +               bnx2x_storm_stats_update(bp, false);
>         }
>
>         bnx2x_net_stats_update(bp);
> @@ -1337,7 +1344,7 @@ static void bnx2x_stats_stop(struct bnx2x *bp)
>         if (bp->port.pmf)
>                 update = (bnx2x_hw_stats_update(bp) == 0);
>
> -       update |= (bnx2x_storm_stats_update(bp) == 0);
> +       update |= (bnx2x_storm_stats_update(bp, false) == 0);
>
>         if (update) {
>                 bnx2x_net_stats_update(bp);
> --
> 1.8.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html




-- 
Best regards,
Dmitry

^ permalink raw reply

* Re: SCTP and IP_TOS
From: Ben Greear @ 2013-08-12 20:51 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: netdev
In-Reply-To: <520943E2.7010408@gmail.com>

On 08/12/2013 01:21 PM, Vlad Yasevich wrote:
> On 08/12/2013 01:00 PM, Ben Greear wrote:
>> Hello!
>>
>> I notice that I read 0x2 as IP_TOS getsockopt on an SCTP socket configured
>> for streaming mode.
>>
>> Looks to me like the reason is that SCTP uses a socket type of
>> SCTP_SOCKET_TCP
>> and the ipv4/ip_sockglue.c code is only masking out ECN for SOCK_STREAM
>> types.
>>
>> Is this per design, or should the ip_sockglue.c mask out ECN for
>> SCTP_SOCKET_TCP
>> types as well?
>>
>> Thanks,
>> Ben
>>
>
>  From the ip_glue perspective, you would see either SOCK_STREAM or
> SOCK_SEQPACKET.
>
> So you are trying to set tos bits on a SEQPACKET socket, ip_sockglue()
> wouldn't try preserver current ECN bits as it does for STREAM sockets.

Actually, I am just reading the TOS, and should never be setting it
at all in this particular test case.  TCP connections return 0x0 in
this case, but SCTP returns 0x2.

It's a small issue, but it screwed up some sub-standard code in
my application, so that is why I noticed it.

It *could* be that my app is somehow to blame.  I'll poke around
in the kernel with printk when I get a chance.

Thanks,
Ben

>
> -vlad
>


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* Re: SCTP and IP_TOS
From: Vlad Yasevich @ 2013-08-12 20:21 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev
In-Reply-To: <52091492.9060904@candelatech.com>

On 08/12/2013 01:00 PM, Ben Greear wrote:
> Hello!
>
> I notice that I read 0x2 as IP_TOS getsockopt on an SCTP socket configured
> for streaming mode.
>
> Looks to me like the reason is that SCTP uses a socket type of
> SCTP_SOCKET_TCP
> and the ipv4/ip_sockglue.c code is only masking out ECN for SOCK_STREAM
> types.
>
> Is this per design, or should the ip_sockglue.c mask out ECN for
> SCTP_SOCKET_TCP
> types as well?
>
> Thanks,
> Ben
>

 From the ip_glue perspective, you would see either SOCK_STREAM or
SOCK_SEQPACKET.

So you are trying to set tos bits on a SEQPACKET socket, ip_sockglue()
wouldn't try preserver current ECN bits as it does for STREAM sockets.

-vlad

^ permalink raw reply

* Re: SCTP performance?
From: Vlad Yasevich @ 2013-08-12 20:10 UTC (permalink / raw)
  To: Ben Greear; +Cc: Eric Dumazet, netdev
In-Reply-To: <520583AB.9030509@candelatech.com>

On 08/09/2013 08:04 PM, Ben Greear wrote:
> On 08/09/2013 04:21 PM, Eric Dumazet wrote:
>> On Fri, 2013-08-09 at 16:11 -0700, Ben Greear wrote:
>>> I just added some support for SCTP to my traffic-generator tool.
>>>
>>> I tried to send 1Gbps of traffic, bi-directional, across two
>>> 10G interfaces.  TCP does this without any trouble at all,
>>> but SCTP was asymetric and never got above around 700Mbps,
>>> and was usually stuck at < 500Mbps.
>>>
>>> perf top didn't show any obvious CPU bottlenecks.
>>>
>>> Has anyone done any recent performance testing with SCTP?
>>>
>>> I'd be interested to know the results if so...
>>
>> You mean there is no SCTP offload on the NIC and/or GRO, yes that's too
>> bad.
>>
>
> I'm sure that is part of the problem.
>
> I got much better results when I explicitly set the
> tx/rx socket buffer sizes to 2MB, so maybe it just sucks
> at auto-tuning it's socket buffer sizes.
>
> Thanks,
> Ben
>

There is no buffer autotunning.  There is also no GRO since SCTP doesn't
lend itself easily to GRO. :(

There has been some research efforts at autotunning, but nothing 
proposed.  I'll see if I can find the code and make it work better.

-vlad

^ permalink raw reply

* Re: [PATCH net v4 1/6] bnx2x: properly initialize statistic counters
From: Benjamin Poirier @ 2013-08-12 20:08 UTC (permalink / raw)
  To: Dmitry Kravkov; +Cc: davem, netdev, eilong, Ariel Elior
In-Reply-To: <1375738544-8695-2-git-send-email-dmitry@broadcom.com>

On 2013/08/06 00:35, Dmitry Kravkov wrote:
> This prevent second statistics query be sent before first one is complete.
> This is required since two outstanding queries may cause FW assert.
> 
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> index 98366ab..a22ad61 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
> @@ -1589,12 +1589,17 @@ void bnx2x_memset_stats(struct bnx2x *bp)
>  
>  void bnx2x_stats_init(struct bnx2x *bp)
>  {
> -	int /*abs*/port = BP_PORT(bp);
> +	struct stats_counter *counters = &bp->fw_stats_data->storm_counters;
>  	int mb_idx = BP_FW_MB_IDX(bp);
> +	int port = BP_PORT(bp);
>  
>  	bp->stats_pending = 0;
>  	bp->executer_idx = 0;
>  	bp->stats_counter = 0;
> +	counters->xstats_counter = cpu_to_le16(0xFFFF);
> +	counters->tstats_counter = cpu_to_le16(0xFFFF);
> +	counters->ustats_counter = cpu_to_le16(0xFFFF);
> +	counters->cstats_counter = cpu_to_le16(0xFFFF);

I think the following code executed a little later becomes redundant:

static void bnx2x_prep_fw_stats_req(struct bnx2x *bp)
{
[...]
	/* prepare to the first stats ramrod (will be completed with
	 * the counters equal to zero) - init counters to somethig different.
	 */
	memset(&bp->fw_stats_data->storm_counters, 0xff,
	       sizeof(struct stats_counter));

^ permalink raw reply

* Re: [PATCH 8/8] net: davinci_mdio: use platform_{get,set}_drvdata()
From: David Miller @ 2013-08-12 20:04 UTC (permalink / raw)
  To: sergei.shtylyov
  Cc: clbchenlibo.chen, mugunthanvnm, bigeasy, prabhakar.csengg, b-liu,
	netdev, linux-kernel, lizefan
In-Reply-To: <520926CB.4020500@cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Mon, 12 Aug 2013 22:17:47 +0400

>    Doesn't get described as well. I think you're mixing two types of
>    changes in one patchset.

Agreed, you're going to have to redo this entire patch set.

^ permalink raw reply

* Re: [PATCH] rtnetlink: rtnl_bridge_getlink: Call nlmsg_find_attr() with ifinfomsg header
From: Vlad Yasevich @ 2013-08-12 19:57 UTC (permalink / raw)
  To: Asbjoern Sloth Toennesen
  Cc: Stephen Hemminger, netdev, bridge, David S. Miller, linux-kernel
In-Reply-To: <1376325009-8399-1-git-send-email-ast@fiberby.net>

On 08/12/2013 12:30 PM, Asbjoern Sloth Toennesen wrote:
> Fix the iproute2 command `bridge vlan show`, after switching from
> rtgenmsg to ifinfomsg.
>
> Signed-off-by: Asbjoern Sloth Toennesen <ast@fiberby.net>


Thanks..  I've still been using an older iproute version and didn't see 
this.


Reviewed-by: Vlad Yasevich <vyasevich@gmail.com>
> ---
>   net/core/rtnetlink.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 3de7408..a043171 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -2384,7 +2384,7 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb)
>   	struct nlattr *extfilt;
>   	u32 filter_mask = 0;
>
> -	extfilt = nlmsg_find_attr(cb->nlh, sizeof(struct rtgenmsg),
> +	extfilt = nlmsg_find_attr(cb->nlh, sizeof(struct ifinfomsg),
>   				  IFLA_EXT_MASK);
>   	if (extfilt)
>   		filter_mask = nla_get_u32(extfilt);
>

^ permalink raw reply

* pull request: wireless-next 2013-08-12
From: John W. Linville @ 2013-08-12 19:53 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

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

Dave,

This is a batch of updates intended for 3.12.  It is mostly driver
stuff, although Johannes Berg and Simon Wunderlich make a good
showing with mac80211 bits (particularly some work on 5/10 MHz
channel support).

The usual suspects are mostly represented.  There are lots of updates
to iwlwifi, ath9k, ath10k, mwifiex, rt2x00, wil6210, as usual.
The bcma bus gets some love this time, as do cw1200, iwl4965, and a
few other bits here and there.  I don't think there is much unusual
here, FWIW.

Please let me know if there are problems!

John

---

The following changes since commit f3dfd20860db3d0c400dd83a378176a28d3662db:

  af_unix: fix bug on large send() (2013-08-11 22:02:36 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem

for you to fetch changes up to 89c2af3c14ddf8ae48637a7b454d66ac5e0ca728:

  Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem (2013-08-12 14:45:06 -0400)

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

Alexander Bondar (3):
      iwlwifi: mvm: Upgrade to a new power management uAPSD API
      iwlwifi: mvm: Change AM->PSM timeout for EAPOL frames
      iwlwifi: mvm: Change beacon abort escape time value

Alexey Khoroshilov (1):
      hostap: do not return positive number on failure path in prism2_open()

Amitkumar Karwar (18):
      cfg80211/nl80211: rename packet pattern related structures and enums
      cfg80211/nl80211: Add packet coalesce support
      mwifiex: add PCIe shutdown handler to avoid system hang on reboot
      mwifiex: move del_timer_sync(scan_delay_timer) call to fix memleak
      mwifiex: remove unnecessary del_timer(cmd_timer)
      mwifiex: move if_ops.cleanup_if() call
      mwifiex: add unregister_dev handler for usb interface
      mwifiex: reduce firmware poll retries
      mwifiex: replace mdelay with msleep
      mwifiex: correction in mwifiex_check_fw_status() return status
      mwifiex: remove duplicate structure host_cmd_tlv
      mwifiex: handle driver initialization error paths
      mwifiex: code rearrangement in sdio.c
      mwifiex: fix adapter pointer dereference issue
      mwifiex: rename mef macros
      mwifiex: modify mwifiex_is_pattern_supported() routine
      mwifiex: increase max supported pattern offset
      mwifiex: add packet coalesce support

Antonio Quartulli (1):
      mac80211: ibss - remove not authorized station earlier

Avinash Patil (7):
      mwifiex: rename pkt_count to ba_pkt_count in mwifiex_ra_list_tbl struct
      mwifiex: maintain outstanding packet count for RA list instead of packet size
      mwifiex: delete AP TX queues when bridged packets reach threshold
      mwifiex: correct max IE length check for WPS IE
      mwifiex: modify mwifiex_ap_sta_limits to advertise support for P2P
      ieee80211: add definition for interworking support
      mwifiex: populate rates in probe request using cfg80211_scan_request

Avri Altman (2):
      iwlwifi: mvm: new api to get signal strength
      iwlwifi: mvm: fix signal reporting for < 3 antennas

Bing Zhao (1):
      mwifiex: fix build error when CONFIG_PM is not set

Chris Wright (1):
      mac80211: fix infinite loop in ieee80211_determine_chantype

Chun-Yeow Yeoh (1):
      mac80211: set forwarding in mesh capability info

David Spinadel (1):
      iwlwifi: mvm: enable pre-scan passive to active

Eliad Peller (4):
      iwlwifi: fix some documentation typos
      iwlwifi: pcie: some little cleanups
      iwlwifi: mvm: add some missing cleanups in iwl_mvm_mac_add_interface
      iwlwifi: mvm: use designated initialization for some arrays

Emmanuel Grumbach (8):
      iwlwifi: pcie: don't disable L1 for newest NICs
      iwlwifi: mvm: better handle several several vifs in BT Coex
      iwlwifi: mvm: fix the ACK / CTS kill mask upon RSSI event
      iwlwifi: mvm: don't allocate BT_COEX cmd on stack
      iwlwifi: mvm: remove the default calibration values for 7000
      iwlwifi: mvm: register vif debugfs for AP mode too
      iwlwifi: mvm: remove obsolete flag in TX command API
      iwlwifi: mvm: advertise support for DYNAMIC / STATIC SMPS

Eran Harary (1):
      iwlwifi: mvm: fix debugfs restart if fw_restart is disabled

Eric Dumazet (1):
      iwl3945: better skb management in rx path

Eyal Shapira (2):
      iwlwifi: remove duplicate rate scale init code
      iwlwifi: mvm: remove traffic load monitoring in rs

Eytan Lifshitz (1):
      iwlwifi: mvm: add high temperature SKU thermal throttling parameters

Fabio Baltieri (1):
      mac80211: use oneshot blink API for LED triggers

Felix Fietkau (12):
      ath9k: add utility functions for accessing tid queues
      ath9k: split tid retry packets into a separate queue
      ath9k: add function for getting the tx tid for a packet
      ath9k: add CAB queue info to debugfs
      ath9k: simplify ath_tx_form_aggr
      ath9k: fix block ack window tracking check
      ath9k: prepare queueing code for handling unaggregated traffic
      ath9k: fix clearing expired A-MPDU subframes in tx completion
      ath9k: always clear ps filter bit on new assoc
      ath9k: use software queues for un-aggregated data packets
      ath9k: improve tx scheduling fairness
      ath9k: use software queueing for multicast traffic

Fred Zhou (1):
      ieee80211: add definition for 802.11ac information elements

Gabor Juhos (25):
      rt2x00: rt2800lib: introduce rt2800_eeprom_word enum
      rt2x00: rt2800lib: introduce local EEPROM access functions
      rt2x00: rt2800lib: introduce rt2800_eeprom_read_from_array helper
      rt2x00: rt2800lib: introduce rt2800_eeprom_word_index helper
      rt2x00: rt2800lib: add EEPROM map for the RT3593 chipset
      rt2x00: rt2800lib: add MAC register initialization for RT3593
      rt2x00: rt2800lib: add BBP register initialization for RT3593
      rt2x00: rt2800lib: add RFCSR register initialization for RT3593
      rt2x00: rt2800lib: add BBP post initialization for RT3593
      rt2x00: rt2800lib: add TX power configuration for RT3593
      rt2x00: rt2800lib: fix BBP1_TX_ANTENNA field configuration for 3T devices
      rt2x00: rt2800lib: fix antenna configuration for RT3593
      rt2x00: rt2800lib: add rt2800_txpower_to_dev helper
      rt2x00: rt2800lib: fix default TX power values for RT3593
      rt2x00: rt2800lib: introduce rt2800_get_txmixer_gain_{24,5}g helpers
      rt2x00: rt2800lib: hardcode TX mixer gain values for RT3593
      rt2x00: rt2800lib: fix LNA_A[12] gain values for RT3593
      rt2x00: rt2800lib: add default_power3 field for three-chain devices
      rt2x00: rt2800lib: add rf_vals for RF3053
      rt2x00: rt2800lib: add channel configuration for RF3053
      rt2x00: rt2800lib: enable VCO recalibration for RF3053
      rt2x00: rt2800lib: enable RF3053 support
      rt2x00: rt2800lib: enable RT3593 support
      rt2x00: rt2800usb: use correct [RT]XWI size for RT3593
      rt2x00: rt2800usb: add USB device ID for Linksys AE3000

Hauke Mehrtens (6):
      bcma: add some more core names
      bcma: make it possible to select SoC support without mips
      bcma: add constants for new ARM based SoCs
      bcma: return correct error code when bus scan failed
      bcma: fix handling of big addrl
      bgmac: make bgmac depend on bcm47xx

Hila Gonen (1):
      iwlwifi: mvm: Change beacon filtering command

Huawei Yang (2):
      mwifiex: remove stop_net_dev_queue operation in AP forwarding
      mwifiex: add tx info to skb when forming mgmt frame

Ilan Peer (1):
      iwlwifi: mvm: Return on inconsistency in add interface

Inbal Hacohen (1):
      iwlwifi: move dump_fh into common code

Jingoo Han (1):
      net: wireless: rt2x00: Staticize rt2x00queue_pause_queue_nocheck()

Johannes Berg (27):
      wireless: indent kernel-doc with tabs
      mac80211: add per-chain signal information to radiotap
      mac80211_hwsim: use ieee80211_free_txskb
      mac80211_hwsim: claim uAPSD support
      mac80211_hwsim: claim active monitor support
      mac80211: make active monitor injection work w/ HW queue
      iwlwifi: remove forward debugfs function declarations
      iwlwifi: mvm: remove unneeded argument from iwl_mvm_tx_protection()
      iwlwifi: pcie: make unused queue warning more readable
      ath9k: make rfkill configurable
      iwlwifi: dvm: remove P2P support
      nl80211: fix another nl80211_fam.attrbuf race
      iwlwifi: mvm: reprobe device on firmware error during restart
      iwlwifi: mvm: support six IPv6 addresses in D3
      iwlwifi: mvm: assign quota per virtual interface
      iwlwifi: mvm: split constants into separate file
      iwlwifi: mvm: report per-chain signal to mac80211
      iwlwifi: list Emmanuel in maintainers file
      mac80211: don't wait for TX status forever
      mac80211: ignore HT primary channel while connected
      cfg80211: fix P2P GO interface teardown
      mac80211: continue using disabled channels while connected
      mac80211: add debugfs for driver-buffered TID bitmap
      iwlwifi: pcie: fix resume when no opmode is present
      iwlwifi: mvm: small cleanups in quota management code
      iwlwifi: remove transport suspend/resume indirection
      brcmfmac: use CFG80211_TESTMODE_CMD

John Greene (1):
      brcmsmac: Further reduce log spam from tx phy messages

John W. Linville (9):
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge tag 'for-linville-20130730' of git://github.com/kvalo/ath6kl
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem

Kalle Valo (2):
      MAINTAINERS: add ath10k
      MAINTAINERS: update ath6kl git location

Karl Beldan (1):
      mac80211: report some VHT radiotap infos for tx status

Kirshenbaum Erez (1):
      wil6210: Enable TCP/UDP checksum HW offload

Mark Schulte (1):
      rtlwifi: rtl8192cu: fix function declaration header

Matti Gottlieb (3):
      iwlwifi: mvm: sram hex dump on NIC error
      iwlwifi: mvm: Enable user set TX power
      iwlwifi: mvm: Add RX statistics debugfs entry

Michal Kazior (34):
      ath10k: fix teardown ordering
      ath10k: fix possible deadlock
      ath10k: setup rts/frag thresholds upon vdev creation
      ath10k: do not setup rts/frag thresholds for suspended interfaces
      ath10k: remove ath10k_bus
      ath10k: fix typo in define name
      ath10k: silent warning in IBSS mode
      ath10k: lower print level for a message
      ath10k: provide errno if bmi read/write fails
      ath10k: change function to take struct ath10k as arg
      ath10k: rename hif callback
      ath10k: embed HTC struct inside ath10k
      ath10k: embed HTT struct inside ath10k
      ath10k: improve locking
      ath10k: abort scan properly if wmi_scan_stop fails
      ath10k: add missing debug prints
      ath10k: decouple pci start/stop logic
      ath10k: decouple core start/stop logic
      ath10k: allow deferred regd update
      ath10k: reset BMI state upon init
      ath10k: decouple suspend code
      ath10k: move free_vdev_map initialization
      ath10k: make sure all resources are freed upon ath10k_stop()
      ath10k: defer hw setup to start/stop mac80211 hooks
      ath10k: store firmware files in memory
      ath10k: skip fw stats debugfs interface if device is down
      ath10k: implement device recovery
      ath10k: implement fw crash simulation command
      ath10k: fix NULL dereference for injected packets
      ath10k: create debugfs interface to trigger fw crash
      ath10k: prevent HTC from being used after stopping
      ath10k: don't reset HTC endpoints unnecessarily
      ath10k: fix memleak in mac setup
      ath10k: fix rts/fragmentation threshold setup

Rafał Miłecki (1):
      ssb: drop BROKEN from SSB_SFLASH

Shuah Khan (1):
      wireless: Convert mwifiex/pcie to dev_pm_ops from legacy pm_ops

Simon Wunderlich (16):
      nl80211: enable HT overrides for ibss
      mac80211: enable HT overrides for ibss
      nl80211: add scan width to bss and scan request structs
      mac80211/rc80211: add chandef to rate initialization
      mac80211: fix timing for 5 MHz and 10 MHz channels
      mac80211: add radiotap flag and handling for 5/10 MHz
      mac80211: select and adjust bitrates according to channel mode
      cfg80211/mac80211: get mandatory rates based on scan width
      cfg80211/mac80211: use reduced txpower for 5 and 10 MHz
      mac80211: allow scanning for 5/10 MHz channels in IBSS
      mac80211: return if IBSS chandef can not be used
      nl80211: allow 5 and 10 MHz channels for IBSS
      mac80211: fix regression when initializing ibss wmm params
      mac80211: fix off-by-one regression in ibss beacon generation
      nl80211/cfg80211: add channel switch command
      mac80211: add channel switch command and beacon callbacks

Solomon Peachy (2):
      cw1200: Fix incorrect endianness annotation in a header field
      cw1200: Fix spurious BUG_ON() trigger when starting AP mode.

Stanislaw Gruszka (3):
      iwl4965: better skb management in rx path
      iwl4965: set power mode early
      iwl4965: reset firmware after rfkill off

Stone Piao (3):
      mwifiex: discard deauth and disassoc event during WPS session
      mwifiex: skip registering mgmt frame that has already registered
      mwifiex: support to send deauth for P2P client

Sujith Manoharan (34):
      ath9k: Fix RTS threshold
      ath9k: Move INI overrides to ar9003_hw_override_ini
      ath9k: Add a HW flag for FCC
      ath9k: Fix FastChannelChange for AR9462/AR9565
      ath9k: Use correct channel when switching bands
      ath9k: Program correct initvals for FCC
      ath9k: Release the RF bus after setting board values
      ath9k: Fix diversity combining for AR9285
      ath9k: Add a debugfs file for antenna diversity
      ath9k: Do a quick scan only when scan_not_start is true
      ath9k: Use a subroutine to check for short scan
      ath9k: Add ALT check for cards with GROUP-3 config
      ath9k: Use a subroutine to try LNA switch
      ath9k: Use a helper function for checking LNA options
      ath9k: Simplify checks in quick_scan
      ath9k: Use a subroutine to calculate ALT ratio
      ath9k: Add statistics for antenna diversity
      ath9k: Add information about antenna diversity
      ath9k: Print LNA combining mode during init
      ath9k: Fix antenna diversity for CUS198
      ath9k: Cleanup WLAN/BT RX diversity
      ath9k: Add a HW capability for WLAN/BT RX diversity
      ath9k: Rename ath9k_hw_antctrl_shared_chain_lnadiv
      ath9k: Enable WLAN/BT Ant Diversity for WB225/WB195
      ath9k: Program HW for WB195 diversity
      ath9k: Remove "shared_chain_lnadiv"
      ath9k: Set SWCOM value for CUS198
      ath9k: Support ANT diversity for WB225
      ath9k: Remove ath_ant_comb_update()
      ath9k: Fix antenna control init for AR9485
      ath9k: Add more PCI IDs for WB225 cards
      ath9k: Fix build failure
      ath9k: Fix BTCOEX usage for RX diversity
      ath9k: Run the LNA combining algorithm properly

Vladimir Kondratiev (7):
      wil6210: Align WMI header with latest FW
      wil6210: fix wrong index in wil_vring_free
      wil6210: Optimize Tx completion
      wil6210: Introduce struct for sw context
      wil6210: fix subtle race in wil_tx_vring
      wil6210: fix error path in wil_tx_vring
      wil6210: drop -Werror compiler flag

Xose Vazquez Perez (1):
      wireless: rt2x00: rt2800usb: add RT3573 devices

 MAINTAINERS                                        |    2 +-
 drivers/bcma/Kconfig                               |   10 +-
 drivers/bcma/main.c                                |    2 +-
 drivers/bcma/scan.c                                |   28 +-
 drivers/net/ethernet/broadcom/Kconfig              |    2 +-
 drivers/net/wireless/ath/ath.h                     |    2 +-
 drivers/net/wireless/ath/ath10k/bmi.c              |   12 +-
 drivers/net/wireless/ath/ath10k/bmi.h              |    1 +
 drivers/net/wireless/ath/ath10k/ce.c               |    2 +-
 drivers/net/wireless/ath/ath10k/core.c             |  321 +++--
 drivers/net/wireless/ath/ath10k/core.h             |   50 +-
 drivers/net/wireless/ath/ath10k/debug.c            |   87 +-
 drivers/net/wireless/ath/ath10k/hif.h              |   49 +-
 drivers/net/wireless/ath/ath10k/htc.c              |   61 +-
 drivers/net/wireless/ath/ath10k/htc.h              |    8 +-
 drivers/net/wireless/ath/ath10k/htt.c              |   27 +-
 drivers/net/wireless/ath/ath10k/htt.h              |    3 +-
 drivers/net/wireless/ath/ath10k/htt_rx.c           |    3 +-
 drivers/net/wireless/ath/ath10k/htt_tx.c           |   12 +-
 drivers/net/wireless/ath/ath10k/mac.c              |  409 +++++-
 drivers/net/wireless/ath/ath10k/mac.h              |    1 +
 drivers/net/wireless/ath/ath10k/pci.c              |  304 ++--
 drivers/net/wireless/ath/ath10k/pci.h              |    4 +-
 drivers/net/wireless/ath/ath10k/wmi.c              |   40 +-
 drivers/net/wireless/ath/ath10k/wmi.h              |   19 +
 drivers/net/wireless/ath/ath9k/Kconfig             |   10 +
 drivers/net/wireless/ath/ath9k/antenna.c           |  672 +++++----
 drivers/net/wireless/ath/ath9k/ar9002_phy.c        |   67 +
 drivers/net/wireless/ath/ath9k/ar9002_phy.h        |   10 +-
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c     |   26 +-
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h     |    2 +
 drivers/net/wireless/ath/ath9k/ar9003_phy.c        |  184 ++-
 drivers/net/wireless/ath/ath9k/ar9003_phy.h        |    5 -
 drivers/net/wireless/ath/ath9k/ath9k.h             |   44 +-
 drivers/net/wireless/ath/ath9k/debug.c             |  206 ++-
 drivers/net/wireless/ath/ath9k/debug.h             |   29 +-
 drivers/net/wireless/ath/ath9k/eeprom_4k.c         |   19 +
 drivers/net/wireless/ath/ath9k/hw-ops.h            |   11 +-
 drivers/net/wireless/ath/ath9k/hw.c                |   96 +-
 drivers/net/wireless/ath/ath9k/hw.h                |    9 +-
 drivers/net/wireless/ath/ath9k/init.c              |   32 +-
 drivers/net/wireless/ath/ath9k/main.c              |   19 +-
 drivers/net/wireless/ath/ath9k/pci.c               |   90 +-
 drivers/net/wireless/ath/ath9k/phy.h               |    7 +
 drivers/net/wireless/ath/ath9k/rc.c                |    2 +
 drivers/net/wireless/ath/ath9k/recv.c              |   44 +-
 drivers/net/wireless/ath/ath9k/xmit.c              |  501 ++++---
 drivers/net/wireless/ath/wil6210/Makefile          |    3 -
 drivers/net/wireless/ath/wil6210/debugfs.c         |    4 +-
 drivers/net/wireless/ath/wil6210/netdev.c          |    2 +
 drivers/net/wireless/ath/wil6210/trace.h           |   22 +-
 drivers/net/wireless/ath/wil6210/txrx.c            |  160 +-
 drivers/net/wireless/ath/wil6210/txrx.h            |   20 +-
 drivers/net/wireless/ath/wil6210/wil6210.h         |   27 +-
 drivers/net/wireless/ath/wil6210/wmi.c             |   20 +-
 .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |    4 +-
 drivers/net/wireless/brcm80211/brcmsmac/ampdu.c    |    6 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.c     |    4 +-
 drivers/net/wireless/cw1200/sta.c                  |    7 +-
 drivers/net/wireless/cw1200/wsm.h                  |    2 +-
 drivers/net/wireless/hostap/hostap_main.c          |    4 +-
 drivers/net/wireless/iwlegacy/3945-rs.c            |    1 +
 drivers/net/wireless/iwlegacy/3945.c               |   31 +-
 drivers/net/wireless/iwlegacy/4965-mac.c           |   34 +-
 drivers/net/wireless/iwlegacy/4965-rs.c            |    1 +
 drivers/net/wireless/iwlegacy/common.c             |    1 +
 drivers/net/wireless/iwlwifi/Kconfig               |   17 -
 drivers/net/wireless/iwlwifi/dvm/agn.h             |    6 -
 drivers/net/wireless/iwlwifi/dvm/debugfs.c         |   15 -
 drivers/net/wireless/iwlwifi/dvm/dev.h             |    7 -
 drivers/net/wireless/iwlwifi/dvm/mac80211.c        |  172 +--
 drivers/net/wireless/iwlwifi/dvm/main.c            |   62 -
 drivers/net/wireless/iwlwifi/dvm/rs.c              |    6 +-
 drivers/net/wireless/iwlwifi/dvm/rxon.c            |    6 +-
 drivers/net/wireless/iwlwifi/dvm/scan.c            |  105 +-
 drivers/net/wireless/iwlwifi/dvm/tx.c              |   19 -
 drivers/net/wireless/iwlwifi/iwl-7000.c            |   11 +
 drivers/net/wireless/iwlwifi/iwl-config.h          |    4 +
 drivers/net/wireless/iwlwifi/iwl-fw.h              |   19 +-
 drivers/net/wireless/iwlwifi/iwl-io.c              |   67 +
 drivers/net/wireless/iwlwifi/iwl-io.h              |    3 +
 drivers/net/wireless/iwlwifi/iwl-nvm-parse.c       |    8 +-
 drivers/net/wireless/iwlwifi/iwl-op-mode.h         |    4 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h           |   25 +-
 drivers/net/wireless/iwlwifi/mvm/Makefile          |    2 +-
 drivers/net/wireless/iwlwifi/mvm/bt-coex.c         |  162 ++-
 drivers/net/wireless/iwlwifi/mvm/constants.h       |   71 +
 drivers/net/wireless/iwlwifi/mvm/d3.c              |   66 +-
 drivers/net/wireless/iwlwifi/mvm/debugfs.c         |  254 +++-
 drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h       |   49 +-
 drivers/net/wireless/iwlwifi/mvm/fw-api-power.h    |  143 +-
 drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h     |    5 +-
 drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h       |    2 -
 drivers/net/wireless/iwlwifi/mvm/fw-api.h          |   27 +-
 drivers/net/wireless/iwlwifi/mvm/fw.c              |   55 -
 drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c        |    3 +-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c        |   57 +-
 drivers/net/wireless/iwlwifi/mvm/mvm.h             |   85 +-
 drivers/net/wireless/iwlwifi/mvm/ops.c             |   58 +-
 drivers/net/wireless/iwlwifi/mvm/power.c           |  198 ++-
 drivers/net/wireless/iwlwifi/mvm/power_legacy.c    |  319 ++++
 drivers/net/wireless/iwlwifi/mvm/quota.c           |   27 +-
 drivers/net/wireless/iwlwifi/mvm/rs.c              |  179 +--
 drivers/net/wireless/iwlwifi/mvm/rs.h              |   16 +-
 drivers/net/wireless/iwlwifi/mvm/rx.c              |   97 +-
 drivers/net/wireless/iwlwifi/mvm/scan.c            |    2 +
 drivers/net/wireless/iwlwifi/mvm/sta.c             |    3 +-
 drivers/net/wireless/iwlwifi/mvm/tt.c              |   32 +-
 drivers/net/wireless/iwlwifi/mvm/tx.c              |    4 +-
 drivers/net/wireless/iwlwifi/mvm/utils.c           |   23 +
 drivers/net/wireless/iwlwifi/pcie/drv.c            |   24 +-
 drivers/net/wireless/iwlwifi/pcie/internal.h       |    1 -
 drivers/net/wireless/iwlwifi/pcie/rx.c             |    2 +-
 drivers/net/wireless/iwlwifi/pcie/trans.c          |  118 +-
 drivers/net/wireless/iwlwifi/pcie/tx.c             |   22 +-
 drivers/net/wireless/mac80211_hwsim.c              |   10 +-
 drivers/net/wireless/mwifiex/11n_aggr.c            |    4 +-
 drivers/net/wireless/mwifiex/cfg80211.c            |  176 ++-
 drivers/net/wireless/mwifiex/cfp.c                 |   42 +-
 drivers/net/wireless/mwifiex/decl.h                |    3 +-
 drivers/net/wireless/mwifiex/fw.h                  |   70 +-
 drivers/net/wireless/mwifiex/ie.c                  |    2 +-
 drivers/net/wireless/mwifiex/init.c                |   14 +-
 drivers/net/wireless/mwifiex/ioctl.h               |   43 +-
 drivers/net/wireless/mwifiex/join.c                |    1 +
 drivers/net/wireless/mwifiex/main.c                |   96 +-
 drivers/net/wireless/mwifiex/main.h                |    8 +-
 drivers/net/wireless/mwifiex/pcie.c                |   39 +-
 drivers/net/wireless/mwifiex/scan.c                |   63 +-
 drivers/net/wireless/mwifiex/sdio.c                |  213 ++-
 drivers/net/wireless/mwifiex/sta_cmd.c             |   77 +-
 drivers/net/wireless/mwifiex/sta_cmdresp.c         |    2 +
 drivers/net/wireless/mwifiex/sta_event.c           |   10 +
 drivers/net/wireless/mwifiex/sta_ioctl.c           |   11 +-
 drivers/net/wireless/mwifiex/uap_cmd.c             |  130 +-
 drivers/net/wireless/mwifiex/uap_txrx.c            |   70 +-
 drivers/net/wireless/mwifiex/usb.c                 |    8 +
 drivers/net/wireless/mwifiex/wmm.c                 |   16 +-
 drivers/net/wireless/rt2x00/Kconfig                |    6 +
 drivers/net/wireless/rt2x00/rt2800.h               |  274 +++-
 drivers/net/wireless/rt2x00/rt2800lib.c            | 1524 ++++++++++++++++++--
 drivers/net/wireless/rt2x00/rt2800usb.c            |   39 +-
 drivers/net/wireless/rt2x00/rt2x00.h               |    1 +
 drivers/net/wireless/rt2x00/rt2x00queue.c          |    2 +-
 drivers/net/wireless/rtlwifi/rc.c                  |    1 +
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.h        |    3 +
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.h        |    3 -
 drivers/net/wireless/ti/wlcore/main.c              |   10 +-
 drivers/ssb/Kconfig                                |    2 +-
 drivers/ssb/driver_chipcommon_sflash.c             |    8 +-
 include/linux/bcma/bcma.h                          |   17 +
 include/linux/ieee80211.h                          |    9 +
 include/net/cfg80211.h                             |  197 ++-
 include/net/ieee80211_radiotap.h                   |    4 +
 include/net/mac80211.h                             |   67 +-
 include/uapi/linux/nl80211.h                       |  183 ++-
 net/mac80211/cfg.c                                 |  232 ++-
 net/mac80211/chan.c                                |   58 +
 net/mac80211/debugfs_sta.c                         |    9 +
 net/mac80211/driver-ops.h                          |   13 +
 net/mac80211/ht.c                                  |   53 +-
 net/mac80211/ibss.c                                |  184 ++-
 net/mac80211/ieee80211_i.h                         |   67 +-
 net/mac80211/iface.c                               |   11 +-
 net/mac80211/led.c                                 |   19 +-
 net/mac80211/led.h                                 |    4 +-
 net/mac80211/main.c                                |   15 +-
 net/mac80211/mesh.c                                |    7 +-
 net/mac80211/mesh_plink.c                          |    2 +-
 net/mac80211/mlme.c                                |  152 +-
 net/mac80211/rate.c                                |   46 +-
 net/mac80211/rate.h                                |   22 +-
 net/mac80211/rc80211_minstrel.c                    |   33 +-
 net/mac80211/rc80211_minstrel_ht.c                 |   15 +-
 net/mac80211/rc80211_pid_algo.c                    |    1 +
 net/mac80211/rx.c                                  |   97 +-
 net/mac80211/scan.c                                |   72 +-
 net/mac80211/status.c                              |   90 +-
 net/mac80211/trace.h                               |   26 +
 net/mac80211/tx.c                                  |  108 +-
 net/mac80211/util.c                                |  216 ++-
 net/wireless/core.c                                |   10 +
 net/wireless/core.h                                |    2 +
 net/wireless/mesh.c                                |    5 +-
 net/wireless/nl80211.c                             |  486 ++++++-
 net/wireless/nl80211.h                             |    2 +
 net/wireless/rdev-ops.h                            |   12 +
 net/wireless/scan.c                                |   31 +-
 net/wireless/trace.h                               |   45 +-
 net/wireless/util.c                                |   14 +-
 190 files changed, 8855 insertions(+), 3321 deletions(-)
 create mode 100644 drivers/net/wireless/iwlwifi/mvm/constants.h
 create mode 100644 drivers/net/wireless/iwlwifi/mvm/power_legacy.c
-- 
John W. Linville		Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org			might be all we have.  Be ready.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH net] bnx2x: guard stats_pending with stats_lock in all cases
From: Neal Cardwell @ 2013-08-12 19:08 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Neal Cardwell, Eilon Greenstein, Vladislav Zolotarov,
	Yaniv Rosner, Merav Sicron, Eric Dumazet, Tom Herbert,
	Havard Skinnemoen, Sanjay Hortikar

As 9bcb8018cf ("bnx2x: Fix the race on bp->stats_pending") noted, we
can have a race on bp->stats_pending between the timer and a
STATS_EVENT_LINK_UP event handler.

But it seems we can also have the following two races on
bp->stats_pending between the timer and a STATS_EVENT_STOP handler:

Scenario A:
-----------

thread 1:  bnx2x_timer() thread in bnx2x_storm_stats_post():
		/* send FW stats ramrod */
		rc = bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_STAT_QUERY, 0,
				   U64_HI(bp->fw_stats_req_mapping),
				   U64_LO(bp->fw_stats_req_mapping),
				   NONE_CONNECTION_TYPE);
		if (rc == 0)

thread 2: ethtool thread:
bnx2x_stats_handle(bp, STATS_EVENT_STOP)
  -> bnx2x_stats_stop()
    -> bnx2x_storm_stats_update()
	bp->stats_pending = 0;

thread 1:  bnx2x_timer() thread in bnx2x_storm_stats_post():
			bp->stats_pending = 1;

If the action interleaves in this way we end up with a
bp->stats_pending value of 1 when there are no stats pending.

Scenario B:
-----------
thread 1:  bnx2x_timer() thread in bnx2x_stats_update():
		if (bnx2x_storm_stats_update(bp)) {
			if (bp->stats_pending == 3) { // false
			reg1 = bp->stats_pending      // reg1=1

thread 2: ethtool thread:
bnx2x_stats_handle(bp, STATS_EVENT_STOP)
  -> bnx2x_stats_stop()
    -> bnx2x_storm_stats_update()
	bp->stats_pending = 0;

thread 1:  bnx2x_timer() thread in bnx2x_stats_update():
			reg1++				// reg1=2
			bp->stats_pending = reg1;	// stats_pending=2
			return;

If the action interleaves in this way we end up with a non-zero
bp->stats_pending value when there are no stats pending.

-----------

These are suspected as possible contributors to occasional
bnx2x_panic() dumps we see of the form:

 storm stats were not updated for 3 times

When these panic messages happen we see the NIC hang.

The proposed fix is for all, not just some, of the reads and writes to
stats_pending to be guarded by stats_lock. So now all accesses to
stats_pending and stats_couner are guarded by stats_lock.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Vladislav Zolotarov <vladz@broadcom.com>
Cc: Yaniv Rosner <yanivr@broadcom.com>
Cc: Merav Sicron <meravs@broadcom.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Havard Skinnemoen <hskinnemoen@google.com>
Cc: Sanjay Hortikar <horti@google.com>
Change-Id: Ic389c4355ef4a3e01da8f1f4c2019e75dbb5ddf6
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 47 +++++++++++++----------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index 98366ab..d72a630 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -123,16 +123,11 @@ static void bnx2x_dp_stats(struct bnx2x *bp)
  */
 static void bnx2x_storm_stats_post(struct bnx2x *bp)
 {
+	spin_lock_bh(&bp->stats_lock);
+
 	if (!bp->stats_pending) {
 		int rc;
 
-		spin_lock_bh(&bp->stats_lock);
-
-		if (bp->stats_pending) {
-			spin_unlock_bh(&bp->stats_lock);
-			return;
-		}
-
 		bp->fw_stats_req->hdr.drv_stats_counter =
 			cpu_to_le16(bp->stats_counter++);
 
@@ -151,8 +146,9 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
 		if (rc == 0)
 			bp->stats_pending = 1;
 
-		spin_unlock_bh(&bp->stats_lock);
 	}
+
+	spin_unlock_bh(&bp->stats_lock);
 }
 
 static void bnx2x_hw_stats_post(struct bnx2x *bp)
@@ -888,9 +884,7 @@ static int bnx2x_storm_stats_validate_counters(struct bnx2x *bp)
 	/* Make sure we use the value of the counter
 	 * used for sending the last stats ramrod.
 	 */
-	spin_lock_bh(&bp->stats_lock);
 	cur_stats_counter = bp->stats_counter - 1;
-	spin_unlock_bh(&bp->stats_lock);
 
 	/* are storm stats valid? */
 	if (le16_to_cpu(counters->xstats_counter) != cur_stats_counter) {
@@ -923,7 +917,8 @@ static int bnx2x_storm_stats_validate_counters(struct bnx2x *bp)
 	return 0;
 }
 
-static int bnx2x_storm_stats_update(struct bnx2x *bp)
+static int bnx2x_storm_stats_update(struct bnx2x *bp,
+				    bool track_pending)
 {
 	struct tstorm_per_port_stats *tport =
 				&bp->fw_stats_data->port.tstorm_port_statistics;
@@ -934,9 +929,24 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
 	struct bnx2x_eth_stats_old *estats_old = &bp->eth_stats_old;
 	int i;
 
+	spin_lock_bh(&bp->stats_lock);
+
 	/* vfs stat counter is managed by pf */
-	if (IS_PF(bp) && bnx2x_storm_stats_validate_counters(bp))
+	if (IS_PF(bp) && bnx2x_storm_stats_validate_counters(bp)) {
+		bool pending_timeout = false;
+
+		if (track_pending && (bp->stats_pending++ == 3))
+			pending_timeout = true;
+
+		spin_unlock_bh(&bp->stats_lock);
+
+		if (pending_timeout) {
+			BNX2X_ERR("storm stats were not updated for 3 times\n");
+			bnx2x_panic();
+		}
+
 		return -EAGAIN;
+	}
 
 	estats->error_bytes_received_hi = 0;
 	estats->error_bytes_received_lo = 0;
@@ -1118,6 +1128,8 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
 
 	bp->stats_pending = 0;
 
+	spin_unlock_bh(&bp->stats_lock);
+
 	return 0;
 }
 
@@ -1237,18 +1249,13 @@ static void bnx2x_stats_update(struct bnx2x *bp)
 		if (bp->port.pmf)
 			bnx2x_hw_stats_update(bp);
 
-		if (bnx2x_storm_stats_update(bp)) {
-			if (bp->stats_pending++ == 3) {
-				BNX2X_ERR("storm stats were not updated for 3 times\n");
-				bnx2x_panic();
-			}
+		if (bnx2x_storm_stats_update(bp, true))
 			return;
-		}
 	} else {
 		/* vf doesn't collect HW statistics, and doesn't get completions
 		 * perform only update
 		 */
-		bnx2x_storm_stats_update(bp);
+		bnx2x_storm_stats_update(bp, false);
 	}
 
 	bnx2x_net_stats_update(bp);
@@ -1337,7 +1344,7 @@ static void bnx2x_stats_stop(struct bnx2x *bp)
 	if (bp->port.pmf)
 		update = (bnx2x_hw_stats_update(bp) == 0);
 
-	update |= (bnx2x_storm_stats_update(bp) == 0);
+	update |= (bnx2x_storm_stats_update(bp, false) == 0);
 
 	if (update) {
 		bnx2x_net_stats_update(bp);
-- 
1.8.3

^ permalink raw reply related

* Re: [PATCH 8/8] net: davinci_mdio: use platform_{get,set}_drvdata()
From: Sergei Shtylyov @ 2013-08-12 18:17 UTC (permalink / raw)
  To: Libo Chen
  Cc: David Miller, mugunthanvnm, bigeasy, prabhakar.csengg, b-liu,
	netdev, LKML, Li Zefan
In-Reply-To: <5208E231.60104@huawei.com>

On 08/12/2013 05:25 PM, Libo Chen wrote:

> Use the wrapper functions for getting and setting the driver data using
> platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
> so we can directly pass a struct platform_device.

> Signed-off-by: Libo Chen <libo.chen@huawei.com>
> ---
>   drivers/net/ethernet/ti/davinci_mdio.c |    4 +---
>   1 files changed, 1 insertions(+), 3 deletions(-)

> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
> index 16ddfc3..2249b2c 100644
> --- a/drivers/net/ethernet/ti/davinci_mdio.c
> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
[...]
> @@ -434,7 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev)
>   	pm_runtime_put_sync(&pdev->dev);
>   	pm_runtime_disable(&pdev->dev);
>
> -	dev_set_drvdata(dev, NULL);

    Doesn't get described as well. I think you're mixing two types of changes 
in one patchset.

WBR, Sergei

^ permalink raw reply

* Re: [PATCH 4/8] net: fs_enet: use platform_{get,set}_drvdata()
From: Sergei Shtylyov @ 2013-08-12 18:16 UTC (permalink / raw)
  To: Libo Chen
  Cc: pantelis.antoniou, vbordug, David Miller, linuxppc-dev, netdev,
	LKML, Li Zefan
In-Reply-To: <5208E222.60300@huawei.com>

On 08/12/2013 05:24 PM, Libo Chen wrote:

> Use the wrapper functions for getting and setting the driver data using
> platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
> so we can directly pass a struct platform_device.

> Signed-off-by: Libo Chen <libo.chen@huawei.com>
> ---
>   .../net/ethernet/freescale/fs_enet/fs_enet-main.c  |    1 -
>   1 files changed, 0 insertions(+), 1 deletions(-)

> diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
> index 8de53a1..7e3de10 100644
> --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
> +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
> @@ -1122,7 +1122,6 @@ static int fs_enet_remove(struct platform_device *ofdev)
>
>   	fep->ops->free_bd(ndev);
>   	fep->ops->cleanup_data(ndev);
> -	dev_set_drvdata(fep->dev, NULL);
>   	of_node_put(fep->fpi->phy_node);
>   	free_netdev(ndev);
>   	return 0;

    Changelog simply doesn't match the patch.

WBR, Sergei

^ permalink raw reply


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