Post Go back to editing

Using switch to extend number of network ports in host processor

Thread Summary

The user is using the ADIN6310 switch to expand network ports in an embedded Linux system, aiming to isolate L2 and L3 traffic between ports and tag ingress traffic for differentiation. The final answer provides an example configuration using Logical MAC groups and static table entries to achieve this, confirming that the approach works for both L2 and L3 traffic. The user also inquired about using the extended table for L3 traffic routing and ensuring egress to specific ports.
AI Generated Content
Category: Software
Product Number: ADIN3310
Software Version: 5.0

We are currently using the ADIN6310 switch as a way to expand the number of network ports in our existing embedded Linux product as well as utilise some of the high level features to off load these from our main processor.

I am currently using Logical Mac groups as well as adding an entry into the static table for each of the mac groups to let all mac addresses pass through (passing 00:00:00:00:00:00 in MAC address mask) the specific network port and adding a tag on ingress.

These features seem to be targeting L2 traffic however for our use case we would like to use these features for L3 traffic also.

This is currently working for both L2 and L3 traffic and I have validated with basic network packets (Ethernet & IP) however have not yet done extensive testing. There is no documentation outlining this and I was just wondering if this is an expected use case for this switch and if there are any other features I could be utilising for this?

Thank you.

Edit Notes

Added more detail for clarity
[edited by: harrisonNoja at 7:10 AM (GMT -5) on 27 Nov 2025]
Parents
  • Hi Harrison,

    The Logical MAC are primarily validated for Layer 2 traffic.

    Applying ingress tag for Layer 3 traffic can still work, although this behavior has not been extensively tested.

    Could you confirm if I understand that the main goal is to expand network ports for the host? Is tagging ingress traffic a strict requirement?

    This will help me recommend other features for your use case.

    Thanks,

    Karl

  • Hi Karl,

    Thanks for getting back to me.

    That is correct, the main goal is to expand the network ports for the host. Tagging is not a strict requirement, only that the network traffic from the ports should be completely isolated from each other on both ingress and egress.

    I have looked into using VLAN for this but we currently have customers who use VLANs with our device and and from my understanding the switch can only tag untagged packets.

    Thanks 

  • I think you can use the forward mask (SES_ApplyForwardMask) for the network ports.

    You can configure the API so that incoming frames on the extended network ports to only forwarded to the host port.

    For example, if Port 0 is the host port, and the other ports are the extended network ports, you can configure SES_ApplyForwardMask(SES_macPort1, 0x01).
    Repeat this for each extended network port, such as SES_macPort2, SES_macPort3, and so on.
    For frames going from the host to the extended network ports, you would have to install extended table entries.

    Could you share more details about your system?

    This will help me better understand your requirements

    Also, are you using extended table to route L3 traffic?

Reply
  • I think you can use the forward mask (SES_ApplyForwardMask) for the network ports.

    You can configure the API so that incoming frames on the extended network ports to only forwarded to the host port.

    For example, if Port 0 is the host port, and the other ports are the extended network ports, you can configure SES_ApplyForwardMask(SES_macPort1, 0x01).
    Repeat this for each extended network port, such as SES_macPort2, SES_macPort3, and so on.
    For frames going from the host to the extended network ports, you would have to install extended table entries.

    Could you share more details about your system?

    This will help me better understand your requirements

    Also, are you using extended table to route L3 traffic?

Children
  • From my understanding using the forward mask would not add a tag to the end of the packet meaning the host processor couldn't differentiate which network port on the switch the packet originated from.

    Currently I am only using Logical mac groups and static table entries, on ingress a tail is added to both L2 and L3 traffic so that host processor can differentiate which port the packet originated from. On egress, the source mac address is changed to ensure the packet is egressed from a specific network port on the switch.

    Could you please provide an example of how to setup the extended table to route L3 traffic such that it adds a tag to the packet on ingress and is there a method to egress packets on specific network ports only? 


    To elaborate on our system and requirements,

    SYSTEM
    We have a dual core arm processor running Linux which is directly connected to the ADIN6310 switch in a MAC-MAC connection over SGMII. The host port on the switch is port 1 and we have 3 external network ports on our custom board, 2 SFPs and 1 LAN port.

    Requirements 
    All network traffic is ingressing or egressing from the host processor. 
    The network traffic ingressing from each of the 3 network ports must be isolated from each other and once it reaches the host processor, there must be a way to determine which network port the packet originated from (both L2 & L3) so the host processor can process these network streams independently.
    When transmitting packets from the host processor, we must be able to egress the packets out of specific network ports (both L2 & L3 traffic) on the switch.

  • Hi Karl,

    Just following up on this thread to see if you have found any more information for my use case.

    Thank you

  • Hi Harrison,

    I've attached an example configuration.

    This approach is similar to what you mentioned about adding a static table entry and passing 0s in the address mask.

    In the example, traffic ingressing on Port 1 or Port 2 is set to be forwarded to the link port (Port 0) with a tail tag.

    int main(int argc, char* argv[])
    {
    	printf("\n--START--\n");
    	int32_t rv = SES_PORT_ERROR;
    	rv = SES_Initialize();
    	rv = SES_FirmwareCheck();
    
    	Sleep(5000); // Wait for PHYs to link up
    
    	memcpy(&logicalMacConfig1.logicalMac, logicalMac1, 6);
    	logicalMacConfig1.portMap = 0x01 | 0x02; // Port 0 and Port 1
    	logicalMacConfig1.deviceLinkPort = 0; // Link Port - Port 0
    	logicalMacConfig1.rxLogicalMacCallback = NULL;
    	rv = SES_AddLogicalMac(&logicalMacConfig1, &logicalMacReturns1);
    	printf("Added Logical MAC 1 : %d\n", rv);
    
    	memcpy(&logicalMacConfig2.logicalMac, logicalMac2, 6);
    	logicalMacConfig2.portMap = 0x01 | 0x04; // Port 0 and Port 2
    	logicalMacConfig2.deviceLinkPort = 0; // Link Port - Port 0
    	logicalMacConfig2.rxLogicalMacCallback = NULL;
    	rv = SES_AddLogicalMac(&logicalMacConfig2, &logicalMacReturns2);
    	printf("Added Logical MAC 2 : %d\n", rv);
    
    	uint8_t macAddr[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //sample mac address
        uint8_t macMask[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //wildcard mask
    
    	rv = SES_AddStaticTableEntryEx(0, 			// lookup priority
            &macAddr, 								// mac address
            &macMask,                     			// mac mask
            SES_DYNTBL_NO_VLAN,          			// vlan id
            SES_DYNTBL_VLAN_EXACT_MATCH, 			// vlan mask
            0,                           			// source entry
            0,                           			// override
            0,                           			// source override
            0,                           			// hsr prp supervisory
    		SES_dynamicTblLookupBasic, 				// lookup type
            0x01, 									// port map
            0,										// send to ae
    		0,										// danp
            0,										// cut through -> store and forward operation
            0,										// synt timestamp
            0,										// local timestamp
            dynamicTblSequenceGeneration,  			// sequencemgmt
            0,										// rx sequence set
            logicalMacReturns1.txPrpXformIndex,     // transmit filter
            SES_IGNORE_FIELD,            // receive filter
            NULL);                       // index*
    	printf("Added Static Table Entry : %d\n", rv);
    
    	printf("\n--END--\n");
    
    	while(1) {
    
    	}
    	return(0);
    }

    Let me know if you'd like more details on the setup.

    Regards,

    Karl