]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita0be6ec2cfc991eda34c6a11afd3d044b62756fa
treecce05cf8fc21f67dc0ce79c123d4bbc6d43ebf99
parent0aef255b0cda693a7ee7d8428ea38150ea0e9a9c
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