[PATCH net] net: psample: Fix netlink skb length with tunnel info

2021-02-24 Thread Chris Mi
") CC: Yotam Gigi Reviewed-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: Chris Mi --- net/psample/psample.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/psample/psample.c b/net/psample/psample.c index 33e238c965bd..482c07f2766b 100644 --- a/net/psamp

Re: [PATCH net] net: psample: Fix the netlink skb length

2021-02-04 Thread Chris Mi
On 2/4/2021 4:47 PM, Ido Schimmel wrote: On Wed, Feb 03, 2021 at 06:21:03PM -0800, Jakub Kicinski wrote: On Wed, 3 Feb 2021 11:10:28 +0800 Chris Mi wrote: Currently, the netlink skb length only includes metadata and data length. It doesn't include the psample generic netlink header l

Re: [PATCH net] net: psample: Fix the netlink skb length

2021-02-04 Thread Chris Mi
On 2/4/2021 10:21 AM, Jakub Kicinski wrote: On Wed, 3 Feb 2021 11:10:28 +0800 Chris Mi wrote: Currently, the netlink skb length only includes metadata and data length. It doesn't include the psample generic netlink header length. But what's the bug? Did you see oversized messa

[PATCH net] net: psample: Fix the netlink skb length

2021-02-02 Thread Chris Mi
y: Ido Schimmel Signed-off-by: Chris Mi --- net/psample/psample.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/psample/psample.c b/net/psample/psample.c index 33e238c965bd..807d75f5a40f 100644 --- a/net/psample/psample.c +++ b/net/psample/psample.c @@ -363,6

Re: [PATCH net-next v6] net: psample: Introduce stubs to remove NIC driver dependency

2021-02-02 Thread Chris Mi
Hi Jakub, On 2/3/2021 5:24 AM, Jakub Kicinski wrote: On Mon, 01 Feb 2021 23:31:15 -0800 Saeed Mahameed wrote: On Mon, 2021-02-01 at 17:14 -0800, Jakub Kicinski wrote: On Mon,  1 Feb 2021 10:04:12 +0800 Chris Mi wrote: In order to send sampled packets to userspace, NIC driver calls psample

Re: [PATCH net-next v5] net: psample: Introduce stubs to remove NIC driver dependency

2021-02-01 Thread Chris Mi
On 2/2/2021 5:10 AM, Jakub Kicinski wrote: On Mon, 1 Feb 2021 09:32:15 +0800 Chris Mi wrote: On 1/30/2021 2:59 PM, Jakub Kicinski wrote: On Sat, 30 Jan 2021 10:33:19 +0800 Chris Mi wrote: +// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB +/* Copyright (c) 2021 Mellanox Technologies

[PATCH net-next v6] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-31 Thread Chris Mi
: kernel test robot Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko --- v1->v2: - fix sparse errors v2->v3: - remove inline v3->v4: - add inline back v4->v5: - address Jakub's comments v5-v6: - fix psample_stub.c copyright include/net/psample.h| 26 ++

Re: [PATCH net-next v5] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-31 Thread Chris Mi
On 1/30/2021 10:52 PM, Ido Schimmel wrote: On Sat, Jan 30, 2021 at 10:33:19AM +0800, Chris Mi wrote: In order to send sampled packets to userspace, NIC driver calls psample api directly. But it creates a hard dependency on module psample. Introduce psample_ops to remove the hard dependency. It

Re: [PATCH net-next v4] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-31 Thread Chris Mi
Hi Ido, On 1/30/2021 10:42 PM, Ido Schimmel wrote: On Fri, Jan 29, 2021 at 12:30:09PM -0800, Jakub Kicinski wrote: On Fri, 29 Jan 2021 14:08:39 +0800 Chris Mi wrote: Instead of discussing it several days, maybe it's better to review current patch, so that we can move forward :) It took

Re: [PATCH net-next v5] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-31 Thread Chris Mi
On 1/30/2021 2:59 PM, Jakub Kicinski wrote: On Sat, 30 Jan 2021 10:33:19 +0800 Chris Mi wrote: +// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB +/* Copyright (c) 2021 Mellanox Technologies. */ + +const struct psample_ops __rcu *psample_ops __read_mostly; +EXPORT_SYMBOL_GPL(psample_ops

Re: [PATCH net-next v4] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-30 Thread Chris Mi
On 1/30/2021 5:50 AM, Jakub Kicinski wrote: On Thu, 28 Jan 2021 09:45:43 +0800 Chris Mi wrote: In order to send sampled packets to userspace, NIC driver calls psample api directly. But it creates a hard dependency on module psample. Introduce psample_ops to remove the hard dependency. It is

[PATCH net-next v5] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-29 Thread Chris Mi
: kernel test robot Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko --- v1->v2: - fix sparse errors v2->v3: - remove inline v3->v4: - add inline back v4->v5: - address Jakub's comments include/net/psample.h| 26 ++ net/psample/psample.c| 14 ++

