All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Alexei Starovoitov <ast@plumgrid.com>
Cc: roopa@cumulusnetworks.com, rshearma@brocade.com,
	ebiederm@xmission.com, hannes@stressinduktion.org,
	pshelar@nicira.com, jesse@nicira.com, davem@davemloft.net,
	daniel@iogearbox.net, tom@herbertland.com, edumazet@google.com,
	jiri@resnulli.us, marcelo.leitner@gmail.com,
	stephen@networkplumber.org, jpettit@nicira.com, kaber@trash.net,
	simon.horman@netronome.com, joestringer@nicira.com, ja@ssi.bg,
	weichunc@plumgrid.com, netdev@vger.kernel.org,
	dev@openvswitch.org
Subject: Re: [PATCH net-next 14/22] vxlan: Flow based tunneling
Date: Tue, 21 Jul 2015 19:53:11 +0200	[thread overview]
Message-ID: <20150721175311.GE23672@pox.localdomain> (raw)
In-Reply-To: <55AE81C1.2070909@plumgrid.com>

On 07/21/15 at 10:30am, Alexei Starovoitov wrote:
> RX:
> >+		info->mode = IP_TUNNEL_INFO_RX;
> >+		info->key.tun_flags = TUNNEL_KEY;
> >+		info->key.tun_id = cpu_to_be64(vni >> 8);
> ...
> TX:
> >+		dst_port = info->key.tp_dst ? : vxlan->dst_port;
> >+		vni = be64_to_cpu(info->key.tun_id);
> 
> I think the copy paste of ovs_tunnel_info into ip_tunnel_info
> can be improved. In particular instead of '__be64 tun_id'
> we can use '__u64 tun_id' which will avoid extra byteswaps for rx/tx
> paths.
> 
> netlink for this part also seems inconsistent.
> In the patch 16:
> +static const struct nla_policy ip_tun_policy[IP_TUN_MAX + 1] = {
> +	[IP_TUN_ID]		= { .type = NLA_U64 },
> ...
> +	if (tb[IP_TUN_ID])
> +		tun_info->key.tun_id = nla_get_u64(tb[IP_TUN_ID]);
> 
> I think nla_get_be64 should be there?
> and with my suggestion we can add be64_to_cpu() here instead
> of doing it per packet.
> Thoughts?

I like this. The be64 originates from how OVS stores the tun_id in the
flow key. I agree that it makes sense to limit and delay the byteswaps
to when OVS inherits the flow key from the ip_tunnel_info. I will send
a follow-up.

  reply	other threads:[~2015-07-21 17:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21  8:43 [PATCH net-next 00/22 v2] Lightweight & flow based encapsulation Thomas Graf
2015-07-21  8:43 ` [PATCH net-next 01/22] rtnetlink: introduce new RTA_ENCAP_TYPE and RTA_ENCAP attributes Thomas Graf
     [not found] ` <cover.1437468140.git.tgraf-G/eBtMaohhA@public.gmane.org>
2015-07-21  8:43   ` [PATCH net-next 02/22] lwtunnel: infrastructure for handling light weight tunnels like mpls Thomas Graf
2015-07-21  8:43   ` [PATCH net-next 03/22] ipv4: support for fib route lwtunnel encap attributes Thomas Graf
2015-07-21  8:43   ` [PATCH net-next 04/22] ipv6: " Thomas Graf
2015-07-21  8:43   ` [PATCH net-next 05/22] lwtunnel: support dst output redirect function Thomas Graf
2015-07-21  8:43   ` [PATCH net-next 06/22] ipv4: redirect dst output to lwtunnel output Thomas Graf
2015-07-21  8:43   ` [PATCH net-next 12/22] dst: Metadata destinations Thomas Graf
2015-07-22  8:58   ` [PATCH net-next 00/22 v2] Lightweight & flow based encapsulation thomas.morin-C0LM0jrOve7QT0dZR+AlfA
     [not found]     ` <17034_1437555506_55AF5B32_17034_5736_1_55AF5B30.8070208-C0LM0jrOve7QT0dZR+AlfA@public.gmane.org>
2015-07-22 15:43       ` roopa
2015-07-21  8:43 ` [PATCH net-next 07/22] ipv6: rt6_info output redirect to tunnel output Thomas Graf
2015-07-21  8:43 ` [PATCH net-next 08/22] mpls: export mpls functions for use by mpls iptunnels Thomas Graf
2015-07-21  8:43 ` [PATCH net-next 09/22] mpls: ip tunnel support Thomas Graf
2015-07-21  8:43 ` [PATCH net-next 10/22] ip_tunnel: Make ovs_tunnel_info and ovs_key_ipv4_tunnel generic Thomas Graf
2015-07-21  8:43 ` [PATCH net-next 11/22] icmp: Don't leak original dst into ip_route_input() Thomas Graf
2015-07-21  8:43 ` [PATCH net-next 13/22] arp: Inherit metadata dst when creating ARP requests Thomas Graf
2015-07-21  8:43 ` [PATCH net-next 14/22] vxlan: Flow based tunneling Thomas Graf
2015-07-21 17:30   ` Alexei Starovoitov
2015-07-21 17:53     ` Thomas Graf [this message]
2015-07-21  8:43 ` [PATCH net-next 15/22] route: Extend flow representation with tunnel key Thomas Graf
2015-07-21  8:44 ` [PATCH net-next 16/22] route: Per route IP tunnel metadata via lightweight tunnel Thomas Graf
2015-07-21  8:44 ` [PATCH net-next 17/22] fib: Add fib rule match on tunnel id Thomas Graf
2015-07-21  8:44 ` [PATCH net-next 18/22] vxlan: Factor out device configuration Thomas Graf
2015-07-21  8:44 ` [PATCH net-next 19/22] openvswitch: Make tunnel set action attach a metadata dst Thomas Graf
2015-07-21  8:44 ` [PATCH net-next 20/22] openvswitch: Move dev pointer into vport itself Thomas Graf
2015-07-21  8:44 ` [PATCH net-next 21/22] openvswitch: Abstract vport name through ovs_vport_name() Thomas Graf
2015-07-21  8:44 ` [PATCH net-next 22/22] openvswitch: Use regular VXLAN net_device device Thomas Graf
2015-07-21 17:39 ` [PATCH net-next 00/22 v2] Lightweight & flow based encapsulation David Miller
  -- strict thread matches above, loose matches on Subject: below --
2015-07-17 12:55 [PATCH net-next 00/22] " Thomas Graf
2015-07-17 12:55 ` [PATCH net-next 14/22] vxlan: Flow based tunneling Thomas Graf
2015-07-17 18:41   ` Alexei Starovoitov
2015-07-20 11:49     ` Thomas Graf
2015-07-20 17:15   ` Marcelo Ricardo Leitner
2015-07-20 17:41     ` Marcelo Ricardo Leitner

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=20150721175311.GE23672@pox.localdomain \
    --to=tgraf@suug.ch \
    --cc=ast@plumgrid.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=ja@ssi.bg \
    --cc=jesse@nicira.com \
    --cc=jiri@resnulli.us \
    --cc=joestringer@nicira.com \
    --cc=jpettit@nicira.com \
    --cc=kaber@trash.net \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=rshearma@brocade.com \
    --cc=simon.horman@netronome.com \
    --cc=stephen@networkplumber.org \
    --cc=tom@herbertland.com \
    --cc=weichunc@plumgrid.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.