> From: Fijalkowski, Maciej <maciej.fijalkowski@xxxxxxxxx> > Sent: Thursday, February 16, 2023 5:37 PM [...] > > > > + xdp_res = i40e_run_xdp(rx_ring, xdp, xdp_prog); > > > > + > > > > if (xdp_res) { > > > > - if (xdp_res & (I40E_XDP_TX | I40E_XDP_REDIR)) { > > > > - xdp_xmit |= xdp_res; > > > > + xdp_xmit |= xdp_res & (I40E_XDP_TX | > > > I40E_XDP_REDIR); > > > > > > what was wrong with having above included in the > > > > > > } else if (xdp_res & (I40E_XDP_TX | I40E_XDP_REDIR)) { > > > > > > branch? > > > > > > > For multi-buffer packets, only the first 'if' branch will be executed. We > need to set > > xdp_xmit for both single and multi-buffer packets. > > maybe pass xdp_xmit to i40e_process_rx_buffs and use it for buf_flip > initialization? also you trimmed the code, but in there please don't > define on-stack variables smaller than u32 (u16 next) > xdp_xmit may have been set by the xdp_res of a preceding packet in the current napi call. We want to consume or flip the buffer based on only the xdp_res of current packet. ACK for u16 -> u32.