On Sun, May 28, 2017 at 02:59:46PM +0300, Roi Dayan wrote: > Add tc helper functions to query and manipulate the flower classifier. > > Signed-off-by: Paul Blakey <pa...@mellanox.com> > Signed-off-by: Roi Dayan <r...@mellanox.com>
Thanks, this looks good to me and I would be happy to apply it if someone provided a review. Also, please see the note below. ... > --- a/lib/tc.c > +++ b/lib/tc.c > @@ -1,5 +1,6 @@ ... > + if (ip_proto == IPPROTO_TCP) { > + if (attrs[TCA_FLOWER_KEY_TCP_SRC_MASK]) { > + key->src_port = > + nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_SRC]); > + mask->src_port = > + nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_SRC_MASK]); > + } > + if (attrs[TCA_FLOWER_KEY_TCP_DST_MASK]) { > + key->dst_port = > + nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_DST]); > + mask->dst_port = > + nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_DST_MASK]); > + } > + } else if (ip_proto == IPPROTO_UDP) { > + if (attrs[TCA_FLOWER_KEY_UDP_SRC_MASK]) { > + key->src_port = nl_attr_get_be16(attrs[TCA_FLOWER_KEY_UDP_SRC]); > + mask->src_port = > + nl_attr_get_be16(attrs[TCA_FLOWER_KEY_UDP_SRC_MASK]); > + } > + if (attrs[TCA_FLOWER_KEY_UDP_DST_MASK]) { > + key->dst_port = nl_attr_get_be16(attrs[TCA_FLOWER_KEY_UDP_DST]); > + mask->dst_port = > + nl_attr_get_be16(attrs[TCA_FLOWER_KEY_UDP_DST_MASK]); > + } > + } As mentioned a few times it seems that SCTP could be trivially supported here. I think adding it would make for an excellent follow-up patch. ... _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev