Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IPv6][SAM] Enable multicast hash table for multiple MAC addresses on SAM network interface #926

Merged

Conversation

ActoryOu
Copy link
Member

[IPv6][SAM] Enable multicast hash table for multiple MAC addresses on SAM network interface

Description

The change is made by @htibosch.

When IPv6/Multiple endpoints enabled, the space to store MAC addresses is not enough.
To support it better, use multicast hash table in hardware to reduce loading on space.

Test Steps

Below scenarios are tested (by @htibosch) on both IPv4/IPv6:

  • DNS
  • UDP
  • TCP
  • Ping
  • IPERF3

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

kar-rahul-aws
kar-rahul-aws previously approved these changes Jun 19, 2023
kar-rahul-aws
kar-rahul-aws previously approved these changes Jun 19, 2023
@@ -691,7 +710,7 @@ static BaseType_t prvGMACInit( NetworkInterface_t * pxInterface )
NetworkEndPoint_t * pxEndPoint;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe its more cleaner (or more readable) to have different names for variables (pxEndPoint) though they are in different scope.

tony-josi-aws
tony-josi-aws previously approved these changes Jun 20, 2023
@htibosch
Copy link
Contributor

htibosch commented Jun 20, 2023

Thank you Actory for creating this PR.
What I miss is a few items in the description of the PR:

  • The name of the NetworkInterface will change from "GMAC" to "GMAC1", depending on the assigned index.
  • The function pxSAM_FillInterfaceDescriptor() now calls FreeRTOS_AddNetworkInterface(), as it should
  • Adapted vGMACGenerateChecksum() for use with IPv6 addresses
  • An event passed to the IP-task does not have to be declared static as in static IPStackEvent_t xRxEvent
  • When FreeRTOS_MatchingEndpoint() does not find a match, drop the received packet

Some remarks:

The function name prvAddMACAddress() is too generic. Maybe we should call it prvAddMulticastMACAddress()
At the bottom there is the function gmac_enable_irq(). I used it for testing: it makes stepping easier. You can remove the declaration.

@ActoryOu
Copy link
Member Author

ActoryOu commented Jun 21, 2023

Thank you Actory for creating this PR. What I miss is a few items in the description of the PR:

  • The name of the NetworkInterface will change from "GMAC" to "GMAC1", depending on the assigned index.
  • The function pxSAM_FillInterfaceDescriptor() now calls FreeRTOS_AddNetworkInterface(), as it should
  • Adapted vGMACGenerateChecksum() for use with IPv6 addresses
  • An event passed to the IP-task does not have to be declared static as in static IPStackEvent_t xRxEvent
  • When FreeRTOS_MatchingEndpoint() does not find a match, drop the received packet

Some remarks:

The function name prvAddMACAddress() is too generic. Maybe we should call it prvAddMulticastMACAddress() At the bottom there is the function gmac_enable_irq(). I used it for testing: it makes stepping easier. You can remove the declaration.

Thanks for additions.
I've updated prvAddMACAddress to prvAddMulticastMACAddress and removed gmac_enable_irq.

Please help to take a look.
Thanks.

@@ -706,7 +725,7 @@ static BaseType_t prvGMACInit( NetworkInterface_t * pxInterface )
ucMACAddress[ 3 ] = pxEndPoint->ipv6_settings.xIPAddress.ucBytes[ 13 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding IPv6 multi-cast MAC addresses of the IPv6 endpoints to the hash table, shouldn't it be of the form - Address Mapping -- Multicast

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a valid issue and the field ucMACAddress[ 2 ] needs to be set as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change will be reverted, see Solicited-node multicast address. It is used to give the DUT a multicast address which is used during the SLAAC for DAD (Duplicate Address Detection).

@tony-josi-aws tony-josi-aws merged commit 70d365d into FreeRTOS:dev/IPv6_integration Jun 22, 2023
@ActoryOu ActoryOu deleted the SAM_driver_update branch June 29, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants