2021-10-19 22:42:48

by Erik Ekman

[permalink] [raw]
Subject: [PATCH] sfc: Don't use netif_info before net_device setup

Use pci_info instead to avoid unnamed/uninitialized noise:

[197088.688729] sfc 0000:01:00.0: Solarflare NIC detected
[197088.690333] sfc 0000:01:00.0: Part Number : SFN5122F
[197088.729061] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no SR-IOV VFs probed
[197088.729071] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no PTP support

Inspired by fa44821a4ddd ("sfc: don't use netif_info et al before
net_device is registered") from Heiner Kallweit.

Signed-off-by: Erik Ekman <[email protected]>
---
drivers/net/ethernet/sfc/ptp.c | 4 ++--
drivers/net/ethernet/sfc/siena_sriov.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index a39c5143b386..797e51802ccb 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -648,7 +648,7 @@ static int efx_ptp_get_attributes(struct efx_nic *efx)
} else if (rc == -EINVAL) {
fmt = MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS;
} else if (rc == -EPERM) {
- netif_info(efx, probe, efx->net_dev, "no PTP support\n");
+ pci_info(efx->pci_dev, "no PTP support\n");
return rc;
} else {
efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf),
@@ -824,7 +824,7 @@ static int efx_ptp_disable(struct efx_nic *efx)
* should only have been called during probe.
*/
if (rc == -ENOSYS || rc == -EPERM)
- netif_info(efx, probe, efx->net_dev, "no PTP support\n");
+ pci_info(efx->pci_dev, "no PTP support\n");
else if (rc)
efx_mcdi_display_error(efx, MC_CMD_PTP,
MC_CMD_PTP_IN_DISABLE_LEN,
diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c
index 83dcfcae3d4b..441e7f3e5375 100644
--- a/drivers/net/ethernet/sfc/siena_sriov.c
+++ b/drivers/net/ethernet/sfc/siena_sriov.c
@@ -1057,7 +1057,7 @@ void efx_siena_sriov_probe(struct efx_nic *efx)
return;

if (efx_siena_sriov_cmd(efx, false, &efx->vi_scale, &count)) {
- netif_info(efx, probe, efx->net_dev, "no SR-IOV VFs probed\n");
+ pci_info(efx->pci_dev, "no SR-IOV VFs probed\n");
return;
}
if (count > 0 && count > max_vfs)
--
2.31.1


2021-10-21 10:11:33

by Martin Habets

[permalink] [raw]
Subject: Re: [PATCH] sfc: Don't use netif_info before net_device setup

On Wed, Oct 20, 2021 at 12:40:16AM +0200, Erik Ekman wrote:
> Use pci_info instead to avoid unnamed/uninitialized noise:
>
> [197088.688729] sfc 0000:01:00.0: Solarflare NIC detected
> [197088.690333] sfc 0000:01:00.0: Part Number : SFN5122F
> [197088.729061] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no SR-IOV VFs probed
> [197088.729071] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no PTP support
>
> Inspired by fa44821a4ddd ("sfc: don't use netif_info et al before
> net_device is registered") from Heiner Kallweit.
>
> Signed-off-by: Erik Ekman <[email protected]>

Acked-by: Martin Habets <[email protected]>

> ---
> drivers/net/ethernet/sfc/ptp.c | 4 ++--
> drivers/net/ethernet/sfc/siena_sriov.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
> index a39c5143b386..797e51802ccb 100644
> --- a/drivers/net/ethernet/sfc/ptp.c
> +++ b/drivers/net/ethernet/sfc/ptp.c
> @@ -648,7 +648,7 @@ static int efx_ptp_get_attributes(struct efx_nic *efx)
> } else if (rc == -EINVAL) {
> fmt = MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS;
> } else if (rc == -EPERM) {
> - netif_info(efx, probe, efx->net_dev, "no PTP support\n");
> + pci_info(efx->pci_dev, "no PTP support\n");
> return rc;
> } else {
> efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf),
> @@ -824,7 +824,7 @@ static int efx_ptp_disable(struct efx_nic *efx)
> * should only have been called during probe.
> */
> if (rc == -ENOSYS || rc == -EPERM)
> - netif_info(efx, probe, efx->net_dev, "no PTP support\n");
> + pci_info(efx->pci_dev, "no PTP support\n");
> else if (rc)
> efx_mcdi_display_error(efx, MC_CMD_PTP,
> MC_CMD_PTP_IN_DISABLE_LEN,
> diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c
> index 83dcfcae3d4b..441e7f3e5375 100644
> --- a/drivers/net/ethernet/sfc/siena_sriov.c
> +++ b/drivers/net/ethernet/sfc/siena_sriov.c
> @@ -1057,7 +1057,7 @@ void efx_siena_sriov_probe(struct efx_nic *efx)
> return;
>
> if (efx_siena_sriov_cmd(efx, false, &efx->vi_scale, &count)) {
> - netif_info(efx, probe, efx->net_dev, "no SR-IOV VFs probed\n");
> + pci_info(efx->pci_dev, "no SR-IOV VFs probed\n");
> return;
> }
> if (count > 0 && count > max_vfs)
> --
> 2.31.1

2021-10-21 23:41:40

by Jesse Brandeburg

[permalink] [raw]
Subject: Re: [PATCH] sfc: Don't use netif_info before net_device setup

On 10/19/2021 3:40 PM, Erik Ekman wrote:
> Use pci_info instead to avoid unnamed/uninitialized noise:
>
> [197088.688729] sfc 0000:01:00.0: Solarflare NIC detected
> [197088.690333] sfc 0000:01:00.0: Part Number : SFN5122F
> [197088.729061] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no SR-IOV VFs probed
> [197088.729071] sfc 0000:01:00.0 (unnamed net_device) (uninitialized): no PTP support
>
> Inspired by fa44821a4ddd ("sfc: don't use netif_info et al before
> net_device is registered") from Heiner Kallweit.
>
> Signed-off-by: Erik Ekman <[email protected]>

Reviewed-by: Jesse Brandeburg <[email protected]>