From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) by dpdk.org (Postfix) with ESMTP id 607973772 for ; Mon, 6 Mar 2017 15:10:41 +0100 (CET) Received: by mail-wr0-f170.google.com with SMTP id g10so117352059wrg.2 for ; Mon, 06 Mar 2017 06:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=BWogSZ5lLgjfVeotCnjTKMLEnuj9jMILSh+tjHILTQE=; b=HvS+iW+p7M8iltCs+j5aaGhWvHbiLs+br6Vzk6ajcJSLwgJ2IIogYW4bR8w9QIcGGk U9uhwn0PF6Mdzaen9FPIQySJpeMK3ZeSishccpQQwfycNHcMgxiGDWXc0c77xwzc4dGr OLPXJlGtSLniLWUEsXQk+gZSRfpJxRnqg+ogr0yDokbCJvD/mus5s3XXZDEZliqnleXD jN6xPNcveXZbrg2pZ9SYhxxeWlB8A9byg+GpZDHHDU4Ur2YWsIFqMnpuz/AixrM4Ea5/ ZHE//t3gru/rpn4b4I9efkJZ4ooldk5WdqrYhWF6ABcVFIl9DJjZK3gMzNgoRyjrCQER VzxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=BWogSZ5lLgjfVeotCnjTKMLEnuj9jMILSh+tjHILTQE=; b=qn+CZN8iN2dZnl37EI1QhYBaWUmQhVk4fHT4XcA5Q6BKk7Q8kX4Y7h6gQDbLDhJmYA w62tSimo406MndPqGNEQIyRT4NO28GSxPJhubDmxzqRl0VUbooU2XrANXlOH6j2oQsE2 6OjWm5/T0XI10vs6JPNwimPc8bynqVqtHU9x4wUs/HgUHeN25IbSPRxFA8NSL3LTZXtf T7BfWJKRB7RgJctXsx4tvTWTie+wI2SXXvhKDEqvy20q+haCVGPbkJ1OxrTii/bIJ04Y vArw24zh3k5PLj3DKD8CNdnxTwn3j8s230UbFJHR3wecjpOGyvXpRFSk9HewMgrp1M5/ WldA== X-Gm-Message-State: AMke39mwEAzdbp5HLOoCQQeAPosdakJdOajyPW9m1319kPRREbBdbv9n2PWRLEzdl0lQCm6L X-Received: by 10.223.177.148 with SMTP id q20mr15138350wra.154.1488809441100; Mon, 06 Mar 2017 06:10:41 -0800 (PST) Received: from paques.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k195sm15015248wmd.7.2017.03.06.06.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 06:10:40 -0800 (PST) Date: Mon, 6 Mar 2017 15:10:31 +0100 From: Pascal Mazon To: "Wiles, Keith" Cc: "dev@dpdk.org" Message-ID: <20170306151031.77a73da0@paques.dev.6wind.com> In-Reply-To: <0FF8ED8E-9F3B-421A-AF51-7F6557095D59@intel.com> References: <5044b7ef7b9e5207fb2202bd5715524bd0d49379.1488534161.git.pascal.mazon@6wind.com> <0FF8ED8E-9F3B-421A-AF51-7F6557095D59@intel.com> Organization: 6WIND X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Mon, 06 Mar 2017 14:10:41 -0000 On Fri, 3 Mar 2017 15:31:14 +0000 "Wiles, Keith" wrote: > > > On Mar 3, 2017, at 3:46 AM, Pascal Mazon > > wrote: > > > > Advertize RTE_PTYPE_UNKNOWN since tap does not report any packet > > type. > > > > 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(+) > > > > 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 = Y > > Multicast MAC filter = Y > > Speed capabilities = Y > > Unicast MAC filter = Y > > +Packet type parsing = Y > > Other kdrv = Y > > ARMv7 = Y > > ARMv8 = 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 > > > > #include > > #include > > @@ -216,6 +217,8 @@ pmd_rx_burst(void *queue, struct rte_mbuf > > **bufs, uint16_t nb_pkts) mbuf->data_len = len; > > mbuf->pkt_len = len; > > mbuf->port = rxq->in_port; > > + mbuf->packet_type = rte_net_get_ptype(mbuf, NULL, > > + > > RTE_PTYPE_ALL_MASK); > > > > /* account for the receive frame */ > > bufs[num_rx++] = mbuf; > > @@ -760,6 +763,17 @@ tap_mtu_set(struct rte_eth_dev *dev, uint16_t > > mtu) return 0; > > } > > > > +static const uint32_t* > > +tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) > > +{ > > + static const uint32_t ptypes[] = { > > + 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? > tap PMD depends on the rte_net_get_ptype(), which code may change in the future to support more packet types. Those changes would then need to be reflected on the tap PMD, to be consistent. I reported only RTE_PTYPE_UNKNOWN to avoid keeping a tight sync with the rte_net library. As we're allowed to be more precise in the packet types we actually set, compared to those we declare as supported, I thought it best. Would you indeed rather we copied all currently supported packet types from rte_net to tap_dev_supported_ptypes_get()? Regards, Pascal > > + > > static const struct eth_dev_ops ops = { > > .dev_start = tap_dev_start, > > .dev_stop = tap_dev_stop, > > @@ -784,6 +798,7 @@ static const struct eth_dev_ops ops = { > > .mtu_set = tap_mtu_set, > > .stats_get = tap_stats_get, > > .stats_reset = tap_stats_reset, > > + .dev_supported_ptypes_get = tap_dev_supported_ptypes_get, > > }; > > > > static int > > -- > > 2.8.0.rc0 > > > > Regards, > Keith >