[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200731131857.41b0f32a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Fri, 31 Jul 2020 13:18:57 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Edward Cree <ecree@...arflare.com>
Cc: <linux-net-drivers@...arflare.com>, <davem@...emloft.net>,
<netdev@...r.kernel.org>
Subject: Re: [PATCH v2 net-next 03/11] sfc_ef100: read Design Parameters at
probe time
On Fri, 31 Jul 2020 13:58:35 +0100 Edward Cree wrote:
> + default:
> + /* Host interface says "Drivers should ignore design parameters
> + * that they do not recognise."
> + */
> + netif_info(efx, probe, efx->net_dev,
> + "Ignoring unrecognised design parameter %u\n",
> + reader->type);
Is this really important enough to spam the logs with?
> + return 0;
> + }
> +}
> +
> +static int ef100_check_design_params(struct efx_nic *efx)
> +{
> + struct ef100_tlv_state reader = {};
> + u32 total_len, offset = 0;
> + efx_dword_t reg;
> + int rc = 0, i;
> + u32 data;
> +
> + efx_readd(efx, ®, ER_GZ_PARAMS_TLV_LEN);
> + total_len = EFX_DWORD_FIELD(reg, EFX_DWORD_0);
> + netif_dbg(efx, probe, efx->net_dev, "%u bytes of design parameters\n",
> + total_len);
> + while (offset < total_len) {
> + efx_readd(efx, ®, ER_GZ_PARAMS_TLV + offset);
> + data = EFX_DWORD_FIELD(reg, EFX_DWORD_0);
> + for (i = 0; i < sizeof(data); i++) {
> + rc = ef100_tlv_feed(&reader, data);
> + /* Got a complete value? */
> + if (!rc && reader.state == EF100_TLV_TYPE)
> + rc = ef100_process_design_param(efx, &reader);
> + if (rc)
> + goto out;
> + data >>= 8;
> + offset++;
> + }
> + }
Should you warn if the TLV stream ends half-way through an entry?
> +out:
> + return rc;
> +}
Powered by blists - more mailing lists