From: Ting Xu Date: Tue, 27 Jul 2021 10:55:08 +0000 (+0800) Subject: net/ice: fix bandwidth config size in memory copy X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e787b44a6b3ea755bf4a01b8349b7b1b828aef13;p=dpdk.git net/ice: fix bandwidth config size in memory copy The memory size of bandwidth config parameters is not set correctly in memory copy process, which leads to the wrong values. This patch fixed the size to the correct value. Fixes: 3a6bfc37eaf4 ("net/ice: support QoS config VF bandwidth in DCF") Cc: stable@dpdk.org Signed-off-by: Ting Xu Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sched.c index 090988c6e1..dcf2723494 100644 --- a/drivers/net/ice/ice_dcf_sched.c +++ b/drivers/net/ice/ice_dcf_sched.c @@ -833,7 +833,7 @@ static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev, goto fail_clear; } /* store the bandwidth information for replay */ - ice_memcpy(hw->qos_bw_cfg[vf_id], vf_bw, sizeof(*vf_bw), + ice_memcpy(hw->qos_bw_cfg[vf_id], vf_bw, size, ICE_NONDMA_TO_NONDMA); ice_memset(vf_bw, 0, size, ICE_NONDMA_MEM); } @@ -859,7 +859,7 @@ static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev, ret_val = ICE_ERR_NO_MEMORY; goto fail_clear; } - ice_memcpy(hw->qos_bw_cfg[ICE_DCF_VFID], tc_bw, sizeof(*tc_bw), + ice_memcpy(hw->qos_bw_cfg[ICE_DCF_VFID], tc_bw, size, ICE_NONDMA_TO_NONDMA); hw->tm_conf.committed = true;