Skip to content
  • Íñigo Huguet's avatar
    4f2ba958
    net: sfc: fix using uninitialized xdp tx_queue · 4f2ba958
    Íñigo Huguet authored
    Bugzilla: https://bugzilla.redhat.com/2042841
    
    
    
    commit fb5833d81e4333294add35d3ac7f7f52a7bf107f
    Author: Taehee Yoo <ap420073@gmail.com>
    Date:   Tue Apr 5 08:45:44 2022 +0000
    
        net: sfc: fix using uninitialized xdp tx_queue
        
        In some cases, xdp tx_queue can get used before initialization.
        1. interface up/down
        2. ring buffer size change
        
        When CPU cores are lower than maximum number of channels of sfc driver,
        it creates new channels only for XDP.
        
        When an interface is up or ring buffer size is changed, all channels
        are initialized.
        But xdp channels are always initialized later.
        So, the below scenario is possible.
        Packets are received to rx queue of normal channels and it is acted
        XDP_TX and tx_queue of xdp channels get used.
        But these tx_queues are not initialized yet.
        If so, TX DMA or queue error occurs.
        
        In order to avoid this problem.
        1. initializes xdp tx_queues earlier than other rx_queue in
        efx_start_channels().
        2. checks whether tx_queue is initialized or not in efx_xdp_tx_buffers().
        
        Splat looks like:
           sfc 0000:08:00.1 enp8s0f1np1: TX queue 10 spurious TX completion id 250
           sfc 0000:08:00.1 enp8s0f1np1: resetting (RECOVER_OR_ALL)
           sfc 0000:08:00.1 enp8s0f1np1: MC command 0x80 inlen 100 failed rc=-22
           (raw=22) arg=789
           sfc 0000:08:00.1 enp8s0f1np1: has been disabled
        
        Fixes: f28100cb ("sfc: fix lack of XDP TX queues - error XDP TX failed (-22)")
    Acked-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
    Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    
    Signed-off-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
    4f2ba958
    net: sfc: fix using uninitialized xdp tx_queue
    Íñigo Huguet authored
    Bugzilla: https://bugzilla.redhat.com/2042841
    
    
    
    commit fb5833d81e4333294add35d3ac7f7f52a7bf107f
    Author: Taehee Yoo <ap420073@gmail.com>
    Date:   Tue Apr 5 08:45:44 2022 +0000
    
        net: sfc: fix using uninitialized xdp tx_queue
        
        In some cases, xdp tx_queue can get used before initialization.
        1. interface up/down
        2. ring buffer size change
        
        When CPU cores are lower than maximum number of channels of sfc driver,
        it creates new channels only for XDP.
        
        When an interface is up or ring buffer size is changed, all channels
        are initialized.
        But xdp channels are always initialized later.
        So, the below scenario is possible.
        Packets are received to rx queue of normal channels and it is acted
        XDP_TX and tx_queue of xdp channels get used.
        But these tx_queues are not initialized yet.
        If so, TX DMA or queue error occurs.
        
        In order to avoid this problem.
        1. initializes xdp tx_queues earlier than other rx_queue in
        efx_start_channels().
        2. checks whether tx_queue is initialized or not in efx_xdp_tx_buffers().
        
        Splat looks like:
           sfc 0000:08:00.1 enp8s0f1np1: TX queue 10 spurious TX completion id 250
           sfc 0000:08:00.1 enp8s0f1np1: resetting (RECOVER_OR_ALL)
           sfc 0000:08:00.1 enp8s0f1np1: MC command 0x80 inlen 100 failed rc=-22
           (raw=22) arg=789
           sfc 0000:08:00.1 enp8s0f1np1: has been disabled
        
        Fixes: f28100cb ("sfc: fix lack of XDP TX queues - error XDP TX failed (-22)")
    Acked-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
    Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    
    Signed-off-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
Loading