From: Saeed Mahameed <saeed@kernel.org>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com,
Bartosz Staszewski <bartoszx.staszewski@intel.com>,
netdev@vger.kernel.org, maciej.fijalkowski@intel.com,
magnus.karlsson@intel.com, bjorn@kernel.org, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
bpf@vger.kernel.org,
Mateusz Palczewski <mateusz.palczewski@intel.com>,
Shwetha Nagaraju <Shwetha.nagaraju@intel.com>
Subject: Re: [PATCH net v3 1/1] i40e: Fix the inability to attach XDP program on downed interface
Date: Fri, 9 Dec 2022 11:07:02 -0800 [thread overview]
Message-ID: <Y5OHVnaGZckyhaSC@x130> (raw)
In-Reply-To: <20221209185411.2519898-1-anthony.l.nguyen@intel.com>
On 09 Dec 10:54, Tony Nguyen wrote:
>From: Bartosz Staszewski <bartoszx.staszewski@intel.com>
>
>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: 613142b0bb88 ("i40e: Log error for oversized MTU on device")
>Fixes: 0c8493d90b6b ("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>
>---
>v3:
>- Remove unnecessary braces and parentheses
>- Simplify return in i40e_calculate_vsi_rx_buf_len(); return early on
>if conditions and remove elses
>
Reviewed-by: Saeed Mahameed <saeed@kernel.com>
next prev parent reply other threads:[~2022-12-09 19:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 18:54 [PATCH net v3 1/1] i40e: Fix the inability to attach XDP program on downed interface Tony Nguyen
2022-12-09 19:07 ` Saeed Mahameed [this message]
2022-12-12 23:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5OHVnaGZckyhaSC@x130 \
--to=saeed@kernel.org \
--cc=Shwetha.nagaraju@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bartoszx.staszewski@intel.com \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=mateusz.palczewski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).