[OPNFLWPLUG-31] Queue list for a node connector is always empty Created: 15/Jan/14  Updated: 27/Sep/21  Due: 23/Jan/14  Resolved: 03/Feb/14

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

Type: Improvement
Reporter: Anil Gujele Assignee: Anil Vishnoi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC


Issue Links:
Blocks
is blocked by YANGTOOLS-75 key from ListSchemaNode has different... Resolved

 Description   

1. add queue for a port using mininet:

sudo ovs−vsctl −− set port s1-eth1 qos=@newqos −− −−id=@newqos create qos type=linux−htb other−config:max−rate=1000000 queues:0=@newqueue −− −−id=@newqueue create queue other−config:min−rate=1000000 other−config:max−rate=1000000

2. read queue operational data as shown below, queue list is always empty.
InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey)
.augmentation(FlowCapableNodeConnector.class).toInstance();

FlowCapableNodeConnector nodeConnector =
(FlowCapableNodeConnector) dataProviderService.readOperationalData(connectorRef);

List<Queue> queueList = nodeConnector.getQueue();

queueList is always empty.

3. we are able to see queue stats using REST API
http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1/

{
"node-connector": [
{
"flow-node-inventory:current-feature": "copper 10gb-fd",
"flow-node-inventory:hardware-address": "0E:52:5A:55:C0:47",
"flow-node-inventory:peer-features": "",
"id": "openflow:1:1",
"flow-node-inventory:state":

{ "flow-node-inventory:blocked": false, "flow-node-inventory:link-down": false, "flow-node-inventory:live": false }

,
"flow-node-inventory:configuration": "",
"opendaylight-port-statistics:flow-capable-node-connector-statistics": {
"opendaylight-port-statistics:receive-over-run-error": 0,
"opendaylight-port-statistics:transmit-errors": 0,
"opendaylight-port-statistics:receive-drops": 0,
"opendaylight-port-statistics:receive-crc-error": 0,
"opendaylight-port-statistics:duration": {},
"opendaylight-port-statistics:packets":

{ "opendaylight-port-statistics:transmitted": 774, "opendaylight-port-statistics:received": 5 }

,
"opendaylight-port-statistics:receive-frame-error": 0,
"opendaylight-port-statistics:receive-errors": 0,
"opendaylight-port-statistics:transmit-drops": 0,
"opendaylight-port-statistics:bytes":

{ "opendaylight-port-statistics:transmitted": 48762, "opendaylight-port-statistics:received": 378 }

,
"opendaylight-port-statistics:collision-count": 0
},
"flow-node-inventory:port-number": 1,
"flow-node-inventory:supported": "",
"flow-node-inventory:advertised-features": "",
"flow-node-inventory:name": "s1-eth1",
"flow-node-inventory:queue": [
{
"flow-node-inventory:queue-id": 0,
"opendaylight-queue-statistics:flow-capable-node-connector-queue-statistics": {
"opendaylight-queue-statistics:duration": {},
"opendaylight-queue-statistics:transmitted-bytes": 45360,
"opendaylight-queue-statistics:transmitted-packets": 720,
"opendaylight-queue-statistics:transmission-errors": 0
}
}
]
}
]
}



 Comments   
Comment by Anil Gujele [ 20/Jan/14 ]

As per my understanding, There are code changes required from controller and plugin side.

Controller side:
Currently controller does not support to query the Queue for node connector and add queue to the node connector. So queue list is not found for the node connector in controller even if queue is added in Switch.

Plugin Side:
ModelDrivenSwitch.java does not implement interface SalQueueService.java to support queue , So interface implementation for queue support is missing.
Queue reply is also not yet implemented to attach the Queue to node connector.

Comment by Anil Gujele [ 20/Jan/14 ]

As per my understanding, There are code changes required from controller , plugin and Yang model side. i am not good with Yang and Controller side, so pls assign it to controller team.

Yang Model:
Queue Model at controller side (GetQueueOutput.java Or QueueGetConfigReply.java) supports port:queue mapping as 1:1
Queue Model at plugin side (GetQueueConfigOutput.java) supports port:queue mapping as 1:n

Controller side:
Currently controller does not support to query the Queue for node connector and add queue to the node connector. So queue list is not found for the node connector in controller even if queue is added in Switch.

