[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9de0a7a7-d609-ccfd-d27c-1b64b6366751@pensando.io>
Date: Tue, 9 Jul 2019 15:34:14 -0700
From: Shannon Nelson <snelson@...sando.io>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v3 net-next 13/19] ionic: Add initial ethtool support
On 7/8/19 10:25 PM, Michal Kubecek wrote:
> On Mon, Jul 08, 2019 at 12:25:26PM -0700, Shannon Nelson wrote:
>> Add in the basic ethtool callbacks for device information
>> and control.
>>
>> +
>> + if (fec_type != idev->port_info->config.fec_type) {
>> + mutex_lock(&ionic->dev_cmd_lock);
>> + ionic_dev_cmd_port_fec(idev, PORT_FEC_TYPE_NONE);
> The second argument should be fec_type, I believe.
Yep.
>
>> + err = ionic_dev_cmd_wait(ionic, devcmd_timeout);
>> + mutex_unlock(&ionic->dev_cmd_lock);
>> + if (err)
>> + return err;
>> +
>> + idev->port_info->config.fec_type = fec_type;
>> + }
>> +
>> + return 0;
>> +}
> ...
>> +static int ionic_set_ringparam(struct net_device *netdev,
>> + struct ethtool_ringparam *ring)
>> +{
>> + struct lif *lif = netdev_priv(netdev);
>> + bool running;
>> + int i, j;
>> +
>> + if (ring->rx_mini_pending || ring->rx_jumbo_pending) {
>> + netdev_info(netdev, "Changing jumbo or mini descriptors not supported\n");
>> + return -EINVAL;
>> + }
>> +
>> + i = ring->tx_pending & (ring->tx_pending - 1);
>> + j = ring->rx_pending & (ring->rx_pending - 1);
>> + if (i || j) {
>> + netdev_info(netdev, "Descriptor count must be a power of 2\n");
>> + return -EINVAL;
>> + }
> You can use is_power_of_2() here (it wouldn't allow 0 but you probably
> don't want to allow that either).
Sure.
Thanks,
sln
Powered by blists - more mailing lists