Re: [Patch net-next] net_sched: remove the leftover cleanup_a()

2016-08-03 Thread Jamal Hadi Salim
Cong, Improvement on the basic test as it no longer oopses, but: here's a test that will oops: - # add action that will be shared for multi-flows sudo tc actions add action drop index 10 #add an action noone uses sudo tc actions add action ok index 12 # sudo tc

Re: [iproute PATCH 3/4] tc: use action_a2n() everywhere

2016-07-26 Thread Jamal Hadi Salim
On 16-07-23 07:28 AM, Phil Sutter wrote: Signed-off-by: Phil Sutter <p...@nwl.cc> Thanks for the nice work Phil. Acked-by: Jamal Hadi Salim <j...@mojatatu.com> cheers, jamal

Re: [iproute PATCH 2/4] tc: util: bore up action_a2n()

2016-07-26 Thread Jamal Hadi Salim
-by: Phil Sutter <p...@nwl.cc> Acked-by: Jamal Hadi Salim <j...@mojatatu.com> cheers, jamal

Re: [Patch net-next v2 1/2] net_sched: move tc_action into tcf_common

2016-07-26 Thread Jamal Hadi Salim
inherit from it. Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> Cong - i need to stare at this longer than cursory to give feedback. I apologize, I am in travel mode but will get back to you. cheers, jamal

Re: [patch net-next 1/9] mlxsw: pci: Add resources query implementation.

2016-07-21 Thread Jamal Hadi Salim
On 16-07-21 05:43 AM, Jiri Pirko wrote: Thu, Jul 21, 2016 at 11:41:18AM CEST, j...@mojatatu.com wrote: Ok, here's an example: On 16-07-21 04:19 AM, Jiri Pirko wrote: Email is splitting that first line - but it is 80 chars or less You are right. Will fix this. ok, passed my first test

Re: [patch net-next 1/9] mlxsw: pci: Add resources query implementation.

2016-07-21 Thread Jamal Hadi Salim
Ok, here's an example: On 16-07-21 04:19 AM, Jiri Pirko wrote: From: Nogah Frankel +static int +mlxsw_pci_resources_query(struct mlxsw_pci *mlxsw_pci, char *mbox, + struct mlxsw_resources *resources, u8 query_enabled) +{ to: static int

Re: [patch net-next 0/9] mlxsw: implement port mirroring offload

2016-07-21 Thread Jamal Hadi Salim
On 16-07-21 05:07 AM, Jiri Pirko wrote: Thu, Jul 21, 2016 at 11:00:33AM CEST, j...@mojatatu.com wrote: On 16-07-21 04:19 AM, Jiri Pirko wrote: From: Jiri Pirko [..] infrastructure. If answer is yes, thencould we have used a classifier like u32 here? i.e something like:

Re: [patch net-next 0/9] mlxsw: implement port mirroring offload

2016-07-21 Thread Jamal Hadi Salim
On 16-07-21 04:19 AM, Jiri Pirko wrote: From: Jiri Pirko This patchset introduces tc matchall classifier and its offload to Spectrum hardware. In combination with mirred action, defined port mirroring setup is offloaded by mlxsw/spectrum driver. The commands used for

Re: [Patch net-next 1/2] net_sched: move tc_action into tcf_common

2016-07-21 Thread Jamal Hadi Salim
It is an involved change (and i was fond of the container_of() trickery;)). Looking at this patch I cant grok some parts - maybe i need to apply it when i am not in a hurry to see clearly. Mostly this around things like: --- const struct tc_action *a struct tcf_mirred *m = to_mirred(a) ---

