Commit f2e3190
tsnep: Fix mapping for zero copy XDP_TX action
[ Upstream commit d7f5fb3 ]
For XDP_TX action xdp_buff is converted to xdp_frame. The conversion is
done by xdp_convert_buff_to_frame(). The memory type of the resulting
xdp_frame depends on the memory type of the xdp_buff. For page pool
based xdp_buff it produces xdp_frame with memory type
MEM_TYPE_PAGE_POOL. For zero copy XSK pool based xdp_buff it produces
xdp_frame with memory type MEM_TYPE_PAGE_ORDER0.
tsnep_xdp_xmit_back() is not prepared for that and uses always the page
pool buffer type TSNEP_TX_TYPE_XDP_TX. This leads to invalid mappings
and the transmission of undefined data.
Improve tsnep_xdp_xmit_back() to use the generic buffer type
TSNEP_TX_TYPE_XDP_NDO for zero copy XDP_TX.
Fixes: 3fc2333 ("tsnep: Add XDP socket zero-copy RX support")
Signed-off-by: Gerhard Engleder <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent 3689096 commit f2e3190
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
722 | | - | |
| 722 | + | |
| 723 | + | |
723 | 724 | | |
724 | 725 | | |
725 | 726 | | |
| 727 | + | |
726 | 728 | | |
727 | 729 | | |
728 | 730 | | |
729 | 731 | | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
730 | 738 | | |
731 | 739 | | |
732 | | - | |
| 740 | + | |
733 | 741 | | |
734 | 742 | | |
735 | 743 | | |
| |||
1273 | 1281 | | |
1274 | 1282 | | |
1275 | 1283 | | |
1276 | | - | |
| 1284 | + | |
1277 | 1285 | | |
1278 | 1286 | | |
1279 | 1287 | | |
| |||
1323 | 1331 | | |
1324 | 1332 | | |
1325 | 1333 | | |
1326 | | - | |
| 1334 | + | |
1327 | 1335 | | |
1328 | 1336 | | |
1329 | 1337 | | |
| |||
0 commit comments