From patchwork Fri Mar 3 09:46:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Mazon X-Patchwork-Id: 21254 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 93B6137B0; Fri, 3 Mar 2017 10:46:34 +0100 (CET) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 3987F2C31 for ; Fri, 3 Mar 2017 10:46:31 +0100 (CET) Received: from 6wind.com (unknown [10.16.0.184]) by proxy.6wind.com (Postfix) with SMTP id 427F324B34; Fri, 3 Mar 2017 10:46:25 +0100 (CET) Received: by 6wind.com (sSMTP sendmail emulation); Fri, 03 Mar 2017 10:46:23 +0100 From: Pascal Mazon To: keith.wiles@intel.com Cc: dev@dpdk.org, Pascal Mazon Date: Fri, 3 Mar 2017 10:46:12 +0100 Message-Id: <5044b7ef7b9e5207fb2202bd5715524bd0d49379.1488534161.git.pascal.mazon@6wind.com> X-Mailer: git-send-email 2.8.0.rc0 In-Reply-To: References: Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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; +} + 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