netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/10] bnx2x: patch series
@ 2013-01-14 15:11 Yuval Mintz
  2013-01-14 15:11 ` [PATCH net-next 01/10] bnx2x: Clear dirty status when booting after UNDI Yuval Mintz
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Yuval Mintz @ 2013-01-14 15:11 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, ariele, Yuval Mintz

Hi Dave,

This patch series contains several patches, some of which 
are cosmetic (e.g., introduce 2013),
some fix small issues or rare corner cases (e.g., link failure in self test),
and some add new functionality - better support for dumping our registers 
(supporting `ethtool -w/-d') and support for FW GRO in bridging scenarios.

Please consider applying this patch-series to 'net-next'.

Thanks,
Yuval Mintz

^ permalink raw reply	[flat|nested] 28+ messages in thread
* [PATCH net-next] bnx2x: fix GRO parameters
@ 2013-01-17 13:26 Yuval Mintz
  2013-01-17 14:33 ` Eric Dumazet
  0 siblings, 1 reply; 28+ messages in thread
From: Yuval Mintz @ 2013-01-17 13:26 UTC (permalink / raw)
  To: davem, eric.dumazet, netdev; +Cc: eilong, ariele, Yuval Mintz

bnx2x does an internal GRO pass but doesn't provide gso_segs, thus
breaking qdisc_pkt_len_init() in case ingress qdisc is used.

We store gso_segs in NAPI_GRO_CB(skb)->count, where tcp_gro_complete()
expects to find the number of aggregated segments.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
---
This is Eric Dumazet's patch with slight semantic modifications.
Eric - Do you want to put your ack or signoff on this patch?

Dave - Please apply this to 'net-next' afterwards.

Thanks,
Yuval Mintz
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 47 ++++++++++++-------------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 18fc26e..49810a0 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -439,31 +439,34 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue,
  */
 #define TPA_TSTAMP_OPT_LEN	12
 /**
- * bnx2x_set_lro_mss - calculate the approximate value of the MSS
+ * bnx2x_set_gro_params - compute GRO values
  *
- * @bp:			driver handle
+ * @skb:		packet skb
  * @parsing_flags:	parsing flags from the START CQE
  * @len_on_bd:		total length of the first packet for the
  *			aggregation.
+ * @pkt_len:		length of all segments
  *
  * Approximate value of the MSS for this aggregation calculated using
  * the first packet of it.
+ * Compute number of aggregated segments, and gso_type
  */
-static u16 bnx2x_set_lro_mss(struct bnx2x *bp, u16 parsing_flags,
-			     u16 len_on_bd)
+static void bnx2x_set_gro_params(struct sk_buff *skb, u16 parsing_flags,
+				 u16 len_on_bd, unsigned int pkt_len)
 {
-	/*
-	 * TPA arrgregation won't have either IP options or TCP options
+	/* TPA aggregation won't have either IP options or TCP options
 	 * other than timestamp or IPv6 extension headers.
 	 */
 	u16 hdrs_len = ETH_HLEN + sizeof(struct tcphdr);
 
 	if (GET_FLAG(parsing_flags, PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) ==
-	    PRS_FLAG_OVERETH_IPV6)
+	    PRS_FLAG_OVERETH_IPV6) {
 		hdrs_len += sizeof(struct ipv6hdr);
-	else /* IPv4 */
+		skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
+	} else {
 		hdrs_len += sizeof(struct iphdr);
-
+		skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
+	}
 
 	/* Check if there was a TCP timestamp, if there is it's will
 	 * always be 12 bytes length: nop nop kind length echo val.
@@ -473,7 +476,13 @@ static u16 bnx2x_set_lro_mss(struct bnx2x *bp, u16 parsing_flags,
 	if (parsing_flags & PARSING_FLAGS_TIME_STAMP_EXIST_FLAG)
 		hdrs_len += TPA_TSTAMP_OPT_LEN;
 
-	return len_on_bd - hdrs_len;
+	skb_shinfo(skb)->gso_size = len_on_bd - hdrs_len;
+
+	/* tcp_gro_complete() will copy NAPI_GRO_CB(skb)->count
+	 * to skb_shinfo(skb)->gso_segs
+	 */
+	NAPI_GRO_CB(skb)->count = DIV_ROUND_UP(pkt_len - hdrs_len,
+					       skb_shinfo(skb)->gso_size);
 }
 
 static int bnx2x_alloc_rx_sge(struct bnx2x *bp,
@@ -527,19 +536,9 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,
 	}
 
 	/* This is needed in order to enable forwarding support */
-	if (frag_size) {
-		skb_shinfo(skb)->gso_size = bnx2x_set_lro_mss(bp,
-					tpa_info->parsing_flags, len_on_bd);
-
-		/* set for GRO */
-		if (fp->mode == TPA_MODE_GRO && skb_shinfo(skb)->gso_size)
-			skb_shinfo(skb)->gso_type =
-			    (GET_FLAG(tpa_info->parsing_flags,
-				      PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) ==
-						PRS_FLAG_OVERETH_IPV6) ?
-				SKB_GSO_TCPV6 : SKB_GSO_TCPV4;
-	}
-
+	if (frag_size)
+		bnx2x_set_gro_params(skb, tpa_info->parsing_flags, len_on_bd,
+				     le16_to_cpu(cqe->pkt_len));
 
 #ifdef BNX2X_STOP_ON_ERROR
 	if (pages > min_t(u32, 8, MAX_SKB_FRAGS)*SGE_PAGE_SIZE*PAGES_PER_SGE) {
@@ -651,7 +650,7 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp,
 			       struct sk_buff *skb)
 {
 #ifdef CONFIG_INET
-	if (fp->mode == TPA_MODE_GRO && skb_shinfo(skb)->gso_size) {
+	if (skb_shinfo(skb)->gso_size) {
 		skb_set_network_header(skb, 0);
 		switch (be16_to_cpu(skb->protocol)) {
 		case ETH_P_IP:
-- 
1.8.1.227.g44fe835

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2013-01-17 19:56 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14 15:11 [PATCH net-next 0/10] bnx2x: patch series Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 01/10] bnx2x: Clear dirty status when booting after UNDI Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 02/10] bnx2x: Add an additional fatal hw assertion - BRB_HW_INTERRUPT Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 03/10] bnx2x: use SAN Mac for FCoE Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 04/10] bnx2x: Fix rare self-test failures Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 05/10] bnx2x: Added nvram personalities support Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 06/10] bnx2x: add `ethtool -w' support Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 07/10] bnx2x: improve stop-on-error Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 08/10] bnx2x: Clean previous IGU status before ack Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 09/10] bnx2x: Added FW GRO bridging support Yuval Mintz
2013-01-14 17:22   ` Eric Dumazet
2013-01-14 18:44     ` Eric Dumazet
2013-01-15  7:28       ` Yuval Mintz
2013-01-15 14:39         ` Eric Dumazet
2013-01-15 14:02           ` Yuval Mintz
2013-01-15 15:07             ` Eric Dumazet
2013-01-15 20:09             ` David Miller
2013-01-16  4:56               ` Eric Dumazet
2013-01-16  5:37                 ` [PATCH net-next] bnx2x: fix GRO parameters Eric Dumazet
2013-01-16  7:01                   ` Yuval Mintz
2013-01-16 15:29                     ` Eric Dumazet
2013-01-16 14:38                       ` Yuval Mintz
2013-01-16 16:50                         ` Eric Dumazet
2013-01-17  7:16                           ` Yuval Mintz
2013-01-14 15:11 ` [PATCH net-next 10/10] bnx2x: Introduce 2013 and advance version to 1.78.02 Yuval Mintz
  -- strict thread matches above, loose matches on Subject: below --
2013-01-17 13:26 [PATCH net-next] bnx2x: fix GRO parameters Yuval Mintz
2013-01-17 14:33 ` Eric Dumazet
2013-01-17 19:56   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).