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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Wilfred
URL:
  <https://savannah.nongnu.org/bugs/?56293>

                 Summary: The callback API used to add or delete multicast MAC
filter entry need some optimization
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: kevingao
            Submitted on: 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
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

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) */




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56293>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

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

Wilfred
Follow-up Comment #1, bug #56293 (project lwip):

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).

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56293>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

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

Wilfred
Follow-up Comment #2, bug #56293 (project lwip):

Ping?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56293>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel