Skip to content
  • Claudiu Manoil's avatar
    gianfar: Add paged allocation and Rx S/G · 75354148
    Claudiu Manoil authored
    
    
    The eTSEC h/w is capable of scatter/gather on the receive side
    too if MAXFRM > MRBLR, when the allowed maximum Rx frame size
    is set to be greater than the maximum Rx buffer size (MRBLR).
    It's about time the driver makes use of this h/w capability,
    by supporting fixed buffer sizes and Rx S/G.
    
    The buffer size given to eTSEC for reception is fixed to
    1536B (must be multiple of 64), which is the same default
    buffer size as before, used to accommodate standard MTU
    (1500B) size frames.  As before, eTSEC can receive frames of
    up to 9600B.  Individual Rx buffers are mapped to page halves
    (page size for eTSEC systems is 4KB).  The skb is built around
    the first buffer of a frame (using build_skb()).  In case the
    frame spans multiple buffers, the trailing buffers are added
    as Rx fragments to the skb.  The last buffer in frame is marked
    by the L status flag.  A mechanism is in place to reuse the pages
    owned by the driver (for Rx) for subsequent receptions.
    
    Supporting fixed size buffers allows the implementation of Rx S/G,
    which in turn removes the memory pressure issues the driver had
    before when MTU was set for jumbo frame reception.
    Also, in most cases, the Rx path becomes faster due to Rx page
    reusal, since the overhead of allocating new rx buffers is removed
    from the fast path.
    
    Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    75354148