S32G274 PFE1 cannot send and receive udp broadcast messages

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32G274 PFE1 cannot send and receive udp broadcast messages

1,066 Views
jack_huang1
Contributor III

  Dears;

         Description of the problem: S32G274 PFE1 cannot send and receive udp broadcast messages

         Test: The PC sends udp broadcast messages to execute the script python testudp.py

          See Attachment 1 for PFE1 configurations.

       

jack_huang1_0-1706863226110.jpeg

 

Executed on the S32G274
root@s32g274acicvd2:~# tcpdump udp port 5432

tcpdump: verroot@s32g274acicvd2:~# tcpdump udp port 5432tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

listening on pfe1, link-type EN10MB (Ethernet), capture size 262144 bytes

No news

However, other devices on the same network segment can receive broadcast messages

    See Attachment 2.

    Please take a look at this problem to see if the network configuration prohibits broadcasting, and the firewall is still in the same state.

 

    Thank you!

 Best Regards!

0 Kudos
10 Replies

793 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @jack_huang1

Thanks for reply and the logs shared.

  1. As I mentioned previously, the test I had done is based on pre-built images of BSP34.2, I did not change any of the source code including the firmware images, the only change is the uboot env to enable the PFE1 since by default PFE1 is disabled.
  2. For PFE driver/dts I used, my Linux git tag used should be:

commit 0b76731696c17e9bae9f61ba568fc73aeaa83244 (HEAD, tag: bsp34.2-5.10.120-rt, tag: bsp34.0.1-5.10.120-rt, tag: bsp34.0-5.10.120-rt)

The customer may checkout this tag(git checkout bsp34.2-5.10.120-rt) to compare the source code/dts if any differences found.

  1. I have read the logs from customer, and have the following questions to clarify:

3.1 The board, as the customer ever mentioned, they are testing this feature with a RDB, would you please help to double check if they are using a S32G2RDB2 or a custom board to test?

3.2 If it is a RDB2, the software images used from customer may be built from their own since I found there are much differences from their booting logs, May I know if it is possible to test it with the pre-built images to have an apple to apple comparison?(full images, not only the kernel/dts, but tfa/uboot)

3.3 If it is a custom board, may I know if the ethernet PHY used is different from the RDB one?

4. I have checked the PFE FW images from the customer, which is the same with the one I used, it is 1.4.0 images.

I will continue investigating the log to check if there are any further findings.

 

Best Regards

Chenyin

0 Kudos

858 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @jack_huang1

 

Thanks for the reply.

Prior to the test, may I know if the customer ever tested the default pre-built images on your board the same as what I used? Are there any issues found either?

 

Best Regards

Chenyin

0 Kudos

804 Views
jack_huang1
Contributor III

Dear;

         Is based on Boot_log_BSP34_S32G2_broadcast_test.txt test only changed the uboot env to the same configuration as you switched to pfe1, and then the test still can not send and receive broadcast messages.

         1. You can compare the firmware I sent you with the pfe firmware you used
         2. Can you send the pfe driver source code you use? Compare and contrast;
         3. If possible, please use pfe1 to re-test the broadcast and capture a screenshot after receiving the message and capturing a tcpdump package, thank you very much!

        The kernel dts configuration is as follows:

&pfe {

        nxp,pfeng-hif-channels = <PFE_HIF_CHANNEL_0>,

                                                 <PFE_HIF_CHANNEL_1>;

 

        status = "okay";

        pinctrl-names = "default";

        pinctrl-0 = <&pfe1mdioc_pins>,

                    <&pfe1rgmiic_pins>;

};

 

// pfe0 disabled

&pfe_netif0 {

        status = "disabled";

};

 

// Network interface 'pfe1'

&pfe_netif1 {

        phy-mode = "rgmii-id";

        fixed-link {

                speed = <1000>;

                full-duplex;

        };

};

 

// pfe2 disabled

