DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 14/15] ethdev: Support VFs on the different PCI domains
From: Kamil Rytarowski @ 2016-10-10 13:01 UTC (permalink / raw)
  To: Ferruh Yigit, dev
  Cc: maciej.czekaj, zyta.szpak, slawomir.rosek, rad, jerin.jacob,
	john.mcnamara, Kamil Rytarowski
In-Reply-To: <90a90355-4f83-1def-081b-070924dd60d0@intel.com>



W dniu 10.10.2016 o 12:19, Ferruh Yigit pisze:
> Hi Kamil,
>
> On 9/30/2016 1:05 PM, Kamil Rytarowski wrote:
>> It's possible to have the same numbers for bus, device id and function,
>> therefore we need to differentiate on domain.
>>
>> This enables DPDK with multiple VFs on ThunderX 2-socket hardware.
>>
>> Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
>> Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
>> Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
>> Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
>> Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>> ---
>>   lib/librte_ether/rte_ethdev.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
>> index 382c959..01d5fb0 100644
>> --- a/lib/librte_ether/rte_ethdev.c
>> +++ b/lib/librte_ether/rte_ethdev.c
>> @@ -225,7 +225,7 @@ rte_eth_dev_create_unique_device_name(char *name, size_t size,
>>   {
>>   	int ret;
>>   
>> -	ret = snprintf(name, size, "%d:%d.%d",
>> +	ret = snprintf(name, size, "%d:%d:%d.%d", pci_dev->addr.domain,
>>   			pci_dev->addr.bus, pci_dev->addr.devid,
>>   			pci_dev->addr.function);
>>   	if (ret < 0)
>>
> Is it possible to separate this patch from patchset, this is a ethdev
> patch and it seems not directly related to the rest of the patchset?
>
> Thanks,
> ferruh

This patch is directly related with secondary queue set support on 
ThunderX, but it can be skipped in this chain of patches and applied as 
a standalone diff.

Is disabling this one on patch work sufficient? Of course unless there 
are no more comments to produce v3 of the original patch chain "Add 
support for secondary queue set in nicvf thunderx driver".

Should I resubmit it as a new standalone patch?

^ permalink raw reply

* Re: [RFC v2] Generic flow director/filtering/classification API
From: Adrien Mazarguil @ 2016-10-10 13:19 UTC (permalink / raw)
  To: Zhao1, Wei; +Cc: dev@dpdk.org
In-Reply-To: <A2573D2ACFCADC41BB3BE09C6DE313CA01FDBBB5@PGSMSX103.gar.corp.intel.com>

Hi Wei,

On Mon, Oct 10, 2016 at 09:42:53AM +0000, Zhao1, Wei wrote:
> Hi Adrien Mazarguil,
> 
> In your v2 version of rte_flow.txt , there is an action type RTE_FLOW_ACTION_TYPE_MARK,  but there is no definition of struct rte_flow_action_mark.
> And there is  an definition of struct rte_flow_action_id. Is it a typo or other usage?
> 
> Thank you.
> 
> struct rte_flow_action_id {
> 	uint32_t id; /**< 32 bit value to return with packets. */
> };

That is indeed a mistake, this struct should be named
"rte_flow_action_mark". I'll fix it for the next update, thanks.

-- 
Adrien Mazarguil
6WIND

^ permalink raw reply

* [PATCH v3] net/kni: add KNI PMD
From: Ferruh Yigit @ 2016-10-10 13:19 UTC (permalink / raw)
  To: dev; +Cc: Ferruh Yigit
In-Reply-To: <1474025398-18553-1-git-send-email-ferruh.yigit@intel.com>

Add KNI PMD which wraps librte_kni for ease of use.

KNI PMD can be used as any regular PMD to send / receive packets to the
Linux networking stack.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---

v3:
* rebase on top of latest master

v2:
* updated driver name eth_kni -> net_kni
---
 config/common_base                      |   1 +
 config/common_linuxapp                  |   1 +
 drivers/net/Makefile                    |   1 +
 drivers/net/kni/Makefile                |  63 +++++
 drivers/net/kni/rte_eth_kni.c           | 463 ++++++++++++++++++++++++++++++++
 drivers/net/kni/rte_pmd_kni_version.map |   4 +
 mk/rte.app.mk                           |  10 +-
 7 files changed, 538 insertions(+), 5 deletions(-)
 create mode 100644 drivers/net/kni/Makefile
 create mode 100644 drivers/net/kni/rte_eth_kni.c
 create mode 100644 drivers/net/kni/rte_pmd_kni_version.map

diff --git a/config/common_base b/config/common_base
index f5d2eff..03b93c7 100644
--- a/config/common_base
+++ b/config/common_base
@@ -543,6 +543,7 @@ CONFIG_RTE_PIPELINE_STATS_COLLECT=n
 # Compile librte_kni
 #
 CONFIG_RTE_LIBRTE_KNI=n
+CONFIG_RTE_LIBRTE_PMD_KNI=n
 CONFIG_RTE_KNI_KMOD=n
 CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
 CONFIG_RTE_KNI_KO_DEBUG=n
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 2483dfa..2ecd510 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -39,6 +39,7 @@ CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
 CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_AF_PACKET=y
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index bc93230..c4771cd 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -41,6 +41,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic
 DIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k
 DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e
 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += kni
 DIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4
 DIRS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5
 DIRS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += mpipe
diff --git a/drivers/net/kni/Makefile b/drivers/net/kni/Makefile
new file mode 100644
index 0000000..0b7cf91
--- /dev/null
+++ b/drivers/net/kni/Makefile
@@ -0,0 +1,63 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2016 Intel Corporation. All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_pmd_kni.a
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+LDLIBS += -lpthread
+
+EXPORT_MAP := rte_pmd_kni_version.map
+
+LIBABIVER := 1
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += rte_eth_kni.c
+
+#
+# Export include files
+#
+SYMLINK-y-include +=
+
+# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += lib/librte_eal
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += lib/librte_ether
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += lib/librte_kni
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KNI) += lib/librte_mempool
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
new file mode 100644
index 0000000..ce9e758
--- /dev/null
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -0,0 +1,463 @@
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <fcntl.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include <rte_ethdev.h>
+#include <rte_kni.h>
+#include <rte_malloc.h>
+#include <rte_vdev.h>
+
+#define KNI_MAX_QUEUE_PER_PORT 8
+#define MAX_PACKET_SZ 2048
+#define MAX_KNI_PORTS 8
+#define DRV_NAME net_kni
+
+struct pmd_queue_stats {
+	uint64_t pkts;
+	uint64_t bytes;
+	uint64_t err_pkts;
+};
+
+struct pmd_queue {
+	struct pmd_internals *internals;
+	struct rte_mempool *mb_pool;
+
+	struct pmd_queue_stats rx;
+	struct pmd_queue_stats tx;
+};
+
+struct pmd_internals {
+	struct rte_kni *kni;
+	int is_kni_started;
+
+	pthread_t thread;
+	int stop_thread;
+
+	struct pmd_queue rx_queues[KNI_MAX_QUEUE_PER_PORT];
+	struct pmd_queue tx_queues[KNI_MAX_QUEUE_PER_PORT];
+};
+
+static struct ether_addr eth_addr;
+static const char *drivername = RTE_STR(DRV_NAME);
+static struct rte_eth_link pmd_link = {
+		.link_speed = 10000,
+		.link_duplex = ETH_LINK_FULL_DUPLEX,
+		.link_status = 0
+};
+static int is_kni_initialized;
+
+static uint16_t
+eth_kni_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+{
+	struct pmd_queue *kni_q = q;
+	struct rte_kni *kni = kni_q->internals->kni;
+	uint16_t nb_pkts;
+
+	nb_pkts = rte_kni_rx_burst(kni, bufs, nb_bufs);
+
+	kni_q->rx.pkts += nb_pkts;
+	kni_q->rx.err_pkts += nb_bufs - nb_pkts;
+
+	return nb_pkts;
+}
+
+static uint16_t
+eth_kni_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+{
+	struct pmd_queue *kni_q = q;
+	struct rte_kni *kni = kni_q->internals->kni;
+	uint16_t nb_pkts;
+
+	nb_pkts =  rte_kni_tx_burst(kni, bufs, nb_bufs);
+
+	kni_q->tx.pkts += nb_pkts;
+	kni_q->tx.err_pkts += nb_bufs - nb_pkts;
+
+	return nb_pkts;
+}
+
+static void *
+kni_handle_request(void *param)
+{
+	struct pmd_internals *internals = param;
+#define MS 1000
+
+	while (!internals->stop_thread) {
+		rte_kni_handle_request(internals->kni);
+		usleep(500 * MS);
+	}
+
+	return param;
+}
+
+static int
+eth_kni_start(struct rte_eth_dev *dev)
+{
+	struct pmd_internals *internals = dev->data->dev_private;
+	uint16_t port_id = dev->data->port_id;
+	struct rte_mempool *mb_pool;
+	struct rte_kni_conf conf;
+	const char *name = dev->data->name + 4; /* remove eth_ */
+
+	snprintf(conf.name, RTE_KNI_NAMESIZE, "%s", name);
+	conf.force_bind = 0;
+	conf.group_id = port_id;
+	conf.mbuf_size = MAX_PACKET_SZ;
+	mb_pool = internals->rx_queues[0].mb_pool;
+
+	internals->kni = rte_kni_alloc(mb_pool, &conf, NULL);
+	if (internals->kni == NULL) {
+		RTE_LOG(ERR, PMD,
+			"Fail to create kni for port: %d\n", port_id);
+		return -1;
+	}
+
+	return 0;
+}
+
+static int
+eth_kni_dev_start(struct rte_eth_dev *dev)
+{
+	struct pmd_internals *internals = dev->data->dev_private;
+	int ret;
+
+	if (internals->is_kni_started == 0) {
+		ret = eth_kni_start(dev);
+		if (ret)
+			return -1;
+		internals->is_kni_started = 1;
+	}
+
+	ret = pthread_create(&internals->thread, NULL, kni_handle_request,
+			internals);
+	if (ret) {
+		RTE_LOG(ERR, PMD, "Fail to create kni request thread\n");
+		return -1;
+	}
+
+	dev->data->dev_link.link_status = 1;
+
+	return 0;
+}
+
+static void
+eth_kni_dev_stop(struct rte_eth_dev *dev)
+{
+	struct pmd_internals *internals = dev->data->dev_private;
+	int ret;
+
+	internals->stop_thread = 1;
+
+	ret = pthread_cancel(internals->thread);
+	if (ret)
+		RTE_LOG(ERR, PMD, "Can't cancel the thread\n");
+
+	ret = pthread_join(internals->thread, NULL);
+	if (ret)
+		RTE_LOG(ERR, PMD, "Can't join the thread\n");
+
+	internals->stop_thread = 0;
+
+	dev->data->dev_link.link_status = 0;
+}
+
+static int
+eth_kni_dev_configure(struct rte_eth_dev *dev __rte_unused)
+{
+	return 0;
+}
+
+static void
+eth_kni_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+{
+	struct rte_eth_dev_data *data = dev->data;
+	struct pmd_internals *internals = data->dev_private;
+
+	dev_info->driver_name = data->drv_name;
+	dev_info->max_mac_addrs = 1;
+	dev_info->max_rx_pktlen = (uint32_t)-1;
+	dev_info->max_rx_queues = RTE_DIM(internals->rx_queues);
+	dev_info->max_tx_queues = RTE_DIM(internals->tx_queues);
+	dev_info->min_rx_bufsize = 0;
+	dev_info->pci_dev = NULL;
+}
+
+static int
+eth_kni_rx_queue_setup(struct rte_eth_dev *dev,
+		uint16_t rx_queue_id,
+		uint16_t nb_rx_desc __rte_unused,
+		unsigned int socket_id __rte_unused,
+		const struct rte_eth_rxconf *rx_conf __rte_unused,
+		struct rte_mempool *mb_pool)
+{
+	struct pmd_internals *internals = dev->data->dev_private;
+	struct pmd_queue *q;
+
+	q = &internals->rx_queues[rx_queue_id];
+	q->internals = internals;
+	q->mb_pool = mb_pool;
+
+	dev->data->rx_queues[rx_queue_id] = q;
+
+	return 0;
+}
+
+static int
+eth_kni_tx_queue_setup(struct rte_eth_dev *dev,
+		uint16_t tx_queue_id,
+		uint16_t nb_tx_desc __rte_unused,
+		unsigned int socket_id __rte_unused,
+		const struct rte_eth_txconf *tx_conf __rte_unused)
+{
+	struct pmd_internals *internals = dev->data->dev_private;
+	struct pmd_queue *q;
+
+	q = &internals->tx_queues[tx_queue_id];
+	q->internals = internals;
+
+	dev->data->tx_queues[tx_queue_id] = q;
+
+	return 0;
+}
+
+static void
+eth_kni_queue_release(void *q __rte_unused)
+{
+}
+
+static int
+eth_kni_link_update(struct rte_eth_dev *dev __rte_unused,
+		int wait_to_complete __rte_unused)
+{
+	return 0;
+}
+
+static void
+eth_kni_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+{
+	unsigned long rx_packets_total = 0, rx_bytes_total = 0;
+	unsigned long tx_packets_total = 0, tx_bytes_total = 0;
+	struct rte_eth_dev_data *data = dev->data;
+	unsigned long tx_packets_err_total = 0;
+	unsigned int i, num_stats;
+	struct pmd_queue *q;
+
+	num_stats = RTE_MIN((unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS,
+			data->nb_rx_queues);
+	for (i = 0; i < num_stats; i++) {
+		q = data->rx_queues[i];
+		stats->q_ipackets[i] = q->rx.pkts;
+		stats->q_ibytes[i] = q->rx.bytes;
+		rx_packets_total += stats->q_ipackets[i];
+		rx_bytes_total += stats->q_ibytes[i];
+	}
+
+	num_stats = RTE_MIN((unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS,
+			data->nb_tx_queues);
+	for (i = 0; i < num_stats; i++) {
+		q = data->tx_queues[i];
+		stats->q_opackets[i] = q->tx.pkts;
+		stats->q_obytes[i] = q->tx.bytes;
+		stats->q_errors[i] = q->tx.err_pkts;
+		tx_packets_total += stats->q_opackets[i];
+		tx_bytes_total += stats->q_obytes[i];
+		tx_packets_err_total += stats->q_errors[i];
+	}
+
+	stats->ipackets = rx_packets_total;
+	stats->ibytes = rx_bytes_total;
+	stats->opackets = tx_packets_total;
+	stats->obytes = tx_bytes_total;
+	stats->oerrors = tx_packets_err_total;
+}
+
+static void
+eth_kni_stats_reset(struct rte_eth_dev *dev)
+{
+	struct rte_eth_dev_data *data = dev->data;
+	struct pmd_queue *q;
+	unsigned int i;
+
+	for (i = 0; i < data->nb_rx_queues; i++) {
+		q = data->rx_queues[i];
+		q->rx.pkts = 0;
+		q->rx.bytes = 0;
+	}
+	for (i = 0; i < data->nb_tx_queues; i++) {
+		q = data->tx_queues[i];
+		q->tx.pkts = 0;
+		q->tx.bytes = 0;
+		q->tx.err_pkts = 0;
+	}
+}
+
+static const struct eth_dev_ops eth_kni_ops = {
+	.dev_start = eth_kni_dev_start,
+	.dev_stop = eth_kni_dev_stop,
+	.dev_configure = eth_kni_dev_configure,
+	.dev_infos_get = eth_kni_dev_info,
+	.rx_queue_setup = eth_kni_rx_queue_setup,
+	.tx_queue_setup = eth_kni_tx_queue_setup,
+	.rx_queue_release = eth_kni_queue_release,
+	.tx_queue_release = eth_kni_queue_release,
+	.link_update = eth_kni_link_update,
+	.stats_get = eth_kni_stats_get,
+	.stats_reset = eth_kni_stats_reset,
+};
+
+static struct rte_eth_dev *
+eth_kni_create(const char *name, unsigned int numa_node)
+{
+	struct pmd_internals *internals = NULL;
+	struct rte_eth_dev_data *data;
+	struct rte_eth_dev *eth_dev;
+	uint16_t nb_rx_queues = 1;
+	uint16_t nb_tx_queues = 1;
+
+	RTE_LOG(INFO, PMD, "Creating kni ethdev on numa socket %u\n",
+			numa_node);
+
+	data = rte_zmalloc_socket(name, sizeof(*data), 0, numa_node);
+	if (data == NULL)
+		goto error;
+
+	internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);
+	if (internals == NULL)
+		goto error;
+
+	/* reserve an ethdev entry */
+	eth_dev = rte_eth_dev_allocate(name);
+	if (eth_dev == NULL)
+		goto error;
+
+	data->dev_private = internals;
+	data->port_id = eth_dev->data->port_id;
+	memmove(data->name, eth_dev->data->name, sizeof(data->name));
+	data->nb_rx_queues = nb_rx_queues;
+	data->nb_tx_queues = nb_tx_queues;
+	data->dev_link = pmd_link;
+	data->mac_addrs = &eth_addr;
+
+	eth_dev->data = data;
+	eth_dev->dev_ops = &eth_kni_ops;
+	eth_dev->driver = NULL;
+
+	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
+	data->kdrv = RTE_KDRV_NONE;
+	data->drv_name = drivername;
+	data->numa_node = numa_node;
+
+	return eth_dev;
+
+error:
+	rte_free(data);
+	rte_free(internals);
+
+	return NULL;
+}
+
+static int
+kni_init(void)
+{
+	if (is_kni_initialized == 0)
+		rte_kni_init(MAX_KNI_PORTS);
+
+	is_kni_initialized += 1;
+
+	return 0;
+}
+
+static int
+eth_kni_probe(const char *name, const char *params __rte_unused)
+{
+	struct rte_eth_dev *eth_dev;
+	int ret;
+
+	RTE_LOG(INFO, PMD, "Initializing eth_kni for %s\n", name);
+
+	ret = kni_init();
+	if (ret < 0)
+		/* Not return error to prevent panic in rte_eal_init() */
+		return 0;
+
+	eth_dev = eth_kni_create(name, rte_socket_id());
+	if (eth_dev == NULL)
+		return -1;
+
+	eth_dev->rx_pkt_burst = eth_kni_rx;
+	eth_dev->tx_pkt_burst = eth_kni_tx;
+
+	return 0;
+}
+
+static int
+eth_kni_remove(const char *name)
+{
+	struct rte_eth_dev *eth_dev;
+	struct pmd_internals *internals;
+
+	RTE_LOG(INFO, PMD, "Un-Initializing eth_kni for %s\n", name);
+
+	/* find the ethdev entry */
+	eth_dev = rte_eth_dev_allocated(name);
+	if (eth_dev == NULL)
+		return -1;
+
+	eth_kni_dev_stop(eth_dev);
+
+	if (eth_dev->data) {
+		internals = eth_dev->data->dev_private;
+		rte_kni_release(internals->kni);
+
+		rte_free(internals);
+	}
+	rte_free(eth_dev->data);
+
+	rte_eth_dev_release_port(eth_dev);
+
+	is_kni_initialized -= 1;
+	if (is_kni_initialized == 0)
+		rte_kni_close();
+
+	return 0;
+}
+
+static struct rte_vdev_driver eth_kni_drv = {
+	.probe = eth_kni_probe,
+	.remove = eth_kni_remove,
+};
+
+DRIVER_REGISTER_VDEV(DRV_NAME, eth_kni_drv);
diff --git a/drivers/net/kni/rte_pmd_kni_version.map b/drivers/net/kni/rte_pmd_kni_version.map
new file mode 100644
index 0000000..61463bf
--- /dev/null
+++ b/drivers/net/kni/rte_pmd_kni_version.map
@@ -0,0 +1,4 @@
+DPDK_16.11 {
+
+	local: *;
+};
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index ac50a21..a94983b 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -59,11 +59,6 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
 #
 # Order is important: from higher level to lower level
 #
-
-ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI)            += -lrte_kni
-endif
-
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE)       += -lrte_pipeline
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)          += -lrte_table
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PORT)           += -lrte_port
@@ -84,6 +79,10 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
 
 _LDLIBS-y += --whole-archive
 
+ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI)            += -lrte_kni
+endif
+
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
@@ -114,6 +113,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD)       += -lrte_pmd_enic
 _LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD)      += -lrte_pmd_fm10k
 _LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD)       += -lrte_pmd_i40e
 _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD)      += -lrte_pmd_ixgbe
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KNI)        += -lrte_pmd_kni
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD)       += -lrte_pmd_mlx4 -libverbs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD)       += -lrte_pmd_mlx5 -libverbs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD)      += -lrte_pmd_mpipe -lgxio
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH] net/i40e: add additional prefetch instructions for bulk rx
From: Wu, Jingjing @ 2016-10-10 13:25 UTC (permalink / raw)
  To: Yigit, Ferruh, Vladyslav Buslov, Zhang, Helin; +Cc: dev@dpdk.org
In-Reply-To: <18156776-3658-a97d-3fbc-19c1a820a04d@intel.com>



> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, September 14, 2016 9:25 PM
> To: Vladyslav Buslov <vladyslav.buslov@harmonicinc.com>; Zhang, Helin
> <helin.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: add additional prefetch instructions for bulk rx
> 
> On 7/14/2016 6:27 PM, Vladyslav Buslov wrote:
> > Added prefetch of first packet payload cacheline in i40e_rx_scan_hw_ring
> > Added prefetch of second mbuf cacheline in i40e_rx_alloc_bufs
> >
> > Signed-off-by: Vladyslav Buslov <vladyslav.buslov@harmonicinc.com>
> > ---
> >  drivers/net/i40e/i40e_rxtx.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> > index d3cfb98..e493fb4 100644
> > --- a/drivers/net/i40e/i40e_rxtx.c
> > +++ b/drivers/net/i40e/i40e_rxtx.c
> > @@ -1003,6 +1003,7 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
> >                 /* Translate descriptor info to mbuf parameters */
> >                 for (j = 0; j < nb_dd; j++) {
> >                         mb = rxep[j].mbuf;
> > +                       rte_prefetch0(RTE_PTR_ADD(mb->buf_addr,
> RTE_PKTMBUF_HEADROOM));

Why did prefetch here? I think if application need to deal with packet, it is more suitable to put it in application.

> >                         qword1 = rte_le_to_cpu_64(\
> >                                 rxdp[j].wb.qword1.status_error_len);
> >                         pkt_len = ((qword1 &
> I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
> > @@ -1086,9 +1087,11 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)
> >
> >         rxdp = &rxq->rx_ring[alloc_idx];
> >         for (i = 0; i < rxq->rx_free_thresh; i++) {
> > -               if (likely(i < (rxq->rx_free_thresh - 1)))
> > +               if (likely(i < (rxq->rx_free_thresh - 1))) {
> >                         /* Prefetch next mbuf */
> > -                       rte_prefetch0(rxep[i + 1].mbuf);
> > +                       rte_prefetch0(&rxep[i + 1].mbuf->cacheline0);
> > +                       rte_prefetch0(&rxep[i + 1].mbuf->cacheline1);
> > +               }
Agree with this change. And when I test it by testpmd with iofwd, no performance increase is observed but minor decrease.
Can you share will us when it will benefit the performance in your scenario ? 


Thanks
Jingjing

^ permalink raw reply

* Re: [PATCH v2 14/15] ethdev: Support VFs on the different PCI domains
From: Ferruh Yigit @ 2016-10-10 13:27 UTC (permalink / raw)
  To: Kamil Rytarowski, dev
  Cc: maciej.czekaj, zyta.szpak, slawomir.rosek, rad, jerin.jacob,
	john.mcnamara, Kamil Rytarowski
In-Reply-To: <9d573206-79c8-b82f-e47f-f8b300112123@caviumnetworks.com>

On 10/10/2016 2:01 PM, Kamil Rytarowski wrote:
> 
> 
> W dniu 10.10.2016 o 12:19, Ferruh Yigit pisze:
>> Hi Kamil,
>>
>> On 9/30/2016 1:05 PM, Kamil Rytarowski wrote:
>>> It's possible to have the same numbers for bus, device id and function,
>>> therefore we need to differentiate on domain.
>>>
>>> This enables DPDK with multiple VFs on ThunderX 2-socket hardware.
>>>
>>> Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
>>> Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
>>> Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
>>> Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
>>> Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>> ---
>>>   lib/librte_ether/rte_ethdev.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
>>> index 382c959..01d5fb0 100644
>>> --- a/lib/librte_ether/rte_ethdev.c
>>> +++ b/lib/librte_ether/rte_ethdev.c
>>> @@ -225,7 +225,7 @@ rte_eth_dev_create_unique_device_name(char *name, size_t size,
>>>   {
>>>   	int ret;
>>>   
>>> -	ret = snprintf(name, size, "%d:%d.%d",
>>> +	ret = snprintf(name, size, "%d:%d:%d.%d", pci_dev->addr.domain,
>>>   			pci_dev->addr.bus, pci_dev->addr.devid,
>>>   			pci_dev->addr.function);
>>>   	if (ret < 0)
>>>
>> Is it possible to separate this patch from patchset, this is a ethdev
>> patch and it seems not directly related to the rest of the patchset?
>>
>> Thanks,
>> ferruh
> 
> This patch is directly related with secondary queue set support on 
> ThunderX, but it can be skipped in this chain of patches and applied as 
> a standalone diff.
> 
> Is disabling this one on patch work sufficient? Of course unless there 
> are no more comments to produce v3 of the original patch chain "Add 
> support for secondary queue set in nicvf thunderx driver".

I think it is sufficient, at least I don't have any more comment for
rest of the patchset and it looks good to me.

> 
> Should I resubmit it as a new standalone patch?

Can you please resubmit just this one patch, so it can be properly reviewed.

Thanks,
ferruh

^ permalink raw reply

* Re: [PATCH] net/mlx5: fix init on secondary process
From: Ferruh Yigit @ 2016-10-10 13:32 UTC (permalink / raw)
  To: Olivier Gournet, dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro
In-Reply-To: <1475072658-29534-1-git-send-email-ogournet@corp.free.fr>

On 9/28/2016 3:24 PM, Olivier Gournet wrote:
> Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
> 
> Signed-off-by: Olivier Gournet <ogournet@corp.free.fr>
> ---

Adding maintainer to the thread

^ permalink raw reply

* Re: [PATCH v4 4/6] i40e: add Tx preparation
From: Wu, Jingjing @ 2016-10-10 14:02 UTC (permalink / raw)
  To: Kulasek, TomaszX, dev@dpdk.org; +Cc: Ananyev, Konstantin, Kulasek, TomaszX
In-Reply-To: <20160930090039.10164-5-tomaszx.kulasek@intel.com>

>  #include "i40e_logs.h"
>  #include "base/i40e_prototype.h"
> @@ -79,6 +81,17 @@
>  		PKT_TX_TCP_SEG |		 \
>  		PKT_TX_OUTER_IP_CKSUM)
> 
> +#define I40E_TX_OFFLOAD_MASK (  \
> +		PKT_TX_IP_CKSUM |       \
> +		PKT_TX_L4_MASK |        \
> +		PKT_TX_OUTER_IP_CKSUM | \
> +		PKT_TX_TCP_SEG |        \
> +		PKT_TX_QINQ_PKT |       \
> +		PKT_TX_VLAN_PKT)
> +
More TX flags are added for tunneling as below.
/**
 * Bits 45:48 used for the tunnel type.
 * When doing Tx offload like TSO or checksum, the HW needs to configure the
 * tunnel type into the HW descriptors.
 */
#define PKT_TX_TUNNEL_VXLAN   (0x1ULL << 45)
#define PKT_TX_TUNNEL_GRE     (0x2ULL << 45)
#define PKT_TX_TUNNEL_IPIP    (0x3ULL << 45)
#define PKT_TX_TUNNEL_GENEVE  (0x4ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK    (0xFULL << 45)

Please check:
commit 63c0d74daaa9a807fbca8a3e363bbe41d6fb715f
Author: Jianfeng Tan <jianfeng.tan@intel.com>
Date:   Mon Aug 1 03:56:53 2016 +0000

    mbuf: add Tx side tunneling type


Thanks
Jingjing

^ permalink raw reply

* Re: [PATCH v4 1/6] ethdev: add Tx preparation
From: Thomas Monjalon @ 2016-10-10 14:08 UTC (permalink / raw)
  To: Tomasz Kulasek; +Cc: dev, konstantin.ananyev
In-Reply-To: <20160930090039.10164-2-tomaszx.kulasek@intel.com>

Hi,

Now that the feature seems to meet a consensus, I've looked at it more
closely before integrating. Sorry if it appears like a late review.

2016-09-30 11:00, Tomasz Kulasek:
> Added API for `rte_eth_tx_prep`

I would love to read the usability and performance considerations here.
No need for something as long as the cover letter. Just few lines
about why it is needed and why it is a good choice for performance.

> uint16_t rte_eth_tx_prep(uint8_t port_id, uint16_t queue_id,
> 	struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
> 
> Added fields to the `struct rte_eth_desc_lim`:
> 
> 	uint16_t nb_seg_max;
> 		/**< Max number of segments per whole packet. */
> 
> 	uint16_t nb_mtu_seg_max;
> 		/**< Max number of segments per one MTU */
[...]
> +#else
> +
> +static inline uint16_t
> +rte_eth_tx_prep(uint8_t port_id __rte_unused, uint16_t queue_id __rte_unused,
> +		struct rte_mbuf **tx_pkts __rte_unused, uint16_t nb_pkts)

Doxygen is failing here.
Have you tried to move __rte_unused before the identifier?

[...]
> +#define PKT_TX_OFFLOAD_MASK (    \
> +		PKT_TX_IP_CKSUM |        \
> +		PKT_TX_L4_MASK |         \
> +		PKT_TX_OUTER_IP_CKSUM |  \
> +		PKT_TX_TCP_SEG |         \
> +		PKT_TX_QINQ_PKT |        \
> +		PKT_TX_VLAN_PKT)

We should really stop adding some public constants without the proper
RTE prefix.
And by the way, should not we move such flags into rte_net?

[...]
> -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_sctp.h rte_icmp.h rte_arp.h
> +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_sctp.h rte_icmp.h rte_arp.h rte_pkt.h

You can use the += operator on a new line for free :)

No more comments, the rest seems OK. Thanks

^ permalink raw reply

* Re: [PATCH] net/enic: update enic guide and add warning for invalid conf
From: Mcnamara, John @ 2016-10-10 14:16 UTC (permalink / raw)
  To: John Daley, Richardson, Bruce; +Cc: dev@dpdk.org, Nelson Escobar
In-Reply-To: <20160929205505.31690-1-johndale@cisco.com>

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of John Daley
> Sent: Thursday, September 29, 2016 9:55 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>
> Cc: dev@dpdk.org; Nelson Escobar <neescoba@cisco.com>
> Subject: [dpdk-dev] [PATCH] net/enic: update enic guide and add warning
> for invalid conf
> 
> From: Nelson Escobar <neescoba@cisco.com>
> 
> Update the enic guide to better explain how to setup vNIC parameters on
> the Cisco VIC since the introduction of rx scatter and print an error
> message for the case of having 1 RQ configured in the vNIC.
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>

Hi,

It would be better in the RST documentation to use ```` backticks to
designate function and variable names as fixed width. Also, the documentation
convention is to use Rx/Tx. However, these are minor so the patch is okay as
it is.

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH v2] mk: gcc -march support for intel processors code names
From: Thomas Monjalon @ 2016-10-10 14:25 UTC (permalink / raw)
  To: Liu, Yong, reshma.pattan; +Cc: dev
In-Reply-To: <57EB30E0.30106@intel.com>

2016-09-28 10:54, Liu, Yong:
> Tested-by: Yong Liu <yong.liu@intel.com>
>             FangFang Wei <fangfangx.wei@intel.com>
[...]
>    Description: Build test on different distributions
>    Command / instruction:
>      Verify build pass on listed distributions.
> 
>      OS                   GCC            Kernel
>      Ubuntu 16.04         5.4.0          4.4.0-36-generic
>      Fedora23             5.3.1          4.2.3-300
>      Fedora24             6.1.1          4.6.4-301
>      Ubuntu 12.04         4.6.3          3.8.0-29
>      Ubuntu 12.04 i686    4.6.3          3.8.0-29
>      Ubuntu 14.04         4.8.4          3.16.0-30
>      Ubuntu 14.04 i686    4.8.4          3.16.0-30
>      Fedora18             4.7.2          3.6.10-4
>      Fedora18 i686        4.7.2          3.6.10-4
>      Fedora20             4.8.2          3.15.6-200
>      Fedora20 i686        4.8.3          3.11.0
>      Suse11SP2            4.5.1          3.0.13-0.2
>      Suse12SP3            4.7.2          3.7.10-1.1
>      RHEL7.0              4.8.2          3.10.0-123
>      RHEL7.2              4.8.5          3.10.0-327
>      CentOS7.0            4.8.5          3.10.0-327
>      FreeBSD10.0          4.8.4          10.0-RELEASE
>      FreeBSD10.3          4.8.5          10.3-RELEASE

I do not understand this test.
This patch is dropping a lot of optimizations with compilers older than 4.9 !

Why not recommend GCC 4.9 and keep the graceful degradation for older versions,
at least for one more year, even if it is not optimal for newer architectures?

^ permalink raw reply

* Re: [PATCH v7 2/2] net/ixgbe: add callback to user app on VF to PF mbox msg
From: Iremonger, Bernard @ 2016-10-10 14:31 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev@dpdk.org, Shah, Rahul R, Lu, Wenzhuo, az5157@att.com,
	Iremonger, Bernard
In-Reply-To: <2780407.hr2q20cLcS@xps13>

Hi Thomas,

<snip>

> Subject: Re: [dpdk-dev] [PATCH v7 2/2] net/ixgbe: add callback to user app
> on VF to PF mbox msg
> 
> 2016-10-07 17:46, Bernard Iremonger:
> > +struct rte_pmd_ixgbe_mb_event_param {
> > +	uint16_t vfid;     /**< Virtual Function number */
> > +	uint16_t msg_type; /**< message type */
> > +	uint16_t retval;   /**< return value */
> > +	void *userdata;    /**< pointer to user data */
> 
> Generally speaking, the user data is a pointer passed by the application when
> registering the callback and must be untouched.
> It should be the name of the parameter that you are overriding with this
> structure.
> So this "userdata" pointer could probably be better defined.
> 
> By the way, it is far from trivial to understand how to write the callback.
> I think it deserves more explanations.
> 

I will clarify the description of the struct  rte_pmd_ixgbe_mb_event_param, and rename the member userdate to msg in a v8 patchset.

Regards,

Bernard.

^ permalink raw reply

* [PATCH v8 0/2] modify callback for VF management
From: Bernard Iremonger @ 2016-10-10 14:34 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu, az5157; +Cc: Bernard Iremonger
In-Reply-To: <1475858784-5303-1-git-send-email-bernard.iremonger@intel.com>

This patchset modifies the callback function for VF management.

A third parameter has been added to the _rte_eth_dev_callback_process
function. All references to this function have been updated.
Changes have been made to the ixgbe_rcv_msg_from_vf function to
use the new callback parameter.

This patchset depends on the following patch.
http://dpdk.org/dev/patchwork/patch/16430/
[dpdk-dev,v7,1/2] net/ixgbe: add API's for VF management

These patches were part of the RFC PATCH v2 of the above patchset,
but were dropped from the v3 patchset.

Changes in v8:
Rebased to latest master.
Improve description of struct rte_pmd_ixgbe_mb_event_param,
rename  member user_data to msg.

Changes in v7:
Rebased to latest master.
Move references to _rte_eth_dev_callback_process in ixgbe patch
to librte_ether patch.
Revised description of callback parameter.

Changes in v6:
Rebased to latest master.
Squashed patches down to two patches.
Renamed parameter to _rte_eth_dev_callback_process function.
Updated API descriptions.

Changes in v5:
Rebased to latest master.
Added parameter to the _rte_eth_dev_callback_process function
Removed two new callback functions which were added previously.
Updated all calls to the _rte_eth_dev_callback_process function.

Changes in v4:
Rebased to latest master.
Moved the callback parameter structure from the ethdev to the ixgbe PMD.

Changes in v3:
Rebased to latest master.
Submitted as a seperate patchset.
Moved the response enums from the ethdev to the ixgbe PMD.

Changes in v2:
Rebased to latest master.

Bernard Iremonger (2):
  librte_ether: modify internal callback function
  net/ixgbe: add callback to user app on VF to PF mbox msg

 app/test/virtual_pmd.c                 |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c |  6 ++---
 drivers/net/e1000/em_ethdev.c          |  2 +-
 drivers/net/e1000/igb_ethdev.c         |  4 ++--
 drivers/net/enic/enic_main.c           |  2 +-
 drivers/net/i40e/i40e_ethdev.c         |  4 ++--
 drivers/net/i40e/i40e_ethdev_vf.c      |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       |  4 ++--
 drivers/net/ixgbe/ixgbe_pf.c           | 42 +++++++++++++++++++++++++++++-----
 drivers/net/ixgbe/rte_pmd_ixgbe.h      | 20 ++++++++++++++++
 drivers/net/mlx4/mlx4.c                |  4 ++--
 drivers/net/mlx5/mlx5_ethdev.c         |  4 ++--
 drivers/net/nfp/nfp_net.c              |  2 +-
 drivers/net/thunderx/nicvf_ethdev.c    |  2 +-
 drivers/net/vhost/rte_eth_vhost.c      |  6 ++---
 drivers/net/virtio/virtio_ethdev.c     |  2 +-
 lib/librte_ether/rte_ethdev.c          |  5 +++-
 lib/librte_ether/rte_ethdev.h          | 12 +++++++++-
 18 files changed, 94 insertions(+), 31 deletions(-)

-- 
2.9.0

^ permalink raw reply

* [PATCH v8 1/2] librte_ether: modify internal callback function
From: Bernard Iremonger @ 2016-10-10 14:34 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu, az5157; +Cc: Bernard Iremonger
In-Reply-To: <1475858784-5303-1-git-send-email-bernard.iremonger@intel.com>

add cb_arg parameter to the _rte_eth_dev_callback_process function.

Adding a parameter to this function allows passing information
to the application when an eth device event occurs such as
a VF to PF message.
This allows the application to decide if a particular function
is permitted.

drivers/net: add parameter to callback process function

add parameter to call of _rte_eth_dev_callback_process function
in the following PMD's:

net/bonding
net/e1000
net/i40e
net/enic
net/ixgbe
net/mlx4
net/mlx5
net/nfp
net/thunderx
net/vhost
net/virtio

app/test: add parameter to callback process function
add parameter to call of _rte_eth_dev_callback_process function

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Alex Zelezniak <az5157@att.com>
---
 app/test/virtual_pmd.c                 |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c |  6 +++---
 drivers/net/e1000/em_ethdev.c          |  2 +-
 drivers/net/e1000/igb_ethdev.c         |  4 ++--
 drivers/net/enic/enic_main.c           |  2 +-
 drivers/net/i40e/i40e_ethdev.c         |  4 ++--
 drivers/net/i40e/i40e_ethdev_vf.c      |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       |  4 ++--
 drivers/net/mlx4/mlx4.c                |  4 ++--
 drivers/net/mlx5/mlx5_ethdev.c         |  4 ++--
 drivers/net/nfp/nfp_net.c              |  2 +-
 drivers/net/thunderx/nicvf_ethdev.c    |  2 +-
 drivers/net/vhost/rte_eth_vhost.c      |  6 +++---
 drivers/net/virtio/virtio_ethdev.c     |  2 +-
 lib/librte_ether/rte_ethdev.c          |  5 ++++-
 lib/librte_ether/rte_ethdev.h          | 12 +++++++++++-
 16 files changed, 38 insertions(+), 25 deletions(-)

diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 4831113..65b44c6 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -485,7 +485,7 @@ virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id,
 
 	vrtl_eth_dev->data->dev_link.link_status = link_status;
 
-	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC);
+	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 int
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index fb4050c..8d510e3 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1958,7 +1958,7 @@ bond_ethdev_delayed_lsc_propagation(void *arg)
 		return;
 
 	_rte_eth_dev_callback_process((struct rte_eth_dev *)arg,
-			RTE_ETH_EVENT_INTR_LSC);
+			RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 void
@@ -2079,7 +2079,7 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC);
+						RTE_ETH_EVENT_INTR_LSC, NULL);
 
 		} else {
 			if (internals->link_down_delay_ms > 0)
@@ -2088,7 +2088,7 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC);
+						RTE_ETH_EVENT_INTR_LSC, NULL);
 		}
 	}
 }
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index f767e1c..e13e858 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1599,7 +1599,7 @@ eth_em_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
 
 	eth_em_interrupt_get_status(dev);
 	eth_em_interrupt_action(dev);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 static int
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 5a1a83e..d9ab2df 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -2683,7 +2683,7 @@ eth_igb_interrupt_action(struct rte_eth_dev *dev)
 		E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 		E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 		E1000_WRITE_FLUSH(hw);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 	}
 
 	return 0;
