linux_dsm_epyc7002/drivers/net/ethernet/3com
Neil Horman a6522c0898 3c59x: mask LAST_FRAG bit from length field in ring
Recently, I fixed a bug in 3c59x:

commit 6e144419e4
Author: Neil Horman <nhorman@tuxdriver.com>
Date:   Wed Jan 13 12:43:54 2016 -0500

    3c59x: fix another page map/single unmap imbalance

Which correctly rebalanced dma mapping and unmapping types.  Unfortunately it
introduced a new bug which causes oopses on older systems.

When mapping dma regions, the last entry for a packet in the 3c59x tx ring
encodes a LAST_FRAG bit, which is encoded as the high order bit of the buffers
length field.  When it is unmapped the LAST_FRAG bit is cleared prior to being
passed to the unmap function.  Unfortunately the commit above fails to do that
masking.  It was missed in testing because the system on which I tested it had
an intel iommu, the driver for which ignores the size field, using only the DMA
address as the token to identify the mapping to be released.  However, on older
systems that rely on swiotlb (or other dma drivers that key off that length
field), not masking off that LAST_FRAG high order bit results in parsing a huge
size to be release, leading to all sorts of odd corruptions and the like.

Fix is easy, just mask the length with 0xFFF.  It should really be
&(LAST_FRAG-1), but 0xFFF is the style of the file, and I'd like to make this
fix minimal and correct before making it prettier.

Appies to the net tree cleanly.  All testing on both iommu and swiommu based
systems produce good results

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-29 17:03:35 -05:00
..
3c59x.c 3c59x: mask LAST_FRAG bit from length field in ring 2016-02-29 17:03:35 -05:00
3c509.c drivers/net: fix eisa_driver probe section mismatch 2015-12-14 00:24:22 -05:00
3c515.c drivers/net: Convert remaining uses of pr_warning to pr_warn 2014-09-09 20:37:08 -07:00
3c574_cs.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
3c589_cs.c drivers/net: Use setup_timer and mod_timer 2015-02-11 19:40:12 -08:00
Kconfig drivers/net: remove all references to obsolete Ethernet-HOWTO 2015-06-23 06:50:35 -07:00
Makefile drivers/net: delete old 8bit ISA 3c501 driver. 2013-01-22 10:39:49 -05:00
typhoon.c net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
typhoon.h