You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
/**
* i40e_xdp_setup - Add/remove an XDP program to a VSI
* @vsi: the VSI to add the program
* @prog: the XDP program
**/
int i40e_xdp_setup(struct i40e_vsi *vsi,
struct bpf_prog *prog)
{
struct i40e_pf *pf = vsi->back;
struct net_device *netdev = vsi->netdev;
int i, frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
bool need_reset;
struct bpf_prog *old_prog;
if (prog && prog->xdp_adjust_head)
return -EOPNOTSUPP;
When dropping packets from XDP, it still counts as rx_receive++, not rx_dropped++
return XDP_DROP
static bool i40e_run_xdp(struct i40e_ring *rx_ring,
struct i40e_rx_buffer *rx_buffer,
union i40e_rx_desc *rx_desc,
unsigned int size,
struct bpf_prog *xdp_prog)
{
...
case XDP_DROP:
do_drop:
if (likely(i40e_page_is_reusable(rx_buffer->page))) {
i40e_reuse_rx_page(rx_ring, rx_buffer);
rx_ring->rx_stats.page_reuse_count++;
break;
}
dma_unmap_page(rx_ring->dev, rx_buffer->dma, PAGE_SIZE,
DMA_FROM_DEVICE);
__free_pages(rx_buffer->page, 0);
break;
default:
bpf_warn_invalid_xdp_action(xdp_action);
goto do_drop;
}
/* clear contents of buffer_info */
rx_buffer->page = NULL;
return true; /* Swallowed by XDP */
return true will add packets stats to txdp_consumed_bytes
static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
{
...
skb = i40e_fetch_rx_buffer(rx_ring, rx_desc, skb,
&xdp_consumed_bytes);
if (xdp_consumed_bytes) {
cleaned_count++;
i40e_update_rx_next_to_clean(rx_ring);
total_rx_bytes += xdp_consumed_bytes;
total_rx_packets++;
The text was updated successfully, but these errors were encountered:
I observed 2 issues.
return XDP_DROP
return true will add packets stats to txdp_consumed_bytes
The text was updated successfully, but these errors were encountered: