[Bug,1145] net/ice fdir flow create/destroy failed with RTE_LIBRTE_ICE_16BYTE_RX_DESC defined

Message ID bug-1145-3@http.bugs.dpdk.org/ (mailing list archive)
State Not Applicable, archived
Delegated to: Qi Zhang
Headers
Series [Bug,1145] net/ice fdir flow create/destroy failed with RTE_LIBRTE_ICE_16BYTE_RX_DESC defined |

Checks

Context Check Description
ci/github-robot: build success github build: passed

Commit Message

bugzilla@dpdk.org Dec. 9, 2022, 2:04 a.m. UTC
  https://bugs.dpdk.org/show_bug.cgi?id=1145

            Bug ID: 1145
           Summary: net/ice fdir flow create/destroy failed with
                    RTE_LIBRTE_ICE_16BYTE_RX_DESC defined
           Product: DPDK
           Version: 21.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: major
          Priority: Normal
         Component: ethdev
          Assignee: dev@dpdk.org
          Reporter: hanshuang87@gmail.com
  Target Milestone: ---

Fdir rx queue use the same ice_rx_queue struct as packet rx queue.
When RTE_LIBRTE_ICE_16BYTE_RX_DESC defined rxq->rx_ring type is
ice_16b_rx_flex_desc.

#ifdef RTE_LIBRTE_ICE_16BYTE_RX_DESC
#define ice_rx_flex_desc ice_16b_rx_flex_desc
#else
#define ice_rx_flex_desc ice_32b_rx_flex_desc
#endif

But ice_check_fdir_programming_status check the rxdp assuming that rx_ring type
is ice_32byte_rx_desc.

rxdp = (volatile union ice_32byte_rx_desc *)(&rxq->rx_ring[rxq->rx_tail]);

I think this patch will fix the bug, but not the best solution:
  

Patch

--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -4481,9 +4481,10 @@ 
        uint32_t error;
        uint32_t id;
        int ret = -EAGAIN;
+       volatile union ice_32byte_rx_desc *rx_ring = rxq->rx_ring;

        rxdp = (volatile union ice_32byte_rx_desc *)
-               (&rxq->rx_ring[rxq->rx_tail]);
+               (&rx_ring[rxq->rx_tail]);
        qword1 = rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len);
        rx_status = (qword1 & ICE_RXD_QW1_STATUS_M)
                        >> ICE_RXD_QW1_STATUS_S;