Skip to content

Commit

Permalink
net: Make gro complete function to return void
Browse files Browse the repository at this point in the history
tcp_gro_complete() function only updates the skb fields related to GRO
and it always returns zero. All the 3 drivers which are using it
do not check for the return value either.

Change it to return void instead which simplifies its callers as
error handing becomes unnecessary.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Parav Pandit authored and David S. Miller committed May 31, 2023
1 parent f209c8e commit b1f2abc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ INDIRECT_CALLABLE_DECLARE(int tcp4_gro_complete(struct sk_buff *skb, int thoff))
INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp4_gro_receive(struct list_head *head, struct sk_buff *skb));
INDIRECT_CALLABLE_DECLARE(int tcp6_gro_complete(struct sk_buff *skb, int thoff));
INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp6_gro_receive(struct list_head *head, struct sk_buff *skb));
int tcp_gro_complete(struct sk_buff *skb);
void tcp_gro_complete(struct sk_buff *skb);

void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, __be32 daddr);

Expand Down
7 changes: 3 additions & 4 deletions net/ipv4/tcp_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb)
return pp;
}

int tcp_gro_complete(struct sk_buff *skb)
void tcp_gro_complete(struct sk_buff *skb)
{
struct tcphdr *th = tcp_hdr(skb);

Expand All @@ -311,8 +311,6 @@ int tcp_gro_complete(struct sk_buff *skb)

if (skb->encapsulation)
skb->inner_transport_header = skb->transport_header;

return 0;
}
EXPORT_SYMBOL(tcp_gro_complete);

Expand Down Expand Up @@ -342,7 +340,8 @@ INDIRECT_CALLABLE_SCOPE int tcp4_gro_complete(struct sk_buff *skb, int thoff)
if (NAPI_GRO_CB(skb)->is_atomic)
skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_FIXEDID;

return tcp_gro_complete(skb);
tcp_gro_complete(skb);
return 0;
}

static const struct net_offload tcpv4_offload = {
Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/tcpv6_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff)
&iph->daddr, 0);
skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV6;

return tcp_gro_complete(skb);
tcp_gro_complete(skb);
return 0;
}

static struct sk_buff *tcp6_gso_segment(struct sk_buff *skb,
Expand Down

0 comments on commit b1f2abc

Please sign in to comment.