From: Thomas F Herbert <thomasfherbert@gmail.com>
To: Pravin Shelar <pshelar@nicira.com>
Cc: netdev <netdev@vger.kernel.org>,
therbert@redhat.com, "dev@openvswitch.org" <dev@openvswitch.org>
Subject: Re: [PATCH 3/3] 802.1AD: Flow handling, actions, vlan parsing and netlink attributes
Date: Tue, 29 Sep 2015 19:52:30 -0400 [thread overview]
Message-ID: <560B243E.4090602@gmail.com> (raw)
In-Reply-To: <CALnjE+oqFNGUNHbXgkr8+gWM1TDFSi-jbuL+kggrqZD+AaDK1A@mail.gmail.com>
On 9/29/15 6:56 PM, Pravin Shelar wrote:
> On Fri, Sep 25, 2015 at 3:35 PM, Thomas F Herbert
> <thomasfherbert@gmail.com> wrote:
>> Pravin,
>>
>> Another comment and question. Please seen inline below.
>>
>> Thanks,
>>
>> --Tom
>>
>> On 9/24/15 7:42 PM, Pravin Shelar wrote:
>>> On Thu, Sep 24, 2015 at 10:58 AM, Thomas F Herbert
>>> <thomasfherbert@gmail.com> wrote:
>>>> Add support for 802.1ad including the ability to push and pop double
>>>> tagged vlans. Add support for 802.1ad to netlink parsing and flow
>>>> conversion. Uses double nested encap attributes to represent double
>>>> tagged vlan. Inner TPID encoded along with ctci in nested attributes.
>>>>
>>>> Signed-off-by: Thomas F Herbert <thomasfherbert@gmail.com>
>>>> ---
>>>> net/openvswitch/flow.c | 83 +++++++++++++++++----
>>>> net/openvswitch/flow.h | 5 ++
>>>> net/openvswitch/flow_netlink.c | 166
>>>> ++++++++++++++++++++++++++++++++++++++---
>>>> 3 files changed, 230 insertions(+), 24 deletions(-)
>>>>
> ...
>
>>>> @@ -1320,6 +1437,7 @@ static int __ovs_nla_put_key(const struct
>>>> sw_flow_key *swkey,
>>>> {
>>>> struct ovs_key_ethernet *eth_key;
>>>> struct nlattr *nla, *encap;
>>>> + struct nlattr *in_encap = NULL;
>>>>
>>>> if (nla_put_u32(skb, OVS_KEY_ATTR_RECIRC_ID, output->recirc_id))
>>>> goto nla_put_failure;
>>>> @@ -1368,17 +1486,42 @@ static int __ovs_nla_put_key(const struct
>>>> sw_flow_key *swkey,
>>>> ether_addr_copy(eth_key->eth_src, output->eth.src);
>>>> ether_addr_copy(eth_key->eth_dst, output->eth.dst);
>>>>
>>>> - if (swkey->eth.tci || swkey->eth.type == htons(ETH_P_8021Q)) {
>>>> + if (swkey->eth.tci || eth_type_vlan(swkey->eth.type)) {
>>>> __be16 eth_type;
>>>> - eth_type = !is_mask ? htons(ETH_P_8021Q) : htons(0xffff);
>>>> +
>>>> + if (swkey->eth.cvlan.ctci ||
>>>> + eth_type_vlan(swkey->eth.cvlan.c_tpid))
>>>> + eth_type = !is_mask ? htons(ETH_P_8021AD) :
>>>> + htons(0xffff);
>>>> + else
>>>> + eth_type = !is_mask ? htons(ETH_P_8021Q) :
>>>> + htons(0xffff);
>>>> +
>>> Here we can directly dump output->eth.type to netlink. No need to
>>> check for inner encap.
>> The eth.type is set to the inner encapsulated protocol not to the tpid. We
>> don't "know" what the outer tpid so I assume it is 802.1Q. To address this
>> situation, do you think I should add the outer tpid to sw_flow_key?
>> Also see comment above in flow.h.
>>
> With the addition of nested vlan, we need to add outer tpid. This will
> simplify vlan netlink serialization too.
Yes, thanks. I agree that this is the sensible approach.
next prev parent reply other threads:[~2015-09-29 23:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 17:58 [PATCH net-next V13 0/3] openvswitch: Add support for 802.1ad Thomas F Herbert
[not found] ` <1443117498-19123-1-git-send-email-thomasfherbert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-24 17:58 ` [PATCH 1/3] openvswitch: 802.1ad uapi changes Thomas F Herbert
2015-09-24 17:58 ` [PATCH 3/3] 802.1AD: Flow handling, actions, vlan parsing and netlink attributes Thomas F Herbert
[not found] ` <1443117498-19123-4-git-send-email-thomasfherbert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-24 23:42 ` Pravin Shelar
2015-09-25 19:18 ` Thomas F Herbert
2015-09-25 22:35 ` Thomas F Herbert
[not found] ` <5605CC2F.1010700-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-29 22:56 ` Pravin Shelar
2015-09-29 23:52 ` Thomas F Herbert [this message]
2015-09-24 17:58 ` [PATCH 2/3] Check for vlan ethernet types for 8021.q or 802.1ad Thomas F Herbert
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=560B243E.4090602@gmail.com \
--to=thomasfherbert@gmail.com \
--cc=dev@openvswitch.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
--cc=therbert@redhat.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.