mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH AUTOSEL for 4.4 01/17] net: systemport: Utilize skb_put_padto()
@ 2017-11-22 22:24 alexander.levin
  2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 02/17] net: systemport: Pad packet before inserting TSB alexander.levin
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: alexander.levin @ 2017-11-22 22:24 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Florian Fainelli, David S . Miller, alexander.levin

From: Florian Fainelli <f.fainelli@gmail.com>

[ Upstream commit bb7da333d0a9f3bddc08f84187b7579a3f68fd24 ]

Since we need to pad our packets, utilize skb_put_padto() which
increases skb->len by how much we need to pad, allowing us to eliminate
the test on skb->len right below.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 8860e74aa28f..fae1a1ff53ab 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1061,13 +1061,12 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
 	 * (including FCS and tag) because the length verification is done after
 	 * the Broadcom tag is stripped off the ingress packet.
 	 */
-	if (skb_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) {
+	if (skb_put_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) {
 		ret = NETDEV_TX_OK;
 		goto out;
 	}
 
-	skb_len = skb->len < ETH_ZLEN + ENET_BRCM_TAG_LEN ?
-			ETH_ZLEN + ENET_BRCM_TAG_LEN : skb->len;
+	skb_len = skb->len;
 
 	mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE);
 	if (dma_mapping_error(kdev, mapping)) {
-- 
2.11.0

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-11-22 23:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 22:24 [PATCH AUTOSEL for 4.4 01/17] net: systemport: Utilize skb_put_padto() alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 02/17] net: systemport: Pad packet before inserting TSB alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 07/17] nfs: Don't take a reference on fl->fl_file for LOCK operation alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 04/17] vti6: fix device register to report IFLA_INFO_KIND alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 05/17] net/appletalk: Fix kernel memory disclosure alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 06/17] ravb: Remove Rx overflow log messages alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 03/17] ARM: OMAP1: DMA: Correct the number of logical channels alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 08/17] KVM: arm/arm64: Fix occasional warning from the timer work function alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 11/17] net: sctp: fix array overrun read on sctp_timer_tbl alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 10/17] drm/exynos/decon5433: set STANDALONE_UPDATE_F on output enablement alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 09/17] NFSv4: Fix client recovery when server reboots multiple times alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 14/17] tcp: correct memory barrier usage in tcp_check_space() alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 13/17] dmaengine: pl330: fix double lock alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 15/17] mm: avoid returning VM_FAULT_RETRY from ->page_mkwrite handlers alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 12/17] tipc: fix cleanup at module unload alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 16/17] xen-netfront: Improve error handling during initialization alexander.levin
2017-11-22 22:24 ` [PATCH AUTOSEL for 4.4 17/17] net: fec: fix multicast filtering hardware setup alexander.levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®