Subject: Re: [PATCH net-next 10/15] ixgbe: extend .info_get with() stored versions

From: Jakub Kicinski <[email-masked]>
Date: Tue, 8 Apr 2025 19:31:24 -0700

On Mon,  7 Apr 2025 14:51:14 -0700 Tony Nguyen wrote:
> From: Jedrzej Jagielski <[email-masked]>
> 
> Add functions reading inactive versions from the inactive flash
> bank.

Just to be crystal clear -- could you share the outputs for dev info:
 - before update
 - after update, before reboot/reload
 - after update, after activation (/reboot/reload)
?

AFAICT the code is fine but talking about the "inactive versions"
is not exactly in line with the uAPI expectations. 

> +static int ixgbe_set_ctx_dev_caps(struct ixgbe_hw *hw,
> +				  struct ixgbe_info_ctx *ctx,
> +				  struct netlink_ext_ack *extack)
> +{
> +	int err = ixgbe_discover_dev_caps(hw, &ctx->dev_caps);
> +
> +	if (err) {

Don't call functions which need error checking as part of variable init.

> +		NL_SET_ERR_MSG_MOD(extack,
> +				   "Unable to discover device capabilities");
> +		return err;
> +	}
> +
> +	if (ctx->dev_caps.common_cap.nvm_update_pending_orom) {
> +		err = ixgbe_get_inactive_orom_ver(hw, &ctx->pending_orom);
> +		if (err)
> +			ctx->dev_caps.common_cap.nvm_update_pending_orom =
> +				false;

This function would benefit from having ctx->dev_caps.common_cap
stored to a local variable with a shorter name :S

> +	}
> +
> +	if (ctx->dev_caps.common_cap.nvm_update_pending_nvm) {
> +		err = ixgbe_get_inactive_nvm_ver(hw, &ctx->pending_nvm);
> +		if (err)
> +			ctx->dev_caps.common_cap.nvm_update_pending_nvm = false;
> +	}
> +
> +	if (ctx->dev_caps.common_cap.nvm_update_pending_netlist) {
> +		err = ixgbe_get_inactive_netlist_ver(hw, &ctx->pending_netlist);
> +		if (err)
> +			ctx->dev_caps.common_cap.nvm_update_pending_netlist =
> +				false;
> +	}
-- 
pw-bot: cr