mtu issue with gianfar driver

Kumar Reddy Suresh-B22303 B22303 at freescale.com
Mon Jul 25 21:47:33 EST 2011


Hi All,

A problem was observed in gianfar driver when the interface MTU was modified to a small value.

FYI Kernel Version : 2.6.32 on PPC.


Like if we change the interface mtu to say 100, ping traffic with size greater than 450 is failing.
It was observed that packets ( ping requests) going out of that interface are getting properly fragmented, but the return packets ( ping replies ) are getting dropped by the interface.

To fix this issue the function gfar_change_mtu() in gianfar.c was modified as below:

rx_buffer_size is restored to DEFAULT_RX_BUFFER_SIZE as indicated in RED in the code snippet below

------------------------- CODE SNIPPET BEGIN ----------------------------------
                tempsize =
                    (frame_size & ~(INCREMENTAL_BUFFER_SIZE - 1)) +
                    INCREMENTAL_BUFFER_SIZE;

        if (tempsize < DEFAULT_RX_BUFFER_SIZE )
           tempsize = DEFAULT_RX_BUFFER_SIZE;

                /* Only stop and start the controller if it isn't already
                * stopped, and we changed something */
                if ((oldsize != tempsize) && (dev->flags & IFF_UP))
                                stop_gfar(dev);

                priv->rx_buffer_size = tempsize;

                dev->mtu = new_mtu;
------------------------- CODE SNIPPET END----------------------------------

If this fix OK? What is the impact of this change on overall behavior?

Best Regards,
- Suresh



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20110725/ce750873/attachment.html>


More information about the Linuxppc-dev mailing list