netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: wenxu <wenxu@ucloud.cn>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>, pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: Re: [PATCH nf-next v2] netfilter:nft_meta: add NFT_META_VLAN support
Date: Sat, 6 Jul 2019 22:29:14 +0800	[thread overview]
Message-ID: <83e9506d-8888-f841-f16c-0d038e52b39e@ucloud.cn> (raw)
In-Reply-To: <caaaa242-6bb8-9d5e-af66-a0cd6592f81d@cumulusnetworks.com>


在 2019/7/6 20:02, Nikolay Aleksandrov 写道:
> On 05/07/2019 16:16, wenxu@ucloud.cn wrote:
>> From: wenxu <wenxu@ucloud.cn>
>>
>> This patch provide a meta vlan to set the vlan tag of the packet.
>>
>> for q-in-q outer vlan id 20:
>> meta vlan set 0x88a8:20
>>
>> set the default 0x8100 vlan type with vlan id 20
>> meta vlan set 20
>>
>> Signed-off-by: wenxu <wenxu@ucloud.cn>
>> ---
>>  include/net/netfilter/nft_meta.h         |  5 ++++-
>>  include/uapi/linux/netfilter/nf_tables.h |  4 ++++
>>  net/netfilter/nft_meta.c                 | 25 +++++++++++++++++++++++++
>>  3 files changed, 33 insertions(+), 1 deletion(-)
>>
> The patch looks fine, just a note: you'll only be able to work with the
> outer tag, so guessing to achieve a double-tagged frame you'll have to
> add another NFT_META_VLAN_INNER(?) and will have to organize them one
> after another.

yes, It's just set/mangle the meta vlan data. 
I think it's a good idear for stacked tagged with NFT_META_VLAN_INNER, in 
this case it should check the the proto of vlan tag already on packet
There are three case:
1. packet already contain a vlan header with proto 0x88a8, it should push the inner vlan tag
2. there is no outer vlan tag, maybe we should add a inner 0x8100 tag 
and outer 0x88a8 tag?
3.  packet already contain a vlan tag with proto 0x8100, push the vlan tag and add outer 0x88a8 tag ?

>
>
>

  reply	other threads:[~2019-07-06 14:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 13:16 [PATCH 1/7 nf-next v2] netfilter: separate bridge meta key from nft_meta into meta_bridge wenxu
2019-07-05 13:16 ` [PATCH 2/7 nf-next v2] netfilter: nft_meta_bridge: Remove the br_private.h header wenxu
2019-07-05 20:45   ` Pablo Neira Ayuso
2019-07-05 13:16 ` [PATCH 3/7 nf-next v2] bridge: add br_vlan_get_pvid_rcu() wenxu
2019-07-05 20:45   ` Pablo Neira Ayuso
2019-07-05 13:16 ` [PATCH 4/7 nf-next v2] netfilter: nft_meta_bridge: add NFT_META_BRI_IIFPVID support wenxu
2019-07-05 20:45   ` Pablo Neira Ayuso
     [not found]   ` <20190813195427.vmootvj5rmxgihml@salvia>
2019-08-13 19:54     ` Pablo Neira Ayuso
2019-07-05 13:16 ` [PATCH 5/7 nf-next v2] bridge: add br_vlan_get_proto() wenxu
2019-07-05 20:45   ` Pablo Neira Ayuso
2019-07-05 13:16 ` [PATCH 6/7 nf-next v2] netfilter: nft_meta_bridge: Add NFT_META_BRI_IIFVPROTO support wenxu
2019-07-05 20:45   ` Pablo Neira Ayuso
2019-07-05 13:16 ` [PATCH nf-next v2] netfilter:nft_meta: add NFT_META_VLAN support wenxu
2019-07-06 12:02   ` Nikolay Aleksandrov
2019-07-06 14:29     ` wenxu [this message]
2019-07-07 10:12       ` Nikolay Aleksandrov
2019-07-07 10:13         ` Nikolay Aleksandrov
2019-07-05 20:44 ` [PATCH 1/7 nf-next v2] netfilter: separate bridge meta key from nft_meta into meta_bridge Pablo Neira Ayuso

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=83e9506d-8888-f841-f16c-0d038e52b39e@ucloud.cn \
    --to=wenxu@ucloud.cn \
    --cc=bridge@lists.linux-foundation.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=pablo@netfilter.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).