* 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
* [PATCHv3 bpf-next 0/2] xdp: add dev map multicast support 2020-04-15 8:54 [RFC PATCH bpf-next 0/2] xdp: add " Hangbin Liu @ 2020-05-23 6:05 ` Hangbin Liu 2020-05-23 6:05 ` [PATCHv3 bpf-next 1/2] xdp: add a new helper for " Hangbin Liu 0 siblings, 1 reply; 4+ messages in thread From: Hangbin Liu @ 2020-05-23 6:05 UTC (permalink / raw) To: bpf Cc: netdev, Toke Høiland-Jørgensen, Jiri Benc, Jesper Dangaard Brouer, Eelco Chaudron, ast, Daniel Borkmann, Lorenzo Bianconi, Hangbin Liu Hi all, This patchset is 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 achieve this, I re-implement a new helper bpf_redirect_map_multi() to accept two maps, the forwarding map and exclude map. If user don't want to use exclude map and just want simply stop redirecting back to ingress device, they can use flag BPF_F_EXCLUDE_INGRESS. The example in patch 2 is functional, but not a lot of effort has been made on performance optimisation. I did a simple test(pkt size 64) with pktgen. Here is the test result with BPF_MAP_TYPE_DEVMAP_HASH arrays: bpf_redirect_map() with 1 ingress, 1 egress: generic path: ~1600k pps native path: ~980k pps bpf_redirect_map_multi() with 1 ingress, 3 egress: generic path: ~600k pps native path: ~480k pps bpf_redirect_map_multi() with 1 ingress, 9 egress: generic path: ~125k pps native path: ~100k pps The bpf_redirect_map_multi() is slower than bpf_redirect_map() as we loop the arrays and do clone skb/xdpf. The native path is slower than generic path as we send skbs by pktgen. So the result looks reasonable. We need also note that the performace number will get slower if we use large BPF_MAP_TYPE_DEVMAP arrays. 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 v3: Based on Toke's suggestion, do the following update a) Update bpf_redirect_map_multi() description in bpf.h. b) Fix exclude_ifindex checking order in dev_in_exclude_map(). c) Fix one more xdpf clone in dev_map_enqueue_multi(). d) Go find next one in dev_map_enqueue_multi() if the interface is not able to forward instead of abort the whole loop. e) Remove READ_ONCE/WRITE_ONCE for ex_map. f) Add rxcnt map to show the packet transmit speed in sample test. g) Add performace test number. I didn't split the tools/include to a separate patch because I think they are all the same change, and I saw some others also do like this. But I can re-post the patch and split it if you insist. v2: Discussed with Jiri, Toke, Jesper, Eelco, we think the v1 is doing a trick and may make user confused. So let's just add a new helper to make the implementation more clear. Hangbin Liu (2): xdp: add a new helper for dev map multicast support sample/bpf: add xdp_redirect_map_multicast test include/linux/bpf.h | 20 +++ include/linux/filter.h | 1 + include/net/xdp.h | 1 + include/uapi/linux/bpf.h | 22 ++- kernel/bpf/devmap.c | 124 ++++++++++++++ kernel/bpf/verifier.c | 6 + net/core/filter.c | 101 ++++++++++- net/core/xdp.c | 26 +++ samples/bpf/Makefile | 3 + samples/bpf/xdp_redirect_map_multi.sh | 133 +++++++++++++++ samples/bpf/xdp_redirect_map_multi_kern.c | 112 ++++++++++++ samples/bpf/xdp_redirect_map_multi_user.c | 198 ++++++++++++++++++++++ tools/include/uapi/linux/bpf.h | 22 ++- 13 files changed, 762 insertions(+), 7 deletions(-) create mode 100755 samples/bpf/xdp_redirect_map_multi.sh create mode 100644 samples/bpf/xdp_redirect_map_multi_kern.c create mode 100644 samples/bpf/xdp_redirect_map_multi_user.c -- 2.25.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCHv3 bpf-next 1/2] xdp: add a new helper for dev map multicast support 2020-05-23 6:05 ` [PATCHv3 " Hangbin Liu @ 2020-05-23 6:05 ` Hangbin Liu 2020-05-26 7:34 ` kbuild test robot 0 siblings, 1 reply; 4+ messages in thread From: Hangbin Liu @ 2020-05-23 6:05 UTC (permalink / raw) To: bpf Cc: netdev, Toke Høiland-Jørgensen, Jiri Benc, Jesper Dangaard Brouer, Eelco Chaudron, ast, Daniel Borkmann, Lorenzo Bianconi, Hangbin Liu This patch is for xdp multicast support. In this implementation we add a new helper to accept two maps: forward map and exclude map. We will redirect the packet to all the interfaces in *forward map*, but exclude the interfaces that in *exclude map*. To achive this I add a new ex_map for struct bpf_redirect_info. in the helper I set tgt_value to NULL to make a difference with bpf_xdp_redirect_map() We also add a flag *BPF_F_EXCLUDE_INGRESS* incase you don't want to create a exclude map for each interface and just want to exclude the ingress interface. The general data path is kept in net/core/filter.c. The native data path is in kernel/bpf/devmap.c so we can use direct calls to get better performace. v3: Based on Toke's suggestion, do the following update a) Update bpf_redirect_map_multi() description in bpf.h. b) Fix exclude_ifindex checking order in dev_in_exclude_map(). c) Fix one more xdpf clone in dev_map_enqueue_multi(). d) Go find next one in dev_map_enqueue_multi() if the interface is not able to forward instead of abort the whole loop. e) Remove READ_ONCE/WRITE_ONCE for ex_map. v2: Add new syscall bpf_xdp_redirect_map_multi() which could accept include/exclude maps directly. Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> --- include/linux/bpf.h | 20 ++++++ include/linux/filter.h | 1 + include/net/xdp.h | 1 + include/uapi/linux/bpf.h | 22 +++++- kernel/bpf/devmap.c | 124 +++++++++++++++++++++++++++++++++ kernel/bpf/verifier.c | 6 ++ net/core/filter.c | 101 +++++++++++++++++++++++++-- net/core/xdp.c | 26 +++++++ tools/include/uapi/linux/bpf.h | 22 +++++- 9 files changed, 316 insertions(+), 7 deletions(-) diff --git a/include/linux/bpf.h b/include/linux/bpf.h index efe8836b5c48..d1c169bec6b5 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -1240,6 +1240,11 @@ int dev_xdp_enqueue(struct net_device *dev, struct xdp_buff *xdp, struct net_device *dev_rx); int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, struct net_device *dev_rx); +bool dev_in_exclude_map(struct bpf_dtab_netdev *obj, struct bpf_map *map, + int exclude_ifindex); +int dev_map_enqueue_multi(struct xdp_buff *xdp, struct net_device *dev_rx, + struct bpf_map *map, struct bpf_map *ex_map, + bool exclude_ingress); int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, struct bpf_prog *xdp_prog); @@ -1377,6 +1382,21 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, return 0; } +static inline +bool dev_in_exclude_map(struct bpf_dtab_netdev *obj, struct bpf_map *map, + int exclude_ifindex) +{ + return false; +} + +static inline +int dev_map_enqueue_multi(struct xdp_buff *xdp, struct net_device *dev_rx, + struct bpf_map *map, struct bpf_map *ex_map, + bool exclude_ingress) +{ + return 0; +} + struct sk_buff; static inline int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, diff --git a/include/linux/filter.h b/include/linux/filter.h index 73d06a39e2d6..5d9c6ac6ade3 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -612,6 +612,7 @@ struct bpf_redirect_info { u32 tgt_index; void *tgt_value; struct bpf_map *map; + struct bpf_map *ex_map; u32 kern_flags; }; diff --git a/include/net/xdp.h b/include/net/xdp.h index 90f11760bd12..967684aa096a 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -105,6 +105,7 @@ void xdp_warn(const char *msg, const char *func, const int line); #define XDP_WARN(msg) xdp_warn(msg, __func__, __LINE__) struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp); +struct xdp_frame *xdpf_clone(struct xdp_frame *xdpf); /* Convert xdp_buff to xdp_frame */ static inline diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 97e1fd19ff58..000b0cf961ea 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -3157,6 +3157,20 @@ union bpf_attr { * **bpf_sk_cgroup_id**\ (). * Return * The id is returned or 0 in case the id could not be retrieved. + * + * int bpf_redirect_map_multi(struct bpf_map *map, struct bpf_map *ex_map, u64 flags) + * Description + * Redirect the packet to ALL the interfaces in *map*, but + * exclude the interfaces in *ex_map* (which may be NULL). + * + * Currently the *flags* only supports *BPF_F_EXCLUDE_INGRESS*, + * which additionally excludes the current ingress device. + * + * See also bpf_redirect_map(), which supports redirecting + * packet to a specific ifindex in the map. + * Return + * **XDP_REDIRECT** on success, or **XDP_ABORTED** on error. + * */ #define __BPF_FUNC_MAPPER(FN) \ FN(unspec), \ @@ -3288,7 +3302,8 @@ union bpf_attr { FN(seq_printf), \ FN(seq_write), \ FN(sk_cgroup_id), \ - FN(sk_ancestor_cgroup_id), + FN(sk_ancestor_cgroup_id), \ + FN(redirect_map_multi), /* integer value in 'imm' field of BPF_CALL instruction selects which helper * function eBPF program intends to call @@ -3417,6 +3432,11 @@ enum bpf_lwt_encap_mode { BPF_LWT_ENCAP_IP, }; +/* BPF_FUNC_redirect_map_multi flags. */ +enum { + BPF_F_EXCLUDE_INGRESS = (1ULL << 0), +}; + #define __bpf_md_ptr(type, name) \ union { \ type name; \ diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index a51d9fb7a359..ecc5c44a5bab 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -455,6 +455,130 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, return __xdp_enqueue(dev, xdp, dev_rx); } +/* Use direct call in fast path instead of map->ops->map_get_next_key() */ +static int devmap_get_next_key(struct bpf_map *map, void *key, void *next_key) +{ + + switch (map->map_type) { + case BPF_MAP_TYPE_DEVMAP: + return dev_map_get_next_key(map, key, next_key); + case BPF_MAP_TYPE_DEVMAP_HASH: + return dev_map_hash_get_next_key(map, key, next_key); + default: + break; + } + + return -ENOENT; +} + +bool dev_in_exclude_map(struct bpf_dtab_netdev *obj, struct bpf_map *map, + int exclude_ifindex) +{ + struct bpf_dtab_netdev *in_obj = NULL; + u32 key, next_key; + int err; + + if (obj->dev->ifindex == exclude_ifindex) + return true; + + if (!map) + return false; + + devmap_get_next_key(map, NULL, &key); + + for (;;) { + switch (map->map_type) { + case BPF_MAP_TYPE_DEVMAP: + in_obj = __dev_map_lookup_elem(map, key); + break; + case BPF_MAP_TYPE_DEVMAP_HASH: + in_obj = __dev_map_hash_lookup_elem(map, key); + break; + default: + break; + } + + if (in_obj && in_obj->dev->ifindex == obj->dev->ifindex) + return true; + + err = devmap_get_next_key(map, &key, &next_key); + + if (err) + break; + + key = next_key; + } + + return false; +} + +int dev_map_enqueue_multi(struct xdp_buff *xdp, struct net_device *dev_rx, + struct bpf_map *map, struct bpf_map *ex_map, + bool exclude_ingress) +{ + struct bpf_dtab_netdev *obj = NULL; + struct xdp_frame *xdpf, *nxdpf; + struct net_device *dev; + bool first = true; + u32 key, next_key; + int err; + + devmap_get_next_key(map, NULL, &key); + + xdpf = convert_to_xdp_frame(xdp); + if (unlikely(!xdpf)) + return -EOVERFLOW; + + for (;;) { + switch (map->map_type) { + case BPF_MAP_TYPE_DEVMAP: + obj = __dev_map_lookup_elem(map, key); + break; + case BPF_MAP_TYPE_DEVMAP_HASH: + obj = __dev_map_hash_lookup_elem(map, key); + break; + default: + break; + } + + if (!obj || dev_in_exclude_map(obj, ex_map, + exclude_ingress ? dev_rx->ifindex : 0)) + goto find_next; + + dev = obj->dev; + + if (!dev->netdev_ops->ndo_xdp_xmit) + goto find_next; + + err = xdp_ok_fwd_dev(dev, xdp->data_end - xdp->data); + if (unlikely(err)) + goto find_next; + + if (!first) { + nxdpf = xdpf_clone(xdpf); + if (unlikely(!nxdpf)) + return -ENOMEM; + + bq_enqueue(dev, nxdpf, dev_rx); + } else { + bq_enqueue(dev, xdpf, dev_rx); + first = false; + } + +find_next: + err = devmap_get_next_key(map, &key, &next_key); + if (err) + break; + key = next_key; + } + + /* didn't find anywhere to forward to, free buf */ + if (first) + xdp_return_frame_rx_napi(xdpf); + + return 0; +} + int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, struct bpf_prog *xdp_prog) { diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index d2e27dba4ac6..a5857953248d 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -3946,6 +3946,7 @@ static int check_map_func_compatibility(struct bpf_verifier_env *env, case BPF_MAP_TYPE_DEVMAP: case BPF_MAP_TYPE_DEVMAP_HASH: if (func_id != BPF_FUNC_redirect_map && + func_id != BPF_FUNC_redirect_map_multi && func_id != BPF_FUNC_map_lookup_elem) goto error; break; @@ -4038,6 +4039,11 @@ static int check_map_func_compatibility(struct bpf_verifier_env *env, map->map_type != BPF_MAP_TYPE_XSKMAP) goto error; break; + case BPF_FUNC_redirect_map_multi: + if (map->map_type != BPF_MAP_TYPE_DEVMAP && + map->map_type != BPF_MAP_TYPE_DEVMAP_HASH) + goto error; + break; case BPF_FUNC_sk_redirect_map: case BPF_FUNC_msg_redirect_map: case BPF_FUNC_sock_map_update: diff --git a/net/core/filter.c b/net/core/filter.c index bd2853d23b50..f07eb1408f70 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -3473,12 +3473,17 @@ static const struct bpf_func_proto bpf_xdp_adjust_meta_proto = { }; static int __bpf_tx_xdp_map(struct net_device *dev_rx, void *fwd, - struct bpf_map *map, struct xdp_buff *xdp) + struct bpf_map *map, struct xdp_buff *xdp, + struct bpf_map *ex_map, bool exclude_ingress) { switch (map->map_type) { case BPF_MAP_TYPE_DEVMAP: case BPF_MAP_TYPE_DEVMAP_HASH: - return dev_map_enqueue(fwd, xdp, dev_rx); + if (fwd) + return dev_map_enqueue(fwd, xdp, dev_rx); + else + return dev_map_enqueue_multi(xdp, dev_rx, map, ex_map, + exclude_ingress); case BPF_MAP_TYPE_CPUMAP: return cpu_map_enqueue(fwd, xdp, dev_rx); case BPF_MAP_TYPE_XSKMAP: @@ -3534,6 +3539,8 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp, struct bpf_prog *xdp_prog) { struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); + bool exclude_ingress = !!(ri->flags & BPF_F_EXCLUDE_INGRESS); + struct bpf_map *ex_map = ri->ex_map; struct bpf_map *map = READ_ONCE(ri->map); u32 index = ri->tgt_index; void *fwd = ri->tgt_value; @@ -3541,6 +3548,7 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp, ri->tgt_index = 0; ri->tgt_value = NULL; + ri->ex_map = NULL; WRITE_ONCE(ri->map, NULL); if (unlikely(!map)) { @@ -3552,7 +3560,7 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp, err = dev_xdp_enqueue(fwd, xdp, dev); } else { - err = __bpf_tx_xdp_map(dev, fwd, map, xdp); + err = __bpf_tx_xdp_map(dev, fwd, map, xdp, ex_map, exclude_ingress); } if (unlikely(err)) @@ -3566,6 +3574,50 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp, } EXPORT_SYMBOL_GPL(xdp_do_redirect); +static int dev_map_redirect_multi(struct net_device *dev, struct sk_buff *skb, + struct bpf_prog *xdp_prog, + struct bpf_map *map, struct bpf_map *ex_map, + bool exclude_ingress) + +{ + struct bpf_dtab_netdev *dst; + struct sk_buff *nskb; + u32 key, next_key; + int err; + void *fwd; + + /* Get first key from forward map */ + map->ops->map_get_next_key(map, NULL, &key); + + for (;;) { + fwd = __xdp_map_lookup_elem(map, key); + if (fwd) { + dst = (struct bpf_dtab_netdev *)fwd; + if (dev_in_exclude_map(dst, ex_map, + exclude_ingress ? dev->ifindex : 0)) + goto find_next; + + nskb = skb_clone(skb, GFP_ATOMIC); + if (!nskb) + return -ENOMEM; + + err = dev_map_generic_redirect(dst, nskb, xdp_prog); + if (unlikely(err)) + return err; + } + +find_next: + err = map->ops->map_get_next_key(map, &key, &next_key); + if (err) + break; + + key = next_key; + } + + consume_skb(skb); + return 0; +} + static int xdp_do_generic_redirect_map(struct net_device *dev, struct sk_buff *skb, struct xdp_buff *xdp, @@ -3573,19 +3625,29 @@ static int xdp_do_generic_redirect_map(struct net_device *dev, struct bpf_map *map) { struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); + bool exclude_ingress = !!(ri->flags & BPF_F_EXCLUDE_INGRESS); + struct bpf_map *ex_map = ri->ex_map; u32 index = ri->tgt_index; void *fwd = ri->tgt_value; int err = 0; ri->tgt_index = 0; ri->tgt_value = NULL; + ri->ex_map = NULL; WRITE_ONCE(ri->map, NULL); if (map->map_type == BPF_MAP_TYPE_DEVMAP || map->map_type == BPF_MAP_TYPE_DEVMAP_HASH) { - struct bpf_dtab_netdev *dst = fwd; + if (fwd) { + struct bpf_dtab_netdev *dst = fwd; + + err = dev_map_generic_redirect(dst, skb, xdp_prog); + } else { + /* Deal with multicast maps */ + err = dev_map_redirect_multi(dev, skb, xdp_prog, map, + ex_map, exclude_ingress); + } - err = dev_map_generic_redirect(dst, skb, xdp_prog); if (unlikely(err)) goto err; } else if (map->map_type == BPF_MAP_TYPE_XSKMAP) { @@ -3699,6 +3761,33 @@ static const struct bpf_func_proto bpf_xdp_redirect_map_proto = { .arg3_type = ARG_ANYTHING, }; +BPF_CALL_3(bpf_xdp_redirect_map_multi, struct bpf_map *, map, + struct bpf_map *, ex_map, u64, flags) +{ + struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); + + if (unlikely(!map || flags > BPF_F_EXCLUDE_INGRESS)) + return XDP_ABORTED; + + ri->tgt_index = 0; + ri->tgt_value = NULL; + ri->flags = flags; + ri->ex_map = ex_map; + + WRITE_ONCE(ri->map, map); + + return XDP_REDIRECT; +} + +static const struct bpf_func_proto bpf_xdp_redirect_map_multi_proto = { + .func = bpf_xdp_redirect_map_multi, + .gpl_only = false, + .ret_type = RET_INTEGER, + .arg1_type = ARG_CONST_MAP_PTR, + .arg1_type = ARG_CONST_MAP_PTR, + .arg3_type = ARG_ANYTHING, +}; + static unsigned long bpf_skb_copy(void *dst_buff, const void *skb, unsigned long off, unsigned long len) { @@ -6363,6 +6452,8 @@ xdp_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) return &bpf_xdp_redirect_proto; case BPF_FUNC_redirect_map: return &bpf_xdp_redirect_map_proto; + case BPF_FUNC_redirect_map_multi: + return &bpf_xdp_redirect_map_multi_proto; case BPF_FUNC_xdp_adjust_tail: return &bpf_xdp_adjust_tail_proto; case BPF_FUNC_fib_lookup: diff --git a/net/core/xdp.c b/net/core/xdp.c index 90f44f382115..acdc63833b1f 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -475,3 +475,29 @@ void xdp_warn(const char *msg, const char *func, const int line) WARN(1, "XDP_WARN: %s(line:%d): %s\n", func, line, msg); }; EXPORT_SYMBOL_GPL(xdp_warn); + +struct xdp_frame *xdpf_clone(struct xdp_frame *xdpf) +{ + unsigned int headroom, totalsize; + struct xdp_frame *nxdpf; + struct page *page; + void *addr; + + headroom = xdpf->headroom + sizeof(*xdpf); + totalsize = headroom + xdpf->len; + + if (unlikely(totalsize > PAGE_SIZE)) + return NULL; + page = dev_alloc_page(); + if (!page) + return NULL; + addr = page_to_virt(page); + + memcpy(addr, xdpf, totalsize); + + nxdpf = addr; + nxdpf->data = addr + headroom; + + return nxdpf; +} +EXPORT_SYMBOL_GPL(xdpf_clone); diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 97e1fd19ff58..000b0cf961ea 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -3157,6 +3157,20 @@ union bpf_attr { * **bpf_sk_cgroup_id**\ (). * Return * The id is returned or 0 in case the id could not be retrieved. + * + * int bpf_redirect_map_multi(struct bpf_map *map, struct bpf_map *ex_map, u64 flags) + * Description + * Redirect the packet to ALL the interfaces in *map*, but + * exclude the interfaces in *ex_map* (which may be NULL). + * + * Currently the *flags* only supports *BPF_F_EXCLUDE_INGRESS*, + * which additionally excludes the current ingress device. + * + * See also bpf_redirect_map(), which supports redirecting + * packet to a specific ifindex in the map. + * Return + * **XDP_REDIRECT** on success, or **XDP_ABORTED** on error. + * */ #define __BPF_FUNC_MAPPER(FN) \ FN(unspec), \ @@ -3288,7 +3302,8 @@ union bpf_attr { FN(seq_printf), \ FN(seq_write), \ FN(sk_cgroup_id), \ - FN(sk_ancestor_cgroup_id), + FN(sk_ancestor_cgroup_id), \ + FN(redirect_map_multi), /* integer value in 'imm' field of BPF_CALL instruction selects which helper * function eBPF program intends to call @@ -3417,6 +3432,11 @@ enum bpf_lwt_encap_mode { BPF_LWT_ENCAP_IP, }; +/* BPF_FUNC_redirect_map_multi flags. */ +enum { + BPF_F_EXCLUDE_INGRESS = (1ULL << 0), +}; + #define __bpf_md_ptr(type, name) \ union { \ type name; \ -- 2.25.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv3 bpf-next 1/2] xdp: add a new helper for dev map multicast support 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 0 siblings, 0 replies; 4+ messages in thread From: kbuild test robot @ 2020-05-26 7:34 UTC (permalink / raw) To: Hangbin Liu, bpf Cc: kbuild-all, netdev, Toke Høiland-Jørgensen, Jiri Benc, Jesper Dangaard Brouer, Eelco Chaudron, ast, Daniel Borkmann, Lorenzo Bianconi, Hangbin Liu [-- Attachment #1: Type: text/plain, Size: 5721 bytes --] 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-20200525] [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 config: c6x-randconfig-r003-20200526 (attached as .config) compiler: c6x-elf-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-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 warnings (new ones prefixed by >>, old ones prefixed by <<): In file included from include/asm-generic/atomic.h:12, from ./arch/c6x/include/generated/asm/atomic.h:1, from include/linux/atomic.h:7, from include/asm-generic/bitops/lock.h:5, from arch/c6x/include/asm/bitops.h:87, from include/linux/bitops.h:29, from include/linux/kernel.h:12, from include/linux/list.h:9, from include/linux/module.h:12, from net/core/filter.c:20: net/core/filter.c: In function 'bpf_clear_redirect_map': arch/c6x/include/asm/cmpxchg.h:55:3: warning: value computed is not used [-Wunused-value] 55 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | (unsigned long)(o), | ~~~~~~~~~~~~~~~~~~~~~ 57 | (unsigned long)(n), | ~~~~~~~~~~~~~~~~~~~~~ 58 | sizeof(*(ptr)))) | ~~~~~~~~~~~~~~~~ include/asm-generic/cmpxchg.h:106:28: note: in expansion of macro 'cmpxchg_local' 106 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) | ^~~~~~~~~~~~~ net/core/filter.c:3534:4: note: in expansion of macro 'cmpxchg' 3534 | cmpxchg(&ri->map, map, NULL); | ^~~~~~~ net/core/filter.c: At top level: >> net/core/filter.c:3787:20: warning: initialized field overwritten [-Woverride-init] 3787 | .arg1_type = ARG_CONST_MAP_PTR, | ^~~~~~~~~~~~~~~~~ net/core/filter.c:3787:20: note: (near initialization for 'bpf_xdp_redirect_map_multi_proto.<anonymous>.<anonymous>.arg1_type') /tmp/cc2n7hPR.s: Assembler messages: /tmp/cc2n7hPR.s:69347: Warning: ignoring changed section type for .far /tmp/cc2n7hPR.s:69347: Warning: ignoring changed section attributes for .far /tmp/cc2n7hPR.s:69454: Warning: ignoring changed section type for .far /tmp/cc2n7hPR.s:69454: Warning: ignoring changed section attributes for .far /tmp/cc2n7hPR.s:69503: Warning: ignoring changed section type for .far /tmp/cc2n7hPR.s:69503: Warning: ignoring changed section attributes for .far -- In file included from include/asm-generic/atomic.h:12, from ./arch/c6x/include/generated/asm/atomic.h:1, from include/linux/atomic.h:7, from include/asm-generic/bitops/lock.h:5, from arch/c6x/include/asm/bitops.h:87, from include/linux/bitops.h:29, from include/linux/kernel.h:12, from include/linux/list.h:9, from include/linux/module.h:12, from net/core/filter.c:20: net/core/filter.c: In function 'bpf_clear_redirect_map': arch/c6x/include/asm/cmpxchg.h:55:3: warning: value computed is not used [-Wunused-value] 55 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | (unsigned long)(o), | ~~~~~~~~~~~~~~~~~~~~~ 57 | (unsigned long)(n), | ~~~~~~~~~~~~~~~~~~~~~ 58 | sizeof(*(ptr)))) | ~~~~~~~~~~~~~~~~ include/asm-generic/cmpxchg.h:106:28: note: in expansion of macro 'cmpxchg_local' 106 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) | ^~~~~~~~~~~~~ net/core/filter.c:3534:4: note: in expansion of macro 'cmpxchg' 3534 | cmpxchg(&ri->map, map, NULL); | ^~~~~~~ net/core/filter.c: At top level: >> net/core/filter.c:3787:20: warning: initialized field overwritten [-Woverride-init] 3787 | .arg1_type = ARG_CONST_MAP_PTR, | ^~~~~~~~~~~~~~~~~ net/core/filter.c:3787:20: note: (near initialization for 'bpf_xdp_redirect_map_multi_proto.<anonymous>.<anonymous>.arg1_type') /tmp/ccHtg48M.s: Assembler messages: /tmp/ccHtg48M.s:69347: Warning: ignoring changed section type for .far /tmp/ccHtg48M.s:69347: Warning: ignoring changed section attributes for .far /tmp/ccHtg48M.s:69454: Warning: ignoring changed section type for .far /tmp/ccHtg48M.s:69454: Warning: ignoring changed section attributes for .far /tmp/ccHtg48M.s:69503: Warning: ignoring changed section type for .far /tmp/ccHtg48M.s:69503: Warning: ignoring changed section attributes for .far vim +3787 net/core/filter.c 3781 3782 static const struct bpf_func_proto bpf_xdp_redirect_map_multi_proto = { 3783 .func = bpf_xdp_redirect_map_multi, 3784 .gpl_only = false, 3785 .ret_type = RET_INTEGER, 3786 .arg1_type = ARG_CONST_MAP_PTR, > 3787 .arg1_type = ARG_CONST_MAP_PTR, 3788 .arg3_type = ARG_ANYTHING, 3789 }; 3790 --- 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: 23268 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv3 bpf-next 1/2] xdp: add a new helper for dev map multicast support @ 2020-05-26 7:34 ` kbuild test robot 0 siblings, 0 replies; 4+ messages in thread From: kbuild test robot @ 2020-05-26 7:34 UTC (permalink / raw) To: kbuild-all [-- Attachment #1: Type: text/plain, Size: 5837 bytes --] 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-20200525] [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 config: c6x-randconfig-r003-20200526 (attached as .config) compiler: c6x-elf-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-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 warnings (new ones prefixed by >>, old ones prefixed by <<): In file included from include/asm-generic/atomic.h:12, from ./arch/c6x/include/generated/asm/atomic.h:1, from include/linux/atomic.h:7, from include/asm-generic/bitops/lock.h:5, from arch/c6x/include/asm/bitops.h:87, from include/linux/bitops.h:29, from include/linux/kernel.h:12, from include/linux/list.h:9, from include/linux/module.h:12, from net/core/filter.c:20: net/core/filter.c: In function 'bpf_clear_redirect_map': arch/c6x/include/asm/cmpxchg.h:55:3: warning: value computed is not used [-Wunused-value] 55 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | (unsigned long)(o), | ~~~~~~~~~~~~~~~~~~~~~ 57 | (unsigned long)(n), | ~~~~~~~~~~~~~~~~~~~~~ 58 | sizeof(*(ptr)))) | ~~~~~~~~~~~~~~~~ include/asm-generic/cmpxchg.h:106:28: note: in expansion of macro 'cmpxchg_local' 106 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) | ^~~~~~~~~~~~~ net/core/filter.c:3534:4: note: in expansion of macro 'cmpxchg' 3534 | cmpxchg(&ri->map, map, NULL); | ^~~~~~~ net/core/filter.c: At top level: >> net/core/filter.c:3787:20: warning: initialized field overwritten [-Woverride-init] 3787 | .arg1_type = ARG_CONST_MAP_PTR, | ^~~~~~~~~~~~~~~~~ net/core/filter.c:3787:20: note: (near initialization for 'bpf_xdp_redirect_map_multi_proto.<anonymous>.<anonymous>.arg1_type') /tmp/cc2n7hPR.s: Assembler messages: /tmp/cc2n7hPR.s:69347: Warning: ignoring changed section type for .far /tmp/cc2n7hPR.s:69347: Warning: ignoring changed section attributes for .far /tmp/cc2n7hPR.s:69454: Warning: ignoring changed section type for .far /tmp/cc2n7hPR.s:69454: Warning: ignoring changed section attributes for .far /tmp/cc2n7hPR.s:69503: Warning: ignoring changed section type for .far /tmp/cc2n7hPR.s:69503: Warning: ignoring changed section attributes for .far -- In file included from include/asm-generic/atomic.h:12, from ./arch/c6x/include/generated/asm/atomic.h:1, from include/linux/atomic.h:7, from include/asm-generic/bitops/lock.h:5, from arch/c6x/include/asm/bitops.h:87, from include/linux/bitops.h:29, from include/linux/kernel.h:12, from include/linux/list.h:9, from include/linux/module.h:12, from net/core/filter.c:20: net/core/filter.c: In function 'bpf_clear_redirect_map': arch/c6x/include/asm/cmpxchg.h:55:3: warning: value computed is not used [-Wunused-value] 55 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | (unsigned long)(o), | ~~~~~~~~~~~~~~~~~~~~~ 57 | (unsigned long)(n), | ~~~~~~~~~~~~~~~~~~~~~ 58 | sizeof(*(ptr)))) | ~~~~~~~~~~~~~~~~ include/asm-generic/cmpxchg.h:106:28: note: in expansion of macro 'cmpxchg_local' 106 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) | ^~~~~~~~~~~~~ net/core/filter.c:3534:4: note: in expansion of macro 'cmpxchg' 3534 | cmpxchg(&ri->map, map, NULL); | ^~~~~~~ net/core/filter.c: At top level: >> net/core/filter.c:3787:20: warning: initialized field overwritten [-Woverride-init] 3787 | .arg1_type = ARG_CONST_MAP_PTR, | ^~~~~~~~~~~~~~~~~ net/core/filter.c:3787:20: note: (near initialization for 'bpf_xdp_redirect_map_multi_proto.<anonymous>.<anonymous>.arg1_type') /tmp/ccHtg48M.s: Assembler messages: /tmp/ccHtg48M.s:69347: Warning: ignoring changed section type for .far /tmp/ccHtg48M.s:69347: Warning: ignoring changed section attributes for .far /tmp/ccHtg48M.s:69454: Warning: ignoring changed section type for .far /tmp/ccHtg48M.s:69454: Warning: ignoring changed section attributes for .far /tmp/ccHtg48M.s:69503: Warning: ignoring changed section type for .far /tmp/ccHtg48M.s:69503: Warning: ignoring changed section attributes for .far vim +3787 net/core/filter.c 3781 3782 static const struct bpf_func_proto bpf_xdp_redirect_map_multi_proto = { 3783 .func = bpf_xdp_redirect_map_multi, 3784 .gpl_only = false, 3785 .ret_type = RET_INTEGER, 3786 .arg1_type = ARG_CONST_MAP_PTR, > 3787 .arg1_type = ARG_CONST_MAP_PTR, 3788 .arg3_type = ARG_ANYTHING, 3789 }; 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: 23268 bytes --] ^ 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.