All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCHv3 bpf-next 1/2] xdp: add a new helper for dev map multicast support
@ 2020-05-25  3:47 kbuild test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2020-05-25  3:47 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200523060537.264096-2-liuhangbin@gmail.com>
References: <20200523060537.264096-2-liuhangbin@gmail.com>
TO: Hangbin Liu <liuhangbin@gmail.com>
TO: bpf(a)vger.kernel.org
CC: netdev(a)vger.kernel.org
CC: "Toke Høiland-Jørgensen" <toke@redhat.com>
CC: Jiri Benc <jbenc@redhat.com>
CC: Jesper Dangaard Brouer <brouer@redhat.com>
CC: Eelco Chaudron <echaudro@redhat.com>
CC: ast(a)kernel.org
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
CC: Hangbin Liu <liuhangbin@gmail.com>

Hi Hangbin,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]
[also build test WARNING on net-next/master next-20200522]
[cannot apply to bpf/master net/master linus/master v5.7-rc7]
[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/Hangbin-Liu/xdp-add-dev-map-multicast-support/20200523-141019
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: s390-randconfig-s002-20200524 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-240-gf0fe1cd9-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=s390 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   net/core/filter.c:400:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:403:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:406:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:409:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:412:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:486:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:489:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:492:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:1380:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@    expected struct sock_filter const *filter @@    got struct sock_struct sock_filter const *filter @@
   net/core/filter.c:1380:39: sparse:    expected struct sock_filter const *filter
   net/core/filter.c:1380:39: sparse:    got struct sock_filter [noderef] <asn:1> *filter
   net/core/filter.c:1458:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@    expected struct sock_filter const *filter @@    got struct sock_struct sock_filter const *filter @@
   net/core/filter.c:1458:39: sparse:    expected struct sock_filter const *filter
   net/core/filter.c:1458:39: sparse:    got struct sock_filter [noderef] <asn:1> *filter
   net/core/filter.c:7011:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:7014:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:7017:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:215:32: sparse: sparse: cast to restricted __be16
   net/core/filter.c:242:32: sparse: sparse: cast to restricted __be32
   net/core/filter.c:1880:43: sparse: sparse: incorrect type in argument 2 (different base types) @@    expected restricted __wsum [usertype] diff @@    got urestricted __wsum [usertype] diff @@
   net/core/filter.c:1880:43: sparse:    expected restricted __wsum [usertype] diff
   net/core/filter.c:1880:43: sparse:    got unsigned long long [usertype] to
   net/core/filter.c:1883:36: sparse: sparse: incorrect type in argument 2 (different base types) @@    expected restricted __be16 [usertype] old @@    got urestricted __be16 [usertype] old @@
   net/core/filter.c:1883:36: sparse:    expected restricted __be16 [usertype] old
   net/core/filter.c:1883:36: sparse:    got unsigned long long [usertype] from
   net/core/filter.c:1883:42: sparse: sparse: incorrect type in argument 3 (different base types) @@    expected restricted __be16 [usertype] new @@    got urestricted __be16 [usertype] new @@
   net/core/filter.c:1883:42: sparse:    expected restricted __be16 [usertype] new
   net/core/filter.c:1883:42: sparse:    got unsigned long long [usertype] to
   net/core/filter.c:1886:36: sparse: sparse: incorrect type in argument 2 (different base types) @@    expected restricted __be32 [usertype] from @@    got urestricted __be32 [usertype] from @@
   net/core/filter.c:1886:36: sparse:    expected restricted __be32 [usertype] from
   net/core/filter.c:1886:36: sparse:    got unsigned long long [usertype] from
   net/core/filter.c:1886:42: sparse: sparse: incorrect type in argument 3 (different base types) @@    expected restricted __be32 [usertype] to @@    got urestricted __be32 [usertype] to @@
   net/core/filter.c:1886:42: sparse:    expected restricted __be32 [usertype] to
   net/core/filter.c:1886:42: sparse:    got unsigned long long [usertype] to
   net/core/filter.c:1931:59: sparse: sparse: incorrect type in argument 3 (different base types) @@    expected restricted __wsum [usertype] diff @@    got urestricted __wsum [usertype] diff @@
   net/core/filter.c:1931:59: sparse:    expected restricted __wsum [usertype] diff
   net/core/filter.c:1931:59: sparse:    got unsigned long long [usertype] to
   net/core/filter.c:1934:52: sparse: sparse: incorrect type in argument 3 (different base types) @@    expected restricted __be16 [usertype] from @@    got urestricted __be16 [usertype] from @@
   net/core/filter.c:1934:52: sparse:    expected restricted __be16 [usertype] from
   net/core/filter.c:1934:52: sparse:    got unsigned long long [usertype] from
   net/core/filter.c:1934:58: sparse: sparse: incorrect type in argument 4 (different base types) @@    expected restricted __be16 [usertype] to @@    got urestricted __be16 [usertype] to @@
   net/core/filter.c:1934:58: sparse:    expected restricted __be16 [usertype] to
   net/core/filter.c:1934:58: sparse:    got unsigned long long [usertype] to
   net/core/filter.c:1937:52: sparse: sparse: incorrect type in argument 3 (different base types) @@    expected restricted __be32 [usertype] from @@    got urestricted __be32 [usertype] from @@
   net/core/filter.c:1937:52: sparse:    expected restricted __be32 [usertype] from
   net/core/filter.c:1937:52: sparse:    got unsigned long long [usertype] from
   net/core/filter.c:1937:58: sparse: sparse: incorrect type in argument 4 (different base types) @@    expected restricted __be32 [usertype] to @@    got urestricted __be32 [usertype] to @@
   net/core/filter.c:1937:58: sparse:    expected restricted __be32 [usertype] to
   net/core/filter.c:1937:58: sparse:    got unsigned long long [usertype] to
   net/core/filter.c:1983:28: sparse: sparse: incorrect type in return expression (different base types) @@    expected unsigned long long @@    got nsigned long long @@
   net/core/filter.c:1983:28: sparse:    expected unsigned long long
   net/core/filter.c:1983:28: sparse:    got restricted __wsum
   net/core/filter.c:2005:35: sparse: sparse: incorrect type in return expression (different base types) @@    expected unsigned long long @@    got restricted unsigned long long @@
   net/core/filter.c:2005:35: sparse:    expected unsigned long long
   net/core/filter.c:2005:35: sparse:    got restricted __wsum [usertype] csum
   net/core/filter.c:4720:17: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] spi @@    got restricted unsigned int [usertype] spi @@
   net/core/filter.c:4720:17: sparse:    expected unsigned int [usertype] spi
   net/core/filter.c:4720:17: sparse:    got restricted __be32 const [usertype] spi
   net/core/filter.c:4728:33: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] remote_ipv4 @@    got restricted unsigned int [usertype] remote_ipv4 @@
   net/core/filter.c:4728:33: sparse:    expected unsigned int [usertype] remote_ipv4
   net/core/filter.c:4728:33: sparse:    got restricted __be32 const [usertype] a4
   net/core/filter.c:3534:25: sparse: sparse: non size-preserving integer to pointer cast
   net/core/filter.c:3786:10: sparse: sparse: Initializer entry defined twice
