[dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2 tunnel operation

He, Shaopeng shaopeng.he at intel.com
Mon Mar 7 03:04:42 CET 2016


Hi Wenzhuo,

> -----Original Message-----
> From: Lu, Wenzhuo
> Sent: Friday, March 04, 2016 11:31 AM
> To: He, Shaopeng <shaopeng.he at intel.com>; dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2
> tunnel operation
> 
> Hi Shaopeng,
> 
> 
> > -----Original Message-----
> > From: He, Shaopeng
> > Sent: Friday, March 4, 2016 9:47 AM
> > To: Lu, Wenzhuo; dev at dpdk.org
> > Subject: RE: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new
> > l2 tunnel operation
> >
> > Hi Wenzhuo,
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wenzhuo Lu
> > > Sent: Thursday, February 18, 2016 10:46 AM
> > > To: dev at dpdk.org
> > > Subject: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2
> > > tunnel operation
> > >
> > > Add functions to support the new l2 tunnel operation.
> > > 1, Insertion and stripping for l2 tunnel tag.
> > > 2, Forwarding the packets to a pool based on l2 tunnel tag.
> > >
> > > Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
> > > ---
> > >  lib/librte_ether/rte_ethdev.c | 183
> > > ++++++++++++++++++++++++++++++++++++
> > >  lib/librte_ether/rte_ethdev.h | 214
> > > ++++++++++++++++++++++++++++++++++++++++++
> > >  2 files changed, 397 insertions(+)
> > >
> > > diff --git a/lib/librte_ether/rte_ethdev.c
> > > b/lib/librte_ether/rte_ethdev.c index c5c12cb..6bc19d4 100644
> > > --- a/lib/librte_ether/rte_ethdev.c
> > > +++ b/lib/librte_ether/rte_ethdev.c
> > > @@ -3298,3 +3298,186 @@ rte_eth_dev_l2_tunnel_disable(uint8_t
> port_id,
> > >  				-ENOTSUP);
> > >  	return (*dev->dev_ops->l2_tunnel_disable)(dev, l2_tunnel_type);  }
> > > +
> > > +int
> > > +rte_eth_dev_l2_tunnel_insertion_enable(uint8_t port_id,
> > > +				       struct rte_eth_l2_tunnel *l2_tunnel,
> > > +				       uint16_t vf_id)
> > > +{
> > > +	struct rte_eth_dev *dev;
> > > +
> > > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > > +	if (l2_tunnel == NULL) {
> > > +		RTE_PMD_DEBUG_TRACE("Invalid l2_tunnel parameter\n");
> > > +		return -EINVAL;
> > > +	}
> > > +
> > > +	if (l2_tunnel->l2_tunnel_type >= RTE_L2_TUNNEL_TYPE_MAX) {
> >
> > How about the value of RTE_L2_TUNNEL_TYPE_NONE here, is it an invalid
> > type too?
> Honestly, the purpose I check this tunnel type here is to avoid the subscript
> out of bound error if some NIC create an array which index is tunnel type.
> So, although type_none is an invalid type, I don't check it here. How do you
> think about it? Thanks.
Ok for me if it will not cause problem and be checked in other place

Thanks,
--Shaopeng



More information about the dev mailing list