Discussion:
[etherlab-dev] Problem to get VoE Data (Etherlab master patchset 20160804)
Christoph Schroeder
2017-01-18 16:25:52 UTC
Permalink
Hi,

I am currently testing the patchset 20160804 and encountered a problem
introduced by 0005-Support-for-multiple-mailbox-protocols.patch. It's
not possible to retrieve the data via the libraries
"ecrt_voe_handler_data" function anymore after a successful
ecrt_voe_handler_read. I still get the correct data size but there is no
data found at the returned pointer address.

I guess this is the problem:
"The mailbox state machines will check and fetch the data from their own
buffer instead of the datagram buffer (that is no longer used for
mailbox read data)."

The data seems to be stored somewhere else now and the function still
returns a pointer to a datagram buffer. Communication still works and
the data is there inside the master as debuglevel=1 prints the correct
data into the kernel log. I found the lines were this is done in the new
introduced "ec_voe_handler_state_read_response_data", but how can I
access the data from the library without using ioctl calls from my user
application? I would appreciate any hint or an update of the patch.


Thanks and best regards,
Christoph

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Karl Eugen Huthmacher, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de
Gavin Lambert
2017-01-19 00:09:00 UTC
Permalink
Post by Christoph Schroeder
I am currently testing the patchset 20160804 and encountered a problem
introduced by 0005-Support-for-multiple-mailbox-protocols.patch. It's not
possible to retrieve the data via the libraries "ecrt_voe_handler_data"
function anymore after a successful ecrt_voe_handler_read. I still get the
correct data size but there is no data found at the returned pointer address.
"The mailbox state machines will check and fetch the data from their own
buffer instead of the datagram buffer (that is no longer used for mailbox
read data)."
The data seems to be stored somewhere else now and the function still
returns a pointer to a datagram buffer. Communication still works and the
data is there inside the master as debuglevel=1 prints the correct data into
the kernel log. I found the lines were this is done in the new introduced
"ec_voe_handler_state_read_response_data", but how can I access the
data from the library without using ioctl calls from my user application? I
would appreciate any hint or an update of the patch.
Try the following changes (sorry, can't generate a patch right now):

* voe_handler.c:372: "mbox_coe_data" should be "mbox_voe_data".

* voe_handler.c:500: add:
memcpy(voe->datagram.data + EC_MBOX_HEADER_SIZE, data, data_size);

* voe_handler.c:608: same here.

Give this a try and let me know if it helps, or if further changes are required, and I can update the patchset accordingly.
Christoph Schroeder
2017-01-19 15:28:33 UTC
Permalink
Hi Gavin,

that worked, I had to add some minor changes:
memcpy(voe->datagram.data + EC_MBOX_HEADER_SIZE, data, data_size);
=>
memcpy(voe->datagram.data + EC_MBOX_HEADER_SIZE, data, voe->data_size +
EC_VOE_HEADER_SIZE);
The VoE header is taken into account here by ecrt_voe_handler_data and
there is also ecrt_voe_handler_received_header so the VoE header has to
be copied too.

Best regards,
Christoph
Post by Gavin Lambert
Post by Christoph Schroeder
I am currently testing the patchset 20160804 and encountered a problem
introduced by 0005-Support-for-multiple-mailbox-protocols.patch. It's not
possible to retrieve the data via the libraries "ecrt_voe_handler_data"
function anymore after a successful ecrt_voe_handler_read. I still get the
correct data size but there is no data found at the returned pointer address.
"The mailbox state machines will check and fetch the data from their own
buffer instead of the datagram buffer (that is no longer used for mailbox
read data)."
The data seems to be stored somewhere else now and the function still
returns a pointer to a datagram buffer. Communication still works and the
data is there inside the master as debuglevel=1 prints the correct data into
the kernel log. I found the lines were this is done in the new introduced
"ec_voe_handler_state_read_response_data", but how can I access the
data from the library without using ioctl calls from my user application? I
would appreciate any hint or an update of the patch.
* voe_handler.c:372: "mbox_coe_data" should be "mbox_voe_data".
memcpy(voe->datagram.data + EC_MBOX_HEADER_SIZE, data, data_size);
* voe_handler.c:608: same here.
Give this a try and let me know if it helps, or if further changes are required, and I can update the patchset accordingly.
________________________________

Helmholtz-Zentrum Berlin fÃŒr Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Karl Eugen Huthmacher, stv. Vorsitzende Dr. Jutta Koch-Unterseher
GeschÀftsfÌhrung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de
Gavin Lambert
2017-01-19 22:34:14 UTC
Permalink
Post by Gavin Lambert
Post by Gavin Lambert
* voe_handler.c:372: "mbox_coe_data" should be "mbox_voe_data".
memcpy(voe->datagram.data + EC_MBOX_HEADER_SIZE, data, data_size);
* voe_handler.c:608: same here.
memcpy(voe->datagram.data + EC_MBOX_HEADER_SIZE, data, data_size);
=> memcpy(voe->datagram.data + EC_MBOX_HEADER_SIZE, data, voe-
Post by Gavin Lambert
data_size + EC_VOE_HEADER_SIZE); The VoE header is taken into account
here by ecrt_voe_handler_data and there is also
ecrt_voe_handler_received_header so the VoE header has to be copied too.
Sorry, I meant rec_size rather than data_size.

rec_size == voe->data_size + EC_VOE_HEADER_SIZE already, since voe->data_size isn't actually assigned until that line.
Loading...