Re: [PATCH net-next 1/4] dpaa_eth: fix SG mapping

From: David Miller
Date: Tue Feb 20 2018 - 13:56:23 EST


From: Madalin Bucur <madalin.bucur@xxxxxxx>
Date: Mon, 19 Feb 2018 10:10:41 -0600

> An issue in the code mapping the skb fragments into
> scatter-gather frames was evidentiated by netperf
> TCP_SENDFILE tests. This patch addresses the issue.
>
> Signed-off-by: Madalin Bucur <madalin.bucur@xxxxxxx>

This is a poorly worded commit message.

You have to say exactly what "the issue" is.

Reading your patch:

> @@ -1916,8 +1916,10 @@ static int skb_to_sg_fd(struct dpaa_priv *priv,
> goto csum_failed;
> }
>
> + /* SGT[0] is used by the linear part */
> sgt = (struct qm_sg_entry *)(sgt_buf + priv->tx_headroom);
> - qm_sg_entry_set_len(&sgt[0], skb_headlen(skb));
> + buff_len = skb_headlen(skb);
> + qm_sg_entry_set_len(&sgt[0], buff_len);
> sgt[0].bpid = FSL_DPAA_BPID_INV;
> sgt[0].offset = 0;
> addr = dma_map_single(dev, skb->data,

This change has no effect and is unrelated. Please do not mix
unrelated changes with the main change, because this makes it
hard to review your work.

> @@ -1930,27 +1932,28 @@ static int skb_to_sg_fd(struct dpaa_priv *priv,
> qm_sg_entry_set64(&sgt[0], addr);
>
> /* populate the rest of SGT entries */
> - frag = &skb_shinfo(skb)->frags[0];
> - frag_len = frag->size;
> - for (i = 1; i <= nr_frags; i++, frag++) {
> + for (i = 0; i < nr_frags; i++) {
> + frag = &skb_shinfo(skb)->frags[i];
> + buff_len = frag->size;
> WARN_ON(!skb_frag_page(frag));
> addr = skb_frag_dma_map(dev, frag, 0,
> - frag_len, dma_dir);
> + buff_len, dma_dir);

And clearly the bug you are fixing is simply that frag_len was only
being set for the first fragment.

Please just fix that bug and remove all of these other completely
unrelated changes.