netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pravin Shelar <pshelar@ovn.org>
To: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Cc: Greg Rose <gvrose8192@gmail.com>, Ben Pfaff <blp@ovn.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	ovs dev <dev@openvswitch.org>
Subject: Re: [PATCH net-next v4] net: openvswitch: add hash info to upcall
Date: Wed, 13 Nov 2019 21:03:22 -0800	[thread overview]
Message-ID: <CAOrHB_Ci+iSL=Ctt_TjNuFc3=+gRTdWwdGH4hgpUVS1Thc8nGA@mail.gmail.com> (raw)
In-Reply-To: <1573657489-16067-1-git-send-email-xiangxia.m.yue@gmail.com>

On Wed, Nov 13, 2019 at 7:05 AM <xiangxia.m.yue@gmail.com> wrote:
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> When using the kernel datapath, the upcall don't
> include skb hash info relatived. That will introduce
> some problem, because the hash of skb is important
> in kernel stack. For example, VXLAN module uses
> it to select UDP src port. The tx queue selection
> may also use the hash in stack.
>
> Hash is computed in different ways. Hash is random
> for a TCP socket, and hash may be computed in hardware,
> or software stack. Recalculation hash is not easy.
>
> Hash of TCP socket is computed:
> tcp_v4_connect
>     -> sk_set_txhash (is random)
>
> __tcp_transmit_skb
>     -> skb_set_hash_from_sk
>
> There will be one upcall, without information of skb
> hash, to ovs-vswitchd, for the first packet of a TCP
> session. The rest packets will be processed in Open vSwitch
> modules, hash kept. If this tcp session is forward to
> VXLAN module, then the UDP src port of first tcp packet
> is different from rest packets.
>
> TCP packets may come from the host or dockers, to Open vSwitch.
> To fix it, we store the hash info to upcall, and restore hash
> when packets sent back.
>
> +---------------+          +-------------------------+
> |   Docker/VMs  |          |     ovs-vswitchd        |
> +----+----------+          +-+--------------------+--+
>      |                       ^                    |
>      |                       |                    |
>      |                       |  upcall            v restore packet hash (not recalculate)
>      |                     +-+--------------------+--+
>      |  tap netdev         |                         |   vxlan module
>      +--------------->     +-->  Open vSwitch ko     +-->
>        or internal type    |                         |
>                            +-------------------------+
>
> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2019-October/364062.html
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>

Acked-by: Pravin B Shelar <pshelar@ovn.org>

Thanks.

  reply	other threads:[~2019-11-14  5:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13 15:04 [PATCH net-next v4] net: openvswitch: add hash info to upcall xiangxia.m.yue
2019-11-14  5:03 ` Pravin Shelar [this message]
2019-11-15  1: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='CAOrHB_Ci+iSL=Ctt_TjNuFc3=+gRTdWwdGH4hgpUVS1Thc8nGA@mail.gmail.com' \
    --to=pshelar@ovn.org \
    --cc=blp@ovn.org \
    --cc=dev@openvswitch.org \
    --cc=gvrose8192@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiangxia.m.yue@gmail.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).