• Nick Child's avatar
    ibmveth: Copy tx skbs into a premapped buffer · d6832ca4
    Nick Child authored
    Rather than DMA mapping and unmapping every outgoing skb, copy the skb
    into a buffer that was mapped during the drivers open function. Copying
    the skb and its frags have proven to be more time efficient than
    mapping and unmapping. As an effect, performance increases by 3-5
    Gbits/s.
    
    Allocate and DMA map one continuous 64KB buffer at `ndo_open`. This
    buffer is maintained until `ibmveth_close` is called. This buffer is
    large enough to hold the largest possible linnear skb. During
    `ndo_start_xmit`, copy the skb and all of it's frags into the continuous
    buffer. By manually linnearizing all the socket buffers, time is saved
    during memcpy as well as more efficient handling in FW.
    As a result, we no longer need to worry about the firmware limitation
    of handling a max of 6 frags. So, we only need to maintain 1 descriptor
    instead of 6 and can hardcode 0 for the other 5 descriptors during
    h_send_logical_lan.
    
    Since, DMA allocation/mapping issues can no longer arise in xmit
    functions, we can further reduce code size by removing the need for a
    bounce buffer on DMA errors.
    Signed-off-by: default avatarNick Child <nnac123@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d6832ca4
ibmveth.h 6.31 KB