net/mlx5: fix buffer split offload advertising
authorViacheslav Ovsiienko <viacheslavo@nvidia.com>
Fri, 11 Dec 2020 11:44:52 +0000 (11:44 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:05 +0000 (16:03 +0100)
The buffer split Rx offload is not compatible with Multi-Packet
Receiving Queue (MPRQ) Rx offload, hence, the buffer split
offload flag RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT and other related
values should be advertised only if there is no MPRQ engaged.

Fixes: 6c8f7f1c1877 ("net/mlx5: report Rx buffer split capabilities")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
drivers/net/mlx5/mlx5_ethdev.c
drivers/net/mlx5/mlx5_rxq.c

index a3910cf..45ee7e4 100644 (file)
@@ -310,8 +310,8 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
        info->max_mac_addrs = MLX5_MAX_UC_MAC_ADDRESSES;
        info->rx_queue_offload_capa = mlx5_get_rx_queue_offloads(dev);
        info->rx_seg_capa.max_nseg = MLX5_MAX_RXQ_NSEG;
-       info->rx_seg_capa.multi_pools = 1;
-       info->rx_seg_capa.offset_allowed = 1;
+       info->rx_seg_capa.multi_pools = !config->mprq.enabled;
+       info->rx_seg_capa.offset_allowed = !config->mprq.enabled;
        info->rx_seg_capa.offset_align_log2 = 0;
        info->rx_offload_capa = (mlx5_get_rx_port_offloads() |
                                 info->rx_queue_offload_capa);
index 114f75b..4d78878 100644 (file)
@@ -404,14 +404,14 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
        struct mlx5_priv *priv = dev->data->dev_private;
        struct mlx5_dev_config *config = &priv->config;
        uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
-                            RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT |
                             DEV_RX_OFFLOAD_TIMESTAMP |
                             DEV_RX_OFFLOAD_JUMBO_FRAME |
                             DEV_RX_OFFLOAD_RSS_HASH);
 
+       if (!config->mprq.enabled)
+               offloads |= RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT;
        if (config->hw_fcs_strip)
                offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
-
        if (config->hw_csum)
                offloads |= (DEV_RX_OFFLOAD_IPV4_CKSUM |
                             DEV_RX_OFFLOAD_UDP_CKSUM |