From: Jakub Kicinski <kuba@kernel.org>
To: Edward Cree <ecree@solarflare.com>
Cc: <linux-net-drivers@solarflare.com>, <davem@davemloft.net>,
<netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next 03/11] sfc_ef100: read Design Parameters at probe time
Date: Fri, 31 Jul 2020 13:18:57 -0700 [thread overview]
Message-ID: <20200731131857.41b0f32a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <48b1fedf-0863-8fab-7f7a-e2df6946b764@solarflare.com>
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;
> +}
next prev parent reply other threads:[~2020-07-31 20:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 12:55 [PATCH v2 net-next 00/11] sfc: driver for EF100 family NICs, part 2 Edward Cree
2020-07-31 12:58 ` [PATCH v2 net-next 01/11] sfc_ef100: check firmware version at start-of-day Edward Cree
2020-07-31 12:58 ` [PATCH v2 net-next 02/11] sfc_ef100: fail the probe if NIC uses unsol_ev credits Edward Cree
2020-07-31 12:58 ` [PATCH v2 net-next 03/11] sfc_ef100: read Design Parameters at probe time Edward Cree
2020-07-31 20:18 ` Jakub Kicinski [this message]
2020-08-03 14:33 ` Edward Cree
2020-08-03 21:54 ` Jakub Kicinski
2020-07-31 12:59 ` [PATCH v2 net-next 04/11] sfc_ef100: TX path for EF100 NICs Edward Cree
2020-07-31 19:39 ` Jakub Kicinski
2020-08-03 14:36 ` Edward Cree
2020-07-31 12:59 ` [PATCH v2 net-next 05/11] sfc_ef100: RX filter table management and related gubbins Edward Cree
2020-07-31 12:59 ` [PATCH v2 net-next 06/11] sfc_ef100: RX path for EF100 Edward Cree
2020-07-31 13:00 ` [PATCH v2 net-next 07/11] sfc_ef100: plumb in fini_dmaq Edward Cree
2020-07-31 13:00 ` [PATCH v2 net-next 08/11] sfc_ef100: statistics gathering Edward Cree
2020-07-31 20:27 ` Jakub Kicinski
2020-07-31 13:00 ` [PATCH v2 net-next 09/11] sfc_ef100: functions for selftests Edward Cree
2020-07-31 13:01 ` [PATCH v2 net-next 10/11] sfc_ef100: read pf_index at probe time Edward Cree
2020-07-31 13:01 ` [PATCH v2 net-next 11/11] sfc_ef100: add nic-type for VFs, and bind to them Edward Cree
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200731131857.41b0f32a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).