aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorPaul Blakey <paulb@mellanox.com>2018-06-05 04:04:03 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-05 10:29:58 -0400
commitd96a43c66464cdf0b249fdf47b6dcd65b83af8c0 (patch)
treededabc30a64e17f27a66dd7b58450a72022c9fa6 /net/sched/cls_api.c
parent1d88ba1ebb2763aa86172cd7ca05dedbeccc0d35 (diff)
net: sched: cls: Fix offloading when ingress dev is vxlan
When using a vxlan device as the ingress dev, we count it as a "no offload dev", so when such a rule comes and err stop is true, we fail early and don't try the egdev route which can offload it through the egress device. Fix that by not calling the block offload if one of the devices attached to it is not offload capable, but make sure egress on such case is capable instead. Fixes: caa7260156eb ("net: sched: keep track of offloaded filters [..]") Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Paul Blakey <paulb@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index cdc3c87c53e6..29fb4d68a144 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -807,10 +807,6 @@ static int tcf_block_cb_call(struct tcf_block *block, enum tc_setup_type type,
807 int ok_count = 0; 807 int ok_count = 0;
808 int err; 808 int err;
809 809
810 /* Make sure all netdevs sharing this block are offload-capable. */
811 if (block->nooffloaddevcnt && err_stop)
812 return -EOPNOTSUPP;
813
814 list_for_each_entry(block_cb, &block->cb_list, list) { 810 list_for_each_entry(block_cb, &block->cb_list, list) {
815 err = block_cb->cb(type, type_data, block_cb->cb_priv); 811 err = block_cb->cb(type, type_data, block_cb->cb_priv);
816 if (err) { 812 if (err) {
@@ -1729,21 +1725,31 @@ static int tc_exts_setup_cb_egdev_call(struct tcf_exts *exts,
1729int tc_setup_cb_call(struct tcf_block *block, struct tcf_exts *exts, 1725int tc_setup_cb_call(struct tcf_block *block, struct tcf_exts *exts,
1730 enum tc_setup_type type, void *type_data, bool err_stop) 1726 enum tc_setup_type type, void *type_data, bool err_stop)
1731{ 1727{
1732 int ok_count; 1728 int ok_count = 0;
1733 int ret; 1729 int ret;
1734 1730
1735 ret = tcf_block_cb_call(block, type, type_data, err_stop); 1731 if (!block->nooffloaddevcnt) {
1736 if (ret < 0) 1732 ret = tcf_block_cb_call(block, type, type_data, err_stop);
1737 return ret; 1733 if (ret < 0)
1738 ok_count = ret; 1734 return ret;
1735 ok_count = ret;
1736 }
1739 1737
1740 if (!exts || ok_count) 1738 if (!exts || ok_count)
1741 return ok_count; 1739 goto skip_egress;
1740
1742 ret = tc_exts_setup_cb_egdev_call(exts, type, type_data, err_stop); 1741 ret = tc_exts_setup_cb_egdev_call(exts, type, type_data, err_stop);
1743 if (ret < 0) 1742 if (ret < 0)
1744 return ret; 1743 return ret;
1745 ok_count += ret; 1744 ok_count += ret;
1746 1745
1746skip_egress:
1747 /* if one of the netdevs sharing this block are not offload-capable
1748 * make sure we succeeded in egress instead.
1749 */
1750 if (block->nooffloaddevcnt && !ok_count && err_stop)
1751 return -EOPNOTSUPP;
1752
1747 return ok_count; 1753 return ok_count;
1748} 1754}
1749EXPORT_SYMBOL(tc_setup_cb_call); 1755EXPORT_SYMBOL(tc_setup_cb_call);