From: Adrien Mazarguil Date: Tue, 3 Nov 2015 17:15:13 +0000 (+0100) Subject: mlx5: fix build with debugging enabled X-Git-Tag: spdx-start~8155 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=13d57bd5cdfeff687b9920fe236a873600c8aa50;p=dpdk.git mlx5: fix build with debugging enabled The following error occurs when CONFIG_RTE_LIBRTE_MLX5_DEBUG=y: drivers/net/mlx5/mlx5.c:381:4: error: ISO C forbids braced-groups within expressions RTE_MIN() uses the non-standard ({ ... }) syntax to declare variables within parentheses, which is rejected by -pedantic. Since the RSS_INDIRECTION_TABLE_SIZE check is meant to go away as soon as DPDK supports larger/variable indirection tables, put it in a separate condition. Fixes: 634efbc2c8c0 ("mlx5: support RETA query and update") Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 69c58071ac..821ee0f0c3 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -65,6 +65,7 @@ #include "mlx5_utils.h" #include "mlx5_rxtx.h" #include "mlx5_autoconf.h" +#include "mlx5_defs.h" /** * DPDK callback to close the device. @@ -377,9 +378,11 @@ mlx5_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) DEBUG("L2 tunnel checksum offloads are %ssupported", (priv->hw_csum_l2tun ? "" : "not ")); - priv->ind_table_max_size = - RTE_MIN((unsigned int)RSS_INDIRECTION_TABLE_SIZE, - exp_device_attr.rx_hash_caps.max_rwq_indirection_table_size); + priv->ind_table_max_size = exp_device_attr.rx_hash_caps.max_rwq_indirection_table_size; + /* Remove this check once DPDK supports larger/variable + * indirection tables. */ + if (priv->ind_table_max_size > (unsigned int)RSS_INDIRECTION_TABLE_SIZE) + priv->ind_table_max_size = RSS_INDIRECTION_TABLE_SIZE; DEBUG("maximum RX indirection table size is %u", priv->ind_table_max_size);