-
Notifications
You must be signed in to change notification settings - Fork 11
[bug] i40e 2.26.8 XDP_REDIRECT is not available with Linux 6.5 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When bpf_redirect_map is used for redirection in the XDP, the backend does not receive the packet. After analysis, it is found that dev->xdp_features does not set the NETDEV_XDP_ACT_NDO_XMIT flag, causing the packet to be discarded And NETDEV_XDP_ACT_NDO_XMIT is set by calling xdp_features_set_redirect_target when binding XDP program to dev device. HAVE_AF_XDP_ZC_SUPPORT is not defined when compiling on the Linux 6.5 platform, resulting in xdp_features_set_redirect_target not being called. In fact, there is no relationship between the two. Therefore, xdp_features_set_redirect_target is placed outside indef HAVE_AF_XDP_ZC_SUPPORT Signed-off-by: Qingzhi Yang <[email protected]>
|
Good day @Kubiak, ***@***.***>
Can you find someone from XDP team to review?
Thank you
Alex
From: imcom ***@***.***>
Sent: Thursday, September 26, 2024 4:07 AM
To: intel/ethernet-linux-i40e ***@***.***>
Cc: Loktionov, Aleksandr ***@***.***>; Mention ***@***.***>
Subject: Re: [intel/ethernet-linux-i40e] [bug] i40e 2.26.8 XDP_REDIRECT is not available with Linux 6.5 (PR #7)
hi @aloktion<https://github.com/aloktion> @rdower<https://github.com/rdower> would you please assign this PR to someone for review. This is a blocking issue on our platform. We need to run XDP with Linux kernel 6.5 and i40e driver. Thanks!
—
Reply to this email directly, view it on GitHub<#7 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATTGNVYQPF6D6F6IQMGWVE3ZYNT45AVCNFSM6AAAAABO247MJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZVGYYDKOJWGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
hey @aloktion - can you help clarify Intel's position on open source contributions to both i40e and as well as the other github/intel/ethernet-linux* repositories? It looks like from the commit log into this repo that this is not the canonical repo for this driver (or all of the other drivers), but rather a mirror of an Intel internal source control. That's fine, but it would be good for the community to understand if issues and pull requests are going to be handled on the repository, or not. |
|
Good day Jon I'm TL of igb, ixgbe, ixgbevf and i40e linux base drivers, for acceleration technologies for example XDP, RDMA there are different teams. |
|
Great, thank you for responding quickly. To clarify, does that mean Intel will be accepting GitHub PRs and GitHub issues? or should that be driven exclusively by Intel alone? Thats fine if that's the case, I just want to make sure the expectation is clear. I see the readme says (below) see the project hosted on GitHub, but I'm assuming what the last paragraph means is that support should go through an Intel IPS ticket instead? |
|
Please use IPS |
Ok, if that is the case, I think it would reduce confusion going forward if at least GitHub pull requests were shut off at a repo level for all of Intel's ethernet repos, as otherwise it leaves open for confusion that Intel will accept pull requests. Having GitHub issues open would probably still be nice though, as that would allow the community to at least point out issues, where community members may not have access to IPS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution is correct. The call of xdp_features_set_redirect_target() is independent on zero-copy support.
Please also move the comment Kick start the NAPI context... before the for loop because the comment is also specific just to the AF_XDP_ZC.
#ifdef HAVE_AF_XDP_ZC_SUPPORT
/* Kick start the NAPI context if there is an AF_XDP socket open
* on that queue id. This so that receiving will start.
*/
for (i = 0; i < vsi->num_queue_pairs; i++)
Please re-format the commit message to preserve the kernel standards for line lenght.
Also, I would say that the following statement is not entirely true:
HAVE_AF_XDP_ZC_SUPPORT is not defined when compiling on the Linux 6.5 platform
because according to our kcompat we support AF_XDP_ZC for all mainline kernels from their 4.20.0 version. As far as I know, the support for XDP sockets may be disabled using the kernel config variable, so maybe this is your case for 6.5?
So, I would suggest to edit that sentence to be more precise.
Anyway, as I stated on the beginning, I agree that xdp_features_set_redirect_target() should not be dependent on AF_XDP_ZC support.
Thanks,
Michal
| /* Kick start the NAPI context if there is an AF_XDP socket open | ||
| * on that queue id. This so that receiving will start. | ||
| */ | ||
| if (need_reset && prog) { | ||
| #ifdef HAVE_AF_XDP_ZC_SUPPORT | ||
| for (i = 0; i < vsi->num_queue_pairs; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /* Kick start the NAPI context if there is an AF_XDP socket open | |
| * on that queue id. This so that receiving will start. | |
| */ | |
| if (need_reset && prog) { | |
| #ifdef HAVE_AF_XDP_ZC_SUPPORT | |
| for (i = 0; i < vsi->num_queue_pairs; i++) | |
| if (need_reset && prog) { | |
| #ifdef HAVE_AF_XDP_ZC_SUPPORT | |
| /* Kick start the NAPI context if there is an AF_XDP socket open | |
| * on that queue id. This so that receiving will start. | |
| */ | |
| for (i = 0; i < vsi->num_queue_pairs; i++) |
…ifdef This fixes XDP redirect functionality by ensuring xdp_features_set_redirect_target() is called for all XDP programs, not just AF_XDP zero-copy programs. The bug prevented bpf_redirect_map() from working correctly because the kernel requires NETDEV_XDP_ACT_NDO_XMIT flag to be set for XDP redirect to function. Fixes CPU isolation issues where XDP redirect returns -ENXIO (error -6). See: intel#7
When bpf_redirect_map is used for redirection in the XDP, the backend does not receive the packet.
After analysis, it is found that dev->xdp_features does not set the NETDEV_XDP_ACT_NDO_XMIT flag, causing the packet to be discarded.
And NETDEV_XDP_ACT_NDO_XMIT is set by calling xdp_features_set_redirect_target when binding XDP program to dev device. HAVE_AF_XDP_ZC_SUPPORT is not defined when compiling on the Linux 6.5 platform, resulting in xdp_features_set_redirect_target not being called.
In fact, there is no relationship between the two.
Therefore, xdp_features_set_redirect_target is placed outside indef HAVE_AF_XDP_ZC_SUPPORT.
Signed-off-by: Qingzhi Yang [email protected]