netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] gro: avoid checking for a failed search
@ 2022-10-24  5:17 Richard Gobert
  2022-11-01 15:51 ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Gobert @ 2022-10-24  5:17 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, lixiaoyan, alexanderduyck,
	richardbgobert, steffen.klassert, netdev, linux-kernel

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


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

end of thread, other threads:[~2022-11-02 18:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24  5:17 [PATCH net-next] gro: avoid checking for a failed search Richard Gobert
2022-11-01 15:51 ` Jakub Kicinski
2022-11-02 16:45   ` Richard Gobert
2022-11-02 18:20     ` Eric Dumazet
2022-11-02 18:25       ` Eric Dumazet

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).