netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: "Yang, Yi" <yi.y.yang@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"dev@openvswitch.org" <dev@openvswitch.org>,
	"blp@ovn.org" <blp@ovn.org>, "e@erig.me" <e@erig.me>,
	"jan.scheurich@ericsson.com" <jan.scheurich@ericsson.com>
Subject: Re: [PATCH net-next v4] openvswitch: enable NSH support
Date: Mon, 21 Aug 2017 11:47:13 +0200	[thread overview]
Message-ID: <20170821114713.7c6ebb9a@griffin> (raw)
In-Reply-To: <20170821091541.GA75219@cran64.bj.intel.com>

On Mon, 21 Aug 2017 17:15:42 +0800, Yang, Yi wrote:
> The issue is it is used union in
> 
> struct nsh_hdr {
>     ovs_be16 ver_flags_ttl_len;
>     uint8_t md_type;
>     uint8_t next_proto;
>     ovs_16aligned_be32 path_hdr;
>     union {
>         struct nsh_md1_ctx md1;
>         struct nsh_md2_tlv md2;
>     };
> };

This should work (modulo the non-kernel type names, of course). Did you
mean to put [] after md2?

> in Linux kernel build, it complained it, I changed it to

What was the error message?

> struct nsh_hdr {
>     ovs_be16 ver_flags_ttl_len;
>     uint8_t md_type;
>     uint8_t next_proto;
>     ovs_16aligned_be32 path_hdr;
>     union {
>         struct nsh_md1_ctx md1;
>         struct nsh_md2_tlv md2[0];
>     };
> };

I wouldn't use this. First, zero length array is a GCC extension. It
would indeed be better not to use that in uAPI. Second, I wouldn't even
use a flexible array member here, see my reply to Jan for the reasons.

Note that I commented on struct nsh_md2_tlv having __u8[] as the last
member which IMHO makes good sense. I'm not entirely sure what C99 says
about flexible array member being part of a struct inside union inside
a struct, though. GCC seems to cope with that just fine but AFAIK it
has some extension over the C standard wrt. flexible array members.

> I don't know how we can support this, is it a must-have thing?

What would happen if you get a GSO packet? Ports of an ovs bridge claim
GSO support, thus they may get a GSO packet. You have to handle it one
way or the other: either software segment the packet before pushing the
header, or implement proper GSO support for NSH.

> But struct nsh_hdr had different struct from struct ovs_key_nsh, we
> have no way to make them completely same, do you mean we should use the
> same name if they are same fields and represent the same thing?

Yes.

Thanks,

 Jiri

  reply	other threads:[~2017-08-21  9:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  7:24 [PATCH net-next v4] openvswitch: enable NSH support Yi Yang
2017-08-18 13:26 ` Jiri Benc
2017-08-18 13:31   ` Jiri Benc
2017-08-21  6:31     ` Yang, Yi
2017-08-21  6:11   ` Yang, Yi
     [not found]     ` <20170821061109.GA72656-re2EX8HDrk21gSHoDXDV2kEOCMrvLtNR@public.gmane.org>
2017-08-21  8:19       ` Jiri Benc
2017-08-21  8:39         ` Yang, Yi
2017-08-21  9:04           ` Jan Scheurich
     [not found]             ` <CFF8EF42F1132E4CBE2BF0AB6C21C58D727494F3-hqolJogE5njKJFWPz4pdheaU1rCVNFv4@public.gmane.org>
2017-08-21  9:31               ` Jan Scheurich
2017-08-21  9:35               ` Jiri Benc
2017-08-21  9:42                 ` Jan Scheurich
2017-08-21  9:51                   ` Jiri Benc
2017-08-21 10:10                     ` Jan Scheurich
     [not found]                       ` <CFF8EF42F1132E4CBE2BF0AB6C21C58D7274A5C7-hqolJogE5njKJFWPz4pdheaU1rCVNFv4@public.gmane.org>
2017-08-21 11:50                         ` Jiri Benc
2017-08-22  8:32                           ` Jan Scheurich
     [not found]                             ` <CFF8EF42F1132E4CBE2BF0AB6C21C58D7274C9FB-hqolJogE5njKJFWPz4pdheaU1rCVNFv4@public.gmane.org>
2017-08-22 17:35                               ` Ben Pfaff
2017-08-23 15:27                                 ` David Laight
     [not found]           ` <20170821083900.GA74649-re2EX8HDrk21gSHoDXDV2kEOCMrvLtNR@public.gmane.org>
2017-08-21  9:18             ` Jiri Benc
2017-08-21  9:15               ` Yang, Yi
2017-08-21  9:47                 ` Jiri Benc [this message]
2017-08-21 11:11                   ` Yang, Yi
2017-08-22  9:38                   ` Yang, Yi
2017-08-23  7:26                     ` Jiri Benc
2017-08-18 19:09 ` Eric Garver
2017-08-21  6:21   ` Yang, Yi

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=20170821114713.7c6ebb9a@griffin \
    --to=jbenc@redhat.com \
    --cc=blp@ovn.org \
    --cc=dev@openvswitch.org \
    --cc=e@erig.me \
    --cc=jan.scheurich@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=yi.y.yang@intel.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).