Netdev List
 help / color / mirror / Atom feed
* [PATCH] llc: fix coding style and memory barrier documentation
@ 2026-05-05 19:25 Lucas Poupeau
  2026-05-05 20:19 ` Andrew Lunn
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Lucas Poupeau @ 2026-05-05 19:25 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni; +Cc: horms, netdev, linux-kernel, Lucas Poupeau

Fix multiple style issues reported by checkpatch.pl to improve code
maintainability and compliance with kernel standards.

Changes included:
- Add mandatory explanatory comments to memory barriers, specifying
  the reasoning and pairing context.
- Insert missing blank lines after variable declarations to improve
  readability.
- Relocate EXPORT_SYMBOL macros to immediately follow their respective
  function definitions as per the modern kernel coding style.

Note: Some indentation warnings from checkpatch.pl persist in this
commit. Despite several attempts to align them, the tool remains
capricious regarding these specific blocks, and further manual
refinement proved counterproductive.

Reported-by: checkpatch.pl
Signed-off-by: Lucas Poupeau <lucasp.linux@gmail.com>
---
 net/llc/llc_input.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index 61b0159b2fbe..500621d1bd75 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -1,8 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * llc_input.c - Minimal input path for LLC
  *
  * Copyright (c) 1997 by Procom Technology, Inc.
- * 		 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  *
  * This program can be redistributed or modified under the terms of the
  * GNU General Public License as published by the Free Software Foundation.
@@ -19,11 +20,6 @@
 #include <net/llc_pdu.h>
 #include <net/llc_sap.h>
 
-#if 0
-#define dprintk(args...) printk(KERN_DEBUG args)
-#else
-#define dprintk(args...)
-#endif
 
 /*
  * Packet handler for the station, registerable because in the minimal
@@ -46,6 +42,7 @@ void llc_add_pack(int type, void (*handler)(struct llc_sap *sap,
 	if (type == LLC_DEST_SAP || type == LLC_DEST_CONN)
 		llc_type_handlers[type - 1] = handler;
 }
+EXPORT_SYMBOL(llc_add_pack);
 
 void llc_remove_pack(int type)
 {
@@ -53,11 +50,17 @@ void llc_remove_pack(int type)
 		llc_type_handlers[type - 1] = NULL;
 	synchronize_net();
 }
+EXPORT_SYMBOL(llc_remove_pack);
 
 void llc_set_station_handler(void (*handler)(struct sk_buff *skb))
 {
 	/* Ensure initialisation is complete before it's called */
 	if (handler)
+    /*
+     * This barrier ensures that any previous memory operations
+     * are visible before the handler is executed.
+     * Pairs with the smp_wmb() in [indiquez ici la fonction ou le fichier].
+     */
 		smp_wmb();
 
 	llc_station_handler = handler;
@@ -65,6 +68,7 @@ void llc_set_station_handler(void (*handler)(struct sk_buff *skb))
 	if (!handler)
 		synchronize_net();
 }
+EXPORT_SYMBOL(llc_set_station_handler);
 
 /**
  *	llc_pdu_type - returns which LLC component must handle for PDU
@@ -72,7 +76,7 @@ void llc_set_station_handler(void (*handler)(struct sk_buff *skb))
  *
  *	This function returns which LLC component must handle this PDU.
  */
-static __inline__ int llc_pdu_type(struct sk_buff *skb)
+static inline int llc_pdu_type(struct sk_buff *skb)
 {
 	int type = LLC_DEST_CONN; /* I-PDU or S-PDU type */
 	struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
@@ -164,8 +168,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
 	struct llc_sap *sap;
 	struct llc_pdu_sn *pdu;
 	int dest;
-	int (*rcv)(struct sk_buff *, struct net_device *,
-		   struct packet_type *, struct net_device *);
+	int (*rcv)(struct sk_buff *skb, struct net_device *dev,
+		   struct packet_type *pt, struct net_device *orig_dev);
 	void (*sta_handler)(struct sk_buff *skb);
 	void (*sap_handler)(struct llc_sap *sap, struct sk_buff *skb);
 
@@ -206,6 +210,7 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
 	} else {
 		if (rcv) {
 			struct sk_buff *cskb = skb_clone(skb, GFP_ATOMIC);
+
 			if (cskb)
 				rcv(cskb, dev, pt, orig_dev);
 		}
@@ -217,6 +222,7 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
 drop:
 	kfree_skb(skb);
 	goto out;
+
 handle_station:
 	sta_handler = READ_ONCE(llc_station_handler);
 	if (!sta_handler)
@@ -225,6 +231,3 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
 	goto out;
 }
 
-EXPORT_SYMBOL(llc_add_pack);
-EXPORT_SYMBOL(llc_remove_pack);
-EXPORT_SYMBOL(llc_set_station_handler);
-- 
2.54.0


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

* Re: [PATCH] llc: fix coding style and memory barrier documentation
  2026-05-05 19:25 [PATCH] llc: fix coding style and memory barrier documentation Lucas Poupeau
@ 2026-05-05 20:19 ` Andrew Lunn
  2026-05-05 23:16 ` Jakub Kicinski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2026-05-05 20:19 UTC (permalink / raw)
  To: Lucas Poupeau; +Cc: davem, edumazet, kuba, pabeni, horms, netdev, linux-kernel

On Tue, May 05, 2026 at 09:25:49PM +0200, Lucas Poupeau wrote:
> Fix multiple style issues reported by checkpatch.pl to improve code
> maintainability and compliance with kernel standards.
> 
> Changes included:
> - Add mandatory explanatory comments to memory barriers, specifying
>   the reasoning and pairing context.
> - Insert missing blank lines after variable declarations to improve
>   readability.
> - Relocate EXPORT_SYMBOL macros to immediately follow their respective
>   function definitions as per the modern kernel coding style.
> 
> Note: Some indentation warnings from checkpatch.pl persist in this
> commit. Despite several attempts to align them, the tool remains
> capricious regarding these specific blocks, and further manual
> refinement proved counterproductive.
> 
> Reported-by: checkpatch.pl
> Signed-off-by: Lucas Poupeau <lucasp.linux@gmail.com>

Please take a read of

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

The Subject line needs to indicate what tree it is for.

Please also break this patch up. One patch per type of fix. You are
aiming for patches which are obviously correct. Such patches are
generally small, and have good commit messages.

> -#if 0
> -#define dprintk(args...) printk(KERN_DEBUG args)
> -#else
> -#define dprintk(args...)
> -#endif

It is not obvious why this is correct. Is dprintk() not actually used
in this file? That would be something you would say in the commit
message.

> +    /*
> +     * This barrier ensures that any previous memory operations
> +     * are visible before the handler is executed.
> +     * Pairs with the smp_wmb() in [indiquez ici la fonction ou le fichier].
> +     */

Please do specify the function here. Otherwise the comment is useless.

	Andrew

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

* Re: [PATCH] llc: fix coding style and memory barrier documentation
  2026-05-05 19:25 [PATCH] llc: fix coding style and memory barrier documentation Lucas Poupeau
  2026-05-05 20:19 ` Andrew Lunn
@ 2026-05-05 23:16 ` Jakub Kicinski
  2026-05-10  9:01 ` kernel test robot
  2026-05-10 23:57 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2026-05-05 23:16 UTC (permalink / raw)
  To: Lucas Poupeau; +Cc: davem, edumazet, pabeni, horms, netdev, linux-kernel

On Tue,  5 May 2026 21:25:49 +0200 Lucas Poupeau wrote:
> Fix multiple style issues reported by checkpatch.pl to improve code
> maintainability and compliance with kernel standards.

Quoting documentation:

  Clean-up patches
  ~~~~~~~~~~~~~~~~
  
  Netdev discourages patches which perform simple clean-ups, which are not in
  the context of other work. For example:
  
  * Addressing ``checkpatch.pl``, and other trivial coding style warnings
  * Addressing :ref:`Local variable ordering<rcs>` issues
  * Conversions to device-managed APIs (``devm_`` helpers)
  
  This is because it is felt that the churn that such changes produce comes
  at a greater cost than the value of such clean-ups.
  
  Conversely, spelling and grammar fixes are not discouraged.
  
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#clean-up-patches

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

* Re: [PATCH] llc: fix coding style and memory barrier documentation
  2026-05-05 19:25 [PATCH] llc: fix coding style and memory barrier documentation Lucas Poupeau
  2026-05-05 20:19 ` Andrew Lunn
  2026-05-05 23:16 ` Jakub Kicinski