Plugin Side:
ModelDrivenSwitch.java does not implement interface SalQueueService.java to support queue , So interface implementation for queue support is missing.
Queue reply is also not yet implemented to attach the Queue to node connector.

Comment by Abhijit Kumbhare [ 20/Jan/14 ]

Anil - Ed said there were changes made to the controller - which may be fixing this and wanted it retested.

Comment by Anil Gujele [ 21/Jan/14 ]

Retested this issue and found that it is still happening.
Below test code can be use to recheck the issue.

Test code to reproduce this issue.
public void testQueue()
{
List<Node> nodes = getNodes();
for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext() {
NodeKey nodeKey = iterator.next().getKey();
InstanceIdentifier<Node> nodeRef = InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey)
.toInstance();
Node node = (Node) dataProviderService.readOperationalData(nodeRef);
List<NodeConnector> ports = node.getNodeConnector();
for (Iterator<NodeConnector> iterator2 = ports.iterator(); iterator2.hasNext() {
NodeConnectorKey nodeConnectorKey = iterator2.next().getKey();
InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey)
.augmentation(FlowCapableNodeConnector.class).toInstance();
FlowCapableNodeConnector nodeConnector = (FlowCapableNodeConnector) dataProviderService
.readOperationalData(connectorRef);
// queue list is always empty, OPNFLWPLUG-31 is raised.
List<Queue> queueList = nodeConnector.getQueue();

for (Iterator<Queue> iterator3 = queueList.iterator(); iterator3.hasNext()

{ QueueKey queueKey = iterator3.next().getKey(); InstanceIdentifier<Queue> queueRef = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey) .augmentation(FlowCapableNodeConnector.class).child(Queue.class, queueKey).toInstance(); Queue queue = (Queue) dataProviderService.readOperationalData(queueRef); }

}
}
}

Comment by Anil Vishnoi [ 22/Jan/14 ]

Hi AnilG,

This bug seems to be similar to OPNFLWPLUG-33. Where you can access the group statistics when you fetch data for /node/openflow:1 but it throws exception when you try to access the specific group like /node/openflow:1/group/1 using restconf. This is a bug (329) in yangtools which Martin Sunal is working on currently.

Similarly in this issue, To recreate the issue locally I created queue on node-connector:1 of the switch and then I fetch details of node-connector:1 using restconf, I do see queue statistics data in the response. Following is the snapshot of the restconf data

URI:http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1/

{
"node-connector": [
{
"flow-node-inventory:peer-features": "",
"flow-node-inventory:maximum-speed": 1048576,
"flow-node-inventory:state":

{ "flow-node-inventory:blocked": false, "flow-node-inventory:link-down": false, "flow-node-inventory:live": true }

,
"id": "openflow:1:1",
"flow-node-inventory:port-number": 1,
"flow-node-inventory:supported": "pause hundred-gb-fd hundred-mb-hd other copper hundred-mb-fd fiber",
"flow-node-inventory:advertised-features": "pause hundred-gb-fd hundred-mb-hd other copper hundred-mb-fd fiber",
"flow-node-inventory:name": "eth1",
"flow-node-inventory:current-speed": 0,
"flow-node-inventory:current-feature": "pause other",
"flow-node-inventory:hardware-address": "00:21:CC:BA:14:E4",
"flow-node-inventory:configuration": "",
"opendaylight-port-statistics:flow-capable-node-connector-statistics": {
"opendaylight-port-statistics:receive-over-run-error": 0,
"opendaylight-port-statistics:transmit-errors": 0,
"opendaylight-port-statistics:receive-drops": 0,
"opendaylight-port-statistics:receive-crc-error": 0,
"opendaylight-port-statistics:duration":

{ "opendaylight-port-statistics:second": 1541, "opendaylight-port-statistics:nanosecond": 682000 }

,
"opendaylight-port-statistics:packets":

{ "opendaylight-port-statistics:transmitted": 295, "opendaylight-port-statistics:received": 0 }

,
"opendaylight-port-statistics:receive-frame-error": 0,
"opendaylight-port-statistics:receive-errors": 0,
"opendaylight-port-statistics:transmit-drops": 0,
"opendaylight-port-statistics:bytes":

{ "opendaylight-port-statistics:transmitted": 18585, "opendaylight-port-statistics:received": 0 }

,
"opendaylight-port-statistics:collision-count": 0
},
"flow-node-inventory:queue": [
{
"flow-node-inventory:queue-id": 1,
"opendaylight-queue-statistics:flow-capable-node-connector-queue-statistics": {
"opendaylight-queue-statistics:duration":

{ "opendaylight-queue-statistics:second": 154, "opendaylight-queue-statistics:nanosecond": 966000 }

,
"opendaylight-queue-statistics:transmitted-bytes": 0,
"opendaylight-queue-statistics:transmitted-packets": 0,
"opendaylight-queue-statistics:transmission-errors": 0
}
}
]
}
]
}

