[dpdk-dev] [PATCH v4 12/12] examples/l3fwd: add option to parse ptype

2016-02-26 Thread Tan, Jianfeng
Hi Konstantin, On 2/26/2016 9:14 PM, Ananyev, Konstantin wrote: > Hi Jianfeng, > >> +static int ... >> +if (hdr_len == sizeof(struct ipv4_hdr) && >> +(hdr->next_proto_id == 6 || >> + hdr->next_proto_id == 17)) > Use IPPORTO_UDP,

[dpdk-dev] [PATCH v4 12/12] examples/l3fwd: add option to parse ptype

2016-02-26 Thread Ananyev, Konstantin
> > Actually it is a good point: > > for EM case should l3fwd process only TCP/UDP packets? > > If yes, then it needs to check not only L3, but also L4 type too > > Which means that for EM and LPM check_packet_type_ok() should also be > > different. > > Or we can leave it as it is - in that case

[dpdk-dev] [PATCH v4 12/12] examples/l3fwd: add option to parse ptype

2016-02-26 Thread Ananyev, Konstantin
Hi Jianfeng, > > +static int > +check_packet_type_ok(int portid) > +{ > + int i, ret; > + int ptype_l3_ipv4 = 0, ptype_l3_ipv6 = 0; > + > + ret = rte_eth_dev_get_ptype_info(portid, RTE_PTYPE_L3_MASK, NULL, 0); > + if (ret <= 0) > + return 0; > + > + uint32_t

[dpdk-dev] [PATCH v4 12/12] examples/l3fwd: add option to parse ptype

2016-02-26 Thread Jianfeng Tan
As a example to use ptype info, l3fwd needs firstly to use rte_eth_dev_get_ptype_info() API to check if device and/or PMD driver will parse and fill the needed packet type; if not, use the newly added option, --parse-ptype, to analyze it in the callback softly. Under the mode of EXACT_MATCH, ip