netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: Mason <slash.tmp@free.fr>
Cc: netdev@vger.kernel.org, Eric Dumazet <eric.dumazet@gmail.com>,
	Alexander Duyck <alexander.h.duyck@redhat.com>
Subject: Re: [PATCH v8] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller
Date: Wed, 25 Nov 2015 12:45:01 +0000	[thread overview]
Message-ID: <yw1x37vuqmcy.fsf@unicorn.mansr.com> (raw)
In-Reply-To: <5655AB63.40204@free.fr> (Mason's message of "Wed, 25 Nov 2015 13:36:51 +0100")

Mason <slash.tmp@free.fr> writes:

> On 19/11/2015 14:02, Mans Rullgard wrote:
>
>> +	if (dma_mapping_error(&dev->dev, dma_addr)) {
>> +		skb_free_frag(data);
>> +		return -ENOMEM;
>> +	}
>
> I'm back-porting this driver to 4.1
>
> skb_free_frag() was introduced in 4.2 by 181edb2bfa22b IIUC.
>
> +static inline void skb_free_frag(void *addr)
> +{
> +       __free_page_frag(addr);
> +}
>
> Should I just copy the definition of __free_page_frag() ?

Looks like it ought to work.  Try and find out.  Not that you'll ever
hit that error condition unless you fake it.

> /*
>  * Frees a page fragment allocated out of either a compound or order 0 page.
>  */
> void __free_page_frag(void *addr)
> {
> 	struct page *page = virt_to_head_page(addr);
>
> 	if (unlikely(put_page_testzero(page)))
> 		__free_pages_ok(page, compound_order(page));
> }
>
> Regards.
>

-- 
Måns Rullgård
mans@mansr.com

  reply	other threads:[~2015-11-25 12:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 13:02 [PATCH v8] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Mans Rullgard
2015-11-20 16:48 ` David Miller
2015-11-25 12:36 ` Mason
2015-11-25 12:45   ` Måns Rullgård [this message]
2015-11-25 13:00     ` Mason
2015-11-25 13:04       ` Måns Rullgård
2015-11-25 16:12         ` Alexander Duyck
2015-11-25 16:16           ` Måns Rullgård
2015-11-25 16:21             ` Mason
2015-11-25 16:24               ` Måns Rullgård
2015-11-25 12:45   ` Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yw1x37vuqmcy.fsf@unicorn.mansr.com \
    --to=mans@mansr.com \
    --cc=alexander.h.duyck@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=slash.tmp@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).