net: Remove gso_send_check as an offload callback
The send_check logic was only interesting in cases of TCP offload and UDP UFO where the checksum needed to be initialized to the pseudo header checksum. Now we've moved that logic into the related gso_segment functions so gso_send_check is no longer needed. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f71470b37e
commit
53e5039896
10 changed files with 3 additions and 113 deletions
|
@ -1197,40 +1197,6 @@ int inet_sk_rebuild_header(struct sock *sk)
|
|||
}
|
||||
EXPORT_SYMBOL(inet_sk_rebuild_header);
|
||||
|
||||
static int inet_gso_send_check(struct sk_buff *skb)
|
||||
{
|
||||
const struct net_offload *ops;
|
||||
const struct iphdr *iph;
|
||||
int proto;
|
||||
int ihl;
|
||||
int err = -EINVAL;
|
||||
|
||||
if (unlikely(!pskb_may_pull(skb, sizeof(*iph))))
|
||||
goto out;
|
||||
|
||||
iph = ip_hdr(skb);
|
||||
ihl = iph->ihl * 4;
|
||||
if (ihl < sizeof(*iph))
|
||||
goto out;
|
||||
|
||||
proto = iph->protocol;
|
||||
|
||||
/* Warning: after this point, iph might be no longer valid */
|
||||
if (unlikely(!pskb_may_pull(skb, ihl)))
|
||||
goto out;
|
||||
__skb_pull(skb, ihl);
|
||||
|
||||
skb_reset_transport_header(skb);
|
||||
err = -EPROTONOSUPPORT;
|
||||
|
||||
ops = rcu_dereference(inet_offloads[proto]);
|
||||
if (likely(ops && ops->callbacks.gso_send_check))
|
||||
err = ops->callbacks.gso_send_check(skb);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct sk_buff *inet_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features)
|
||||
{
|
||||
|
@ -1655,7 +1621,6 @@ static int ipv4_proc_init(void);
|
|||
static struct packet_offload ip_packet_offload __read_mostly = {
|
||||
.type = cpu_to_be16(ETH_P_IP),
|
||||
.callbacks = {
|
||||
.gso_send_check = inet_gso_send_check,
|
||||
.gso_segment = inet_gso_segment,
|
||||
.gro_receive = inet_gro_receive,
|
||||
.gro_complete = inet_gro_complete,
|
||||
|
@ -1664,7 +1629,6 @@ static struct packet_offload ip_packet_offload __read_mostly = {
|
|||
|
||||
static const struct net_offload ipip_offload = {
|
||||
.callbacks = {
|
||||
.gso_send_check = inet_gso_send_check,
|
||||
.gso_segment = inet_gso_segment,
|
||||
.gro_receive = inet_gro_receive,
|
||||
.gro_complete = inet_gro_complete,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue