]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
flow_offload: reject to offload tc actions in offload drivers
authorBaowen Zheng <baowen.zheng@corigine.com>
Fri, 17 Dec 2021 18:16:18 +0000 (19:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Dec 2021 14:08:47 +0000 (14:08 +0000)
A follow-up patch will allow users to offload tc actions independent of
classifier in the software datapath.

In preparation for this, teach all drivers that support offload of the flow
tables to reject such configuration as currently none of them support it.

Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c
drivers/net/ethernet/netronome/nfp/flower/offload.c

index 1471b6130a2b9015ee787afc5f51dd1f968eef88..d8afcf8d6b30e937cb81cddcf9b91056147bf34d 100644 (file)
@@ -1962,7 +1962,7 @@ static int bnxt_tc_setup_indr_cb(struct net_device *netdev, struct Qdisc *sch, v
                                 void *data,
                                 void (*cleanup)(struct flow_block_cb *block_cb))
 {
-       if (!bnxt_is_netdev_indr_offload(netdev))
+       if (!netdev || !bnxt_is_netdev_indr_offload(netdev))
                return -EOPNOTSUPP;
 
        switch (type) {
index fcb0892c08a9f97134307c9bce91a9d1ae619aca..0991345c4ae5cd18e00ac3d8189d58c16dd57ece 100644 (file)
@@ -517,6 +517,9 @@ int mlx5e_rep_indr_setup_cb(struct net_device *netdev, struct Qdisc *sch, void *
                            void *data,
                            void (*cleanup)(struct flow_block_cb *block_cb))
 {
+       if (!netdev)
+               return -EOPNOTSUPP;
+
        switch (type) {
        case TC_SETUP_BLOCK:
                return mlx5e_rep_indr_setup_block(netdev, sch, cb_priv, type_data,
index 224089d04d983187a81e8b781460eaa6a6dcd220..f97eff5afd12524cdfdb76aa0cf96acfba1748c9 100644 (file)
@@ -1867,6 +1867,9 @@ nfp_flower_indr_setup_tc_cb(struct net_device *netdev, struct Qdisc *sch, void *
                            void *data,
                            void (*cleanup)(struct flow_block_cb *block_cb))
 {
+       if (!netdev)
+               return -EOPNOTSUPP;
+
        if (!nfp_fl_is_netdev_to_offload(netdev))
                return -EOPNOTSUPP;