&pfe_netif2 {

        //phy-handle = <&mdio_b_phy4>;

        status = "disabled";

};

 

&pfe_mdio0 {

        /* unused */

        status = "disabled";

};

 

&pfe_mdio1 {

        status = "okay";

};

 

&pfe_mdio2 {

        status = "disabled";

};

 

           Best Regards!

0 Kudos

799 Views
jack_huang1
Contributor III

Dear;

          Add kernel&uboot log information, see attachment! Thank you!

0 Kudos

860 Views
jack_huang1
Contributor III

Dear ;

          The same uboot env has been modified, but there is still the same problem. Please send the pfe firmware and the modified uboot image to the attachment. Please check if there is anything different from your Settings.

Uboot env:

pfe1_phy_addr=8

pfe1addr=00:01:be:be:ef:22

pfe2addr=00:01:be:be:ef:33

pfeaddr=00:01:be:be:ef:11

pfeng_mode=enable,none,sgmii,rgmii

pfengemac=0

pfengfw=mmc@0:3:/lib/firmware/s32g_pfe_class.fw

preboot=sf probe 6:1; sf mark;

ramdisk_addr=0x90000000

s32cc_gmac_mode=enable

hwconfig=pcie0:mode=pcie,clock=ext;pcie1:mode=rc&sgmii,clock=int,fmhz=100,xpcs_mode=1

 

Pfe1 config:

root@s32g274acicvd2:~# ifconfig

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

inet 127.0.0.1 netmask 255.0.0.0

inet6 ::1 prefixlen 128 scopeid 0x10<host>

loop txqueuelen 1000 (Local Loopback)

RX packets 557774 bytes 58349060 (55.6 MiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 557774 bytes 58349060 (55.6 MiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

pfe1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255

inet6 fe80::9a:cdff:fe00:1 prefixlen 64 scopeid 0x20<link>

ether 02:9a:cd:00:00:01 txqueuelen 1000 (Ethernet)

RX packets 54125 bytes 25997549 (24.7 MiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 77032 bytes 26437355 (25.2 MiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

device memory 0x46000000-46ffffff

 

Configuration file:

root@s32g274acicvd2:~# cat /etc/systemd/network/10-pfe1.network

[Match]

Name=pfe1

KernelCommandLine=!root=/dev/nfs

[Network]

DHCP=no

Address=192.168.1.1/24

[Route]

Gateway=192.168.1.2

root@s32g274acicvd2:~#

        Please see the attachment for u-boot-flash and fiwmare-pfe. Please find out where the configuration problem is now, thank you!

 

     Best Regards!

 

      

0 Kudos

1,009 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @jack_huang1

 

Thanks for the reply.

I was using the pre-built images of BSP34.2, the firmware version information are shown below from the Release_Notes

chenyin_h_0-1707211960846.png

 

By default, the PFE1 is disabled.

In order to use PFE1 for the test which could closely match the customer’s situation, I modified the uboot env with the following:

hwconfig=pcie0:mode=pcie,clock=ext;pcie1:mode=rc&sgmii,clock=int,fmhz=100,xpcs_mode=1

pfeng_mode=enable,none,sgmii,rgmii

Then, after booting the Linux, the PFE1 could be used correctly.

Hope it helps.

 

Best Regards

Chenyin

0 Kudos

1,019 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @jack_huang1

Thank you for the reply.

I had tested it with PFE1 enabled, but do not find any issues of the broadcast function, attached is the full logs for your reference.

(I did not use the python script from customer on RDB2(TX test), since lacking of corresponding module in python, as a result, I use a application with the same functionality compiled from C source code. For RX test, I used the same python code from the customer).

 

Best Regards

Chenyin

0 Kudos

1,011 Views
jack_huang1
Contributor III

Dear;

        Excuse me. Is your software version and firmware version s32g-bsp34+ pfe1 firmware version1.4.0?
How did you enable pfe1 here? How exactly do you modify PFE1? Thank you!

 

      Best Regards!

0 Kudos

1,051 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @jack_huang1

Thank you for the question

  1. I tested the broadcast feature with default SDK settings(pfe0 enabled, while pfe1 disabled), directly connected the pfe0 to the network interface on another machine, with the python code from user, the test is running without issues. (The PFE0 could send and receive broadcast packets correctly).

root@s32g274ardb2:~#   tcpdump udp port 5432

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

listening on pfe0, link-type EN10MB (Ethernet), capture size 262144 bytes

 

17:26:53.365798 IP 192.168.1.100.39829 > 192.168.1.255.5432: UDP, length 13

  1. From the logs attached from customer, seems they were not using the default ethernet configurations, could you please help to clarify the settings? Like hwconfig and corresponding ethernet parameters in u-boot env.

 

Best Regards

Chenyin

0 Kudos

1,030 Views
jack_huang1
Contributor III

Dear;

         

We are using pfe1. Could you please help check whether there is any problem with the configuration of pfe1?
The contents of testudp.py are as follows:

import socket

 

# Create UDP Socket

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

 

#  If SO_BROADCAST is set to True, the broadcast function is enabled

sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)

 

# Define the destination IP address and port number

#target_ip = '255.255.255.255' # The default broadcast address is used here

target_ip = '255.255.255.255' # The default broadcast address is used here

port = 5432

 

# Construct the data to be sent

message = b"Hello, World!"

 

try:

    #Send broadcast messag

    sock.sendto(message, (target_ip, port))

except Exception as e:

    print("Error occurred while sending broadcast message:", str(e))

finally:

    # Close Socket

    print("sending broadcast message successful and close")

    sock.close()

The dmesg log of pfe1 is as follows (see the attached log).:

root@s32g274acicvd2:~# dmesg | grep pfe1

[    8.719350] pfeng 46000000.pfe: netif name: pfe1

[    8.719368] pfeng 46000000.pfe: netif(pfe1) mode: std

[    8.719375] pfeng 46000000.pfe: netif(pfe1) EMAC: 1

[    8.719384] pfeng 46000000.pfe: netif(pfe1) HIFs: count 1 map 02

[    8.802388] pfeng 46000000.pfe pfe1: registered

[    8.802404] pfeng 46000000.pfe pfe1: Subscribe to HIF1

[    8.802847] pfeng 46000000.pfe pfe1: Enable HIF1

[    8.803029] pfeng 46000000.pfe pfe1: setting MAC addr: 00:01:be:be:ef:22

[    8.803064] pfeng 46000000.pfe pfe1: PTP HW addend 0x80000000, max_adj configured to 46566128 ppb

[    8.803688] pfeng 46000000.pfe pfe1: Registered PTP HW clock successfully on EMAC1

[    8.826586] pfeng 46000000.pfe: Logical interface s8.pfe1 created in emac1

[    8.837868] pfeng 46000000.pfe: New match rules 0x40000400 set to s8.pfe1

[   18.737305] pfeng 46000000.pfe pfe1: configuring for fixed/rgmii-id link mode

[   18.737561] pfeng 46000000.pfe pfe1: Link is Up - 1Gbps/Full - flow control off

[   18.737831] IPv6: ADDRCONF(NETDEV_CHANGE): pfe1: link becomes ready

[   20.108322] device pfe1 entered promiscuous mode

[   24.634016] pfeng 46000000.pfe pfe1: Link is Down

[   24.639302] pfeng 46000000.pfe pfe1: setting MAC addr: 02:9a:cd:00:00:01

[   24.644103] pfeng 46000000.pfe pfe1: configuring for fixed/rgmii-id link mode

[   24.644400] pfeng 46000000.pfe pfe1: Link is Up - 1Gbps/Full - flow control off

[   25.639644] IPv6: ADDRCONF(NETDEV_CHANGE): pfe1: link becomes ready

 

          Thank you!

      Best Regards!

 

 

0 Kudos