X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fhns3%2Fhns3_ethdev_vf.c;h=904562e03f6f8f4827733ec588b0cf674bd7c311;hb=2de74dcfbd150fde59c8e0a20ae21e22ab27605e;hp=e2608906577bb27187d72fabb5d2e9fc084e7bfb;hpb=99d673d5d3a8046a7f55d82a0a26244372f76abd;p=dpdk.git diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index e260890657..904562e03f 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -713,7 +713,8 @@ hns3vf_init_ring_with_vector(struct hns3_hw *hw) * Rx interrupt. */ vec = hw->num_msi - 1; /* vector 0 for misc interrupt, not for queue */ - hw->intr_tqps_num = vec - 1; /* the last interrupt is reserved */ + /* vec - 1: the last interrupt is reserved */ + hw->intr_tqps_num = vec > hw->tqps_num ? hw->tqps_num : vec - 1; for (i = 0; i < hw->intr_tqps_num; i++) { /* * Set gap limiter and rate limiter configuration of queue's @@ -1473,7 +1474,7 @@ hns3_query_vf_resource(struct hns3_hw *hw) return -EINVAL; } - hw->num_msi = (num_msi > hw->tqps_num + 1) ? hw->tqps_num + 1 : num_msi; + hw->num_msi = num_msi; return 0; }