All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH bpf-next 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps
Date: Sat, 25 Jul 2020 12:10:54 +0800	[thread overview]
Message-ID: <202007251227.e9JeaOtr%lkp@intel.com> (raw)
In-Reply-To: <20200725000410.3566700-28-guro@fb.com>

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

Hi Roman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Roman-Gushchin/bpf-switch-to-memcg-based-memory-accounting/20200725-080940
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All errors (new ones prefixed by >>):

   net/core/sock_map.c: In function 'sock_hash_alloc':
>> net/core/sock_map.c:1027:8: error: implicit declaration of function 'bpf_map_charge_init'; did you mean 'bpf_map_free_id'? [-Werror=implicit-function-declaration]
    1027 |  err = bpf_map_charge_init(&htab->map.memory, cost);
         |        ^~~~~~~~~~~~~~~~~~~
         |        bpf_map_free_id
>> net/core/sock_map.c:1027:38: error: 'struct bpf_map' has no member named 'memory'
    1027 |  err = bpf_map_charge_init(&htab->map.memory, cost);
         |                                      ^
>> net/core/sock_map.c:1035:3: error: implicit declaration of function 'bpf_map_charge_finish' [-Werror=implicit-function-declaration]
    1035 |   bpf_map_charge_finish(&htab->map.memory);
         |   ^~~~~~~~~~~~~~~~~~~~~
   net/core/sock_map.c:1035:35: error: 'struct bpf_map' has no member named 'memory'
    1035 |   bpf_map_charge_finish(&htab->map.memory);
         |                                   ^
   cc1: some warnings being treated as errors

vim +1027 net/core/sock_map.c

