bnxt_en: check for ingress qdisc in flower offload
authorSathya Perla <sathya.perla@broadcom.com>
Mon, 18 Sep 2017 11:35:37 +0000 (17:05 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Sep 2017 23:51:53 +0000 (16:51 -0700)
Check for ingress-only qdisc for flower offload, as other qdiscs
are not supported for flower offload.

Suggested-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c

index ccd699fb2d706ec51252998f7957ae875cd812ea..7dd3d131043a76ba4b83b43f755d2b782c07139e 100644 (file)
@@ -750,6 +750,10 @@ int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
 {
        int rc = 0;
 
+       if (!is_classid_clsact_ingress(cls_flower->common.classid) ||
+           cls_flower->common.chain_index)
+               return -EOPNOTSUPP;
+
        switch (cls_flower->command) {
        case TC_CLSFLOWER_REPLACE:
                rc = bnxt_tc_add_flow(bp, src_fid, cls_flower);