This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ECOS] IPv6 on synth over TAP interface


>>>>> "Andrew" == Andrew Lunn <andrew dot lunn at ascom dot ch> writes:

    >> IPv6 requires multicast support, i.e. it needs additional
    >> functionality from the ethernet device driver.
    >> 
    Andrew> ....

    >> Not all real ethernet cards will support multicasts, so during
    >> initialization there is a message from rawether to the eCos
    >> ecosynth driver containing a multicast_supported flag (plus
    >> other info like the MAC address). The eCos driver then uses
    >> that information when processing the SET_MC_ALL ioctl(). IIRC
    >> the tap device should always support multicasts.

    Andrew> I found part of the problem...

    Andrew> //
    Andrew> // This function supports "I/O control" operations on an interface.
    Andrew> //
    Andrew> static int  
    Andrew> eth_drv_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
    Andrew> {
    Andrew> ...

    Andrew>     case SIOCDELMULTI:
    Andrew>     {
    Andrew>         struct ifmultiaddr *ifma;
    Andrew>         struct eth_drv_mc_list mc_list;
    Andrew>         int mode = (ifp->if_flags & IFF_ALLMULTI) ? ETH_DRV_SET_MC_ALL :
    Andrew>                                                     ETH_DRV_SET_MC_LIST;

    Andrew> So the eth_drv layer decided to either use *MC_ALL or
    Andrew> *MC_LIST depending on the interface flags. The synth
    Andrew> driver only supports *MC_ALL, so needs to set IFF_ALLMULTI
    Andrew> in the flags. Without this, the eth_drv uses the *MC_LIST
    Andrew> option which the synth driver returns with an error.

This code does not look quite right. Presumably higher-level code will
only use this ioctl if CYGINT_IO_ETH_MULTICAST is implemented. Hence
this ioctl() code "knows" that the driver will either support only
ALLMULTI or it will support full multicast lists. That assumption
could be invalid if you have two different network interfaces, only
one of which supports multicasts. The situation is worse on the
synthetic target than for more normal platforms because the extent of
multicast support is not known until run-time.

Possibly the code should check for IFF_MULTICAST, and then use
ALLMULTI to decide between MC_ALL or MC_LIST.

However I don't see any other ethernet drivers which set IFF_ALLMULTI.
Why should this be necessary on the synthetic target but not for any
other ethernet driver? I suspect the real problem lies elsewhere, or
possibly just the "implements CYGINT_IO_ETH_MULTICAST" is sufficient.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]