From: Pascal Mazon Date: Wed, 15 Mar 2017 14:48:19 +0000 (+0100) Subject: net/tap: add flow control management X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2d3ebfeea9b2bd27265e8c1ff4152fcf44b7d217;p=dpdk.git net/tap: add flow control management A tap netdevice does not support flow control; ensure nothing but RTE_FC_NONE mode can be set. Signed-off-by: Pascal Mazon Reviewed-by: Ferruh Yigit --- diff --git a/doc/guides/nics/features/tap.ini b/doc/guides/nics/features/tap.ini index 7f3f4d661d..a51712dce0 100644 --- a/doc/guides/nics/features/tap.ini +++ b/doc/guides/nics/features/tap.ini @@ -14,6 +14,7 @@ Multicast MAC filter = Y Speed capabilities = Y Unicast MAC filter = Y Packet type parsing = Y +Flow control = 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 7b70d62d55..f8d9cc7dc3 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -796,6 +796,23 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) return ptypes; } +static int +tap_flow_ctrl_get(struct rte_eth_dev *dev __rte_unused, + struct rte_eth_fc_conf *fc_conf) +{ + fc_conf->mode = RTE_FC_NONE; + return 0; +} + +static int +tap_flow_ctrl_set(struct rte_eth_dev *dev __rte_unused, + struct rte_eth_fc_conf *fc_conf) +{ + if (fc_conf->mode != RTE_FC_NONE) + return -ENOTSUP; + return 0; +} + static const struct eth_dev_ops ops = { .dev_start = tap_dev_start, .dev_stop = tap_dev_stop, @@ -806,6 +823,8 @@ static const struct eth_dev_ops ops = { .tx_queue_setup = tap_tx_queue_setup, .rx_queue_release = tap_rx_queue_release, .tx_queue_release = tap_tx_queue_release, + .flow_ctrl_get = tap_flow_ctrl_get, + .flow_ctrl_set = tap_flow_ctrl_set, .link_update = tap_link_update, .dev_set_link_up = tap_link_set_up, .dev_set_link_down = tap_link_set_down,