Commit 0c87b54
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: 613142b ("i40e: Log error for oversized MTU on device")
Fixes: 0c8493d ("i40e: add XDP support for pass and drop actions")
Signed-off-by: Bartosz Staszewski <bartoszx.staszewski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Shwetha Nagaraju <Shwetha.nagaraju@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Saeed Mahameed <saeed@kernel.com>
Link: https://lore.kernel.org/r/20221209185411.2519898-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent ede5a38 commit 0c87b54
1 file changed
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3693 | 3693 | | |
3694 | 3694 | | |
3695 | 3695 | | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
3696 | 3714 | | |
3697 | 3715 | | |
3698 | 3716 | | |
| |||
3704 | 3722 | | |
3705 | 3723 | | |
3706 | 3724 | | |
3707 | | - | |
3708 | | - | |
3709 | | - | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
3710 | 3728 | | |
3711 | | - | |
3712 | | - | |
| 3729 | + | |
| 3730 | + | |
3713 | 3731 | | |
3714 | | - | |
3715 | 3732 | | |
3716 | | - | |
3717 | | - | |
3718 | | - | |
3719 | | - | |
3720 | | - | |
3721 | 3733 | | |
3722 | 3734 | | |
3723 | 3735 | | |
| |||
13282 | 13294 | | |
13283 | 13295 | | |
13284 | 13296 | | |
13285 | | - | |
| 13297 | + | |
13286 | 13298 | | |
13287 | 13299 | | |
13288 | 13300 | | |
| |||
0 commit comments