DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: Pascal Mazon <pascal.mazon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 5/6] net/tap: add packet type management
Date: Mon, 6 Mar 2017 14:46:10 +0000	[thread overview]
Message-ID: <5D908DC5-1F22-4353-8840-E164760E7782@intel.com> (raw)
In-Reply-To: <20170306151031.77a73da0@paques.dev.6wind.com>


> On Mar 6, 2017, at 8:10 AM, Pascal Mazon <pascal.mazon@6wind.com> wrote:
> 
> On Fri, 3 Mar 2017 15:31:14 +0000
> "Wiles, Keith" <keith.wiles@intel.com> wrote:
> 
>> 
>>> On Mar 3, 2017, at 3:46 AM, Pascal Mazon <pascal.mazon@6wind.com>
>>> wrote:
>>> 
>>> Advertize RTE_PTYPE_UNKNOWN since tap does not report any packet
>>> type.
>>> 
>>> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
>>> ---
>>> 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 <rte_malloc.h>
>>> #include <rte_vdev.h>
>>> #include <rte_kvargs.h>
>>> +#include <rte_net.h>
>>> 
>>> #include <sys/types.h>
>>> #include <sys/stat.h>
>>> @@ -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()?

I see your point here, it not reasonable to copy all of the ptypes from rte_net to here ignore my comment.

> 
> 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
>> 
> 

Regards,
Keith

  reply	other threads:[~2017-03-06 14:46 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  9:46 [dpdk-dev] [PATCH 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-03  9:46 ` [dpdk-dev] [PATCH 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-03  9:46 ` [dpdk-dev] [PATCH 2/6] net/tap: add speed capabilities Pascal Mazon
2017-03-03 15:27   ` Wiles, Keith
2017-03-06 13:58     ` Pascal Mazon
2017-03-06 14:38       ` Wiles, Keith
2017-03-03  9:46 ` [dpdk-dev] [PATCH 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-03  9:46 ` [dpdk-dev] [PATCH 4/6] net/tap: add MTU management Pascal Mazon
2017-03-03 15:23   ` Wiles, Keith
2017-03-06 13:59     ` Pascal Mazon
2017-03-03  9:46 ` [dpdk-dev] [PATCH 5/6] net/tap: add packet type management Pascal Mazon
2017-03-03 15:31   ` Wiles, Keith
2017-03-06 14:10     ` Pascal Mazon
2017-03-06 14:46       ` Wiles, Keith [this message]
2017-03-03  9:46 ` [dpdk-dev] [PATCH 6/6] net/tap: add flow control management Pascal Mazon
2017-03-06 16:31 ` [dpdk-dev] [PATCH v2 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-06 16:31   ` [dpdk-dev] [PATCH v2 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-06 16:31   ` [dpdk-dev] [PATCH v2 2/6] net/tap: add speed capabilities Pascal Mazon
2017-03-06 16:31   ` [dpdk-dev] [PATCH v2 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-06 16:31   ` [dpdk-dev] [PATCH v2 4/6] net/tap: add MTU management Pascal Mazon
2017-03-06 16:31   ` [dpdk-dev] [PATCH v2 5/6] net/tap: add packet type management Pascal Mazon
2017-03-06 16:31   ` [dpdk-dev] [PATCH v2 6/6] net/tap: add flow control management Pascal Mazon
2017-03-07 16:31   ` [dpdk-dev] [PATCH v3 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-14  8:22     ` [dpdk-dev] [PATCH v4 0/8] " Pascal Mazon
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 1/8] net/tap: remove wrong IFF_NOARP flags Pascal Mazon
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 2/8] net/tap: refactor ioctl calls Pascal Mazon
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 3/8] net/tap: add MAC address management Pascal Mazon
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 4/8] net/tap: add MTU management Pascal Mazon
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 5/8] net/tap: add speed capabilities Pascal Mazon
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 6/8] net/tap: add multicast addresses management Pascal Mazon
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 7/8] net/tap: add packet type management Pascal Mazon
2017-03-15 13:35         ` Ferruh Yigit
2017-03-15 13:44           ` Pascal Mazon
2017-03-15 14:31             ` Ferruh Yigit
2017-03-15 13:42         ` Ferruh Yigit
2017-03-14  8:22       ` [dpdk-dev] [PATCH v4 8/8] net/tap: add flow control management Pascal Mazon
2017-03-15 13:43       ` [dpdk-dev] [PATCH v4 0/8] net/tap: add additional management ops Ferruh Yigit
2017-03-15 14:48     ` [dpdk-dev] [PATCH v5 " Pascal Mazon
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 1/8] net/tap: remove wrong IFF_NOARP flags Pascal Mazon
2017-03-15 21:37         ` Wiles, Keith
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 2/8] net/tap: refactor ioctl calls Pascal Mazon
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 3/8] net/tap: add MAC address management Pascal Mazon
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 4/8] net/tap: add MTU management Pascal Mazon
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 5/8] net/tap: add speed capabilities Pascal Mazon
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 6/8] net/tap: add multicast addresses management Pascal Mazon
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 7/8] net/tap: add packet type management Pascal Mazon
2017-03-15 14:48       ` [dpdk-dev] [PATCH v5 8/8] net/tap: add flow control management Pascal Mazon
2017-03-15 16:46       ` [dpdk-dev] [PATCH v5 0/8] net/tap: add additional management ops Ferruh Yigit
2017-03-15 21:44         ` Wiles, Keith
2017-03-07 16:31   ` [dpdk-dev] [PATCH v3 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-09 14:05     ` Ferruh Yigit
2017-03-10  9:01       ` Pascal Mazon
2017-03-07 16:31   ` [dpdk-dev] [PATCH v3 2/6] net/tap: add speed capabilities Pascal Mazon
2017-03-09 14:18     ` Ferruh Yigit
2017-03-09 14:36       ` Wiles, Keith
2017-03-09 16:05         ` Ferruh Yigit
2017-03-10  9:03           ` Pascal Mazon
2017-03-10  9:11             ` Pascal Mazon
2017-03-07 16:31   ` [dpdk-dev] [PATCH v3 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-07 16:31   ` [dpdk-dev] [PATCH v3 4/6] net/tap: add MTU management Pascal Mazon
2017-03-07 16:31   ` [dpdk-dev] [PATCH v3 5/6] net/tap: add packet type management Pascal Mazon
2017-03-09 14:26     ` Ferruh Yigit
2017-03-10 12:34       ` Pascal Mazon
2017-03-07 16:31   ` [dpdk-dev] [PATCH v3 6/6] net/tap: add flow control management Pascal Mazon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D908DC5-1F22-4353-8840-E164760E7782@intel.com \
    --to=keith.wiles@intel.com \
    --cc=dev@dpdk.org \
    --cc=pascal.mazon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).