[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151120231053.GA46238@ast-mbp.thefacebook.com>
Date: Fri, 20 Nov 2015 15:10:54 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Tom Herbert <tom@...bertland.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, kernel-team@...com,
davewatson@...com
Subject: Re: [PATCH net-next 4/6] kcm: Kernel Connection Multiplexor module
On Fri, Nov 20, 2015 at 01:21:58PM -0800, Tom Herbert wrote:
> +
> + while (eaten < orig_len) {
> + /* Always clone since we will consume something */
> + skb = skb_clone(orig_skb, GFP_ATOMIC);
> + if (!skb) {
> + desc->error = -ENOMEM;
> + break;
> + }
...
> + if (!pskb_pull(skb, offset + eaten)) {
pskb_pull after clone == pskb_expand_head
meaning that we'll be linearizing things all the time.
can we try skb_share_check() first ?
the packet shouldn't be shared at this point, so it might save a lot.
> + kfree_skb(skb);
> + desc->error = -ENOMEM;
> + break;
> + }
...
> + /* Need to trim, should be rare? */
> + err = pskb_trim(skb, orig_len - eaten);
...
> + if (!rxm->full_len) {
> + ssize_t len;
> +
> + len = KCM_RUN_FILTER(psock->bpf_prog, head);
bpf can read packet beyond linear header just fine.
It's slower than reads from header, since extra calls invovled,
but if that becomes a bottle neck we can optimize the way we do JIT there.
--
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