net: ena: Don't register memory info on XDP exchange
[ Upstream commit 9c9e539956fa67efb8a65e32b72a853740b33445 ]
Since the queues aren't destroyed when we only exchange XDP programs,
there's no need to re-register them again.
Fixes: 548c4940b9 ("net: ena: Implement XDP_TX action")
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: David Arinzon <darinzon@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a4aa727ad0
commit
f17d9aec07
@@ -516,16 +516,18 @@ static void ena_xdp_exchange_program_rx_in_range(struct ena_adapter *adapter,
|
||||
struct bpf_prog *prog,
|
||||
int first, int count)
|
||||
{
|
||||
struct bpf_prog *old_bpf_prog;
|
||||
struct ena_ring *rx_ring;
|
||||
int i = 0;
|
||||
|
||||
for (i = first; i < count; i++) {
|
||||
rx_ring = &adapter->rx_ring[i];
|
||||
xchg(&rx_ring->xdp_bpf_prog, prog);
|
||||
if (prog) {
|
||||
old_bpf_prog = xchg(&rx_ring->xdp_bpf_prog, prog);
|
||||
|
||||
if (!old_bpf_prog && prog) {
|
||||
ena_xdp_register_rxq_info(rx_ring);
|
||||
rx_ring->rx_headroom = XDP_PACKET_HEADROOM;
|
||||
} else {
|
||||
} else if (old_bpf_prog && !prog) {
|
||||
ena_xdp_unregister_rxq_info(rx_ring);
|
||||
rx_ring->rx_headroom = NET_SKB_PAD;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user