My comments apply more to the yet to be submitted kernel part. Until
then, I agree with Joe that all of this should be inside
#ifndef __KERNEL__. But these are comments I'd have at netdev thus you
may as well change that for v2 (or explain that I'm wrong).
On Wed, 5 Jul 2017 11:45:42 +0800, Yi Yang wrote:
> +#define OVS_ENCAP_NSH_MAX_MD_LEN 256
This makes the size set in stone forever. I believe it is not what you
want.
Netlink is based on attributes for the purpose of future extensibility
and that's exactly what's needed here. The 'metadata' field should be
in its own attribute (or, rather, attributes).
> +/*
> + * struct ovs_action_encap_nsh - %OVS_ACTION_ATTR_ENCAP_NSH
> + * @flags: NSH header flags.
> + * @mdtype: NSH metadata type.
> + * @mdlen: Length of NSH metadata in bytes.
> + * @np: NSH next_protocol: Inner packet type.
> + * @path_hdr: NSH service path id and service index.
> + * @metadata: NSH metadata for MD type 1 or 2
> + */
> +struct ovs_action_encap_nsh {
Please call this push_nsh to be consistent with other similar uses
(MPLS, Ethernet).
> + uint8_t flags;
> + uint8_t mdtype;
> + uint8_t mdlen;
> + uint8_t np;
> + __be32 path_hdr;
> + uint8_t metadata[OVS_ENCAP_NSH_MAX_MD_LEN];
> +};
> +
> /**
> * enum ovs_nat_attr - Attributes for %OVS_CT_ATTR_NAT.
> *
> @@ -870,6 +889,8 @@ enum ovs_nat_attr {
> * @OVS_ACTION_ATTR_PUSH_ETH: Push a new outermost Ethernet header onto the
> * packet.
> * @OVS_ACTION_ATTR_POP_ETH: Pop the outermost Ethernet header off the
> packet.
> + * @OVS_ACTION_ATTR_ENCAP_NSH: encap NSH action to push NSH header.
> + * @OVS_ACTION_ATTR_DECAP_NSH: decap NSH action to remove NSH header.
> *
> * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not
> all
> * fields within a header are modifiable, e.g. the IPv4 protocol and fragment
> @@ -905,6 +926,8 @@ enum ovs_action_attr {
> OVS_ACTION_ATTR_TRUNC, /* u32 struct ovs_action_trunc. */
> OVS_ACTION_ATTR_PUSH_ETH, /* struct ovs_action_push_eth. */
> OVS_ACTION_ATTR_POP_ETH, /* No argument. */
> + OVS_ACTION_ATTR_ENCAP_NSH, /* struct ovs_action_encap_nsh. */
> + OVS_ACTION_ATTR_DECAP_NSH, /* No argument. */
Likewise, this should be PUSH and POP, not ENCAP and DECAP.
Thanks,
Jiri
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev