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. Suggested-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Richard Gobert <richardbgobert@gmail.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20221108123320.GA59373@debian Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
e29edc475f
commit
e081ecf084
|
@ -489,9 +489,13 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
|
|||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(ptype, head, list) {
|
||||
if (ptype->type != type || !ptype->callbacks.gro_receive)
|
||||
continue;
|
||||
if (ptype->type == type && ptype->callbacks.gro_receive)
|
||||
goto found_ptype;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
goto normal;
|
||||
|
||||
found_ptype:
|
||||
skb_set_network_header(skb, skb_gro_offset(skb));
|
||||
skb_reset_mac_len(skb);
|
||||
BUILD_BUG_ON(sizeof_field(struct napi_gro_cb, zeroed) != sizeof(u32));
|
||||
|
@ -522,12 +526,8 @@ 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();
|
||||
|
||||
if (&ptype->list == head)
|
||||
goto normal;
|
||||
rcu_read_unlock();
|
||||
|
||||
if (PTR_ERR(pp) == -EINPROGRESS) {
|
||||
ret = GRO_CONSUMED;
|
||||
|
|
Loading…
Reference in New Issue