udp: pass udp_offload struct to UDP gro callbacks
This patch introduces udp_offload_callbacks which has the same GRO functions (but not a GSO function) as offload_callbacks, except there is an argument to a udp_offload struct passed to gro_receive and gro_complete functions. This additional argument can be used to retrieve the per port structure of the encapsulation for use in gro processing (mostly by doing container_of on the structure). Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
d823ab68fb
commit
a2b12f3c7a
@@ -339,7 +339,8 @@ unflush:
|
||||
skb_gro_pull(skb, sizeof(struct udphdr)); /* pull encapsulating udp header */
|
||||
skb_gro_postpull_rcsum(skb, uh, sizeof(struct udphdr));
|
||||
NAPI_GRO_CB(skb)->proto = uo_priv->offload->ipproto;
|
||||
pp = uo_priv->offload->callbacks.gro_receive(head, skb);
|
||||
pp = uo_priv->offload->callbacks.gro_receive(head, skb,
|
||||
uo_priv->offload);
|
||||
|
||||
out_unlock:
|
||||
rcu_read_unlock();
|
||||
@@ -395,7 +396,9 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff)
|
||||
|
||||
if (uo_priv != NULL) {
|
||||
NAPI_GRO_CB(skb)->proto = uo_priv->offload->ipproto;
|
||||
err = uo_priv->offload->callbacks.gro_complete(skb, nhoff + sizeof(struct udphdr));
|
||||
err = uo_priv->offload->callbacks.gro_complete(skb,
|
||||
nhoff + sizeof(struct udphdr),
|
||||
uo_priv->offload);
|
||||
}
|
||||
|
||||
rcu_read_unlock();
|
||||
|
Reference in New Issue
Block a user