buglwIP - A Lightweight TCP/IP stack - Bugs: bug #56293, The callback API used to add or...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56293: The callback API used to add or delete multicast MAC filter entry need some optimization

Submitter:  Gao Qingshui <kevingao>
Submitted:  Thu 09 May 2019 11:23:13 AM UTC
   
 
Category:  Network drivers Severity:  3 - Normal
Item Group:  Change Request Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  2.2.1
lwIP version:  git head

Fri 01 Oct 2021 06:43:04 PM UTC, comment #4: 

Targeting to 2.2.0 since this is a breaking change.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 30 Jan 2020 08:13:23 PM UTC, comment #3: 

Sigh, no patch. Ok, so I think this is a viable approach for standard MACs but I could imagine there are MACs that have hardware offloading for IPv4/IPv6 available, so this should be optional.

In other words, I think it would be good to have a 'netif->multicast_mac_filter' callback and set 'igmp_mac_filter' and 'mld_mac_filter' to default callbacks that do the IPv4/IPv6-to-EthAddr translation by default.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 14 May 2019 07:35:25 PM UTC, comment #2: 

Ping?

Simon Goldschmidt <goldsimon>
Group administrator
Thu 09 May 2019 11:30:10 AM UTC, comment #1: 

For this and other bug entries you entered: it would be much easier to see what you mean and review the change if you attached a patch (i.e. commit your changes to your local tree, run "git format-patch -1 HEAD" and attach the resulting file here).

Simon Goldschmidt <goldsimon>
Group administrator
Thu 09 May 2019 11:23:13 AM UTC, original submission:  

Two optimizations could be implemented about the callback API used to add or delete multicast MAC filter:
1,currently there are two callback APIs, igmp_mac_filter for IGMP and mld_mac_filter for MLD, but one API is enough as the L2 layer does not distinguish between IPv4 or IPv6;
2,the input argument could be changed from IP address to MAC address, this could make the network driver prosssing simpler as it does not need to do IPv4 or IPv6 address mapping to MAC address.

so I recommend to change the prototype to below format for both IPv4 and IPv6:

/************************************************************/
before change:
#if LWIP_IPV4 && LWIP_IGMP
/** Function prototype for netif igmp_mac_filter functions */
typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
       const ip4_addr_t *group, enum netif_mac_filter_action action);
#endif /* LWIP_IPV4 && LWIP_IGMP */
#if LWIP_IPV6 && LWIP_IPV6_MLD
/** Function prototype for netif mld_mac_filter functions */
typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
       const ip6_addr_t *group, enum netif_mac_filter_action action);
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */

#if LWIP_IPV4 && LWIP_IGMP
  /** This function could be called to add or delete an entry in the multicast filter table of the ethernet MAC.*/
  netif_igmp_mac_filter_fn igmp_mac_filter;
#endif /* LWIP_IPV4 && LWIP_IGMP */
#if LWIP_IPV6 && LWIP_IPV6_MLD
  /** This function could be called to add or delete an entry in the IPv6 multicast filter table of the ethernet MAC. */
  netif_mld_mac_filter_fn mld_mac_filter;
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */

/************************************************************/
after change:
#if (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD)
/** Function prototype for netif_mac_filter functions */
typedef err_t (*netif_mac_filter_fn)(struct netif *netif,
       const struct eth_addr *multi_mac, enum netif_mac_filter_action action);
#endif /* (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD) */
#if (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD)
  /** This function could be called to add or delete an entry in the  multicast filter table of the ethernet MAC. */
  netif_mac_filter_fn multicast_mac_filter;
#endif /* (LWIP_IPV4 && LWIP_IGMP) || (LWIP_IPV6 && LWIP_IPV6_MLD) */

Gao Qingshui <kevingao>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by kevingao (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-12-22 goldsimon Planned Release2.2.0 2.2.1
    2021-10-01 goldsimon Planned ReleaseNone 2.2.0

    Back to the top

    Powered by Savane 3.13-0ba7.
    Corresponding source code