Code Monkey home page Code Monkey logo

sc_ethernet's People

Contributors

andrewstanfordjason avatar djpwilk avatar henkmuller avatar interactive-matter avatar mlippett avatar stefanharjes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sc_ethernet's Issues

Xmos Daisy Chain topology

I am connecting two daisy chain board each other without avb switch. One board is connected to linux machine (in which openavb is running).
I have two audio slice each connected to DC boards.
I want to record from 8 audio channels in which 4 channels per daisy chain board.
I want the setup like:
two DC as talkers and PC as listener.
But recorded signal does no look right form. I recorded simple 1khz sine wave.
I modified:
line 39: #define AVB_NUM_SOURCES 2
line 61: #define AVB_NUM_SINKS 2
in xmos source code.

xmos console output is as following:
PTP Port 0 Role: Master
PTP Port 1 Role: Master
Setting clock source: INPUT_STREAM_DERIVED
MAAP reserved Talker stream #0 address: 91:E0:F0:0:A0:56
MAAP reserved Talker stream #1 address: 91:E0:F0:0:A0:57
CONNECTING Talker stream #0 (229700617C0000) -> Listener 0:22:97:FF:FE:0:61:BC
MSRP: Register stream request 229700:617C0000
Added stream:
ID: 229700617C0000
DA:91:E0:F0:0:A0:56:
max size: 128
interval: 1
Talker stream #0 ready
Added stream:
ID: 22970061BC0000
DA:91:E0:F0:0:5F:CA:
max size: 128
interval: 1
CONNECTING Listener sink #0 -> Talker stream 22970061BC0000, DA: 91:E0:F0:0:5F:CA
Listener sink #0 chan map:
0 -> 0
1 -> 1
1722 router: Enabled map for stream 22970061BC0000 (link_num:0, hash:0)
MSRP: Register attach request 229700:61BC0000
Media output 0 locked: 166 samples shorter
Media output 1 locked: 166 samples shorter
PTP Port 1 Role: Slave
PTP Port 0 Role: Master
Media output 0 lost lock
Media output 1 lost lock
Media output 0 locked: 123 samples shorter
Media output 1 locked: 122 samples shorter
PTP sync locked
CONNECTING Talker stream #0 (229700617C0000) -> Listener A0:36:9F:FF:FE:4A:52:20
Added stream:
ID: 229700617C0000
Increasing port 1 shaper bandwidth to 10880000
Setting stream 0 1722 TX port to 1
Talker stream #0 on
Decreasing port 1 shaper bandwidth to 0
Talker stream #0 off
AP: MSRP_LISTENER 617C0000:1:0:0 MRP_EVENT_RECEIVE_LEAVE_ALL: MRP_LO -> MRP_UNUSED

in
1722 router: Enabled map for stream 22970061BC0000 (link_num:0, hash:0)
MSRP: Register attach request 229700:61BC0000
Media output 0 locked: 166 samples shorter
Media output 1 locked: 166 samples shorter
PTP Port 1 Role: Slave
PTP Port 0 Role: Master
Media output 0 lost lock
Media output 1 lost lock

I traced those messages and it is in media_clock_server.xc. There is some macros including stable threshold.
What is that threshold for? and min and max range?

What is the problem?

Thank you.

UDP connections from Windows XP

Using XC-2s to bridge networks.
Using the latest sc_ethernet for my bridging app, different OS(win7, vista, linux) can connect/transmit UDP with neglible transmission errors/loss due to my radio connection between the 2 XC-2s.
TCP-Connections behave as expected, little bit slower than pure UDP.

Common scenario includes, streaming 1 high bandwidth UDP stream or multiple slower UDP streams.

If Windows XP is used, UDP connections are notably slower, i.e. higher loss, lower sustainable bandwidth.

Promiscuous mode is selected and mac_filter should let everything through.

Ethernet server is started and mac_rx called, my processing done, mac_tx on other XC-2 executed.

Other OS behave as expected with same hardware/firmware.

README.rst summary table

Hi Dave,

Thanks for having a go at this - the formatting is off in the Brief description line. Can you also pls make it the last entry of the table?

Thanks,

-Mark

