Unverified Commit 4fbc6335 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14846 net: stmmac: fix TSO DMA API usage causing oops

parents 51740b55 5dcf3a5b
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4136,9 +4136,9 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
	int tmp_pay_len = 0, first_tx;
	struct stmmac_tx_queue *tx_q;
	bool has_vlan, set_ic;
	dma_addr_t tso_des, des;
	u8 proto_hdr_len, hdr;
	u32 pay_len, mss;
	dma_addr_t des;
	int i;

	tx_q = &priv->dma_conf.tx_queue[queue];
@@ -4223,14 +4223,15 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)

		/* If needed take extra descriptors to fill the remaining payload */
		tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE;
		tso_des = des;
	} else {
		stmmac_set_desc_addr(priv, first, des);
		tmp_pay_len = pay_len;
		des += proto_hdr_len;
		tso_des = des + proto_hdr_len;
		pay_len = 0;
	}

	stmmac_tso_allocator(priv, des, tmp_pay_len, (nfrags == 0), queue);
	stmmac_tso_allocator(priv, tso_des, tmp_pay_len, (nfrags == 0), queue);

	/* In case two or more DMA transmit descriptors are allocated for this
	 * non-paged SKB data, the DMA buffer address should be saved to