From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E5474201 for ; Fri, 3 Mar 2017 16:31:15 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2017 07:31:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,237,1484035200"; d="scan'208";a="1104433594" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 03 Mar 2017 07:31:15 -0800 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.17]) by fmsmsx104.amr.corp.intel.com ([169.254.3.29]) with mapi id 14.03.0248.002; Fri, 3 Mar 2017 07:31:14 -0800 From: "Wiles, Keith" To: Pascal Mazon CC: "dev@dpdk.org" Thread-Topic: [PATCH 5/6] net/tap: add packet type management Thread-Index: AQHSlAMe5cJ/51kDn0KVSe+iAUMP8aGDxHeA Date: Fri, 3 Mar 2017 15:31:14 +0000 Message-ID: <0FF8ED8E-9F3B-421A-AF51-7F6557095D59@intel.com> References: <5044b7ef7b9e5207fb2202bd5715524bd0d49379.1488534161.git.pascal.mazon@6wind.com> In-Reply-To: <5044b7ef7b9e5207fb2202bd5715524bd0d49379.1488534161.git.pascal.mazon@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.49.209] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 5/6] net/tap: add packet type management X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 15:31:16 -0000 > On Mar 3, 2017, at 3:46 AM, Pascal Mazon wrote: >=20 > Advertize RTE_PTYPE_UNKNOWN since tap does not report any packet type. >=20 > Signed-off-by: Pascal Mazon > --- > doc/guides/nics/features/tap.ini | 1 + > drivers/net/tap/rte_eth_tap.c | 15 +++++++++++++++ > 2 files changed, 16 insertions(+) >=20 > diff --git a/doc/guides/nics/features/tap.ini b/doc/guides/nics/features/= tap.ini > index 6aa11874e2bc..7f3f4d661dd7 100644 > --- a/doc/guides/nics/features/tap.ini > +++ b/doc/guides/nics/features/tap.ini > @@ -13,6 +13,7 @@ MTU update =3D Y > Multicast MAC filter =3D Y > Speed capabilities =3D Y > Unicast MAC filter =3D Y > +Packet type parsing =3D Y > Other kdrv =3D Y > ARMv7 =3D Y > ARMv8 =3D Y > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.= c > index 64b84cd76321..e4af36a6d142 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -36,6 +36,7 @@ > #include > #include > #include > +#include >=20 > #include > #include > @@ -216,6 +217,8 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uin= t16_t nb_pkts) > mbuf->data_len =3D len; > mbuf->pkt_len =3D len; > mbuf->port =3D rxq->in_port; > + mbuf->packet_type =3D rte_net_get_ptype(mbuf, NULL, > + RTE_PTYPE_ALL_MASK); >=20 > /* account for the receive frame */ > bufs[num_rx++] =3D mbuf; > @@ -760,6 +763,17 @@ tap_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > return 0; > } >=20 > +static const uint32_t* > +tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) > +{ > + static const uint32_t ptypes[] =3D { > + RTE_PTYPE_UNKNOWN, > + > + }; > + > + return ptypes; > +} Can we just add the code to grab the ptype value instead of just saying not= supported. The original code would just return an error from ethdev correct, what was = wrong with that one. I would like to see the tap PMD just return the ptype = would that not be more useful? > + > static const struct eth_dev_ops ops =3D { > .dev_start =3D tap_dev_start, > .dev_stop =3D tap_dev_stop, > @@ -784,6 +798,7 @@ static const struct eth_dev_ops ops =3D { > .mtu_set =3D tap_mtu_set, > .stats_get =3D tap_stats_get, > .stats_reset =3D tap_stats_reset, > + .dev_supported_ptypes_get =3D tap_dev_supported_ptypes_get, > }; >=20 > static int > --=20 > 2.8.0.rc0 >=20 Regards, Keith