Like bond, add ethtool get_link_ksettings to show the total speed.
Signed-off-by: Hangbin Liu
---
drivers/net/team/team.c | 25 +
1 file changed, 25 insertions(+)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 2106045b3e16..5e892ee4c006 100644
On Tue, May 28, 2019 at 11:08:23AM +0200, Jiri Pirko wrote:
> >+static int team_ethtool_get_link_ksettings(struct net_device *dev,
> >+ struct ethtool_link_ksettings *cmd)
> >+{
> >+struct team *team= netdev_priv(dev);
> >+unsigned long speed = 0;
> >+
test_lirc_mode2_user is included in test_lirc_mode2.sh test and should
not be run directly.
Fixes: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program")
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/bpf/Makefile | 7 ---
1 file changed, 4 insertions(+), 3
and remove it later
and
b) return 0 directly if the rule exactally the same.
Thanks
Hangbin
>
> On Wed, May 8, 2019 at 9:39 AM David Miller wrote:
> >
> > From: Hangbin Liu
> > Date: Tue, 7 May 2019 17:11:18 +0800
> >
> > > With commit 153380ec4b9 ("f
On Wed, Jun 05, 2019 at 10:47:58AM +0900, Lorenzo Colitti wrote:
> On Wed, Jun 5, 2019 at 10:43 AM Hangbin Liu wrote:
> > Although I'm still not clear what's the difference between
> >
> > a) adding a dup rule and remove it later
> > and
> > b) retur
On Wed, Jun 05, 2019 at 11:25:11AM +0900, Lorenzo Colitti wrote:
> On Wed, Jun 5, 2019 at 11:15 AM Hangbin Liu wrote:
> > How do you add the rules? with ip cmd it should has NLM_F_EXCL flag and
> > you will get -EEXIST error out.
>
> The fact that the code worked before thi
On Wed, Jun 05, 2019 at 12:43:44PM +0900, Lorenzo Colitti wrote:
> On Wed, Jun 5, 2019 at 12:29 PM Hangbin Liu wrote:
> > > We rely on being able to add a rule and either have a dup be created
> > > (in which case we'll remove it later) or have it fail with EEXIST (in
On Tue, Jun 04, 2019 at 09:57:56PM -0600, David Ahern wrote:
> On 6/4/19 7:43 PM, Hangbin Liu wrote:
> > Hi David Ahern,
> >
> > On Fri, May 31, 2019 at 06:43:42PM -0700, Maciej Żenczykowski wrote:
> >> FYI, this userspace visible change in behaviour breaks Andro
: Nathan Chancellor
Fixes: e9919a24d302 ("fib_rules: return 0 directly if an exactly same rule
exists when NLM_F_EXCL not supplied")
Signed-off-by: Hangbin Liu
---
net/core/fib_rules.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/core/fib_rules.c
Hi David,
Before commit 18a8021a7be3 ("net/ipv4: Plumb support for filtering route
dumps"), when we dump a non-exist table, ip cmd exits silently.
# ip -4 route list table 1
# echo $?
0
After commit 18a8021a7be3 ("net/ipv4: Plumb support for filtering route
dumps"). When we dump a non-exist tabl
On Fri, Jul 19, 2019 at 10:55:49AM -0600, David Ahern wrote:
> Hi:
>
> On 7/18/19 10:17 PM, Hangbin Liu wrote:
> > Hi David,
> >
> > Before commit 18a8021a7be3 ("net/ipv4: Plumb support for filtering route
> > dumps"), when we dump a non-exist table, ip
via fe80:52:0:4982::1fe dev eth0 proto ra src \
2620::2cf:e2ff:fe40:37 metric 1024 hoplimit 64 pref medium
Fix it by disabling the __ip_dev_find() check if iif is LOOPBACK_IFINDEX.
Reported-by: Jianlin Shi
Signed-off-by: Hangbin Liu
---
net/ipv4/route.c | 3 ++-
1 file changed, 2
ned-off-by: Hangbin Liu
---
drivers/net/ethernet/ibm/ibmveth.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmveth.c
b/drivers/net/ethernet/ibm/ibmveth.c
index d654c234aaf7..3b9406a4ca92 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/d
On Thu, Aug 01, 2019 at 03:28:43AM -0700, Joe Perches wrote:
> Perhaps add the netdev__ratelimited variants and use that instead
>
> Somthing like:
Yes, that looks better. Do you mind if I take your code and add your
Signed-off-by info?
Thanks
Hangbin
>
> ---
> include/linux/netdevice.h | 54
On Thu, Aug 01, 2019 at 01:51:25PM -0600, David Ahern wrote:
> On 8/1/19 2:29 AM, Hangbin Liu wrote:
> > Jianlin reported a bug that for IPv4, ip route get from src_addr would fail
> > if src_addr is not an address on local system.
> >
> > \# ip route get 1.1.1.1
On Thu, Aug 01, 2019 at 12:51:14PM -0400, David Miller wrote:
> From: Hangbin Liu
> Date: Thu, 1 Aug 2019 17:03:47 +0800
>
> > When setting lots of multicast list on ibmveth, e.g. add 3000 membership on
> > a
> > multicast group, the following error message flushes
: h_multicast_ctrl rc=4 when adding
an entry to the filter table
We got 1.5 million lines of messages in 1.3h. Let's replace netdev_err() by
netdev_err_ratelimited() to avoid this issue.
Signed-off-by: Hangbin Liu
---
drivers/net/ethernet/ibm/ibmveth.c | 5 ++---
1 file changed, 2 inser
Add netdev_level_ratelimited so we can use it in the future.
The code is copied from device.h.
Suggested-by: Joe Perches
Signed-off-by: Hangbin Liu
---
include/linux/netdevice.h | 53 +++
1 file changed, 53 insertions(+)
diff --git a/include/linux
filter
table
error when add more thann 256 memberships in one multicast group. I haven't
found this issue on other driver. It looks like an ibm driver issue and need
to be fixed separately.
v2: add netdev_level_ratelimited as Joe Perches suggested
Hangbin Liu (2):
netdevice.h
On Sun, Aug 11, 2019 at 09:08:20PM -0700, David Miller wrote:
> From: Hangbin Liu
> Date: Fri, 9 Aug 2019 08:29:39 +0800
>
> > ibmveth 3003 env3: h_multicast_ctrl rc=4 when adding an entry to the
> > filter table
> > error when add more thann 256 membership
The ip address autojoin is not working for IPv6 as ipv6_add_addr()
will return -EADDRNOTAVAIL when adding a multicast address.
Reported-by: Jianlin Shi
Fixes: 93a714d6b53d ("multicast: Extend ip address command to enable multicast
group join/leave on")
Signed-off-by: Hangbin Liu
---
e 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.
Hangbin Liu (5):
bpf: add a new bpf argument type ARG_CONST_MAP_PTR_OR_NULL
xdp: add a new helper for dev map multicast support
sample/bpf: add xd
>i40e |2.0M | 9.5M | 7.5M
5.10 rc6 + patch | xdp_redirect_map i40e->veth |1.7M | 11.6M | 9.1M
[1]
https://patchwork.ozlabs.org/project/netdev/patch/20201208120159.2278277-1-liuhang...@gmail.com/
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: Hangbin Liu
--
v14: no u
Add a new bpf argument type ARG_CONST_MAP_PTR_OR_NULL which could be
used when we want to allow NULL pointer for map parameter. The bpf helper
need to take care and check if the map is NULL when use this type.
Signed-off-by: Hangbin Liu
---
v11-v14: rebase the patch to latest bpf-next
v10
calls to get better
performace.
[0] https://xdp-project.net/#Handling-multicast
Signed-off-by: Hangbin Liu
---
v14: no update, only rebase the code
v13:
pass xdp_prog through bq_enqueue
v12:
rebase the code based on Jespoer's devmap xdp_prog patch
v11:
Fix bpf_redirect_map_multi() hel
dpdrv ping6 ns2-4
Pass: xdpegress mac ns1-2
Pass: xdpegress mac ns1-3
Pass: xdpegress mac ns1-4
Pass: xdpegress ping ns1-2
Pass: xdpegress ping ns1-3
Pass: xdpegress ping ns1-4
Summary: PASS 24, FAIL 0
Signed-off-by: Hangbin Liu
---
v14: no update, only rebase the code
v13: remove setrlimit
v12
FAILED
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/bpf/test_verifier.c | 22 +-
.../testing/selftests/bpf/verifier/map_ptr.c | 70 +++
2 files changed, 91 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_verifier.c
b/tools/testing
This is a sample for xdp multicast. In the sample we could forward all
packets between given interfaces. There is also an option -X that could
enable 2nd xdp_prog on egress interface.
Signed-off-by: Hangbin Liu
---
v13-v14: no update, only rebase the code
v12: add devmap xdp_prog on egress
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Signed-off-by: Hangbin Liu
---
v6: no code update, only rebase the code
Hi Yonghong,
On Thu, Jan 14, 2021 at 01:01:28PM -0800, Yonghong Song wrote:
> > +/* map to stroe egress interface mac address */
>
> s/stroe/store
Thanks, I will fix it.
> > - struct bpf_program *prog, *dummy_prog;
> > + struct bpf_program *prog, *dummy_prog, *devmap_prog;
> > + int devmap_
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Signed-off-by: Hangbin Liu
---
v7:
a) use bpf_object__find_progr
Hi John,
Thanks for the reviewing.
On Sun, Jan 17, 2021 at 04:10:40PM -0800, John Fastabend wrote:
> > + * The forwarding *map* could be either
> > BPF_MAP_TYPE_DEVMAP or
> > + * BPF_MAP_TYPE_DEVMAP_HASH. But the *ex_map* must be
> > + * BPF_MAP_TY
On Sun, Jan 17, 2021 at 02:57:02PM -0800, John Fastabend wrote:
[...]
> It looks like we could embed xdp_buff in xdp_frame and then keep the metadata
> at the end.
>
> Because you are working performance here wdyt? <- @Jesper as well.
Leave this question to Jesper.
> >
> > - sent = dev->netd
sting")
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/net/fib_tests.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selftests/net/fib_tests.sh
b/tools/testing/selftests/net/fib_tests.sh
index 84205c3a55eb..2b5707738609 100755
--- a/tools/testing/selftests/net/fi
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Acked-by: Yonghong Song
Signed-off-by: Hangbin Liu
---
v8: Fix some
This is a sample for xdp multicast. In the sample we could forward all
packets between given interfaces. There is also an option -X that could
enable 2nd xdp_prog on egress interface.
Signed-off-by: Hangbin Liu
---
v15: use bpf_object__find_program_by_name() instead of
FAILED
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/bpf/test_verifier.c | 22 +-
.../testing/selftests/bpf/verifier/map_ptr.c | 70 +++
2 files changed, 91 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_verifier.c
b/tools/testing
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
includ
dpdrv ping6 ns2-4
Pass: xdpegress mac ns1-2
Pass: xdpegress mac ns1-3
Pass: xdpegress mac ns1-4
Pass: xdpegress ping ns1-2
Pass: xdpegress ping ns1-3
Pass: xdpegress ping ns1-4
Summary: PASS 24, FAIL 0
Signed-off-by: Hangbin Liu
---
v15: use bpf_object__find_program_by_name inste
calls to get better
performace.
[0] https://xdp-project.net/#Handling-multicast
Signed-off-by: Hangbin Liu
---
v15:
a) Update bpf_redirect_map_multi() helper description that ex_map must be
keyed by ifindex.
b) remove variable last_one in dev_map_enqueue_multi() as it's pointless.
c) a
Add a new bpf argument type ARG_CONST_MAP_PTR_OR_NULL which could be
used when we want to allow NULL pointer for map parameter. The bpf helper
need to take care and check if the map is NULL when use this type.
Signed-off-by: Hangbin Liu
---
v13-v15: no update
v11-v12: rebase the patch to latest
>i40e |2.0M | 9.5M | 7.5M
5.10 rc6 + patch | xdp_redirect_map i40e->veth |1.7M | 11.6M | 9.1M
[1]
https://patchwork.ozlabs.org/project/netdev/patch/20201208120159.2278277-1-liuhang...@gmail.com/
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: Hangbin Liu
---
v15:
a) do
On Tue, Jan 19, 2021 at 03:51:27PM +0100, Jesper Dangaard Brouer wrote:
> > @@ -73,13 +90,63 @@ int xdp_redirect_map_prog(struct xdp_md *ctx)
> >
> > /* count packet in global counter */
> > value = bpf_map_lookup_elem(&rxcnt, &key);
> > - if (value)
> > + if (value) {
> >
Set the link down before enslave it to a bond device, to avoid
Error: Device can not be enslaved while up.
Fixes: 6374a5606990 ("selftests: rtnetlink: Test bridge enslavement with
different parent IDs")
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/net/rtnetlink.sh | 2
Hi Ido,
On Wed, Jan 20, 2021 at 12:42:10PM +0200, Ido Schimmel wrote:
> > diff --git a/tools/testing/selftests/net/rtnetlink.sh
> > b/tools/testing/selftests/net/rtnetlink.sh
> > index c9ce3dfa42ee..a26fddc63992 100755
> > --- a/tools/testing/selftests/net/rtnetlink.sh
> > +++ b/tools/testing/sel
Hi Maciej,
On Wed, Jan 20, 2021 at 11:42:38PM +0100, Maciej Fijalkowski wrote:
> > +static int dev_map_bpf_prog_run(struct bpf_prog *xdp_prog,
> > + struct xdp_frame **frames, int n,
> > + struct net_device *dev)
> > +{
> > + struct xdp_txq_info
On Wed, Jan 20, 2021 at 05:46:51PM -0800, Jakub Kicinski wrote:
> On Wed, 20 Jan 2021 21:43:28 +0200 Ido Schimmel wrote:
> > On Wed, Jan 20, 2021 at 10:38:47PM +0800, Hangbin Liu wrote:
> > > Hi Ido,
> > >
> > > On Wed, Jan 20, 2021 at 12:42:10PM +0200, Ido Sc
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Signed-off-by: Hangbin Liu
---
v9:
roll back to just set src mac
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Signed-off-by: Hangbin Liu
---
v10:
make xdp_redirect_map() always i
bpf_xdp_redirect_map_multi() which could accept
include/exclude maps directly.
Hangbin Liu (5):
bpf: add a new bpf argument type ARG_CONST_MAP_PTR_OR_NULL
xdp: add a new helper for dev map multicast support
sample/bpf: add xdp_redirect_map_multicast test
selftests/bpf: Add verifier tests for
>i40e |2.0M | 9.5M | 7.5M
5.10 rc6 + patch | xdp_redirect_map i40e->veth |1.7M | 11.6M | 9.1M
[1] https://lore.kernel.org/bpf/20210122025007.2968381-1-liuhang...@gmail.com
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: Hangbin Liu
---
v16:
a) refactor bq_xmit_all logic
Add a new bpf argument type ARG_CONST_MAP_PTR_OR_NULL which could be
used when we want to allow NULL pointer for map parameter. The bpf helper
need to take care and check if the map is NULL when use this type.
Signed-off-by: Hangbin Liu
---
v13-v15: no update
v11-v12: rebase the patch to latest
calls to get better
performace.
[0] https://xdp-project.net/#Handling-multicast
Signed-off-by: Hangbin Liu
---
v15:
a) Update bpf_redirect_map_multi() helper description that ex_map must be
keyed by ifindex.
b) remove variable last_one in dev_map_enqueue_multi() as it's pointless.
c) a
dpdrv ping6 ns2-4
Pass: xdpegress mac ns1-2
Pass: xdpegress mac ns1-3
Pass: xdpegress mac ns1-4
Pass: xdpegress ping ns1-2
Pass: xdpegress ping ns1-3
Pass: xdpegress ping ns1-4
Summary: PASS 24, FAIL 0
Signed-off-by: Hangbin Liu
---
v15: use bpf_object__find_program_by_name inste
This is a sample for xdp multicast. In the sample we could forward all
packets between given interfaces. There is also an option -X that could
enable 2nd xdp_prog on egress interface.
Signed-off-by: Hangbin Liu
---
v15: use bpf_object__find_program_by_name() instead of
FAILED
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/bpf/test_verifier.c | 21 +-
.../testing/selftests/bpf/verifier/map_ptr.c | 70 +++
2 files changed, 90 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_verifier.c
b/tools/testing
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Signed-off-by: Hangbin Liu
---
v5:
a) close fd when err out in get_ma
ev_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.
Hangbin Liu (5):
>i40e |2.0M | 9.5M | 7.5M
5.10 rc6 + patch | xdp_redirect_map i40e->veth |1.7M | 11.6M | 9.1M
[1]
https://patchwork.ozlabs.org/project/netdev/patch/20201208120159.2278277-1-liuhang...@gmail.com/
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: Hangbin Liu
---
ker
Add a new bpf argument type ARG_CONST_MAP_PTR_OR_NULL which could be
used when we want to allow NULL pointer for map parameter. The bpf helper
need to take care and check if the map is NULL when use this type.
Signed-off-by: Hangbin Liu
---
v11-v12: rebase the patch to latest bpf-next
v10
FAILED
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/bpf/test_verifier.c | 22 +-
.../testing/selftests/bpf/verifier/map_ptr.c | 70 +++
2 files changed, 91 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_verifier.c
b/tools/testing
calls to get better
performace.
[0] https://xdp-project.net/#Handling-multicast
Signed-off-by: Hangbin Liu
---
v12:
rebase the code based on Jespoer's devmap xdp_prog patch
v11:
Fix bpf_redirect_map_multi() helper description typo.
Add loop limit for devmap_get_next_obj() and dev_m
This is a sample for xdp multicast. In the sample we could forward all
packets between given interfaces. There is also an option -X that could
enable 2nd xdp_prog on egress interface.
Signed-off-by: Hangbin Liu
---
v12: add devmap xdp_prog on egress support
v10-v11: no update
v9: use NULL
dpdrv ping6 ns2-4
Pass: xdpegress mac ns1-2
Pass: xdpegress mac ns1-3
Pass: xdpegress mac ns1-4
Pass: xdpegress ping ns1-2
Pass: xdpegress ping ns1-3
Pass: xdpegress ping ns1-4
Summary: PASS 24, FAIL 0
Signed-off-by: Hangbin Liu
---
v12: add devmap prog test on egress
v9: use NULL directly for arg
Hi David,
Thanks for the comment.
On Thu, Dec 17, 2020 at 09:07:03AM -0700, David Ahern wrote:
> > + return n - nframes; /* dropped frames count */
>
> just return nframes here, since ...
>
> > + xdp_drop = dev_map_bpf_prog_run(bq->xdp_prog, bq->q, cnt, dev);
> > + cnt -=
Hi David,
I just aware that,
On Thu, Dec 17, 2020 at 09:07:03AM -0700, David Ahern wrote:
> > +static int dev_map_bpf_prog_run(struct bpf_prog *xdp_prog,
> > + struct xdp_frame **frames, int n,
> > + struct net_device *dev)
> > +{
> > + struct
bpf_xdp_redirect_map_multi() which could accept
include/exclude maps directly.
Hangbin Liu (5):
bpf: add a new bpf argument type ARG_CONST_MAP_PTR_OR_NULL
xdp: add a new helper for dev map multicast support
sample/bpf: add xdp_redirect_map_multicast test
selftests/bpf: Add verifier tests for
This is a sample for xdp multicast. In the sample we could forward all
packets between given interfaces. There is also an option -X that could
enable 2nd xdp_prog on egress interface.
Signed-off-by: Hangbin Liu
---
v12: add devmap xdp_prog on egress support
v10-v11: no update
v9: use NULL
calls to get better
performace.
[0] https://xdp-project.net/#Handling-multicast
Signed-off-by: Hangbin Liu
---
v13:
pass xdp_prog through bq_enqueue
v12:
rebase the code based on Jespoer's devmap xdp_prog patch
v11:
Fix bpf_redirect_map_multi() helper description typo.
Add
-off-by: Hangbin Liu
---
v11-v12: rebase the patch to latest bpf-next
v10: remove useless CONST_PTR_TO_MAP_OR_NULL and Copy-paste comment.
v9: merge the patch from [1] in to this series.
v1-v8: no this patch
---
include/linux/bpf.h | 1 +
kernel/bpf/verifier.c | 10 ++
2 files changed
>i40e |2.0M | 9.5M | 7.5M
5.10 rc6 + patch | xdp_redirect_map i40e->veth |1.7M | 11.6M | 9.1M
[1]
https://patchwork.ozlabs.org/project/netdev/patch/20201208120159.2278277-1-liuhang...@gmail.com/
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: Hangbin Liu
---
v13: pa
dpdrv ping6 ns2-4
Pass: xdpegress mac ns1-2
Pass: xdpegress mac ns1-3
Pass: xdpegress mac ns1-4
Pass: xdpegress ping ns1-2
Pass: xdpegress ping ns1-3
Pass: xdpegress ping ns1-4
Summary: PASS 24, FAIL 0
Signed-off-by: Hangbin Liu
---
v13: remove setrlimit
v12: add devmap prog test on egress
v9: use
FAILED
Signed-off-by: Hangbin Liu
---
tools/testing/selftests/bpf/test_verifier.c | 22 +-
.../testing/selftests/bpf/verifier/map_ptr.c | 70 +++
2 files changed, 91 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_verifier.c
b/tools/testing
On Thu, Nov 26, 2020 at 10:31:56PM -0800, Yonghong Song wrote:
> > index 35e16dee613e..8bdec0865e1d 100644
> > --- a/samples/bpf/xdp_redirect_map_user.c
> > +++ b/samples/bpf/xdp_redirect_map_user.c
> > @@ -21,12 +21,13 @@
> > static int ifindex_in;
> > static int ifindex_out;
> > -static bool
On Mon, Nov 30, 2020 at 10:32:08AM +0100, Jesper Dangaard Brouer wrote:
> > I plan to write a example about vlan header modification based on egress
> > index. I will post the patch later.
>
> I did notice the internal thread you had with Toke. I still think it
> will be more simple to modify the
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Signed-off-by: Hangbin Liu
---
v3:
a) modify the src mac address based
On Tue, Dec 08, 2020 at 11:39:14AM +0100, Jesper Dangaard Brouer wrote:
> > + /* If -X supplied, load 2nd xdp prog on egress.
> > +* If not, just load dummy prog on egress.
> > +*/
>
> The dummy prog need to be loaded, regardless of 2nd xdp prog on egress.
Thanks for this remind, Now I
This patch add a xdp program on egress to show that we can modify
the packet on egress. In this sample we will set the pkt's src
mac to egress's mac address. The xdp_prog will be attached when
-X option supplied.
Signed-off-by: Hangbin Liu
---
v4:
a) Update get_mac_addr socket creati
d 90
I also run the following upstream kselftest with patches iproute2 and
all passed.
test_lwt_ip_encap.sh
test_xdp_redirect.sh
test_tc_redirect.sh
test_xdp_meta.sh
test_xdp_veth.sh
test_xdp_vlan.sh
Hangbin Liu (5):
iproute2: add check_libbpf() and get_libbpf_version()
lib: make ipvrf able t
can't be sure that the
version we discovered at compile time is actually the one we are
using at runtime. This can lead to hard-to-debug errors. So we add
a new file lib/bpf_glue.c and a helper function get_libbpf_version()
to get correct libbpf version at runtime.
Signed-off-by: Hangbin Liu
--
pport in
iproute2.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Hangbin Liu
---
v6: bpf_glue.c is created in previous patch. So I changed the commit
description.
v5: Fix bpf_prog_load_dev typo.
v4: Add new file bpf_glue.c
v2-v3: no update
---
include/bpf_util.h | 10 +++--
.
For tail calls, we find it first and update the element after prog load.
Other maps/progs will be loaded by libbpf directly.
[1] https://lore.kernel.org/bpf/20190820114706.18546-1-t...@redhat.com/
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Hangbin Liu
---
v6: also make bpf_libbpf.c
Users should try use the new BTF defined maps instead of struct
bpf_elf_map defined maps. The tail call examples are not added yet
as libbpf doesn't currently support declaratively populating tail call
maps.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Hangbin Liu
---
examples/bpf/R
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Hangbin Liu
---
examples/bpf/README| 14 +-
examples/bpf/{ => legacy}/bpf_cyclic.c | 2 +-
examples/bpf/{ => legacy}/bpf_graft.c | 2 +-
examples/bpf/{ => legacy}/bpf_map_in_map.c | 2 +-
dex 5: 66 pkt/s, out ifindex 6: 66 pkt/s
Signed-off-by: Hangbin Liu
---
v2:
a) use pkt counter instead of IP ttl modification on egress program
b) make the egress program selectable by option -X
---
samples/bpf/xdp_redirect_map_kern.c | 26 +++--
samples/bpf/xdp_redirect_map_user.c
On Thu, Nov 26, 2020 at 11:51:19AM +0100, Jesper Dangaard Brouer wrote:
> On Thu, 26 Nov 2020 16:43:25 +0800
> Hangbin Liu wrote:
>
> > Current sample test xdp_redirect_map only count pkts on ingress. But we
> > can't know whether the pkts are redirected or droppe
The tcbpf2_kern.o and related kernel sections are moved to bpf
selftest folder since b05cd7404323 ("samples/bpf: remove the bpf tunnel
testsuite."). Remove this one as well.
Fixes: b05cd7404323 ("samples/bpf: remove the bpf tunnel testsuite.")
Acked-by: Martin KaFai Lau
Si
e ip6ip6 test back to bpf tunnel test. Update the ipip6's
topology for both IPv4 and IPv6 testing. Since iperf test is removed as
currect framework simplified it in purpose, I also removed unused tcp
checkings in test_tunnel_kern.c.
Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.")
2: Keep ip6ip6 section in test_tunnel_kern.c.
Hangbin Liu (2):
selftest/bpf: add missed ip6ip6 test back
samples/bpf: remove unused test_ipip.sh
samples/bpf/test_ipip.sh | 179 --
.../selftests/bpf/progs/test_tunnel_kern.c| 42 +---
tools/testing/selftests/bp
This patch add running xdp program on egress interface support for
xdp_redirect_map sample. The new prog will change the IP ttl based
on egress ifindex.
Signed-off-by: Hangbin Liu
---
samples/bpf/xdp_redirect_map_kern.c | 74 -
samples/bpf/xdp_redirect_map_user.c
On Tue, Nov 10, 2020 at 03:25:10PM +0100, Jesper Dangaard Brouer wrote:
> On Tue, 10 Nov 2020 20:46:39 +0800
> Hangbin Liu wrote:
>
> > This patch add running xdp program on egress interface support for
> > xdp_redirect_map sample. The new prog will change the IP ttl based
On Fri, Nov 13, 2020 at 08:24:41PM -0700, David Ahern wrote:
> On 11/9/20 12:07 AM, Hangbin Liu wrote:
> > diff --git a/lib/bpf_glue.c b/lib/bpf_glue.c
> > new file mode 100644
> > index ..7626a893
> > --- /dev/null
> > +++ b/lib/bpf_glue.c
>
> ...
On Fri, Nov 13, 2020 at 08:26:51PM -0700, David Ahern wrote:
> > +# Influential LIBBPF environment variables:
> > +# LIBBPF_FORCE={on,off} on: require link against libbpf;
> > +# off: disable libbpf probing
> > +# LIBBPF_LIBDIR Path to libbpf to use
> > +
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Hangbin Liu
---
examples/bpf/README| 14 +-
examples/bpf/{ => legacy}/bpf_cyclic.c | 2 +-
examples/bpf/{ => legacy}/bpf_graft.c | 2 +-
examples/bpf/{ => legacy}/bpf_map_in_map.c | 2 +-
iproute2
with libbpf. If set to on, then force to build with libbpf and exit if
not available. If set to off, then force to not build with libbpf.
Signed-off-by: Hangbin Liu
---
v5:
1) Fix LIBBPF_DIR typo and description, use libbpf DESTDIR as LIBBPF_DIR
dest.
v4:
1) Remove duplicate
Users should try use the new BTF defined maps instead of struct
bpf_elf_map defined maps. The tail call examples are not added yet
as libbpf doesn't currently support declaratively populating tail call
maps.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Hangbin Liu
---
examples/bpf/R
.
For tail calls, we find it first and update the element after prog load.
Other maps/progs will be loaded by libbpf directly.
[1] https://lore.kernel.org/bpf/20190820114706.18546-1-t...@redhat.com/
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Hangbin Liu
---
v4:
Move ipvrf code to patch 02
.sh
test_xdp_veth.sh
test_xdp_vlan.sh
Hangbin Liu (5):
configure: add check_libbpf() for later libbpf support
lib: rename bpf.c to bpf_legacy.c
lib: add libbpf support
examples/bpf: move struct bpf_elf_map defined maps to legacy folder
examples/bpf: add bpf examples with BTF defi
ibbpf function name.
Signed-off-by: Hangbin Liu
---
v5: Fix bpf_prog_load_dev typo.
v4: Add new file bpf_glue.c
v2-v3: no update
---
include/bpf_util.h | 10 +++---
ip/ipvrf.c | 6 +++---
lib/Makefile| 2 +-
lib/bpf_glue.c
On Mon, Nov 16, 2020 at 06:37:57PM -0800, Alexei Starovoitov wrote:
> On Mon, Nov 16, 2020 at 03:54:46PM +0100, Jesper Dangaard Brouer wrote:
> >
> > Thus, IMHO we MUST move forward and get started with converting
> > iproute2 to libbpf, and start on the work to deprecate the build in
> > BPF-ELF-
1 - 100 of 726 matches
Mail list logo