I don't see the bug. I think your patch actually introduces one.
The value stored by dma_ummap_len_set is used to determine if the buffer
needs to be unmapped or not. Prior to us writing it the value should be
0. With your patch we will now be trying to unmap the failed DMA
mapping which is an error.
Thanks,
Alex
On 03/04/2014 01:36 AM, superking wrote:
> Hi, igb maintainer
>
> I download igb driver from intel web site(stable version 5.1.2) not use
> git clone. I find a small bug and made a patch by diff command. the
> attachment is my patch.
>
> I also paste it to here.
> It is very small bug. if dma_mapping_error return true. it will goto
> dma_error to call dma_unmap_single function, but the dma and len was not
> set to tx_buffer struct.
> so I just change the sequence.
>
> --- src.orig/igb_main.c 2014-03-04 16:08:21.948652914 +0800
> +++ src/igb_main.c 2014-03-04 16:11:31.688649452 +0800
> @@ -5303,13 +5303,14 @@ static void igb_tx_map(struct igb_ring *
> tx_buffer = first;
>
> for (frag = &skb_shinfo(skb)->frags[0];; frag++) {
> - if (dma_mapping_error(tx_ring->dev, dma))
> - goto dma_error;
> -
> + /* record length, and DMA address */
> dma_unmap_len_set(tx_buffer, len, size);
> dma_unmap_addr_set(tx_buffer, dma, dma);
>
> + if (dma_mapping_error(tx_ring->dev, dma))
> + goto dma_error;
> +
> tx_desc->read.buffer_addr = cpu_to_le64(dma);
>
> while (unlikely(size > IGB_MAX_DATA_PER_TXD)) {
>
>
>
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries. Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> E1000-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/e1000-devel
> To learn more about Intel® Ethernet, visit
> http://communities.intel.com/community/wired
>
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit
http://communities.intel.com/community/wired