stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net: systemport: Utilize skb_put_padto()" has been added to the 4.9-stable tree
@ 2017-12-06 17:00 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-12-06 17:00 UTC (permalink / raw)
  To: f.fainelli, alexander.levin, davem, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    net: systemport: Utilize skb_put_padto()

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-systemport-utilize-skb_put_padto.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Wed Dec  6 17:39:55 CET 2017
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 3 Jan 2017 16:34:48 -0800
Subject: net: systemport: Utilize skb_put_padto()

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/broadcom/bcmsysport.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1039,13 +1039,12 @@ static netdev_tx_t bcm_sysport_xmit(stru
 	 * (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)) {


Patches currently in stable-queue which might be from f.fainelli@gmail.com are

queue-4.9/net-systemport-pad-packet-before-inserting-tsb.patch
queue-4.9/net-systemport-utilize-skb_put_padto.patch
queue-4.9/net-phy-micrel-ksz8795-do-not-set-supported_pause.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-06 17:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-06 17:00 Patch "net: systemport: Utilize skb_put_padto()" has been added to the 4.9-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).