OSDN Git Service

net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 19 Oct 2019 08:13:23 +0000 (10:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Oct 2019 17:36:07 +0000 (10:36 -0700)
commit8dc9a0888f4c8e27b25e48ff1b4bc2b3a845cc2d
treebfe4cd0f3579d6d0821326081954d4dca365ae85
parent568a3fa24a95476d40afe3f8616bafb543bc4182
net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine

Refactor mvneta_rx_swbm code introducing mvneta_swbm_rx_frame and
mvneta_swbm_add_rx_fragment routines. Rely on build_skb in oreder to
allocate skb since the previous patch introduced buffer recycling using
the page_pool API.
This patch fixes even an issue in the original driver where dma buffers
are accessed before dma sync.
mvneta driver can run on not cache coherent devices so it is
necessary to sync DMA buffers before sending them to the device
in order to avoid memory corruptions. Running perf analysis we can
see a performance cost associated with this DMA-sync (anyway it is
already there in the original driver code). In follow up patches we
will add more logic to reduce DMA-sync as much as possible.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c