cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
3,230 Views
Registered: ‎12-15-2016

Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Upgrading our design to 2017.3 have revealed a possible bug in device tree generator.
In 2017.2 the generator generated the following dtsi for the DMA part of a 10G design.

 

hier_10g_eth_axi_dma_0: dma@80020000 {
        #dma-cells = <1>;
        clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", "m_axi_mm2s_aclk", "m_axi_s2mm_aclk";
        clocks = <&misc_clk_0>, <&misc_clk_0>, <&misc_clk_0>, <&misc_clk_0>;
        compatible = "xlnx,eth-dma";
        interrupt-parent = <&gic>;
        interrupts = <0 90 4 0 91 4>;
        reg = <0x0 0x80020000 0x0 0x10000>;
        xlnx,addrwidth = <0x24>;
        xlnx,include-sg ;
        dma-channel@80020000 {
                compatible = "xlnx,axi-dma-mm2s-channel";
                dma-channels = <0x1>;
                interrupts = <0 90 4>;
                xlnx,datawidth = <0x40>;
                xlnx,device-id = <0x0>;
                xlnx,include-dre ;
        };
        dma-channel@80020030 {
                compatible = "xlnx,axi-dma-s2mm-channel";
                dma-channels = <0x1>;
                interrupts = <0 91 4>;
                xlnx,datawidth = <0x40>;
                xlnx,device-id = <0x0>;
                xlnx,include-dre ;
        };
};


Switching to 2017.3 it generates the following DMA related dtsi and generates the error:
(phandle_references): Reference to non-existent node or label "hier_10g_eth_rx_data_fifo_0"

 

Currently I have problem

 

hier_10g_eth_axi_dma_0: dma@80020000 {
        #dma-cells = <1>;
        axistream-connected = <&hier_10g_eth_rx_data_fifo_0>;
        axistream-control-connected = <&hier_10g_eth_rx_data_fifo_0>;
        clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk";
        clocks = <&misc_clk_0>, <&misc_clk_0>;
        compatible = "xlnx,eth-dma";
        interrupt-parent = <&gic>;
        interrupts = <0 90 4 0 91 4>;
        reg = <0x0 0x80020000 0x0 0x10000>;
        xlnx,include-dre ;
};
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
4,392 Views
Registered: ‎12-15-2016

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Hi everybody.

 

The big problem was at my end, and the fix of device-tree compiler from @appanad works. So will send a pull request on github.

Part of the problem was a mac address class. So after finding this and carefully flush the arp tables we have success.

 

@stephenm thanks for your input - have given you kudos for your input.

 

Notice I am not quite happy with the performance - but it will do for now.

 

 

/mnt/qspi/bin # ./iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 172.16.5.154 port 5001 connected with 172.16.2.134 port 55604
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  2.61 GBytes  2.24 Gbits/sec
[  5] local 172.16.5.154 port 5001 connected with 172.16.2.134 port 55606
[  5]  0.0-10.0 sec  2.60 GBytes  2.23 Gbits/sec

View solution in original post

0 Kudos
9 Replies
Highlighted
Adventurer
Adventurer
3,158 Views
Registered: ‎12-15-2016

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Just for the record the error persist with 2017.4

0 Kudos
Highlighted
Moderator
Moderator
3,154 Views
Registered: ‎09-12-2007

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Can you share the HDF? 

0 Kudos
Highlighted
Adventurer
Adventurer
3,132 Views
Registered: ‎12-15-2016

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Hi @stephenm

 

Unfortunately, I cannot share our current hdf in a public forum. Have shared it with Xilinx, but will try to describe all the details in a number for posts, and my work on this issue. Both to help others and to keep some log of my findings / work.

 

Notice I am also writing mails with @appanad directly as he has made part of the code. I also got a patch attempt, making the dts to compile – unfortunately, it does not yet work. For reference the patch is here – https://github.com/frosteyes/device-tree-xlnx/commit/faa6f667930e49caaf04c5ae7f70ad405fc7a1fe

 

Yesterday he also wrote as answer to some question.

In 2017.3 driver expects xlnx, include-dre property in the Ethernet node.

In 2017.4 in the driver we have added multi queue support,

So from 2017.4 onwards it expects the xlnx, include-dre property in the AXI DMA node.

 

Back to the issue, and where I am - will provide it in next post shortly

0 Kudos
Highlighted
Adventurer
Adventurer
3,127 Views
Registered: ‎12-15-2016

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Looking at the tcl for the device-tree generator.

https://github.com/Xilinx/device-tree-xlnx/blob/master/axi_dma/data/axi_dma.tcl

From 2017.2 to 2017.3 we had the change.

https://github.com/Xilinx/device-tree-xlnx/commit/cc38c413fb748dec06eb57457505ed1e2ade6727#diff-e87500b52ba84559b740fd8e6390a2d1

 

Notice this commit disables the generation of dma-channel as subnode to the dma node for 10G xxv designs.

 

So in short, we are going from a working device-tree like this where I have removed all the non-essential parts.

 

