Skip to contentSkip to conversation

net/core/dev: Warn on a too-short GRO frame

PATCH Superseded Aaron Conole 2 participants 2 messages Apr 1, 2016

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net/core/dev: Warn on a too-short GRO frame

From: Aaron Conole <[email protected]>

When signaling that a GRO frame is ready to be processed, the network stack correctly checks length and aborts processing when a frame is less than 14 bytes. However, such a condition is really indicative of a broken driver, and should be loudly signaled, rather than silently dropped as the case is today.

Convert the condition to use net_warn_ratelimited() to ensure the stack loudly complains about such broken drivers.

---
v2:
* Convert from WARN_ON to net_warn_ratelimited

 net/core/dev.c | 2 ++
 1 file changed, 2 insertions(+)
net/core/dev.c +2 -0
index b9bcbe7..1be269e 100644
@@ -4663,6 +4663,8 @@ static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
 	if (unlikely(skb_gro_header_hard(skb, hlen))) {
 		eth = skb_gro_header_slow(skb, hlen, 0);
 		if (unlikely(!eth)) {
+			net_warn_ratelimited("%s: dropping impossible skb\n",
+					     __func__);
 			napi_reuse_skb(napi, skb);
 			return NULL;
 		}
Signature · 1 line
2.5.5
#1 lore raw
Quoted 8 lines · Aaron Conole

From: Aaron Conole <[email protected]>

When signaling that a GRO frame is ready to be processed, the network stack correctly checks length and aborts processing when a frame is less than 14 bytes. However, such a condition is really indicative of a broken driver, and should be loudly signaled, rather than silently dropped as the case is today.

Quoted 5 lines

Convert the condition to use net_warn_ratelimited() to ensure the stack loudly complains about such broken drivers.

---

Shouldn't we give a hint of device name ?

(available in napi->dev->name )