linux/drivers/net/ethernet/freescale/dpaa2
Ioana Ciornei 54a57d1c44 dpaa2-eth: fix the size of the mapped SGT buffer
This patch fixes an error condition triggered when the code path which
transmits a S/G frame descriptor when the skb's headroom is not enough
for DPAA2's needs.

We are greated with a splat like the one below when a SGT structure is
recycled and that is because even though a dma_unmap is performed on the
Tx confirmation path, the unmap is not done with the proper size.

[  714.464927] WARNING: CPU: 13 PID: 0 at drivers/iommu/io-pgtable-arm.c:281 __arm_lpae_map+0x2d4/0x30c
(...)
[  714.465343] Call trace:
[  714.465348]  __arm_lpae_map+0x2d4/0x30c
[  714.465353]  __arm_lpae_map+0x114/0x30c
[  714.465357]  __arm_lpae_map+0x114/0x30c
[  714.465362]  __arm_lpae_map+0x114/0x30c
[  714.465366]  arm_lpae_map+0xf4/0x180
[  714.465373]  arm_smmu_map+0x4c/0xc0
[  714.465379]  __iommu_map+0x100/0x2bc
[  714.465385]  iommu_map_atomic+0x20/0x30
[  714.465391]  __iommu_dma_map+0xb0/0x110
[  714.465397]  iommu_dma_map_page+0xb8/0x120
[  714.465404]  dma_map_page_attrs+0x1a8/0x210
[  714.465413]  __dpaa2_eth_tx+0x384/0xbd0 [fsl_dpaa2_eth]
[  714.465421]  dpaa2_eth_tx+0x84/0x134 [fsl_dpaa2_eth]
[  714.465427]  dev_hard_start_xmit+0x10c/0x2b0
[  714.465433]  sch_direct_xmit+0x1a0/0x550
(...)

The dpaa2-eth driver uses an area of software annotations to transmit
necessary information from the Tx path to the Tx confirmation one. This
SWA structure has a different layout for each kind of frame that we are
dealing with: linear, S/G or XDP.

The commit referenced was incorrectly setting up the 'sgt_size' field
for the S/G type of SWA even though we are dealing with a linear skb
here.

Fixes: d70446ee1f ("dpaa2-eth: send a scatter-gather FD instead of realloc-ing")
Reported-by: Daniel Thompson <daniel.thompson@linaro.org>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20201211171607.108034-1-ciorneiioana@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-12-16 11:01:07 -08:00
..
dpaa2-eth-dcb.c dpaa2-eth: add a dpaa2_eth_ prefix to all functions in dpaa2-eth-dcb.c 2020-09-01 13:23:47 -07:00
dpaa2-eth-debugfs.c dpaa2-eth: Convert to DEFINE_SHOW_ATTRIBUTE 2020-09-17 17:05:29 -07:00
dpaa2-eth-debugfs.h dpaa2: no need to check return value of debugfs_create functions 2019-08-10 15:25:48 -07:00
dpaa2-eth-devlink.c dpaa2-eth: add support for devlink parser error drop traps 2020-10-02 16:31:56 -07:00
dpaa2-eth-trace.h dpaa2-eth: fix recursive header include 2020-06-25 16:03:39 -07:00
dpaa2-eth.c dpaa2-eth: fix the size of the mapped SGT buffer 2020-12-16 11:01:07 -08:00
dpaa2-eth.h dpaa2-eth: add support for devlink parser error drop traps 2020-10-02 16:31:56 -07:00
dpaa2-ethtool.c dpaa2-eth: install a single steering rule when SHARED_FS is enabled 2020-09-25 17:10:27 -07:00
dpaa2-mac.c dpaa2-mac: Add a missing of_node_put after of_device_is_available 2020-12-07 17:57:19 -08:00
dpaa2-mac.h dpaa2-mac: add PCS support through the Lynx module 2020-09-24 19:49:36 -07:00
dpaa2-ptp.c dpaa2-eth: define a global ptp_qoriq structure pointer 2020-09-18 14:32:48 -07:00
dpaa2-ptp.h dpaa2-eth: define a global ptp_qoriq structure pointer 2020-09-18 14:32:48 -07:00
dpkg.h
dpmac-cmd.h dpaa2-eth: fix a build warning in dpmac.c 2020-09-18 14:36:00 -07:00
dpmac.c dpaa2-eth: add ethtool MAC counters 2019-11-07 15:31:53 -08:00
dpmac.h dpaa2-eth: add ethtool MAC counters 2019-11-07 15:31:53 -08:00
dpni-cmd.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
dpni.c dpaa2-eth: add APIs of 1588 single step timestamping 2020-09-18 14:32:47 -07:00
dpni.h dpaa2-eth: install a single steering rule when SHARED_FS is enabled 2020-09-25 17:10:27 -07:00
dprtc-cmd.h dpaa2-ptp: add external trigger event support 2019-12-16 15:56:41 -08:00
dprtc.c dpaa2-ptp: add interrupt support 2019-06-15 13:43:06 -07:00
dprtc.h dpaa2-ptp: add external trigger event support 2019-12-16 15:56:41 -08:00
Kconfig dpaa2-eth: Fix compile error due to missing devlink support 2020-11-24 14:57:55 -08:00
Makefile dpaa2-eth: add basic devlink support 2020-10-02 16:31:56 -07:00