hier_10g_eth_axi_dma_0: dma@80020000 {
        compatible = "xlnx,eth-dma";
        xlnx,include-sg ;
        ...
        dma-channel@80020000 {
                compatible = "xlnx,axi-dma-mm2s-channel";
                xlnx,include-dre ;
				...
        };
        dma-channel@80020030 {
                compatible = "xlnx,axi-dma-s2mm-channel";
                xlnx,include-dre ;
				...
        };
};

To a non-working device-tree with a single dma node without any dma channel subnodes.

 

hier_10g_eth_axi_dma_0: dma@80020000 {
		compatible = "xlnx,eth-dma";
		xlnx,include-dre ;
		...
};

Notice that the working version have include-dre for each channel as this is selected in the DMA ip core, and also it have Scatter gather in the top node as setup in the core. Where the new - non-working version just set "include-dre" on the top node.

 

10g_dma_setup.png

 

0 Kudos
Highlighted
Adventurer
Adventurer
3,116 Views
Registered: ‎12-15-2016

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

So looking at the kernel. First we look at the patch referenced in the device-tree generator commit.
https://github.com/Xilinx/linux-xlnx/commit/99d053bb0e87207e0177f8ac236477e812857aee

Notice I just converted the gitenterprise.xilinx.com address to the public github address.

 

It changes 3 files, where I am puzzled over why the device-tree commit changed the DMA node and this commit reference the axienet node. The 3 files.
Documentation/devicetree/bindings/net/xilinx_axienet.txt
drivers/net/ethernet/xilinx/xilinx_axienet.h
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

The kernel commit reference the bottom ethernet node, where the device tree changes the top dma node of the code below. Notice that they both continue the "include-dre" property.

 

hier_10g_eth_axi_dma_0: dma@80020000 {
		...
		axistream-connected = <&hier_10g_eth_xxv_ethernet_0>;
		axistream-control-connected = <&hier_10g_eth_xxv_ethernet_0>;
		....
		compatible = "xlnx,eth-dma";
		xlnx,include-dre ;
};
hier_10g_eth_xxv_ethernet_0: ethernet@80030000 {
		axistream-connected = <&hier_10g_eth_axi_dma_0>;
		axistream-control-connected = <&hier_10g_eth_axi_dma_0>;
		...
		compatible = "xlnx,xxv-ethernet-1.0";
		...
		xlnx,include-dre ;
		...
};

 

Continuing a bit with the dma node. Searching for any reference to the eth-dma as the compatible is set to in the linux kernel source returns nothing. - linux-xlnx$ grep -R eth-dma * returns nothing.

 

Looking at the device-tree documentation for the dma in the kernel

https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt

It shows that the dma-channel are mandatory subnodes for the dma node. And the compatible value of "axi-dma-mm2s-channel" and " axi-dma-s2mm-channel" is used to find the channel driver.

 

 

 

0 Kudos
Highlighted
Moderator
Moderator
3,114 Views
Registered: ‎09-12-2007

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

No Problem. I have an old design for the zc706 that I ported to 2017.3 (this is attached for you ref. build source the build_hw.tcl)

 

I created the HDF, and I cloned the xilinx-v2017.3 branch of the DTG to test:

To test, I created a simple HSI script to create the DT. Note: I just created a TCL script with the content below:

 

proc gen_dts {hdf} {
   open_hw_design $hdf
   set_repo_path ./repo
   create_sw_design device-tree -os device_tree -proc ps7_cortexa9_0
   generate_target -dir my_dts
}

 

gen_dts 10G_AXI_Eth/project_1.sdk/design_1_wrapper.hdf

 

This is created without any issue here.

 

 

10g.PNG

Highlighted
Adventurer
Adventurer
4,393 Views
Registered: ‎12-15-2016

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Hi everybody.

 

The big problem was at my end, and the fix of device-tree compiler from @appanad works. So will send a pull request on github.

Part of the problem was a mac address class. So after finding this and carefully flush the arp tables we have success.

 

@stephenm thanks for your input - have given you kudos for your input.

 

Notice I am not quite happy with the performance - but it will do for now.

 

 

/mnt/qspi/bin # ./iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 172.16.5.154 port 5001 connected with 172.16.2.134 port 55604
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  2.61 GBytes  2.24 Gbits/sec
[  5] local 172.16.5.154 port 5001 connected with 172.16.2.134 port 55606
[  5]  0.0-10.0 sec  2.60 GBytes  2.23 Gbits/sec

View solution in original post

0 Kudos
Highlighted
Moderator
Moderator
3,084 Views
Registered: ‎09-12-2007

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Great that you got this working.

 

What is your setup like? are you going board to board, or to your laptop?

0 Kudos
Highlighted
Adventurer
Adventurer
2,709 Views
Registered: ‎12-15-2016

Re: Devicetree Generator Fails with AXI 10G Ethernet

Jump to solution

Hi @stephenm

 

Just noticed I never answered you.

 

To all reading this thread - I have provided a number of patches for 10G to xilinx there will part of 2018.1.

 

Regarding the performance I have a number of workstations using Intel x520-da2  and x710-da2 I know is able to deliver 9.9 Gbps. So this is what I use for testing.

 

Though will create a new topic for bandwidth when I am ready to work with this.

0 Kudos