浏览代码

qede: Fix single MTU sized packet from firmware GRO flow

In firmware assisted GRO flow there could be a single MTU sized
segment arriving due to firmware aggregation timeout/last segment
in an aggregation flow, which is not expected to be an actual gro
packet. So If a skb has zero frags from the GRO flow then simply
push it in the stack as non gso skb.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Yuval Mintz <yuval.mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Manish Chopra 9 年之前
父节点
当前提交
ee2fa8e6b3
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      drivers/net/ethernet/qlogic/qede/qede_main.c

+ 13 - 0
drivers/net/ethernet/qlogic/qede/qede_main.c

@@ -1069,6 +1069,17 @@ static void qede_gro_receive(struct qede_dev *edev,
 			     struct sk_buff *skb,
 			     struct sk_buff *skb,
 			     u16 vlan_tag)
 			     u16 vlan_tag)
 {
 {
+	/* FW can send a single MTU sized packet from gro flow
+	 * due to aggregation timeout/last segment etc. which
+	 * is not expected to be a gro packet. If a skb has zero
+	 * frags then simply push it in the stack as non gso skb.
+	 */
+	if (unlikely(!skb->data_len)) {
+		skb_shinfo(skb)->gso_type = 0;
+		skb_shinfo(skb)->gso_size = 0;
+		goto send_skb;
+	}
+
 #ifdef CONFIG_INET
 #ifdef CONFIG_INET
 	if (skb_shinfo(skb)->gso_size) {
 	if (skb_shinfo(skb)->gso_size) {
 		skb_set_network_header(skb, 0);
 		skb_set_network_header(skb, 0);
@@ -1087,6 +1098,8 @@ static void qede_gro_receive(struct qede_dev *edev,
 		}
 		}
 	}
 	}
 #endif
 #endif
+
+send_skb:
 	skb_record_rx_queue(skb, fp->rss_id);
 	skb_record_rx_queue(skb, fp->rss_id);
 	qede_skb_receive(edev, fp, skb, vlan_tag);
 	qede_skb_receive(edev, fp, skb, vlan_tag);
 }
 }