From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id E99412C49 for ; Fri, 10 Mar 2017 13:35:16 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id n11so9502618wma.1 for ; Fri, 10 Mar 2017 04:35:16 -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=XskURzLa2SB08fX2g+cDasv3JzsIWRUe2ZepkGe629Y=; b=SZ85YYtpqg8xrQ3abh1dPBGo8Nk1UUkm/lM+6++RszO/kzwuUUoS2rBninoSVkAu9N FhnBJmpe4T5YRD4ALVf3Rebf0hvNod+R6zVqrpPNddi9kdF0nwDHzEO3bhf1NWL/DtBj tE19Y2jr1vqLjt2s01r0k5rs0cTayQOL8JFFwN8W7zBSqSbeOhL5C6wtsVNv+2rdgG96 EdffkqRA1cWF+q4XwNdNXjEHJriHBpornKf3/TgPLWhgNIVCXpsVkozcmlNCdWq5n5OZ fa/Wt5ewnuq94ZBSz4E47oZwxWel6r/XpOruu/eElE4Rocf4Q/qXgfkDXG7xPaPDTBvM ZtHA== 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=XskURzLa2SB08fX2g+cDasv3JzsIWRUe2ZepkGe629Y=; b=rPP0usoQsHFUVrYipadzjfm/AEU80yeCFokcmWuaIxX/KldDeu+zkoCrztEX982exe XqptnMlViSBILJ0VUjGBApbiSJld4NWE70o5Iq8wvaU6Rrcmh6vmZ9peZTUrrP61esls GOhpn6XZnefn8pjJRgOBI7U2qspyFGa0Cp7qxhF4J0E4QTxynK+VMQ3ER9QFm9iabFE/ wubJLs4l8A+6nBcAtMeV3N+GgjVYIeMSOfU8rpQPsHc2xRfbAX6PuETa+AO9dDBYcd8Y Oz5evN20Wc0dwT3V2fkJOf+CJt6T2kYvASmkAr/2mqucRfTqFuOy6KfaYCWHNO+HaQKJ hJ3Q== X-Gm-Message-State: AFeK/H0w2DUEs8MvCCoLGdHsBdt8PKtesAFxnzpJubj14vJiQNLgOnLy2sL5dWYG6BupCyVy X-Received: by 10.28.218.80 with SMTP id r77mr2204700wmg.0.1489149316645; Fri, 10 Mar 2017 04:35:16 -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 m201sm3151706wmd.19.2017.03.10.04.35.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Mar 2017 04:35:16 -0800 (PST) Date: Fri, 10 Mar 2017 13:34:38 +0100 From: Pascal Mazon To: Ferruh Yigit Cc: keith.wiles@intel.com, dev@dpdk.org Message-ID: <20170310133438.046349c4@paques.dev.6wind.com> In-Reply-To: <0b7941e9-c930-954e-d9ca-5b876e2a0038@intel.com> References: <1488904298-31395-6-git-send-email-pascal.mazon@6wind.com> <0b7941e9-c930-954e-d9ca-5b876e2a0038@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 v3 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, 10 Mar 2017 12:35:17 -0000 On Thu, 9 Mar 2017 14:26:08 +0000 Ferruh Yigit wrote: > On 3/7/2017 4:31 PM, 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 d76f1dc83b03..edb5d2a82f12 > > 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); > > Isn't PMD become inconsistent with this update. It reports > RTE_PTYPE_UNKNOWN, but sets mbuf->packet_type with various ptype. I discussed this briefly with Keith, but my argument was that the librte_net did not provide a list of supported packet types, so I didn't want to have to keep tap supported packet type list in sync with the lib. But it's actually just a few lines to add, I'll do that and also set a comment to mention that it must be in sync with librte_net. > > Do we want software packet type parsing in PMD level? Any change some > users may not interested with this data at all. Well, most PMDs support packet type parsing, and among the vdev, I inspired that part from virtio, which does software ptype parsing. An application coded with physical hardware PMD in mind doesn't have to be recoded when switching to a tap PMD. Furthermore, the tap PMD is already using syscalls in its datapath, the cost of software packet parsing won't really change overall performance. Regards, Pascal > > > > > /* account for the receive frame */ > > bufs[num_rx++] = mbuf; > > @@ -769,6 +772,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; > > +} > > + > > static const struct eth_dev_ops ops = { > > .dev_start = tap_dev_start, > > .dev_stop = tap_dev_stop, > > @@ -793,6 +807,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 > > >