All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv4 net-next 0/4] net: common feature compute for upper interface
@ 2025-10-14  8:02 Hangbin Liu
  2025-10-14  8:02 ` [PATCHv4 net-next 1/4] net: add a common function to compute features from lowers devices Hangbin Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Hangbin Liu @ 2025-10-14  8:02 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Sabrina Dubroca, Jiri Pirko,
	Simon Horman, Ido Schimmel, Shuah Khan, Stanislav Fomichev,
	Stanislav Fomichev, Kuniyuki Iwashima, Ahmed Zaki,
	Alexander Lobakin, bridge, linux-kselftest, Hangbin Liu

Some high-level virtual drivers need to compute features from their
lower devices, but each currently has its own implementation and may
miss some feature computations. This patch set introduces a common function
to compute features for such devices.

Currently, bonding, team, and bridge have been updated to use the new
helper.

v4:
* update needed_{headroom, tailroom} in the common helper (Ido Schimmel)
* remove unneeded err in team (Stanislav Fomichev)
* remove selftest as `ethtool -k` does not test the dev->*_features. We
  can add back the selftest when there is a good way to test. (Sabrina Dubroca)

v3:
a) fix hw_enc_features asign order (Sabrina Dubroca)
b) set virtual dev feature defination in netdev_features.h (Jakub Kicinski)
c) remove unneeded err in team_del_slave (Stanislav Fomichev)
d) remove NETIF_F_HW_ESP test as it needs to be test with GSO pkts (Sabrina Dubroca)

v2:
a) remove hard_header_len setting. I will set needed_headroom for bond/team
   in a separate patch as bridge has it's own ways. (Ido Schimmel)
b) Add test file to Makefile, set RET=0 to a proper location. (Ido Schimmel)

Hangbin Liu (4):
  net: add a common function to compute features from lowers devices
  bonding: use common function to compute the features
  team: use common function to compute the features
  net: bridge: use common function to compute the features

 drivers/net/bonding/bond_main.c | 99 ++-------------------------------
 drivers/net/team/team_core.c    | 83 ++-------------------------
 include/linux/netdev_features.h | 18 ++++++
 include/linux/netdevice.h       |  1 +
 net/bridge/br_if.c              | 22 +-------
 net/core/dev.c                  | 95 +++++++++++++++++++++++++++++++
 6 files changed, 127 insertions(+), 191 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: [PATCHv4 net-next 1/4] net: add a common function to compute features from lowers devices
@ 2025-10-16 23:51 kernel test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-10-16 23:51 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20251014080217.47988-2-liuhangbin@gmail.com>
References: <20251014080217.47988-2-liuhangbin@gmail.com>
TO: Hangbin Liu <liuhangbin@gmail.com>
TO: netdev@vger.kernel.org
CC: Jay Vosburgh <jv@jvosburgh.net>
CC: Andrew Lunn <andrew+netdev@lunn.ch>
CC: Eric Dumazet <edumazet@google.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Paolo Abeni <pabeni@redhat.com>
CC: Sabrina Dubroca <sdubroca@redhat.com>
CC: Jiri Pirko <jiri@resnulli.us>
CC: Simon Horman <horms@kernel.org>
CC: Ido Schimmel <idosch@nvidia.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: Stanislav Fomichev <sdf@fomichev.me>
CC: Kuniyuki Iwashima <kuniyu@google.com>
CC: Alexander Lobakin <aleksander.lobakin@intel.com>
CC: bridge@lists.linux.dev
CC: linux-kselftest@vger.kernel.org
CC: Hangbin Liu <liuhangbin@gmail.com>

Hi Hangbin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Hangbin-Liu/net-add-a-common-function-to-compute-features-from-lowers-devices/20251014-160824
base:   net-next/main
patch link:    https://lore.kernel.org/r/20251014080217.47988-2-liuhangbin%40gmail.com
patch subject: [PATCHv4 net-next 1/4] net: add a common function to compute features from lowers devices
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-141-20251015 (https://download.01.org/0day-ci/archive/20251017/202510170720.CKUqiiSx-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202510170720.CKUqiiSx-lkp@intel.com/

New smatch warnings:
net/core/dev.c:12676 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_headroom'.
net/core/dev.c:12678 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_tailroom'.

Old smatch warnings:
net/core/dev.c:12703 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_headroom'.
net/core/dev.c:12704 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_tailroom'.

vim +/max_headroom +12676 net/core/dev.c

93045b1e9511f0f Hangbin Liu 2025-10-14  12666  
93045b1e9511f0f Hangbin Liu 2025-10-14  12667  		mpls_features = netdev_increment_features(mpls_features,
93045b1e9511f0f Hangbin Liu 2025-10-14  12668  							  lower_dev->mpls_features,
93045b1e9511f0f Hangbin Liu 2025-10-14  12669  							  VIRTUAL_DEV_MPLS_FEATURES);
93045b1e9511f0f Hangbin Liu 2025-10-14  12670  
93045b1e9511f0f Hangbin Liu 2025-10-14  12671  		dst_release_flag &= lower_dev->priv_flags;
93045b1e9511f0f Hangbin Liu 2025-10-14  12672  
93045b1e9511f0f Hangbin Liu 2025-10-14  12673  		if (update_header) {
93045b1e9511f0f Hangbin Liu 2025-10-14  12674  			max_header_len = max_t(unsigned short, max_header_len,
93045b1e9511f0f Hangbin Liu 2025-10-14  12675  					lower_dev->hard_header_len);
93045b1e9511f0f Hangbin Liu 2025-10-14 @12676  			max_headroom = max_t(unsigned short, max_headroom,
93045b1e9511f0f Hangbin Liu 2025-10-14  12677  					lower_dev->needed_headroom);
93045b1e9511f0f Hangbin Liu 2025-10-14 @12678  			max_tailroom = max_t(unsigned short, max_tailroom,
93045b1e9511f0f Hangbin Liu 2025-10-14  12679  					lower_dev->needed_tailroom);
93045b1e9511f0f Hangbin Liu 2025-10-14  12680  		}
93045b1e9511f0f Hangbin Liu 2025-10-14  12681  
93045b1e9511f0f Hangbin Liu 2025-10-14  12682  		tso_max_size = min(tso_max_size, lower_dev->tso_max_size);
93045b1e9511f0f Hangbin Liu 2025-10-14  12683  		tso_max_segs = min(tso_max_segs, lower_dev->tso_max_segs);
93045b1e9511f0f Hangbin Liu 2025-10-14  12684  	}
93045b1e9511f0f Hangbin Liu 2025-10-14  12685  
93045b1e9511f0f Hangbin Liu 2025-10-14  12686  	dev->gso_partial_features = gso_partial_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12687  	dev->vlan_features = vlan_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12688  	dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
93045b1e9511f0f Hangbin Liu 2025-10-14  12689  				    NETIF_F_HW_VLAN_CTAG_TX |
93045b1e9511f0f Hangbin Liu 2025-10-14  12690  				    NETIF_F_HW_VLAN_STAG_TX;
93045b1e9511f0f Hangbin Liu 2025-10-14  12691  #ifdef CONFIG_XFRM_OFFLOAD
93045b1e9511f0f Hangbin Liu 2025-10-14  12692  	dev->hw_enc_features |= xfrm_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12693  #endif
93045b1e9511f0f Hangbin Liu 2025-10-14  12694  	dev->mpls_features = mpls_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12695  
93045b1e9511f0f Hangbin Liu 2025-10-14  12696  	dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
93045b1e9511f0f Hangbin Liu 2025-10-14  12697  	if ((dev->priv_flags & IFF_XMIT_DST_RELEASE_PERM) &&
93045b1e9511f0f Hangbin Liu 2025-10-14  12698  	    dst_release_flag == (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
93045b1e9511f0f Hangbin Liu 2025-10-14  12699  		dev->priv_flags |= IFF_XMIT_DST_RELEASE;
93045b1e9511f0f Hangbin Liu 2025-10-14  12700  
93045b1e9511f0f Hangbin Liu 2025-10-14  12701  	if (update_header) {
93045b1e9511f0f Hangbin Liu 2025-10-14  12702  		dev->hard_header_len = max_header_len;
93045b1e9511f0f Hangbin Liu 2025-10-14  12703  		dev->needed_headroom = max_headroom;
93045b1e9511f0f Hangbin Liu 2025-10-14  12704  		dev->needed_tailroom = max_tailroom;
93045b1e9511f0f Hangbin Liu 2025-10-14  12705  	}
93045b1e9511f0f Hangbin Liu 2025-10-14  12706  
93045b1e9511f0f Hangbin Liu 2025-10-14  12707  	netif_set_tso_max_segs(dev, tso_max_segs);
93045b1e9511f0f Hangbin Liu 2025-10-14  12708  	netif_set_tso_max_size(dev, tso_max_size);
93045b1e9511f0f Hangbin Liu 2025-10-14  12709  
93045b1e9511f0f Hangbin Liu 2025-10-14  12710  	netdev_change_features(dev);
93045b1e9511f0f Hangbin Liu 2025-10-14  12711  }
93045b1e9511f0f Hangbin Liu 2025-10-14  12712  EXPORT_SYMBOL(netdev_compute_features_from_lowers);
93045b1e9511f0f Hangbin Liu 2025-10-14  12713  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: [PATCHv4 net-next 1/4] net: add a common function to compute features from lowers devices
@ 2025-10-19  5:52 kernel test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-10-19  5:52 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20251014080217.47988-2-liuhangbin@gmail.com>
References: <20251014080217.47988-2-liuhangbin@gmail.com>
TO: Hangbin Liu <liuhangbin@gmail.com>
TO: netdev@vger.kernel.org
CC: Jay Vosburgh <jv@jvosburgh.net>
CC: Andrew Lunn <andrew+netdev@lunn.ch>
CC: Eric Dumazet <edumazet@google.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Paolo Abeni <pabeni@redhat.com>
CC: Sabrina Dubroca <sdubroca@redhat.com>
CC: Jiri Pirko <jiri@resnulli.us>
CC: Simon Horman <horms@kernel.org>
CC: Ido Schimmel <idosch@nvidia.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: Stanislav Fomichev <sdf@fomichev.me>
CC: Kuniyuki Iwashima <kuniyu@google.com>
CC: Alexander Lobakin <aleksander.lobakin@intel.com>
CC: bridge@lists.linux.dev
CC: linux-kselftest@vger.kernel.org
CC: Hangbin Liu <liuhangbin@gmail.com>

Hi Hangbin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Hangbin-Liu/net-add-a-common-function-to-compute-features-from-lowers-devices/20251014-160824
base:   net-next/main
patch link:    https://lore.kernel.org/r/20251014080217.47988-2-liuhangbin%40gmail.com
patch subject: [PATCHv4 net-next 1/4] net: add a common function to compute features from lowers devices
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: i386-randconfig-141-20251015 (https://download.01.org/0day-ci/archive/20251019/202510191336.5MademAX-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202510191336.5MademAX-lkp@intel.com/

New smatch warnings:
net/core/dev.c:12676 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_headroom'.
net/core/dev.c:12678 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_tailroom'.

Old smatch warnings:
net/core/dev.c:12703 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_headroom'.
net/core/dev.c:12704 netdev_compute_features_from_lowers() error: uninitialized symbol 'max_tailroom'.

vim +/max_headroom +12676 net/core/dev.c

93045b1e9511f0f Hangbin Liu 2025-10-14  12666  
93045b1e9511f0f Hangbin Liu 2025-10-14  12667  		mpls_features = netdev_increment_features(mpls_features,
93045b1e9511f0f Hangbin Liu 2025-10-14  12668  							  lower_dev->mpls_features,
93045b1e9511f0f Hangbin Liu 2025-10-14  12669  							  VIRTUAL_DEV_MPLS_FEATURES);
93045b1e9511f0f Hangbin Liu 2025-10-14  12670  
93045b1e9511f0f Hangbin Liu 2025-10-14  12671  		dst_release_flag &= lower_dev->priv_flags;
93045b1e9511f0f Hangbin Liu 2025-10-14  12672  
93045b1e9511f0f Hangbin Liu 2025-10-14  12673  		if (update_header) {
93045b1e9511f0f Hangbin Liu 2025-10-14  12674  			max_header_len = max_t(unsigned short, max_header_len,
93045b1e9511f0f Hangbin Liu 2025-10-14  12675  					lower_dev->hard_header_len);
93045b1e9511f0f Hangbin Liu 2025-10-14 @12676  			max_headroom = max_t(unsigned short, max_headroom,
93045b1e9511f0f Hangbin Liu 2025-10-14  12677  					lower_dev->needed_headroom);
93045b1e9511f0f Hangbin Liu 2025-10-14 @12678  			max_tailroom = max_t(unsigned short, max_tailroom,
93045b1e9511f0f Hangbin Liu 2025-10-14  12679  					lower_dev->needed_tailroom);
93045b1e9511f0f Hangbin Liu 2025-10-14  12680  		}
93045b1e9511f0f Hangbin Liu 2025-10-14  12681  
93045b1e9511f0f Hangbin Liu 2025-10-14  12682  		tso_max_size = min(tso_max_size, lower_dev->tso_max_size);
93045b1e9511f0f Hangbin Liu 2025-10-14  12683  		tso_max_segs = min(tso_max_segs, lower_dev->tso_max_segs);
93045b1e9511f0f Hangbin Liu 2025-10-14  12684  	}
93045b1e9511f0f Hangbin Liu 2025-10-14  12685  
93045b1e9511f0f Hangbin Liu 2025-10-14  12686  	dev->gso_partial_features = gso_partial_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12687  	dev->vlan_features = vlan_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12688  	dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
93045b1e9511f0f Hangbin Liu 2025-10-14  12689  				    NETIF_F_HW_VLAN_CTAG_TX |
93045b1e9511f0f Hangbin Liu 2025-10-14  12690  				    NETIF_F_HW_VLAN_STAG_TX;
93045b1e9511f0f Hangbin Liu 2025-10-14  12691  #ifdef CONFIG_XFRM_OFFLOAD
93045b1e9511f0f Hangbin Liu 2025-10-14  12692  	dev->hw_enc_features |= xfrm_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12693  #endif
93045b1e9511f0f Hangbin Liu 2025-10-14  12694  	dev->mpls_features = mpls_features;
93045b1e9511f0f Hangbin Liu 2025-10-14  12695  
93045b1e9511f0f Hangbin Liu 2025-10-14  12696  	dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
93045b1e9511f0f Hangbin Liu 2025-10-14  12697  	if ((dev->priv_flags & IFF_XMIT_DST_RELEASE_PERM) &&
93045b1e9511f0f Hangbin Liu 2025-10-14  12698  	    dst_release_flag == (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
93045b1e9511f0f Hangbin Liu 2025-10-14  12699  		dev->priv_flags |= IFF_XMIT_DST_RELEASE;
93045b1e9511f0f Hangbin Liu 2025-10-14  12700  
93045b1e9511f0f Hangbin Liu 2025-10-14  12701  	if (update_header) {
93045b1e9511f0f Hangbin Liu 2025-10-14  12702  		dev->hard_header_len = max_header_len;
93045b1e9511f0f Hangbin Liu 2025-10-14  12703  		dev->needed_headroom = max_headroom;
93045b1e9511f0f Hangbin Liu 2025-10-14  12704  		dev->needed_tailroom = max_tailroom;
93045b1e9511f0f Hangbin Liu 2025-10-14  12705  	}
93045b1e9511f0f Hangbin Liu 2025-10-14  12706  
93045b1e9511f0f Hangbin Liu 2025-10-14  12707  	netif_set_tso_max_segs(dev, tso_max_segs);
93045b1e9511f0f Hangbin Liu 2025-10-14  12708  	netif_set_tso_max_size(dev, tso_max_size);
93045b1e9511f0f Hangbin Liu 2025-10-14  12709  
93045b1e9511f0f Hangbin Liu 2025-10-14  12710  	netdev_change_features(dev);
93045b1e9511f0f Hangbin Liu 2025-10-14  12711  }
93045b1e9511f0f Hangbin Liu 2025-10-14  12712  EXPORT_SYMBOL(netdev_compute_features_from_lowers);
93045b1e9511f0f Hangbin Liu 2025-10-14  12713  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-10-19  5:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14  8:02 [PATCHv4 net-next 0/4] net: common feature compute for upper interface Hangbin Liu
2025-10-14  8:02 ` [PATCHv4 net-next 1/4] net: add a common function to compute features from lowers devices Hangbin Liu
2025-10-14  9:40   ` Jiri Pirko
2025-10-15  1:25     ` Hangbin Liu
2025-10-16 11:27       ` Jiri Pirko
2025-10-16 12:38         ` Hangbin Liu
2025-10-16 13:24           ` Jiri Pirko
2025-10-17  2:53             ` Hangbin Liu
2025-10-14 14:02   ` Simon Horman
2025-10-15  3:03     ` Hangbin Liu
2025-10-14  8:02 ` [PATCHv4 net-next 2/4] bonding: use common function to compute the features Hangbin Liu
2025-10-14  8:02 ` [PATCHv4 net-next 3/4] team: " Hangbin Liu
2025-10-14  8:02 ` [PATCHv4 net-next 4/4] net: bridge: " Hangbin Liu
  -- strict thread matches above, loose matches on Subject: below --
2025-10-16 23:51 [PATCHv4 net-next 1/4] net: add a common function to compute features from lowers devices kernel test robot
2025-10-19  5:52 kernel test robot

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.