Can not access Raw Socket packets inside LS1088-ARDB

cancel
Showing results for 
Search instead for 
Did you mean: 

Can not access Raw Socket packets inside LS1088-ARDB

3,331 Views
janarbek_matai
Contributor III

Hi All,

I have a simple application as folows:

Sender: Sender puts ethernet packet in the form of  ethernet header + payload (it is a non-standard frame meaning that it does not include IP/TCP/UDP header), and uses raw sockets to send it over the network to LS1088ARDB.

Reciever: Receiver runs on LS1088ARDB, and it uses raw sockets to receive the data. However, I am not getting any data.  My Sender/Receiver applications works perfectly find on a standard Linux PCs.  But it is not working on LS1088-ARDB, and I am wondering if there is a setting in MC/DPAA2 that drops non-standard ethernet frames?  

Labels (1)
7 Replies

2,956 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Janarbek Matai,

Recently we add "Soft Parser Support" in the latest LSDK 1812 release.

SPC(Soft Parser Configuration) tool allow users to extend the hard parser's capabilities to support custom protocols that are not supported by the hardware parser.

The soft parser tool defines custom protocols using xml files, based on the NetPDL standard.

 

The architecture of SPC on DPAA 2.x is based on using an offline tool to take in a text-based description of the protocol(s) to be parsed and produce a blob for Management Complex (MC) to load.

Loading of the blob is done at system boot by U-Boot. There is one blob per system and the soft parser sequence(s) can be used on any of the interfaces (physical ports or internal links).

 

A soft parser blob is a binary file that encapsulates the entire configuration required to configure the Soft Parser HW module: custom protocols bytecode, SP protocols configuration, SP parameters, and soft parser hardware configuration. The soft parser blob file is generated by the SPC (Soft Parser Configuration) Tool. MC can be used to apply an SP Blob on hardware by using U-Boot command line.

 

For details, please refer to the section "8.3.7.1 Soft Parser Configuration Tool" and "

8.3.7.2 SPC on DPAA 2.x Based Platforms" in LSDK 1812 user manual which could be downloaded from Layerscape SDK | NXP 


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

2,956 Views
janarbek_matai
Contributor III

Hi Yiping,

I am trying to understand the usage of SPC tool.

To configure the Soft Parser, we are (overall) required following steps:

1) Use the SPC tool to create a blob of custom protocol based on XML file based desription of the custom protocol.

2) Load the blob in MC in U-boot.

Question 1) Am I correct ?

Question 2) Is there an example of XML file to describe a custom protol? 

Thanks in advance.

0 Kudos

2,956 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Janarbek Matai,

Yes, correct, please refer to the attached XML sample file.


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,956 Views
janarbek_matai
Contributor III

Hi Yiping Wang,

Thank you for answering my question. How am I going to access Soft Parser from a Linux which is built using Yocto  2.5?  Or does the source code of Soft Parser is available so that I can build it for my Linux?

0 Kudos

2,956 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please download SPC tool with the following address.

$ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/spc -b LSDK-18.12


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

2,956 Views
janarbek_matai
Contributor III

Great! Really apprecaite for the response. 

Is it possible to cross-compile the SPC tool for a Linux running on LS1088ARDB? My Linux on my LS1088ARDB is created by Yocto 2.5. 

If not, how are we going to use SPC tool in Linux that is generated by Yocto 2.5?

Issuing a make (Cross compiler is from Yocto SDK) gives me following error inside the spc/source directory.

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

lhdev@lhdev-VirtualBox:~/sdk/dev/spc/source$ make
aarch64-fsl-linux-g++  --sysroot=/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb  -O2 -pipe -g -feliminate-unused-debug-types  -DSPC_LINUX -O2 -D__STDC_LIMIT_MACROS -I/usr/include -I/usr/include/libxml2 -I./include/net   -c -o libspc.o libspc.cpp
cc1plus: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories]
In file included from /usr/include/features.h:367:0,
                 from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/aarch64-fsl-linux/bits/os_defines.h:39,
                 from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/aarch64-fsl-linux/bits/c++config.h:533,
                 from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/bits/exception.h:38,
                 from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/typeinfo:34,
                 from libspc.cpp:29:
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/sys/cdefs.h:467:49: error: missing binary operator before token "("
 #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
                                                 ^
In file included from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/cstdlib:75:0,
                 from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/ext/string_conversions.h:41,
                 from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/bits/basic_string.h:6349,
                 from /home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/c++/7.3.0/string:52,
                 from libspc.cpp:32:
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:133:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:139:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:145:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:151:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:157:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:163:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:169:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:211:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:225:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:231:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:237:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:243:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:249:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:255:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/home/lhdev/sdk/esdk/tmp/sysroots/ls1088ardb/usr/include/stdlib.h:261:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
In file included from libspc.cpp:36:0:
GenericError.h:33:10: fatal error: libxml/parser.h: No such file or directory
 #include <libxml/parser.h>
          ^~~~~~~~~~~~~~~~~

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

Thanks,

JM.

0 Kudos

2,956 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to INSTALL file in spc source folder, please refer to the following Makefile provided in flexbuilder.


         export LDFLAGS="-L$(RFSDIR)/lib -L$(RFSDIR)/lib/aarch64-linux-gnu -L$(RFSDIR)/usr/lib \
         -Wl,-rpath=$(RFSDIR)/lib/aarch64-linux-gnu:$(RFSDIR)/usr/lib/aarch64-linux-gnu" && \
         $(MAKE) LIBXML2_HEADER_PATH=$(RFSDIR)/usr/include/libxml2 \
         TCLAP_HEADER_PATH=$(RFSDIR)/usr/include \
         NET_USPACE_HEADER_PATH=$(FBDIR)/packages/apps/spc/source/include/net \
         CXX=$(CROSS_COMPILE)g++ CC=$(CROSS_COMPILE)gcc -C spc/source


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------