Skip to content
Commit 0c87b545 authored by Bartosz Staszewski's avatar Bartosz Staszewski Committed by Jakub Kicinski
Browse files

i40e: Fix the inability to attach XDP program on downed interface

Whenever trying to load XDP prog on downed interface, function i40e_xdp
was passing vsi->rx_buf_len field to i40e_xdp_setup() which was equal 0.
i40e_open() calls i40e_vsi_configure_rx() which configures that field,
but that only happens when interface is up. When it is down, i40e_open()
is not being called, thus vsi->rx_buf_len is not set.

Solution for this is calculate buffer length in newly created
function - i40e_calculate_vsi_rx_buf_len() that return actual buffer
length. Buffer length is being calculated based on the same rules
applied previously in i40e_vsi_configure_rx() function.

Fixes: 613142b0 ("i40e: Log error for oversized MTU on device")
Fixes: 0c8493d9

 ("i40e: add XDP support for pass and drop actions")
Signed-off-by: default avatarBartosz Staszewski <bartoszx.staszewski@intel.com>
Signed-off-by: default avatarMateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: default avatarShwetha Nagaraju <Shwetha.nagaraju@intel.com>
Reviewed-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: default avatarSaeed Mahameed <saeed@kernel.com>
Link: https://lore.kernel.org/r/20221209185411.2519898-1-anthony.l.nguyen@intel.com
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ede5a389
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment