lkml.org 
[lkml]   [2022]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH net-next] gro: avoid checking for a failed search
After searching for a protocol handler in dev_gro_receive, checking for
failure is redundant. Skip the failure code after finding the
corresponding handler.

Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
---
net/core/gro.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/core/gro.c b/net/core/gro.c
index bc9451743307..a4e1b5a5be64 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -522,13 +522,13 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive,
ipv6_gro_receive, inet_gro_receive,
&gro_list->list, skb);
- break;
+ rcu_read_unlock();
+ goto found;
}
rcu_read_unlock();
+ goto normal;

- if (&ptype->list == head)
- goto normal;
-
+found:
if (PTR_ERR(pp) == -EINPROGRESS) {
ret = GRO_CONSUMED;
goto ok;
--
2.20.1
\
 
 \ /
  Last update: 2022-11-01 13:02    [W:0.049 / U:1.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site