[dpdk-dev] [PATCH v2] net/enic: add private API to set ingress VLAN rewrite mode

John Daley (johndale) johndale at cisco.com
Wed Mar 13 22:11:23 CET 2019

Due to time zone differences, I'll answer for Hyong (below).

> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Wednesday, March 13, 2019 1:36 PM
> To: Ferruh Yigit <ferruh.yigit at intel.com>; Hyong Youb Kim (hyonkim)
> <hyonkim at cisco.com>
> Cc: Andrew Rybchenko <arybchenko at solarflare.com>; Qi Zhang
> <qi.z.zhang at intel.com>; dev at dpdk.org; John Daley (johndale)
> <johndale at cisco.com>; Shahaf Shuler <shahafs at mellanox.com>; Jerin Jacob
> <jerin.jacob at caviumnetworks.com>; David Marchand
> <david.marchand at 6wind.com>; Maxime Coquelin
> <maxime.coquelin at redhat.com>; Konstantin Ananyev
> <konstantin.ananyev at intel.com>; Hemant Agrawal
> <hemant.agrawal at nxp.com>; Stephen Hemminger
> <stephen at networkplumber.org>
> Subject: Re: [PATCH v2] net/enic: add private API to set ingress VLAN rewrite
> mode
> 13/03/2019 19:32, Ferruh Yigit:
> > On 3/5/2019 7:11 AM, Hyong Youb Kim wrote:
> > > The driver currently has a devarg to set the rewrite mode during
> > > init. Some apps want to programatically set it after running
> > > rte_eal_init() and finding that ports are VIC. Add a private
> > > function to support such applications.
> >
> > It is not good idea to have PMD specific APIs (although we already have
> some).
> >
> > Specific to this case, as far as I can see it is to pass a config
> > value and do the action related to it, what would you think having a
> > generic key/value set/get API in ethdev for this? Similar to rawdev
> get_attr/set_attr [1]?
> >
> > My concern is it may turn into something like ioctl with many things
> > pushed to it, and cause possible duplication ...
> Yes, it is clearly ioctl style.
> Please could you explain more what is the rewrite mode?
> Does it apply to the port or the queue?
It applies to a port. By default the Cisco VIC VLAN tags every packet on ingress even if they were untagged coming in on the wire. They are tagged with VLAN 0 or a VLAN id programmed into the NIC depending on the configuration. Its part of the original design, to maintain priority bits, ancient history.

Some apps don't like this (VPP) or take a slower path (OVS). Hyong added a ig-vlan-rewrite=untag devarg to disable this (leave untagged/default vlan packets untagged) during rte_eal_init and this is helpful for OVS, but VPP likes to set the rewrite mode after rte_eal_init() and finding the ports are VIC ports. So that is the reasoning behind the private API call.

More information about the dev mailing list