@@ -2743,7 +2743,7 @@ void igbvf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == E1000_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
 }
 
 static int
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 15a05b4..fb72491 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -436,7 +436,7 @@ enic_intr_handler(__rte_unused struct rte_intr_handle *handle,
 	vnic_intr_return_all_credits(&enic->intr);
 
 	enic_link_update(enic);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 	enic_log_q_error(enic);
 }
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d0640b9..0dd396a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5514,7 +5514,7 @@ i40e_dev_interrupt_delayed_handler(void *param)
 
 	/* handle the link up interrupt in an alarm callback */
 	i40e_dev_link_update(dev, 0);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 
 	i40e_pf_enable_irq0(hw);
 	rte_intr_enable(&(dev->pci_dev->intr_handle));
@@ -5598,7 +5598,7 @@ i40e_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
 			return;
 		else
 			_rte_eth_dev_callback_process(dev,
-				RTE_ETH_EVENT_INTR_LSC);
+				RTE_ETH_EVENT_INTR_LSC, NULL);
 	}
 
 done:
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 34eb274..bd89cd9 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1341,7 +1341,7 @@ i40evf_handle_pf_event(__rte_unused struct rte_eth_dev *dev,
 	switch (pf_msg->event) {
 	case I40E_VIRTCHNL_EVENT_RESET_IMPENDING:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event\n");
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
 		break;
 	case I40E_VIRTCHNL_EVENT_LINK_CHANGE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event\n");
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 35281f9..b00aef3 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3559,7 +3559,7 @@ ixgbe_dev_interrupt_delayed_handler(void *param)
 		ixgbe_dev_link_update(dev, 0);
 		intr->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE;
 		ixgbe_dev_link_status_print(dev);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 	}
 
 	PMD_DRV_LOG(DEBUG, "enable intr in delayed handler S[%08x]", eicr);
@@ -7537,7 +7537,7 @@ static void ixgbevf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == IXGBE_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
 }
 
 static int
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 1553b2e..3e57cca 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -5448,7 +5448,7 @@ mlx4_dev_link_status_handler(void *arg)
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 /**
@@ -5471,7 +5471,7 @@ mlx4_dev_interrupt_handler(struct rte_intr_handle *intr_handle, void *cb_arg)
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 /**
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index bf4232a..c76e754 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1069,7 +1069,7 @@ mlx5_dev_link_status_handler(void *arg)
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 /**
@@ -1092,7 +1092,7 @@ mlx5_dev_interrupt_handler(struct rte_intr_handle *intr_handle, void *cb_arg)
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 /**
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index d526f34..a2b9056 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1219,7 +1219,7 @@ nfp_net_dev_interrupt_delayed_handler(void *param)
 	struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
 
 	nfp_net_link_update(dev, 0);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 
 	nfp_net_dev_link_status_print(dev);
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b758c9f..c61e171 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -108,7 +108,7 @@ nicvf_interrupt(void *arg)
 			nicvf_set_eth_link_status(nic,
 					&nic->eth_dev->data->dev_link);
 		_rte_eth_dev_callback_process(nic->eth_dev,
-				RTE_ETH_EVENT_INTR_LSC);
+				RTE_ETH_EVENT_INTR_LSC, NULL);
 	}
 
 	rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index c1d09a0..18a0c10 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -559,7 +559,7 @@ new_device(int vid)
 
 	RTE_LOG(INFO, PMD, "New connection established\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 
 	return 0;
 }
@@ -626,7 +626,7 @@ destroy_device(int vid)
 
 	RTE_LOG(INFO, PMD, "Connection closed\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 static int
@@ -655,7 +655,7 @@ vring_state_changed(int vid, uint16_t vring, int enable)
 	RTE_LOG(INFO, PMD, "vring%u is %s\n",
 			vring, enable ? "enabled" : "disabled");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE, NULL);
 
 	return 0;
 }
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index b4dfc0a..2f0065a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1103,7 +1103,7 @@ virtio_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
 	if (isr & VIRTIO_PCI_ISR_CONFIG) {
 		if (virtio_dev_link_update(dev, 0) == 0)
 			_rte_eth_dev_callback_process(dev,
-						      RTE_ETH_EVENT_INTR_LSC);
+						      RTE_ETH_EVENT_INTR_LSC, NULL);
 	}
 
 }
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 88fa382..0d9d9c1 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2508,7 +2508,7 @@ rte_eth_dev_callback_unregister(uint8_t port_id,
 
 void
 _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-	enum rte_eth_event_type event)
+	enum rte_eth_event_type event, void *cb_arg)
 {
 	struct rte_eth_dev_callback *cb_lst;
 	struct rte_eth_dev_callback dev_cb;
@@ -2519,6 +2519,9 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
 			continue;
 		dev_cb = *cb_lst;
 		cb_lst->active = 1;
+		if (cb_arg != NULL)
+			dev_cb.cb_arg = (void *) cb_arg;
+
 		rte_spinlock_unlock(&rte_eth_dev_cb_lock);
 		dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
 						dev_cb.cb_arg);
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0a32ebb..351f972 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3030,6 +3030,7 @@ enum rte_eth_event_type {
 				/**< queue state event (enabled/disabled) */
 	RTE_ETH_EVENT_INTR_RESET,
 			/**< reset interrupt event, sent to VF on PF reset */