But when I tried to access the queue details of this node connector using following URI:

http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1/queue/1

I am getting following exception ( similar to OPNFLWPLUG-33)
<b>exception</b>
<pre>java.lang.IllegalArgumentException
com.google.common.base.Preconditions.checkArgument(Preconditions.java:76)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.addKeyValue(ControllerContext.java:787)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:672)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:688)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:688)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:688)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.toInstanceIdentifier(ControllerContext.java:170)
org.opendaylight.controller.sal.restconf.impl.RestconfImpl.readOperationalData(RestconfImpl.java:215)

I believe when you are trying to get the queues programmatically, you are hitting the same bug. I will discuss this issue with Martin and will update you with further details.

Thanks
Anil

Thanks
Anil

Comment by Anil Vishnoi [ 22/Jan/14 ]

Hi AnilG,

I discussed with Martin and this bug also seems to be causing because of yangtoolks bug – 329.

Thanks
Anil

Comment by Anil Vishnoi [ 23/Jan/14 ]

Hi AnilG,

Dependent yangtools bug (bug -329) is now fixed, can you please verify that this fix resolves this issue.

Thanks
Anil

Comment by Anil Gujele [ 25/Jan/14 ]

Hi AnilV,

I tested this issue with today's build, it is still not resolved.

Test code to reproduce this issue (after adding the queue as mention in defect description).

public void testQueue()
{
List<Node> nodes = getNodes();
for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext() {
NodeKey nodeKey = iterator.next().getKey();
InstanceIdentifier<Node> nodeRef = InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey)
.toInstance();
Node node = (Node) dataProviderService.readOperationalData(nodeRef);
List<NodeConnector> ports = node.getNodeConnector();
for (Iterator<NodeConnector> iterator2 = ports.iterator(); iterator2.hasNext() {
NodeConnectorKey nodeConnectorKey = iterator2.next().getKey();
InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey)
.augmentation(FlowCapableNodeConnector.class).toInstance();
FlowCapableNodeConnector nodeConnector = (FlowCapableNodeConnector) dataProviderService
.readOperationalData(connectorRef);
// queue list is always empty, OPNFLWPLUG-31 is raised.
List<Queue> queueList = nodeConnector.getQueue();

for (Iterator<Queue> iterator3 = queueList.iterator(); iterator3.hasNext()

{ QueueKey queueKey = iterator3.next().getKey(); InstanceIdentifier<Queue> queueRef = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey) .augmentation(FlowCapableNodeConnector.class).child(Queue.class, queueKey).toInstance(); Queue queue = (Queue) dataProviderService.readOperationalData(queueRef); }

}
}
}

Regards
ANil

Comment by Anil Vishnoi [ 31/Jan/14 ]

Hi AnilG,

I followed the step you mentioned in the Description for creating queue and I tested this issue locally with the latest code from repo. When i directly fetch queue stats through RESTCONF, i am able to fetch the stats. I used following URI to fetch individual queue stats

URI:http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1/queue/0

Stats:
{
"flow-node-inventory:queue": [
{
"flow-node-inventory:queue-id": 0,
"opendaylight-queue-statistics:flow-capable-node-connector-queue-statistics": {
"opendaylight-queue-statistics:duration":

{ "opendaylight-queue-statistics:second": 4294967295, "opendaylight-queue-statistics:nanosecond": 4294967295 }

,
"opendaylight-queue-statistics:transmitted-bytes": 2331,
"opendaylight-queue-statistics:transmitted-packets": 37,
"opendaylight-queue-statistics:transmission-errors": 0
}
}
]
}

Can you please check by fetching queue/stats programmatically.

Thanks
AnilV

Comment by Anil Gujele [ 03/Feb/14 ]

Hi AnilV,

Verified, Now programatically also we are able to get the queue list from the port if there is any queue is added for the port.

– ANil

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