From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 96857FA84 for ; Mon, 6 Mar 2017 17:31:55 +0100 (CET) Received: from 6wind.com (unknown [10.16.0.184]) by proxy.6wind.com (Postfix) with SMTP id DCC61258AB; Mon, 6 Mar 2017 17:31:49 +0100 (CET) Received: by 6wind.com (sSMTP sendmail emulation); Mon, 06 Mar 2017 17:31:47 +0100 From: Pascal Mazon To: keith.wiles@intel.com Cc: dev@dpdk.org, Pascal Mazon Date: Mon, 6 Mar 2017 17:31:29 +0100 Message-Id: X-Mailer: git-send-email 2.8.0.rc0 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 6/6] net/tap: add flow control 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: Mon, 06 Mar 2017 16:31:55 -0000 A tap netdevice does not support flow control; ensure nothing but RTE_FC_NONE mode can be set. Signed-off-by: Pascal Mazon --- doc/guides/nics/features/tap.ini | 1 + drivers/net/tap/rte_eth_tap.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/doc/guides/nics/features/tap.ini b/doc/guides/nics/features/tap.ini index 7f3f4d661dd7..a51712dce066 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 4d0188d1dde1..cc3194b8a69c 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -774,6 +774,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, @@ -784,6 +801,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, -- 2.8.0.rc0