Commit 2bf8a5d
xsk: remove @first_frag from xsk_build_skb()
Devices that set IFF_TX_SKB_NO_LINEAR will not execute branch that
handles metadata, as we set @first_frag only for !IFF_TX_SKB_NO_LINEAR
code in xsk_build_skb().
Same functionality can be achieved with checking if xsk_get_num_desc()
returns 0. To replace current usage of @first_frag with
XSKCB(skb)->num_descs check, pull out the code from
xsk_set_destructor_arg() that initializes sk_buff::cb and call it before
skb_store_bits() in branch that creates skb against first processed
frag. This so error path has the XSKCB(skb)->num_descs initialized and
can free skb in case skb_store_bits() failed.
Signed-off-by: Maciej Fijalkowski <[email protected]>1 parent a7e5b88 commit 2bf8a5d
1 file changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
608 | 615 | | |
609 | 616 | | |
610 | 617 | | |
| |||
620 | 627 | | |
621 | 628 | | |
622 | 629 | | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | 630 | | |
627 | 631 | | |
628 | 632 | | |
| |||
672 | 676 | | |
673 | 677 | | |
674 | 678 | | |
675 | | - | |
| 679 | + | |
676 | 680 | | |
677 | 681 | | |
678 | 682 | | |
| |||
725 | 729 | | |
726 | 730 | | |
727 | 731 | | |
728 | | - | |
729 | 732 | | |
730 | 733 | | |
731 | 734 | | |
| |||
742 | 745 | | |
743 | 746 | | |
744 | 747 | | |
745 | | - | |
746 | | - | |
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
| |||
752 | 753 | | |
753 | 754 | | |
754 | 755 | | |
| 756 | + | |
755 | 757 | | |
756 | 758 | | |
757 | 759 | | |
| |||
797 | 799 | | |
798 | 800 | | |
799 | 801 | | |
800 | | - | |
| 802 | + | |
801 | 803 | | |
802 | 804 | | |
803 | 805 | | |
| |||
839 | 841 | | |
840 | 842 | | |
841 | 843 | | |
842 | | - | |
| 844 | + | |
843 | 845 | | |
844 | 846 | | |
845 | 847 | | |
| |||
0 commit comments