Commit 7b868311 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Paolo Abeni
Browse files

net: stmmac: move stmmac_xmit() first entry index code



The handling of the first descriptor index/pointer is split around
the checksum handling which makes no sense. Group this code together.

Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1w3d0M-0000000DfLv-1C6S@rmk-PC.armlinux.org.uk


Tested-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent cafacdc4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -4728,10 +4728,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
	/* Check if VLAN can be inserted by HW */
	has_vlan = stmmac_vlan_insert(priv, skb, tx_q);

	entry = tx_q->cur_tx;
	first_entry = entry;
	WARN_ON(tx_q->tx_skbuff[first_entry]);

	csum_insertion = (skb->ip_summed == CHECKSUM_PARTIAL);
	/* DWMAC IPs can be synthesized to support tx coe only for a few tx
	 * queues. In that case, checksum offloading for those queues that don't
@@ -4748,6 +4744,10 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
		csum_insertion = !csum_insertion;
	}

	entry = tx_q->cur_tx;
	first_entry = entry;
	WARN_ON(tx_q->tx_skbuff[first_entry]);

	desc = stmmac_get_tx_desc(priv, tx_q, entry);
	first_desc = desc;