Subject: Re: [PATCH net-next 5/9] net/eipoib: Add ethtool file support

From: Or Gerlitz <[email-masked]>
Date: Wed, 11 Jul 2012 11:40:05 +0300

On 7/10/2012 8:48 PM, Ben Hutchings wrote:
> +static void parent_ethtool_get_drvinfo(struct net_device *parent_dev,
> +				       struct ethtool_drvinfo *drvinfo)
> +{
> +	struct parent *parent = netdev_priv(parent_dev);
> +
> +	if (strlen(DRV_NAME) + strlen(parent->ipoib_main_interface) > 31)
> +		strncpy(drvinfo->driver, "driver name is too long", 32);
> Returning error messages like is stupid; either truncate or WARN.

OK

>
>> +	else
>> +		sprintf(drvinfo->driver, "%s:%s",
>> +			DRV_NAME, parent->ipoib_main_interface);
> Why do you not use the separate driver and bus_info fields?

OK, we'll use the bus info field for placing the name of the PIF

>
>> +static const char parent_strings[][ETH_GSTRING_LEN] = {
>> +	/* public statistics */
>> +	"rx_packets", "tx_packets", "rx_bytes",
>> +	"tx_bytes", "rx_errors", "tx_errors",
>> +	"rx_dropped", "tx_dropped", "multicast",
>> +	"collisions", "rx_length_errors", "rx_over_errors",
>> +	"rx_crc_errors", "rx_frame_errors", "rx_fifo_errors",
>> +	"rx_missed_errors", "tx_aborted_errors", "tx_carrier_errors",
>> +	"tx_fifo_errors", "tx_heartbeat_errors", "tx_window_errors",
>> +#define PUB_STATS_LEN	21
> [...]
>
> This is duplicating the basic netdev statistics that are already available without
> ethtool.  Most of them are completely meaningless for Infiniband, I suspect.

OK, will implement the ndo get stats entry for the basic statistics instead