Skip to content

Commit

Permalink
ipv6: Add support for setting ipv6 flow label.
Browse files Browse the repository at this point in the history
IPv6 Flow Label is currently read only. This patch adds support
to allow actions like actions=set_field:0x12345->ipv6_label.

The change to mf_set_flow_value() is a bug fix, but the bug was
not visible before the flow label was modifiable.

Signed-off-by: Pritesh Kothari <[email protected]>
[[email protected] added an item to NEWS]
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Pritesh Kothari authored and blp committed Jan 13, 2015
1 parent b13bfc3 commit 88cc95c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Post-v2.3.0
commands are now redundant and will be removed in a future
release. See ovs-vswitchd(8) for details.
- OpenFlow:
* The IPv6 flow label field is now modifiable.
* OpenFlow 1.5 (draft) extended registers are now supported.
* The OpenFlow 1.5 (draft) actset_output field is now supported.
* OpenFlow 1.5 (draft) Copy-Field action is now supported.
Expand Down
2 changes: 1 addition & 1 deletion lib/meta-flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ mf_set_flow_value(const struct mf_field *mf,
break;

case MFF_IPV6_LABEL:
flow->ipv6_label = value->be32 & ~htonl(IPV6_LABEL_MASK);
flow->ipv6_label = value->be32 & htonl(IPV6_LABEL_MASK);
break;

case MFF_IP_PROTO:
Expand Down
2 changes: 1 addition & 1 deletion lib/meta-flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ enum OVS_PACKED_ENUM mf_field_id {
* Maskable: bitwise.
* Formatting: hexadecimal.
* Prerequisites: IPv6.
* Access: read-only.
* Access: read/write.
* NXM: NXM_NX_IPV6_LABEL(27) since v1.4.
* OXM: OXM_OF_IPV6_FLABEL(28) since OF1.2 and v1.7.
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/ofproto.at
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ OVS_VSWITCHD_START
instructions: apply_actions,clear_actions,write_actions,write_metadata$goto
Write-Actions and Apply-Actions features:
actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
matching:
metadata: exact match or wildcard
in_port_oxm: exact match or wildcard
Expand Down Expand Up @@ -1465,7 +1465,7 @@ OVS_VSWITCHD_START
instructions: meter,apply_actions,clear_actions,write_actions,write_metadata$goto
Write-Actions and Apply-Actions features:
actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
supported on Set-Field: tun_id tun_src tun_dst metadata in_port in_port_oxm pkt_mark reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
supported on Set-Field: tun_id tun_src tun_dst metadata in_port in_port_oxm pkt_mark reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
matching:
dp_hash: arbitrary mask
recirc_id: exact match or wildcard
Expand Down

0 comments on commit 88cc95c

Please sign in to comment.