All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Mao Wenan <maowenan@huawei.com>,
	ast@kernel.org, daniel@iogearbox.net, kafai@fb.com,
	songliubraving@fb.com, yhs@fb.com, andriin@fb.com,
	john.fastabend@gmail.com, kpsingh@chromium.org
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/2] bpf: Change error code when ops is NULL
Date: Fri, 24 Apr 2020 13:10:43 +0800	[thread overview]
Message-ID: <202004241309.YR41aSa4%lkp@intel.com> (raw)
In-Reply-To: <20200422083010.28000-2-maowenan@huawei.com>

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

Hi Mao,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]
[also build test ERROR on bpf/master net/master net-next/master v5.7-rc2 next-20200423]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Mao-Wenan/Change-return-code-if-failed-to-load-object/20200424-025339
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=c6x 

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

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

   kernel/bpf/syscall.c: In function 'find_and_alloc_map':
>> kernel/bpf/syscall.c:116:11: warning: missing terminating " character
     116 |   pr_warn("map type %d not supported or
         |           ^
   kernel/bpf/syscall.c:117:31: warning: missing terminating " character
     117 |     kernel config not opened\n", type);
         |                               ^
   In file included from kernel/bpf/syscall.c:1551:
>> include/linux/bpf_types.h:120: error: unterminated argument list invoking macro "pr_warn"
     120 | #endif
         | 
>> kernel/bpf/syscall.c:116:3: error: 'pr_warn' undeclared (first use in this function)
     116 |   pr_warn("map type %d not supported or
         |   ^~~~~~~
   kernel/bpf/syscall.c:116:3: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/bpf/syscall.c:116:10: error: expected ';' before '}' token
     116 |   pr_warn("map type %d not supported or
         |          ^
         |          ;
   ......
    1554 | };
         | ~         
>> kernel/bpf/syscall.c:1556:12: error: invalid storage class for function 'find_prog_type'
    1556 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~
   In file included from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   kernel/bpf/syscall.c: In function 'find_prog_type':
>> kernel/bpf/syscall.c:1560:25: error: 'bpf_prog_types' undeclared (first use in this function); did you mean 'bpf_prog_type'?
    1560 |  if (type >= ARRAY_SIZE(bpf_prog_types))
         |                         ^~~~~~~~~~~~~~
   include/linux/kernel.h:47:33: note: in definition of macro 'ARRAY_SIZE'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                 ^~~
   In file included from include/linux/bits.h:23,
                    from include/linux/bitops.h:5,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1560:14: note: in expansion of macro 'ARRAY_SIZE'
    1560 |  if (type >= ARRAY_SIZE(bpf_prog_types))
         |              ^~~~~~~~~~
   In file included from include/linux/fdtable.h:13,
                    from kernel/bpf/syscall.c:14:
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/nospec.h:52:9: note: in definition of macro 'array_index_nospec'
      52 |  typeof(size) _s = (size);     \
         |         ^~~~
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1562:34: note: in expansion of macro 'ARRAY_SIZE'
    1562 |  type = array_index_nospec(type, ARRAY_SIZE(bpf_prog_types));
         |                                  ^~~~~~~~~~
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/nospec.h:52:21: note: in definition of macro 'array_index_nospec'
      52 |  typeof(size) _s = (size);     \
         |                     ^~~~
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1562:34: note: in expansion of macro 'ARRAY_SIZE'
    1562 |  type = array_index_nospec(type, ARRAY_SIZE(bpf_prog_types));
         |                                  ^~~~~~~~~~
   kernel/bpf/syscall.c: In function 'find_and_alloc_map':
>> kernel/bpf/syscall.c:1556:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1556 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
         | ^~~~~~
>> kernel/bpf/syscall.c:1586:13: error: invalid storage class for function 'bpf_audit_prog'
    1586 | static void bpf_audit_prog(const struct bpf_prog *prog, unsigned int op)
         |             ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1627:12: error: invalid storage class for function 'bpf_prog_charge_memlock'
    1627 | static int bpf_prog_charge_memlock(struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1642:13: error: invalid storage class for function 'bpf_prog_uncharge_memlock'
    1642 | static void bpf_prog_uncharge_memlock(struct bpf_prog *prog)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1650:12: error: invalid storage class for function 'bpf_prog_alloc_id'
    1650 | static int bpf_prog_alloc_id(struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1693:13: error: invalid storage class for function '__bpf_prog_put_rcu'
    1693 | static void __bpf_prog_put_rcu(struct rcu_head *rcu)
         |             ^~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1704:13: error: invalid storage class for function '__bpf_prog_put_noref'
    1704 | static void __bpf_prog_put_noref(struct bpf_prog *prog, bool deferred)
         |             ^~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1716:13: error: invalid storage class for function '__bpf_prog_put'
    1716 | static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock)
         |             ^~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
>> kernel/bpf/syscall.c:1731:19: error: non-static declaration of 'bpf_prog_put' follows static declaration
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1731:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1727:6: note: previous definition of 'bpf_prog_put' was here
    1727 | void bpf_prog_put(struct bpf_prog *prog)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1731:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         | ^~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1733:12: error: invalid storage class for function 'bpf_prog_release'
    1733 | static int bpf_prog_release(struct inode *inode, struct file *filp)
         |            ^~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1741:13: error: invalid storage class for function 'bpf_prog_get_stats'
    1741 | static void bpf_prog_get_stats(const struct bpf_prog *prog,
         |             ^~~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1766:13: error: invalid storage class for function 'bpf_prog_show_fdinfo'
    1766 | static void bpf_prog_show_fdinfo(struct seq_file *m, struct file *filp)
         |             ^~~~~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1797:11: error: 'bpf_dummy_read' undeclared (first use in this function)
    1797 |  .read  = bpf_dummy_read,
         |           ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1798:12: error: 'bpf_dummy_write' undeclared (first use in this function)
    1798 |  .write  = bpf_dummy_write,
         |            ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1813:25: error: invalid storage class for function '____bpf_prog_get'
    1813 | static struct bpf_prog *____bpf_prog_get(struct fd f)
         |                         ^~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   kernel/bpf/syscall.c:1829:19: error: non-static declaration of 'bpf_prog_add' follows static declaration
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1829:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1825:6: note: previous definition of 'bpf_prog_add' was here
    1825 | void bpf_prog_add(struct bpf_prog *prog, int i)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1829:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1840:19: error: non-static declaration of 'bpf_prog_sub' follows static declaration
    1840 | EXPORT_SYMBOL_GPL(bpf_prog_sub);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1840:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1840 | EXPORT_SYMBOL_GPL(bpf_prog_sub);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1831:6: note: previous definition of 'bpf_prog_sub' was here
    1831 | void bpf_prog_sub(struct bpf_prog *prog, int i)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")

vim +/pr_warn +120 include/linux/bpf_types.h

40077e0cf62206 Johannes Berg          2017-04-11   78  
40077e0cf62206 Johannes Berg          2017-04-11   79  BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   80  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   81  BPF_MAP_TYPE(BPF_MAP_TYPE_PROG_ARRAY, prog_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   82  BPF_MAP_TYPE(BPF_MAP_TYPE_PERF_EVENT_ARRAY, perf_event_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   83  #ifdef CONFIG_CGROUPS
40077e0cf62206 Johannes Berg          2017-04-11   84  BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_ARRAY, cgroup_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   85  #endif
de9cbbaadba5ad Roman Gushchin         2018-08-02   86  #ifdef CONFIG_CGROUP_BPF
de9cbbaadba5ad Roman Gushchin         2018-08-02   87  BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_STORAGE, cgroup_storage_map_ops)
b741f1630346de Roman Gushchin         2018-09-28   88  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, cgroup_storage_map_ops)
de9cbbaadba5ad Roman Gushchin         2018-08-02   89  #endif
40077e0cf62206 Johannes Berg          2017-04-11   90  BPF_MAP_TYPE(BPF_MAP_TYPE_HASH, htab_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   91  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_HASH, htab_percpu_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   92  BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_HASH, htab_lru_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   93  BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_PERCPU_HASH, htab_lru_percpu_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   94  BPF_MAP_TYPE(BPF_MAP_TYPE_LPM_TRIE, trie_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   95  #ifdef CONFIG_PERF_EVENTS
144991602e6a14 Mauricio Vasquez B     2018-10-18   96  BPF_MAP_TYPE(BPF_MAP_TYPE_STACK_TRACE, stack_trace_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   97  #endif
40077e0cf62206 Johannes Berg          2017-04-11   98  BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   99  BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
546ac1ffb70d25 John Fastabend         2017-07-17  100  #ifdef CONFIG_NET
546ac1ffb70d25 John Fastabend         2017-07-17  101  BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
6f9d451ab1a337 Toke Høiland-Jørgensen 2019-07-26  102  BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
6ac99e8f23d4b1 Martin KaFai Lau       2019-04-26  103  BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
604326b41a6fb9 Daniel Borkmann        2018-10-13  104  #if defined(CONFIG_BPF_STREAM_PARSER)
174a79ff9515f4 John Fastabend         2017-08-15  105  BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
81110384441a59 John Fastabend         2018-05-14  106  BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
546ac1ffb70d25 John Fastabend         2017-07-17  107  #endif
6710e1126934d8 Jesper Dangaard Brouer 2017-10-16  108  BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
fbfc504a24f53f Björn Töpel            2018-05-02  109  #if defined(CONFIG_XDP_SOCKETS)
fbfc504a24f53f Björn Töpel            2018-05-02  110  BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)
fbfc504a24f53f Björn Töpel            2018-05-02  111  #endif
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  112  #ifdef CONFIG_INET
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  113  BPF_MAP_TYPE(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, reuseport_array_ops)
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  114  #endif
6bdc9c4c31c816 John Fastabend         2017-08-16  115  #endif
f1a2e44a3aeccb Mauricio Vasquez B     2018-10-18  116  BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops)
f1a2e44a3aeccb Mauricio Vasquez B     2018-10-18  117  BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)
85d33df357b634 Martin KaFai Lau       2020-01-08  118  #if defined(CONFIG_BPF_JIT)
85d33df357b634 Martin KaFai Lau       2020-01-08  119  BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops)
85d33df357b634 Martin KaFai Lau       2020-01-08 @120  #endif

:::::: The code at line 120 was first introduced by commit
:::::: 85d33df357b634649ddbe0a20fd2d0fc5732c3cb bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS

:::::: TO: Martin KaFai Lau <kafai@fb.com>
:::::: CC: Alexei Starovoitov <ast@kernel.org>

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: Mao Wenan <maowenan@huawei.com>,
	ast@kernel.org, daniel@iogearbox.net, kafai@fb.com,
	songliubraving@fb.com, yhs@fb.com, andriin@fb.com,
	john.fastabend@gmail.com, kpsingh@chromium.org
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/2] bpf: Change error code when ops is NULL
Date: Fri, 24 Apr 2020 05:10:43 +0000	[thread overview]
Message-ID: <202004241309.YR41aSa4%lkp@intel.com> (raw)
In-Reply-To: <20200422083010.28000-2-maowenan@huawei.com>

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

Hi Mao,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]
[also build test ERROR on bpf/master net/master net-next/master v5.7-rc2 next-20200423]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Mao-Wenan/Change-return-code-if-failed-to-load-object/20200424-025339
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=c6x 

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

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

   kernel/bpf/syscall.c: In function 'find_and_alloc_map':
>> kernel/bpf/syscall.c:116:11: warning: missing terminating " character
     116 |   pr_warn("map type %d not supported or
         |           ^
   kernel/bpf/syscall.c:117:31: warning: missing terminating " character
     117 |     kernel config not opened\n", type);
         |                               ^
   In file included from kernel/bpf/syscall.c:1551:
>> include/linux/bpf_types.h:120: error: unterminated argument list invoking macro "pr_warn"
     120 | #endif
         | 
>> kernel/bpf/syscall.c:116:3: error: 'pr_warn' undeclared (first use in this function)
     116 |   pr_warn("map type %d not supported or
         |   ^~~~~~~
   kernel/bpf/syscall.c:116:3: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/bpf/syscall.c:116:10: error: expected ';' before '}' token
     116 |   pr_warn("map type %d not supported or
         |          ^
         |          ;
   ......
    1554 | };
         | ~         
>> kernel/bpf/syscall.c:1556:12: error: invalid storage class for function 'find_prog_type'
    1556 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~
   In file included from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   kernel/bpf/syscall.c: In function 'find_prog_type':
>> kernel/bpf/syscall.c:1560:25: error: 'bpf_prog_types' undeclared (first use in this function); did you mean 'bpf_prog_type'?
    1560 |  if (type >= ARRAY_SIZE(bpf_prog_types))
         |                         ^~~~~~~~~~~~~~
   include/linux/kernel.h:47:33: note: in definition of macro 'ARRAY_SIZE'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                 ^~~
   In file included from include/linux/bits.h:23,
                    from include/linux/bitops.h:5,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1560:14: note: in expansion of macro 'ARRAY_SIZE'
    1560 |  if (type >= ARRAY_SIZE(bpf_prog_types))
         |              ^~~~~~~~~~
   In file included from include/linux/fdtable.h:13,
                    from kernel/bpf/syscall.c:14:
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/nospec.h:52:9: note: in definition of macro 'array_index_nospec'
      52 |  typeof(size) _s = (size);     \
         |         ^~~~
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1562:34: note: in expansion of macro 'ARRAY_SIZE'
    1562 |  type = array_index_nospec(type, ARRAY_SIZE(bpf_prog_types));
         |                                  ^~~~~~~~~~
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/nospec.h:52:21: note: in definition of macro 'array_index_nospec'
      52 |  typeof(size) _s = (size);     \
         |                     ^~~~
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1562:34: note: in expansion of macro 'ARRAY_SIZE'
    1562 |  type = array_index_nospec(type, ARRAY_SIZE(bpf_prog_types));
         |                                  ^~~~~~~~~~
   kernel/bpf/syscall.c: In function 'find_and_alloc_map':
>> kernel/bpf/syscall.c:1556:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1556 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
         | ^~~~~~
>> kernel/bpf/syscall.c:1586:13: error: invalid storage class for function 'bpf_audit_prog'
    1586 | static void bpf_audit_prog(const struct bpf_prog *prog, unsigned int op)
         |             ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1627:12: error: invalid storage class for function 'bpf_prog_charge_memlock'
    1627 | static int bpf_prog_charge_memlock(struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1642:13: error: invalid storage class for function 'bpf_prog_uncharge_memlock'
    1642 | static void bpf_prog_uncharge_memlock(struct bpf_prog *prog)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1650:12: error: invalid storage class for function 'bpf_prog_alloc_id'
    1650 | static int bpf_prog_alloc_id(struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1693:13: error: invalid storage class for function '__bpf_prog_put_rcu'
    1693 | static void __bpf_prog_put_rcu(struct rcu_head *rcu)
         |             ^~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1704:13: error: invalid storage class for function '__bpf_prog_put_noref'
    1704 | static void __bpf_prog_put_noref(struct bpf_prog *prog, bool deferred)
         |             ^~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1716:13: error: invalid storage class for function '__bpf_prog_put'
    1716 | static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock)
         |             ^~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
>> kernel/bpf/syscall.c:1731:19: error: non-static declaration of 'bpf_prog_put' follows static declaration
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1731:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1727:6: note: previous definition of 'bpf_prog_put' was here
    1727 | void bpf_prog_put(struct bpf_prog *prog)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1731:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         | ^~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1733:12: error: invalid storage class for function 'bpf_prog_release'
    1733 | static int bpf_prog_release(struct inode *inode, struct file *filp)
         |            ^~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1741:13: error: invalid storage class for function 'bpf_prog_get_stats'
    1741 | static void bpf_prog_get_stats(const struct bpf_prog *prog,
         |             ^~~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1766:13: error: invalid storage class for function 'bpf_prog_show_fdinfo'
    1766 | static void bpf_prog_show_fdinfo(struct seq_file *m, struct file *filp)
         |             ^~~~~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1797:11: error: 'bpf_dummy_read' undeclared (first use in this function)
    1797 |  .read  = bpf_dummy_read,
         |           ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1798:12: error: 'bpf_dummy_write' undeclared (first use in this function)
    1798 |  .write  = bpf_dummy_write,
         |            ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1813:25: error: invalid storage class for function '____bpf_prog_get'
    1813 | static struct bpf_prog *____bpf_prog_get(struct fd f)
         |                         ^~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   kernel/bpf/syscall.c:1829:19: error: non-static declaration of 'bpf_prog_add' follows static declaration
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1829:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1825:6: note: previous definition of 'bpf_prog_add' was here
    1825 | void bpf_prog_add(struct bpf_prog *prog, int i)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1829:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1840:19: error: non-static declaration of 'bpf_prog_sub' follows static declaration
    1840 | EXPORT_SYMBOL_GPL(bpf_prog_sub);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1840:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1840 | EXPORT_SYMBOL_GPL(bpf_prog_sub);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1831:6: note: previous definition of 'bpf_prog_sub' was here
    1831 | void bpf_prog_sub(struct bpf_prog *prog, int i)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")

vim +/pr_warn +120 include/linux/bpf_types.h

40077e0cf62206 Johannes Berg          2017-04-11   78  
40077e0cf62206 Johannes Berg          2017-04-11   79  BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   80  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   81  BPF_MAP_TYPE(BPF_MAP_TYPE_PROG_ARRAY, prog_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   82  BPF_MAP_TYPE(BPF_MAP_TYPE_PERF_EVENT_ARRAY, perf_event_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   83  #ifdef CONFIG_CGROUPS
40077e0cf62206 Johannes Berg          2017-04-11   84  BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_ARRAY, cgroup_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   85  #endif
de9cbbaadba5ad Roman Gushchin         2018-08-02   86  #ifdef CONFIG_CGROUP_BPF
de9cbbaadba5ad Roman Gushchin         2018-08-02   87  BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_STORAGE, cgroup_storage_map_ops)
b741f1630346de Roman Gushchin         2018-09-28   88  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, cgroup_storage_map_ops)
de9cbbaadba5ad Roman Gushchin         2018-08-02   89  #endif
40077e0cf62206 Johannes Berg          2017-04-11   90  BPF_MAP_TYPE(BPF_MAP_TYPE_HASH, htab_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   91  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_HASH, htab_percpu_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   92  BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_HASH, htab_lru_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   93  BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_PERCPU_HASH, htab_lru_percpu_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   94  BPF_MAP_TYPE(BPF_MAP_TYPE_LPM_TRIE, trie_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   95  #ifdef CONFIG_PERF_EVENTS
144991602e6a14 Mauricio Vasquez B     2018-10-18   96  BPF_MAP_TYPE(BPF_MAP_TYPE_STACK_TRACE, stack_trace_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   97  #endif
40077e0cf62206 Johannes Berg          2017-04-11   98  BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   99  BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
546ac1ffb70d25 John Fastabend         2017-07-17  100  #ifdef CONFIG_NET
546ac1ffb70d25 John Fastabend         2017-07-17  101  BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
6f9d451ab1a337 Toke Høiland-Jørgensen 2019-07-26  102  BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
6ac99e8f23d4b1 Martin KaFai Lau       2019-04-26  103  BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
604326b41a6fb9 Daniel Borkmann        2018-10-13  104  #if defined(CONFIG_BPF_STREAM_PARSER)
174a79ff9515f4 John Fastabend         2017-08-15  105  BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
81110384441a59 John Fastabend         2018-05-14  106  BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
546ac1ffb70d25 John Fastabend         2017-07-17  107  #endif
6710e1126934d8 Jesper Dangaard Brouer 2017-10-16  108  BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
fbfc504a24f53f Björn Töpel            2018-05-02  109  #if defined(CONFIG_XDP_SOCKETS)
fbfc504a24f53f Björn Töpel            2018-05-02  110  BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)
fbfc504a24f53f Björn Töpel            2018-05-02  111  #endif
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  112  #ifdef CONFIG_INET
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  113  BPF_MAP_TYPE(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, reuseport_array_ops)
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  114  #endif
6bdc9c4c31c816 John Fastabend         2017-08-16  115  #endif
f1a2e44a3aeccb Mauricio Vasquez B     2018-10-18  116  BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops)
f1a2e44a3aeccb Mauricio Vasquez B     2018-10-18  117  BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)
85d33df357b634 Martin KaFai Lau       2020-01-08  118  #if defined(CONFIG_BPF_JIT)
85d33df357b634 Martin KaFai Lau       2020-01-08  119  BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops)
85d33df357b634 Martin KaFai Lau       2020-01-08 @120  #endif

:::::: The code at line 120 was first introduced by commit
:::::: 85d33df357b634649ddbe0a20fd2d0fc5732c3cb bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS

:::::: TO: Martin KaFai Lau <kafai@fb.com>
:::::: CC: Alexei Starovoitov <ast@kernel.org>

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH bpf-next 1/2] bpf: Change error code when ops is NULL
Date: Fri, 24 Apr 2020 13:10:43 +0800	[thread overview]
Message-ID: <202004241309.YR41aSa4%lkp@intel.com> (raw)
In-Reply-To: <20200422083010.28000-2-maowenan@huawei.com>

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

Hi Mao,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]
[also build test ERROR on bpf/master net/master net-next/master v5.7-rc2 next-20200423]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Mao-Wenan/Change-return-code-if-failed-to-load-object/20200424-025339
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=c6x 

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

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

   kernel/bpf/syscall.c: In function 'find_and_alloc_map':
>> kernel/bpf/syscall.c:116:11: warning: missing terminating " character
     116 |   pr_warn("map type %d not supported or
         |           ^
   kernel/bpf/syscall.c:117:31: warning: missing terminating " character
     117 |     kernel config not opened\n", type);
         |                               ^
   In file included from kernel/bpf/syscall.c:1551:
>> include/linux/bpf_types.h:120: error: unterminated argument list invoking macro "pr_warn"
     120 | #endif
         | 
>> kernel/bpf/syscall.c:116:3: error: 'pr_warn' undeclared (first use in this function)
     116 |   pr_warn("map type %d not supported or
         |   ^~~~~~~
   kernel/bpf/syscall.c:116:3: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/bpf/syscall.c:116:10: error: expected ';' before '}' token
     116 |   pr_warn("map type %d not supported or
         |          ^
         |          ;
   ......
    1554 | };
         | ~         
>> kernel/bpf/syscall.c:1556:12: error: invalid storage class for function 'find_prog_type'
    1556 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~
   In file included from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   kernel/bpf/syscall.c: In function 'find_prog_type':
>> kernel/bpf/syscall.c:1560:25: error: 'bpf_prog_types' undeclared (first use in this function); did you mean 'bpf_prog_type'?
    1560 |  if (type >= ARRAY_SIZE(bpf_prog_types))
         |                         ^~~~~~~~~~~~~~
   include/linux/kernel.h:47:33: note: in definition of macro 'ARRAY_SIZE'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                 ^~~
   In file included from include/linux/bits.h:23,
                    from include/linux/bitops.h:5,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1560:14: note: in expansion of macro 'ARRAY_SIZE'
    1560 |  if (type >= ARRAY_SIZE(bpf_prog_types))
         |              ^~~~~~~~~~
   In file included from include/linux/fdtable.h:13,
                    from kernel/bpf/syscall.c:14:
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/nospec.h:52:9: note: in definition of macro 'array_index_nospec'
      52 |  typeof(size) _s = (size);     \
         |         ^~~~
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1562:34: note: in expansion of macro 'ARRAY_SIZE'
    1562 |  type = array_index_nospec(type, ARRAY_SIZE(bpf_prog_types));
         |                                  ^~~~~~~~~~
   include/linux/build_bug.h:16:51: error: bit-field '<anonymous>' width not an integer constant
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                   ^
   include/linux/nospec.h:52:21: note: in definition of macro 'array_index_nospec'
      52 |  typeof(size) _s = (size);     \
         |                     ^~~~
   include/linux/compiler.h:357:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
     357 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                            ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:47:59: note: in expansion of macro '__must_be_array'
      47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                                           ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1562:34: note: in expansion of macro 'ARRAY_SIZE'
    1562 |  type = array_index_nospec(type, ARRAY_SIZE(bpf_prog_types));
         |                                  ^~~~~~~~~~
   kernel/bpf/syscall.c: In function 'find_and_alloc_map':
>> kernel/bpf/syscall.c:1556:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1556 | static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog)
         | ^~~~~~
>> kernel/bpf/syscall.c:1586:13: error: invalid storage class for function 'bpf_audit_prog'
    1586 | static void bpf_audit_prog(const struct bpf_prog *prog, unsigned int op)
         |             ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1627:12: error: invalid storage class for function 'bpf_prog_charge_memlock'
    1627 | static int bpf_prog_charge_memlock(struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1642:13: error: invalid storage class for function 'bpf_prog_uncharge_memlock'
    1642 | static void bpf_prog_uncharge_memlock(struct bpf_prog *prog)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1650:12: error: invalid storage class for function 'bpf_prog_alloc_id'
    1650 | static int bpf_prog_alloc_id(struct bpf_prog *prog)
         |            ^~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1693:13: error: invalid storage class for function '__bpf_prog_put_rcu'
    1693 | static void __bpf_prog_put_rcu(struct rcu_head *rcu)
         |             ^~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1704:13: error: invalid storage class for function '__bpf_prog_put_noref'
    1704 | static void __bpf_prog_put_noref(struct bpf_prog *prog, bool deferred)
         |             ^~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1716:13: error: invalid storage class for function '__bpf_prog_put'
    1716 | static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock)
         |             ^~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
>> kernel/bpf/syscall.c:1731:19: error: non-static declaration of 'bpf_prog_put' follows static declaration
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1731:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1727:6: note: previous definition of 'bpf_prog_put' was here
    1727 | void bpf_prog_put(struct bpf_prog *prog)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1731:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1731 | EXPORT_SYMBOL_GPL(bpf_prog_put);
         | ^~~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1733:12: error: invalid storage class for function 'bpf_prog_release'
    1733 | static int bpf_prog_release(struct inode *inode, struct file *filp)
         |            ^~~~~~~~~~~~~~~~
>> kernel/bpf/syscall.c:1741:13: error: invalid storage class for function 'bpf_prog_get_stats'
    1741 | static void bpf_prog_get_stats(const struct bpf_prog *prog,
         |             ^~~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1766:13: error: invalid storage class for function 'bpf_prog_show_fdinfo'
    1766 | static void bpf_prog_show_fdinfo(struct seq_file *m, struct file *filp)
         |             ^~~~~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1797:11: error: 'bpf_dummy_read' undeclared (first use in this function)
    1797 |  .read  = bpf_dummy_read,
         |           ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1798:12: error: 'bpf_dummy_write' undeclared (first use in this function)
    1798 |  .write  = bpf_dummy_write,
         |            ^~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1813:25: error: invalid storage class for function '____bpf_prog_get'
    1813 | static struct bpf_prog *____bpf_prog_get(struct fd f)
         |                         ^~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   kernel/bpf/syscall.c:1829:19: error: non-static declaration of 'bpf_prog_add' follows static declaration
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1829:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1825:6: note: previous definition of 'bpf_prog_add' was here
    1825 | void bpf_prog_add(struct bpf_prog *prog, int i)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1829:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1829 | EXPORT_SYMBOL_GPL(bpf_prog_add);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1840:19: error: non-static declaration of 'bpf_prog_sub' follows static declaration
    1840 | EXPORT_SYMBOL_GPL(bpf_prog_sub);
         |                   ^~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1840:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    1840 | EXPORT_SYMBOL_GPL(bpf_prog_sub);
         | ^~~~~~~~~~~~~~~~~
   kernel/bpf/syscall.c:1831:6: note: previous definition of 'bpf_prog_sub' was here
    1831 | void bpf_prog_sub(struct bpf_prog *prog, int i)
         |      ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from kernel/bpf/syscall.c:4:
   include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      67 |  static const struct kernel_symbol __ksymtab_##sym  \
         |  ^~~~~~
   include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
     108 |  __KSYMTAB_ENTRY(sym, sec)
         |  ^~~~~~~~~~~~~~~
   include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
     147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
         |                                       ^~~~~~~~~~~~~~~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")

vim +/pr_warn +120 include/linux/bpf_types.h

40077e0cf62206 Johannes Berg          2017-04-11   78  
40077e0cf62206 Johannes Berg          2017-04-11   79  BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   80  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   81  BPF_MAP_TYPE(BPF_MAP_TYPE_PROG_ARRAY, prog_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   82  BPF_MAP_TYPE(BPF_MAP_TYPE_PERF_EVENT_ARRAY, perf_event_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   83  #ifdef CONFIG_CGROUPS
40077e0cf62206 Johannes Berg          2017-04-11   84  BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_ARRAY, cgroup_array_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   85  #endif
de9cbbaadba5ad Roman Gushchin         2018-08-02   86  #ifdef CONFIG_CGROUP_BPF
de9cbbaadba5ad Roman Gushchin         2018-08-02   87  BPF_MAP_TYPE(BPF_MAP_TYPE_CGROUP_STORAGE, cgroup_storage_map_ops)
b741f1630346de Roman Gushchin         2018-09-28   88  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, cgroup_storage_map_ops)
de9cbbaadba5ad Roman Gushchin         2018-08-02   89  #endif
40077e0cf62206 Johannes Berg          2017-04-11   90  BPF_MAP_TYPE(BPF_MAP_TYPE_HASH, htab_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   91  BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_HASH, htab_percpu_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   92  BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_HASH, htab_lru_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   93  BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_PERCPU_HASH, htab_lru_percpu_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   94  BPF_MAP_TYPE(BPF_MAP_TYPE_LPM_TRIE, trie_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   95  #ifdef CONFIG_PERF_EVENTS
144991602e6a14 Mauricio Vasquez B     2018-10-18   96  BPF_MAP_TYPE(BPF_MAP_TYPE_STACK_TRACE, stack_trace_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   97  #endif
40077e0cf62206 Johannes Berg          2017-04-11   98  BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops)
40077e0cf62206 Johannes Berg          2017-04-11   99  BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
546ac1ffb70d25 John Fastabend         2017-07-17  100  #ifdef CONFIG_NET
546ac1ffb70d25 John Fastabend         2017-07-17  101  BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
6f9d451ab1a337 Toke Høiland-Jørgensen 2019-07-26  102  BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
6ac99e8f23d4b1 Martin KaFai Lau       2019-04-26  103  BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
604326b41a6fb9 Daniel Borkmann        2018-10-13  104  #if defined(CONFIG_BPF_STREAM_PARSER)
174a79ff9515f4 John Fastabend         2017-08-15  105  BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
81110384441a59 John Fastabend         2018-05-14  106  BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
546ac1ffb70d25 John Fastabend         2017-07-17  107  #endif
6710e1126934d8 Jesper Dangaard Brouer 2017-10-16  108  BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
fbfc504a24f53f Björn Töpel            2018-05-02  109  #if defined(CONFIG_XDP_SOCKETS)
fbfc504a24f53f Björn Töpel            2018-05-02  110  BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)
fbfc504a24f53f Björn Töpel            2018-05-02  111  #endif
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  112  #ifdef CONFIG_INET
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  113  BPF_MAP_TYPE(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, reuseport_array_ops)
5dc4c4b7d4e811 Martin KaFai Lau       2018-08-08  114  #endif
6bdc9c4c31c816 John Fastabend         2017-08-16  115  #endif
f1a2e44a3aeccb Mauricio Vasquez B     2018-10-18  116  BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops)
f1a2e44a3aeccb Mauricio Vasquez B     2018-10-18  117  BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)
85d33df357b634 Martin KaFai Lau       2020-01-08  118  #if defined(CONFIG_BPF_JIT)
85d33df357b634 Martin KaFai Lau       2020-01-08  119  BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops)
85d33df357b634 Martin KaFai Lau       2020-01-08 @120  #endif

:::::: The code at line 120 was first introduced by commit
:::::: 85d33df357b634649ddbe0a20fd2d0fc5732c3cb bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS

:::::: TO: Martin KaFai Lau <kafai@fb.com>
:::::: CC: Alexei Starovoitov <ast@kernel.org>

---
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: 52604 bytes --]

  parent reply	other threads:[~2020-04-24  5:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  8:30 [PATCH bpf-next 0/2] Change return code if failed to load object Mao Wenan
2020-04-22  8:30 ` Mao Wenan
2020-04-22  8:30 ` [PATCH bpf-next 1/2] bpf: Change error code when ops is NULL Mao Wenan
2020-04-22  8:30   ` Mao Wenan
2020-04-22  9:33   ` Dan Carpenter
2020-04-22  9:33     ` Dan Carpenter
2020-04-23  3:33     ` [PATCH bpf-next v2 0/2] Change return code if failed to load object Mao Wenan
2020-04-23  3:33       ` Mao Wenan
2020-04-23  3:33       ` [PATCH bpf-next v2 1/2] bpf: Change error code when ops is NULL Mao Wenan
2020-04-23  3:33         ` Mao Wenan
2020-04-23  5:43         ` Alexei Starovoitov
2020-04-23  5:43           ` Alexei Starovoitov
2020-04-23  6:25           ` maowenan
2020-04-23  6:25             ` maowenan
2020-04-23 16:07             ` Alexei Starovoitov
2020-04-23 16:07               ` Alexei Starovoitov
2020-04-24  1:13               ` maowenan
2020-04-24  1:13                 ` maowenan
2020-04-23  3:33       ` [PATCH bpf-next v2 2/2] libbpf: Return err if bpf_object__load failed Mao Wenan
2020-04-23  3:33         ` Mao Wenan
2020-04-24  5:10   ` kbuild test robot [this message]
2020-04-24  5:10     ` [PATCH bpf-next 1/2] bpf: Change error code when ops is NULL kbuild test robot
2020-04-24  5:10     ` kbuild test robot
2020-04-24  5:18   ` kbuild test robot
2020-04-24  5:18     ` kbuild test robot
2020-04-30  1:55   ` kbuild test robot
2020-04-30  2:04     ` kbuild test robot
2020-04-30  2:04     ` kbuild test robot
2020-04-22  8:30 ` [PATCH bpf-next 2/2] libbpf: Return err if bpf_object__load failed Mao Wenan
2020-04-22  8:30   ` Mao Wenan
2020-04-22 23:27   ` Andrii Nakryiko
2020-04-22 23:27     ` Andrii Nakryiko
2020-04-24  1:46 [PATCH bpf-next 1/2] bpf: Change error code when ops is NULL kbuild test robot
2020-04-24 13:41 kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202004241309.YR41aSa4%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kpsingh@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maowenan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.