From: David Miller <davem@davemloft.net>
To: dsa@cumulusnetworks.com
Cc: netdev@vger.kernel.org, shm@cumulusnetworks.com
Subject: Re: [PATCH net-next] vrf: Add ethernet header for pass through VRF device
Date: Tue, 25 Aug 2015 15:51:08 -0700 (PDT) [thread overview]
Message-ID: <20150825.155108.983138344238637012.davem@davemloft.net> (raw)
In-Reply-To: <55DCEE43.4000200@cumulusnetworks.com>
From: David Ahern <dsa@cumulusnetworks.com>
Date: Tue, 25 Aug 2015 15:37:55 -0700
> On 8/25/15 2:02 PM, David Miller wrote:
>> From: David Ahern <dsa@cumulusnetworks.com>
>> Date: Sun, 23 Aug 2015 12:41:00 -0600
>>
>>> @@ -250,6 +253,17 @@ static netdev_tx_t vrf_xmit(struct sk_buff *skb,
>>> struct net_device *dev)
>>>
>>> static netdev_tx_t vrf_finish(struct sock *sk, struct sk_buff *skb)
>>> {
>>> + int err;
>>> +
>>> + __skb_pull(skb, skb_network_offset(skb));
>>> + err = dev_hard_header(skb, skb->dev, ntohs(skb->protocol),
>>> + NULL, NULL, skb->len);
>>> +
>>> + if (err < 0) {
>>> + vrf_tx_error(skb->dev, skb);
>>> + return -EINVAL;
>>> + }
>>> +
>>> return dev_queue_xmit(skb);
>>
>> This is expensive and rediculous to do for every TX frame.
>>
>> You'll need to find another way.
>>
>
> The packet is directed here from the IP layer via the custom dst, so
> there is no L2 header on the skb. So while the push and pop of the
> header seems silly it is part and parcel of the feature to run tcpdump
> on the VRF device. I don't see how it could be done any other way.
You're losing a significant optimization on the transmit path by not
using the neighbour table entry hard header cache.
That's what I want you to fix.
See dst_neigh_output() and in particular neigh_hh_output().
next prev parent reply other threads:[~2015-08-25 22:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-23 18:41 [PATCH net-next] vrf: Add ethernet header for pass through VRF device David Ahern
2015-08-25 21:02 ` David Miller
2015-08-25 22:37 ` David Ahern
2015-08-25 22:51 ` David Miller [this message]
2015-08-26 19:36 ` David Ahern
2015-08-27 0:30 ` David Miller
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=20150825.155108.983138344238637012.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
--cc=shm@cumulusnetworks.com \
/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).