@@ -2394,7 +2394,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
if (xdp_res & (I40E_XDP_TX | I40E_XDP_REDIR)) {
xdp_xmit |= xdp_res;
- i40e_rx_buffer_flip(rx_ring, rx_buffer, size);
+
+ if (xdp.rxq->mem.type == MEM_TYPE_XSK_BUFF_POOL ||
+ xdp_get_map_type() != BPF_MAP_TYPE_XSKMAP)
+ i40e_rx_buffer_flip(rx_ring, rx_buffer, size);
} else {
rx_buffer->pagecnt_bias++;
}
@@ -919,6 +919,17 @@ static inline void xdp_clear_return_frame_no_direct(void)
ri->kern_flags &= ~BPF_RI_F_RF_NO_DIRECT;
}
+static enum bpf_map_type xdp_get_map_type(void)
+{
+ struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info);
+ struct bpf_map *map = READ_ONCE(ri->map);
+
+ if (map)
+ return map->map_type;
+ else
+ return BPF_MAP_TYPE_UNSPEC;
+}
+
static inline int xdp_ok_fwd_dev(const struct net_device *fwd,
unsigned int pktlen)