Skip to content

Conversation

@sihuihan88
Copy link

Failing to include port_number when calling dp_poll in verify_packet_any_port, will result in dataplane warning as follows:

"dataplane : WARNING : Dataplane poll with exp_pkt but no port number "

Copy link
Member

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible that the current implementation is not ideal, but what you are proposing is definitely wrong IMO. I don't think port_number can be an iterable object.

"""
logging.debug("Checking for pkt on device %d, port %r", device_number, ports)
result = dp_poll(test, device_number=device_number, exp_pkt=pkt, timeout=1)
result = dp_poll(test, device_number=device_number, exp_pkt=pkt, timeout=1, port_number= ports)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whitespace is wrong

@sihuihan88
Copy link
Author

Could you elaborate a little bit on why the current fix is wrong? IMO To prevent having this warning when calling verify_packet_any_port, we should pass the right value to the port_number argument when it calls dp_poll.

@antoninbas
Copy link
Member

antoninbas commented Jun 7, 2017

dp_poll(test, device_number=device_number, exp_pkt=pkt, timeout=1, port_number=ports)

You pass ports as port_number, but ports is an iterable object, like a Python list. I believe dp_poll expects a single integer for port_number (see https://github.com/p4lang/ptf/tree/master/src/ptf#L815). I don't see how your fix can even work. If you are convinced that your change is correct, maybe you could add a unit test there: https://github.com/p4lang/ptf/blob/master/ptf_nn/ptf_nn_test/test.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants