This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3356: CPSW LLDP

Part Number: AM3356

CPSW working mode is switch.

LLDP packets are broadcast packets, and the current project needs to send them to the specified port.

LLDP packets received by P1 are only forwarded to P0

LLDP packets received by P2 are only forwarded to P0

LLDP packets sended by P0 are only forwarded to P1 or P2

How to configure CPSW related registers?

SDK version:ti-processor-sdk-linux-rt-am335x-evm-07.03.00.005

  • LLDP packets sended by P0 are only forwarded to P1 or P2 。 I've solved it

    LLDP packets received by P1 are only forwarded to P0

    LLDP packets received by P2 are only forwarded to P0

    How to configure CPSW related registers?

  • Hello Jou baron,

    Thank you for the Query, inputs and working towards resolving some of the issues.

    I am reassigning the thread to the CPSW expert for support.

    Please expect a delay in response as i reassign the thread.

    Regards,

    Sreenivasa

  • Hello ,

    Have you made any progress on this issue

  • Hello Jou baron,

    Thank you for checking.

    The CPSW expert works out of Dallas and i have assigned your query to the expert.

    As i said in the above reply, Please expect a delay in response as i reassign the thread.

    Regards,

    Sreenivasa

  •                                         Figure 1

                                       Figure 2

    I configured it as shown in Figure 2, but it didn't work。

    Do it need other configurations?

  • Hi,

    Are you using this link from the SW developer's guide to configure  the CPSW ALE?

    Could you show the steps that you did to setup the CPSW?

    Best Regards,

    Schuyler

  • struct net_switch_config cmd_struct;
    struct ifreq ifr;
    int sockfd;
    strncpy(ifr.ifr_name, "eth0", IFNAMSIZ);
    ifr.ifr_data = (char*)&cmd_struct;
    if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
        printf("Can't open the socket\n");
        return -1;
    }
    memset(&cmd_struct, 0, sizeof(struct net_switch_config));

    cmd_struct.cmd = CONFIG_SWITCH_ADD_MULTICAST;
    cmd_struct.addr[0] = 0x01;
    cmd_struct.addr[1] = 0x80;
    cmd_struct.addr[2] = 0xc2;
    cmd_struct.addr[3] = 0x00;
    cmd_struct.addr[4] = 0x00;
    cmd_struct.addr[5] = 0x0e;
    cmd_struct.port = 0x03;
    cmd_struct.vid = 0x01;
    cmd_struct.super = 0x00;


    if (ioctl(sockfd, SIOCSWITCHCONFIG, &ifr) < 0) {
            printf("Command failed\n");
            close(sockfd);
            return -1;
        }


    cmd_struct.cmd = CONFIG_SWITCH_ADD_MULTICAST;
    cmd_struct.addr[0] = 0x01;
    cmd_struct.addr[1] = 0x80;
    cmd_struct.addr[2] = 0xc2;
    cmd_struct.addr[3] = 0x00;
    cmd_struct.addr[4] = 0x00;
    cmd_struct.addr[5] = 0x0e;
    cmd_struct.port = 0x05;
    cmd_struct.vid = 0x02;
    cmd_struct.super = 0x00;


    if (ioctl(sockfd, SIOCSWITCHCONFIG, &ifr) < 0) {
            printf("Command failed\n");
            close(sockfd);
            return -1;
        }    
        
    printf("command success\n");
    close(sockfd);

  • Hi,

    After looking at this again are you using VLANs in the switch config commands based on the diagram posted at the beginning of the thread? This diagram is showing how dual mac mode is implemented in the switch. Please try the command again with VLAN ids.

    Best Regards,

    Schuyler

  • I do not configure VLAN for dual mac.


    My functional requirements:
    LLDP packets are broadcast packets, and the current project needs to send them to the specified port. The destination MAC of lldp packets is 01:80:c2:00:00:0e. Lldp packets without VLAN tag.

    1. CPSW working mode is switch.
    2. LLDP packets received by P1 are only forwarded to P0
    3. LLDP packets received by P2 are only forwarded to P0

    Whether the function can be realized, and if so, how to configure it

  • 4. Other data exchanges of P0, P1 and P2 cannot be affected, and the switch function needs to exist