[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <067cd4b7-791f-fe7a-7131-d90dd2362b00@cumulusnetworks.com>
Date: Tue, 3 Oct 2017 13:26:35 +0300
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org
Cc: davem@...emloft.net, yotamg@...lanox.com, idosch@...lanox.com,
mlxsw@...lanox.com, andrew@...n.ch, dsa@...ulusnetworks.com,
edumazet@...gle.com, willemb@...gle.com, johannes.berg@...el.com,
dcaratti@...hat.com, pabeni@...hat.com, daniel@...earbox.net,
f.fainelli@...il.com, fw@...len.de, gfree.wind@....163.com
Subject: Re: [patch net-next v2 3/7] ipv4: ipmr: Don't forward packets already
forwarded by hardware
On 03/10/17 10:58, Jiri Pirko wrote:
> From: Yotam Gigi <yotamg@...lanox.com>
>
> Change the ipmr module to not forward packets if:
> - The packet is marked with the offload_mr_fwd_mark, and
> - Both input interface and output interface share the same parent ID.
>
> This way, a packet can go through partial multicast forwarding in the
> hardware, where it will be forwarded only to the devices that share the
> same parent ID (AKA, reside inside the same hardware). The kernel will
> forward the packet to all other interfaces.
>
> To do this, add the ipmr_offload_forward helper, which per skb, ingress VIF
> and egress VIF, returns whether the forwarding was offloaded to hardware.
> The ipmr_queue_xmit frees the skb and does not forward it if the result is
> a true value.
>
> All the forwarding path code compiles out when the CONFIG_NET_SWITCHDEV is
> not set.
>
> Signed-off-by: Yotam Gigi <yotamg@...lanox.com>
> Reviewed-by: Ido Schimmel <idosch@...lanox.com>
> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
> ---
> v1->v2:
> - Use dev_parent_id.len field instead of the dev_parent_id_valid field
> ---
> net/ipv4/ipmr.c | 37 ++++++++++++++++++++++++++++++++-----
> 1 file changed, 32 insertions(+), 5 deletions(-)
>
> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> index 1b161ad..b3ee01b 100644
> --- a/net/ipv4/ipmr.c
> +++ b/net/ipv4/ipmr.c
> @@ -1859,10 +1859,33 @@ static inline int ipmr_forward_finish(struct net *net, struct sock *sk,
> return dst_output(net, sk, skb);
> }
>
Reviewed-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Powered by blists - more mailing lists