netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Jesse Gross <jesse@nicira.com>
Cc: David Miller <davem@davemloft.net>,
	"dev@openvswitch.org" <dev@openvswitch.org>,
	netdev <netdev@vger.kernel.org>,
	Daniel Borkmann <dborkman@redhat.com>,
	ffusco@redhat.com, fleitner@redhat.com,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Ben Hutchings <bhutchings@solarflare.com>
Subject: Re: [net-next 7/7] openvswitch: Use skb_zerocopy() for upcall
Date: Thu, 5 Dec 2013 21:29:43 +0000	[thread overview]
Message-ID: <20131205212943.GA11286@casper.infradead.org> (raw)
In-Reply-To: <CAEP_g=8j_JUk9mDc0KLPSCoWuKwssfCrTi3-Vp8jX4iNN-9Sng@mail.gmail.com>

On 12/03/13 at 09:43pm, Jesse Gross wrote:

Thanks for merging a first set of patches

> On Sat, Nov 30, 2013 at 4:21 AM, Thomas Graf <tgraf@suug.ch> wrote:
> > diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
> > index 8eaa39a..867edf1 100644
> > --- a/net/openvswitch/datapath.c
> > +++ b/net/openvswitch/datapath.c
> > +static int queue_gso_packets(struct datapath *, struct net *, int dp_ifindex,
> > +                            struct sk_buff *, const struct dp_upcall_info *);
> > +static int queue_userspace_packet(struct datapath *, struct net *,
> > +                                 int dp_ifindex, struct sk_buff *,
> >                                   const struct dp_upcall_info *);
> 
> Should we drop the dp_ifindex arguments from these functions? It
> should be trivially derivable from struct datapath.

Sounds good
> 
> >  static size_t upcall_msg_size(const struct sk_buff *skb,
> > -                             const struct nlattr *userdata)
> > +                             const struct nlattr *userdata,
> > +                             unsigned int hdrlen)
> 
> I think that 'skb' is now unused.

Right

> 
> > @@ -427,7 +429,21 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
> >                 goto out;
> >         }
> >
> > -       len = upcall_msg_size(skb, upcall_info->userdata);
> > +       /* Complete checksum if needed */
> > +       if (skb->ip_summed == CHECKSUM_PARTIAL &&
> > +           (err = skb_checksum_help(skb)))
> > +               goto out;
> 
> I think that we can remove the hardware features argument to
> __skb_gso_segment() in queue_gso_packet(). It was there to take
> advantage of the copy and checksum optimization but that's no longer
> present.

In the case of a mapped skb we could still make use of it as we copy
the packet into the headroom. It would mean integrating the logic
into skb_zerocopy() though so I'd say we stay with what you propose.
It shouldn't be the fast path anyway.

> > @@ -447,13 +463,17 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
> >                           nla_len(upcall_info->userdata),
> >                           nla_data(upcall_info->userdata));
> >
> > -       nla = __nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, skb->len);
> > +       /* Only reserve room for attribute header, packet data is added
> > +        * in skb_zerocopy() */
> > +       if (!(nla = nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, 0)))
> > +               goto out;
> 
> Does this initialized 'err' on failure?

Good catch, I'll fix this up as well.

      reply	other threads:[~2013-12-05 21:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30 12:21 [PATCH net-next 0/8 v8] Open vSwitch upcall optimiziations Thomas Graf
2013-11-30 12:21 ` [net-next 1/7] genl: Add genlmsg_new_unicast() for unicast message allocation Thomas Graf
     [not found] ` <cover.1385813891.git.tgraf-G/eBtMaohhA@public.gmane.org>
2013-11-30 12:21   ` [net-next 2/7] netlink: Avoid netlink mmap alloc if msg size exceeds frame size Thomas Graf
2013-11-30 12:21 ` [net-next 3/7] openvswitch: Enable memory mapped Netlink i/o Thomas Graf
     [not found]   ` <9f7f05a726935c434d43d92c2908a997c403725b.1385813891.git.tgraf-G/eBtMaohhA@public.gmane.org>
2013-11-30 12:35     ` Florian Westphal
2013-11-30 14:04       ` Thomas Graf
2013-12-04  5:45   ` Jesse Gross
2013-11-30 12:21 ` [net-next 4/7] net: Export skb_zerocopy() to zerocopy from one skb to another Thomas Graf
2013-11-30 12:21 ` [net-next 5/7] openvswitch: Allow user space to announce ability to accept unaligned Netlink messages Thomas Graf
2013-11-30 12:21 ` [net-next 6/7] openvswitch: Drop user features if old user space attempted to create datapath Thomas Graf
2013-11-30 12:21 ` [net-next 7/7] openvswitch: Use skb_zerocopy() for upcall Thomas Graf
2013-12-04  5:43   ` Jesse Gross
2013-12-05 21:29     ` Thomas Graf [this message]

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=20131205212943.GA11286@casper.infradead.org \
    --to=tgraf@suug.ch \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=dev@openvswitch.org \
    --cc=eric.dumazet@gmail.com \
    --cc=ffusco@redhat.com \
    --cc=fleitner@redhat.com \
    --cc=jesse@nicira.com \
    --cc=netdev@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).