mbox series

[v6,net-next,0/3] net/sched: fix over mtu packet of defrag in

Message ID 1604989686-8171-1-git-send-email-wenxu@ucloud.cn
Headers show
Series net/sched: fix over mtu packet of defrag in | expand

Message

wenxu Nov. 10, 2020, 6:28 a.m. UTC
From: wenxu <wenxu@ucloud.cn>

Currently kernel tc subsystem can do conntrack in act_ct. But when several
fragment packets go through the act_ct, function tcf_ct_handle_fragments
will defrag the packets to a big one. But the last action will redirect
mirred to a device which maybe lead the reassembly big packet over the mtu
of target device.

The first patch fix miss init the qdisc_skb_cb->mru
The send one refactor the hanle of xmit in act_mirred and prepare for the
third one
The last one add implict packet fragment support to fix the over mtu for
defrag in act_ct.

wenxu (3):
  net/sched: fix miss init the mru in qdisc_skb_cb
  net/sched: act_mirred: refactor the handle of xmit
  net/sched: act_frag: add implict packet fragment support.

 include/net/act_api.h     |  16 +++++
 include/net/sch_generic.h |   5 --
 net/core/dev.c            |   2 +
 net/sched/Kconfig         |  13 ++++
 net/sched/Makefile        |   1 +
 net/sched/act_api.c       |  47 +++++++++++++
 net/sched/act_ct.c        |   7 ++
 net/sched/act_frag.c      | 164 ++++++++++++++++++++++++++++++++++++++++++++++
 net/sched/act_mirred.c    |  21 ++++--
 9 files changed, 265 insertions(+), 11 deletions(-)
 create mode 100644 net/sched/act_frag.c

Comments

Vlad Buslov Nov. 10, 2020, 6:23 p.m. UTC | #1
On Tue 10 Nov 2020 at 08:28, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>

>

> Currently kernel tc subsystem can do conntrack in act_ct. But when several

> fragment packets go through the act_ct, function tcf_ct_handle_fragments

> will defrag the packets to a big one. But the last action will redirect

> mirred to a device which maybe lead the reassembly big packet over the mtu

> of target device.

>

> The first patch fix miss init the qdisc_skb_cb->mru

> The send one refactor the hanle of xmit in act_mirred and prepare for the

> third one

> The last one add implict packet fragment support to fix the over mtu for

> defrag in act_ct.

>

> wenxu (3):

>   net/sched: fix miss init the mru in qdisc_skb_cb

>   net/sched: act_mirred: refactor the handle of xmit

>   net/sched: act_frag: add implict packet fragment support.

>

>  include/net/act_api.h     |  16 +++++

>  include/net/sch_generic.h |   5 --

>  net/core/dev.c            |   2 +

>  net/sched/Kconfig         |  13 ++++

>  net/sched/Makefile        |   1 +

>  net/sched/act_api.c       |  47 +++++++++++++

>  net/sched/act_ct.c        |   7 ++

>  net/sched/act_frag.c      | 164 ++++++++++++++++++++++++++++++++++++++++++++++

>  net/sched/act_mirred.c    |  21 ++++--

>  9 files changed, 265 insertions(+), 11 deletions(-)

>  create mode 100644 net/sched/act_frag.c


Hi,

I ran our CT tests with this series and kernel debug configs enabled
without any issue.

Tested-by: Vlad Buslov <vladbu@nvidia.com>
Marcelo Ricardo Leitner Nov. 10, 2020, 6:59 p.m. UTC | #2
On Tue, Nov 10, 2020 at 02:28:03PM +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>

> 

> Currently kernel tc subsystem can do conntrack in act_ct. But when several

> fragment packets go through the act_ct, function tcf_ct_handle_fragments

> will defrag the packets to a big one. But the last action will redirect

> mirred to a device which maybe lead the reassembly big packet over the mtu

> of target device.

> 

> The first patch fix miss init the qdisc_skb_cb->mru

> The send one refactor the hanle of xmit in act_mirred and prepare for the

> third one

> The last one add implict packet fragment support to fix the over mtu for

> defrag in act_ct.


Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Jakub Kicinski Nov. 11, 2020, 12:16 a.m. UTC | #3
On Tue, 10 Nov 2020 14:28:06 +0800 wenxu@ucloud.cn wrote:
> +static int (*tcf_xmit_hook)(struct sk_buff *skb,

> +			    int (*xmit)(struct sk_buff *skb));


missing the rcu annotation on this

net/sched/act_api.c:35:17: error: incompatible types in comparison expression (different address spaces):
net/sched/act_api.c:35:17:    int ( [noderef] __rcu * )( ... )
net/sched/act_api.c:35:17:    int ( * )( ... )
net/sched/act_api.c:52:17: error: incompatible types in comparison expression (different address spaces):
net/sched/act_api.c:52:17:    int ( [noderef] __rcu * )( ... )
net/sched/act_api.c:52:17:    int ( * )( ... )
net/sched/act_api.c:64:21: error: incompatible types in comparison expression (different address spaces):
net/sched/act_api.c:64:21:    int ( [noderef] __rcu * )( ... )
net/sched/act_api.c:64:21:    int ( * )( ... )