Question about send_packet in ethernet MAC lib 3.0.1

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Post Reply
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Question about send_packet in ethernet MAC lib 3.0.1

Post by gerrykurz »

The send_packet function has a parameter called ifnum which from the documentation is
ifnum The index of the MAC interface to send the
packet Use the ETHERNET_ALL_INTERFACES define to send to all interfaces.
How do I get the index of a MAC interface?

In my application, I am using three instances of the MAC interface.


srinie
XCore Addict
Posts: 158
Joined: Thu Mar 20, 2014 8:04 am

Post by srinie »

Hi,
I do not ve a feedback on this, but am curious to know a couple of things.

Which version of mac you are using (excluding the rgmii one since it uses 1 tile for it)?
(should be raw mii or 100 mbps standard one)?


From the task diagram, the application connects to an instance of MAC using ethernet_tx_if. Not fully clear from the documentation whether the application need to handle data between multiple MACs or mii buffering takes care of this.

============================

My understanding is that the current state of the code does not seem to use this!!!

inline void send_packet(client ethernet_tx_if i, char packet[n], unsigned n,
unsigned ifnum) {
i._init_send_packet(n, ifnum);
i._complete_send_packet(packet, n, 0, ifnum);

---------------

case i_tx[int i]._complete_send_packet(char data[n], unsigned n,
int request_timestamp,
unsigned dst_port):
memcpy(txbuf, data, n);
i_mii.send_packet(txbuf, n);
// wait for the packet to be sent
mii_packet_sent(mii_info);
break;

==============
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Post by gerrykurz »

I am using one instance of the real time mac and two instances of the regular 100 mbps.

And yes, I am a bit confused about the ifnum parameter and how it may or may not apply to multiple mac instances.

The only example in the documentation is using the ETHERNET_ALL_INTERFACES define for this parameter but they don't say what this would do in a multiple mac configuration.
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Post by gerrykurz »

Here is a bit more information about my application.

All three mac instances are running on different tiles. I have four tiles (two L16 parts) in my application.
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Post by gerrykurz »

Here is the answer to this question from XMOS:

The ifnum parameter is not currently used but is reserved for potential use in future versions of the MAC.
Dukuu
Junior Member
Posts: 4
Joined: Thu May 19, 2016 1:52 pm

Post by Dukuu »

gerrykurz wrote:Here is the answer to this question from XMOS:

The ifnum parameter is not currently used but is reserved for potential use in future versions of the MAC.
Thanks for that answer! I was looking through the code, where this "ifnum" is used, and did not find. Great, that you answered this here. Sad, that it is not described in any docs.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

It's worth noting that there was a dual-port version of the ethernet MAC that was used for the Daisy Chain AVB. This support is not in the latest version of the ethernet MAC, but that is the reason that the argument is in the API - so it doesn't have to change to support multi-ported MAC.

In the dual-port MAC the "ifnum" argument could be used to control which interface a packet was sent on. Either a specific interface or all interfaces in the case of a broadcast.
Post Reply