diff mbox series

答复: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called for redirected xsk copy mode

Message ID 3a12136e75a04b98b736c14da4044506@baidu.com
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series 答复: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called for redirected xsk copy mode | expand

Commit Message

Li RongQing July 6, 2020, 6:38 a.m. UTC
> -----邮件原件-----
> 发件人: Magnus Karlsson [mailto:magnus.karlsson@gmail.com]
> 发送时间: 2020年7月6日 14:13
> 收件人: Li,Rongqing <lirongqing@baidu.com>
> 抄送: intel-wired-lan <intel-wired-lan@lists.osuosl.org>; Björn Töpel
> <bjorn.topel@intel.com>; Karlsson, Magnus <magnus.karlsson@intel.com>;
> Netdev <netdev@vger.kernel.org>
> 主题: Re: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called for
> redirected xsk copy mode
> 
> Thank you RongQing for reporting this. I will take a look at it and produce a
> patch.
> 
> /Magnus

Thanks, and ixgbevf/ixgbe have same issue.

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

I have a RFC, it maybe not better due to adding a new variable 
http://patchwork.ozlabs.org/project/netdev/patch/1593763926-24292-1-git-send-email-lirongqing@baidu.com/

or check memory type

Whether,  like to see your patch

-Li RongQing
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index b3836092c327..f41664e0c84e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2394,7 +2394,9 @@  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)
+                                       i40e_rx_buffer_flip(rx_ring, rx_buffer, size);
                        } else {
                                rx_buffer->pagecnt_bias++;
                        }