Re: [ovs-dev] [PATCH] netdev-afxdp: Update memory locking limits unconditionally.

2019-10-11 Thread William Tu
On Fri, Oct 11, 2019 at 01:17:59PM +0200, Ilya Maximets wrote:
> On 10.10.2019 20:29, William Tu wrote:
> >On Wed, Oct 09, 2019 at 04:23:31PM +0200, Ilya Maximets wrote:
> >>Any type of AF_XDP socket in all modes implies creation of BPF map of
> >>type BPF_MAP_TYPE_XSKMAP.  This leads to BPF_MAP_CREATE syscall and
> >>subsequently 'xsk_map_alloc()' function that will charge required
> >>memory from the memlock limit and fail with EPERM if we're trying
> >>to allocate more.
> >>
> >>On my system with 64K bytes of max locked memory by default, OVS
> >>frequently starts to fail after addition of 3rd afxdp port in SKB
> >>mode:
> >>
> >>   netdev_afxdp|ERR|xsk_socket__create failed (Operation not permitted)
> >>mode: SKB qid: 0
> >>
> >>Fixes: 0de1b425962d ("netdev-afxdp: add new netdev type for AF_XDP.")
> >>Signed-off-by: Ilya Maximets 
> >>---
> >Good catch!
> >
> >I applied to master.
> >
> >--William
> >
> 
> Thanks!
> This also needs to be backported to 2.12.
> 
> Best regards, Ilya Maximets.

Done, thanks
William
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] netdev-afxdp: Update memory locking limits unconditionally.

2019-10-11 Thread Ilya Maximets

On 10.10.2019 20:29, William Tu wrote:

On Wed, Oct 09, 2019 at 04:23:31PM +0200, Ilya Maximets wrote:

Any type of AF_XDP socket in all modes implies creation of BPF map of
type BPF_MAP_TYPE_XSKMAP.  This leads to BPF_MAP_CREATE syscall and
subsequently 'xsk_map_alloc()' function that will charge required
memory from the memlock limit and fail with EPERM if we're trying
to allocate more.

On my system with 64K bytes of max locked memory by default, OVS
frequently starts to fail after addition of 3rd afxdp port in SKB
mode:

   netdev_afxdp|ERR|xsk_socket__create failed (Operation not permitted)
mode: SKB qid: 0

Fixes: 0de1b425962d ("netdev-afxdp: add new netdev type for AF_XDP.")
Signed-off-by: Ilya Maximets 
---

Good catch!

I applied to master.

--William



Thanks!
This also needs to be backported to 2.12.

Best regards, Ilya Maximets.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] netdev-afxdp: Update memory locking limits unconditionally.

2019-10-10 Thread William Tu
On Wed, Oct 09, 2019 at 04:23:31PM +0200, Ilya Maximets wrote:
> Any type of AF_XDP socket in all modes implies creation of BPF map of
> type BPF_MAP_TYPE_XSKMAP.  This leads to BPF_MAP_CREATE syscall and
> subsequently 'xsk_map_alloc()' function that will charge required
> memory from the memlock limit and fail with EPERM if we're trying
> to allocate more.
> 
> On my system with 64K bytes of max locked memory by default, OVS
> frequently starts to fail after addition of 3rd afxdp port in SKB
> mode:
> 
>   netdev_afxdp|ERR|xsk_socket__create failed (Operation not permitted)
>mode: SKB qid: 0
> 
> Fixes: 0de1b425962d ("netdev-afxdp: add new netdev type for AF_XDP.")
> Signed-off-by: Ilya Maximets 
> ---
Good catch!

I applied to master.

--William

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev