From: Pascal Mazon <pascal.mazon@6wind.com>
To: keith.wiles@intel.com
Cc: dev@dpdk.org, Pascal Mazon <pascal.mazon@6wind.com>
Subject: [PATCH v3 2/6] net/tap: add speed capabilities
Date: Tue, 7 Mar 2017 17:31:34 +0100 [thread overview]
Message-ID: <1488904298-31395-3-git-send-email-pascal.mazon@6wind.com> (raw)
In-Reply-To: <cover.1488817125.git.pascal.mazon@6wind.com>
Tap PMD is flexible, it supports any speed.
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
doc/guides/nics/features/tap.ini | 1 +
drivers/net/tap/rte_eth_tap.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/doc/guides/nics/features/tap.ini b/doc/guides/nics/features/tap.ini
index d9b47a003654..dad5a0561087 100644
--- a/doc/guides/nics/features/tap.ini
+++ b/doc/guides/nics/features/tap.ini
@@ -9,6 +9,7 @@ Jumbo frame = Y
Promiscuous mode = Y
Allmulticast mode = Y
Basic stats = Y
+Speed capabilities = Y
Unicast MAC filter = Y
Other kdrv = Y
ARMv7 = Y
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 1e46ee36efa2..ef525a3f0826 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -351,6 +351,40 @@ tap_dev_configure(struct rte_eth_dev *dev __rte_unused)
return 0;
}
+static uint32_t
+tap_dev_speed_capa(void)
+{
+ uint32_t speed = pmd_link.link_speed;
+ uint32_t capa = 0;
+
+ if (speed >= ETH_SPEED_NUM_10M)
+ capa |= ETH_LINK_SPEED_10M;
+ if (speed >= ETH_SPEED_NUM_100M)
+ capa |= ETH_LINK_SPEED_100M;
+ if (speed >= ETH_SPEED_NUM_1G)
+ capa |= ETH_LINK_SPEED_1G;
+ if (speed >= ETH_SPEED_NUM_5G)
+ capa |= ETH_LINK_SPEED_2_5G;
+ if (speed >= ETH_SPEED_NUM_5G)
+ capa |= ETH_LINK_SPEED_5G;
+ if (speed >= ETH_SPEED_NUM_10G)
+ capa |= ETH_LINK_SPEED_10G;
+ if (speed >= ETH_SPEED_NUM_20G)
+ capa |= ETH_LINK_SPEED_20G;
+ if (speed >= ETH_SPEED_NUM_25G)
+ capa |= ETH_LINK_SPEED_25G;
+ if (speed >= ETH_SPEED_NUM_40G)
+ capa |= ETH_LINK_SPEED_40G;
+ if (speed >= ETH_SPEED_NUM_50G)
+ capa |= ETH_LINK_SPEED_50G;
+ if (speed >= ETH_SPEED_NUM_56G)
+ capa |= ETH_LINK_SPEED_56G;
+ if (speed >= ETH_SPEED_NUM_100G)
+ capa |= ETH_LINK_SPEED_100G;
+
+ return capa;
+}
+
static void
tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
@@ -363,6 +397,7 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->max_tx_queues = internals->nb_queues;
dev_info->min_rx_bufsize = 0;
dev_info->pci_dev = NULL;
+ dev_info->speed_capa = tap_dev_speed_capa();
}
static void
--
2.8.0.rc0
next prev parent reply other threads:[~2017-03-07 16:31 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 9:46 [PATCH 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-03 9:46 ` [PATCH 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-03 9:46 ` [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 ` [PATCH 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-03 9:46 ` [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 ` [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
2017-03-03 9:46 ` [PATCH 6/6] net/tap: add flow control management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 1/6] net/tap: add MAC address " Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 2/6] net/tap: add speed capabilities Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 4/6] net/tap: add MTU management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 5/6] net/tap: add packet type management Pascal Mazon
2017-03-06 16:31 ` [PATCH v2 6/6] net/tap: add flow control management Pascal Mazon
2017-03-07 16:31 ` [PATCH v3 0/6] net/tap: add additional management ops Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 0/8] " Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 1/8] net/tap: remove wrong IFF_NOARP flags Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 2/8] net/tap: refactor ioctl calls Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 3/8] net/tap: add MAC address management Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 4/8] net/tap: add MTU management Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 5/8] net/tap: add speed capabilities Pascal Mazon
2017-03-14 8:22 ` [PATCH v4 6/8] net/tap: add multicast addresses management Pascal Mazon
2017-03-14 8:22 ` [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 ` [PATCH v4 8/8] net/tap: add flow control management Pascal Mazon
2017-03-15 13:43 ` [PATCH v4 0/8] net/tap: add additional management ops Ferruh Yigit
2017-03-15 14:48 ` [PATCH v5 " Pascal Mazon
2017-03-15 14:48 ` [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 ` [PATCH v5 2/8] net/tap: refactor ioctl calls Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 3/8] net/tap: add MAC address management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 4/8] net/tap: add MTU management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 5/8] net/tap: add speed capabilities Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 6/8] net/tap: add multicast addresses management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 7/8] net/tap: add packet type management Pascal Mazon
2017-03-15 14:48 ` [PATCH v5 8/8] net/tap: add flow control management Pascal Mazon
2017-03-15 16:46 ` [PATCH v5 0/8] net/tap: add additional management ops Ferruh Yigit
2017-03-15 21:44 ` Wiles, Keith
2017-03-07 16:31 ` [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 ` Pascal Mazon [this message]
2017-03-09 14:18 ` [PATCH v3 2/6] net/tap: add speed capabilities 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 ` [PATCH v3 3/6] net/tap: add multicast addresses management Pascal Mazon
2017-03-07 16:31 ` [PATCH v3 4/6] net/tap: add MTU management Pascal Mazon
2017-03-07 16:31 ` [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 ` [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=1488904298-31395-3-git-send-email-pascal.mazon@6wind.com \
--to=pascal.mazon@6wind.com \
--cc=dev@dpdk.org \
--cc=keith.wiles@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.