net/sfc: support initialising different Rx queue types
authorIgor Romanov <igor.romanov@oktetlabs.ru>
Fri, 2 Jul 2021 08:39:38 +0000 (11:39 +0300)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 20 Jul 2021 10:20:31 +0000 (12:20 +0200)
Add extra EFX flags to RxQ info initialization API to support
choosing different RxQ types and make the API public to use
it in for counter queues.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/net/sfc/sfc_rx.c
drivers/net/sfc/sfc_rx.h

index 597785a..c7a7bd6 100644 (file)
@@ -1155,7 +1155,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index,
        else
                rxq_info->type = EFX_RXQ_TYPE_DEFAULT;
 
        else
                rxq_info->type = EFX_RXQ_TYPE_DEFAULT;
 
-       rxq_info->type_flags =
+       rxq_info->type_flags |=
                (offloads & DEV_RX_OFFLOAD_SCATTER) ?
                EFX_RXQ_FLAG_SCATTER : EFX_RXQ_FLAG_NONE;
 
                (offloads & DEV_RX_OFFLOAD_SCATTER) ?
                EFX_RXQ_FLAG_SCATTER : EFX_RXQ_FLAG_NONE;
 
@@ -1594,8 +1594,9 @@ sfc_rx_stop(struct sfc_adapter *sa)
        efx_rx_fini(sa->nic);
 }
 
        efx_rx_fini(sa->nic);
 }
 
-static int
-sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index)
+int
+sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index,
+                 unsigned int extra_efx_type_flags)
 {
        struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
        struct sfc_rxq_info *rxq_info = &sas->rxq_info[sw_index];
 {
        struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
        struct sfc_rxq_info *rxq_info = &sas->rxq_info[sw_index];
@@ -1606,6 +1607,7 @@ sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index)
        SFC_ASSERT(rte_is_power_of_2(max_entries));
 
        rxq_info->max_entries = max_entries;
        SFC_ASSERT(rte_is_power_of_2(max_entries));
 
        rxq_info->max_entries = max_entries;
+       rxq_info->type_flags = extra_efx_type_flags;
 
        return 0;
 }
 
        return 0;
 }
@@ -1770,7 +1772,7 @@ sfc_rx_configure(struct sfc_adapter *sa)
 
                sw_index = sfc_rxq_sw_index_by_ethdev_rx_qid(sas,
                                                        sas->ethdev_rxq_count);
 
                sw_index = sfc_rxq_sw_index_by_ethdev_rx_qid(sas,
                                                        sas->ethdev_rxq_count);
-               rc = sfc_rx_qinit_info(sa, sw_index);
+               rc = sfc_rx_qinit_info(sa, sw_index, 0);
                if (rc != 0)
                        goto fail_rx_qinit_info;
 
                if (rc != 0)
                        goto fail_rx_qinit_info;
 
index 96c7dc4..e5a6fde 100644 (file)
@@ -129,6 +129,8 @@ void sfc_rx_close(struct sfc_adapter *sa);
 int sfc_rx_start(struct sfc_adapter *sa);
 void sfc_rx_stop(struct sfc_adapter *sa);
 
 int sfc_rx_start(struct sfc_adapter *sa);
 void sfc_rx_stop(struct sfc_adapter *sa);
 
+int sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index,
+                     unsigned int extra_efx_type_flags);
 int sfc_rx_qinit(struct sfc_adapter *sa, unsigned int rx_queue_id,
                 uint16_t nb_rx_desc, unsigned int socket_id,
                 const struct rte_eth_rxconf *rx_conf,
 int sfc_rx_qinit(struct sfc_adapter *sa, unsigned int rx_queue_id,
                 uint16_t nb_rx_desc, unsigned int socket_id,
                 const struct rte_eth_rxconf *rx_conf,