WAS ( Re: [PATCH net-next 1/1] net_sched: Introduce skbmod action

2016-07-21 Thread Jamal Hadi Salim
On 16-07-19 08:23 PM, Daniel Borkmann wrote: On 07/19/2016 08:04 PM, Cong Wang wrote: On Tue, Jul 19, 2016 at 8:03 AM, Daniel Borkmann <dan...@iogearbox.net> wrote: On 07/19/2016 03:56 PM, Jamal Hadi Salim wrote: [...] [..] I don't think so. 1) checksum is supposed to be done by csum

Re: [PATCH net-next 1/1] net_sched: Introduce skbmod action

2016-07-19 Thread Jamal Hadi Salim
On 16-07-19 09:21 AM, Daniel Borkmann wrote: True, the 32 bit chunks are more generic and as such you need to put more effort in user space to handle them, but at the same time gain more flexibility w/o having to have a module for each and every proto. I dont see anything wrong with using

Re: [PATCH net-next 1/1] net_sched: Introduce skbmod action

2016-07-19 Thread Jamal Hadi Salim
On 16-07-18 01:38 PM, Cong Wang wrote: On Mon, Jul 18, 2016 at 3:26 AM, Jamal Hadi Salim <j...@mojatatu.com> wrote: On 16-07-18 06:07 AM, Thomas Graf wrote: Right. I was at the same point as Jamal and it is nasty to try and reverse engineer the dumps without any further hints. I

Re: [PATCH net-next 1/1] net_sched: Introduce skbmod action

2016-07-18 Thread Jamal Hadi Salim
On 16-07-18 06:07 AM, Thomas Graf wrote: Right. I was at the same point as Jamal and it is nasty to try and reverse engineer the dumps without any further hints. I assume that's what he is referring to with difficulties. That +: if you get me a field which says "dstmac" i dont have to go

Re: [PATCH net-next 1/1] net_sched: Introduce skbmod action

2016-07-18 Thread Jamal Hadi Salim
On 16-07-18 05:44 AM, Daniel Borkmann wrote: On 07/18/2016 08:51 AM, Jamal Hadi Salim wrote: On 16-07-18 12:19 AM, Alexei Starovoitov wrote: Looking at that just out of curiosity on how complex it could look for src/dst mac, is it actually functional in iproute2 upstream tree

Re: [PATCH net-next 1/1] net_sched: Introduce skbmod action

2016-07-18 Thread Jamal Hadi Salim
On 16-07-18 12:19 AM, Alexei Starovoitov wrote: On Sun, Jul 17, 2016 at 04:41:24AM -0400, Jamal Hadi Salim wrote: From: Jamal Hadi Salim <j...@mojatatu.com> This action is intended to be an upgrade from a usability perspective from pedit (as well as operational debugability). C

[PATCH net-next 1/1] net_sched: Introduce skbmod action

2016-07-17 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> This action is intended to be an upgrade from a usability perspective from pedit (as well as operational debugability). Compare this: sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \ u32 match ip protocol 1 0xff flowid 1:2 \ action

Re: [PATCH v6 05/12] Add sample for adding simple drop program to link

2016-07-16 Thread Jamal Hadi Salim
On 16-07-11 09:37 AM, Jesper Dangaard Brouer wrote: On Mon, 11 Jul 2016 07:09:26 -0400 Jamal Hadi Salim <j...@mojatatu.com> wrote: $ perf record -a samples/bpf/xdp1 $( [..] So - devil's advocate speaking: I can filter and drop with this very specific NIC at 10x as fast in ha

Re: [RFC PATCH net-next 1/1] Introduce skbmod action

2016-07-16 Thread Jamal Hadi Salim
On 16-07-12 01:10 PM, Cong Wang wrote: On Mon, Jul 11, 2016 at 5:12 AM, Jamal Hadi Salim <j...@mojatatu.com> wrote: From: Jamal Hadi Salim <j...@mojatatu.com> This action is intended to be an upgrade from a usability perspective from pedit. Compare this: Definitely agree we need

[RFC PATCH net-next 1/1] Introduce skbmod action

2016-07-11 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> This action is intended to be an upgrade from a usability perspective from pedit. Compare this: sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \ u32 match ip protocol 1 0xff flowid 1:2 \ action pedit munge offset -14 u8 se

Re: [PATCH v6 05/12] Add sample for adding simple drop program to link

2016-07-11 Thread Jamal Hadi Salim
On 16-07-07 10:15 PM, Brenden Blanco wrote: Add a sample program that only drops packets at the BPF_PROG_TYPE_XDP_RX hook of a link. With the drop-only program, observed single core rate is ~20Mpps. Other tests were run, for instance without the dropcnt increment or without reading from the

Re: [PATCH v2 net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-06 Thread Jamal Hadi Salim
On 16-07-05 02:19 PM, Cong Wang wrote: On Tue, Jul 5, 2016 at 4:04 AM, Jamal Hadi Salim <j...@mojatatu.com> wrote: Second arguement usability, from: to: $TC filter add dev $ETH parent 1: protocol ip prio 10 \ u32 match ip protocol 1 0xff flowid 1:2 \ action mirred egress re

Re: [PATCH v2 net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-05 Thread Jamal Hadi Salim
On 16-07-04 06:14 PM, David Miller wrote: I agree with Jiri. The whole model is to chain together the actions that you need to accomplish whatever it is you want to do. This means actions are as specialized as possible, and do one thing as precisely and efficiently as possible. It seems

Re: [PATCH v2 net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-02 Thread Jamal Hadi Salim
On 16-07-02 12:58 PM, Cong Wang wrote: On Sat, Jul 2, 2016 at 7:34 AM, Jamal Hadi Salim <j...@mojatatu.com> wrote: From: Jamal Hadi Salim <j...@mojatatu.com> Often redirecting or mirroring requires that we set the dstMAC address of the target device. While it is possible to pip

[PATCH v2 net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-02 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Often redirecting or mirroring requires that we set the dstMAC address of the target device. While it is possible to pipe to a pedit action, this patch obsoletes the need for that. This is a justified feature because the dst MAC addresses r

Re: [PATCH net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-02 Thread Jamal Hadi Salim
On 16-07-02 10:16 AM, Jamal Hadi Salim wrote: On 16-07-02 10:07 AM, Nikolay Aleksandrov wrote: On 02/07/16 16:02, Jamal Hadi Salim wrote: On 16-07-02 09:49 AM, Nikolay Aleksandrov wrote: Also a minor suggestion - maybe err out on a zero mac address, otherwise the user might think

Re: [PATCH net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-02 Thread Jamal Hadi Salim
On 16-07-02 10:07 AM, Nikolay Aleksandrov wrote: On 02/07/16 16:02, Jamal Hadi Salim wrote: On 16-07-02 09:49 AM, Nikolay Aleksandrov wrote: Also a minor suggestion - maybe err out on a zero mac address, otherwise the user might think the operation was successful. Is a zero mac address

Re: [PATCH net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-02 Thread Jamal Hadi Salim
On 16-07-02 09:49 AM, Nikolay Aleksandrov wrote: On 02/07/16 15:26, Jamal Hadi Salim wrote: From: Jamal Hadi Salim <j...@mojatatu.com> Often redirecting or mirroring requires that we set the MAC address of the target device. While it is possible to pipe to a pedit action this obs

[PATCH net-next 1/1] net sched actions: mirred add support for setting Dst MAC address

2016-07-02 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Often redirecting or mirroring requires that we set the MAC address of the target device. While it is possible to pipe to a pedit action this obsoletes the need for that. This is justified feature because the dst MAC addresses rewrite is such a

[iproute2 1/1] actions: skbedit add support for mod-ing skb pkt_type

2016-07-02 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> I'll make a formal submission sans the header when the kernel patches makes it in. This version is for someone who wants to play around with the net-next kernel patches i sent Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/

[PATCH v2 net-next 3/3] net sched actions: skbedit convert to use more modern nla_put_xxx

2016-07-02 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- net/sched/act_skbedit.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 1c4c924..8e573c0 1006

[PATCH v2 net-next 2/3] net sched actions: skbedit add support for mod-ing skb pkt_type

2016-07-02 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Extremely useful for setting packet type to host so i dont have to modify the dst mac address using pedit (which requires that i know the mac address) Example usage: tc filter add dev eth0 parent : protocol ip pref 9 u32 \ match ip src 5.5.

[PATCH v2 net-next 1/3] net: simplify and make pkt_type_ok() available for other users

2016-07-02 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Suggested-by: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/linux/skbuff.h | 10 ++ net/netfilter/nft_meta.c | 9 + 2 files changed, 11 insertions(+), 8 deleti

Re: [net-next PATCH 1/2] net: pktgen: support injecting packets for qdisc testing

2016-07-01 Thread Jamal Hadi Salim
On 16-06-30 12:53 PM, John Fastabend wrote: On 16-06-30 03:21 AM, Jamal Hadi Salim wrote: On 16-06-29 03:47 PM, John Fastabend wrote: Taking a look at the link couple differences exist. First the patch linked does a 'netif_xmit_frozen_or_drv_stopped(txq)' check but this really shouldn't

Re: [Patch net] net_sched: fix mirrored packets checksum

2016-07-01 Thread Jamal Hadi Salim
On 16-06-30 01:15 PM, Cong Wang wrote: Similar to commit 9b368814b336 ("net: fix bridge multicast packet checksum validation") we need to fixup the checksum for CHECKSUM_COMPLETE when pushing skb on RX path. Otherwise we get similar splats. Cc: Jamal Hadi Salim <j...@mojatatu

Re: [net-next PATCH 1/2] net: pktgen: support injecting packets for qdisc testing

2016-06-30 Thread Jamal Hadi Salim
pkt_dev->errors++; + net_info_ratelimited("%s xmit error: %d\n", + pkt_dev->odevname, ret); + break; + } + goto out; } txq = skb_get_tx_queue(odev, pkt_dev-&g

Re: [Patch net 2/2] act_ife: acquire ife_mod_lock before reading ifeoplist

2016-06-23 Thread Jamal Hadi Salim
On 16-06-20 04:37 PM, Cong Wang wrote: Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> Acked-by: Jamal Hadi Salim <j...@mojatatu.com> cheers, jamal

Re: [Patch net 1/2] act_ife: only acquire tcf_lock for existing actions

2016-06-23 Thread Jamal Hadi Salim
to make sure the whole update is atomic. For net-next, we can get rid of this spinlock because we already hold the RTNL lock on slow path, and on fast path we can use RCU to protect the metalist. Joint work with Jamal. Reported-by: Alexey Khoroshilov <khoroshi...@ispras.ru> Cc: Jamal Hadi Sa

Re: [patch net-next v4 0/4] return offloaded stats as default and expose original sw stats

2016-06-20 Thread Jamal Hadi Salim
On 16-06-19 11:14 PM, Roopa Prabhu wrote: On Fri, Jun 17, 2016 at 10:12 AM, Florian Fainelli wrote: I have also mentioned this before, the default api must provide accumulated (hw and sw) stats..., because this is the api that the user queries on an interface. Sorry

Re: act_mirred: remove spinlock in fast path

2016-06-18 Thread Jamal Hadi Salim
On 16-06-18 11:16 AM, Eric Dumazet wrote: Given an update/replace of an action is such a rare occassion, what is wrong with init doing a spin lock on existing action? Sure, there is performance impact on fast path at that point - but: as established update/replace is _a rare occassion_ ;->

[PATCH net-next 1/2] net: simplify and make pkt_type_ok() available for other users

2016-06-18 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Suggested-by: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/linux/skbuff.h | 11 +++ net/netfilter/nft_meta.c | 9 + 2 files changed, 12 insertions(+), 8

[PATCH net-next 2/2] net sched actions: skbedit add support for mod-ing skb pkt_type

2016-06-18 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Extremely useful for setting packet type to host so i dont have to modify the dst mac address using pedit (which requires that i know the mac address) Example usage: tc filter add dev eth0 parent : protocol ip pref 9 u32 \ match ip src 5.5.

Re: [BUG] act_ife: sleeping functions called in atomic context

2016-06-18 Thread Jamal Hadi Salim
On 16-06-17 01:31 PM, Cong Wang wrote: My patch is against -net. (I see you already figured out your patch is missing in -net-next.) Ok, should have re-read this email before working on the patch;-> Or are you suggesting to rebase it for -net-next? I think it fixes some real bug so -net is

Re: [patch net-next v4 0/4] return offloaded stats as default and expose original sw stats

2016-06-18 Thread Jamal Hadi Salim
On 16-06-18 04:00 AM, Jiri Pirko wrote: Fri, Jun 17, 2016 at 07:12:22PM CEST, f.faine...@gmail.com wrote: Yep. And I believe that for offloaded forwarding, this tools should see hw counters, as they show what is going on in real. If your NIC is offloading packets today, these tools

Re: [PATCH v2 net-next 0/3] net sched action timestamp improvements

2016-06-18 Thread Jamal Hadi Salim
On 16-06-18 12:31 AM, David Miller wrote: From: Jamal Hadi Salim <j...@mojatatu.com> Date: Fri, 17 Jun 2016 07:15:27 -0400 Ok, mystery solved. Dave, this patch series is missing from current net-next. Then what is: commit 53eb440f4ada034ea43b295891feec3df0fa7a29 /blink, blink sorry

Re: act_mirred: remove spinlock in fast path

2016-06-18 Thread Jamal Hadi Salim
On 16-06-17 06:03 PM, Eric Dumazet wrote: On Fri, Jun 17, 2016 at 2:59 PM, Cong Wang wrote: Generally speaking I worry about we change multiple fields in a struct meanwhile we could still read them any time in the middle, we may get them correct for some easy case,

Re: [patch net-next v4 0/4] return offloaded stats as default and expose original sw stats

2016-06-17 Thread Jamal Hadi Salim
On 16-06-17 10:05 AM, Jiri Pirko wrote: Fri, Jun 17, 2016 at 03:48:35PM CEST, d...@cumulusnetworks.com wrote: On 6/17/16 2:24 AM, Jiri Pirko wrote: That is problematic. Existing apps depend on rtnetlink stats. But if we don't count offloaded forwarded packets, the apps don't see anything.

Fwd: Re: [PATCH v2 net-next 0/3] net sched action timestamp improvements

2016-06-17 Thread Jamal Hadi Salim
To: j...@mojatatu.com CC: netdev@vger.kernel.org, xiyou.wangc...@gmail.com, dan...@iogearbox.net From: Jamal Hadi Salim <j...@mojatatu.com> Date: Mon, 6 Jun 2016 06:32:52 -0400 From: Jamal Hadi Salim <j...@mojatatu.com> Various aggregations of duplicated code, fixes and introdu

Re: [BUG] act_ife: sleeping functions called in atomic context

2016-06-17 Thread Jamal Hadi Salim
On 16-06-17 01:38 AM, Cong Wang wrote: On Thu, Jun 16, 2016 at 7:14 PM, Cong Wang wrote: I think we can just remove that tcf_lock, I am testing a patch now. Please try the attached patch, I will do more tests tomorrow. Thanks! Cong, What tree are you using? I

Re: [BUG] act_ife: sleeping functions called in atomic context

2016-06-16 Thread Jamal Hadi Salim
On 16-06-16 05:43 PM, Cong Wang wrote: On Thu, Jun 16, 2016 at 1:50 PM, Alexey Khoroshilov wrote: tcf_ife_init() contains a big chunk of code executed with ife->tcf_lock spinlock held. But that code contains several calls to sleeping functions: populate_metalist() and

Re: [PATCH net-next V2] tun: introduce tx skb ring

2016-06-15 Thread Jamal Hadi Salim
On 16-06-15 07:52 AM, Jamal Hadi Salim wrote: > On 16-06-15 04:38 AM, Jason Wang wrote: >> We used to queue tx packets in sk_receive_queue, this is less >> efficient since it requires spinlocks to synchronize between producer > > So this is more exercising the skb array

Re: [PATCH net-next V2] tun: introduce tx skb ring

2016-06-15 Thread Jamal Hadi Salim
On 16-06-15 04:38 AM, Jason Wang wrote: > We used to queue tx packets in sk_receive_queue, this is less > efficient since it requires spinlocks to synchronize between producer > and consumer. > > This patch tries to address this by: > > - introduce a new mode which will be only enabled with

Re: [PATCH net-next 00/10] net_sched: defer skb freeing while changing qdiscs

2016-06-15 Thread Jamal Hadi Salim
On 16-06-13 11:21 PM, Eric Dumazet wrote: qdiscs/classes are changed under RTNL protection and often while blocking BH and root qdisc spinlock. When lots of skbs need to be dropped, we free them under these locks causing TX/RX freezes, and more generally latency spikes. I saw spikes of 50+ ms

[PATCH net 1/1] net sched actions: bug fix dumping actions directly didnt produce NLMSG_DONE

2016-06-13 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> This refers to commands to direct action access as follows: sudo tc actions add action drop index 12 sudo tc actions add action pipe index 10 And then dumping them like so: sudo tc actions ls action gact iproute2 worked because it depended on a

Re: [Patch net-next] net_sched: make tcf_hash_check() boolean

2016-06-13 Thread Jamal Hadi Salim
On 16-06-13 04:46 PM, Cong Wang wrote: Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> Acked-by: Jamal Hadi Salim <j...@mojatatu.com> cheers, jamal

Re: [Patch net] act_ipt: fix a bind refcnt leak

2016-06-13 Thread Jamal Hadi Salim
On 16-06-13 04:44 PM, Cong Wang wrote: And avoid calling tcf_hash_check() twice. Fixes: a57f19d30b2d ("net sched: ipt action fix late binding") Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> Good catch. Acked-b

Re: [Patch net-next] act_police: rename tcf_act_police_locate() to tcf_act_police_init()

2016-06-13 Thread Jamal Hadi Salim
On 16-06-13 01:47 PM, Cong Wang wrote: This function is just ->init(), rename it to make it obvious. Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> Acked-by: Jamal Hadi Salim <j...@mojatatu.com> cheers, jamal

Re: [Patch net-next] net_sched: remove internal use of TC_POLICE_*

2016-06-13 Thread Jamal Hadi Salim
On 16-06-13 01:47 PM, Cong Wang wrote: These should be gone when we removed CONFIG_NET_CLS_POLICE. We can not totally remove them since they are exposed to userspace. Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> Acked-by: Jamal H

Re: [net-next PATCH v2 1/1] net sched actions: skbedit add support for mod-ing skb pkt_type

2016-06-13 Thread Jamal Hadi Salim
On 16-06-13 08:21 AM, Daniel Borkmann wrote: Looks like nft_meta_set_eval() can already do that, but restricted via pkt_type_ok(), so we can't play bad games with PACKET_LOOPBACK et al. Wasn't aware of that. Hm, so if you want to make use of this from tc as well, probably it makes sense to add

Re: [net-next PATCH v2 1/1] net sched actions: skbedit add support for mod-ing skb pkt_type

2016-06-13 Thread Jamal Hadi Salim
On 16-06-13 04:00 AM, Daniel Borkmann wrote: Hi Jamal, On 06/12/2016 11:24 PM, Jamal Hadi Salim wrote: From: Jamal Hadi Salim <h...@mojatatu.com> Extremely useful for setting packet type to host so i dont have to modify the dst mac address using pedit (which requires that i know t

[iproute2 PATCH 1/1] action pedit: stylistic changes

2016-06-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> More modern layout. Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- tc/m_pedit.c | 118 +++ 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/tc/m_pedit.c b/

[net-next PATCH v2 1/1] net sched actions: skbedit add support for mod-ing skb pkt_type

2016-06-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <h...@mojatatu.com> Extremely useful for setting packet type to host so i dont have to modify the dst mac address using pedit (which requires that i know the mac address) Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/net/tc_act/tc_skbedit.h

Re: [net-next PATCH 1/1] net sched actions: skbedit add support for mod-ing skb pkt_type

2016-06-12 Thread Jamal Hadi Salim
On 16-06-12 05:12 PM, Jamal Hadi Salim wrote: From: Jamal Hadi Salim <j...@mojatatu.com> Extremely useful for setting packet type to host so i dont have to modify the dst mac address using pedit (which requires that i know the mac address) Signed-off-by: Jamal Hadi Salim <j...@moj

[net-next PATCH 1/1] net sched actions: skbedit add support for mod-ing skb pkt_type

2016-06-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Extremely useful for setting packet type to host so i dont have to modify the dst mac address using pedit (which requires that i know the mac address) Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/net/tc_act/tc_skbedit.h

Re: [PATCH v2 net] fq_codel: fix NET_XMIT_CN behavior

2016-06-10 Thread Jamal Hadi Salim
On 16-06-06 12:18 PM, Florian Westphal wrote: Eric Dumazet <eric.duma...@gmail.com> wrote: On Mon, 2016-06-06 at 13:42 +0200, Florian Westphal wrote: Jamal Hadi Salim <j...@mojatatu.com> wrote: BTW, returning NET_XMIT_CN could be confusing to tcp; it does not mean that the pa

Re: [PATCH net-next] net, cls: allow for deleting all filters for given parent

2016-06-10 Thread Jamal Hadi Salim
ce won't get the updates (except for queries with RTM_GETTFILTER). Don't worry about any failure in tfilter_notify(), we call it in non-wildcard removal too. Your current patch looks good to me. Thanks! Daniel, I acked this already (sorry I missed the event notification bits). Acked-by: Jamal H

Re: [PATCH v2 net] fq_codel: fix NET_XMIT_CN behavior

2016-06-06 Thread Jamal Hadi Salim
On 16-06-05 07:30 PM, Cong Wang wrote: Potentially all of the following: net/sched/sch_choke.c: return NET_XMIT_CN; net/sched/sch_fifo.c: return NET_XMIT_CN; net/sched/sch_generic.c:return NET_XMIT_CN; net/sched/sch_gred.c: return NET_XMIT_CN; net/sched/sch_hhf.c:

[PATCH v2 net-next 2/3] net sched actions: introduce timestamp for firsttime use

2016-06-06 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Useful to know when the action was first used for accounting (and debugging) Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/net/act_api.h| 2 ++ include/uapi/linux/pkt_cls.h | 1 + net/sched/act_api.c | 1

[PATCH v2 net-next 1/3] net sched: actions use tcf_lastuse_update for consistency

2016-06-06 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- net/sched/act_connmark.c | 2 +- net/sched/act_csum.c | 2 +- net/sched/act_ife.c | 6 +++--- net/sched/act_ipt.c | 2 +- net/sched/act_mirred.c | 1 - net/sched/act_na

[PATCH v2 net-next 3/3] net sched actions: aggregate dumping of actions timeinfo

2016-06-06 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/net/act_api.h| 8 net/sched/act_bpf.c | 6 +- net/sched/act_connmark.c | 5 + net/sched/act_csum.c | 6 ++ net/sched/act_gact.c | 5 +---

[PATCH v2 net-next 0/3] net sched action timestamp improvements

2016-06-06 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Various aggregations of duplicated code, fixes and introduction of firstused timestamp v2: add const for source time info per suggestion from Cong Jamal Hadi Salim (3): net sched: actions use tcf_lastuse_update for consistency net sched a

Re: [net-next PATCH 3/3] net sched actions: aggregate dumping of actions timeinfo

2016-06-06 Thread Jamal Hadi Salim
On 16-06-06 01:39 AM, Cong Wang wrote: On Sun, Jun 5, 2016 at 7:26 AM, Jamal Hadi Salim <j...@mojatatu.com> wrote: diff --git a/include/net/act_api.h b/include/net/act_api.h index 8389c00..5453f52 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -80,6 +80,14 @@ static

[net-next PATCH 1/1] net sched: indentation and other OCD stylistic fixes

2016-06-05 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/net/act_api.h | 14 -- include/net/tc_act/tc_defact.h | 4 ++-- include/uapi/linux/pkt_cls.h | 6 +++--- net/sched/act_api.c

[net-next PATCH 0/3] net sched action timestamp improvements

2016-06-05 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Various aggregations of duplicated code, fixes and introduction of firstused timestamp Jamal Hadi Salim (3): net sched: actions use tcf_lastuse_update for consistency net sched actions: introduce timestamp for firsttime use net sched a

[net-next PATCH 1/3] net sched: actions use tcf_lastuse_update for consistency

2016-06-05 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- net/sched/act_connmark.c | 2 +- net/sched/act_csum.c | 2 +- net/sched/act_ife.c | 6 +++--- net/sched/act_ipt.c | 2 +- net/sched/act_mirred.c | 1 - net/sched/act_na

[net-next PATCH 3/3] net sched actions: aggregate dumping of actions timeinfo

2016-06-05 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/net/act_api.h| 8 net/sched/act_bpf.c | 6 +- net/sched/act_connmark.c | 5 + net/sched/act_csum.c | 6 ++ net/sched/act_gact.c | 5 +---

[net-next PATCH 2/3] net sched actions: introduce timestamp for firsttime use

2016-06-05 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Useful to know when the action was first used for accounting (and debugging) Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/net/act_api.h| 2 ++ include/uapi/linux/pkt_cls.h | 1 + net/sched/act_api.c | 1

[iproute2 resend PATCH 1/1] man: tc-ife.8: man page for ife action

2016-06-05 Thread Jamal Hadi Salim
From: Lucas Bates <luc...@mojatatu.com> Signed-off-by: Lucas Bates <luc...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> Acked-by: Phil Sutter <p...@nwl.cc> --- man/man8/tc-ife.8 | 117 ++ 1 file

Re: [PATCH v2 net] fq_codel: fix NET_XMIT_CN behavior

2016-06-05 Thread Jamal Hadi Salim
o") Reported-by: Stas Nichiporovich <stas...@gmail.com> Signed-off-by: Eric Dumazet <eduma...@google.com> Cc: WANG Cong <xiyou.wangc...@gmail.com> Cc: Jamal Hadi Salim <j...@mojatatu.com> Acked-by: Jamal Hadi Salim <j...@mojatatu.com> cheers, jamal

Re: [PATCH net-next] net, cls: allow for deleting all filters for given parent

2016-06-05 Thread Jamal Hadi Salim
and NLM_F_CREATE flag were allowed where the kernel would auto-generate a pref/prio. We can piggyback on that and use prio of 0 as a wildcard for requests of RTM_DELTFILTER. Signed-off-by: Daniel Borkmann <dan...@iogearbox.net> Looks good to me. Acked-by: Jamal Hadi Salim <j...@mojatatu.com

[iproute2 PATCH 1/1] tc filter u32: Coding style fixes

2016-05-25 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> "handle" was being used several times for different things. Fix the 80 character limit abuse and other little issues while at it. Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com>

Re: [iproute2 PATH 2/2] tc action policer: enable timestamp display

2016-05-25 Thread Jamal Hadi Salim
Stephen, This requires you pull Dave's -net headers. cheers, jamal On 16-05-25 06:05 AM, Jamal Hadi Salim wrote: From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- tc/m_police.c | 11 ++- 1 file changed, 10 insertions(+)

[iproute2 PATH 1/2] tc action policer: Avoid nonsensical input

2016-05-25 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> The user must at least specify a choice of the token bucket or ewma policing or late binding index. TB policing requires at minimal a rate and burst. In addition fix formatting issues (80 chars etc). Signed-off-by: Jamal Hadi Salim <j...@moj

[iproute2 PATH 2/2] tc action policer: enable timestamp display

2016-05-25 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- tc/m_police.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tc/m_police.c b/tc/m_police.c index 8752d4f..cb17c9e 100644 --- a/tc/m_police.c +++ b/t

Re: [iproute2 PATCH v2 1/1] vv4.6.0

2016-05-24 Thread Jamal Hadi Salim
More git foo. I have no idea how this went out ;-> Please ignore this but not the other. cheers, jamal On 16-05-24 07:52 AM, Jamal Hadi Salim wrote: From: Stephen Hemminger <shemm...@brocade.com> --- include/SNAPSHOT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) d

[iproute2 PATCH v2 1/1] tc simple action: bug fix

2016-05-24 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Failed compile m_simple.c: In function ‘parse_simple’: m_simple.c:154:6: warning: too many arguments for format [-Wformat-extra-args] *argv); ^ m_simple.c:103:14: warning: unused variable ‘maybe_bind’ [-Wunused-variable] Reported-by:

[iproute2 PATCH v2 1/1] vv4.6.0

2016-05-24 Thread Jamal Hadi Salim
From: Stephen Hemminger --- include/SNAPSHOT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SNAPSHOT.h b/include/SNAPSHOT.h index 9220f77..cc67058 100644 --- a/include/SNAPSHOT.h +++ b/include/SNAPSHOT.h @@ -1 +1 @@ -static const char

Re: [iproute2 1/1] tc simple action: bug fix

2016-05-24 Thread Jamal Hadi Salim
On 16-05-24 06:30 AM, Daniel Borkmann wrote: On 05/24/2016 03:04 AM, Jamal Hadi Salim wrote: From: Jamal Hadi Salim <j...@mojatatu.com> Failed compile m_simple.c: In function ‘parse_simple’: m_simple.c:154:6: warning: too many arguments for format [-Wformat-extra-args]

[net PATCH v2 1/1] net sched actions: policer missing timestamp processing

2016-05-23 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Policer was not dumping or updating timestamps Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/uapi/linux/pkt_cls.h | 4 +++- net/sched/act_police.c | 11 +++ 2 files changed, 14 insertions(+), 1 deletion(-)

[iproute2 1/1] tc simple action: bug fix

2016-05-23 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Failed compile m_simple.c: In function ‘parse_simple’: m_simple.c:154:6: warning: too many arguments for format [-Wformat-extra-args] *argv); ^ m_simple.c:103:14: warning: unused variable ‘maybe_bind’ [-Wunused-variable] Reported-by:

Re: [iproute2 PATCH v2 1/1] tc simple action update and breakage

2016-05-23 Thread Jamal Hadi Salim
On 16-05-23 06:39 PM, Daniel Borkmann wrote: m_simple.c: In function ‘parse_simple’: m_simple.c:154:6: warning: too many arguments for format [-Wformat-extra-args] *argv); ^ m_simple.c:103:14: warning: unused variable ‘maybe_bind’ [-Wunused-variable] int ok = 0, maybe_bind =

Re: [net PATCH 1/1] net sched actions: policer missing timestamp processing

2016-05-23 Thread Jamal Hadi Salim
On 16-05-23 04:52 PM, Cong Wang wrote: + tcf_tm_dump(, >tcf_tm); This depends on a previous patch you sent, right? Sigh. There goes my git foo. Will resubmit an updated version. cheers, jamal

[iproute2 PATCH 1/1] tc fix ife late binding

2016-05-22 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> following late binding didn't work sudo tc actions add action ife encode \ type 0xDEAD allow mark dst 02:15:15:15:15:15 index 1 Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- tc/m_ife.c | 1 + 1 file changed, 1 insertion(+) dif

Re: [iproute2 1/1] man: tc-ife.8: man page for ife action

2016-05-22 Thread Jamal Hadi Salim
On 16-05-02 07:40 PM, Jamal Hadi Salim wrote: On 16-05-02 06:10 PM, Stephen Hemminger wrote: On Sat, 30 Apr 2016 06:58:04 -0400 Jamal Hadi Salim <j...@mojatatu.com> wrote: From: Lucas Bates <luc...@mojatatu.com> Signed-off-by: Lucas Bates <luc...@mojatatu.com> Signed-off-by

Re: [RFC net-next] net: sched: do not acquire qdisc spinlock in qdisc/class stats dump

2016-05-22 Thread Jamal Hadi Salim
On 16-05-20 01:50 AM, Eric Dumazet wrote: It wont be inaccurate (no drift), as the writers hold the qdisc spinlock. It it the same with say IP/TCP SNMP counters : When an incoming frame is handled, it might change many SNMP counters, but an SNMP agent might fetch the whole set of SNMP values

[net PATCH 1/1] net sched actions: policer missing timestamp processing

2016-05-22 Thread Jamal Hadi Salim
From: Jamal Hadi Salim <j...@mojatatu.com> Policer was not dumping or updating timestamps Signed-off-by: Jamal Hadi Salim <j...@mojatatu.com> --- include/uapi/linux/pkt_cls.h | 4 +++- net/sched/act_police.c | 10 ++ 2 files changed, 13 insertions(+), 1 deletion(-)

Re: [net-next PATCH 0/2] net sched small OCD cleanups

2016-05-22 Thread Jamal Hadi Salim
On 16-05-19 02:28 PM, David Miller wrote: From: Jamal Hadi Salim <j...@mojatatu.com> Date: Tue, 17 May 2016 17:19:13 -0400 I have been staring at these small OCD cleanups for a while. Got cycles to do them as prep for another patch i am working on. Indentation/stylistic and consistency u

Re: [net-next RFC 1/1] net sched actions: introduce timestamp for first time used

2016-05-22 Thread Jamal Hadi Salim
On 16-05-20 01:16 AM, Cong Wang wrote: One nit: It is better if you can swap 'stm' with 'dtm', it looks odd to put destination on the right side. Will make the change for when net-next opens up. cheers, jamal

Re: [RFC net-next] net: sched: do not acquire qdisc spinlock in qdisc/class stats dump

2016-05-22 Thread Jamal Hadi Salim
ch all counters like packets and bytes sent at the expense of interfering in fast path (queue and dequeue packets) is simply not worth the pain, as the values are generally stale after 1 usec. These lock acquisitions slow down the fast path by 10 to 20 % Acked-by: Jamal Hadi Salim <j...@moj

Re: [net-next RFC 1/1] net sched actions: introduce timestamp for first time used

2016-05-19 Thread Jamal Hadi Salim
On 16-05-19 07:54 AM, Jamal Hadi Salim wrote: On 16-05-18 01:17 PM, Cong Wang wrote: I think it is the time to add a wrapper for these tm.XX = jiffies_to_clock_t(XXX). Agreed. Will send a patch. Actually I will resend the firstuse as well without RFC tag and the wrapper one as separate

Re: [net-next RFC 1/1] net sched actions: introduce timestamp for first time used

2016-05-19 Thread Jamal Hadi Salim
On 16-05-18 01:17 PM, Cong Wang wrote: On Tue, May 17, 2016 at 4:38 PM, Jamal Hadi Salim <j...@mojatatu.com> wrote: diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 014f9a6..f581e01 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c @@ -156,6 +156,7 @@ stat

<    3   4   5   6   7   8   9   10   11   >