summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>2019-05-04 07:46:19 -0400
committerDavid S. Miller <davem@davemloft.net>2019-05-06 00:49:24 -0400
commit9681e8b3ef6cf85fb1487f155100096e171baa7b (patch)
tree3c7a7a43da3e51695b9dbd4ec046f527010cd518 /net/dsa
parentab79af32b0a5606324ce04c0f04a0d2f90b94464 (diff)
net/dsa: use intermediate representation for matchall offload
Updates dsa hardware switch handling infrastructure to use the newer intermediate representation for flow actions in matchall offloads. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 8ad9bf957da1..6ce2fdb64db0 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -778,27 +778,25 @@ static int dsa_slave_add_cls_matchall(struct net_device *dev,
778 struct dsa_mall_tc_entry *mall_tc_entry; 778 struct dsa_mall_tc_entry *mall_tc_entry;
779 __be16 protocol = cls->common.protocol; 779 __be16 protocol = cls->common.protocol;
780 struct dsa_switch *ds = dp->ds; 780 struct dsa_switch *ds = dp->ds;
781 struct net_device *to_dev; 781 struct flow_action_entry *act;
782 const struct tc_action *a;
783 struct dsa_port *to_dp; 782 struct dsa_port *to_dp;
784 int err = -EOPNOTSUPP; 783 int err = -EOPNOTSUPP;
785 784
786 if (!ds->ops->port_mirror_add) 785 if (!ds->ops->port_mirror_add)
787 return err; 786 return err;
788 787
789 if (!tcf_exts_has_one_action(cls->exts)) 788 if (!flow_offload_has_one_action(&cls->rule->action))
790 return err; 789 return err;
791 790
792 a = tcf_exts_first_action(cls->exts); 791 act = &cls->rule->action.entries[0];
793 792
794 if (is_tcf_mirred_egress_mirror(a) && protocol == htons(ETH_P_ALL)) { 793 if (act->id == FLOW_ACTION_MIRRED && protocol == htons(ETH_P_ALL)) {
795 struct dsa_mall_mirror_tc_entry *mirror; 794 struct dsa_mall_mirror_tc_entry *mirror;
796 795
797 to_dev = tcf_mirred_dev(a); 796 if (!act->dev)
798 if (!to_dev)
799 return -EINVAL; 797 return -EINVAL;
800 798
801 if (!dsa_slave_dev_check(to_dev)) 799 if (!dsa_slave_dev_check(act->dev))
802 return -EOPNOTSUPP; 800 return -EOPNOTSUPP;
803 801
804 mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL); 802 mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL);
@@ -809,7 +807,7 @@ static int dsa_slave_add_cls_matchall(struct net_device *dev,
809 mall_tc_entry->type = DSA_PORT_MALL_MIRROR; 807 mall_tc_entry->type = DSA_PORT_MALL_MIRROR;
810 mirror = &mall_tc_entry->mirror; 808 mirror = &mall_tc_entry->mirror;
811 809
812 to_dp = dsa_slave_to_port(to_dev); 810 to_dp = dsa_slave_to_port(act->dev);
813 811
814 mirror->to_local_port = to_dp->index; 812 mirror->to_local_port = to_dp->index;
815 mirror->ingress = ingress; 813 mirror->ingress = ingress;