Re: [PATCH net-next v4] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-28 Thread Chris Mi
On 1/29/2021 1:14 PM, Cong Wang wrote: On Wed, Jan 27, 2021 at 5:48 PM Chris Mi wrote: In order to send sampled packets to userspace, NIC driver calls psample api directly. But it creates a hard dependency on module psample. Introduce psample_ops to remove the hard dependency. It is

Re: [PATCH net-next] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-27 Thread Chris Mi
On 1/28/2021 7:03 AM, Saeed Mahameed wrote: On Wed, 2021-01-27 at 11:42 +0800, Chris Mi wrote: Could you please tell me what's sparse warnings you hit? https://patchwork.kernel.org/project/netdevbpf/patch/20210127101648.513562-1-...@nvidia.com/ build allmodconfig and build32 OK,

Re: [PATCH net-next v3] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-27 Thread Chris Mi
On 1/28/2021 7:49 AM, Jakub Kicinski wrote: On Wed, 27 Jan 2021 18:16:48 +0800 Chris Mi wrote: @@ -35,4 +45,21 @@ static inline void psample_sample_packet(struct psample_group *group, #endif +static void static inline Done. +psample_nic_sample_packet(struct psample_group *group

[PATCH net-next v4] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-27 Thread Chris Mi
: kernel test robot Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko --- v1->v2: - fix sparse errors v2->v3: - remove inline v3->v4: - add inline back include/net/psample.h| 27 +++ net/psample/psample.c| 13 - net/sched/Makefile |

Re: [PATCH net-next v2] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-27 Thread Chris Mi
On 1/27/2021 5:47 PM, Zhu Yanjun wrote: On Wed, Jan 27, 2021 at 5:06 PM Chris Mi wrote: In order to send sampled packets to userspace, NIC driver calls psample api directly. But it creates a hard dependency on module psample. Introduce psample_ops to remove the hard dependency. It is

[PATCH net-next v3] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-27 Thread Chris Mi
: kernel test robot Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko --- v1->v2: - fix sparse errors v2->v3: - remove inline include/net/psample.h| 27 +++ net/psample/psample.c| 13 - net/sched/Makefile | 2 +- net/sched/psample_stub.

[PATCH net-next v2] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-26 Thread Chris Mi
: kernel test robot Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko --- v1->v2: - fix sparse errors include/net/psample.h| 27 +++ net/psample/psample.c| 13 - net/sched/Makefile | 2 +- net/sched/psample_stub.c | 7 +++ 4 files changed,

Re: [PATCH net-next] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-26 Thread Chris Mi
Hi Jakub, On 1/27/2021 10:49 AM, Jakub Kicinski wrote: On Tue, 26 Jan 2021 22:59:29 +0800 Chris Mi wrote: In order to send sampled packets to userspace, NIC driver calls psample api directly. But it creates a hard dependency on module psample. Introduce psample_ops to remove the hard

[PATCH net-next] net: psample: Introduce stubs to remove NIC driver dependency

2021-01-26 Thread Chris Mi
: Chris Mi Reviewed-by: Jiri Pirko --- include/net/psample.h| 27 +++ net/psample/psample.c| 13 - net/sched/Makefile | 2 +- net/sched/psample_stub.c | 7 +++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 net/sched

Re: [PATCH net] net: flow_offload: Fix memory leak for indirect flow block

2020-12-07 Thread Chris Mi
On 12/8/2020 10:28 AM, Jakub Kicinski wrote: On Mon, 7 Dec 2020 09:59:16 +0800 Chris Mi wrote: The offending commit introduces a cleanup callback that is invoked when the driver module is removed to clean up the tunnel device flow block. But it returns on the first iteration of the for loop

[PATCH net v2] net: flow_offload: Fix memory leak for indirect flow block

2020-12-07 Thread Chris Mi
fload: consolidate indirect flow_block infrastructure") CC: Pablo Neira Ayuso Signed-off-by: Chris Mi Reviewed-by: Roi Dayan --- v2: - CC relevant people. net/core/flow_offload.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/core/flow_offload.c b/net/core/flow

[PATCH net] net: flow_offload: Fix memory leak for indirect flow block

2020-12-06 Thread Chris Mi
fload: consolidate indirect flow_block infrastructure") Signed-off-by: Chris Mi Reviewed-by: Roi Dayan --- net/core/flow_offload.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c index d4474c812b64..715b67f6c62f 100644

[PATCH net-next] net: psample: Add tunnel support

2020-05-19 Thread Chris Mi
subfields if applicable. Increase the metadata length for sampled packet with the tunnel info. If new subfields of tunnel info should be included, update the metadata length accordingly. Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko --- include/uapi/linux/psample.h | 22 + net/psample

[patch iproute2] libnetlink: linkdump_req: AF_PACKET family also expects ext_filter_mask

2019-01-25 Thread Chris Mi
off, query_rss off vf 1 MAC 02:25:d0:12:01:02, spoof checking off, link-state auto, trust off, query_rss off Fixes: d97b16b2c906 ("libnetlink: linkdump_req: Only AF_UNSPEC family expects an ext_filter_mask") Signed-off-by: Chris Mi --- lib/libnetlink.c | 2 +- 1 file changed, 1

Re: Fwd: Re: Kernel panic with 4.16-rc1 (and 4.16-rc2) running selftest

2018-02-26 Thread Chris Mi
Hi Matthew, Sorry for the late response. I'll add the idr test cases for the new APIs ASAP. Thanks, Chris On 2/24/2018 10:46 AM, Matthew Wilcox wrote: On Sat, Feb 24, 2018 at 01:49:35AM +0000, Chris Mi wrote: To verify this patch, the following is a sanity test case: # tc qdisc delet

RE: Fwd: Re: Kernel panic with 4.16-rc1 (and 4.16-rc2) running selftest

2018-02-23 Thread Chris Mi
> -Original Message- > From: Matthew Wilcox [mailto:wi...@infradead.org] > Sent: Saturday, February 24, 2018 9:15 AM > To: Cong Wang ; Khalid Aziz > ; linux-ker...@vger.kernel.org; > netdev@vger.kernel.org > Cc: Chris Mi > Subject: Re: Fwd: Re: Kernel panic wit

RE: [patch iproute2 v10 0/2] tc: Add batchsize feature to batch mode

2018-01-15 Thread Chris Mi
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Tuesday, January 16, 2018 12:41 AM > To: Chris Mi ; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com; step...@networkplumber.org; > marcelo.leit...@gmail.com; p...@nwl.cc > Subject: Re: [patch

[patch iproute2 v10 1/2] lib/libnetlink: Add a new function rtnl_talk_iov

2018-01-11 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_iov that can send multiple messages to kernel. rtnl_talk_iov takes struct iovec * and iovlen as arguments. Signed-off-by: Chris Mi Signed-off-by: David Ahern --- include/libnetlink.h | 3 +++ lib/libnetlink.c

[patch iproute2 v10 2/2] tc: Add batchsize feature for filter and actions

2018-01-11 Thread Chris Mi
/change/replace Signed-off-by: Chris Mi --- tc/m_action.c | 65 --- tc/tc.c| 199 - tc/tc_common.h | 5 +- tc/tc_filter.c | 104 ++ 4 files changed, 294 insertions(+), 79 deletions

[patch iproute2 v10 0/2] tc: Add batchsize feature to batch mode

2018-01-11 Thread Chris Mi
e feature or not v10 === 1. Improve function batchsize_enabled. Chris Mi (2): lib/libnetlink: Add a new function rtnl_talk_iov tc: Add batchsize feature for filter and actions include/libnetlink.h | 3 + lib/libnetlink.c | 65 - tc/m_action.c| 65 +

[patch iproute2 v9 1/2] lib/libnetlink: Add a new function rtnl_talk_iov

2018-01-10 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_iov that can send multiple messages to kernel. rtnl_talk_iov takes struct iovec * and iovlen as arguments. Signed-off-by: Chris Mi Signed-off-by: David Ahern --- include/libnetlink.h | 3 +++ lib/libnetlink.c

[patch iproute2 v9 0/2] tc: Add batchsize feature to batch mode

2018-01-10 Thread Chris Mi
command fails. 2. Add a new function rtnl_talk_iov 3. Allocate the memory in function batch() instead of each client. 4. Remove option -bs. v8 == 1. Replace strcmp with matches. 2. Recycle buffers. v9 == 1. remove rtnl_talk_msg 2. use a table to determine if supporting batchsize feature or not C

[patch iproute2 v9 2/2] tc: Add batchsize feature for filter and actions

2018-01-10 Thread Chris Mi
/change/replace Signed-off-by: Chris Mi --- tc/m_action.c | 65 -- tc/tc.c| 208 - tc/tc_common.h | 5 +- tc/tc_filter.c | 104 ++--- 4 files changed, 303 insertions(+), 79 deletions

RE: [patch iproute2 v8 2/2] tc: Add batchsize feature for filter and actions

2018-01-10 Thread Chris Mi
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Thursday, January 11, 2018 3:41 AM > To: Chris Mi ; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com; step...@networkplumber.org; > marcelo.leit...@gmail.com; p...@nwl.cc > Subject: Re: [patc

RE: [patch iproute2 v8 1/2] lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov

2018-01-10 Thread Chris Mi
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Thursday, January 11, 2018 3:21 AM > To: Chris Mi ; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com; step...@networkplumber.org; > marcelo.leit...@gmail.com; p...@nwl.cc > Subject: Re: [patch

RE: [patch iproute2 v8 2/2] tc: Add batchsize feature for filter and actions

2018-01-10 Thread Chris Mi
> -Original Message- > From: Marcelo Ricardo Leitner [mailto:marcelo.leit...@gmail.com] > Sent: Wednesday, January 10, 2018 7:42 PM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com; > step...@networkplumber.org; dsah...@gmail.com; p...@nwl.cc >

[patch iproute2 v8 2/2] tc: Add batchsize feature for filter and actions

2018-01-09 Thread Chris Mi
. Signed-off-by: Chris Mi --- tc/m_action.c | 60 + tc/tc.c| 165 - tc/tc_common.h | 5 +- tc/tc_filter.c | 97 +++-- 4 files changed, 249 insertions(+), 78 deletions(-) diff --git a/tc

[patch iproute2 v8 0/2] tc: Add batchsize feature to batch mode

2018-01-09 Thread Chris Mi
command fails. 2. Add a new function rtnl_talk_iov 3. Allocate the memory in function batch() instead of each client. 4. Remove option -bs. v8 == 1. Replace strcmp with matches. 2. Recycle buffers. Chris Mi (2): lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov tc: Add batchsize feat

[patch iproute2 v8 1/2] lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov

2018-01-09 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add two functions rtnl_talk_msg and rtnl_talk_iov that can send multiple messages to kernel. rtnl_talk_msg takes struct msghdr * as argument. rtnl_talk_iov takes struct iovec * and iovlen as arguments. Signed-off-by: Chris Mi --- include

RE: [patch iproute2 v7 2/2] tc: Add batchsize feature for filter and actions

2018-01-09 Thread Chris Mi
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Wednesday, January 10, 2018 12:01 AM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com; dsah...@gmail.com; > marcelo.leit...@gmail.com; p...@nwl.cc > Subject: R

RE: [patch iproute2 v7 1/2] lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov

2018-01-09 Thread Chris Mi
> -Original Message- > From: n...@orbyte.nwl.cc [mailto:n...@orbyte.nwl.cc] On Behalf Of Phil > Sutter > Sent: Wednesday, January 10, 2018 3:24 AM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com; > step...@networkplumber.org; dsah...@gmai

RE: [patch iproute2 v7 2/2] tc: Add batchsize feature for filter and actions

2018-01-09 Thread Chris Mi
> -Original Message- > From: Marcelo Ricardo Leitner [mailto:marcelo.leit...@gmail.com] > Sent: Wednesday, January 10, 2018 3:14 AM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com; > step...@networkplumber.org; dsah...@gmail.com; p...@nwl.cc >

[patch iproute2 v7 2/2] tc: Add batchsize feature for filter and actions

2018-01-08 Thread Chris Mi
. Signed-off-by: Chris Mi --- tc/m_action.c | 60 +-- tc/tc.c| 127 ++--- tc/tc_common.h | 5 ++- tc/tc_filter.c | 97 +-- 4 files changed, 210 insertions(+), 79 deletions

[patch iproute2 v7 1/2] lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov

2018-01-08 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add two functions rtnl_talk_msg and rtnl_talk_iov that can send multiple messages to kernel. rtnl_talk_msg takes struct msghdr * as argument. rtnl_talk_iov takes struct iovec * and iovlen as arguments. Signed-off-by: Chris Mi --- include

[patch iproute2 v7 0/2] tc: Add batchsize feature to batch mode

2018-01-08 Thread Chris Mi
command fails. 2. Add a new function rtnl_talk_iov 3. Allocate the memory in function batch() instead of each client. 4. Remove option -bs. Chris Mi (2): lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov tc: Add batchsize feature to batch mode include/libnetlink.h |

RE: [patch iproute2 v6 2/3] tc: Add -bs option to batch mode

2018-01-08 Thread Chris Mi
> -Original Message- > From: Marcelo Ricardo Leitner [mailto:marcelo.leit...@gmail.com] > Sent: Saturday, January 6, 2018 3:15 AM > To: David Ahern > Cc: Chris Mi ; netdev@vger.kernel.org; > gerlitz...@gmail.com; step...@networkplumber.org > Subject: Re: [patch ipr

RE: [patch iproute2 v6 1/3] lib/libnetlink: Add a function rtnl_talk_msg

2018-01-08 Thread Chris Mi
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Saturday, January 6, 2018 1:51 AM > To: Chris Mi ; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com; step...@networkplumber.org; > marcelo.leit...@gmail.com > Subject: Re: [patch iproute2 v

RE: [patch iproute2 v6 0/3] tc: Add -bs option to batch mode

2018-01-08 Thread Chris Mi
> -Original Message- > From: n...@orbyte.nwl.cc [mailto:n...@orbyte.nwl.cc] On Behalf Of Phil > Sutter > Sent: Monday, January 8, 2018 9:32 PM > To: Chris Mi > Cc: dsah...@gmail.com; marcelo.leit...@gmail.com; > netdev@vger.kernel.org; gerlitz...@gmail.com; > st

RE: [patch iproute2 v6 0/3] tc: Add -bs option to batch mode

2018-01-08 Thread Chris Mi
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Monday, January 8, 2018 11:40 PM > To: Chris Mi > Cc: David Ahern ; Phil Sutter ; > marcelo.leit...@gmail.com; netdev@vger.kernel.org; gerlitz...@gmail.com > Subject: Re: [patc

RE: [patch iproute2 v6 0/3] tc: Add -bs option to batch mode

2018-01-08 Thread Chris Mi
> -Original Message- > From: n...@orbyte.nwl.cc [mailto:n...@orbyte.nwl.cc] On Behalf Of Phil > Sutter > Sent: Monday, January 8, 2018 9:32 PM > To: Chris Mi > Cc: dsah...@gmail.com; marcelo.leit...@gmail.com; > netdev@vger.kernel.org; gerlitz...@gmail.com; > st

RE: [patch iproute2 v6 0/3] tc: Add -bs option to batch mode

2018-01-08 Thread Chris Mi
> >> I wonder whether specifying the batch size is necessary at all. > >> Couldn't batch mode just collect messages until either EOF or an > >> incompatible command is encountered which then triggers a commit to > >> kernel? This might simplify code quite a bit. > > That's a good suggestion. > > T

RE: [patch iproute2 v6 0/3] tc: Add -bs option to batch mode

2018-01-07 Thread Chris Mi
> -Original Message- > From: n...@orbyte.nwl.cc [mailto:n...@orbyte.nwl.cc] On Behalf Of Phil > Sutter > Sent: Saturday, January 6, 2018 1:25 AM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com; > step...@networkplumber.org; dsah...@gmail.com; > m

[patch iproute2 v6 2/3] tc: Add -bs option to batch mode

2018-01-03 Thread Chris Mi
delete Otherwise, the batch size is still 1. Signed-off-by: Chris Mi --- tc/m_action.c | 93 ++-- tc/tc.c| 96 +++-- tc/tc_common.h | 8 +++- tc/tc_filter.c | 132

[patch iproute2 v6 1/3] lib/libnetlink: Add a function rtnl_talk_msg

2018-01-03 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_msg that can send multiple messages to kernel. Signed-off-by: Chris Mi --- include/libnetlink.h | 3 +++ lib/libnetlink.c | 66 ++-- 2 files changed, 51

[patch iproute2 v6 0/3] tc: Add -bs option to batch mode

2018-01-03 Thread Chris Mi
ck. Now __rtnl_talk calls __rtnl_talk_msg directly. 3. if (batch_size < 1) batch_size = 1; v5 == 1. Fix a bug that can't deal with batch file with blank line. 2. Describe the limitation in man page. v6 == 1. Add support for mixed commands. 2. Fix a bug that not all messages

[patch iproute2 v6 3/3] man: Add -bs option to tc manpage

2018-01-03 Thread Chris Mi
Signed-off-by: Chris Mi --- man/man8/tc.8 | 7 +++ 1 file changed, 7 insertions(+) diff --git a/man/man8/tc.8 b/man/man8/tc.8 index ff071b33..23db730c 100644 --- a/man/man8/tc.8 +++ b/man/man8/tc.8 @@ -601,6 +601,13 @@ must exist already. read commands from provided file or standard input

Re: [patch iproute2 v5 2/3] tc: Add -bs option to batch mode

2018-01-03 Thread Chris Mi
 2018/1/3 12:25, David Ahern: You need a patch description here ... Done. On 1/2/18 7:55 PM, Chris Mi wrote: static int tc_action_modify(int cmd, unsigned int flags, - int *argc_p, char ***argv_p) + int *argc_p, char ***argv_p

Re: [patch iproute2 v5 1/3] lib/libnetlink: Add a function rtnl_talk_msg

2018-01-03 Thread Chris Mi
2018/1/3 12:08, David Ahern: On 1/2/18 7:55 PM, Chris Mi wrote: diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 00e6ce0c..cc02a139 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -581,32 +581,34 @@ static void rtnl_talk_error(struct nlmsghdr *h, struct nlmsgerr *err

[patch iproute2 v5 3/3] man: Add -bs option to tc manpage

2018-01-02 Thread Chris Mi
Signed-off-by: Chris Mi --- man/man8/tc.8 | 9 + 1 file changed, 9 insertions(+) diff --git a/man/man8/tc.8 b/man/man8/tc.8 index ff071b33..7338ed3b 100644 --- a/man/man8/tc.8 +++ b/man/man8/tc.8 @@ -601,6 +601,15 @@ must exist already. read commands from provided file or standard

[patch iproute2 v5 1/3] lib/libnetlink: Add a function rtnl_talk_msg

2018-01-02 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_msg that can send multiple messages to kernel. Signed-off-by: Chris Mi --- include/libnetlink.h | 3 +++ lib/libnetlink.c | 59 ++-- 2 files changed, 46

[patch iproute2 v5 2/3] tc: Add -bs option to batch mode

2018-01-02 Thread Chris Mi
Signed-off-by: Chris Mi --- tc/m_action.c | 90 -- tc/tc.c| 70 ++--- tc/tc_common.h | 8 +++- tc/tc_filter.c | 121 + 4 files changed, 221 insertions(+), 68

[patch iproute2 v5 0/3] tc: Add -bs option to batch mode

2018-01-02 Thread Chris Mi
ck. Now __rtnl_talk calls __rtnl_talk_msg directly. 3. if (batch_size < 1) batch_size = 1; v5 == 1. Fix a bug that can't deal with batch file with blank line. 2. Describe the limitation in man page. Chris Mi (3): lib/libnetlink: Add a function rtnl_talk_msg tc: Add -b

Re: [patch iproute2 v4 3/3] man: Add -bs option to tc manpage

2018-01-02 Thread Chris Mi
2018/1/3 4:07, Marcelo Ricardo Leitner: On Tue, Jan 02, 2018 at 11:28:04PM +0900, Chris Mi wrote: Signed-off-by: Chris Mi --- man/man8/tc.8 | 5 + 1 file changed, 5 insertions(+) diff --git a/man/man8/tc.8 b/man/man8/tc.8 index ff071b33..de137e16 100644 --- a/man/man8/tc.8 +++ b/man

Re: [patch iproute2 v4 2/3] tc: Add -bs option to batch mode

2018-01-02 Thread Chris Mi
On Tue, Jan 02, 2018 at 11:28:03PM +0900, Chris Mi wrote: @@ -240,23 +244,49 @@ static int batch(const char *name) } cmdlineno = 0; - while (getcmdline(&line, &len, stdin) != -1) { + if (getcmdline(&line, &len, stdin) == -1) + goto

[patch iproute2 v4 3/3] man: Add -bs option to tc manpage

2018-01-02 Thread Chris Mi
Signed-off-by: Chris Mi --- man/man8/tc.8 | 5 + 1 file changed, 5 insertions(+) diff --git a/man/man8/tc.8 b/man/man8/tc.8 index ff071b33..de137e16 100644 --- a/man/man8/tc.8 +++ b/man/man8/tc.8 @@ -601,6 +601,11 @@ must exist already. read commands from provided file or standard input

[patch iproute2 v4 2/3] tc: Add -bs option to batch mode

2018-01-02 Thread Chris Mi
Signed-off-by: Chris Mi --- tc/m_action.c | 90 -- tc/tc.c| 69 +--- tc/tc_common.h | 8 +++- tc/tc_filter.c | 121 + 4 files changed, 220 insertions(+), 68

[patch iproute2 v4 1/3] lib/libnetlink: Add a function rtnl_talk_msg

2018-01-02 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_msg that can send multiple messages to kernel. Signed-off-by: Chris Mi --- include/libnetlink.h | 3 +++ lib/libnetlink.c | 59 ++-- 2 files changed, 46

[patch iproute2 v4 0/3] tc: Add -bs option to batch mode

2018-01-02 Thread Chris Mi
ck. Now __rtnl_talk calls __rtnl_talk_msg directly. 3. if (batch_size < 1) batch_size = 1; Chris Mi (3): lib/libnetlink: Add a function rtnl_talk_msg tc: Add -bs option to batch mode man: Add -bs option to tc manpage include/libnetlink.h | 3 ++ lib/libnetlink.c | 5

Re: [patch iproute2 v3 3/4] tc: Add -bs option to batch mode

2018-01-02 Thread Chris Mi
On Mon, Dec 25, 2017 at 05:46:57PM +0900, Chris Mi wrote: @@ -267,6 +287,7 @@ int main(int argc, char **argv) { int ret; char *batch_file = NULL; + int batch_size = 1; while (argc > 1) { if (argv[1][0] != '-') @@ -297,6 +318,14 @@

Re: [patch iproute2 v3 3/4] tc: Add -bs option to batch mode

2018-01-02 Thread Chris Mi
On 12/25/17 2:46 AM, Chris Mi wrote: Signed-off-by: Chris Mi --- tc/m_action.c | 91 +-- tc/tc.c| 47 ++ tc/tc_common.h | 8 +++- tc/tc_filter.c | 121 + 4

Re: [patch iproute2 v3 2/4] utils: Add a function setcmdlinetotal

2018-01-02 Thread Chris Mi
On 12/25/17 2:46 AM, Chris Mi wrote: This function calculates how many commands a batch file has and set it to global variable cmdlinetotal. Signed-off-by: Chris Mi --- include/utils.h | 4 lib/utils.c | 20 2 files changed, 24 insertions(+) diff --git a

Re: [patch iproute2 v3 1/4] lib/libnetlink: Add a function rtnl_talk_msg

2018-01-02 Thread Chris Mi
On 12/25/17 2:46 AM, Chris Mi wrote: diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 00e6ce0c..f5f675cf 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -581,36 +581,21 @@ static void rtnl_talk_error(struct nlmsghdr *h, struct nlmsgerr *err, strerror(-err->er

[patch iproute2 v3 1/4] lib/libnetlink: Add a function rtnl_talk_msg

2017-12-25 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_msg that can send multiple messages to kernel. Signed-off-by: Chris Mi --- include/libnetlink.h | 3 ++ lib/libnetlink.c | 92 2 files changed, 74

[patch iproute2 v3 3/4] tc: Add -bs option to batch mode

2017-12-25 Thread Chris Mi
Signed-off-by: Chris Mi --- tc/m_action.c | 91 +-- tc/tc.c| 47 ++ tc/tc_common.h | 8 +++- tc/tc_filter.c | 121 + 4 files changed, 204 insertions(+), 63 deletions

[patch iproute2 v3 4/4] man: Add -bs option to tc manpage

2017-12-25 Thread Chris Mi
Signed-off-by: Chris Mi --- man/man8/tc.8 | 5 + 1 file changed, 5 insertions(+) diff --git a/man/man8/tc.8 b/man/man8/tc.8 index ff071b33..de137e16 100644 --- a/man/man8/tc.8 +++ b/man/man8/tc.8 @@ -601,6 +601,11 @@ must exist already. read commands from provided file or standard input

[patch iproute2 v3 2/4] utils: Add a function setcmdlinetotal

2017-12-25 Thread Chris Mi
This function calculates how many commands a batch file has and set it to global variable cmdlinetotal. Signed-off-by: Chris Mi --- include/utils.h | 4 lib/utils.c | 20 2 files changed, 24 insertions(+) diff --git a/include/utils.h b/include/utils.h index

[patch iproute2 v3 0/4] tc: Add -bs option to batch mode

2017-12-25 Thread Chris Mi
ion rtnl_talk_msg. 2. remove most of global variables to use parameter passing 3. divide the previous patch into 4 patches. Chris Mi (4): lib/libnetlink: Add a function rtnl_talk_msg utils: Add a function setcmdlinetotal tc: Add -bs option to batch mode man: Add -bs option to tc manpage

RE: [patch iproute2 v2] tc: add -bs option for batch mode

2017-12-22 Thread Chris Mi
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Friday, December 22, 2017 6:04 AM > To: Chris Mi ; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com > Subject: Re: [patch iproute2 v2] tc: add -bs option for batch mode > > On 12/20/17

RE: [patch iproute2] tc: add -bs option for batch mode

2017-12-20 Thread Chris Mi
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Wednesday, December 20, 2017 11:18 PM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com > Subject: Re: [patch iproute2] tc: add -bs option for batch mode > >

[patch iproute2 v2] tc: add -bs option for batch mode

2017-12-20 Thread Chris Mi
more than 10%. Signed-off-by: Chris Mi --- include/libnetlink.h | 6 include/utils.h | 4 +++ lib/libnetlink.c | 25 ++- lib/utils.c | 20 man/man8/tc.8| 5 +++ tc/m_action.c| 62 +++- tc/tc.c

RE: [patch iproute2] tc: add -bs option for batch mode

2017-12-20 Thread Chris Mi
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Tuesday, December 19, 2017 11:23 PM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com > Subject: Re: [patch iproute2] tc: add -bs option for batch mode > > O

[patch iproute2] tc: add -bs option for batch mode

2017-12-18 Thread Chris Mi
more than 10%. Signed-off-by: Chris Mi --- include/libnetlink.h | 27 include/utils.h | 8 + lib/libnetlink.c | 30 +- lib/utils.c | 20 man/man8/tc.8| 5 +++ tc/m_action.c| 63 --

RE: [patch iproute2] tc: fix command "tc actions del" hang issue

2017-12-17 Thread Chris Mi
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Friday, December 15, 2017 1:17 PM > To: Chris Mi > Cc: netdev@vger.kernel.org; j...@resnulli.us > Subject: Re: [patch iproute2] tc: fix command "tc actions del" hang is

[patch iproute2] tc: fix command "tc actions del" hang issue

2017-12-14 Thread Chris Mi
run time") Signed-off-by: Chris Mi Reviewed-by: Jiri Pirko --- tc/m_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_action.c b/tc/m_action.c index afb6cfad..986ef7d0 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -529,7 +529,7 @@ static int tc_acti

RE: [patch net v2 1/4] net/sched: Change tc_action refcnt and bindcnt to atomic

2017-10-23 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Monday, October 23, 2017 11:40 PM > To: Chris Mi > Cc: Jamal Hadi Salim ; Linux Kernel Network Developers > ; Lucas Bates ; Jiri Pirko > ; David Miller > Subject: Re: [patch net v

RE: [Patch net 14/15] selftests: Introduce a new script to generate tc batch file

2017-10-23 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Tuesday, October 24, 2017 6:03 AM > To: netdev@vger.kernel.org > Cc: paul...@linux.vnet.ibm.com; j...@mojatatu.com; > john.fastab...@gmail.com; Chris Mi ; Cong Wang > > Subject: [Pa

RE: [patch net v2 1/4] net/sched: Change tc_action refcnt and bindcnt to atomic

2017-10-22 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Friday, October 20, 2017 11:00 AM > To: Jamal Hadi Salim > Cc: Chris Mi ; Linux Kernel Network Developers > ; Lucas Bates ; Jiri Pirko > ; David Miller > Subject: Re: [patch net v

RE: [patch net v2 1/4] net/sched: Change tc_action refcnt and bindcnt to atomic

2017-10-17 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Tuesday, October 17, 2017 11:53 PM > To: Chris Mi > Cc: Linux Kernel Network Developers ; Jamal Hadi > Salim ; Lucas Bates ; Jiri Pirko > ; David Miller > Subject: Re: [patch net v

RE: [patch net v3 2/4] net/sched: Use action array instead of action list as parameter

2017-10-17 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Wednesday, October 18, 2017 12:56 AM > To: Chris Mi > Cc: Linux Kernel Network Developers ; Jamal Hadi > Salim ; Lucas Bates ; Jiri Pirko > ; David Miller > Subject: Re: [patch ne

[patch net v3 4/4] selftests: Introduce a new test case to tc testsuite

2017-10-16 Thread Chris Mi
cases belong to "flower" will not be run. In this test case, we create 1M filters and all filters share the same action. When destroying all filters, kernel should not panic. It takes about 18s to run it. Signed-off-by: Chris Mi Acked-by: Jamal Hadi Salim Acked-by: Lucas Bates ---

[patch net v3 3/4] selftests: Introduce a new script to generate tc batch file

2017-10-16 Thread Chris Mi
exit -n NUMBER, --number NUMBER how many lines in batch file -o, --skip_sw skip_sw (offload), by default skip_hw -s, --share_actionall filters share the same action -p, --prioall filters have different prio Signed-off-by: Chris Mi

[patch net v3 2/4] net/sched: Use action array instead of action list as parameter

2017-10-16 Thread Chris Mi
This patch uses the action array directly to fix this issue. Fixes commit in pre-git era. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Chris Mi Acked-by: Jamal Hadi Salim --- include/net/act_api.h | 7 ++-- net/sched/act_api.c | 103 +++

[patch net v3 1/4] net/sched: Change tc_action refcnt and bindcnt to atomic

2017-10-16 Thread Chris Mi
If many filters share the same action. That action's refcnt and bindcnt could be manipulated by many RCU callbacks at the same time. This patch makes these operations atomic. Fixes commit in pre-git era. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Chris Mi Acked-by: J

[patch net v3 0/4] net/sched: Fix a system panic when deleting filters

2017-10-16 Thread Chris Mi
the issue was fixed, apply patches 1 and 2 and then repeat the tests. v2 changelog Revise the comment and add Acked-by: Jamal Hadi Salim v3 changelog Add Acked-by: Lucas Bates for patch 3 and 4 Chris Mi (4): net/sched: Change tc_action refcnt and bindcnt to atomic

RE: [patch net v2 1/4] net/sched: Change tc_action refcnt and bindcnt to atomic

2017-10-16 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Tuesday, October 17, 2017 1:06 AM > To: Chris Mi > Cc: Linux Kernel Network Developers ; Jamal Hadi > Salim ; Lucas Bates ; Jiri Pirko > ; David Miller > Subject: Re: [patch net v

RE: [patch net v2 4/4] selftests: Introduce a new test case to tc testsuite

2017-10-16 Thread Chris Mi
> -Original Message- > From: Lucas Bates [mailto:luc...@mojatatu.com] > Sent: Tuesday, October 17, 2017 12:25 AM > To: Chris Mi > Cc: netdev@vger.kernel.org; Jamal Hadi Salim ; Cong > Wang ; Jiri Pirko ; > da...@davemloft.net > Subject: Re: [patch net v2 4/4] se

RE: [patch net 0/4] net/sched: Fix a system panic when deleting filters

2017-10-16 Thread Chris Mi
Hi Jamal, > -Original Message- > From: Jamal Hadi Salim [mailto:j...@mojatatu.com] > Sent: Monday, October 16, 2017 7:06 PM > To: Chris Mi ; netdev@vger.kernel.org > Cc: luc...@mojatatu.com; xiyou.wangc...@gmail.com; j...@resnulli.us; > da...@davemloft.net > Subjec

[patch net v2 3/4] selftests: Introduce a new script to generate tc batch file

2017-10-16 Thread Chris Mi
exit -n NUMBER, --number NUMBER how many lines in batch file -o, --skip_sw skip_sw (offload), by default skip_hw -s, --share_actionall filters share the same action -p, --prioall filters have different prio Signed-off-by: Chris Mi

  1   2   >