+	RTE_ETH_EVENT_VF_MBOX,  /**< message from the VF received by PF */
 	RTE_ETH_EVENT_MAX       /**< max value of this enum */
 };
 
@@ -3051,6 +3052,11 @@ typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
  * @param cb_arg
  *  Pointer to the parameters for the registered callback.
  *
+ *  The user data is overwritten in the case of RTE_ETH_EVENT_VF_MBOX.
+ *	This even occurs when a message from the VF is received by the PF.
+ *	The user data is overwritten with struct rte_pmd_ixgbe_mb_event_param.
+ *	This struct is defined in rte_pmd_ixgbe.h.
+ *
  * @return
  *  - On success, zero.
  *  - On failure, a negative value.
@@ -3089,12 +3095,16 @@ int rte_eth_dev_callback_unregister(uint8_t port_id,
  *  Pointer to struct rte_eth_dev.
  * @param event
  *  Eth device interrupt event type.
+ * @param cb_arg
+ *  Update callback parameter to pass data back to user application.
+ *  This allows the user application to decide if a particular function
+ *  is permitted or not.
  *
  * @return
  *  void
  */
 void _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-				enum rte_eth_event_type event);
+				enum rte_eth_event_type event, void *cb_arg);
 
 /**
  * When there is no rx packet coming in Rx Queue for a long time, we can
-- 
2.9.0

^ permalink raw reply related

* [PATCH v8 2/2] net/ixgbe: add callback to user app on VF to PF mbox msg
From: Bernard Iremonger @ 2016-10-10 14:34 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu, az5157; +Cc: Bernard Iremonger
In-Reply-To: <1475858784-5303-1-git-send-email-bernard.iremonger@intel.com>

call _rte_eth_dev_callback_process from ixgbe_rcv_msg_from_vf function.

The callback asks the user application if it is allowed to perform
the function.

If the cb_param.retval is RTE_PMD_IXGBE_MB_EVENT_PROCEED then continue,
if 0, do nothing and send ACK to VF
if > 1, do nothing and send NAK to VF.

Signed-off-by: Alex Zelezniak <az5157@att.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_pf.c      | 42 +++++++++++++++++++++++++++++++++------
 drivers/net/ixgbe/rte_pmd_ixgbe.h | 20 +++++++++++++++++++
 2 files changed, 56 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 56393ff..26395e4 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,7 @@
 
 #include "base/ixgbe_common.h"
 #include "ixgbe_ethdev.h"
+#include "rte_pmd_ixgbe.h"
 
 #define IXGBE_MAX_VFTA     (128)
 #define IXGBE_VF_MSG_SIZE_DEFAULT 1
@@ -660,6 +661,7 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ixgbe_vf_info *vfinfo =
 		*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
+	struct rte_pmd_ixgbe_mb_event_param cb_param;
 
 	retval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);
 	if (retval) {
@@ -674,27 +676,54 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)
 	/* flush the ack before we write any messages back */
 	IXGBE_WRITE_FLUSH(hw);
 
