struct tun_file *tfile,
struct iov_iter *from,
struct virtio_net_hdr *hdr,
- int len, int *generic_xdp)
+ int len, int *skb_xdp)
{
struct page_frag *alloc_frag = ¤t->task_frag;
struct sk_buff *skb;
* we do XDP on skb in case the headroom is not enough.
*/
if (hdr->gso_type || !xdp_prog)
- *generic_xdp = 1;
+ *skb_xdp = 1;
else
- *generic_xdp = 0;
+ *skb_xdp = 0;
rcu_read_lock();
xdp_prog = rcu_dereference(tun->xdp_prog);
- if (xdp_prog && !*generic_xdp) {
+ if (xdp_prog && !*skb_xdp) {
struct xdp_buff xdp;
void *orig_data;
u32 act;
bool zerocopy = false;
int err;
u32 rxhash;
- int generic_xdp = 1;
+ int skb_xdp = 1;
if (!(tun->dev->flags & IFF_UP))
return -EIO;
}
if (tun_can_build_skb(tun, tfile, len, noblock, zerocopy)) {
- skb = tun_build_skb(tun, tfile, from, &gso, len, &generic_xdp);
+ /* For the packet that is not easy to be processed
+ * (e.g gso or jumbo packet), we will do it at after
+ * skb was created with generic XDP routine.
+ */
+ skb = tun_build_skb(tun, tfile, from, &gso, len, &skb_xdp);
if (IS_ERR(skb)) {
this_cpu_inc(tun->pcpu_stats->rx_dropped);
return PTR_ERR(skb);
skb_reset_network_header(skb);
skb_probe_transport_header(skb, 0);
- if (generic_xdp) {
+ if (skb_xdp) {
struct bpf_prog *xdp_prog;
int ret;