OSDN Git Service

ibmveth: Copy tx skbs into a premapped buffer
authorNick Child <nnac123@linux.ibm.com>
Wed, 28 Sep 2022 21:43:48 +0000 (16:43 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Sep 2022 11:40:22 +0000 (12:40 +0100)
commitd6832ca48d8af0ec3d02d93c17027304c429c087
treecce05cf8fc21f67dc0ce79c123d4bbc6d43ebf99
parentea9b9a985d58d8e2abd91e8d7514b14398fe414f
ibmveth: Copy tx skbs into a premapped buffer

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: Nick Child <nnac123@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmveth.c
drivers/net/ethernet/ibm/ibmveth.h