Hi,
The idea is to use OFPPS_LIVE bit to propagate link aliveness state towards the
controller also when sending port status.
The ofport->may_enable flag could be used for this purpose. I updated some unit
tests according to the changes of ofproto-dpif.
Signed-off-by: Zoltán Balogh <zoltan.bal...@ericsson.com>
Co-authored-by: László Sürü <laszlo.s...@ericsson.com>
Signed-off-by: László Sürü <laszlo.s...@ericsson.com>
Co-authored-by: Jan Scheurich <jan.scheur...@ericsson.com>
Signed-off-by: Jan Scheurich <jan.scheur...@ericsson.com>
---
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 44e7bbc..9c1b7c9 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3398,6 +3398,13 @@ port_run(struct ofport_dpif *ofport)
}
ofport->may_enable = enable;
+
+ /* Propagate the may_enable flag as link liveness. */
+ if (ofport->may_enable) {
+ ofport->up.pp.state |= OFPUTIL_PS_LIVE;
+ } else {
+ ofport->up.pp.state &= ~OFPUTIL_PS_LIVE;
+ }
}
static int
diff --git a/tests/ofproto.at b/tests/ofproto.at
index 52e1ab4..ec169ae 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -770,15 +770,15 @@ AT_CLEANUP
AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
OVS_VSWITCHD_START
for command_config_state in \
- 'up 0 0' \
+ 'up 0 LIVE' \
'down PORT_DOWN LINK_DOWN' \
'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
- 'up NO_RECV 0' \
- 'receive 0 0'
+ 'up NO_RECV LIVE' \
+ 'receive 0 LIVE'
do
set $command_config_state
command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
@@ -801,15 +801,15 @@ AT_CLEANUP
AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
OVS_VSWITCHD_START
for command_config_state in \
- 'up 0 0' \
+ 'up 0 LIVE' \
'down PORT_DOWN LINK_DOWN' \
'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
- 'up NO_RECV 0' \
- 'receive 0 0'
+ 'up NO_RECV LIVE' \
+ 'receive 0 LIVE'
do
set $command_config_state
command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
@@ -2831,7 +2831,7 @@
udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172
speed: 0 Mbps now, 0 Mbps max
OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
config: 0
- state: 0
+ state: LIVE
speed: 0 Mbps now, 0 Mbps max"
fi
@@ -2840,7 +2840,7 @@ OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
if test X"$1" = X"OFPPR_DELETE"; then shift;
echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test):
addr:aa:55:aa:55:00:0x
config: 0
- state: 0
+ state: LIVE
speed: 0 Mbps now, 0 Mbps max"
fi
@@ -2935,7 +2935,7 @@ check_async () {
speed: 0 Mbps now, 0 Mbps max
OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
config: 0
- state: 0
+ state: LIVE
speed: 0 Mbps now, 0 Mbps max"
fi
@@ -2944,7 +2944,7 @@ OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
if test X"$1" = X"OFPPR_DELETE"; then shift;
echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test):
addr:aa:55:aa:55:00:0x
config: 0
- state: 0
+ state: LIVE
speed: 0 Mbps now, 0 Mbps max"
fi
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev