Commit dce79e3
libbpf: fix compatibility problem in xsk_socket__create
Fix a compatibility problem when the old XDP_SHARED_UMEM mode is used together with the xsk_socket__create() call. In the old XDP_SHARED_UMEM mode, only sharing of the same device and queue id was allowed, and in this mode, the fill ring and completion ring were shared between the AF_XDP sockets. Therfore, it was perfectly fine to call the xsk_socket__create() API for each socket and not use the new xsk_socket__create_shared() API. This behaviour was ruined by the commit introducing XDP_SHARED_UMEM support between different devices and/or queue ids. This patch restores the ability to use xsk_socket__create in these circumstances so that backward compatibility is not broken. We also make sure that a user that uses the xsk_socket__create_shared() api for the first socket in the old XDP_SHARED_UMEM mode above, gets and error message if the user tries to feed a fill ring or a completion ring that is not the same as the ones used for the umem registration. Previously, libbpf would just have silently ignored the supplied fill and completion rings and just taken them from the umem. Better to provide an error to the user. Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com> Fixes: 2f6324a ("libbpf: Support shared umems between queues and devices")1 parent 052041a commit dce79e3
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | | - | |
| 708 | + | |
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
738 | 743 | | |
739 | 744 | | |
740 | 745 | | |
741 | 746 | | |
742 | 747 | | |
743 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
744 | 756 | | |
745 | 757 | | |
746 | 758 | | |
| |||
0 commit comments