LCOV - code coverage report
Current view: top level - drivers/net/gve - gve_ethdev.h (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 2 0.0 %
Date: 2026-06-01 18:36:17 Functions: 0 0 -
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 30 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(C) 2022 Intel Corporation
       3                 :            :  */
       4                 :            : 
       5                 :            : #ifndef _GVE_ETHDEV_H_
       6                 :            : #define _GVE_ETHDEV_H_
       7                 :            : 
       8                 :            : #include <ethdev_driver.h>
       9                 :            : #include <ethdev_pci.h>
      10                 :            : #include <rte_alarm.h>
      11                 :            : #include <rte_ether.h>
      12                 :            : #include <rte_pci.h>
      13                 :            : #include <pthread.h>
      14                 :            : #include <rte_bitmap.h>
      15                 :            : 
      16                 :            : #include "base/gve.h"
      17                 :            : 
      18                 :            : /* TODO: this is a workaround to ensure that Tx complq is enough */
      19                 :            : #define DQO_TX_MULTIPLIER 4
      20                 :            : 
      21                 :            : #define GVE_DEFAULT_MAX_RING_SIZE       1024
      22                 :            : #define GVE_DEFAULT_MIN_RX_RING_SIZE    512
      23                 :            : #define GVE_DEFAULT_MIN_TX_RING_SIZE    256
      24                 :            : 
      25                 :            : #define GVE_DEFAULT_RX_FREE_THRESH      64
      26                 :            : #define GVE_DEFAULT_TX_FREE_THRESH      32
      27                 :            : #define GVE_DEFAULT_TX_RS_THRESH        32
      28                 :            : #define GVE_TX_MAX_FREE_SZ              512
      29                 :            : 
      30                 :            : #define GVE_RX_BUF_ALIGN_DQO            128
      31                 :            : #define GVE_RX_MIN_BUF_SIZE_DQO         1024
      32                 :            : #define GVE_RX_MAX_BUF_SIZE_DQO         ((16 * 1024) - GVE_RX_BUF_ALIGN_DQO)
      33                 :            : #define GVE_MAX_QUEUE_SIZE_DQO          4096
      34                 :            : 
      35                 :            : #define GVE_RX_BUF_ALIGN_GQI            2048
      36                 :            : #define GVE_RX_MIN_BUF_SIZE_GQI         2048
      37                 :            : #define GVE_RX_MAX_BUF_SIZE_GQI         4096
      38                 :            : 
      39                 :            : #define GVE_RSS_HASH_KEY_SIZE 40
      40                 :            : #define GVE_RSS_INDIR_SIZE 128
      41                 :            : 
      42                 :            : #define GVE_TX_CKSUM_OFFLOAD_MASK (             \
      43                 :            :                 RTE_MBUF_F_TX_L4_MASK  |        \
      44                 :            :                 RTE_MBUF_F_TX_TCP_SEG)
      45                 :            : 
      46                 :            : #define GVE_TX_CKSUM_OFFLOAD_MASK_DQO (         \
      47                 :            :                 GVE_TX_CKSUM_OFFLOAD_MASK |     \
      48                 :            :                 RTE_MBUF_F_TX_IP_CKSUM)
      49                 :            : 
      50                 :            : #define GVE_RTE_RSS_OFFLOAD_ALL (       \
      51                 :            :         RTE_ETH_RSS_IPV4 |              \
      52                 :            :         RTE_ETH_RSS_NONFRAG_IPV4_TCP |  \
      53                 :            :         RTE_ETH_RSS_IPV6 |              \
      54                 :            :         RTE_ETH_RSS_IPV6_EX |           \
      55                 :            :         RTE_ETH_RSS_NONFRAG_IPV6_TCP |  \
      56                 :            :         RTE_ETH_RSS_IPV6_TCP_EX |       \
      57                 :            :         RTE_ETH_RSS_NONFRAG_IPV4_UDP |  \
      58                 :            :         RTE_ETH_RSS_NONFRAG_IPV6_UDP |  \
      59                 :            :         RTE_ETH_RSS_IPV6_UDP_EX)
      60                 :            : 
      61                 :            : #define GVE_DEV_POLL_INTERVAL_US (1 * 1000 * 1000) /* 1 second in microseconds */
      62                 :            : 
      63                 :            : /* A list of pages registered with the device during setup and used by a queue
      64                 :            :  * as buffers
      65                 :            :  */
      66                 :            : struct gve_queue_page_list {
      67                 :            :         uint32_t id; /* unique id */
      68                 :            :         uint32_t num_entries;
      69                 :            :         dma_addr_t *page_buses; /* the dma addrs of the pages */
      70                 :            :         union {
      71                 :            :                 const struct rte_memzone *mz; /* memzone allocated for TX queue */
      72                 :            :                 void **qpl_bufs; /* RX qpl-buffer list allocated using malloc*/
      73                 :            :         };
      74                 :            : };
      75                 :            : 
      76                 :            : /* A TX desc ring entry */
      77                 :            : union gve_tx_desc {
      78                 :            :         struct gve_tx_pkt_desc pkt; /* first desc for a packet */
      79                 :            :         struct gve_tx_seg_desc seg; /* subsequent descs for a packet */
      80                 :            : };
      81                 :            : 
      82                 :            : /* Tx desc for DQO format */
      83                 :            : union gve_tx_desc_dqo {
      84                 :            :         struct gve_tx_pkt_desc_dqo pkt;
      85                 :            :         struct gve_tx_tso_context_desc_dqo tso_ctx;
      86                 :            :         struct gve_tx_general_context_desc_dqo general_ctx;
      87                 :            : };
      88                 :            : 
      89                 :            : /* Offload features */
      90                 :            : union gve_tx_offload {
      91                 :            :         uint64_t data;
      92                 :            :         struct {
      93                 :            :                 uint64_t l2_len:7; /* L2 (MAC) Header Length. */
      94                 :            :                 uint64_t l3_len:9; /* L3 (IP) Header Length. */
      95                 :            :                 uint64_t l4_len:8; /* L4 Header Length. */
      96                 :            :                 uint64_t tso_segsz:16; /* TCP TSO segment size */
      97                 :            :                 /* uint64_t unused : 24; */
      98                 :            :         };
      99                 :            : };
     100                 :            : 
     101                 :            : struct gve_tx_iovec {
     102                 :            :         uint32_t iov_base; /* offset in fifo */
     103                 :            :         uint32_t iov_len;
     104                 :            : };
     105                 :            : 
     106                 :            : struct gve_tx_stats {
     107                 :            :         uint64_t packets;
     108                 :            :         uint64_t bytes;
     109                 :            :         uint64_t errors;
     110                 :            :         uint64_t too_many_descs;
     111                 :            : };
     112                 :            : 
     113                 :            : struct gve_rx_stats {
     114                 :            :         uint64_t packets;
     115                 :            :         uint64_t bytes;
     116                 :            :         uint64_t errors;
     117                 :            :         uint64_t no_mbufs;
     118                 :            :         uint64_t no_mbufs_bulk;
     119                 :            :         uint64_t imissed;
     120                 :            : };
     121                 :            : 
     122                 :            : struct gve_xstats_name_offset {
     123                 :            :         char name[RTE_ETH_XSTATS_NAME_SIZE];
     124                 :            :         unsigned int offset;
     125                 :            : };
     126                 :            : 
     127                 :            : struct gve_tx_pkt {
     128                 :            :         struct rte_mbuf *mbuf;
     129                 :            :         int16_t next_avail_pkt; /* Entry in software ring for next free packet slot */
     130                 :            : };
     131                 :            : 
     132                 :            : struct gve_tx_queue {
     133                 :            :         volatile union gve_tx_desc *tx_desc_ring;
     134                 :            :         const struct rte_memzone *mz;
     135                 :            :         uint64_t tx_ring_phys_addr;
     136                 :            :         union {
     137                 :            :                 struct rte_mbuf **sw_ring;
     138                 :            :                 struct gve_tx_pkt *pkt_ring_dqo;
     139                 :            :         };
     140                 :            :         volatile rte_be32_t *qtx_tail;
     141                 :            :         volatile rte_be32_t *qtx_head;
     142                 :            : 
     143                 :            :         uint32_t tx_tail;
     144                 :            :         uint16_t nb_tx_desc;
     145                 :            :         uint16_t nb_complq_desc;
     146                 :            :         uint16_t nb_free;
     147                 :            :         uint16_t nb_used;
     148                 :            :         uint32_t next_to_clean;
     149                 :            :         uint16_t free_thresh;
     150                 :            :         uint16_t rs_thresh;
     151                 :            : 
     152                 :            :         /* Only valid for DQO_QPL queue format */
     153                 :            :         uint16_t sw_tail;
     154                 :            :         uint16_t sw_ntc;
     155                 :            :         uint16_t sw_nb_free;
     156                 :            :         uint32_t fifo_size;
     157                 :            :         uint32_t fifo_head;
     158                 :            :         uint32_t fifo_avail;
     159                 :            :         uint64_t fifo_base;
     160                 :            :         struct gve_queue_page_list *qpl;
     161                 :            :         struct gve_tx_iovec *iov_ring;
     162                 :            : 
     163                 :            :         /* stats items */
     164                 :            :         struct gve_tx_stats stats;
     165                 :            : 
     166                 :            :         uint16_t port_id;
     167                 :            :         uint16_t queue_id;
     168                 :            : 
     169                 :            :         uint16_t ntfy_id;
     170                 :            :         volatile rte_be32_t *ntfy_addr;
     171                 :            : 
     172                 :            :         struct gve_priv *hw;
     173                 :            :         const struct rte_memzone *qres_mz;
     174                 :            :         struct gve_queue_resources *qres;
     175                 :            : 
     176                 :            :         /* newly added for DQO */
     177                 :            :         volatile union gve_tx_desc_dqo *tx_ring;
     178                 :            :         struct gve_tx_compl_desc *compl_ring;
     179                 :            : 
     180                 :            :         /* List of free completion tags that map into sw_ring. */
     181                 :            :         int16_t free_compl_tags_head;
     182                 :            :         uint16_t num_free_compl_tags;
     183                 :            : 
     184                 :            :         const struct rte_memzone *compl_ring_mz;
     185                 :            :         uint64_t compl_ring_phys_addr;
     186                 :            :         uint32_t complq_tail;
     187                 :            :         uint16_t sw_size;
     188                 :            :         uint8_t cur_gen_bit;
     189                 :            :         uint32_t last_desc_cleaned;
     190                 :            :         void **txqs;
     191                 :            :         uint16_t re_cnt;
     192                 :            : 
     193                 :            :         /* Only valid for DQO_RDA queue format */
     194                 :            :         struct gve_tx_queue *complq;
     195                 :            : 
     196                 :            :         uint8_t is_gqi_qpl;
     197                 :            : };
     198                 :            : 
     199                 :            : struct gve_rx_ctx {
     200                 :            :         struct rte_mbuf *mbuf_head;
     201                 :            :         struct rte_mbuf *mbuf_tail;
     202                 :            :         uint16_t total_frags;
     203                 :            :         bool drop_pkt;
     204                 :            : };
     205                 :            : 
     206                 :            : struct gve_rx_queue {
     207                 :            :         volatile struct gve_rx_desc *rx_desc_ring;
     208                 :            :         volatile union gve_rx_data_slot *rx_data_ring;
     209                 :            :         const struct rte_memzone *mz;
     210                 :            :         const struct rte_memzone *data_mz;
     211                 :            :         uint64_t rx_ring_phys_addr;
     212                 :            :         struct rte_mbuf **sw_ring;
     213                 :            :         struct rte_mempool *mpool;
     214                 :            :         struct gve_rx_ctx ctx;
     215                 :            : 
     216                 :            :         uint16_t rx_tail;
     217                 :            :         uint16_t nb_rx_desc;
     218                 :            :         uint16_t expected_seqno; /* the next expected seqno */
     219                 :            :         uint16_t free_thresh;
     220                 :            :         uint16_t nb_rx_hold;
     221                 :            :         uint32_t next_avail;
     222                 :            :         uint32_t nb_avail;
     223                 :            : 
     224                 :            :         volatile rte_be32_t *qrx_tail;
     225                 :            :         volatile rte_be32_t *ntfy_addr;
     226                 :            : 
     227                 :            :         /* only valid for GQI_QPL queue format */
     228                 :            :         struct gve_queue_page_list *qpl;
     229                 :            : 
     230                 :            :         /* stats items */
     231                 :            :         struct gve_rx_stats stats;
     232                 :            : 
     233                 :            :         struct gve_priv *hw;
     234                 :            :         const struct rte_memzone *qres_mz;
     235                 :            :         struct gve_queue_resources *qres;
     236                 :            : 
     237                 :            :         uint16_t port_id;
     238                 :            :         uint16_t queue_id;
     239                 :            :         uint16_t ntfy_id;
     240                 :            :         uint16_t rx_buf_len;
     241                 :            : 
     242                 :            :         /* newly added for DQO */
     243                 :            :         volatile struct gve_rx_desc_dqo *rx_ring;
     244                 :            :         struct gve_rx_compl_desc_dqo *compl_ring;
     245                 :            :         const struct rte_memzone *compl_ring_mz;
     246                 :            :         uint64_t compl_ring_phys_addr;
     247                 :            :         uint8_t cur_gen_bit;
     248                 :            :         uint16_t bufq_tail;
     249                 :            : 
     250                 :            :         /* List of buffers which are known to be completed by the hardware. */
     251                 :            :         int16_t *completed_buf_list;
     252                 :            :         int16_t completed_buf_list_head;
     253                 :            : 
     254                 :            :         /* Only valid for DQO_RDA queue format */
     255                 :            :         struct gve_rx_queue *bufq;
     256                 :            :         struct rte_mbuf **refill_bufs;
     257                 :            : 
     258                 :            :         uint8_t is_gqi_qpl;
     259                 :            : };
     260                 :            : 
     261                 :            : struct gve_flow {
     262                 :            :         uint32_t rule_id;
     263                 :            :         TAILQ_ENTRY(gve_flow) list_handle;
     264                 :            : };
     265                 :            : 
     266                 :            : extern const struct rte_flow_ops gve_flow_ops;
     267                 :            : 
     268                 :            : struct gve_priv {
     269                 :            :         struct gve_irq_db *irq_dbs; /* array of num_ntfy_blks */
     270                 :            :         const struct rte_memzone *irq_dbs_mz;
     271                 :            :         uint32_t mgmt_msix_idx;
     272                 :            :         rte_be32_t *cnt_array; /* array of num_event_counters */
     273                 :            :         const struct rte_memzone *cnt_array_mz;
     274                 :            : 
     275                 :            :         uint16_t num_event_counters;
     276                 :            : 
     277                 :            :         /* TX ring size default and limits. */
     278                 :            :         uint16_t default_tx_desc_cnt;
     279                 :            :         uint16_t max_tx_desc_cnt;
     280                 :            :         uint16_t min_tx_desc_cnt;
     281                 :            : 
     282                 :            :         /* RX ring size default and limits. */
     283                 :            :         uint16_t default_rx_desc_cnt;
     284                 :            :         uint16_t max_rx_desc_cnt;
     285                 :            :         uint16_t min_rx_desc_cnt;
     286                 :            : 
     287                 :            :         uint16_t tx_pages_per_qpl;
     288                 :            : 
     289                 :            :         /* Only valid for DQO_RDA queue format */
     290                 :            :         uint16_t tx_compq_size; /* tx completion queue size */
     291                 :            :         uint16_t rx_bufq_size; /* rx buff queue size */
     292                 :            : 
     293                 :            :         uint64_t max_registered_pages;
     294                 :            :         uint64_t num_registered_pages; /* num pages registered with NIC */
     295                 :            :         uint16_t default_num_queues; /* default num queues to set up */
     296                 :            :         enum gve_queue_format queue_format; /* see enum gve_queue_format */
     297                 :            :         uint8_t enable_rsc;
     298                 :            : 
     299                 :            :         uint16_t max_nb_txq;
     300                 :            :         uint16_t max_nb_rxq;
     301                 :            :         uint32_t num_ntfy_blks; /* spilt between TX and RX so must be even */
     302                 :            : 
     303                 :            :         struct gve_registers __iomem *reg_bar0; /* see gve_register.h */
     304                 :            :         rte_be32_t __iomem *db_bar2; /* "array" of doorbells */
     305                 :            :         struct rte_pci_device *pci_dev;
     306                 :            : 
     307                 :            :         /* Admin queue - see gve_adminq.h*/
     308                 :            :         union gve_adminq_command *adminq;
     309                 :            :         struct gve_dma_mem adminq_dma_mem;
     310                 :            :         uint32_t adminq_mask; /* masks prod_cnt to adminq size */
     311                 :            :         uint32_t adminq_prod_cnt; /* free-running count of AQ cmds executed */
     312                 :            :         uint32_t adminq_cmd_fail; /* free-running count of AQ cmds failed */
     313                 :            :         uint32_t adminq_timeouts; /* free-running count of AQ cmds timeouts */
     314                 :            :         /* free-running count of per AQ cmd executed */
     315                 :            :         uint32_t adminq_describe_device_cnt;
     316                 :            :         uint32_t adminq_cfg_device_resources_cnt;
     317                 :            :         uint32_t adminq_register_page_list_cnt;
     318                 :            :         uint32_t adminq_unregister_page_list_cnt;
     319                 :            :         uint32_t adminq_create_tx_queue_cnt;
     320                 :            :         uint32_t adminq_create_rx_queue_cnt;
     321                 :            :         uint32_t adminq_destroy_tx_queue_cnt;
     322                 :            :         uint32_t adminq_destroy_rx_queue_cnt;
     323                 :            :         uint32_t adminq_dcfg_device_resources_cnt;
     324                 :            :         uint32_t adminq_cfg_rss_cnt;
     325                 :            :         uint32_t adminq_set_driver_parameter_cnt;
     326                 :            :         uint32_t adminq_report_stats_cnt;
     327                 :            :         uint32_t adminq_report_link_speed_cnt;
     328                 :            :         uint32_t adminq_get_ptype_map_cnt;
     329                 :            :         uint32_t adminq_verify_driver_compatibility_cnt;
     330                 :            :         uint32_t adminq_cfg_flow_rule_cnt;
     331                 :            :         volatile uint32_t state_flags;
     332                 :            : 
     333                 :            :         /* Gvnic device link speed from hypervisor. */
     334                 :            :         uint64_t link_speed;
     335                 :            : 
     336                 :            :         uint16_t max_mtu;
     337                 :            :         struct rte_ether_addr dev_addr; /* mac address */
     338                 :            : 
     339                 :            :         struct gve_tx_queue **txqs;
     340                 :            :         struct gve_rx_queue **rxqs;
     341                 :            : 
     342                 :            :         uint32_t stats_report_len;
     343                 :            :         const struct rte_memzone *stats_report_mem;
     344                 :            :         uint16_t stats_start_idx; /* start index of array of stats written by NIC */
     345                 :            :         uint16_t stats_end_idx; /* end index of array of stats written by NIC */
     346                 :            : 
     347                 :            :         struct gve_rss_config rss_config;
     348                 :            :         struct gve_ptype_lut *ptype_lut_dqo;
     349                 :            : 
     350                 :            :         /* Flow rule management */
     351                 :            :         uint32_t max_flow_rules;
     352                 :            :         uint32_t flow_rule_bmp_size;
     353                 :            :         struct rte_bitmap *avail_flow_rule_bmp; /* Tracks available rule IDs (1 = available) */
     354                 :            :         void *avail_flow_rule_bmp_mem; /* Backing memory for the bitmap */
     355                 :            :         pthread_mutex_t flow_rule_lock; /* Lock for bitmap and tailq access */
     356                 :            :         TAILQ_HEAD(, gve_flow) active_flows;
     357                 :            : };
     358                 :            : 
     359                 :            : static inline bool
     360                 :            : gve_is_gqi(struct gve_priv *priv)
     361                 :            : {
     362   [ #  #  #  #  :          0 :         return priv->queue_format == GVE_GQI_RDA_FORMAT ||
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                      # ]
     363                 :            :                 priv->queue_format == GVE_GQI_QPL_FORMAT;
     364                 :            : }
     365                 :            : 
     366                 :            : static inline bool
     367                 :            : gve_get_admin_queue_ok(struct gve_priv *priv)
     368                 :            : {
     369                 :            :         return !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_ADMIN_QUEUE_OK,
     370                 :            :                                        &priv->state_flags);
     371                 :            : }
     372                 :            : 
     373                 :            : static inline void
     374                 :            : gve_set_admin_queue_ok(struct gve_priv *priv)
     375                 :            : {
     376                 :            :         rte_bit_relaxed_set32(GVE_PRIV_FLAGS_ADMIN_QUEUE_OK,
     377                 :            :                               &priv->state_flags);
     378                 :            : }
     379                 :            : 
     380                 :            : static inline void
     381                 :            : gve_clear_admin_queue_ok(struct gve_priv *priv)
     382                 :            : {
     383                 :            :         rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_ADMIN_QUEUE_OK,
     384                 :            :                                 &priv->state_flags);
     385                 :          0 : }
     386                 :            : 
     387                 :            : static inline bool
     388                 :            : gve_get_device_resources_ok(struct gve_priv *priv)
     389                 :            : {
     390                 :            :         return !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_DEVICE_RESOURCES_OK,
     391                 :            :                                        &priv->state_flags);
     392                 :            : }
     393                 :            : 
     394                 :            : static inline void
     395                 :            : gve_set_device_resources_ok(struct gve_priv *priv)
     396                 :            : {
     397                 :            :         rte_bit_relaxed_set32(GVE_PRIV_FLAGS_DEVICE_RESOURCES_OK,
     398                 :            :                               &priv->state_flags);
     399                 :            : }
     400                 :            : 
     401                 :            : static inline void
     402                 :            : gve_clear_device_resources_ok(struct gve_priv *priv)
     403                 :            : {
     404                 :            :         rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_DEVICE_RESOURCES_OK,
     405                 :            :                                 &priv->state_flags);
     406                 :            : }
     407                 :            : 
     408                 :            : static inline bool
     409                 :            : gve_get_device_rings_ok(struct gve_priv *priv)
     410                 :            : {
     411                 :            :         return !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_DEVICE_RINGS_OK,
     412                 :            :                                        &priv->state_flags);
     413                 :            : }
     414                 :            : 
     415                 :            : static inline void
     416                 :            : gve_set_device_rings_ok(struct gve_priv *priv)
     417                 :            : {
     418                 :            :         rte_bit_relaxed_set32(GVE_PRIV_FLAGS_DEVICE_RINGS_OK,
     419                 :            :                               &priv->state_flags);
     420                 :            : }
     421                 :            : 
     422                 :            : static inline void
     423                 :            : gve_clear_device_rings_ok(struct gve_priv *priv)
     424                 :            : {
     425                 :            :         rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_DEVICE_RINGS_OK,
     426                 :            :                                 &priv->state_flags);
     427                 :            : }
     428                 :            : 
     429                 :            : static inline bool
     430                 :            : gve_get_flow_subsystem_ok(struct gve_priv *priv)
     431                 :            : {
     432                 :            :         bool ret;
     433                 :            : 
     434                 :            :         ret = !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_FLOW_SUBSYSTEM_OK,
     435                 :            :                                       &priv->state_flags);
     436                 :            :         rte_atomic_thread_fence(rte_memory_order_acquire);
     437                 :            : 
     438                 :            :         return ret;
     439                 :            : }
     440                 :            : 
     441                 :            : static inline void
     442                 :            : gve_set_flow_subsystem_ok(struct gve_priv *priv)
     443                 :            : {
     444                 :            :         rte_atomic_thread_fence(rte_memory_order_release);
     445                 :            :         rte_bit_relaxed_set32(GVE_PRIV_FLAGS_FLOW_SUBSYSTEM_OK,
     446                 :            :                               &priv->state_flags);
     447                 :            : }
     448                 :            : 
     449                 :            : static inline void
     450                 :            : gve_clear_flow_subsystem_ok(struct gve_priv *priv)
     451                 :            : {
     452                 :            :         rte_atomic_thread_fence(rte_memory_order_release);
     453                 :            :         rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_FLOW_SUBSYSTEM_OK,
     454                 :            :                                 &priv->state_flags);
     455                 :            : }
     456                 :            : 
     457                 :            : int
     458                 :            : gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
     459                 :            :                    unsigned int socket_id, const struct rte_eth_rxconf *conf,
     460                 :            :                    struct rte_mempool *pool);
     461                 :            : int
     462                 :            : gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
     463                 :            :                    unsigned int socket_id, const struct rte_eth_txconf *conf);
     464                 :            : 
     465                 :            : void
     466                 :            : gve_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
     467                 :            : 
     468                 :            : void
     469                 :            : gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
     470                 :            : 
     471                 :            : int
     472                 :            : gve_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
     473                 :            : 
     474                 :            : int
     475                 :            : gve_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
     476                 :            : 
     477                 :            : int
     478                 :            : gve_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
     479                 :            : 
     480                 :            : int
     481                 :            : gve_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
     482                 :            : 
     483                 :            : void
     484                 :            : gve_stop_tx_queues(struct rte_eth_dev *dev);
     485                 :            : 
     486                 :            : void
     487                 :            : gve_stop_rx_queues(struct rte_eth_dev *dev);
     488                 :            : 
     489                 :            : uint16_t
     490                 :            : gve_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
     491                 :            : 
     492                 :            : uint16_t
     493                 :            : gve_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
     494                 :            : 
     495                 :            : void
     496                 :            : gve_set_rx_function(struct rte_eth_dev *dev);
     497                 :            : 
     498                 :            : void
     499                 :            : gve_set_tx_function(struct rte_eth_dev *dev);
     500                 :            : 
     501                 :            : struct gve_queue_page_list *
     502                 :            : gve_setup_queue_page_list(struct gve_priv *priv, uint16_t queue_id, bool is_rx,
     503                 :            :         uint32_t num_pages);
     504                 :            : int
     505                 :            : gve_teardown_queue_page_list(struct gve_priv *priv,
     506                 :            :         struct gve_queue_page_list *qpl);
     507                 :            : 
     508                 :            : /* Below functions are used for DQO */
     509                 :            : 
     510                 :            : int
     511                 :            : gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
     512                 :            :                        uint16_t nb_desc, unsigned int socket_id,
     513                 :            :                        const struct rte_eth_rxconf *conf,
     514                 :            :                        struct rte_mempool *pool);
     515                 :            : int
     516                 :            : gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
     517                 :            :                        uint16_t nb_desc, unsigned int socket_id,
     518                 :            :                        const struct rte_eth_txconf *conf);
     519                 :            : 
     520                 :            : void
     521                 :            : gve_tx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid);
     522                 :            : 
     523                 :            : void
     524                 :            : gve_rx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid);
     525                 :            : 
     526                 :            : int
     527                 :            : gve_rx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id);
     528                 :            : 
     529                 :            : int
     530                 :            : gve_tx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id);
     531                 :            : 
     532                 :            : int
     533                 :            : gve_rx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id);
     534                 :            : 
     535                 :            : int
     536                 :            : gve_tx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id);
     537                 :            : 
     538                 :            : void
     539                 :            : gve_stop_tx_queues_dqo(struct rte_eth_dev *dev);
     540                 :            : 
     541                 :            : void
     542                 :            : gve_stop_rx_queues_dqo(struct rte_eth_dev *dev);
     543                 :            : 
     544                 :            : uint16_t
     545                 :            : gve_rx_burst_dqo(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
     546                 :            : 
     547                 :            : uint16_t
     548                 :            : gve_tx_burst_dqo(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
     549                 :            : 
     550                 :            : void
     551                 :            : gve_set_rx_function_dqo(struct rte_eth_dev *dev);
     552                 :            : 
     553                 :            : void
     554                 :            : gve_set_tx_function_dqo(struct rte_eth_dev *dev);
     555                 :            : 
     556                 :            : #endif /* _GVE_ETHDEV_H_ */

Generated by: LCOV version 1.14