604326b41a6fb9 Daniel Borkmann 2018-10-13   988  
604326b41a6fb9 Daniel Borkmann 2018-10-13   989  static struct bpf_map *sock_hash_alloc(union bpf_attr *attr)
604326b41a6fb9 Daniel Borkmann 2018-10-13   990  {
032a6b3565489a Andrey Ignatov  2020-06-19   991  	struct bpf_shtab *htab;
604326b41a6fb9 Daniel Borkmann 2018-10-13   992  	int i, err;
604326b41a6fb9 Daniel Borkmann 2018-10-13   993  	u64 cost;
604326b41a6fb9 Daniel Borkmann 2018-10-13   994  
604326b41a6fb9 Daniel Borkmann 2018-10-13   995  	if (!capable(CAP_NET_ADMIN))
604326b41a6fb9 Daniel Borkmann 2018-10-13   996  		return ERR_PTR(-EPERM);
604326b41a6fb9 Daniel Borkmann 2018-10-13   997  	if (attr->max_entries == 0 ||
604326b41a6fb9 Daniel Borkmann 2018-10-13   998  	    attr->key_size    == 0 ||
c1cdf65da060a8 Jakub Sitnicki  2020-02-18   999  	    (attr->value_size != sizeof(u32) &&
c1cdf65da060a8 Jakub Sitnicki  2020-02-18  1000  	     attr->value_size != sizeof(u64)) ||
604326b41a6fb9 Daniel Borkmann 2018-10-13  1001  	    attr->map_flags & ~SOCK_CREATE_FLAG_MASK)
604326b41a6fb9 Daniel Borkmann 2018-10-13  1002  		return ERR_PTR(-EINVAL);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1003  	if (attr->key_size > MAX_BPF_STACK)
604326b41a6fb9 Daniel Borkmann 2018-10-13  1004  		return ERR_PTR(-E2BIG);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1005  
ed406bfdb34a82 Roman Gushchin  2020-07-24  1006  	htab = kzalloc(sizeof(*htab), GFP_USER | __GFP_ACCOUNT);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1007  	if (!htab)
604326b41a6fb9 Daniel Borkmann 2018-10-13  1008  		return ERR_PTR(-ENOMEM);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1009  
604326b41a6fb9 Daniel Borkmann 2018-10-13  1010  	bpf_map_init_from_attr(&htab->map, attr);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1011  
604326b41a6fb9 Daniel Borkmann 2018-10-13  1012  	htab->buckets_num = roundup_pow_of_two(htab->map.max_entries);
032a6b3565489a Andrey Ignatov  2020-06-19  1013  	htab->elem_size = sizeof(struct bpf_shtab_elem) +
604326b41a6fb9 Daniel Borkmann 2018-10-13  1014  			  round_up(htab->map.key_size, 8);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1015  	if (htab->buckets_num == 0 ||
032a6b3565489a Andrey Ignatov  2020-06-19  1016  	    htab->buckets_num > U32_MAX / sizeof(struct bpf_shtab_bucket)) {
604326b41a6fb9 Daniel Borkmann 2018-10-13  1017  		err = -EINVAL;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1018  		goto free_htab;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1019  	}
604326b41a6fb9 Daniel Borkmann 2018-10-13  1020  
032a6b3565489a Andrey Ignatov  2020-06-19  1021  	cost = (u64) htab->buckets_num * sizeof(struct bpf_shtab_bucket) +
604326b41a6fb9 Daniel Borkmann 2018-10-13  1022  	       (u64) htab->elem_size * htab->map.max_entries;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1023  	if (cost >= U32_MAX - PAGE_SIZE) {
604326b41a6fb9 Daniel Borkmann 2018-10-13  1024  		err = -EINVAL;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1025  		goto free_htab;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1026  	}
60e5ca8a64bad8 Andrey Ignatov  2020-06-11 @1027  	err = bpf_map_charge_init(&htab->map.memory, cost);
60e5ca8a64bad8 Andrey Ignatov  2020-06-11  1028  	if (err)
60e5ca8a64bad8 Andrey Ignatov  2020-06-11  1029  		goto free_htab;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1030  
604326b41a6fb9 Daniel Borkmann 2018-10-13  1031  	htab->buckets = bpf_map_area_alloc(htab->buckets_num *
032a6b3565489a Andrey Ignatov  2020-06-19  1032  					   sizeof(struct bpf_shtab_bucket),
604326b41a6fb9 Daniel Borkmann 2018-10-13  1033  					   htab->map.numa_node);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1034  	if (!htab->buckets) {
60e5ca8a64bad8 Andrey Ignatov  2020-06-11 @1035  		bpf_map_charge_finish(&htab->map.memory);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1036  		err = -ENOMEM;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1037  		goto free_htab;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1038  	}
604326b41a6fb9 Daniel Borkmann 2018-10-13  1039  
604326b41a6fb9 Daniel Borkmann 2018-10-13  1040  	for (i = 0; i < htab->buckets_num; i++) {
604326b41a6fb9 Daniel Borkmann 2018-10-13  1041  		INIT_HLIST_HEAD(&htab->buckets[i].head);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1042  		raw_spin_lock_init(&htab->buckets[i].lock);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1043  	}
604326b41a6fb9 Daniel Borkmann 2018-10-13  1044  
604326b41a6fb9 Daniel Borkmann 2018-10-13  1045  	return &htab->map;
604326b41a6fb9 Daniel Borkmann 2018-10-13  1046  free_htab:
604326b41a6fb9 Daniel Borkmann 2018-10-13  1047  	kfree(htab);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1048  	return ERR_PTR(err);
604326b41a6fb9 Daniel Borkmann 2018-10-13  1049  }
604326b41a6fb9 Daniel Borkmann 2018-10-13  1050  

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

  reply	other threads:[~2020-07-25  4:10 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-25  0:03 [PATCH bpf-next 00/35] bpf: switch to memcg-based memory accounting Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 01/35] bpf: memcg-based memory accounting for bpf progs Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 02/35] bpf: memcg-based memory accounting for bpf maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 03/35] bpf: refine memcg-based memory accounting for arraymap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 04/35] bpf: refine memcg-based memory accounting for cpumap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 05/35] bpf: memcg-based memory accounting for cgroup storage maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 06/35] bpf: refine memcg-based memory accounting for devmap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 07/35] bpf: refine memcg-based memory accounting for hashtab maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 08/35] bpf: memcg-based memory accounting for lpm_trie maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 09/35] bpf: memcg-based memory accounting for bpf ringbuffer Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 10/35] bpf: memcg-based memory accounting for socket storage maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 11/35] bpf: refine memcg-based memory accounting for sockmap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 12/35] bpf: refine memcg-based memory accounting for xskmap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 13/35] bpf: eliminate rlimit-based memory accounting for arraymap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 14/35] bpf: eliminate rlimit-based memory accounting for bpf_struct_ops maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 15/35] bpf: eliminate rlimit-based memory accounting for cpumap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 16/35] bpf: eliminate rlimit-based memory accounting for cgroup storage maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 17/35] bpf: eliminate rlimit-based memory accounting for devmap maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 18/35] bpf: eliminate rlimit-based memory accounting for hashtab maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 19/35] bpf: eliminate rlimit-based memory accounting for lpm_trie maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 20/35] bpf: eliminate rlimit-based memory accounting for queue_stack_maps maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 21/35] bpf: eliminate rlimit-based memory accounting for reuseport_array maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 22/35] bpf: eliminate rlimit-based memory accounting for bpf ringbuffer Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 23/35] bpf: eliminate rlimit-based memory accounting for sock_map maps Roman Gushchin
2020-07-25  0:03 ` [PATCH bpf-next 24/35] bpf: eliminate rlimit-based memory accounting for stackmap maps Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 25/35] bpf: eliminate rlimit-based memory accounting for socket storage maps Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 26/35] bpf: eliminate rlimit-based memory accounting for xskmap maps Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps Roman Gushchin
2020-07-25  4:10   ` kernel test robot [this message]
2020-07-25  0:04 ` [PATCH bpf-next 28/35] bpf: eliminate rlimit-based memory accounting for bpf progs Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 29/35] bpf: libbpf: cleanup RLIMIT_MEMLOCK usage Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 30/35] bpf: bpftool: do not touch RLIMIT_MEMLOCK Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 31/35] bpf: runqslower: don't " Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 32/35] bpf: selftests: delete bpf_rlimit.h Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 33/35] bpf: selftests: don't touch RLIMIT_MEMLOCK Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 34/35] bpf: samples: do not " Roman Gushchin
2020-07-25  0:04 ` [PATCH bpf-next 35/35] perf: don't " Roman Gushchin

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=202007251227.e9JeaOtr%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.