Skip to content
  • Li Zhijian's avatar
    25aaadf0
    net: always walk through filters in reverse if traffic is egress · 25aaadf0
    Li Zhijian authored
    
    
    Previously, if we attach more than one filters for a single netdev,
    both ingress and egress traffic will go through net filters in same
    order like:
    
    ingress: netdev ->filter1 ->filter2 ->...filter[n] ->emulated device
    egress: emulated device ->filter1 ->filter2 ->...filter[n] ->netdev.
    
    This is against the natural feeling and will complicate filters
    configuration since in some scenes, we hope filters handle the egress
    traffic in a reverse order. For example, in colo-proxy (will be
    implemented later), we have a redirector filter and a colo-rewriter
    filter, we need the filter behave like:
    
    ingress(->)/egress(<-): chardev<->redirector<->colo-rewriter<->emulated device
    
    Since both buffer filter and dump do not require strict order of
    filters, this patch switches to always let egress traffic walk through
    net filters in reverse to simplify the possible filters configuration
    in the future.
    
    Signed-off-by: default avatarWen Congyang <wency@cn.fujitsu.com>
    Signed-off-by: default avatarLi Zhijian <lizhijian@cn.fujitsu.com>
    Reviewed-by: default avatarYang Hongyang <hongyang.yang@easystack.cn>
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    25aaadf0
    net: always walk through filters in reverse if traffic is egress
    Li Zhijian authored
    
    
    Previously, if we attach more than one filters for a single netdev,
    both ingress and egress traffic will go through net filters in same
    order like:
    
    ingress: netdev ->filter1 ->filter2 ->...filter[n] ->emulated device
    egress: emulated device ->filter1 ->filter2 ->...filter[n] ->netdev.
    
    This is against the natural feeling and will complicate filters
    configuration since in some scenes, we hope filters handle the egress
    traffic in a reverse order. For example, in colo-proxy (will be
    implemented later), we have a redirector filter and a colo-rewriter
    filter, we need the filter behave like:
    
    ingress(->)/egress(<-): chardev<->redirector<->colo-rewriter<->emulated device
    
    Since both buffer filter and dump do not require strict order of
    filters, this patch switches to always let egress traffic walk through
    net filters in reverse to simplify the possible filters configuration
    in the future.
    
    Signed-off-by: default avatarWen Congyang <wency@cn.fujitsu.com>
    Signed-off-by: default avatarLi Zhijian <lizhijian@cn.fujitsu.com>
    Reviewed-by: default avatarYang Hongyang <hongyang.yang@easystack.cn>
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Loading