netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: netdev@vger.kernel.org,
	John Fastabend <john.r.fastabend@intel.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	David Miller <davem@davemloft.net>
Subject: Re: [RFC PATCH 0/2 v2] net: alternate proposal for using macvlans with forwarding acceleration
Date: Mon, 07 Oct 2013 15:09:11 -0700	[thread overview]
Message-ID: <52533107.6060306@gmail.com> (raw)
In-Reply-To: <1380917405-23801-1-git-send-email-nhorman@tuxdriver.com>

On 10/04/2013 01:10 PM, Neil Horman wrote:
> Hey all-
>       heres the next, updated version of the vsi/macvlan integration that we've
> been discussing.
>
> Some change notes:
>
> * Changes to the fowarding ops structure - Removed the priv_size field, and
> added a flags field.  Removal of the priv_size field was accomplished by just
> having the add method return a void * and using ERR_PTR and PTR_ERR checks,
> which also allows us to allocate memory for the acceleration path in the driver,
> which I like.  I'm not super happy still with how I'm using the flags (currenly
> only used to indicate support for feature sets), but at least we have the flags
> now, and they can be exposed to user space via iproute2 or ethtool if need be

For the flag why not use the existing feature flag namespace? Adding
NETIF_F_HW_L2FW_DOFFLOAD or something equivalent to netdev_features.h
and also doing the string updates would get the userspace support for
free.

The one downside of a global feature flag approach like this is if
the user wants to create some offloaded macvlan devices and some SW
only macvlans the control sequence is a bit clumsy. But unless we add
a new flag to the macvlan netlink message I'm not sure how to avoid
this. Further if you have multiple control applications
creating/deleting these macvlans the flag mechanism starts to break
down. One app sets the flag the other deletes, you get the idea.

It might be worth adding a netlink flag to change the state of
the HW offload. I know this goes against the 'it just gets offloaded'
line of thought, but if you make the default to offload then it should
be OK.

>
> * Changes to the Transmit path - Specifically I'm using dev_queue_xmit to send
> frames now, which I like as it makes the macvlan subject to the lowerdevs qdisc
> configuration.

This creates perhaps another oddity where on TX the packets will be
visible to the lowerdev. Think tcpdump and egress qdisc. But on ingress
the packets will be delivered directly to macvlan device. Also I was
thinking there might be good reasons to skip the lowerdev qdisc, for
performance reasons or QOS setups.

So it might be best the way you had it in the previous revision even if
it was not functionally equivalent to the SW path. If you skip the lower
dev and submit directly to the hardware then you also don't need a
sk_buff change. The driver can do a lookup via the skb->dev field and
additional hints from the stack are not needed.

If there is a perceived problem with not having the HW and SW completely
equivalent functionally we could always default the feature flag to off.
Then enabling the feature would be a single 'ethtool' command. This
seems like a nice compromise.

I like where this is going though!

Thanks,
John

-- 
John Fastabend         Intel Corporation

  parent reply	other threads:[~2013-10-07 22:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 18:45 [RFC PATCH 0/4] Series short description John Fastabend
2013-09-11 18:46 ` [RFC PATCH 1/4] net: rtnetlink: make priv_size a function for devs with dynamic size John Fastabend
2013-09-11 18:46 ` [RFC PATCH 2/4] net: Add lower dev list helpers John Fastabend
2013-09-14 12:27   ` Veaceslav Falico
2013-09-14 20:43     ` John Fastabend
2013-09-14 21:14       ` Veaceslav Falico
2013-09-11 18:47 ` [RFC PATCH 3/4] net: VSI: Add virtual station interface support John Fastabend
2013-09-20 23:12   ` Neil Horman
2013-09-21 17:30     ` John Fastabend
2013-09-22 16:44       ` Neil Horman
2013-09-11 18:47 ` [RFC PATCH 4/4] ixgbe: Adding VSI support to ixgbe John Fastabend
2013-09-25 20:16 ` [RFC PATCH 0/2] net: alternate proposal for using macvlans with forwarding acceleration Neil Horman
2013-09-25 20:16   ` [RFC PATCH 1/2] net: Add layer 2 hardware acceleration operations for macvlan devices Neil Horman
2013-10-02  7:08     ` John Fastabend
2013-10-02 12:53       ` Neil Horman
2013-09-25 20:16   ` [RFC PATCH 2/2] ixgbe: enable l2 forwarding acceleration for macvlans Neil Horman
2013-10-02  6:31   ` [RFC PATCH 0/2] net: alternate proposal for using macvlans with forwarding acceleration John Fastabend
2013-10-02 13:28     ` Neil Horman
2013-10-04 20:10   ` [RFC PATCH 0/2 v2] " Neil Horman
2013-10-04 20:10     ` [PATCH 1/2] net: Add layer 2 hardware acceleration operations for macvlan devices Neil Horman
2013-10-07 19:52       ` David Miller
2013-10-07 21:20         ` Neil Horman
2013-10-07 21:34           ` David Miller
2013-10-07 22:39             ` John Fastabend
2013-10-08  0:52               ` Neil Horman
2013-10-04 20:10     ` [PATCH 2/2] ixgbe: enable l2 forwarding acceleration for macvlans Neil Horman
2013-10-07 22:09     ` John Fastabend [this message]
2013-10-08  1:08       ` [RFC PATCH 0/2 v2] net: alternate proposal for using macvlans with forwarding acceleration Neil Horman
2013-10-11 18:43   ` [RFC PATCH 0/2 v3] " Neil Horman
2013-10-11 18:43     ` [PATCH 1/2] net: Add layer 2 hardware acceleration operations for macvlan devices Neil Horman
2013-10-13 20:46       ` John Fastabend
2013-10-14 10:48         ` Neil Horman
2013-10-11 18:43     ` [PATCH 2/2] ixgbe: enable l2 forwarding acceleration for macvlans Neil Horman
2013-10-13 20:48       ` John Fastabend
2013-10-14 10:50         ` Neil Horman

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=52533107.6060306@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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).