@ 2026-05-10  9:01 ` kernel test robot
  2026-05-10 15:47   ` Lucas
  2026-05-10 23:57 ` kernel test robot
  3 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2026-05-10  9:01 UTC (permalink / raw)
  To: Lucas Poupeau, davem, edumazet, kuba, pabeni
  Cc: llvm, oe-kbuild-all, horms, netdev, linux-kernel, Lucas Poupeau

Hi Lucas,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]
[also build test ERROR on net/main linus/master horms-ipvs/master v7.1-rc2 next-20260508]
[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/Lucas-Poupeau/llc-fix-coding-style-and-memory-barrier-documentation/20260510-102311
base:   net-next/main
patch link:    https://lore.kernel.org/r/20260505192549.74382-1-lucasp.linux%40gmail.com
patch subject: [PATCH] llc: fix coding style and memory barrier documentation
config: riscv-randconfig-002-20260510 (https://download.01.org/0day-ci/archive/20260510/202605101615.XGX7gOua-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260510/202605101615.XGX7gOua-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605101615.XGX7gOua-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/llc/llc_input.c:181:3: error: call to undeclared function 'dprintk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     181 |                 dprintk("%s: PACKET_OTHERHOST\n", __func__);
         |                 ^
   net/llc/llc_input.c:194:3: error: call to undeclared function 'dprintk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     194 |                 dprintk("%s: llc_sap_find(%02X) failed!\n", __func__,
         |                 ^
   2 errors generated.


vim +/dprintk +181 net/llc/llc_input.c

^1da177e4c3f41 Linus Torvalds           2005-04-16  151  
^1da177e4c3f41 Linus Torvalds           2005-04-16  152  /**
^1da177e4c3f41 Linus Torvalds           2005-04-16  153   *	llc_rcv - 802.2 entry point from net lower layers
^1da177e4c3f41 Linus Torvalds           2005-04-16  154   *	@skb: received pdu
^1da177e4c3f41 Linus Torvalds           2005-04-16  155   *	@dev: device that receive pdu
^1da177e4c3f41 Linus Torvalds           2005-04-16  156   *	@pt: packet type
74c950c966c180 Andrew Lunn              2020-07-13  157   *	@orig_dev: the original receive net device
^1da177e4c3f41 Linus Torvalds           2005-04-16  158   *
^1da177e4c3f41 Linus Torvalds           2005-04-16  159   *	When the system receives a 802.2 frame this function is called. It
^1da177e4c3f41 Linus Torvalds           2005-04-16  160   *	checks SAP and connection of received pdu and passes frame to
^1da177e4c3f41 Linus Torvalds           2005-04-16  161   *	llc_{station,sap,conn}_rcv for sending to proper state machine. If
^1da177e4c3f41 Linus Torvalds           2005-04-16  162   *	the frame is related to a busy connection (a connection is sending
^1da177e4c3f41 Linus Torvalds           2005-04-16  163   *	data now), it queues this frame in the connection's backlog.
^1da177e4c3f41 Linus Torvalds           2005-04-16  164   */
^1da177e4c3f41 Linus Torvalds           2005-04-16  165  int llc_rcv(struct sk_buff *skb, struct net_device *dev,
f2ccd8fa06c8e3 David S. Miller          2005-08-09  166  	    struct packet_type *pt, struct net_device *orig_dev)
^1da177e4c3f41 Linus Torvalds           2005-04-16  167  {
^1da177e4c3f41 Linus Torvalds           2005-04-16  168  	struct llc_sap *sap;
^1da177e4c3f41 Linus Torvalds           2005-04-16  169  	struct llc_pdu_sn *pdu;
^1da177e4c3f41 Linus Torvalds           2005-04-16  170  	int dest;
846d7f9be89210 Lucas Poupeau            2026-05-05  171  	int (*rcv)(struct sk_buff *skb, struct net_device *dev,
846d7f9be89210 Lucas Poupeau            2026-05-05  172  		   struct packet_type *pt, struct net_device *orig_dev);
aadf31de16a7b2 Ben Hutchings            2012-08-13  173  	void (*sta_handler)(struct sk_buff *skb);
aadf31de16a7b2 Ben Hutchings            2012-08-13  174  	void (*sap_handler)(struct llc_sap *sap, struct sk_buff *skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  175  
^1da177e4c3f41 Linus Torvalds           2005-04-16  176  	/*
^1da177e4c3f41 Linus Torvalds           2005-04-16  177  	 * When the interface is in promisc. mode, drop all the crap that it
^1da177e4c3f41 Linus Torvalds           2005-04-16  178  	 * receives, do not try to analyse it.
^1da177e4c3f41 Linus Torvalds           2005-04-16  179  	 */
^1da177e4c3f41 Linus Torvalds           2005-04-16  180  	if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {
0dc47877a3de00 Harvey Harrison          2008-03-05 @181  		dprintk("%s: PACKET_OTHERHOST\n", __func__);
^1da177e4c3f41 Linus Torvalds           2005-04-16  182  		goto drop;
^1da177e4c3f41 Linus Torvalds           2005-04-16  183  	}
^1da177e4c3f41 Linus Torvalds           2005-04-16  184  	skb = skb_share_check(skb, GFP_ATOMIC);
^1da177e4c3f41 Linus Torvalds           2005-04-16  185  	if (unlikely(!skb))
^1da177e4c3f41 Linus Torvalds           2005-04-16  186  		goto out;
^1da177e4c3f41 Linus Torvalds           2005-04-16  187  	if (unlikely(!llc_fixup_skb(skb)))
^1da177e4c3f41 Linus Torvalds           2005-04-16  188  		goto drop;
^1da177e4c3f41 Linus Torvalds           2005-04-16  189  	pdu = llc_pdu_sn_hdr(skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  190  	if (unlikely(!pdu->dsap)) /* NULL DSAP, refer to station */
^1da177e4c3f41 Linus Torvalds           2005-04-16  191  	       goto handle_station;
^1da177e4c3f41 Linus Torvalds           2005-04-16  192  	sap = llc_sap_find(pdu->dsap);
^1da177e4c3f41 Linus Torvalds           2005-04-16  193  	if (unlikely(!sap)) {/* unknown SAP */
0dc47877a3de00 Harvey Harrison          2008-03-05  194  		dprintk("%s: llc_sap_find(%02X) failed!\n", __func__,
^1da177e4c3f41 Linus Torvalds           2005-04-16  195  			pdu->dsap);
^1da177e4c3f41 Linus Torvalds           2005-04-16  196  		goto drop;
^1da177e4c3f41 Linus Torvalds           2005-04-16  197  	}
^1da177e4c3f41 Linus Torvalds           2005-04-16  198  	/*
^1da177e4c3f41 Linus Torvalds           2005-04-16  199  	 * First the upper layer protocols that don't need the full
^1da177e4c3f41 Linus Torvalds           2005-04-16  200  	 * LLC functionality
^1da177e4c3f41 Linus Torvalds           2005-04-16  201  	 */
23dbe7912dad6b Stephen Hemminger        2006-05-25  202  	rcv = rcu_dereference(sap->rcv_func);
696ea472e19c6d Changli Gao              2011-02-22  203  	dest = llc_pdu_type(skb);
6aa7de059173a9 Mark Rutland             2017-10-23  204  	sap_handler = dest ? READ_ONCE(llc_type_handlers[dest - 1]) : NULL;
aadf31de16a7b2 Ben Hutchings            2012-08-13  205  	if (unlikely(!sap_handler)) {
696ea472e19c6d Changli Gao              2011-02-22  206  		if (rcv)
696ea472e19c6d Changli Gao              2011-02-22  207  			rcv(skb, dev, pt, orig_dev);
696ea472e19c6d Changli Gao              2011-02-22  208  		else
696ea472e19c6d Changli Gao              2011-02-22  209  			kfree_skb(skb);
696ea472e19c6d Changli Gao              2011-02-22  210  	} else {
23dbe7912dad6b Stephen Hemminger        2006-05-25  211  		if (rcv) {
8f182b494f8779 Stephen Hemminger        2006-05-25  212  			struct sk_buff *cskb = skb_clone(skb, GFP_ATOMIC);
846d7f9be89210 Lucas Poupeau            2026-05-05  213  
8f182b494f8779 Stephen Hemminger        2006-05-25  214  			if (cskb)
8f182b494f8779 Stephen Hemminger        2006-05-25  215  				rcv(cskb, dev, pt, orig_dev);
^1da177e4c3f41 Linus Torvalds           2005-04-16  216  		}
aadf31de16a7b2 Ben Hutchings            2012-08-13  217  		sap_handler(sap, skb);
696ea472e19c6d Changli Gao              2011-02-22  218  	}
6e2144b76840be Arnaldo Carvalho de Melo 2005-09-22  219  	llc_sap_put(sap);
^1da177e4c3f41 Linus Torvalds           2005-04-16  220  out:
^1da177e4c3f41 Linus Torvalds           2005-04-16  221  	return 0;
^1da177e4c3f41 Linus Torvalds           2005-04-16  222  drop:
^1da177e4c3f41 Linus Torvalds           2005-04-16  223  	kfree_skb(skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  224  	goto out;
846d7f9be89210 Lucas Poupeau            2026-05-05  225  
^1da177e4c3f41 Linus Torvalds           2005-04-16  226  handle_station:
6aa7de059173a9 Mark Rutland             2017-10-23  227  	sta_handler = READ_ONCE(llc_station_handler);
aadf31de16a7b2 Ben Hutchings            2012-08-13  228  	if (!sta_handler)
^1da177e4c3f41 Linus Torvalds           2005-04-16  229  		goto drop;
aadf31de16a7b2 Ben Hutchings            2012-08-13  230  	sta_handler(skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  231  	goto out;
^1da177e4c3f41 Linus Torvalds           2005-04-16  232  }
^1da177e4c3f41 Linus Torvalds           2005-04-16  233  

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

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

* Re: [PATCH] llc: fix coding style and memory barrier documentation
  2026-05-10  9:01 ` kernel test robot
@ 2026-05-10 15:47   ` Lucas
  0 siblings, 0 replies; 6+ messages in thread
From: Lucas @ 2026-05-10 15:47 UTC (permalink / raw)
  To: kernel test robot
  Cc: davem, edumazet, kuba, pabeni, llvm, oe-kbuild-all, horms, netdev,
	linux-kernel

Hi everyone,

I would like to withdraw this patch from further consideration.

Due to personal reasons, I need to step away and focus my attention
elsewhere for the time being. I won't be able to follow up on any
reviews or necessary changes at this stage.
I am very sorry for any inconvenience this may cause to the
maintainers and the community.

Best regards,
Lucas

On Sun, May 10, 2026 at 11:01 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Lucas,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on net-next/main]
> [also build test ERROR on net/main linus/master horms-ipvs/master v7.1-rc2 next-20260508]
> [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/Lucas-Poupeau/llc-fix-coding-style-and-memory-barrier-documentation/20260510-102311
> base:   net-next/main
> patch link:    https://lore.kernel.org/r/20260505192549.74382-1-lucasp.linux%40gmail.com
> patch subject: [PATCH] llc: fix coding style and memory barrier documentation
> config: riscv-randconfig-002-20260510 (https://download.01.org/0day-ci/archive/20260510/202605101615.XGX7gOua-lkp@intel.com/config)
> compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260510/202605101615.XGX7gOua-lkp@intel.com/reproduce)
>
> 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>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202605101615.XGX7gOua-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> >> net/llc/llc_input.c:181:3: error: call to undeclared function 'dprintk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>      181 |                 dprintk("%s: PACKET_OTHERHOST\n", __func__);
>          |                 ^
>    net/llc/llc_input.c:194:3: error: call to undeclared function 'dprintk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>      194 |                 dprintk("%s: llc_sap_find(%02X) failed!\n", __func__,
>          |                 ^
>    2 errors generated.
>
>
> vim +/dprintk +181 net/llc/llc_input.c
>
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  151
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  152  /**
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  153   *     llc_rcv - 802.2 entry point from net lower layers
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  154   *     @skb: received pdu
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  155   *     @dev: device that receive pdu
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  156   *     @pt: packet type
> 74c950c966c180 Andrew Lunn              2020-07-13  157   *     @orig_dev: the original receive net device
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  158   *
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  159   *     When the system receives a 802.2 frame this function is called. It
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  160   *     checks SAP and connection of received pdu and passes frame to
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  161   *     llc_{station,sap,conn}_rcv for sending to proper state machine. If
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  162   *     the frame is related to a busy connection (a connection is sending
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  163   *     data now), it queues this frame in the connection's backlog.
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  164   */
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  165  int llc_rcv(struct sk_buff *skb, struct net_device *dev,
> f2ccd8fa06c8e3 David S. Miller          2005-08-09  166             struct packet_type *pt, struct net_device *orig_dev)
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  167  {
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  168         struct llc_sap *sap;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  169         struct llc_pdu_sn *pdu;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  170         int dest;
> 846d7f9be89210 Lucas Poupeau            2026-05-05  171         int (*rcv)(struct sk_buff *skb, struct net_device *dev,
> 846d7f9be89210 Lucas Poupeau            2026-05-05  172                    struct packet_type *pt, struct net_device *orig_dev);
> aadf31de16a7b2 Ben Hutchings            2012-08-13  173         void (*sta_handler)(struct sk_buff *skb);
> aadf31de16a7b2 Ben Hutchings            2012-08-13  174         void (*sap_handler)(struct llc_sap *sap, struct sk_buff *skb);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  175
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  176         /*
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  177          * When the interface is in promisc. mode, drop all the crap that it
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  178          * receives, do not try to analyse it.
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  179          */
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  180         if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {
> 0dc47877a3de00 Harvey Harrison          2008-03-05 @181                 dprintk("%s: PACKET_OTHERHOST\n", __func__);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  182                 goto drop;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  183         }
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  184         skb = skb_share_check(skb, GFP_ATOMIC);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  185         if (unlikely(!skb))
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  186                 goto out;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  187         if (unlikely(!llc_fixup_skb(skb)))
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  188                 goto drop;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  189         pdu = llc_pdu_sn_hdr(skb);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  190         if (unlikely(!pdu->dsap)) /* NULL DSAP, refer to station */
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  191                goto handle_station;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  192         sap = llc_sap_find(pdu->dsap);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  193         if (unlikely(!sap)) {/* unknown SAP */
> 0dc47877a3de00 Harvey Harrison          2008-03-05  194                 dprintk("%s: llc_sap_find(%02X) failed!\n", __func__,
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  195                         pdu->dsap);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  196                 goto drop;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  197         }
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  198         /*
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  199          * First the upper layer protocols that don't need the full
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  200          * LLC functionality
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  201          */
> 23dbe7912dad6b Stephen Hemminger        2006-05-25  202         rcv = rcu_dereference(sap->rcv_func);
> 696ea472e19c6d Changli Gao              2011-02-22  203         dest = llc_pdu_type(skb);
> 6aa7de059173a9 Mark Rutland             2017-10-23  204         sap_handler = dest ? READ_ONCE(llc_type_handlers[dest - 1]) : NULL;
> aadf31de16a7b2 Ben Hutchings            2012-08-13  205         if (unlikely(!sap_handler)) {
> 696ea472e19c6d Changli Gao              2011-02-22  206                 if (rcv)
> 696ea472e19c6d Changli Gao              2011-02-22  207                         rcv(skb, dev, pt, orig_dev);
> 696ea472e19c6d Changli Gao              2011-02-22  208                 else
> 696ea472e19c6d Changli Gao              2011-02-22  209                         kfree_skb(skb);
> 696ea472e19c6d Changli Gao              2011-02-22  210         } else {
> 23dbe7912dad6b Stephen Hemminger        2006-05-25  211                 if (rcv) {
> 8f182b494f8779 Stephen Hemminger        2006-05-25  212                         struct sk_buff *cskb = skb_clone(skb, GFP_ATOMIC);
> 846d7f9be89210 Lucas Poupeau            2026-05-05  213
> 8f182b494f8779 Stephen Hemminger        2006-05-25  214                         if (cskb)
> 8f182b494f8779 Stephen Hemminger        2006-05-25  215                                 rcv(cskb, dev, pt, orig_dev);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  216                 }
> aadf31de16a7b2 Ben Hutchings            2012-08-13  217                 sap_handler(sap, skb);
> 696ea472e19c6d Changli Gao              2011-02-22  218         }
> 6e2144b76840be Arnaldo Carvalho de Melo 2005-09-22  219         llc_sap_put(sap);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  220  out:
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  221         return 0;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  222  drop:
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  223         kfree_skb(skb);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  224         goto out;
> 846d7f9be89210 Lucas Poupeau            2026-05-05  225
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  226  handle_station:
> 6aa7de059173a9 Mark Rutland             2017-10-23  227         sta_handler = READ_ONCE(llc_station_handler);
> aadf31de16a7b2 Ben Hutchings            2012-08-13  228         if (!sta_handler)
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  229                 goto drop;
> aadf31de16a7b2 Ben Hutchings            2012-08-13  230         sta_handler(skb);
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  231         goto out;
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  232  }
> ^1da177e4c3f41 Linus Torvalds           2005-04-16  233
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] llc: fix coding style and memory barrier documentation
  2026-05-05 19:25 [PATCH] llc: fix coding style and memory barrier documentation Lucas Poupeau
                   ` (2 preceding siblings ...)
  2026-05-10  9:01 ` kernel test robot
@ 2026-05-10 23:57 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-05-10 23:57 UTC (permalink / raw)
  To: Lucas Poupeau, davem, edumazet, kuba, pabeni
  Cc: oe-kbuild-all, horms, netdev, linux-kernel, Lucas Poupeau

Hi Lucas,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]
[also build test ERROR on net/main linus/master horms-ipvs/master v7.1-rc2 next-20260508]
[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/Lucas-Poupeau/llc-fix-coding-style-and-memory-barrier-documentation/20260510-102311
base:   net-next/main
patch link:    https://lore.kernel.org/r/20260505192549.74382-1-lucasp.linux%40gmail.com
patch subject: [PATCH] llc: fix coding style and memory barrier documentation
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20260511/202605110726.4BFheodB-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260511/202605110726.4BFheodB-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605110726.4BFheodB-lkp@intel.com/

All errors (new ones prefixed by >>):

   net/llc/llc_input.c: In function 'llc_rcv':
>> net/llc/llc_input.c:181:17: error: implicit declaration of function 'dprintk'; did you mean '_printk'? [-Werror=implicit-function-declaration]
     181 |                 dprintk("%s: PACKET_OTHERHOST\n", __func__);
         |                 ^~~~~~~
         |                 _printk
   cc1: some warnings being treated as errors


vim +181 net/llc/llc_input.c

^1da177e4c3f41 Linus Torvalds           2005-04-16  151  
^1da177e4c3f41 Linus Torvalds           2005-04-16  152  /**
^1da177e4c3f41 Linus Torvalds           2005-04-16  153   *	llc_rcv - 802.2 entry point from net lower layers
^1da177e4c3f41 Linus Torvalds           2005-04-16  154   *	@skb: received pdu
^1da177e4c3f41 Linus Torvalds           2005-04-16  155   *	@dev: device that receive pdu
^1da177e4c3f41 Linus Torvalds           2005-04-16  156   *	@pt: packet type
74c950c966c180 Andrew Lunn              2020-07-13  157   *	@orig_dev: the original receive net device
^1da177e4c3f41 Linus Torvalds           2005-04-16  158   *
^1da177e4c3f41 Linus Torvalds           2005-04-16  159   *	When the system receives a 802.2 frame this function is called. It
^1da177e4c3f41 Linus Torvalds           2005-04-16  160   *	checks SAP and connection of received pdu and passes frame to
^1da177e4c3f41 Linus Torvalds           2005-04-16  161   *	llc_{station,sap,conn}_rcv for sending to proper state machine. If
^1da177e4c3f41 Linus Torvalds           2005-04-16  162   *	the frame is related to a busy connection (a connection is sending
^1da177e4c3f41 Linus Torvalds           2005-04-16  163   *	data now), it queues this frame in the connection's backlog.
^1da177e4c3f41 Linus Torvalds           2005-04-16  164   */
^1da177e4c3f41 Linus Torvalds           2005-04-16  165  int llc_rcv(struct sk_buff *skb, struct net_device *dev,
f2ccd8fa06c8e3 David S. Miller          2005-08-09  166  	    struct packet_type *pt, struct net_device *orig_dev)
^1da177e4c3f41 Linus Torvalds           2005-04-16  167  {
^1da177e4c3f41 Linus Torvalds           2005-04-16  168  	struct llc_sap *sap;
^1da177e4c3f41 Linus Torvalds           2005-04-16  169  	struct llc_pdu_sn *pdu;
^1da177e4c3f41 Linus Torvalds           2005-04-16  170  	int dest;
846d7f9be89210 Lucas Poupeau            2026-05-05  171  	int (*rcv)(struct sk_buff *skb, struct net_device *dev,
846d7f9be89210 Lucas Poupeau            2026-05-05  172  		   struct packet_type *pt, struct net_device *orig_dev);
aadf31de16a7b2 Ben Hutchings            2012-08-13  173  	void (*sta_handler)(struct sk_buff *skb);
aadf31de16a7b2 Ben Hutchings            2012-08-13  174  	void (*sap_handler)(struct llc_sap *sap, struct sk_buff *skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  175  
^1da177e4c3f41 Linus Torvalds           2005-04-16  176  	/*
^1da177e4c3f41 Linus Torvalds           2005-04-16  177  	 * When the interface is in promisc. mode, drop all the crap that it
^1da177e4c3f41 Linus Torvalds           2005-04-16  178  	 * receives, do not try to analyse it.
^1da177e4c3f41 Linus Torvalds           2005-04-16  179  	 */
^1da177e4c3f41 Linus Torvalds           2005-04-16  180  	if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {
0dc47877a3de00 Harvey Harrison          2008-03-05 @181  		dprintk("%s: PACKET_OTHERHOST\n", __func__);
^1da177e4c3f41 Linus Torvalds           2005-04-16  182  		goto drop;
^1da177e4c3f41 Linus Torvalds           2005-04-16  183  	}
^1da177e4c3f41 Linus Torvalds           2005-04-16  184  	skb = skb_share_check(skb, GFP_ATOMIC);
^1da177e4c3f41 Linus Torvalds           2005-04-16  185  	if (unlikely(!skb))
^1da177e4c3f41 Linus Torvalds           2005-04-16  186  		goto out;
^1da177e4c3f41 Linus Torvalds           2005-04-16  187  	if (unlikely(!llc_fixup_skb(skb)))
^1da177e4c3f41 Linus Torvalds           2005-04-16  188  		goto drop;
^1da177e4c3f41 Linus Torvalds           2005-04-16  189  	pdu = llc_pdu_sn_hdr(skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  190  	if (unlikely(!pdu->dsap)) /* NULL DSAP, refer to station */
^1da177e4c3f41 Linus Torvalds           2005-04-16  191  	       goto handle_station;
^1da177e4c3f41 Linus Torvalds           2005-04-16  192  	sap = llc_sap_find(pdu->dsap);
^1da177e4c3f41 Linus Torvalds           2005-04-16  193  	if (unlikely(!sap)) {/* unknown SAP */
0dc47877a3de00 Harvey Harrison          2008-03-05  194  		dprintk("%s: llc_sap_find(%02X) failed!\n", __func__,
^1da177e4c3f41 Linus Torvalds           2005-04-16  195  			pdu->dsap);
^1da177e4c3f41 Linus Torvalds           2005-04-16  196  		goto drop;
^1da177e4c3f41 Linus Torvalds           2005-04-16  197  	}
^1da177e4c3f41 Linus Torvalds           2005-04-16  198  	/*
^1da177e4c3f41 Linus Torvalds           2005-04-16  199  	 * First the upper layer protocols that don't need the full
^1da177e4c3f41 Linus Torvalds           2005-04-16  200  	 * LLC functionality
^1da177e4c3f41 Linus Torvalds           2005-04-16  201  	 */
23dbe7912dad6b Stephen Hemminger        2006-05-25  202  	rcv = rcu_dereference(sap->rcv_func);
696ea472e19c6d Changli Gao              2011-02-22  203  	dest = llc_pdu_type(skb);
6aa7de059173a9 Mark Rutland             2017-10-23  204  	sap_handler = dest ? READ_ONCE(llc_type_handlers[dest - 1]) : NULL;
aadf31de16a7b2 Ben Hutchings            2012-08-13  205  	if (unlikely(!sap_handler)) {
696ea472e19c6d Changli Gao              2011-02-22  206  		if (rcv)
696ea472e19c6d Changli Gao              2011-02-22  207  			rcv(skb, dev, pt, orig_dev);
696ea472e19c6d Changli Gao              2011-02-22  208  		else
696ea472e19c6d Changli Gao              2011-02-22  209  			kfree_skb(skb);
696ea472e19c6d Changli Gao              2011-02-22  210  	} else {
23dbe7912dad6b Stephen Hemminger        2006-05-25  211  		if (rcv) {
8f182b494f8779 Stephen Hemminger        2006-05-25  212  			struct sk_buff *cskb = skb_clone(skb, GFP_ATOMIC);
846d7f9be89210 Lucas Poupeau            2026-05-05  213  
8f182b494f8779 Stephen Hemminger        2006-05-25  214  			if (cskb)
8f182b494f8779 Stephen Hemminger        2006-05-25  215  				rcv(cskb, dev, pt, orig_dev);
^1da177e4c3f41 Linus Torvalds           2005-04-16  216  		}
aadf31de16a7b2 Ben Hutchings            2012-08-13  217  		sap_handler(sap, skb);
696ea472e19c6d Changli Gao              2011-02-22  218  	}
6e2144b76840be Arnaldo Carvalho de Melo 2005-09-22  219  	llc_sap_put(sap);
^1da177e4c3f41 Linus Torvalds           2005-04-16  220  out:
^1da177e4c3f41 Linus Torvalds           2005-04-16  221  	return 0;
^1da177e4c3f41 Linus Torvalds           2005-04-16  222  drop:
^1da177e4c3f41 Linus Torvalds           2005-04-16  223  	kfree_skb(skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  224  	goto out;
846d7f9be89210 Lucas Poupeau            2026-05-05  225  
^1da177e4c3f41 Linus Torvalds           2005-04-16  226  handle_station:
6aa7de059173a9 Mark Rutland             2017-10-23  227  	sta_handler = READ_ONCE(llc_station_handler);
aadf31de16a7b2 Ben Hutchings            2012-08-13  228  	if (!sta_handler)
^1da177e4c3f41 Linus Torvalds           2005-04-16  229  		goto drop;
aadf31de16a7b2 Ben Hutchings            2012-08-13  230  	sta_handler(skb);
^1da177e4c3f41 Linus Torvalds           2005-04-16  231  	goto out;
^1da177e4c3f41 Linus Torvalds           2005-04-16  232  }
^1da177e4c3f41 Linus Torvalds           2005-04-16  233  

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

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

end of thread, other threads:[~2026-05-10 23:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 19:25 [PATCH] llc: fix coding style and memory barrier documentation Lucas Poupeau
2026-05-05 20:19 ` Andrew Lunn
2026-05-05 23:16 ` Jakub Kicinski
2026-05-10  9:01 ` kernel test robot
2026-05-10 15:47   ` Lucas
2026-05-10 23:57 ` kernel test robot

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