virtio_net.c (56a86f84b8332afe8c6fcb4b09d09d9bf094e2db) | virtio_net.c (1830f8935f3b173d229b86e9927b3b6d599aa1f6) |
---|---|
1/* A network driver using virtio. 2 * 3 * Copyright 2007 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 564 unchanged lines hidden (view full) --- 573 * was not able to create this condition. 574 */ 575 if (unlikely(hdr->hdr.gso_type || hdr->hdr.flags)) 576 goto err_xdp; 577 578 act = do_xdp_prog(vi, rq, xdp_prog, xdp_page, offset, len); 579 switch (act) { 580 case XDP_PASS: | 1/* A network driver using virtio. 2 * 3 * Copyright 2007 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 564 unchanged lines hidden (view full) --- 573 * was not able to create this condition. 574 */ 575 if (unlikely(hdr->hdr.gso_type || hdr->hdr.flags)) 576 goto err_xdp; 577 578 act = do_xdp_prog(vi, rq, xdp_prog, xdp_page, offset, len); 579 switch (act) { 580 case XDP_PASS: |
581 if (unlikely(xdp_page != page)) 582 __free_pages(xdp_page, 0); | 581 /* We can only create skb based on xdp_page. */ 582 if (unlikely(xdp_page != page)) { 583 rcu_read_unlock(); 584 put_page(page); 585 head_skb = page_to_skb(vi, rq, xdp_page, 586 0, len, PAGE_SIZE); 587 return head_skb; 588 } |
583 break; 584 case XDP_TX: 585 if (unlikely(xdp_page != page)) 586 goto err_xdp; 587 rcu_read_unlock(); 588 goto xdp_xmit; 589 case XDP_DROP: 590 default: --- 1896 unchanged lines hidden --- | 589 break; 590 case XDP_TX: 591 if (unlikely(xdp_page != page)) 592 goto err_xdp; 593 rcu_read_unlock(); 594 goto xdp_xmit; 595 case XDP_DROP: 596 default: --- 1896 unchanged lines hidden --- |