Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread Alexei Starovoitov
On 7/14/15 5:58 PM, John Fastabend wrote: Right and we hit this issue when pktgen is run over any stacked device with clone_skb set. I've always put it in the don't do this category but a fix would be nice. hmm, are you sure that commit 52d6c8c6ca12 ("net: pktgen: disable xmit_clone on virtual

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread John Fastabend
On 15-07-14 04:08 PM, Alexei Starovoitov wrote: > On 7/14/15 3:34 PM, David Miller wrote: > 1 get rid of burst hack for both RX and TX in pktgen (kills > >>>performance) >> #1 is a serious consideration if you don't come up with better ideas, >> since an optimization is for nothing if it kn

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread Alexei Starovoitov
On 7/14/15 3:34 PM, David Miller wrote: 1 get rid of burst hack for both RX and TX in pktgen (kills >>>performance) #1 is a serious consideration if you don't come up with better ideas, since an optimization is for nothing if it knowingly breaks things. I've dug up the pktgen source from 2002

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread David Miller
From: Alexei Starovoitov Date: Mon, 13 Jul 2015 15:26:46 -0700 > On 7/13/15 1:55 PM, Daniel Borkmann wrote: >> On 07/13/2015 10:17 PM, Alexei Starovoitov wrote: >> ... >>> We cannot check tc actions from pktgen, since they can be added >>> dynamically. >>> So I see three options: >>> 1 get rid of

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread Alexei Starovoitov
On 7/14/15 3:29 AM, Daniel Borkmann wrote: One other thing that comes to mind, not sure if it's worth it though, would be to split the skb->tc_verd's TC_NCLS itself into TC_NCLS/TC_NACT, so that you can go into the classifier, but skip the action part. Since in tcf_action_exec(), we already test

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread Daniel Borkmann
On 07/14/2015 01:57 PM, Jamal Hadi Salim wrote: On 07/14/15 06:29, Daniel Borkmann wrote: On 07/14/2015 12:26 AM, Alexei Starovoitov wrote: On 7/13/15 1:55 PM, Daniel Borkmann wrote: On 07/13/2015 10:17 PM, Alexei Starovoitov wrote: ... We cannot check tc actions from pktgen, since they can b

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread Jamal Hadi Salim
On 07/14/15 06:29, Daniel Borkmann wrote: On 07/14/2015 12:26 AM, Alexei Starovoitov wrote: On 7/13/15 1:55 PM, Daniel Borkmann wrote: On 07/13/2015 10:17 PM, Alexei Starovoitov wrote: ... We cannot check tc actions from pktgen, since they can be added dynamically. So I see three options: 1 ge

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-14 Thread Daniel Borkmann
On 07/14/2015 12:26 AM, Alexei Starovoitov wrote: On 7/13/15 1:55 PM, Daniel Borkmann wrote: On 07/13/2015 10:17 PM, Alexei Starovoitov wrote: ... We cannot check tc actions from pktgen, since they can be added dynamically. So I see three options: 1 get rid of burst hack for both RX and TX in p

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-13 Thread Alexei Starovoitov
On 7/13/15 1:55 PM, Daniel Borkmann wrote: On 07/13/2015 10:17 PM, Alexei Starovoitov wrote: ... We cannot check tc actions from pktgen, since they can be added dynamically. So I see three options: 1 get rid of burst hack for both RX and TX in pktgen (kills performance) 2 add unlikely(skb_shread

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-13 Thread Daniel Borkmann
On 07/13/2015 10:17 PM, Alexei Starovoitov wrote: ... We cannot check tc actions from pktgen, since they can be added dynamically. So I see three options: 1 get rid of burst hack for both RX and TX in pktgen (kills performance) 2 add unlikely(skb_shread) check to few tc actions 3 do nothing I th

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-13 Thread Alexei Starovoitov
On 7/13/15 1:04 PM, David Miller wrote: From: Alexei Starovoitov Date: Mon, 13 Jul 2015 12:47:42 -0700 In all normal cases skb->users == 1, but pktgen is using trick: atomic_add(burst, &skb->users); so when testing something like: You can want pktgen rx (which is the only buggy case as far a

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-13 Thread David Miller
From: Alexei Starovoitov Date: Mon, 13 Jul 2015 12:47:42 -0700 > In all normal cases skb->users == 1, but pktgen is using trick: > atomic_add(burst, &skb->users); > so when testing something like: You can want pktgen rx (which is the only buggy case as far as I can see, TX is fine) to run fast,

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-13 Thread Alexei Starovoitov
On 7/11/15 9:29 PM, David Miller wrote: From: Alexei Starovoitov Date: Fri, 10 Jul 2015 17:10:11 -0700 TC actions need to check for very unlikely event skb->users != 1, otherwise subsequent pskb_may_pull/pskb_expand_head will crash. When skb_shared() just drop the packet, since in the middle o

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-13 Thread Jamal Hadi Salim
On 07/10/15 20:10, Alexei Starovoitov wrote: TC actions need to check for very unlikely event skb->users != 1, otherwise subsequent pskb_may_pull/pskb_expand_head will crash. When skb_shared() just drop the packet, since in the middle of actions it's too late to call skb_share_check(), since clas

Re: [PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-11 Thread David Miller
From: Alexei Starovoitov Date: Fri, 10 Jul 2015 17:10:11 -0700 > TC actions need to check for very unlikely event skb->users != 1, > otherwise subsequent pskb_may_pull/pskb_expand_head will crash. > When skb_shared() just drop the packet, since in the middle of actions > it's too late to call skb

[PATCH net-next] tc: fix tc actions in case of shared skb

2015-07-11 Thread Alexei Starovoitov
TC actions need to check for very unlikely event skb->users != 1, otherwise subsequent pskb_may_pull/pskb_expand_head will crash. When skb_shared() just drop the packet, since in the middle of actions it's too late to call skb_share_check(), since classifiers/actions assume the same skb pointer. S