+	/**
+	 * initialise structure to send to user application
+	 * will return response from user in retval field
+	 */
+	cb_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;
+	cb_param.vfid = vf;
+	cb_param.msg_type = msgbuf[0] & 0xFFFF;
+	cb_param.msg = (void *)msgbuf;
+
 	/* perform VF reset */
 	if (msgbuf[0] == IXGBE_VF_RESET) {
 		int ret = ixgbe_vf_reset(dev, vf, msgbuf);
 
 		vfinfo[vf].clear_to_send = true;
+
+		/* notify application about VF reset */
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
 		return ret;
 	}
 
+	/**
+	 * ask user application if we allowed to perform those functions
+	 * if we get cb_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED
+	 * then business as usual,
+	 * if 0, do nothing and send ACK to VF
+	 * if cb_param.retval > 1, do nothing and send NAK to VF
+	 */
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
+
+	retval = cb_param.retval;
+
 	/* check & process VF to PF mailbox message */
 	switch ((msgbuf[0] & 0xFFFF)) {
 	case IXGBE_VF_SET_MAC_ADDR:
-		retval = ixgbe_vf_set_mac_addr(dev, vf, msgbuf);
+		if (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)
+			retval = ixgbe_vf_set_mac_addr(dev, vf, msgbuf);
 		break;
 	case IXGBE_VF_SET_MULTICAST:
-		retval = ixgbe_vf_set_multicast(dev, vf, msgbuf);
+		if (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)
+			retval = ixgbe_vf_set_multicast(dev, vf, msgbuf);
 		break;
 	case IXGBE_VF_SET_LPE:
-		retval = ixgbe_set_vf_lpe(dev, vf, msgbuf);
+		if (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)
+			retval = ixgbe_set_vf_lpe(dev, vf, msgbuf);
 		break;
 	case IXGBE_VF_SET_VLAN:
-		retval = ixgbe_vf_set_vlan(dev, vf, msgbuf);
+		if (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)
+			retval = ixgbe_vf_set_vlan(dev, vf, msgbuf);
 		break;
 	case IXGBE_VF_API_NEGOTIATE:
 		retval = ixgbe_negotiate_vf_api(dev, vf, msgbuf);
@@ -704,7 +733,8 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)
 		msg_size = IXGBE_VF_GET_QUEUE_MSG_SIZE;
 		break;
 	case IXGBE_VF_UPDATE_XCAST_MODE:
