diff mbox series

[v2,2/5] net/ice/base: support DCF query port ETS adminq

Message ID 20210617101708.113951-3-ting.xu@intel.com (mailing list archive)
State Superseded
Delegated to: Qi Zhang
Headers show
Series Enable ETS-based Tx QoS for VF in DCF | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ting Xu June 17, 2021, 10:17 a.m. UTC
In the adminq command query port ETS function, the root node teid is
needed. However, for DCF, the root node is not initialized, which will
cause error when we refer to the variable. In this patch, we will check
whether the root node is available or not first.

Signed-off-by: Ting Xu <ting.xu@intel.com>
---
 drivers/net/ice/base/ice_dcb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ice/base/ice_dcb.c b/drivers/net/ice/base/ice_dcb.c
index 0aaa5ae8c1..08c950cd9a 100644
--- a/drivers/net/ice/base/ice_dcb.c
+++ b/drivers/net/ice/base/ice_dcb.c
@@ -1483,7 +1483,8 @@  ice_aq_query_port_ets(struct ice_port_info *pi,
 		return ICE_ERR_PARAM;
 	cmd = &desc.params.port_ets;
 	ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_query_port_ets);
-	cmd->port_teid = pi->root->info.node_teid;
+	if (pi->root)
+		cmd->port_teid = pi->root->info.node_teid;
 
 	status = ice_aq_send_cmd(pi->hw, &desc, buf, buf_size, cd);
 	return status;