netfilter: flowtable: add dsa support
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 24 Mar 2021 01:30:44 +0000 (02:30 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Mar 2021 19:48:39 +0000 (12:48 -0700)
Replace the master ethernet device by the dsa slave port. Packets coming
in from the software ingress path use the dsa slave port as input
device.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nft_flow_offload.c

index 81a5e2b6c901de20ea5c237f0570b8262b7a6d89..143d049fd7f1a0d456d7ff7d8300e591fb13373b 100644 (file)
@@ -89,6 +89,7 @@ static void nft_dev_path_info(const struct net_device_path_stack *stack,
                path = &stack->path[i];
                switch (path->type) {
                case DEV_PATH_ETHERNET:
+               case DEV_PATH_DSA:
                case DEV_PATH_VLAN:
                case DEV_PATH_PPPOE:
                        info->indev = path->dev;
@@ -97,6 +98,10 @@ static void nft_dev_path_info(const struct net_device_path_stack *stack,
 
                        if (path->type == DEV_PATH_ETHERNET)
                                break;
+                       if (path->type == DEV_PATH_DSA) {
+                               i = stack->num_paths;
+                               break;
+                       }
 
                        /* DEV_PATH_VLAN and DEV_PATH_PPPOE */
                        if (info->num_encaps >= NF_FLOW_TABLE_ENCAP_MAX) {