-		retval = ixgbe_set_vf_mc_promisc(dev, vf, msgbuf);
+		if (retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED)
+			retval = ixgbe_set_vf_mc_promisc(dev, vf, msgbuf);
 		break;
 	default:
 		PMD_DRV_LOG(DEBUG, "Unhandled Msg %8.8x", (unsigned)msgbuf[0]);
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 2689668..74b64ad 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -179,4 +179,24 @@ int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on);
  */
 int
 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+ * Response sent back to ixgbe driver from user app after callback
+ */
+enum rte_pmd_ixgbe_mb_event_rsp {
+	RTE_PMD_IXGBE_MB_EVENT_NOOP_ACK,  /**< skip mbox request and ACK */
+	RTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
+	RTE_PMD_IXGBE_MB_EVENT_PROCEED,  /**< proceed with mbox request  */
+	RTE_PMD_IXGBE_MB_EVENT_MAX       /**< max value of this enum */
+};
+
+/**
+ * Data sent to the user application when the callback is executed.
+ */
+struct rte_pmd_ixgbe_mb_event_param {
+	uint16_t vfid;     /**< Virtual Function number */
+	uint16_t msg_type; /**< VF to PF message type, defined in ixgbe_mbx.h */
+	uint16_t retval;   /**< return value */
+	void *msg;         /**< pointer to message */
+};
 #endif /* _PMD_IXGBE_H_ */
-- 
2.9.0

^ permalink raw reply related

* [PATCH] pdump: fix dir permissions value in mkdir call
From: Reshma Pattan @ 2016-10-10 14:35 UTC (permalink / raw)
  To: dev; +Cc: Reshma Pattan

From: Reshma Pattan <reshma.pattan@intel.com>

Inside the function pdump_get_socket_path(), pdump socket
directories are created using mkdir() call with permissions 700,
which was assigning wrong permissions to the directories
i.e. "d-w-r-xr-T" instead of drwx---. The reason is mkdir() call
doesn't consider 700 as an octal value until unless 0 is explicitly
added before the value. Because of this, socket creation failure is
observed when DPDK application was ran in non root user mode.
DPDK application running in root user mode never reported the issue.

So 0 is prefixed to the value to create directories with
the correct permissions.

Fixes: e4ffa2d3 ("pdump: fix error handlings")
Fixes: bdd8dcc6 ("pdump: fix default socket path")

Reported-by: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 lib/librte_pdump/rte_pdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index 9b921ce..ea5ccd9 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -471,12 +471,12 @@ pdump_get_socket_path(char *buffer, int bufsz, enum rte_pdump_socktype type)
 			snprintf(dpdk_dir, sizeof(dpdk_dir), "%s%s",
 					SOCKET_PATH_VAR_RUN, DPDK_DIR);
 
-		mkdir(dpdk_dir, 700);
+		mkdir(dpdk_dir, 0700);
 		snprintf(dir, sizeof(dir), "%s%s",
 					dpdk_dir, SOCKET_DIR);
 	}
 
