From 49cae2c4426c2c07aa1b60a0be5f3812d59c2a41 Mon Sep 17 00:00:00 2001 From: Ting Xu Date: Thu, 1 Jul 2021 19:41:19 +0800 Subject: [PATCH] net/ice/base: support DCF query port ETS adminq 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 Acked-by: Qi Zhang --- drivers/net/ice/base/ice_dcb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_dcb.c b/drivers/net/ice/base/ice_dcb.c index c73fc095ff..9c9675f6ef 100644 --- a/drivers/net/ice/base/ice_dcb.c +++ b/drivers/net/ice/base/ice_dcb.c @@ -1524,7 +1524,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; -- 2.20.1