>> net/core/filter.c:3787:10: sparse:   also defined here
   net/core/filter.c:4062:21: sparse: sparse: non size-preserving integer to pointer cast

# https://github.com/0day-ci/linux/commit/b5e5f70cd41c3958d6bf936874f6774a0e965bf0
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout b5e5f70cd41c3958d6bf936874f6774a0e965bf0
vim +3787 net/core/filter.c

b5e5f70cd41c39 Hangbin Liu 2020-05-23  3781  
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3782  static const struct bpf_func_proto bpf_xdp_redirect_map_multi_proto = {
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3783  	.func           = bpf_xdp_redirect_map_multi,
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3784  	.gpl_only       = false,
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3785  	.ret_type       = RET_INTEGER,
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3786  	.arg1_type      = ARG_CONST_MAP_PTR,
b5e5f70cd41c39 Hangbin Liu 2020-05-23 @3787  	.arg1_type      = ARG_CONST_MAP_PTR,
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3788  	.arg3_type      = ARG_ANYTHING,
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3789  };
b5e5f70cd41c39 Hangbin Liu 2020-05-23  3790  

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [RFC PATCH bpf-next 0/2] xdp: add dev map multicast support
@ 2020-04-15  8:54 Hangbin Liu
  2020-05-23  6:05 ` [PATCHv3 " Hangbin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Hangbin Liu @ 2020-04-15  8:54 UTC (permalink / raw)
  To: bpf
  Cc: netdev, Toke Høiland-Jørgensen, Jiri Benc,
	Jesper Dangaard Brouer, Eelco Chaudron, Alexei Starovoitov,
	Daniel Borkmann, Hangbin Liu

Hi all,

This is a prototype for xdp multicast support, which has been discussed
before[0]. The goal is to be able to implement an OVS-like data plane in
XDP, i.e., a software switch that can forward XDP frames to multiple
ports.

To achieve this, an application needs to specify a group of interfaces
to forward a packet to. It is also common to want to exclude one or more
physical interfaces from the forwarding operation - e.g., to forward a
packet to all interfaces in the multicast group except the interface it
arrived on. While this could be done simply by adding more groups, this
quickly leads to a combinatorial explosion in the number of groups an
application has to maintain.

To avoid the combinatorial explosion, we propose to include the ability
to specify an "exclude group" as part of the forwarding operation. This
needs to be a group (instead of just a single port index), because a
physical interface can be part of a logical grouping, such as a bond
device.

Thus, the logical forwarding operation becomes a "set difference"
operation, i.e. "forward to all ports in group A that are not also in
group B". This series implements such an operation using device maps to
represent the groups. This means that the XDP program specifies two
device maps, one containing the list of netdevs to redirect to, and the
other containing the exclude list.

To be able to reuse the existing bpf_redirect_map() helper, we use a
containing map-in-map type to store the forwarding and exclude groups.
When a map-in-map type is passed to the redirect helper, it will
interpret the index as encoding the forwarding group in the upper 16
bits and the exclude group in the lower 16 bits. The enqueue logic will
unpack the two halves of the index and perform separate lookups in the
containing map. E.g., an index of 0x00010001 will look for the
forwarding group at map index 0x10000 and the exclude group at map index
0x1; the application is expected to populate the map accordingly.

For this RFC series we are primarily looking for feedback on the concept
and API: the example in patch 2 is functional, but not a lot of effort
has been made on performance optimisation.

Last but not least, thanks a lot to Jiri, Eelco, Toke and Jesper for
suggestions and help on implementation.

[0] https://xdp-project.net/#Handling-multicast

Hangbin Liu (2):
  xdp: add dev map multicast support
  sample/bpf: add xdp_redirect_map_multicast test

 include/linux/bpf.h                           |  29 ++
 include/net/xdp.h                             |   1 +
 kernel/bpf/arraymap.c                         |   2 +-
 kernel/bpf/devmap.c                           | 118 +++++++
 kernel/bpf/hashtab.c                          |   2 +-
 kernel/bpf/verifier.c                         |  15 +-
 net/core/filter.c                             |  69 +++-
 net/core/xdp.c                                |  26 ++
 samples/bpf/Makefile                          |   3 +
 samples/bpf/xdp_redirect_map_multicast.sh     | 142 ++++++++
 samples/bpf/xdp_redirect_map_multicast_kern.c | 147 +++++++++
 samples/bpf/xdp_redirect_map_multicast_user.c | 306 ++++++++++++++++++
 12 files changed, 854 insertions(+), 6 deletions(-)
 create mode 100755 samples/bpf/xdp_redirect_map_multicast.sh
 create mode 100644 samples/bpf/xdp_redirect_map_multicast_kern.c
 create mode 100644 samples/bpf/xdp_redirect_map_multicast_user.c

-- 
2.19.2


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

end of thread, other threads:[~2020-05-26  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-25  3:47 [PATCHv3 bpf-next 1/2] xdp: add a new helper for dev map multicast support kbuild test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-04-15  8:54 [RFC PATCH bpf-next 0/2] xdp: add " Hangbin Liu
2020-05-23  6:05 ` [PATCHv3 " Hangbin Liu
2020-05-23  6:05   ` [PATCHv3 bpf-next 1/2] xdp: add a new helper for " Hangbin Liu
2020-05-26  7:34     ` kbuild test robot
2020-05-26  7:34       ` kbuild 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.