app_demo_code does not like my ping

Hi,

I am a bit desparied: I copied over the code of app_ethernet_demo to my led tile app. Works fine. But I cannot ping my device. I wanted to test the app_ethernet_demo on my XC-2 to verify that I got the same problem there. But it just crahses with an exception:
xrun: Program received signal ET_ECALL, Application exception.
[Switching to stdcore[2] hwthread 0]
I just used the binary build by using the module. I think XDE has simbly build the whole module.

I have debugged (as in inspecting the network packages) everything and my conclusion is:
a) the ICMP handler never finds the neccessary 0x01 at frame position 23 (which is the icmp check). Even with debugging I am not really able to find a ping package
b) I see that my ping packages al have a invalid header checksum (0) from my computer. Is there something in the ethernet stack which drops those kind of bad packages? I assume not, but nevertheless I am completely puzzled that I do not see my ping packages in the XDE debugger (ok, ethernet speed and XDE debugger speed do not really fit well together)

Thanks

Marcus

The pakage format is puzzling

While I am at it I am also complaining about the packet format for the ethernet packages:
a) it oscilates between MTU/4 int values and MTU chars - it is understandable, but is it possible to stick to one of them?
b) accessing the different header informations is a pain (for me high level guy ;) ). I do not really understand which package format this is. and by that I am not really able to understand which data is accessed in the different handler routines (currently I am asking myself why rxbuf[23] is not 0x01 even though I am bombarding my XMOS with ping packages. I would really appreciate if we could introduce some macros that explain which parts of the header are accessed.

In the old version (perhaps also the new version) of app_led_tile the package was mapped to a struct and those struct members then used to access the header - much more understandable. Unfortunalty something solely for C, not availaible in XC - at least from what I understand.

Use of MAC_PROMISCUOUS

I am trying to use MAC_PROMISCUOUS but it does not work as I expect it to.
Is it necessary to add a line:

--- a/module_ethernet/src/server/mii_filter.xc
+++ b/module_ethernet/src/server/mii_filter.xc
@@ -134,6 +134,7 @@ void one_port_filter(mii_packet_t buf[],

       if (i) {
 #ifdef MAC_PROMISCUOUS
+          buf[i].filter_result = mac_custom_filter(buf[i].data);
           add_queue_entry(internal_q,i);          
 #else
         if (is_broadcast(buf[i].data[0])          

(or just set it to 1!) ?

Is it possible that XC-3 with two channels does not work?

In the ap_led_tile I use two channels for rx & tx:

chan rx[2], tx[2];

par
{
  // Threads constrained by I/O or latency requirements
//the internal 3 port ethernet switch
  on stdcore[2]: {
      int mac_address[2];
    phy_init_two_port(clk_smi, p_mii_resetn, smi_0, smi_1, mii_0, mii_1);
      ethernet_server_two_port(mii_0, mii_1, mac_address, rx, 2, tx, 2, smi_0, smi_1, null);
  }
  on stdcore[2]: {
      ethSwitch(rx[0], rx[1], c_local_rx_in,
              tx[0], tx[1],c_local_tx,
              cWdog[0]);
  }

Which raises an illegal resource exception, discussed in this xcroe thread: https://www.xcore.com/forum/viewtopic.php?f=32&t=1586&start=0

The acommpanying code looks a lot like the bug reported here: https://www.xcore.com/forum/viewtopic.php?f=26&t=610&p=4527&hilit=illegal_resource#p4527

So is it possible that there is some bug with channels as arrays?

Multiple ethernet slice cards on a slice core board?

I am developing an application that requires the slice core board to have two ethernet ports. One port receives normal ethernet packets from a PC and transmits the same as an AVB packet via the other ethernet port.

How do I make the slice core board function with two ethernet slice cards? What changes do I make to make to the library to support the same?

Kindly help me on this regard.

Thanks a lot !

mii.xc build issue

Dave,

Yes, I know, I should be figuring out how to create a fork to report this. Anyway, around line 188 of mii.xc the source code is

    if (!dptr_hp) dptr_hp = dptr_lp;

This line gives me a compile error. I think it should instead be

ifdef ETHERNET_RX_HP_QUEUE

    if (!dptr_hp) dptr_hp = dptr_lp;

endif

Thanks,
Andrew

getmac.h/xc oddities

While trying to integrate the source I found an interesting contradiction btw. getmac.h:

void ethernet_getmac_otp_indexed(port otp_data, out port otp_addr, port otp_ctrl, int macaddr[], unsigned index);
void ethernet_getmac_otp_count(port otp_data, out port otp_addr, port otp_ctrl, int macaddr[][2], unsigned count);
void ethernet_getmac_otp(port otp_data, out port otp_addr, port otp_ctrl, char macaddr[]);

and the getmac.xc:

void ethernet_getmac_otp_indexed(port otp_data, out port otp_addr, port otp_ctrl, char macaddr[], unsigned index)
void ethernet_getmac_otp_count(port otp_data, out port otp_addr, port otp_ctrl, int macaddr[][2], unsigned count)
void ethernet_getmac_otp(port otp_data, out port otp_addr, port otp_ctrl, char macaddr[])

In the header file macaddr is always int, in the xc file always char. Interestingly enough the compiler has no problem with that - but using a consistent format would make it easier to understand (e.g. stopping me to open issues)

Function call parameter mismatch in two port MAC

How does this function call...

// In file: src/full/ethernet_server.xc    line #65
ethernet_tx_server(mac_address, tx, 2, num_tx, smi1, null);

... match the interface (below)...

// In file: src/full/ethernet_tx_server.xc    line #112
#pragma unsafe arrays
    void ethernet_tx_server(
#if ETHERNET_TX_HP_QUEUE
                        mii_mempool_t tx_mem_hp[],
#endif
                        mii_mempool_t tx_mem_lp[],
                        int num_q,
                        mii_ts_queue_t ts_queue[],
                        const char mac_addr[],
                        chanend tx[],
                        int num_tx,
                        smi_interface_t &?smi1,
                        smi_interface_t &?smi2)

The MAC address and queuing parameter positions are completely mismatched. How was this ever supposed to work?

Only "app_ethernet_tests" builds of the app

I'm a little new to the "dual layer makefiles", but when building the project, only the app_ethernet_tests builds, leaving the other applications unbuilt, is that the intention ?

Reading the "master" makefile, I understands it as:
app_ethernet_demo, app_ethernet_loopback and app_ethernet_tests
should build by default, but it doesn't !?

no XC-3 support

what's the reason for not supporting the dual ethernet board XC-3 with this module?
I see ethernet_server_two_port() and phy_init_two_port() in the code, but they are disabled.

What does NUM_MII_RX_BUF/NUM_MII_TX_BUF do & why is it important?

I have solved the mysteries of my issue #20:

I had to set

define NUM_MII_RX_BUF 5

define NUM_MII_TX_BUF 5

but I had set it to

define NUM_MII_RX_BUF 20

define NUM_MII_TX_BUF 2

(which I copied from some other ethernet_conf.h)

It took me 2! complete days to discover this. It would be extremely great to have some kind of warning like 'running out of tx buffers' or so. Because from anything in the source I was not able to tell what the problem was.

And what does 5 mean? 5 frames? 5 bytes?

I am a bit puzzled โ€ฆ

app_ethernet_demo may contain usefull code

Hi,

it is not really an issue that there is some useful code in app_ethernet_demo. But perhaps it should be availlable as a library of nice small helper functions. I think those functions are perhaps usefull for other applications (at least I think so for my app_led_tile):

is_ethertype (?)
is_mac_addr
is_broadcast

build_arp_response
is_valid_arp_packet

build_icmp_response
is_valid_icmp_packet
And perhaps the ARP/ICMP handling in the demo funxtion.

I will try to copy tht over to the app_led_tile and test if it works well enough for me. Then I will see it is worth a pull request for the sc_ethernet.

So you have to do nothing until I got more results ;)

Marcus

Is there a reason for so many MAC formats?

While browsing through the source and the demo source I have encountere three different formats for MAC addresses in the source code:
6 characters
6 int
2 int

Is it useful? It always puzzles me which format to use and how to reformat the mac address.
Or am I missing something completely.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.