All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@dev.mellanox.co.il>
To: David Miller <davem@davemloft.net>
Cc: Saeed Mahameed <saeedm@mellanox.com>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Or Gerlitz <ogerlitz@mellanox.com>, Tal Alon <talal@mellanox.com>,
	Eran Ben Elisha <eranbe@mellanox.com>
Subject: Re: [PATCH net-next V1 00/11] Mellanox 100G extending mlx5 ethtool support
Date: Tue, 26 Apr 2016 23:55:03 +0300	[thread overview]
Message-ID: <CALzJLG-BJvB7h2wAOqy8ibDdkw7Croaiy7+QU9izrcivuS1yOg@mail.gmail.com> (raw)
In-Reply-To: <20160426.160301.938979848864279754.davem@davemloft.net>

On Tue, Apr 26, 2016 at 11:03 PM, David Miller <davem@davemloft.net> wrote:
>
> Series applied.
>
> Be careful about what feature update semantics you implement.  If you get a request
> to change multiple feature bits, and even one of them cannot be done, the entire
> update operation should fail and the bits should revert to what they were before
> the request.

It will be a nightmare to rollback in such case.  What if the rollback failed ?

>
> Is that how the code behaves now?
>

Not exactly.  If the set/clear of Bit(I) is performed successfully we
set/clear that feature in dev->features ourselves,
and if one fails we return a negative error code so
__netdev_update_features will notify on the failure, but we will be
left with the features that we did success to modify.

__netdev_update_features@net/core/dev.c

if (unlikely(err < 0)) {
        netdev_err(dev,
                        "set_features() failed (%d); wanted %pNF, left %pNF\n",
                        err, &features, &dev->features);
        /* return non-0 since some features might have changed and
         * it's better to fire a spurious notification than miss it
         */
         return -1;
}

>From this I understand it is ok to update the dev->features inside the
device's set_features NDO and return a negative value in case of
failure,
and a notification on changed features will be fired in anycase.

Is this a correct assumption ?

Anyhow if you think this behavior should be fixed, we will fix it.
Failures at set_features should be rare and should be debugged rather
than ignored.

Saeed.

  reply	other threads:[~2016-04-26 20:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24 19:51 [PATCH net-next V1 00/11] Mellanox 100G extending mlx5 ethtool support Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 01/11] net/mlx5e: Report additional error statistics in get stats ndo Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 02/11] net/mlx5e: Statistics handling refactoring Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 03/11] net/mlx5e: Rename VPort counters Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 04/11] net/mlx5e: Add per priority group to PPort counters Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 05/11] net/mlx5e: Add link down events counter Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 06/11] net/mlx5e: Improve set features ndo resiliency Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 07/11] net/mlx5e: Add support for RXALL netdev feature Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 08/11] net/mlx5e: Add ethtool support for interface identify (LED blinking) Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 09/11] net/mlx5e: Add ethtool support for dump module EEPROM Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 10/11] net/mlx5e: Add ethtool support for rxvlan-offload (vlan stripping) Saeed Mahameed
2016-04-24 19:51 ` [PATCH net-next V1 11/11] net/mlx5e: Fix checksum handling for non-stripped vlan packets Saeed Mahameed
2016-04-26 20:03 ` [PATCH net-next V1 00/11] Mellanox 100G extending mlx5 ethtool support David Miller
2016-04-26 20:55   ` Saeed Mahameed [this message]
2016-04-26 21:41     ` David Miller
2016-04-29 20:27       ` Saeed Mahameed
2016-04-29 20:34         ` David Miller
2016-04-29 21:14           ` Saeed Mahameed

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=CALzJLG-BJvB7h2wAOqy8ibDdkw7Croaiy7+QU9izrcivuS1yOg@mail.gmail.com \
    --to=saeedm@dev.mellanox.co.il \
    --cc=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=talal@mellanox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.