]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: use hardware padding of runt frames
authorDoug Berger <opendmb@gmail.com>
Thu, 25 Jun 2020 01:14:55 +0000 (18:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Jun 2020 04:51:03 +0000 (21:51 -0700)
commit1cd1a40f22f8ba5c5f53303d9ffcb7956102fb70
treee95e1549bb6733723ae5cdb2eb7f05fb04624762
parent9083ad4436aad2b554778f311ad8e911fc92f5c2
net: bcmgenet: use hardware padding of runt frames

When commit f76855358b58 ("net: bcmgenet: correctly pad short
packets") added the call to skb_padto() it should have been
located before the nr_frags parameter was read since that value
could be changed when padding packets with lengths between 55
and 59 bytes (inclusive).

The use of a stale nr_frags value can cause corruption of the
pad data when tx-scatter-gather is enabled. This corruption of
the pad can cause invalid checksum computation when hardware
offload of tx-checksum is also enabled.

Since the original reason for the padding was corrected by
commit 5417bb84e7bc ("net: bcmgenet: fix skb_len in
bcmgenet_xmit_single()") we can remove the software padding all
together and make use of hardware padding of short frames as
long as the hardware also always appends the FCS value to the
frame.

Fixes: f76855358b58 ("net: bcmgenet: correctly pad short packets")
Signed-off-by: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c