[OPNFLWPLUG-211] lists of actions are not ordered consistently Created: 08/Jul/14  Updated: 27/Sep/21  Resolved: 19/Aug/14

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Colin Dixon Assignee: Shigeru Yasuda
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


Issue Links:
Duplicate
is duplicated by OPNFLWJAVA-32 Openflow actions not set in the corre... Resolved
External issue ID: 1338

 Description   

Reported on the mailing list here:
https://lists.opendaylight.org/pipermail/controller-dev/2014-July/005499.html

If you have the YANG data model, have you tried specifying "ordered-by-user" in the list?
Thanks
Kiran

----Original Message----
From: controller-dev-bounces at lists.opendaylight.org controller-dev-bounces at lists.opendaylight.org On Behalf Of Shigeru Yasuda
Sent: Tuesday, July 08, 2014 11:18 AM
To: controller-dev at lists.opendaylight.org; openflowplugin-dev at lists.opendaylight.org; vtn-dev at lists.opendaylight.org
Subject: [controller-dev] Flow actions were reordered.

Hi folks,

I observed that flow actions in a flow entry were reordered unexpectedly when I tested VTN with OF13 plugin.

I configured 3 actions in a flow entry (via sal-compatibility):

action[0]: PUSH_VLAN
action[1]: SET_FIELD (VLAN_VID)
action[2]: OUTPUT

But above actions were encoded into an OF13 FLOW_MOD as follows:

action[0]: OUTPUT
action[1]: PUSH_VLAN
action[2]: SET_FIELD (VLAN_VID)

I embedded some trace logs into the controller source, then I observed that flow actions in MD-SAL flow were already reordered when
FlowChangeListener.add() was called.

_applyActions=ApplyActions [
_action=[
Action [
_order=2, _key=ActionKey [_order=2],
_action=OutputActionCase [
_outputAction=OutputAction [
_outputNodeConnector=Uri [_value=openflow:4:1],
augmentation=[]
],
augmentation=[]
],
augmentation=[]
],
Action [
_order=0, _key=ActionKey [_order=0],
_action=PushVlanActionCase [
_pushVlanAction=PushVlanAction [
_ethernetType=33024,
augmentation=[]
],
augmentation=[]
],
augmentation=[]
],
Action [
_order=1, _key=ActionKey [_order=1],
_action=SetVlanIdActionCase [
_setVlanIdAction=SetVlanIdAction [
_vlanId=VlanId [_value=10],
augmentation=[]
],
augmentation=[]
],
augmentation=[]
]
],
augmentation=[]
], ...

And I enabled trace logging for BindingToNormalizedNodeCodec class in sal-binding-broker, then I observed that MD-SAL actions were deserialized out of order.

2014-07-09 00:37:40.849 GMT+09:00 [pool-17-thread-1] TRACE \
o.o.c.m.s.b.i.BindingToNormalizedNodeCodec - \
InstanceIdentifier Path Deserialization: [... snipped ..] \
action/(urn:opendaylight:flow:inventory?revision=2013-08-19)output-action

2014-07-09 00:37:40.851 GMT+09:00 [pool-17-thread-1] TRACE \
o.o.c.m.s.b.i.BindingToNormalizedNodeCodec - \
InstanceIdentifier Path Deserialization: [... snipped ..] \
action/(urn:opendaylight:flow:inventory?revision=2013-08-19)set-vlan-id-action

2014-07-09 00:37:40.851 GMT+09:00 [pool-17-thread-1] TRACE \
o.o.c.m.s.b.i.BindingToNormalizedNodeCodec - \
InstanceIdentifier Path Deserialization: [... snipped ..] \
action/(urn:opendaylight:flow:inventory?revision=2013-08-19)push-vlan-action

The order of elements in a YANG data list seems to be unspecified because it may be randomized by deserialization. My understanding is correct?
If so, I think openflowplugin should sort MD-SAL actions according to action order (Action.getOrder()) when it converts MD-SAL actions into OF actions.

Regards,


Shigeru Yasuda



 Comments   
Comment by Colin Dixon [ 08/Jul/14 ]

Should be fixed by https://git.opendaylight.org/gerrit/#/c/8830/

Waiting for confirmation on the mailing list.

Comment by Shigeru Yasuda [ 09/Jul/14 ]

Verified that this issue was fixed by the following patch.

https://git.opendaylight.org/gerrit/8842

Comment by Rob Adams [ 05/Aug/14 ]

This patch fixes the issue for me and I think it's more "correct" than changing the yang model in the way that has been proposed.

https://git.opendaylight.org/gerrit/#/c/9702/

Comment by Kamal Rameshan [ 08/Aug/14 ]

Two gerrits have been added :
Controller : https://git.opendaylight.org/gerrit/#/c/9802/

Openflowplugin: https://git.opendaylight.org/gerrit/#/c/9214/

This would take care the ordering of the actions as well as instructions and table-feature-properties

Currently waiting for api freeze waiver and review.

Comment by Kamal Rameshan [ 15/Aug/14 ]

Hi Shigeru,

Can you please take the latest and check if this issue is fixed.

Please mark it resolved once reviewed.

Thanks
Kamal

Comment by Abhijit Kumbhare [ 18/Aug/14 ]

Shigeru, Colin,

Can you guys check? This is merged now.

Abhijit

Comment by Shigeru Yasuda [ 19/Aug/14 ]

I verified that merged patches fixed the issue I reported.

Generated at Wed Feb 07 20:31:51 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.