On 10/10/2022 11:17 AM, Junfeng Guo wrote:


Add dev_ops dev_infos_get.
Complete dev_configure with RX offloads configuration.

Signed-off-by: Xiaoyun Li <xiaoyun...@intel.com>
Signed-off-by: Junfeng Guo <junfeng....@intel.com>

<...>

--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -29,8 +29,16 @@ gve_write_version(uint8_t *driver_version_register)
  }

  static int
-gve_dev_configure(__rte_unused struct rte_eth_dev *dev)
+gve_dev_configure(struct rte_eth_dev *dev)
  {
+       struct gve_priv *priv = dev->data->dev_private;
+
+       if (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= 
RTE_ETH_RX_OFFLOAD_RSS_HASH;
+

This is force enabling the feature, we are doing this for PMDs that has the hash value anyway and no additional work or performance loss observed to enable this offload. Otherwise drivers shouldn't update 'dev_conf.rxmode'.

Can you please confirm this PMD fits above description? And can you please add a coment that says force enabling the feature?

+       if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO)
+               priv->enable_rsc = 1;
+
         return 0;
  }

@@ -94,6 +102,60 @@ gve_dev_close(struct rte_eth_dev *dev)
         return err;
  }

+static int
+gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+{
+       struct gve_priv *priv = dev->data->dev_private;
+
+       dev_info->device = dev->device;
+       dev_info->max_mac_addrs = 1;
+       dev_info->max_rx_queues = priv->max_nb_rxq;
+       dev_info->max_tx_queues = priv->max_nb_txq;
+       dev_info->min_rx_bufsize = GVE_MIN_BUF_SIZE;
+       dev_info->max_rx_pktlen = GVE_MAX_RX_PKTLEN;
+       dev_info->max_mtu = RTE_ETHER_MTU;

Can you please confirm max MTU this PMD supports is 1500? Meaning it doesn't support jumbo frames etc...

+       dev_info->min_mtu = RTE_ETHER_MIN_MTU;
+
+       dev_info->rx_offload_capa = 0;
+       dev_info->tx_offload_capa =
+               RTE_ETH_TX_OFFLOAD_MULTI_SEGS   |
+               RTE_ETH_TX_OFFLOAD_IPV4_CKSUM   |
+               RTE_ETH_TX_OFFLOAD_UDP_CKSUM    |
+               RTE_ETH_TX_OFFLOAD_TCP_CKSUM    |
+               RTE_ETH_TX_OFFLOAD_SCTP_CKSUM   |
+               RTE_ETH_TX_OFFLOAD_TCP_TSO;

Can you adverstise these capabilities in the patch that implements them?

Reply via email to