netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Duncan Roe <duncan_roe@optusnet.com.au>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH libnetfilter_queue v2 1/1] Eliminate packet copy when constructing struct pkt_buff
Date: Thu, 27 May 2021 22:23:15 +0200	[thread overview]
Message-ID: <20210527202315.GA11531@salvia> (raw)
In-Reply-To: <20210518030848.17694-2-duncan_roe@optusnet.com.au>

On Tue, May 18, 2021 at 01:08:48PM +1000, Duncan Roe wrote:
> To avoid a copy, the new code takes advantage of the fact that the netfilter
> netlink queue never returns multipart messages.
> This means that the buffer space following that callback data is available for
> packet expansion when mangling.
> 
> nfq_cb_run() is a new nfq-specific callback runqueue for netlink messages.
> The principal function of nfq_cb_run() is to pass to the called function what is
> the length of free space after the packet.
> As a side benefit, nfq_cb_run() also gives the called functio a pointer to a
> zeroised struct pkt_buff, avoiding the malloc / free that was previously needed.
> 
> nfq_cb_t is a new typedef for the function called by nfq_cb_run()
> [c.f. mnl_cb_t / mnl_cb_run].

Interesting idea: let me get back to you with a proposal based on this
patch.

Meanwhile, I have pushed out the __pktb_setup() function which is
going to be needed:

http://git.netfilter.org/libnetfilter_queue/commit/?id=710f891c8a6116f520948f5cf448489947fb7d78

Thanks.

  reply	other threads:[~2021-05-27 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04  2:34 [PATCH RFC libnetfilter_queue 0/1] Eliminate packet copy when constructing struct pkt_buff Duncan Roe
2021-05-04  2:34 ` [PATCH RFC libnetfilter_queue 1/1] " Duncan Roe
2021-05-18  3:08   ` [PATCH libnetfilter_queue v2 0/1] Speed-up Duncan Roe
2021-05-18  3:08   ` [PATCH libnetfilter_queue v2 1/1] Eliminate packet copy when constructing struct pkt_buff Duncan Roe
2021-05-27 20:23     ` Pablo Neira Ayuso [this message]
2021-07-18  4:28       ` Duncan Roe
2021-08-04  1:38       ` Duncan Roe
2021-05-04  2:50 ` [PATCH RFC libnetfilter_queue 0/1] " Duncan Roe
2021-05-31  3:11 ` Duncan Roe

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=20210527202315.GA11531@salvia \
    --to=pablo@netfilter.org \
    --cc=duncan_roe@optusnet.com.au \
    --cc=netfilter-devel@vger.kernel.org \
    /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).