]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: ipmr: Don't forward packets already forwarded by hardware
authorYotam Gigi <yotamg@mellanox.com>
Tue, 3 Oct 2017 07:58:08 +0000 (09:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Oct 2017 17:06:30 +0000 (10:06 -0700)
commitf63c7fd5e4d5bb978807e1b1bb9e7618f1c6a81d
tree5e122c80aafdc2c30baed336b36663a3af4056e4
parent65eb3249cd9001f5b0c7b4c92cf75d47156d8591
ipv4: ipmr: Don't forward packets already forwarded by hardware

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@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipmr.c