Thread (3 messages) flat view 3 messages, 3 authors, 2016-01-05

Re: [PATCH next] net/core/dev: Warn on an impossibly short offload frame

From: Aaron Conole <aconole@redhat.com>
Date: 2016-01-05 18:36:10

Joe Perches [off-list ref] writes:
On Sat, 2016-01-02 at 19:25 -0500, Aaron Conole wrote:
quoted
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 WARN_ON() to ensure that the stack loudly
complains about such broken drivers.
[]
quoted
diff --git a/net/core/dev.c b/net/core/dev.c
[]
quoted
@@ -4579,7 +4579,7 @@ static struct sk_buff *napi_frags_skb(struct
napi_struct *napi)
 	eth = skb_gro_header_fast(skb, 0);
 	if (unlikely(skb_gro_header_hard(skb, hlen))) {
 		eth = skb_gro_header_slow(skb, hlen, 0);
-		if (unlikely(!eth)) {
+		if (WARN_ON(!eth)) {
 			napi_reuse_skb(napi, skb);
 			return NULL;
 		}
It's generally a good idea to use
WARN_ON_RATELIMIT or WARN_ON_ONCE.
Okay, I'll respin switching to WARN_ON_RATELIMIT, if that's a better
approach.

Thanks for the review, Joe!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help