]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvneta: fix operation for 64K PAGE_SIZE
authorMarcin Wojtas <mw@semihalf.com>
Tue, 11 Dec 2018 12:56:49 +0000 (13:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Dec 2018 20:39:59 +0000 (12:39 -0800)
commit40523292717559bcab3f6440653716398c802a6f
treea5631e301c1cdc3dc22338cdb5e1513a56eaeab0
parent0af89895fc0b6b534c0f8634c249f7466c42441d
net: mvneta: fix operation for 64K PAGE_SIZE

Recent changes in the mvneta driver reworked allocation
and handling of the ingress buffers to use entire pages.
Apart from that in SW BM scenario the HW must be informed
via PRXDQS about the biggest possible incoming buffer
that can be propagated by RX descriptors.

The BufferSize field was filled according to the MTU-dependent
pkt_size value. Later change to PAGE_SIZE broke RX operation
when usin 64K pages, as the field is simply too small.

This patch conditionally limits the value passed to the BufferSize
of the PRXDQS register, depending on the PAGE_SIZE used.
On the occasion remove now unused frag_size field of the mvneta_port
structure.

Fixes: 0db0df595cbd ("net: mvneta: Improve the buffer allocation method for SWBM")
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c