-	ret =  mkdir(dir, 700);
+	ret =  mkdir(dir, 0700);
 	/* if user passed socket path is invalid, return immediately */
 	if (ret < 0 && errno != EEXIST) {
 		RTE_LOG(ERR, PDUMP,
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH v2] net/i40e: remove weak symbols
From: Wu, Jingjing @ 2016-10-10 14:36 UTC (permalink / raw)
  To: Zoltan Kiss, dev@dpdk.org
  Cc: Matias Elo, Gonzalez Monroy, Sergio, Yigit, Ferruh,
	damarion@cisco.com, thomas.monjalon@6wind.com
In-Reply-To: <1469034676-2424-1-git-send-email-zoltan.kiss@schaman.hu>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zoltan Kiss
> Sent: Thursday, July 21, 2016 1:11 AM
> To: dev@dpdk.org
> Cc: Matias Elo <matias.elo@nokia-bell-labs.com>; Gonzalez Monroy, Sergio
> <sergio.gonzalez.monroy@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> damarion@cisco.com; thomas.monjalon@6wind.com
> Subject: [dpdk-dev] [PATCH v2] net/i40e: remove weak symbols
> 
> Using weak symbols have a few issues with static linking:
> 
> - normally the linker searches the .o files already linked, if your weak
>   one is there, it won't check if there is a strong version
> - unless the symbol is directly referred, but it's not the right thing to
>   rely on
> - or --whole-archive specified in the command line, which pulls in a lot
>   of unwanted stuff
> - whole-archive also makes libtool dropping the library from the command
>   line, which is what should happen with dynamic linking, but not with
>   static (observed on Ubuntu 14.04). This is an important bug if you
>   build a static library depending on DPDK
> 
> This patch merges the two version and make the behaviour rely on the
> config.
> 
> If we can agree in the concept, I can send a series to fix this for the
> other weak functions.
> 
> Signed-off-by: Zoltan Kiss <zoltan.kiss@schaman.hu>
> ---

Looks good to remove weak symbols.
Just one concern is vector PMD is one specific part to different Micro-Architecture.
It's better to keep independent from normal tx/rx files. Think about ixgbe_rxtx_vec_neon.c and ixgbe_rxtx_vec_sse.c


Thanks
Jingjing

^ permalink raw reply

* Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature
From: Yuanhan Liu @ 2016-10-10 14:42 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Michael S. Tsirkin, Stephen Hemminger, dev, qemu-devel
In-Reply-To: <3b71f113-26af-711c-4060-ca576260ec72@redhat.com>

On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coquelin wrote:
> >>>At that time, a packet always use 2 descs. Since indirect desc is
> >>>enabled (by default) now, the assumption is not true then. What's
> >>>worse, it might even slow things a bit down. That should also be
> >>>part of the reason why performance is slightly worse than before.
> >>>
> >>>	--yliu
> >>
> >>I'm not sure I get what you are saying
> >>
> >>>commit 1d41d77cf81c448c1b09e1e859bfd300e2054a98
> >>>Author: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> >>>Date:   Mon May 2 17:46:17 2016 -0700
> >>>
> >>>    vhost: optimize dequeue for small packets
> >>>
> >>>    A virtio driver normally uses at least 2 desc buffers for Tx: the
> >>>    first for storing the header, and the others for storing the data.
> >>>
> >>>    Therefore, we could fetch the first data desc buf before the main
> >>>    loop, and do the copy first before the check of "are we done yet?".
> >>>    This could save one check for small packets that just have one data
> >>>    desc buffer and need one mbuf to store it.
> >>>
> >>>    Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> >>>    Acked-by: Huawei Xie <huawei.xie@intel.com>
> >>>    Tested-by: Rich Lane <rich.lane@bigswitch.com>
> >>
> >>This fast-paths the 2-descriptors format but it's not active
> >>for indirect descriptors. Is this what you mean?
> >
> >Yes. It's also not active when ANY_LAYOUT is actually turned on.
> >>Should be a simple matter to apply this optimization for indirect.
> >
> >Might be.
> 
> If I understand the code correctly, indirect descs also benefit from this
> optimization, or am I missing something?

Aha..., you are right!

	--yliu

^ permalink raw reply

* Re: [PATCH v3 03/16] mbuf: move packet type definitions in a new file
From: Thomas Monjalon @ 2016-10-10 14:52 UTC (permalink / raw)
  To: Olivier Matz
  Cc: dev, cunming.liang, john.mcnamara, andrey.chilikin,
	konstantin.ananyev
In-Reply-To: <1475483937-21696-4-git-send-email-olivier.matz@6wind.com>

2016-10-03 10:38, Olivier Matz:
> The file rte_mbuf.h starts to be quite big, and next commits
> will introduce more functions related to packet types. Let's
> move them in a new file.
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> ---
>  lib/librte_mbuf/Makefile         |   2 +-
>  lib/librte_mbuf/rte_mbuf.h       | 495 +----------------------------------
>  lib/librte_mbuf/rte_mbuf_ptype.h | 552 +++++++++++++++++++++++++++++++++++++++

Why not moving packet type and other packet flags in librte_net?

^ permalink raw reply

* Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature
From: Maxime Coquelin @ 2016-10-10 14:54 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: Michael S. Tsirkin, Stephen Hemminger, dev, qemu-devel
In-Reply-To: <20161010144209.GI1597@yliu-dev.sh.intel.com>



On 10/10/2016 04:42 PM, Yuanhan Liu wrote:
> On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coquelin wrote:
>>>>> At that time, a packet always use 2 descs. Since indirect desc is
>>>>> enabled (by default) now, the assumption is not true then. What's
>>>>> worse, it might even slow things a bit down. That should also be
>>>>> part of the reason why performance is slightly worse than before.
>>>>>
>>>>> 	--yliu
>>>>
>>>> I'm not sure I get what you are saying
>>>>
>>>>> commit 1d41d77cf81c448c1b09e1e859bfd300e2054a98
>>>>> Author: Yuanhan Liu <yuanhan.liu@linux.intel.com>
>>>>> Date:   Mon May 2 17:46:17 2016 -0700
>>>>>
>>>>>    vhost: optimize dequeue for small packets
>>>>>
>>>>>    A virtio driver normally uses at least 2 desc buffers for Tx: the
>>>>>    first for storing the header, and the others for storing the data.
>>>>>
>>>>>    Therefore, we could fetch the first data desc buf before the main
>>>>>    loop, and do the copy first before the check of "are we done yet?".
>>>>>    This could save one check for small packets that just have one data
>>>>>    desc buffer and need one mbuf to store it.
>>>>>
>>>>>    Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
>>>>>    Acked-by: Huawei Xie <huawei.xie@intel.com>
>>>>>    Tested-by: Rich Lane <rich.lane@bigswitch.com>
>>>>
>>>> This fast-paths the 2-descriptors format but it's not active
>>>> for indirect descriptors. Is this what you mean?
>>>
>>> Yes. It's also not active when ANY_LAYOUT is actually turned on.
>>>> Should be a simple matter to apply this optimization for indirect.
>>>
>>> Might be.
>>
>> If I understand the code correctly, indirect descs also benefit from this
>> optimization, or am I missing something?
>
> Aha..., you are right!

The interesting thing is that the patch I send on Thursday that removes
header access when no offload has been negotiated[0] seems to reduce
almost to zero the performance seen with indirect descriptors enabled.
I see this with 64 bytes packets using testpmd on both ends.

When I did the patch, I would have expected the same gain with both
modes, whereas I measured +1% for direct and +4% for indirect.

Maxime
[0]: http://dpdk.org/dev/patchwork/patch/16423/

^ permalink raw reply

* Re: [PATCH 1/4] testpmd: Add support to configure 25G and 50G speeds
From: Ferruh Yigit @ 2016-10-10 15:01 UTC (permalink / raw)
  To: Ajit Khaparde, dev; +Cc: Pablo de Lara
In-Reply-To: <20160929170335.GA52221@C02PT1RBG8WP.aus.broadcom.com>

Hi Ajit,

On 9/29/2016 6:03 PM, Ajit Khaparde wrote:
> Support to configure 25G and 50G speeds is missing from testpmd.
> This patch also updates the testpmd user guide accordingly.
> 
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

This patch seems not really part of the patchset for bnxt driver, but
standalone testpmd only modification, and can be threaded as single patch.

I am adding testpmd maintainer to cc.

Thanks,
ferruh

^ permalink raw reply

* Re: [PATCH v2] mk: gcc -march support for intel processors code names
From: Pattan, Reshma @ 2016-10-10 15:21 UTC (permalink / raw)
  To: Thomas Monjalon, Liu, Yong; +Cc: dev@dpdk.org
In-Reply-To: <2578548.bj2dOLfXoi@xps13>

Hi Thomas

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Monday, October 10, 2016 3:26 PM
> To: Liu, Yong <yong.liu@intel.com>; Pattan, Reshma
> <reshma.pattan@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] mk: gcc -march support for intel processors
> code names
> 
> 2016-09-28 10:54, Liu, Yong:
> > Tested-by: Yong Liu <yong.liu@intel.com>
> >             FangFang Wei <fangfangx.wei@intel.com>
> [...]
> >    Description: Build test on different distributions
> >    Command / instruction:
> >      Verify build pass on listed distributions.
> >
> >      OS                   GCC            Kernel
> >      Ubuntu 16.04         5.4.0          4.4.0-36-generic
> >      Fedora23             5.3.1          4.2.3-300
> >      Fedora24             6.1.1          4.6.4-301
> >      Ubuntu 12.04         4.6.3          3.8.0-29
> >      Ubuntu 12.04 i686    4.6.3          3.8.0-29
> >      Ubuntu 14.04         4.8.4          3.16.0-30
> >      Ubuntu 14.04 i686    4.8.4          3.16.0-30
> >      Fedora18             4.7.2          3.6.10-4
> >      Fedora18 i686        4.7.2          3.6.10-4
> >      Fedora20             4.8.2          3.15.6-200
> >      Fedora20 i686        4.8.3          3.11.0
> >      Suse11SP2            4.5.1          3.0.13-0.2
> >      Suse12SP3            4.7.2          3.7.10-1.1
> >      RHEL7.0              4.8.2          3.10.0-123
> >      RHEL7.2              4.8.5          3.10.0-327
> >      CentOS7.0            4.8.5          3.10.0-327
> >      FreeBSD10.0          4.8.4          10.0-RELEASE
> >      FreeBSD10.3          4.8.5          10.3-RELEASE
> 
> I do not understand this test.
> This patch is dropping a lot of optimizations with compilers older than 4.9 !
> 
> Why not recommend GCC 4.9 and keep the graceful degradation for older
> versions, at least for one more year, even if it is not optimal for newer
> architectures?

I am ok with the idea, so should I send latest patch by keeping the code in  mk/toolchain/gcc/rte.toolchain-compat.mk untouched/intact?

Thanks,
Reshma

^ permalink raw reply

* Re: [PATCH 2/4] bnxt: Fix a segfault encountered during KNI exit
From: Ferruh Yigit @ 2016-10-10 15:24 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dev
In-Reply-To: <CACZ4nhvUS1f41rr0X0fQ7tEXPOknCtQeKg2vdeTZonHa63i6dw@mail.gmail.com>

On 9/29/2016 8:06 PM, Ajit Khaparde wrote:
> On Thu, Sep 29, 2016 at 12:41 PM, Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>>wrote:
> 
>     On 9/29/2016 6:03 PM, Ajit Khaparde wrote:
>     > The bnxt PMD is running into a segfault when exiting out of KNI
> 
>     KNI?
> 
> examples/kni
> 
> ​On closing the kni app, I am seeing a segfault.​ because of improper
> cleanup of resources
> in the dev_uninit path.

So this is mainly related to driver exit, KNI app is just a way to
reproduce it.

Are you OK with following update in commit log:

"
net/bnxt: fix a segfault encountered during PMD exit

This patch fixes segfault encountered during dev_uninit/close routine.
KNI sample app can be used to reproduce the issue.
"

^ permalink raw reply

* Re: [PATCH] app/test: fix crypto mbuf pool size
From: Trahe, Fiona @ 2016-10-10 15:37 UTC (permalink / raw)
  To: Azarewicz, PiotrX T; +Cc: dev@dpdk.org
In-Reply-To: <1475840080-180796-1-git-send-email-piotrx.t.azarewicz@intel.com>

Hi Piotr,

> -----Original Message-----
> From: Azarewicz, PiotrX T
> Sent: Friday, October 7, 2016 12:35 PM
> To: Trahe, Fiona <fiona.trahe@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] app/test: fix crypto mbuf pool size
> 
> This patch fix that created pool for crypto mbufs may be too big in some
> environments.
> To avoid the issue, mbuf pool is reverted to its previous size.
> Moreover, here is added additional small pool with one large mbuf, what is
> needed in large data test scenarios.
> 
> Fixes: 2070f885b76d ("app/test: added tests for libcrypto PMD")
> 
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> ---
>  app/test/test_cryptodev.c |   28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index
> 2917454..914bb0b 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -60,6 +60,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;
> 
>  struct crypto_testsuite_params {
>  	struct rte_mempool *mbuf_pool;
> +	struct rte_mempool *large_mbuf_pool;
>  	struct rte_mempool *op_mpool;
>  	struct rte_cryptodev_config conf;
>  	struct rte_cryptodev_qp_conf qp_conf;
> @@ -169,7 +170,7 @@ testsuite_setup(void)
>  		/* Not already created so create */
>  		ts_params->mbuf_pool = rte_pktmbuf_pool_create(
>  				"CRYPTO_MBUFPOOL",
> -				NUM_MBUFS, MBUF_CACHE_SIZE, 0,
> UINT16_MAX,
> +				NUM_MBUFS, MBUF_CACHE_SIZE, 0,
> MBUF_SIZE,
>  				rte_socket_id());
>  		if (ts_params->mbuf_pool == NULL) {
>  			RTE_LOG(ERR, USER1, "Can't create
> CRYPTO_MBUFPOOL\n"); @@ -177,6 +178,21 @@ testsuite_setup(void)
>  		}
>  	}
> 
> +	ts_params->large_mbuf_pool = rte_mempool_lookup(
> +			"CRYPTO_LARGE_MBUFPOOL");
> +	if (ts_params->large_mbuf_pool == NULL) {
> +		/* Not already created so create */
> +		ts_params->large_mbuf_pool = rte_pktmbuf_pool_create(
> +				"CRYPTO_LARGE_MBUFPOOL",
> +				1, 0, 0, UINT16_MAX,
> +				rte_socket_id());
> +		if (ts_params->large_mbuf_pool == NULL) {
> +			RTE_LOG(ERR, USER1,
> +				"Can't create
> CRYPTO_LARGE_MBUFPOOL\n");
> +			return TEST_FAILED;
> +		}
> +	}
> +
>  	ts_params->op_mpool = rte_crypto_op_pool_create(
>  			"MBUF_CRYPTO_SYM_OP_POOL",
>  			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> @@ -5149,7 +5165,10 @@ test_AES_GMAC_authentication(const struct
> gmac_test_data *tdata)
>  	if (retval < 0)
>  		return retval;
> 
> -	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> +	if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> +	else
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
> 
It would be safer to test if aad.len > MBUF_SIZE, here and below.


>  	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
>  			rte_pktmbuf_tailroom(ut_params->ibuf));
> @@ -5233,7 +5252,10 @@ test_AES_GMAC_authentication_verify(const
> struct gmac_test_data *tdata)
>  	if (retval < 0)
>  		return retval;
> 
> -	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> +	if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> +	else
> +		ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
> 
>  	memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
>  			rte_pktmbuf_tailroom(ut_params->ibuf));
> --
> 1.7.9.5

^ permalink raw reply

* Re: [PATCH 3/4] bnxt: Add support for Async Link Notification
From: Ferruh Yigit @ 2016-10-10 15:40 UTC (permalink / raw)
  To: Ajit Khaparde, dev
In-Reply-To: <20160929170356.GA52225@C02PT1RBG8WP.aus.broadcom.com>

Hi Ajit,

On 9/29/2016 6:03 PM, Ajit Khaparde wrote:
> This patch adds support to get Link notification asynchronously.
> The HW sends Async notifications on default completion ring. The
> PMD processes these notifications and logs a message appropriately.
> 
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/Makefile      |   1 +
>  drivers/net/bnxt/bnxt.h        |   6 +-
>  drivers/net/bnxt/bnxt_cpr.c    |  21 +++---
>  drivers/net/bnxt/bnxt_ethdev.c | 114 ++++++++++++++++++++++++++----
>  drivers/net/bnxt/bnxt_hwrm.c   |  93 ++++++++++++------------
>  drivers/net/bnxt/bnxt_irq.c    | 156 +++++++++++++++++++++++++++++++++++++++++
>  drivers/net/bnxt/bnxt_irq.h    |  51 ++++++++++++++
>  7 files changed, 367 insertions(+), 75 deletions(-)
>  create mode 100644 drivers/net/bnxt/bnxt_irq.c
>  create mode 100644 drivers/net/bnxt/bnxt_irq.h
> 

<...>

> +static inline int
> +rte_bnxt_atomic_read_link_status(struct rte_eth_dev *eth_dev,
> +				struct rte_eth_link *link)
> +{
> +	struct rte_eth_link *dst = link;
> +	struct rte_eth_link *src = &eth_dev->data->dev_link;
> +
> +	if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
> +					*(uint64_t *)src) == 0)
> +		return 1;
> +
> +	return 0;
> +}
> +

This creates a compilation error:
.../drivers/net/bnxt/bnxt_ethdev.c:444:1:
error: unused function 'rte_bnxt_atomic_read_link_status'
[-Werror,-Wunused-function]
rte_bnxt_atomic_read_link_status(struct rte_eth_dev *eth_dev,
^

Since the patches in this patchet really not related, it is OK to send a
new version of just this patch.

Thanks,
ferruh

^ permalink raw reply

* Re: 17.02 Roadmap
From: O'Driscoll, Tim @ 2016-10-10 16:13 UTC (permalink / raw)
  To: dev@dpdk.org

We published our initial roadmap for 17.02 at the end of August. Since then we've been doing more detailed planning and would like to provide an update on the features that we plan to submit for this release. This is our current plan, which should hopefully remain fairly stable now:

Consistent Filter API: Add support for the Consistent Filter API (see http://dpdk.org/ml/archives/dev/2016-September/047924.html) for IGB, IXGBE and I40E.

Elastic Flow Distributor: The Elastic Flow Distributor (EFD) is a flow-based load balancing library which scales linearly for both lookup and insert with the number of threads or cores.  EFD lookup uses a "perfect hashing" scheme where only the information needed to compute a key's value (and not the key itself) is stored in the lookup table, thus reducing CPU cache storage requirements. 

Extended Stats (Latency and Bit Rate Statistics): Enhance the Extended NIC Stats (Xstats) implementation to support the collection and reporting of latency and bit rate measurements. Latency statistics will include min, max and average latency, and jitter. Bit rate statistics will include peak and average bit rate aggregated over a user-defined time period. This will be implemented for IXGBE and I40E.

Run-Time Configuration of Packet Type (PTYPE) for I40E: At the moment all packet types in DPDK are statically defined. This makes impossible to add new values without first defining them statically and then recompiling DPDK. The ability to configure packet types at run time will be added for I40E.

Packet Distributor Enhancements: Enhancements will be made to the Packet Distributor library to improve performance:
1. Introduce burst functionality to allow batches of packets to be sent to workers.
2. Improve the performance of the flow/core affinity through the use of SSE/AVX instructions.

Add MACsec for IXGBE: MACsec support will be added for IXGBE. Ethdev API primitives will be added to create/delete/enable/disable SC/SA, Next_PN etc. similar to those used in Linux for the macsec_ops. Sample apps (l3fwd, testpmd, etc.) will be updated to support MACsec for the IXGBE. 

Enhance AESNI_GCM PMD: The current AESNI_GCM PMD is limited to AES-128 and does not support other features such as "any AAD length value". It will be updated to use a newer GCM implementation supporting AES128/192/256 and other features.

Create Crypto Performance Test App: A new app, similar to testpmd, will be created to allow crypto performance to be tested using any crypto PMD and any supported crypto algorithm.

Enable Cipher-Only and Hash-Only Support in AESNI_MB PMD: Support will be added for cipher-only and hash-only operations in the AESNI_MB PMD.

Support Chained Mbufs in Cryptodev: Currently, an application using the cryptodev API needs to reserve a continuous block of memory for mbufs. Support will be added for chaining of mbufs in both the QAT and SW PMDs supported by cryptodev.

Optimize Vhost-User Performance for Large Packets: A new memory copy function optimized for core-to-core memory copy which will be added. This will be beneficial for virtualization cases involving large packets, but it can be used for other core-to-core cases as well.

Support New Device Types in Vhost-User: Support will be added to vhost-user for new device types including vhost-scsi and vhost-blk.

Interrupt Mode Support in Virtio PMD: Support for interrupt mode will be added to the virtio PMD.

Virtio-User as an Alternative Exception Path: Investigate the use of virtio-user and vhost-net as an alternative exception path to KNI that does not require out of tree drivers. This work is still at an experimental stage, so it may not be included in 17.02.


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'Driscoll, Tim
> Sent: Wednesday, August 31, 2016 11:32 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] 17.02 Roadmap
> 
> Below are the features that we're planning to submit for the 17.02
> release. We'll submit a patch to update the roadmap page with this info.
> 
> Some things will obviously change during planning/development, so we'll
> provide a more detailed update in late September/early October. After
> that, things should hopefully be relatively stable.
> 
> It would be good if others are also willing to share their plans so that
> we can build up a complete picture of what's planned for 17.02 and make
> sure there's no duplication.
> 
> 
> Consistent Filter API phase 2: Extend support for the Consistent Filter
> API that will be first implemented in 16.11 to IGB and FM10K.
> 
> Elastic Flow Distributor: The Elastic Flow Distributor (EFD) is a flow-
> based load balancing library which scales linearly for both lookup and
> insert with the number of threads or cores.  EFD lookup uses a "perfect
> hashing" scheme where only the information needed to compute a key's
> value (and not the key itself) is stored in the lookup table, thus
> reducing CPU cache storage requirements.
> 
> Cryptodev: Additional Software Algorithms:
> - Optimize the AES-GCM software PMD.
> - Enhance the Intel(r) AES-NI MB PMD to add support for cipher-only and
> authentication-only operations. Add support for AES_CBC_MAC,
> AES_CMAC_128, AES_GMAC_128.
> - Add software support for: 3DES_ECB_128/192, AES_ECB_128/192/256,
> AES_F8, AES_XTS, ARC4.
> 
> Run-Time Configuration of Flow Type (PCTYPE) and Packet Type (PTYPE) for
> I40E: At the moment all flow types and packet types in DPDK are
> statically defined. This makes impossible to add new values without
> first defining them statically and then recompiling DPDK. The ability to
> configure flow types and packet types at run time will be added for
> I40E.
> 
> Extended Stats Latency and Bit Rate Statistics: Enhance the Extended NIC
> Stats (Xstats) implementation to support the collection and reporting of
> latency and bit rate measurements. Latency statistics will include min,
> max and average latency, and jitter. Bit rate statistics will include
> peak and average bit rate aggregated over a user-defined time period.
> This will be implemented for IXGBE and I40E.
> 
> Hardware QoS for IXGBE and I40E: Implement support for Hardware QoS for
> IXGBE and I40E. This involves using DCB so that a PF or VF can receive
> packets for each of the Traffic Classes (TCs) based on the User Priority
> field (in the VLAN header). Bandwidth on transmit for each TC is
> programmable.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox