All of lore.kernel.org
 help / color / mirror / Atom feed
* [batman:batadv/net 2/2] net/batman-adv/bat_v_ogm.c:886:2: error: expected identifier or '(' before 'if'
@ 2020-07-30  9:58 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-30  9:58 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 30582 bytes --]

tree:   https://git.open-mesh.org/linux-merge.git batadv/net
head:   187fb1ba640b9af2ae6793b45f56b1a7f7d0f09a
commit: 187fb1ba640b9af2ae6793b45f56b1a7f7d0f09a [2/2] batman-adv: Fix own OGM check in aggregated OGMs
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
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
        git checkout 187fb1ba640b9af2ae6793b45f56b1a7f7d0f09a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from arch/xtensa/include/asm/processor.h:15,
                    from arch/xtensa/include/asm/atomic.h:18,
                    from include/linux/atomic.h:7,
                    from net/batman-adv/main.h:208,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     193 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   arch/xtensa/include/asm/page.h:201:32: note: in expansion of macro 'pfn_valid'
     201 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from ./arch/xtensa/include/generated/asm/bug.h:1,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/xtensa/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/skbuff.h:15,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/batman-adv/main.h:210,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
   arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     193 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/asm-generic/bug.h:144:27: note: in definition of macro 'WARN_ON_ONCE'
     144 |  int __ret_warn_once = !!(condition);   \
         |                           ^~~~~~~~~
   include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
     352 |  if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
         |                   ^~~~~~~~~
   net/batman-adv/bat_v_ogm.c: In function 'batadv_v_ogm_process':
   net/batman-adv/bat_v_ogm.c:863:6: warning: unused variable 'ret' [-Wunused-variable]
     863 |  int ret;
         |      ^~~
   net/batman-adv/bat_v_ogm.c:862:39: warning: unused variable 'path_throughput' [-Wunused-variable]
     862 |  u32 ogm_throughput, link_throughput, path_throughput;
         |                                       ^~~~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:862:22: warning: unused variable 'link_throughput' [-Wunused-variable]
     862 |  u32 ogm_throughput, link_throughput, path_throughput;
         |                      ^~~~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:860:28: warning: unused variable 'hard_iface' [-Wunused-variable]
     860 |  struct batadv_hard_iface *hard_iface;
         |                            ^~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:859:28: warning: unused variable 'neigh_node' [-Wunused-variable]
     859 |  struct batadv_neigh_node *neigh_node = NULL;
         |                            ^~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:858:35: warning: unused variable 'hardif_neigh' [-Wunused-variable]
     858 |  struct batadv_hardif_neigh_node *hardif_neigh = NULL;
         |                                   ^~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:857:27: warning: unused variable 'orig_node' [-Wunused-variable]
     857 |  struct batadv_orig_node *orig_node = NULL;
         |                           ^~~~~~~~~
   net/batman-adv/bat_v_ogm.c: At top level:
>> net/batman-adv/bat_v_ogm.c:886:2: error: expected identifier or '(' before 'if'
     886 |  if (ogm_throughput == 0) {
         |  ^~
>> net/batman-adv/bat_v_ogm.c:893:2: warning: data definition has no type or storage class
     893 |  hardif_neigh = batadv_hardif_neigh_get(if_incoming, ethhdr->h_source);
         |  ^~~~~~~~~~~~
>> net/batman-adv/bat_v_ogm.c:893:2: error: type defaults to 'int' in declaration of 'hardif_neigh' [-Werror=implicit-int]
>> net/batman-adv/bat_v_ogm.c:893:41: error: 'if_incoming' undeclared here (not in a function); did you mean 'ifinfomsg'?
     893 |  hardif_neigh = batadv_hardif_neigh_get(if_incoming, ethhdr->h_source);
         |                                         ^~~~~~~~~~~
         |                                         ifinfomsg
>> net/batman-adv/bat_v_ogm.c:893:54: error: 'ethhdr' undeclared here (not in a function)
     893 |  hardif_neigh = batadv_hardif_neigh_get(if_incoming, ethhdr->h_source);
         |                                                      ^~~~~~
   net/batman-adv/bat_v_ogm.c:894:2: error: expected identifier or '(' before 'if'
     894 |  if (!hardif_neigh) {
         |  ^~
   net/batman-adv/bat_v_ogm.c:900:2: warning: data definition has no type or storage class
     900 |  orig_node = batadv_v_ogm_orig_get(bat_priv, ogm_packet->orig);
         |  ^~~~~~~~~
>> net/batman-adv/bat_v_ogm.c:900:2: error: type defaults to 'int' in declaration of 'orig_node' [-Werror=implicit-int]
>> net/batman-adv/bat_v_ogm.c:900:36: error: 'bat_priv' undeclared here (not in a function); did you mean 'batadv_priv'?
     900 |  orig_node = batadv_v_ogm_orig_get(bat_priv, ogm_packet->orig);
         |                                    ^~~~~~~~
         |                                    batadv_priv
>> net/batman-adv/bat_v_ogm.c:900:46: error: 'ogm_packet' undeclared here (not in a function)
     900 |  orig_node = batadv_v_ogm_orig_get(bat_priv, ogm_packet->orig);
         |                                              ^~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:901:2: error: expected identifier or '(' before 'if'
     901 |  if (!orig_node)
         |  ^~
   net/batman-adv/bat_v_ogm.c:904:2: warning: data definition has no type or storage class
     904 |  neigh_node = batadv_neigh_node_get_or_create(orig_node, if_incoming,
         |  ^~~~~~~~~~
>> net/batman-adv/bat_v_ogm.c:904:2: error: type defaults to 'int' in declaration of 'neigh_node' [-Werror=implicit-int]
>> net/batman-adv/bat_v_ogm.c:904:47: warning: passing argument 1 of 'batadv_neigh_node_get_or_create' makes pointer from integer without a cast [-Wint-conversion]
     904 |  neigh_node = batadv_neigh_node_get_or_create(orig_node, if_incoming,
         |                                               ^~~~~~~~~
         |                                               |
         |                                               int
   In file included from net/batman-adv/bat_v_ogm.c:39:
   net/batman-adv/originator.h:33:1: note: expected 'struct batadv_orig_node *' but argument is of type 'int'
      33 | batadv_neigh_node_get_or_create(struct batadv_orig_node *orig_node,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:906:2: error: expected identifier or '(' before 'if'
     906 |  if (!neigh_node)
         |  ^~
   net/batman-adv/bat_v_ogm.c:916:2: warning: data definition has no type or storage class
     916 |  link_throughput = ewma_throughput_read(&hardif_neigh->bat_v.throughput);
         |  ^~~~~~~~~~~~~~~
>> net/batman-adv/bat_v_ogm.c:916:2: error: type defaults to 'int' in declaration of 'link_throughput' [-Werror=implicit-int]
>> net/batman-adv/bat_v_ogm.c:916:54: error: invalid type argument of '->' (have 'int')
     916 |  link_throughput = ewma_throughput_read(&hardif_neigh->bat_v.throughput);
         |                                                      ^~
   net/batman-adv/bat_v_ogm.c:917:2: warning: data definition has no type or storage class
     917 |  path_throughput = min_t(u32, link_throughput, ogm_throughput);
         |  ^~~~~~~~~~~~~~~
>> net/batman-adv/bat_v_ogm.c:917:2: error: type defaults to 'int' in declaration of 'path_throughput' [-Werror=implicit-int]
   In file included from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/batman-adv/main.h:210,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
>> net/batman-adv/bat_v_ogm.c:917:48: error: 'ogm_throughput' undeclared here (not in a function); did you mean 'ewma_throughput'?
     917 |  path_throughput = min_t(u32, link_throughput, ogm_throughput);
         |                                                ^~~~~~~~~~~~~~
   include/linux/kernel.h:851:40: note: in definition of macro '__typecheck'
     851 |   (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
         |                                        ^
   include/linux/kernel.h:875:24: note: in expansion of macro '__safe_cmp'
     875 |  __builtin_choose_expr(__safe_cmp(x, y), \
         |                        ^~~~~~~~~~
   include/linux/kernel.h:943:27: note: in expansion of macro '__careful_cmp'
     943 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
         |                           ^~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:917:20: note: in expansion of macro 'min_t'
     917 |  path_throughput = min_t(u32, link_throughput, ogm_throughput);
         |                    ^~~~~
>> include/linux/kernel.h:869:50: error: braced-group within expression allowed only inside a function
     869 | #define __cmp_once(x, y, unique_x, unique_y, op) ({ \
         |                                                  ^
   include/linux/kernel.h:877:3: note: in expansion of macro '__cmp_once'
     877 |   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
         |   ^~~~~~~~~~
   include/linux/kernel.h:943:27: note: in expansion of macro '__careful_cmp'
     943 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
         |                           ^~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:917:20: note: in expansion of macro 'min_t'
     917 |  path_throughput = min_t(u32, link_throughput, ogm_throughput);
         |                    ^~~~~
>> include/linux/kernel.h:875:2: error: first argument to '__builtin_choose_expr' not a constant
     875 |  __builtin_choose_expr(__safe_cmp(x, y), \
         |  ^~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:943:27: note: in expansion of macro '__careful_cmp'
     943 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
         |                           ^~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:917:20: note: in expansion of macro 'min_t'
     917 |  path_throughput = min_t(u32, link_throughput, ogm_throughput);
         |                    ^~~~~
>> net/batman-adv/bat_v_ogm.c:918:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
     918 |  ogm_packet->throughput = htonl(path_throughput);
         |            ^~
>> net/batman-adv/bat_v_ogm.c:921:36: error: expected ')' before '(' token
     921 |            neigh_node, if_incoming,
         |                                    ^
         |                                    )
   net/batman-adv/bat_v_ogm.c:924:2: warning: data definition has no type or storage class
     924 |  rcu_read_lock();
         |  ^~~~~~~~~~~~~
>> net/batman-adv/bat_v_ogm.c:924:2: error: type defaults to 'int' in declaration of 'rcu_read_lock' [-Werror=implicit-int]
>> net/batman-adv/bat_v_ogm.c:924:2: error: function declaration isn't a prototype [-Werror=strict-prototypes]
   net/batman-adv/bat_v_ogm.c:924:2: error: conflicting types for 'rcu_read_lock'
   In file included from include/linux/rbtree.h:22,
                    from include/linux/mm_types.h:10,
                    from include/linux/mmzone.h:21,
                    from include/linux/gfp.h:6,
                    from include/linux/mm.h:10,
                    from include/linux/bvec.h:13,
                    from include/linux/skbuff.h:17,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/batman-adv/main.h:210,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
   include/linux/rcupdate.h:630:29: note: previous definition of 'rcu_read_lock' was here
     630 | static __always_inline void rcu_read_lock(void)
         |                             ^~~~~~~~~~~~~
   In file included from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from include/linux/mm.h:31,
                    from include/linux/bvec.h:13,
                    from include/linux/skbuff.h:17,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/batman-adv/main.h:210,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
   include/linux/rculist.h:381:2: error: expected identifier or '(' before 'for'
     381 |  for (__list_check_rcu(dummy, ## cond, 0),   \
         |  ^~~
   net/batman-adv/bat_v_ogm.c:925:2: note: in expansion of macro 'list_for_each_entry_rcu'
     925 |  list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
         |  ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/rculist.h:65:3: error: expected identifier or '(' before ')' token
      65 |  })
         |   ^
   include/linux/rculist.h:381:7: note: in expansion of macro '__list_check_rcu'
     381 |  for (__list_check_rcu(dummy, ## cond, 0),   \
         |       ^~~~~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:925:2: note: in expansion of macro 'list_for_each_entry_rcu'
     925 |  list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
         |  ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/batman-adv/main.h:210,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
   include/linux/kernel.h:1006:48: error: expected identifier or '(' before ')' token
    1006 |  ((type *)(__mptr - offsetof(type, member))); })
         |                                                ^
   include/linux/rculist.h:306:2: note: in expansion of macro 'container_of'
     306 |  container_of(READ_ONCE(ptr), type, member)
         |  ^~~~~~~~~~~~
   include/linux/rculist.h:382:13: note: in expansion of macro 'list_entry_rcu'
     382 |       pos = list_entry_rcu((head)->next, typeof(*pos), member); \
         |             ^~~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:925:2: note: in expansion of macro 'list_for_each_entry_rcu'
     925 |  list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
         |  ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from include/linux/mm.h:31,
                    from include/linux/bvec.h:13,
                    from include/linux/skbuff.h:17,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/batman-adv/main.h:210,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
   include/linux/rculist.h:383:3: error: expected identifier or '(' before '&' token
     383 |   &pos->member != (head);     \
         |   ^
   net/batman-adv/bat_v_ogm.c:925:2: note: in expansion of macro 'list_for_each_entry_rcu'
     925 |  list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
         |  ^~~~~~~~~~~~~~~~~~~~~~~
   net/batman-adv/bat_v_ogm.c:925:26: warning: data definition has no type or storage class
     925 |  list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
         |                          ^~~~~~~~~~
   include/linux/rculist.h:384:3: note: in definition of macro 'list_for_each_entry_rcu'
     384 |   pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
         |   ^~~
   net/batman-adv/bat_v_ogm.c:925:26: error: type defaults to 'int' in declaration of 'hard_iface' [-Werror=implicit-int]
     925 |  list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
         |                          ^~~~~~~~~~
   include/linux/rculist.h:384:3: note: in definition of macro 'list_for_each_entry_rcu'
     384 |   pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
         |   ^~~
   In file included from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/batman-adv/main.h:210,
                    from net/batman-adv/bat_v_ogm.h:10,
                    from net/batman-adv/bat_v_ogm.c:7:
   include/linux/kernel.h:1001:41: error: braced-group within expression allowed only inside a function
    1001 | #define container_of(ptr, type, member) ({    \
         |                                         ^
   include/linux/rculist.h:306:2: note: in expansion of macro 'container_of'
     306 |  container_of(READ_ONCE(ptr), type, member)
         |  ^~~~~~~~~~~~
   include/linux/rculist.h:384:9: note: in expansion of macro 'list_entry_rcu'

vim +886 net/batman-adv/bat_v_ogm.c

9323158ef9f499 Antonio Quartulli 2016-01-16  845  
9323158ef9f499 Antonio Quartulli 2016-01-16  846  /**
7e9a8c2ce7c5f8 Sven Eckelmann    2017-12-02  847   * batadv_v_ogm_process() - process an incoming batman v OGM
9323158ef9f499 Antonio Quartulli 2016-01-16  848   * @skb: the skb containing the OGM
9323158ef9f499 Antonio Quartulli 2016-01-16  849   * @ogm_offset: offset to the OGM which should be processed (for aggregates)
9323158ef9f499 Antonio Quartulli 2016-01-16  850   * @if_incoming: the interface where this packet was receved
9323158ef9f499 Antonio Quartulli 2016-01-16  851   */
9323158ef9f499 Antonio Quartulli 2016-01-16  852  static void batadv_v_ogm_process(const struct sk_buff *skb, int ogm_offset,
9323158ef9f499 Antonio Quartulli 2016-01-16  853  				 struct batadv_hard_iface *if_incoming)
9323158ef9f499 Antonio Quartulli 2016-01-16  854  {
9323158ef9f499 Antonio Quartulli 2016-01-16  855  	struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
9323158ef9f499 Antonio Quartulli 2016-01-16  856  	struct ethhdr *ethhdr;
9323158ef9f499 Antonio Quartulli 2016-01-16  857  	struct batadv_orig_node *orig_node = NULL;
9323158ef9f499 Antonio Quartulli 2016-01-16  858  	struct batadv_hardif_neigh_node *hardif_neigh = NULL;
9323158ef9f499 Antonio Quartulli 2016-01-16  859  	struct batadv_neigh_node *neigh_node = NULL;
9323158ef9f499 Antonio Quartulli 2016-01-16  860  	struct batadv_hard_iface *hard_iface;
9323158ef9f499 Antonio Quartulli 2016-01-16  861  	struct batadv_ogm2_packet *ogm_packet;
9323158ef9f499 Antonio Quartulli 2016-01-16  862  	u32 ogm_throughput, link_throughput, path_throughput;
3111beed0d595d Linus Lüssing     2016-08-07  863  	int ret;
9323158ef9f499 Antonio Quartulli 2016-01-16  864  
9323158ef9f499 Antonio Quartulli 2016-01-16  865  	ethhdr = eth_hdr(skb);
9323158ef9f499 Antonio Quartulli 2016-01-16  866  	ogm_packet = (struct batadv_ogm2_packet *)(skb->data + ogm_offset);
9323158ef9f499 Antonio Quartulli 2016-01-16  867  
9323158ef9f499 Antonio Quartulli 2016-01-16  868  	ogm_throughput = ntohl(ogm_packet->throughput);
9323158ef9f499 Antonio Quartulli 2016-01-16  869  
9323158ef9f499 Antonio Quartulli 2016-01-16  870  	batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
f25cbb2a6ac1ce Colin Ian King    2017-06-26  871  		   "Received OGM2 packet via NB: %pM, IF: %s [%pM] (from OG: %pM, seqno %u, throughput %u, TTL %u, V %u, tvlv_len %u)\n",
9323158ef9f499 Antonio Quartulli 2016-01-16  872  		   ethhdr->h_source, if_incoming->net_dev->name,
9323158ef9f499 Antonio Quartulli 2016-01-16  873  		   if_incoming->net_dev->dev_addr, ogm_packet->orig,
9323158ef9f499 Antonio Quartulli 2016-01-16  874  		   ntohl(ogm_packet->seqno), ogm_throughput, ogm_packet->ttl,
9323158ef9f499 Antonio Quartulli 2016-01-16  875  		   ogm_packet->version, ntohs(ogm_packet->tvlv_len));
9323158ef9f499 Antonio Quartulli 2016-01-16  876  
187fb1ba640b9a Linus Lüssing     2020-07-23  877  	if (batadv_is_my_mac(bat_priv, ogm_packet->orig))
187fb1ba640b9a Linus Lüssing     2020-07-23  878  		batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
187fb1ba640b9a Linus Lüssing     2020-07-23  879  			   "Drop packet: originator packet from ourself\n");
187fb1ba640b9a Linus Lüssing     2020-07-23  880  		return;
187fb1ba640b9a Linus Lüssing     2020-07-23  881  	}
187fb1ba640b9a Linus Lüssing     2020-07-23  882  
f25cbb2a6ac1ce Colin Ian King    2017-06-26  883  	/* If the throughput metric is 0, immediately drop the packet. No need
f25cbb2a6ac1ce Colin Ian King    2017-06-26  884  	 * to create orig_node / neigh_node for an unusable route.
9323158ef9f499 Antonio Quartulli 2016-01-16  885  	 */
9323158ef9f499 Antonio Quartulli 2016-01-16 @886  	if (ogm_throughput == 0) {
9323158ef9f499 Antonio Quartulli 2016-01-16  887  		batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
f25cbb2a6ac1ce Colin Ian King    2017-06-26  888  			   "Drop packet: originator packet with throughput metric of 0\n");
9323158ef9f499 Antonio Quartulli 2016-01-16  889  		return;
9323158ef9f499 Antonio Quartulli 2016-01-16  890  	}
9323158ef9f499 Antonio Quartulli 2016-01-16  891  
9323158ef9f499 Antonio Quartulli 2016-01-16  892  	/* require ELP packets be to received from this neighbor first */
9323158ef9f499 Antonio Quartulli 2016-01-16 @893  	hardif_neigh = batadv_hardif_neigh_get(if_incoming, ethhdr->h_source);
9323158ef9f499 Antonio Quartulli 2016-01-16  894  	if (!hardif_neigh) {
9323158ef9f499 Antonio Quartulli 2016-01-16  895  		batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
9323158ef9f499 Antonio Quartulli 2016-01-16  896  			   "Drop packet: OGM via unknown neighbor!\n");
9323158ef9f499 Antonio Quartulli 2016-01-16  897  		goto out;
9323158ef9f499 Antonio Quartulli 2016-01-16  898  	}
9323158ef9f499 Antonio Quartulli 2016-01-16  899  
9323158ef9f499 Antonio Quartulli 2016-01-16 @900  	orig_node = batadv_v_ogm_orig_get(bat_priv, ogm_packet->orig);
9323158ef9f499 Antonio Quartulli 2016-01-16  901  	if (!orig_node)
6f91a3f7af4186 Xiyu Yang         2020-04-20  902  		goto out;
9323158ef9f499 Antonio Quartulli 2016-01-16  903  
6f0a6b5ee84fee Marek Lindner     2016-05-03 @904  	neigh_node = batadv_neigh_node_get_or_create(orig_node, if_incoming,
9323158ef9f499 Antonio Quartulli 2016-01-16  905  						     ethhdr->h_source);
9323158ef9f499 Antonio Quartulli 2016-01-16  906  	if (!neigh_node)
9323158ef9f499 Antonio Quartulli 2016-01-16  907  		goto out;
9323158ef9f499 Antonio Quartulli 2016-01-16  908  
9323158ef9f499 Antonio Quartulli 2016-01-16  909  	/* Update the received throughput metric to match the link
9323158ef9f499 Antonio Quartulli 2016-01-16  910  	 * characteristic:
9323158ef9f499 Antonio Quartulli 2016-01-16  911  	 *  - If this OGM traveled one hop so far (emitted by single hop
9323158ef9f499 Antonio Quartulli 2016-01-16  912  	 *    neighbor) the path throughput metric equals the link throughput.
9323158ef9f499 Antonio Quartulli 2016-01-16  913  	 *  - For OGMs traversing more than hop the path throughput metric is
9323158ef9f499 Antonio Quartulli 2016-01-16  914  	 *    the smaller of the path throughput and the link throughput.
9323158ef9f499 Antonio Quartulli 2016-01-16  915  	 */
9323158ef9f499 Antonio Quartulli 2016-01-16 @916  	link_throughput = ewma_throughput_read(&hardif_neigh->bat_v.throughput);
9323158ef9f499 Antonio Quartulli 2016-01-16 @917  	path_throughput = min_t(u32, link_throughput, ogm_throughput);
9323158ef9f499 Antonio Quartulli 2016-01-16 @918  	ogm_packet->throughput = htonl(path_throughput);
9323158ef9f499 Antonio Quartulli 2016-01-16  919  
9323158ef9f499 Antonio Quartulli 2016-01-16  920  	batadv_v_ogm_process_per_outif(bat_priv, ethhdr, ogm_packet, orig_node,
9323158ef9f499 Antonio Quartulli 2016-01-16 @921  				       neigh_node, if_incoming,
9323158ef9f499 Antonio Quartulli 2016-01-16  922  				       BATADV_IF_DEFAULT);
9323158ef9f499 Antonio Quartulli 2016-01-16  923  
9323158ef9f499 Antonio Quartulli 2016-01-16 @924  	rcu_read_lock();
9323158ef9f499 Antonio Quartulli 2016-01-16 @925  	list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
9323158ef9f499 Antonio Quartulli 2016-01-16  926  		if (hard_iface->if_status != BATADV_IF_ACTIVE)
9323158ef9f499 Antonio Quartulli 2016-01-16  927  			continue;
9323158ef9f499 Antonio Quartulli 2016-01-16  928  
9323158ef9f499 Antonio Quartulli 2016-01-16  929  		if (hard_iface->soft_iface != bat_priv->soft_iface)
9323158ef9f499 Antonio Quartulli 2016-01-16  930  			continue;
9323158ef9f499 Antonio Quartulli 2016-01-16  931  
273534468f0507 Sven Eckelmann    2016-03-05  932  		if (!kref_get_unless_zero(&hard_iface->refcount))
273534468f0507 Sven Eckelmann    2016-03-05  933  			continue;
273534468f0507 Sven Eckelmann    2016-03-05  934  
3111beed0d595d Linus Lüssing     2016-08-07  935  		ret = batadv_hardif_no_broadcast(hard_iface,
3111beed0d595d Linus Lüssing     2016-08-07  936  						 ogm_packet->orig,
3111beed0d595d Linus Lüssing     2016-08-07  937  						 hardif_neigh->orig);
3111beed0d595d Linus Lüssing     2016-08-07  938  
3111beed0d595d Linus Lüssing     2016-08-07  939  		if (ret) {
3111beed0d595d Linus Lüssing     2016-08-07  940  			char *type;
3111beed0d595d Linus Lüssing     2016-08-07  941  
3111beed0d595d Linus Lüssing     2016-08-07  942  			switch (ret) {
3111beed0d595d Linus Lüssing     2016-08-07  943  			case BATADV_HARDIF_BCAST_NORECIPIENT:
3111beed0d595d Linus Lüssing     2016-08-07  944  				type = "no neighbor";
3111beed0d595d Linus Lüssing     2016-08-07  945  				break;
3111beed0d595d Linus Lüssing     2016-08-07  946  			case BATADV_HARDIF_BCAST_DUPFWD:
3111beed0d595d Linus Lüssing     2016-08-07  947  				type = "single neighbor is source";
3111beed0d595d Linus Lüssing     2016-08-07  948  				break;
3111beed0d595d Linus Lüssing     2016-08-07  949  			case BATADV_HARDIF_BCAST_DUPORIG:
3111beed0d595d Linus Lüssing     2016-08-07  950  				type = "single neighbor is originator";
3111beed0d595d Linus Lüssing     2016-08-07  951  				break;
3111beed0d595d Linus Lüssing     2016-08-07  952  			default:
3111beed0d595d Linus Lüssing     2016-08-07  953  				type = "unknown";
3111beed0d595d Linus Lüssing     2016-08-07  954  			}
3111beed0d595d Linus Lüssing     2016-08-07  955  
f25cbb2a6ac1ce Colin Ian King    2017-06-26  956  			batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "OGM2 packet from %pM on %s suppressed: %s\n",
3111beed0d595d Linus Lüssing     2016-08-07  957  				   ogm_packet->orig, hard_iface->net_dev->name,
3111beed0d595d Linus Lüssing     2016-08-07  958  				   type);
3111beed0d595d Linus Lüssing     2016-08-07  959  
3111beed0d595d Linus Lüssing     2016-08-07  960  			batadv_hardif_put(hard_iface);
3111beed0d595d Linus Lüssing     2016-08-07  961  			continue;
3111beed0d595d Linus Lüssing     2016-08-07  962  		}
3111beed0d595d Linus Lüssing     2016-08-07  963  
9323158ef9f499 Antonio Quartulli 2016-01-16  964  		batadv_v_ogm_process_per_outif(bat_priv, ethhdr, ogm_packet,
9323158ef9f499 Antonio Quartulli 2016-01-16  965  					       orig_node, neigh_node,
9323158ef9f499 Antonio Quartulli 2016-01-16  966  					       if_incoming, hard_iface);
273534468f0507 Sven Eckelmann    2016-03-05  967  
273534468f0507 Sven Eckelmann    2016-03-05  968  		batadv_hardif_put(hard_iface);
9323158ef9f499 Antonio Quartulli 2016-01-16  969  	}
9323158ef9f499 Antonio Quartulli 2016-01-16 @970  	rcu_read_unlock();
9323158ef9f499 Antonio Quartulli 2016-01-16 @971  out:
9323158ef9f499 Antonio Quartulli 2016-01-16  972  	if (orig_node)
9323158ef9f499 Antonio Quartulli 2016-01-16  973  		batadv_orig_node_put(orig_node);
9323158ef9f499 Antonio Quartulli 2016-01-16  974  	if (neigh_node)
9323158ef9f499 Antonio Quartulli 2016-01-16  975  		batadv_neigh_node_put(neigh_node);
9323158ef9f499 Antonio Quartulli 2016-01-16  976  	if (hardif_neigh)
9323158ef9f499 Antonio Quartulli 2016-01-16  977  		batadv_hardif_neigh_put(hardif_neigh);
9323158ef9f499 Antonio Quartulli 2016-01-16 @978  }
9323158ef9f499 Antonio Quartulli 2016-01-16  979  

:::::: The code at line 886 was first introduced by commit
:::::: 9323158ef9f49935f0c61509919acd31dda8f11b batman-adv: OGMv2 - implement originators logic

:::::: TO: Antonio Quartulli <antonio@open-mesh.com>
:::::: CC: Antonio Quartulli <a@unstable.cc>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 64396 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-30  9:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30  9:58 [batman:batadv/net 2/2] net/batman-adv/bat_v_ogm.c:886:2: error: expected identifier or '(' before 'if' 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.