From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <alex@weka.io>
Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com
 [209.85.217.170]) by dpdk.org (Postfix) with ESMTP id B071195E7
 for <dev@dpdk.org>; Sun, 21 Dec 2014 10:12:22 +0100 (CET)
Received: by mail-lb0-f170.google.com with SMTP id 10so2708370lbg.15
 for <dev@dpdk.org>; Sun, 21 Dec 2014 01:12:22 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:date
 :message-id:subject:from:to:cc:content-type;
 bh=TdCRB5SJ+jyIz80PadSuAeMANzldgzn55MtqyEbMCEk=;
 b=L/KaYk0HCHsh0q3S1u0VK+vDROEZoBJUd04YnpkKbIAwJpNTT1++q4S2+bG9wyJ4Nt
 hGh4BOdZMr0ICv4BXV8fdOiij+/TsDAZeifpUABRTlQ4KB5H495LSi88NY/YQYXT14HG
 fnSDZIFP9haGSV4XF+7Pc2QsnEh4/DKrUJZgBdWnm8BpJpkeYGxcrTiRj1pI2fTat83x
 UD5UgVaRxiJpW0jSN4aSzYYXn4qMut78vGXVIjHGCGdFCSPPv6A/HQH4anpH1dwnI/iR
 RQUfUvZBkA+duy9a8jk88SP8J+1cCM6djfhwAyO7RJWhS1wPf3AKcs6pqxHQGFXVmeTr
 0J7A==
X-Gm-Message-State: ALoCoQkuX/SrfMgFAf8QHZq8uEL4R3RVPEYcTX0tyiWPIHDk/qhwPMVSSMyXZ8ZmUDdePpBBPKVf
MIME-Version: 1.0
X-Received: by 10.152.44.167 with SMTP id f7mr6520733lam.92.1419153142275;
 Sun, 21 Dec 2014 01:12:22 -0800 (PST)
Received: by 10.25.215.208 with HTTP; Sun, 21 Dec 2014 01:12:22 -0800 (PST)
In-Reply-To: <ac4ec7d3-617c-46ae-a891-eb95dd6690f6@email.bluemailapp.com>
References: <ac4ec7d3-617c-46ae-a891-eb95dd6690f6@email.bluemailapp.com>
Date: Sun, 21 Dec 2014 11:12:22 +0200
Message-ID: <CAKfHP0WrXJT-UAoq21LoHqAdTMd0wOU=-tT0K8cRm1r88R7rcQ@mail.gmail.com>
From: Alex Markuze <alex@weka.io>
To: Padam Jeet Singh <padam.singh@inventum.net>
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] VLAN header insertion and removal
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Dec 2014 09:12:22 -0000

On ingress when configuring the device
                                        1.modify
the rte_eth_conf.rxmode.hw_vlan_strip  = 1,

On egress you need to  modify the rte_van_macip struct in the sent mbuf*.
(rte_mbuf.h)
                                       1. add the PKT_TX_VLAN_PKT to the
ol_flags fields.
                                       2. fill the plan_tci in
pkt.vlan_macip.f.vlan_tci

*This is true for dpdk 1.7, structs may have moved in 1.8

On Sat, Dec 20, 2014 at 8:39 PM, Padam Jeet Singh <padam.singh@inventum.net>
wrote:

> Hello,
>
> I have done a simple mbuf adjust and prepend to achieve the removal and
> insertion of the vlan header and it works fine. The use case is something
> similar to the l3fwd example where one port has traffic coming in on
> multiple vlans and the other port has no vlans. The packet processing path
> in the middle inserts or removes the vlan.
>
> Is there an offload flag or mode where this can be done in hardware? Or is
> there a more optimized way to do this in dpdk? For sake of performance I
> want to avoid the copy ethernet header, modify mbuf, copy back the header
> steps.
>
> Thanks,
> Padam
> ---------------------------
> Sent from my mobile. Please excuse the brevity, spelling and punctuation.
>
>