Re: [PATCH V2 net-next 20/21] net-next/hinic: Add ethtool and stats

2017-07-30 Thread Aviad Krawczyk
Hi,

I saw that netif_err is more common in code, is it preferred on netdev_err?
What is the preferred style, netif_ or netdev_?

Best Regards,
Aviad

On 7/27/2017 1:33 AM, Andrew Lunn wrote:
> On Wed, Jul 19, 2017 at 03:36:28PM +0300, Aviad Krawczyk wrote:
>> Hi Joe,
>>
>> I tried to be consistent with the comments before, that requested
>> that we will use dev_err exclude some special cases for use netif.
>>
>> We will replace the dev_err(>dev,.. to netdev_err in the
>> next fix.
> 
> netdev_err() should be used when possible. You just have to be careful
> in the probe() function, before netdev exists and you get "(NULL
> net_device):" or before it is registered and you get "(unnamed
> net_device)" instead of "eth42" etc.
> 
> Andrew
> 
> .
> 



Re: [PATCH V2 net-next 20/21] net-next/hinic: Add ethtool and stats

2017-07-26 Thread Andrew Lunn
On Wed, Jul 19, 2017 at 03:36:28PM +0300, Aviad Krawczyk wrote:
> Hi Joe,
> 
> I tried to be consistent with the comments before, that requested
> that we will use dev_err exclude some special cases for use netif.
> 
> We will replace the dev_err(>dev,.. to netdev_err in the
> next fix.

netdev_err() should be used when possible. You just have to be careful
in the probe() function, before netdev exists and you get "(NULL
net_device):" or before it is registered and you get "(unnamed
net_device)" instead of "eth42" etc.

  Andrew


Re: [PATCH V2 net-next 20/21] net-next/hinic: Add ethtool and stats

2017-07-19 Thread Aviad Krawczyk
Hi Joe,

I tried to be consistent with the comments before, that requested
that we will use dev_err exclude some special cases for use netif.

We will replace the dev_err(>dev,.. to netdev_err in the
next fix.

Thanks for review,
Aviad

On 7/19/2017 1:27 PM, Joe Perches wrote:
> On Wed, 2017-07-19 at 17:19 +0800, Aviad Krawczyk wrote:
>> Add ethtool operations and statistics operations.
> 
> series trivia:
> 
>> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c 
>> b/drivers/net/ethernet/huawei/hinic/hinic_main.c
> []
>> @@ -67,6 +67,178 @@
> []
>> +static int hinic_get_link_ksettings(struct net_device *netdev,
>> +struct ethtool_link_ksettings
>> +*link_ksettings)
>> +{
> []
>> +err = hinic_port_get_cap(nic_dev, _cap);
>> +if (err) {
>> +dev_err(>dev, "Failed to get port capabilities\n");
>> +return err;
>> +}
> 
> it looks like a lot of these dev_ calls
> should be converted to netdev_
> 
> from:
>   dev_err(>dev, ...);
> to:
>   netdev_err(netdev, ...);
> 
> etc...
> 
> 
> .
> 



Re: [PATCH V2 net-next 20/21] net-next/hinic: Add ethtool and stats

2017-07-19 Thread Joe Perches
On Wed, 2017-07-19 at 17:19 +0800, Aviad Krawczyk wrote:
> Add ethtool operations and statistics operations.

series trivia:

> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c 
> b/drivers/net/ethernet/huawei/hinic/hinic_main.c
[]
> @@ -67,6 +67,178 @@
[]
> +static int hinic_get_link_ksettings(struct net_device *netdev,
> + struct ethtool_link_ksettings
> + *link_ksettings)
> +{
[]
> + err = hinic_port_get_cap(nic_dev, _cap);
> + if (err) {
> + dev_err(>dev, "Failed to get port capabilities\n");
> + return err;
> + }

it looks like a lot of these dev_ calls
should be converted to netdev_

from:
dev_err(>dev, ...);
to:
netdev_err(netdev, ...);

etc...