net/ice: fix build on RHEL 7
authorTing Xu <ting.xu@intel.com>
Wed, 7 Jul 2021 09:51:10 +0000 (17:51 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 7 Jul 2021 11:28:06 +0000 (13:28 +0200)
This patch fixed the unmatched integer type issue in the comparison,
which causing compilation failure on RHEL.

drivers/net/ice/ice_dcf_sched.c:353:15: error:
comparison between signed and unsigned integer expressions
   if (node_id > tc_nb * hw->num_vfs) {
               ^

CI reported the failure:
http://mails.dpdk.org/archives/test-report/2021-July/201905.html

Fixes: 3a6bfc37eaf4 ("net/ice: support QoS config VF bandwidth in DCF")

Signed-off-by: Ting Xu <ting.xu@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
drivers/net/ice/ice_dcf_sched.c

index 4371bbc..aeb1afb 100644 (file)
@@ -350,7 +350,7 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id,
                        return -EINVAL;
                }
                /* check the vsi node id */
-               if (node_id > tc_nb * hw->num_vfs) {
+               if (node_id > (uint32_t)(tc_nb * hw->num_vfs)) {
                        error->type = RTE_TM_ERROR_TYPE_NODE_ID;
                        error->message = "too large VSI id";
                        return -EINVAL;