public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option.
@ 2023-03-30  7:03 Boon Khai Ng
  2023-03-30 10:02 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Boon Khai Ng @ 2023-03-30  7:03 UTC (permalink / raw)
  To: David S . Miller; +Cc: linux-kernel, Mun Yew Tham, Tien Sung Ang, Boon Khai Ng

This patch is to fix toggling rx vlan offload from the ethool.

Signed-off-by: Boon Khai Ng <boon.khai.ng@intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8ee595d46481..664c32d61622 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4565,10 +4565,8 @@ static void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
 	veth = (struct vlan_ethhdr *)skb->data;
 	vlan_proto = veth->h_vlan_proto;
 
-	if ((vlan_proto == htons(ETH_P_8021Q) &&
-	     dev->features & NETIF_F_HW_VLAN_CTAG_RX) ||
-	    (vlan_proto == htons(ETH_P_8021AD) &&
-	     dev->features & NETIF_F_HW_VLAN_STAG_RX)) {
+	if (vlan_proto == htons(ETH_P_8021Q) ||
+	    vlan_proto == htons(ETH_P_8021AD)) {
 		/* pop the vlan tag */
 		vlanid = ntohs(veth->h_vlan_TCI);
 		memmove(skb->data + VLAN_HLEN, veth, ETH_ALEN * 2);
@@ -5685,6 +5683,8 @@ static int stmmac_set_features(struct net_device *netdev,
 
 	if (changed & NETIF_F_HW_VLAN_CTAG_RX)
 		stmmac_set_hw_vlan_mode(priv, priv->ioaddr, features);
+		priv->plat->use_hw_vlan = features & NETIF_F_HW_VLAN_CTAG_RX;
+	}
 
 	return 0;
 }
-- 
2.25.1


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

* Re: [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option.
  2023-03-30  7:03 [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option Boon Khai Ng
@ 2023-03-30 10:02 ` kernel test robot
  2023-03-30 11:24 ` kernel test robot
  2023-03-30 17:24 ` Please ignore this review, send out by accident Boon Khai Ng
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-03-30 10:02 UTC (permalink / raw)
  To: Boon Khai Ng, David S . Miller
  Cc: oe-kbuild-all, linux-kernel, Mun Yew Tham, Tien Sung Ang,
	Boon Khai Ng

Hi Boon,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/main]
[also build test WARNING on net/main linus/master v6.3-rc4 next-20230330]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Boon-Khai-Ng/drivers-net-stmmac_main-Add-support-for-HW-accelerated-VLAN-Stripping/20230330-150648
patch link:    https://lore.kernel.org/r/20230330070305.18808-1-boon.khai.ng%40intel.com
patch subject: [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option.
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20230330/202303301734.QmN1Bc6n-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/fb80bd4d4331439d42a4c555121e4bc27ddcd16f
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Boon-Khai-Ng/drivers-net-stmmac_main-Add-support-for-HW-accelerated-VLAN-Stripping/20230330-150648
        git checkout fb80bd4d4331439d42a4c555121e4bc27ddcd16f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 olddefconfig
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/net/ethernet/stmicro/stmmac/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303301734.QmN1Bc6n-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_set_features':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5684:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    5684 |         if (changed & NETIF_F_HW_VLAN_CTAG_RX)
         |         ^~
   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5686:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    5686 |                 priv->plat->use_hw_vlan = features & NETIF_F_HW_VLAN_CTAG_RX;
         |                 ^~~~
   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5687:9: error: no return statement in function returning non-void [-Werror=return-type]
    5687 |         }
         |         ^
   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: At top level:
   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5689:9: error: expected identifier or '(' before 'return'
    5689 |         return 0;
         |         ^~~~~~
   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5690:1: error: expected identifier or '(' before '}' token
    5690 | }
         | ^
   cc1: some warnings being treated as errors


vim +/if +5684 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

47dd7a540b8a0cd drivers/net/stmmac/stmmac_main.c                  Giuseppe Cavallaro 2009-10-14  5656  
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5657  static int stmmac_set_features(struct net_device *netdev,
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5658  			       netdev_features_t features)
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5659  {
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5660  	struct stmmac_priv *priv = netdev_priv(netdev);
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5661  
854ecb883886d78 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5662  	netdev_features_t changed;
854ecb883886d78 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5663  
854ecb883886d78 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5664  	changed = netdev->features ^ features;
854ecb883886d78 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5665  
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5666  	/* Keep the COE Type in case of csum is supporting */
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5667  	if (features & NETIF_F_RXCSUM)
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5668  		priv->hw->rx_csum = priv->plat->rx_coe;
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5669  	else
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5670  		priv->hw->rx_csum = 0;
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5671  	/* No check needed because rx_coe has been set before and it will be
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5672  	 * fixed in case of issue.
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5673  	 */
c10d4c82a5c84c2 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Jose Abreu         2018-04-16  5674  	stmmac_rx_ipc(priv, priv->hw);
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5675  
f8e7dfd6fdabb83 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Vincent Whitchurch 2021-11-26  5676  	if (priv->sph_cap) {
f8e7dfd6fdabb83 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Vincent Whitchurch 2021-11-26  5677  		bool sph_en = (priv->hw->rx_csum > 0) && priv->sph;
f8e7dfd6fdabb83 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Vincent Whitchurch 2021-11-26  5678  		u32 chan;
5fabb01207a2d34 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Ong Boon Leong     2021-04-01  5679  
67afd6d1cfdf0d0 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Jose Abreu         2019-08-17  5680  		for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++)
67afd6d1cfdf0d0 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Jose Abreu         2019-08-17  5681  			stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
f8e7dfd6fdabb83 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Vincent Whitchurch 2021-11-26  5682  	}
67afd6d1cfdf0d0 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Jose Abreu         2019-08-17  5683  
854ecb883886d78 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30 @5684  	if (changed & NETIF_F_HW_VLAN_CTAG_RX)
854ecb883886d78 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5685  		stmmac_set_hw_vlan_mode(priv, priv->ioaddr, features);
fb80bd4d4331439 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5686  		priv->plat->use_hw_vlan = features & NETIF_F_HW_VLAN_CTAG_RX;
fb80bd4d4331439 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5687  	}
854ecb883886d78 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Boon Khai Ng       2023-03-30  5688  
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5689  	return 0;
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5690  }
d2afb5bdffde3da drivers/net/ethernet/stmicro/stmmac/stmmac_main.c Giuseppe CAVALLARO 2014-09-01  5691  

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

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

* Re: [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option.
  2023-03-30  7:03 [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option Boon Khai Ng
  2023-03-30 10:02 ` kernel test robot
@ 2023-03-30 11:24 ` kernel test robot
  2023-03-30 17:24 ` Please ignore this review, send out by accident Boon Khai Ng
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-03-30 11:24 UTC (permalink / raw)
  To: Boon Khai Ng, David S . Miller
  Cc: llvm, oe-kbuild-all, linux-kernel, Mun Yew Tham, Tien Sung Ang,
	Boon Khai Ng

Hi Boon,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/main]
[also build test ERROR on net/main linus/master v6.3-rc4 next-20230330]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Boon-Khai-Ng/drivers-net-stmmac_main-Add-support-for-HW-accelerated-VLAN-Stripping/20230330-150648
patch link:    https://lore.kernel.org/r/20230330070305.18808-1-boon.khai.ng%40intel.com
patch subject: [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option.
config: x86_64-randconfig-a016 (https://download.01.org/0day-ci/archive/20230330/202303301902.TxsoXxWD-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/fb80bd4d4331439d42a4c555121e4bc27ddcd16f
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Boon-Khai-Ng/drivers-net-stmmac_main-Add-support-for-HW-accelerated-VLAN-Stripping/20230330-150648
        git checkout fb80bd4d4331439d42a4c555121e4bc27ddcd16f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303301902.TxsoXxWD-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5687:2: error: non-void function does not return a value [-Werror,-Wreturn-type]
           }
           ^
>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5689:2: error: expected identifier or '('
           return 0;
           ^
>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5690:1: error: extraneous closing brace ('}')
   }
   ^
   3 errors generated.


vim +5687 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

  5656	
  5657	static int stmmac_set_features(struct net_device *netdev,
  5658				       netdev_features_t features)
  5659	{
  5660		struct stmmac_priv *priv = netdev_priv(netdev);
  5661	
  5662		netdev_features_t changed;
  5663	
  5664		changed = netdev->features ^ features;
  5665	
  5666		/* Keep the COE Type in case of csum is supporting */
  5667		if (features & NETIF_F_RXCSUM)
  5668			priv->hw->rx_csum = priv->plat->rx_coe;
  5669		else
  5670			priv->hw->rx_csum = 0;
  5671		/* No check needed because rx_coe has been set before and it will be
  5672		 * fixed in case of issue.
  5673		 */
  5674		stmmac_rx_ipc(priv, priv->hw);
  5675	
  5676		if (priv->sph_cap) {
  5677			bool sph_en = (priv->hw->rx_csum > 0) && priv->sph;
  5678			u32 chan;
  5679	
  5680			for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++)
  5681				stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
  5682		}
  5683	
  5684		if (changed & NETIF_F_HW_VLAN_CTAG_RX)
  5685			stmmac_set_hw_vlan_mode(priv, priv->ioaddr, features);
  5686			priv->plat->use_hw_vlan = features & NETIF_F_HW_VLAN_CTAG_RX;
> 5687		}
  5688	
> 5689		return 0;
> 5690	}
  5691	

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

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

* Please ignore this review, send out by accident.
  2023-03-30  7:03 [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option Boon Khai Ng
  2023-03-30 10:02 ` kernel test robot
  2023-03-30 11:24 ` kernel test robot
@ 2023-03-30 17:24 ` Boon Khai Ng
  2 siblings, 0 replies; 4+ messages in thread
From: Boon Khai Ng @ 2023-03-30 17:24 UTC (permalink / raw)
  To: boon.khai.ng; +Cc: davem, linux-kernel, mun.yew.tham, tien.sung.ang

My appologies for sending out this review by accident, this is meant for internal reivew,
kindly ignore and close this thread. Thanks.

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

end of thread, other threads:[~2023-03-30 17:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-30  7:03 [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option Boon Khai Ng
2023-03-30 10:02 ` kernel test robot
2023-03-30 11:24 ` kernel test robot
2023-03-30 17:24 ` Please ignore this review, send out by accident Boon Khai Ng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox