netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Shannon Nelson <snelson@pensando.io>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH v5 net-next 02/18] ionic: Add hardware init and device commands
Date: Tue, 27 Aug 2019 04:26:28 +0200	[thread overview]
Message-ID: <20190827022628.GD13411@lunn.ch> (raw)
In-Reply-To: <20190826213339.56909-3-snelson@pensando.io>

On Mon, Aug 26, 2019 at 02:33:23PM -0700, Shannon Nelson wrote:
> +void ionic_debugfs_add_dev(struct ionic *ionic)
> +{
> +	struct dentry *dentry;
> +
> +	dentry = debugfs_create_dir(ionic_bus_info(ionic), ionic_dir);
> +	if (IS_ERR_OR_NULL(dentry))
> +		return;
> +
> +	ionic->dentry = dentry;
> +}

Hi Shannon

There was recently a big patchset from GregKH which removed all error
checking from drivers calling debugfs calls. I'm pretty sure you don't
need this check here.

> +#ifdef CONFIG_DEBUG_FS
> +
> +void ionic_debugfs_create(void);
> +void ionic_debugfs_destroy(void);
> +void ionic_debugfs_add_dev(struct ionic *ionic);
> +void ionic_debugfs_del_dev(struct ionic *ionic);
> +void ionic_debugfs_add_ident(struct ionic *ionic);
> +#else
> +static inline void ionic_debugfs_create(void) { }
> +static inline void ionic_debugfs_destroy(void) { }
> +static inline void ionic_debugfs_add_dev(struct ionic *ionic) { }
> +static inline void ionic_debugfs_del_dev(struct ionic *ionic) { }
> +static inline void ionic_debugfs_add_ident(struct ionic *ionic) { }
> +#endif

Is this really needed? I would expect there to be stubs for all the
debugfs calls if it is disabled.

> +/**
> + * union drv_identity - driver identity information
> + * @os_type:          OS type (see enum os_type)
> + * @os_dist:          OS distribution, numeric format
> + * @os_dist_str:      OS distribution, string format
> + * @kernel_ver:       Kernel version, numeric format
> + * @kernel_ver_str:   Kernel version, string format
> + * @driver_ver_str:   Driver version, string format
> + */
> +union ionic_drv_identity {
> +	struct {
> +		__le32 os_type;
> +		__le32 os_dist;
> +		char   os_dist_str[128];
> +		__le32 kernel_ver;
> +		char   kernel_ver_str[32];
> +		char   driver_ver_str[32];
> +	};
> +	__le32 words[512];
> +};

> +int ionic_identify(struct ionic *ionic)
> +{
> +	struct ionic_identity *ident = &ionic->ident;
> +	struct ionic_dev *idev = &ionic->idev;
> +	size_t sz;
> +	int err;
> +
> +	memset(ident, 0, sizeof(*ident));
> +
> +	ident->drv.os_type = cpu_to_le32(IONIC_OS_TYPE_LINUX);
> +	ident->drv.os_dist = 0;
> +	strncpy(ident->drv.os_dist_str, utsname()->release,
> +		sizeof(ident->drv.os_dist_str) - 1);
> +	ident->drv.kernel_ver = cpu_to_le32(LINUX_VERSION_CODE);
> +	strncpy(ident->drv.kernel_ver_str, utsname()->version,
> +		sizeof(ident->drv.kernel_ver_str) - 1);
> +	strncpy(ident->drv.driver_ver_str, IONIC_DRV_VERSION,
> +		sizeof(ident->drv.driver_ver_str) - 1);
> +
> +	mutex_lock(&ionic->dev_cmd_lock);
> +

I don't know about others, but from a privacy prospective, i'm not so
happy about this. This is a smart NIC. It could be reporting back to
Mothership pensando with this information?

I would be happier if there was a privacy statement, right here,
saying what this information is used for, and an agreement it is not
used for anything else. If that gets violated, you can then only blame
yourself when we ripe this out and hard code it to static values.

	 Andrew

  reply	other threads:[~2019-08-27  2:26 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 21:33 [PATCH v5 net-next 00/18] ionic: Add ionic driver Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 01/18] ionic: Add basic framework for IONIC Network device driver Shannon Nelson
2019-08-27  4:06   ` Jakub Kicinski
2019-08-27 18:55     ` Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 02/18] ionic: Add hardware init and device commands Shannon Nelson
2019-08-27  2:26   ` Andrew Lunn [this message]
2019-08-27  4:28     ` Jakub Kicinski
2019-08-27 17:39     ` Shannon Nelson
2019-08-27 19:50       ` Andrew Lunn
2019-08-27 23:17         ` Shannon Nelson
2019-08-27  4:24   ` Jakub Kicinski
2019-08-27 21:22     ` Shannon Nelson
2019-08-28  3:16       ` Jakub Kicinski
2019-08-28  3:26         ` Shannon Nelson
2019-08-28  3:34           ` Jakub Kicinski
2019-08-26 21:33 ` [PATCH v5 net-next 03/18] ionic: Add port management commands Shannon Nelson
2019-08-27  4:36   ` Jakub Kicinski
2019-08-27 21:44     ` Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 04/18] ionic: Add basic lif support Shannon Nelson
2019-08-27  4:42   ` Jakub Kicinski
2019-08-27 23:29     ` Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 05/18] ionic: Add interrupts and doorbells Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 06/18] ionic: Add basic adminq support Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 07/18] ionic: Add adminq action Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 08/18] ionic: Add notifyq support Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 09/18] ionic: Add the basic NDO callbacks for netdev support Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 10/18] ionic: Add management of rx filters Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 11/18] ionic: Add Rx filter and rx_mode ndo support Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 12/18] ionic: Add async link status check and basic stats Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 13/18] ionic: Add initial ethtool support Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 14/18] ionic: Add Tx and Rx handling Shannon Nelson
2019-08-27  2:32   ` Yunsheng Lin
2019-08-27 18:52     ` Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 15/18] ionic: Add netdev-event handling Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 16/18] ionic: Add driver stats Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 17/18] ionic: Add RSS support Shannon Nelson
2019-08-26 21:33 ` [PATCH v5 net-next 18/18] ionic: Add coalesce and other features Shannon Nelson

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=20190827022628.GD13411@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=snelson@pensando.io \
    /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).