lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHXqBFJsGcAdH0zFS_Gd34oR3Ov6ssbXRMzK-KrnSxq8c3=WNg@mail.gmail.com>
Date:	Thu, 6 Oct 2011 22:45:57 +0200
From:	Michał Mirosław <mirqus@...il.com>
To:	Ian Campbell <Ian.Campbell@...rix.com>
Cc:	David Miller <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Jon Mason <jdmason@...zu.us>
Subject: Re: [PATCH 1/8] vxge: convert to SKB paged frag API.

W dniu 6 października 2011 18:00 użytkownik Ian Campbell
<Ian.Campbell@...rix.com> napisał:
> On Thu, 2011-10-06 at 08:05 +0100, Ian Campbell wrote:
>> On Wed, 2011-10-05 at 22:03 +0100, Michał Mirosław wrote:
>> > 2011/10/5 Ian Campbell <ian.campbell@...rix.com>:
>> > [...]
>> > > --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
>> > > +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
>> > > @@ -923,9 +923,9 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
>> > >                if (!frag->size)
>> > >                        continue;
>> > >
>> > > -               dma_pointer = (u64) pci_map_page(fifo->pdev, frag->page,
>> > > -                               frag->page_offset, frag->size,
>> > > -                               PCI_DMA_TODEVICE);
>> > > +               dma_pointer = (u64)skb_frag_dma_map(&fifo->pdev->dev, frag,
>> > > +                                                   0, frag->size,
>> > > +                                                   PCI_DMA_TODEVICE);
>> >
>> > This should be DMA_TO_DEVICE instead of PCI_DMA_TODEVICE.
>> > >                if (unlikely(pci_dma_mapping_error(fifo->pdev, dma_pointer)))
>> > >                        goto _exit2;
>> > I would also change this to dma_mapping_error() in one go.
>> > Just a random patch check.
>> Thanks Michał.
>> I'm sure I must have made the same mistakes in a whole bunch of patches
>> which have already been applied. I'll knock up a fixup patch.
> Here it is. David, if you want N separate patches (or a git pull
> request?) let me know.

There's a catch there, though:

[...]
>                        mapping = skb_frag_dma_map(&tp->pdev->dev, frag, 0,
> -                                                  len, PCI_DMA_TODEVICE);
> +                                                  len, DMA_TO_DEVICE);
>
>                        tnapi->tx_buffers[entry].skb = NULL;
>                        dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
>                                           mapping);
> -                       if (pci_dma_mapping_error(tp->pdev, mapping))
> +                       if (dma_mapping_error(tp->pdev, mapping))

dma_mapping_error() takes struct device *, so those changes should be:

dma_mapping_error(&tp->pdev->dev, mapping)

(Like skb_frag_dma_map()'s first argument).

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