Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-19 Thread Jamal Hadi Salim
On 17-04-19 09:47 AM, Eric Dumazet wrote: Try to _not_ use 32768 bytes for the recvmsg() sizes, but 4KB You pack XXX actions until 4KB skb is full. Then code does : nla_put_u32(skb, TCAA_ACT_COUNT, cb->args[1]) This might fail, then you goto out_module_put; Then we are stuck ? What am I

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-19 Thread Eric Dumazet
On Wed, 2017-04-19 at 07:24 -0400, Jamal Hadi Salim wrote: > On 17-04-18 11:17 PM, Eric Dumazet wrote: > > On Tue, 2017-04-18 at 22:32 -0400, Jamal Hadi Salim wrote: > >> On 17-04-18 09:49 PM, Eric Dumazet wrote: > >>> On Tue, 2017-04-18 at 21:14 -0400, Jamal Hadi Salim wrote: > > >> > >> Make

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-19 Thread Jamal Hadi Salim
On 17-04-18 11:17 PM, Eric Dumazet wrote: On Tue, 2017-04-18 at 22:32 -0400, Jamal Hadi Salim wrote: On 17-04-18 09:49 PM, Eric Dumazet wrote: On Tue, 2017-04-18 at 21:14 -0400, Jamal Hadi Salim wrote: Make sense? What if we have 1024 actions, and user provides a 4KB buffer ? No

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-19 Thread Jamal Hadi Salim
On 17-04-19 02:12 AM, Cong Wang wrote: On Tue, Apr 18, 2017 at 7:32 PM, Jamal Hadi Salim wrote: On 17-04-18 09:49 PM, Eric Dumazet wrote: With this change I ask the kernel to fit as many actions as possible in the 32K (all these 128 will fit in one batch). Then it has to

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-19 Thread Jamal Hadi Salim
On 17-04-19 12:55 AM, Roopa Prabhu wrote: On 4/18/17, 6:14 PM, Jamal Hadi Salim wrote: A new top level TLV space is introduced. An attribute TCAA_ACT_FLAGS is used to carry the flags indicating the user is capable of processing these large dumps. Older user space which doesnt set this flag

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-19 Thread Cong Wang
On Tue, Apr 18, 2017 at 7:32 PM, Jamal Hadi Salim wrote: > On 17-04-18 09:49 PM, Eric Dumazet wrote: >> >> On Tue, 2017-04-18 at 21:14 -0400, Jamal Hadi Salim wrote: >>> >>> From: Jamal Hadi Salim >> >> >> So there is no more limit ? How user is supposed to

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-18 Thread Roopa Prabhu
On 4/18/17, 6:14 PM, Jamal Hadi Salim wrote: > From: Jamal Hadi Salim > > When you dump hundreds of thousands of actions, getting only 32 per > dump batch even when the socket buffer and memory allocations allow > is inefficient. > > With this change, the user will get as many

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-18 Thread Eric Dumazet
On Tue, 2017-04-18 at 22:32 -0400, Jamal Hadi Salim wrote: > On 17-04-18 09:49 PM, Eric Dumazet wrote: > > On Tue, 2017-04-18 at 21:14 -0400, Jamal Hadi Salim wrote: > >> From: Jamal Hadi Salim > > > > So there is no more limit ? How user is supposed to size the buffer for > >

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-18 Thread Jamal Hadi Salim
On 17-04-18 09:49 PM, Eric Dumazet wrote: On Tue, 2017-04-18 at 21:14 -0400, Jamal Hadi Salim wrote: From: Jamal Hadi Salim So there is no more limit ? How user is supposed to size the buffer for recvmsg() ? That part doesnt change. Ok, I believe more clarity is

Re: [PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-18 Thread Eric Dumazet
On Tue, 2017-04-18 at 21:14 -0400, Jamal Hadi Salim wrote: > From: Jamal Hadi Salim So there is no more limit ? How user is supposed to size the buffer for recvmsg() ? > t->tca__pad1 = 0; > @@ -1113,6 +1133,9 @@ static int tc_dump_action(struct sk_buff *skb, struct >

[PATCH net-next 1/2 v2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-18 Thread Jamal Hadi Salim
From: Jamal Hadi Salim When you dump hundreds of thousands of actions, getting only 32 per dump batch even when the socket buffer and memory allocations allow is inefficient. With this change, the user will get as many as possibly fitting within the given constraints