[Intel-wired-lan] [PATCH intel-next 1/4] ice: Refactor ice_aqc_link_topo_addr

Paul Menzel pmenzel at molgen.mpg.de
Thu Aug 26 06:31:01 UTC 2021


Dear Maciej,


Am 16.08.21 um 12:27 schrieb Maciej Machnikowski:
> Separate link topo parameters and move to the ice_aqc_link_topo_params
> in the ice_aqc_link_topo_addr.

What do you mean by “in the ice_aqc_link_topo_addr“? Maybe just add write:

Separate link topo parameters in structure `ice_aqc_link_topo_addr` out 
into new structure `ice_aqc_link_topo_params`.

Please add a note, why the refactoring is needed.
> 
> Signed-off-by: Maciej Machnikowski <maciej.machnikowski at intel.com>
> ---
>   drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 6 +++++-
>   drivers/net/ethernet/intel/ice/ice_common.c     | 8 +++++---
>   2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
> index 6c727745bb29..941342f4be85 100644
> --- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
> +++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
> @@ -1283,7 +1283,7 @@ struct ice_aqc_set_mac_lb {
>   	u8 reserved[15];
>   };
>   
> -struct ice_aqc_link_topo_addr {
> +struct ice_aqc_link_topo_params {
>   	u8 lport_num;
>   	u8 lport_num_valid;
>   #define ICE_AQC_LINK_TOPO_PORT_NUM_VALID	BIT(0)
> @@ -1309,6 +1309,10 @@ struct ice_aqc_link_topo_addr {
>   #define ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED	4
>   #define ICE_AQC_LINK_TOPO_NODE_CTX_OVERRIDE	5
>   	u8 index;
> +};
> +
> +struct ice_aqc_link_topo_addr {
> +	struct ice_aqc_link_topo_params topo_params;
>   	__le16 handle;
>   #define ICE_AQC_LINK_TOPO_HANDLE_S	0
>   #define ICE_AQC_LINK_TOPO_HANDLE_M	(0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S)
> diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
> index 1a3c6b60fdca..5822589aebdc 100644
> --- a/drivers/net/ethernet/intel/ice/ice_common.c
> +++ b/drivers/net/ethernet/intel/ice/ice_common.c
> @@ -240,11 +240,13 @@ ice_aq_get_link_topo_handle(struct ice_port_info *pi, u8 node_type,
>   
>   	ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo);
>   
> -	cmd->addr.node_type_ctx = (ICE_AQC_LINK_TOPO_NODE_CTX_PORT <<
> -				   ICE_AQC_LINK_TOPO_NODE_CTX_S);
> +	cmd->addr.topo_params.node_type_ctx =
> +		(ICE_AQC_LINK_TOPO_NODE_CTX_PORT <<
> +		 ICE_AQC_LINK_TOPO_NODE_CTX_S);
>   
>   	/* set node type */
> -	cmd->addr.node_type_ctx |= (ICE_AQC_LINK_TOPO_NODE_TYPE_M & node_type);
> +	cmd->addr.topo_params.node_type_ctx |=
> +		(ICE_AQC_LINK_TOPO_NODE_TYPE_M & node_type);
>   
>   	return ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd);
>   }
> 


More information about the Intel-wired-lan mailing list