On Thu, Aug 03, 2017 at 04:56:56AM +0800, Yi Yang wrote:
> From: Jan Scheurich <[email protected]>
>
> This commit adds translation and netdev datapath support for generic
> encap and decap actions for the NSH MD1 header. The generic encap and
> decap actions are mapped to specific encap_nsh and decap_nsh actions
> in the datapath.
>
> The translation follows that general scheme that decap() of an NSH
> packet triggers recirculation after decapsulation, while encap(nsh)
> just modifies struct flow and sets the ctx->pending_encap flag to
> generate the encap_nsh action at the next commit to be able to include
> subsequent set_field actions for NSH headers.
>
> Support for the flexible MD2 format using TLV properties is foreseen
> in encap(nsh), but not yet fully implemented.
>
> The CLI syntax for encap of NSH is
> encap(hdr=nsh,prop(class=nsh,type=md_type,val=1))
> encap(hdr=nsh,prop(class=nsh,type=md_type,val=2),
> prop(class=nsh,type=tlv,val(<tlv_class>,<tlv_type>,<hex_string>)))
> Signed-off-by: Jan Scheurich <[email protected]>
> Signed-off-by: Yi Yang <[email protected]>
The syntax examples above should be updated.
Some checkpatch warnings worth addressing here:
ERROR: Inappropriate bracing around statement
#215 FILE: lib/match.c:1268:
if (m->nsh.c1)
ERROR: Inappropriate bracing around statement
#217 FILE: lib/match.c:1270:
if (m->nsh.c2)
ERROR: Inappropriate bracing around statement
#219 FILE: lib/match.c:1272:
if (m->nsh.c3)
ERROR: Inappropriate bracing around statement
#221 FILE: lib/match.c:1274:
if (m->nsh.c4)
WARNING: Line length is >79-characters long
#323 FILE: lib/odp-util.c:259:
ds_put_format(ds, ",spi=0x%x", (ntohl(key->path_hdr) & NSH_SPI_MASK) >>
NSH_SPI_SHIFT);
WARNING: Line length is >79-characters long
#612 FILE: lib/odp-util.c:6809:
encap_nsh.path_hdr = htonl((ntohl(flow->nsh.spi) << NSH_SPI_SHIFT) |
flow->nsh.si);
ERROR: Improper whitespace around control block
#1026 FILE: lib/packets.c:412:
switch(ntohl(packet->packet_type)) {
ERROR: Improper whitespace around control block
#1075 FILE: lib/packets.c:461:
switch(nsh->next_proto) {
WARNING: Line has non-spaces leading whitespace
#1127 FILE: ofproto/ofproto-dpif-sflow.c:1202:
case OVS_ACTION_ATTR_ENCAP_NSH:
WARNING: Line has non-spaces leading whitespace
#1128 FILE: ofproto/ofproto-dpif-sflow.c:1203:
case OVS_ACTION_ATTR_DECAP_NSH:
WARNING: Line length is >79-characters long
#1275 FILE: ofproto/ofproto-dpif-xlate.c:5811:
memset(&flow->dl_dst, 0, sizeof(struct flow) - offsetof(struct flow,
dl_dst));
I also get the following Clang warnings:
../lib/odp-util.c:1843:21: error: cast from 'uint8_t *' (aka 'unsigned char
*') to 'struct nsh_md1_ctx *' increases required alignment from 1 to 4
[-Werror,-Wcast-align]
../lib/odp-util.c:6813:35: error: cast from 'uint8_t *' (aka 'unsigned char
*') to 'struct nsh_md1_ctx *' increases required alignment from 1 to 4
[-Werror,-Wcast-align]
../ofproto/ofproto-dpif-xlate.c:5749:43: error: cast from 'const char *' to
'struct ofpact_ed_prop *' increases required alignment from 1 to 2
[-Werror,-Wcast-align]
Thanks,
Ben.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev