All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jian Shen <shenjian15@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <andrew@lunn.ch>,
	<ecree.xilinx@gmail.com>, <hkallweit1@gmail.com>,
	<alexandr.lobakin@intel.com>, <saeed@kernel.org>,
	<leon@kernel.org>
Cc: <netdev@vger.kernel.org>, <linuxarm@openeuler.org>,
	<lipeng321@huawei.com>
Subject: [RFCv6 PATCH net-next 16/19] net: use netdev_features_equal helpers
Date: Tue, 19 Apr 2022 10:22:03 +0800	[thread overview]
Message-ID: <20220419022206.36381-17-shenjian15@huawei.com> (raw)
In-Reply-To: <20220419022206.36381-1-shenjian15@huawei.com>

Replace the '==' and '!=' operations of features by
netdev_features_equal helpers.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/ethernet/sfc/efx_common.c | 2 +-
 drivers/net/ethernet/sfc/falcon/efx.c | 2 +-
 net/core/dev.c                        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
index 769f3a8b3ff9..6851f2196041 100644
--- a/drivers/net/ethernet/sfc/efx_common.c
+++ b/drivers/net/ethernet/sfc/efx_common.c
@@ -417,7 +417,7 @@ static void efx_start_datapath(struct efx_nic *efx)
 	netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
 	netdev_hw_features_clear(efx->net_dev, efx->fixed_features);
 	netdev_active_features_set(efx->net_dev, efx->fixed_features);
-	if (efx->net_dev->features != old_features)
+	if (!netdev_active_features_equal(efx->net_dev, old_features))
 		netdev_features_change(efx->net_dev);
 
 	/* RX filters may also have scatter-enabled flags */
diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index 52d3ced17602..0bbe83f661d1 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -644,7 +644,7 @@ static void ef4_start_datapath(struct ef4_nic *efx)
 	netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
 	netdev_hw_features_clear(efx->net_dev, efx->fixed_features);
 	netdev_active_features_set(efx->net_dev, efx->fixed_features);
-	if (efx->net_dev->features != old_features)
+	if (!netdev_active_features_equal(efx->net_dev, old_features))
 		netdev_features_change(efx->net_dev);
 
 	/* RX filters may also have scatter-enabled flags */
diff --git a/net/core/dev.c b/net/core/dev.c
index 03e64399c7b4..c59f50898444 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9632,7 +9632,7 @@ int __netdev_update_features(struct net_device *dev)
 	netdev_for_each_upper_dev_rcu(dev, upper, iter)
 		features = netdev_sync_upper_features(dev, upper, features);
 
-	if (dev->features == features)
+	if (netdev_active_features_equal(dev, features))
 		goto sync_lower;
 
 	netdev_dbg(dev, "Features changed: %pNF -> %pNF\n",
-- 
2.33.0


  parent reply	other threads:[~2022-04-19  2:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  2:21 [RFCv6 PATCH net-next 00/19] net: extend the type of netdev_features_t to bitmap Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 01/19] net: introduce operation helpers for netdev features Jian Shen
2022-04-19 14:40   ` Alexander Lobakin
2022-04-20  9:24     ` shenjian (K)
2022-04-19  2:21 ` [RFCv6 PATCH net-next 02/19] net: replace general features macroes with global netdev_features variables Jian Shen
2022-04-19 14:49   ` Alexander Lobakin
2022-04-20  9:54     ` shenjian (K)
2022-07-20 15:09       ` Alexander Lobakin
2022-07-21  1:15         ` shenjian (K)
2022-07-21 14:57           ` Alexander Lobakin
2022-07-21 15:21             ` shenjian (K)
2022-07-20 15:10       ` Alexander Lobakin
2022-07-20 15:13       ` Alexander Lobakin
2022-04-19  2:21 ` [RFCv6 PATCH net-next 03/19] net: replace multiple feature bits with netdev features array Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 04/19] net: sfc: replace const features initialization " Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 05/19] net: simplify the netdev features expression Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 06/19] net: adjust variables definition for netdev_features_t Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 07/19] net: use netdev_feature_add helpers Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 08/19] net: use netdev_features_or helpers Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 09/19] net: use netdev_features_xor helpers Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 10/19] net: use netdev_feature_del helpers Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 11/19] net: use netdev_features_andnot helpers Jian Shen
2022-04-19  2:21 ` [RFCv6 PATCH net-next 12/19] net: use netdev_feature_test helpers Jian Shen
2022-04-19  2:22 ` [RFCv6 PATCH net-next 13/19] net: use netdev_features_intersects helpers Jian Shen
2022-04-19  2:22 ` [RFCv6 PATCH net-next 14/19] net: use netdev_features_and helpers Jian Shen
2022-04-19  2:22 ` [RFCv6 PATCH net-next 15/19] net: use netdev_features_subset helpers Jian Shen
2022-04-19  2:22 ` Jian Shen [this message]
2022-04-19  2:22 ` [RFCv6 PATCH net-next 17/19] net: use netdev_features_copy helpers Jian Shen
2022-04-19  2:22 ` [RFCv6 PATCH net-next 18/19] net: use netdev_xxx_features helpers Jian Shen
2022-04-19  2:22 ` [RFCv6 PATCH net-next 19/19] net: redefine the prototype of netdev_features_t Jian Shen

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=20220419022206.36381-17-shenjian15@huawei.com \
    --to=shenjian15@huawei.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeed@kernel.org \
    /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.