DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 02/12] net/virtio: setup and start cq in configure callback
From: Yao, Lei A @ 2016-11-02  1:38 UTC (permalink / raw)
  To: Olivier Matz, dev@dpdk.org, yuanhan.liu@linux.intel.com; +Cc: dprovan@bivio.net
In-Reply-To: <1476368171-18176-3-git-send-email-olivier.matz@6wind.com>

Hi, Olivier

During the validation work with v16.11-rc2, I find that this patch will cause VM crash if enable virtio bonding in VM. Could you have a check at your side? The following is steps at my side. Thanks a lot

1. bind PF port to igb_uio.
modprobe uio
insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
./tools/dpdk-devbind.py --bind=igb_uio 84:00.1

2. start vhost switch.
./examples/vhost/build/vhost-switch -c 0x1c0000 -n 4 --socket-mem 4096,4096 - -p 0x1 --mergeable 0 --vm2vm 0 --socket-file ./vhost-net

3. bootup one vm with four virtio net device
qemu-system-x86_64 \
-name vm0 -enable-kvm -chardev socket,path=/tmp/vm0_qga0.sock,server,nowait,id=vm0_qga0 \
-device virtio-serial -device virtserialport,chardev=vm0_qga0,name=org.qemu.guest_agent.0 \
-daemonize -monitor unix:/tmp/vm0_monitor.sock,server,nowait \
-net nic,vlan=0,macaddr=00:00:00:c7:56:64,addr=1f \
net user,vlan=0,hostfwd=tcp:10.239.129.127:6107:22 \
-chardev socket,id=char0,path=./vhost-net \
-netdev type=vhost-user,id=netdev0,chardev=char0,vhostforce \
-device virtio-net-pci,netdev=netdev0,mac=52:54:00:00:00:01 \
-chardev socket,id=char1,path=./vhost-net \
-netdev type=vhost-user,id=netdev1,chardev=char1,vhostforce \
-device virtio-net-pci,netdev=netdev1,mac=52:54:00:00:00:02 \
-chardev socket,id=char2,path=./vhost-net \
-netdev type=vhost-user,id=netdev2,chardev=char2,vhostforce \
-device virtio-net-pci,netdev=netdev2,mac=52:54:00:00:00:03 \
-chardev socket,id=char3,path=./vhost-net \
-netdev type=vhost-user,id=netdev3,chardev=char3,vhostforce \
-device virtio-net-pci,netdev=netdev3,mac=52:54:00:00:00:04 \
-cpu host -smp 8 -m 4096 \
-object memory-backend-file,id=mem,size=4096M,mem-path=/mnt/huge,share=on \
-numa node,memdev=mem -mem-prealloc -drive file=/home/osimg/ubuntu16.img -vnc :10

4. on vm:
bind virtio net device to igb_uio
modprobe uio
insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
tools/dpdk-devbind.py --bind=igb_uio 00:04.0 00:05.0 00:06.0 00:07.0
5. startup test_pmd app
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x1f -n 4 - -i --txqflags=0xf00 --disable-hw-vlan-filter
6. create one bonding device (port 4)
create bonded device 0 0 (the first 0: mode, the second: the socket number)
show bonding config 4
7. bind port 0, 1, 2 to port 4
add bonding slave 0 4
add bonding slave 1 4
add bonding slave 2 4
port start 4
Result: just after port start 4(port 4 is bonded port), the vm shutdown immediately.

BRs
Lei

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier Matz
Sent: Thursday, October 13, 2016 10:16 PM
To: dev@dpdk.org; yuanhan.liu@linux.intel.com
Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Chandran, Sugesh <sugesh.chandran@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; Tan, Jianfeng <jianfeng.tan@intel.com>; Zhang, Helin <helin.zhang@intel.com>; adrien.mazarguil@6wind.com; stephen@networkplumber.org; dprovan@bivio.net; Wang, Xiao W <xiao.w.wang@intel.com>; maxime.coquelin@redhat.com
Subject: [dpdk-dev] [PATCH v3 02/12] net/virtio: setup and start cq in configure callback

Move the configuration of control queue in the configure callback.
This is needed by next commit, which introduces the reinitialization of the device in the configure callback to change the feature flags.
Therefore, the control queue will have to be restarted at the same place.

As virtio_dev_cq_queue_setup() is called from a place where
config->max_virtqueue_pairs is not available, we need to store this in
the private structure. It replaces max_rx_queues and max_tx_queues which have the same value. The log showing the value of max_rx_queues and max_tx_queues is also removed since config->max_virtqueue_pairs is already displayed above.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 43 +++++++++++++++++++-------------------
 drivers/net/virtio/virtio_ethdev.h |  4 ++--
 drivers/net/virtio/virtio_pci.h    |  3 +--
 3 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 77ca569..f3921ac 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -552,6 +552,9 @@ virtio_dev_close(struct rte_eth_dev *dev)
 	if (hw->started == 1)
 		virtio_dev_stop(dev);
 
+	if (hw->cvq)
+		virtio_dev_queue_release(hw->cvq->vq);
+
 	/* reset the NIC */
 	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
 		vtpci_irq_config(hw, VIRTIO_MSI_NO_VECTOR); @@ -1191,16 +1194,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev)
 			config->max_virtqueue_pairs = 1;
 		}
 
-		hw->max_rx_queues =
-			(VIRTIO_MAX_RX_QUEUES < config->max_virtqueue_pairs) ?
-			VIRTIO_MAX_RX_QUEUES : config->max_virtqueue_pairs;
-		hw->max_tx_queues =
-			(VIRTIO_MAX_TX_QUEUES < config->max_virtqueue_pairs) ?
-			VIRTIO_MAX_TX_QUEUES : config->max_virtqueue_pairs;
-
-		virtio_dev_cq_queue_setup(eth_dev,
-					config->max_virtqueue_pairs * 2,
-					SOCKET_ID_ANY);
+		hw->max_queue_pairs = config->max_virtqueue_pairs;
 
 		PMD_INIT_LOG(DEBUG, "config->max_virtqueue_pairs=%d",
 				config->max_virtqueue_pairs);
@@ -1211,19 +1205,15 @@ virtio_init_device(struct rte_eth_dev *eth_dev)
 				config->mac[2], config->mac[3],
 				config->mac[4], config->mac[5]);
 	} else {
-		hw->max_rx_queues = 1;
-		hw->max_tx_queues = 1;
+		PMD_INIT_LOG(DEBUG, "config->max_virtqueue_pairs=1");
+		hw->max_queue_pairs = 1;
 	}
 
-	PMD_INIT_LOG(DEBUG, "hw->max_rx_queues=%d   hw->max_tx_queues=%d",
-			hw->max_rx_queues, hw->max_tx_queues);
 	if (pci_dev)
 		PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x",
 			eth_dev->data->port_id, pci_dev->id.vendor_id,
 			pci_dev->id.device_id);
 
-	virtio_dev_cq_start(eth_dev);
-
 	return 0;
 }
 
@@ -1285,7 +1275,6 @@ static int
 eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)  {
 	struct rte_pci_device *pci_dev;
-	struct virtio_hw *hw = eth_dev->data->dev_private;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1301,9 +1290,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
 	eth_dev->tx_pkt_burst = NULL;
 	eth_dev->rx_pkt_burst = NULL;
 
-	if (hw->cvq)
-		virtio_dev_queue_release(hw->cvq->vq);
-
 	rte_free(eth_dev->data->mac_addrs);
 	eth_dev->data->mac_addrs = NULL;
 
@@ -1352,6 +1338,7 @@ virtio_dev_configure(struct rte_eth_dev *dev)  {
 	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
 	struct virtio_hw *hw = dev->data->dev_private;
+	int ret;
 
 	PMD_INIT_LOG(DEBUG, "configure");
 
@@ -1360,6 +1347,16 @@ virtio_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	/* Setup and start control queue */
+	if (vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_VQ)) {
+		ret = virtio_dev_cq_queue_setup(dev,
+			hw->max_queue_pairs * 2,
+			SOCKET_ID_ANY);
+		if (ret < 0)
+			return ret;
+		virtio_dev_cq_start(dev);
+	}
+
 	hw->vlan_strip = rxmode->hw_vlan_strip;
 
 	if (rxmode->hw_vlan_filter
@@ -1553,8 +1550,10 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		dev_info->driver_name = dev->driver->pci_drv.driver.name;
 	else
 		dev_info->driver_name = "virtio_user PMD";
-	dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues;
-	dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues;
+	dev_info->max_rx_queues =
+		RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_RX_QUEUES);
+	dev_info->max_tx_queues =
+		RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_TX_QUEUES);
 	dev_info->min_rx_bufsize = VIRTIO_MIN_RX_BUFSIZE;
 	dev_info->max_rx_pktlen = VIRTIO_MAX_RX_PKTLEN;
 	dev_info->max_mac_addrs = VIRTIO_MAX_MAC_ADDRS; diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index 04d626b..dc18341 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -47,8 +47,8 @@
 #define PAGE_SIZE 4096
 #endif
 
-#define VIRTIO_MAX_RX_QUEUES 128
-#define VIRTIO_MAX_TX_QUEUES 128
+#define VIRTIO_MAX_RX_QUEUES 128U
+#define VIRTIO_MAX_TX_QUEUES 128U
 #define VIRTIO_MAX_MAC_ADDRS 64
 #define VIRTIO_MIN_RX_BUFSIZE 64
 #define VIRTIO_MAX_RX_PKTLEN  9728
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index b8295a7..6930cd6 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -246,8 +246,7 @@ struct virtio_hw {
 	struct virtnet_ctl *cvq;
 	struct rte_pci_ioport io;
 	uint64_t    guest_features;
-	uint32_t    max_tx_queues;
-	uint32_t    max_rx_queues;
+	uint32_t    max_queue_pairs;
 	uint16_t    vtnet_hdr_size;
 	uint8_t	    vlan_strip;
 	uint8_t	    use_msix;
--
2.8.1

^ permalink raw reply related

* Re: [PATCH] E1000: fix for forced speed/duplex config
From: Lu, Wenzhuo @ 2016-11-02  0:37 UTC (permalink / raw)
  To: Ananda Sathyanarayana; +Cc: dev@dpdk.org
In-Reply-To: <1478040424-102624-1-git-send-email-ananda@versa-networks.com>

Hi Ananda,

> -----Original Message-----
> From: Ananda Sathyanarayana [mailto:ananda@versa-networks.com]
> Sent: Wednesday, November 2, 2016 6:47 AM
> To: Lu, Wenzhuo
> Cc: dev@dpdk.org; Ananda Sathyanarayana
> Subject: [PATCH] E1000: fix for forced speed/duplex config
> 
> From the code, it looks like, hw->mac.autoneg, variable is used to switch
> between calling either autoneg function or forcing speed/duplex function. But
> this variable is not modified in eth_em_start/eth_igb_start routines (it is always
> set to 1) even while forcing the link speed.
> 
> Following discussion thread has some more information on this
> 
> http://dpdk.org/ml/archives/dev/2016-October/049272.html
> 
> Signed-off-by: Ananda Sathyanarayana <ananda@versa-networks.com>
Thanks for the patch. It looks fine to me. But as it's a fix, would you like to add a Fixes tag for it?

^ permalink raw reply

* [PATCH] E1000: fix for forced speed/duplex config
From: Ananda Sathyanarayana @ 2016-11-01 22:47 UTC (permalink / raw)
  To: wenzhuo.lu; +Cc: dev

>From the code, it looks like, hw->mac.autoneg, variable is used to
switch between calling either autoneg function or forcing
speed/duplex function. But this variable is not modified in
eth_em_start/eth_igb_start routines (it is always set to 1)
even while forcing the link speed.

Following discussion thread has some more information on
this

http://dpdk.org/ml/archives/dev/2016-October/049272.html

Signed-off-by: Ananda Sathyanarayana <ananda@versa-networks.com>
---
 drivers/net/e1000/em_ethdev.c  | 16 ++++++++++++++--
 drivers/net/e1000/igb_ethdev.c | 16 ++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 7cf5f0c..a2412f5 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -639,6 +639,7 @@ eth_em_start(struct rte_eth_dev *dev)
 	speeds = &dev->data->dev_conf.link_speeds;
 	if (*speeds == ETH_LINK_SPEED_AUTONEG) {
 		hw->phy.autoneg_advertised = E1000_ALL_SPEED_DUPLEX;
+                hw->mac.autoneg = 1;
 	} else {
 		num_speeds = 0;
 		autoneg = (*speeds & ETH_LINK_SPEED_FIXED) == 0;
@@ -672,9 +673,20 @@ eth_em_start(struct rte_eth_dev *dev)
 			hw->phy.autoneg_advertised |= ADVERTISE_1000_FULL;
 			num_speeds++;
 		}
-		if (num_speeds == 0 || (!autoneg && (num_speeds > 1)))
+		if (num_speeds == 0 || (!autoneg && (num_speeds > 1))) {
 			goto error_invalid_config;
-	}
+                }
+                /*
+                 * Set/reset the mac.autoneg based on the link speed,
+                 * fixed or not
+                 */
+                if (!autoneg) {
+                        hw->mac.autoneg = 0;
+                        hw->mac.forced_speed_duplex = hw->phy.autoneg_advertised;
+                } else {
+                        hw->mac.autoneg = 1;
+                }
+        }
 
 	e1000_setup_link(hw);
 
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 4924396..9fb498f 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1327,6 +1327,7 @@ eth_igb_start(struct rte_eth_dev *dev)
 	speeds = &dev->data->dev_conf.link_speeds;
 	if (*speeds == ETH_LINK_SPEED_AUTONEG) {
 		hw->phy.autoneg_advertised = E1000_ALL_SPEED_DUPLEX;
+                hw->mac.autoneg = 1;
 	} else {
 		num_speeds = 0;
 		autoneg = (*speeds & ETH_LINK_SPEED_FIXED) == 0;
@@ -1360,9 +1361,20 @@ eth_igb_start(struct rte_eth_dev *dev)
 			hw->phy.autoneg_advertised |= ADVERTISE_1000_FULL;
 			num_speeds++;
 		}
-		if (num_speeds == 0 || (!autoneg && (num_speeds > 1)))
+		if (num_speeds == 0 || (!autoneg && (num_speeds > 1))) {
 			goto error_invalid_config;
-	}
+                }
+                /*
+                 * Set/reset the mac.autoneg based on the link speed,
+                 * fixed or not
+                 */
+                if (!autoneg) {
+                        hw->mac.autoneg = 0;
+                        hw->mac.forced_speed_duplex = hw->phy.autoneg_advertised;
+                } else {
+                        hw->mac.autoneg = 1;
+                }
+        }
 
 	e1000_setup_link(hw);
 
-- 
1.9.1

^ permalink raw reply related

* [PATCH v2] net/ring: remove unnecessary NULL check
From: Mauricio Vasquez B @ 2016-11-01 19:55 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, ferruh.yigit
In-Reply-To: <1477972113-2600-1-git-send-email-mauricio.vasquez@polito.it>

Coverity detected this as an issue because internals->data will never be NULL,
then the check is not necessary.

Fixes: d082c0395bf6 ("ring: fix memory leak when detaching")
Coverity issue: 137873

Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
---
 drivers/net/ring/rte_eth_ring.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 6d2a8c1..5ca00ed 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -599,17 +599,15 @@ rte_pmd_ring_remove(const char *name)
 
 	eth_dev_stop(eth_dev);
 
-	if (eth_dev->data) {
-		internals = eth_dev->data->dev_private;
-		if (internals->action == DEV_CREATE) {
-			/*
-			 * it is only necessary to delete the rings in rx_queues because
-			 * they are the same used in tx_queues
-			 */
-			for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
-				r = eth_dev->data->rx_queues[i];
-				rte_ring_free(r->rng);
-			}
+	internals = eth_dev->data->dev_private;
+	if (internals->action == DEV_CREATE) {
+		/*
+		 * it is only necessary to delete the rings in rx_queues because
+		 * they are the same used in tx_queues
+		 */
+		for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
+			r = eth_dev->data->rx_queues[i];
+			rte_ring_free(r->rng);
 		}
 
 		rte_free(eth_dev->data->rx_queues);
-- 
1.9.1

^ permalink raw reply related

* [PATCH] net/enic: fix max packet length check
From: John Daley @ 2016-11-01 18:08 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev

When the device was configured with an explicit maximum packet length,
it would fail if the value was greater than MTU configured in CIMC/UCSM
(plus L2 header length). It should have been compared against maximum
allowed by the device.

Fixes: bb34ffb848a0 ("net/enic: determine max egress packet size and max MTU")

Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index bcf83d4..2b154ec 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -463,8 +463,7 @@ static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev,
 	device_info->max_rx_queues = enic->conf_rq_count / 2;
 	device_info->max_tx_queues = enic->conf_wq_count;
 	device_info->min_rx_bufsize = ENIC_MIN_MTU;
-	device_info->max_rx_pktlen = enic->rte_dev->data->mtu
-				   + ETHER_HDR_LEN + 4;
+	device_info->max_rx_pktlen = enic->max_mtu + ETHER_HDR_LEN + 4;
 	device_info->max_mac_addrs = 1;
 	device_info->rx_offload_capa =
 		DEV_RX_OFFLOAD_VLAN_STRIP |
-- 
2.10.0

^ permalink raw reply related

* [PATCH] net: remove mempool as a dependency
From: Ferruh Yigit @ 2016-11-01 17:03 UTC (permalink / raw)
  To: dev
In-Reply-To: <20161101170331.27813-1-ferruh.yigit@intel.com>

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_net/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/librte_net/Makefile b/lib/librte_net/Makefile
index e5758ce..20cf664 100644
--- a/lib/librte_net/Makefile
+++ b/lib/librte_net/Makefile
@@ -45,7 +45,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h
 SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h
 SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h
 
-DEPDIRS-$(CONFIG_RTE_LIBRTE_NET) += lib/librte_eal lib/librte_mempool
-DEPDIRS-$(CONFIG_RTE_LIBRTE_NET) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_NET) += lib/librte_eal lib/librte_mbuf
 
 include $(RTE_SDK)/mk/rte.lib.mk
-- 
2.7.4

^ permalink raw reply related

* [PATCH] doc: add missing library to release notes
From: Ferruh Yigit @ 2016-11-01 17:03 UTC (permalink / raw)
  To: dev

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
CC: Olivier Matz <olivier.matz@6wind.com>
---
 doc/guides/rel_notes/release_16_11.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/guides/rel_notes/release_16_11.rst b/doc/guides/rel_notes/release_16_11.rst
index aa0c09a..5f185be 100644
--- a/doc/guides/rel_notes/release_16_11.rst
+++ b/doc/guides/rel_notes/release_16_11.rst
@@ -248,6 +248,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_mbuf.so.2
      librte_mempool.so.2
      librte_meter.so.1
+     librte_net.so.1
      librte_pdump.so.1
      librte_pipeline.so.3
      librte_pmd_bond.so.1
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH] net/mlx5: fix wrong use of vector instruction
From: Ferruh Yigit @ 2016-11-01 14:24 UTC (permalink / raw)
  To: Elad Persiko, dev
In-Reply-To: <1477988007-26141-1-git-send-email-eladpe@mellanox.com>

On 11/1/2016 8:13 AM, Elad Persiko wrote:
> Constraint alignment was not respected in Tx.
> 
> Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
> 
> Signed-off-by: Elad Persiko <eladpe@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_rxtx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
> index 21164ba..ba8e202 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -309,7 +309,7 @@ mlx5_tx_dbrec(struct txq *txq)
>  	*txq->qp_db = htonl(txq->wqe_ci);
>  	/* Ensure ordering between DB record and BF copy. */
>  	rte_wmb();
> -	rte_mov16(dst, (uint8_t *)data);
> +	memcpy(dst, (uint8_t *)data, 16);
>  	txq->bf_offset ^= (1 << txq->bf_buf_size);
>  }
>  
> @@ -449,7 +449,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  		wqe->eseg.mss = 0;
>  		wqe->eseg.rsvd2 = 0;
>  		/* Start by copying the Ethernet Header. */
> -		rte_mov16((uint8_t *)raw, (uint8_t *)addr);
> +		memcpy((uint8_t *)raw, ((uint8_t *)addr), 16);
>  		length -= MLX5_WQE_DWORD_SIZE;
>  		addr += MLX5_WQE_DWORD_SIZE;
>  		/* Replace the Ethernet type by the VLAN if necessary. */
> 

CC: Maintainers (Adrien Mazarguil <adrien.mazarguil@6wind.com>)

^ permalink raw reply

* Re: [PATCH] pmd_ring: fix coverity issue
From: Ferruh Yigit @ 2016-11-01 14:17 UTC (permalink / raw)
  To: Mauricio Vasquez B, bruce.richardson; +Cc: dev
In-Reply-To: <1477972113-2600-1-git-send-email-mauricio.vasquez@polito.it>

Hi Mauricio,

On 11/1/2016 3:48 AM, Mauricio Vasquez B wrote:
> internals->data will never be NULL, so the check is not necessary.
> 
> Fixes: d082c0395bf6 ("ring: fix memory leak when detaching")
> Coverity issue: 137873
> 
> Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
> ---

Thank you for the patch.
But "fix coverity issue" is not very descriptive title on its own.

Can you please describe what is really done in the patch, perhaps
something like:
"net/ring: remove unnecessary NULL check" ?

Thanks,
ferruh

^ permalink raw reply

* Re: [PATCH v11 1/6] ethdev: add Tx preparation
From: Ananyev, Konstantin @ 2016-11-01 12:57 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev@dpdk.org
In-Reply-To: <2177010.quNaxrZShx@xps13>


Hi Thomas,
 
> > > I suggest to integrate it in the beginning of 17.02 cycle, with the hope
> > > that you can convince other developers to implement it in other drivers,
> > > so we could finally enable it in the default config.
> >
> > Ok, any insights then, how we can convince people to do that?
> 
> You just have to explain clearly what this new feature is bringing
> and what will be the future possibilities.
> 
> > BTW,  it means then that tx_prep() should become part of mandatory API
> > to be implemented by each PMD doing TX offloads, right?
> 
> Right.
> The question is "what means mandatory"?

For me "mandatory" here would mean that:
 - if the PMD supports TX offloads AND
 - if to be able use any of these offloads the upper layer SW would have to:
	- modify the contents of the packet OR
	- obey HW specific restrictions
 then it is a PMD developer responsibility to provide tx_prep() that would implement
 expected modifications of the packet contents and restriction checks.
Otherwise, tx_prep() implementation is not required and can be safely set to NULL.      

Does it sounds good enough to everyone?

> Should we block some patches for non-compliant drivers?

If we agree that it should be a 'mandatory' one - and patch in question breaks
that requirement, then probably yes.

> Should we remove offloads capability from non-compliant drivers?

Do you mean existing PMDs?
Are there any particular right now, that can't work properly with testpmd csumonly mode?

Konstantin


 

^ permalink raw reply

* Re: [PATCH] net/bonding: not handle vlan slow packet
From: linhaifeng @ 2016-11-01 12:32 UTC (permalink / raw)
  To: Ferruh Yigit, dev, declan.doherty
In-Reply-To: <227a3391-019d-3a4c-e76f-d1775466261b@intel.com>

在 2016/11/1 18:46, Ferruh Yigit 写道:
> Hi Haifeng,
> 
> On 10/31/2016 3:52 AM, linhaifeng wrote:
>> From: Haifeng Lin <haifeng.lin@huawei.com>
>>
>> if rx vlan offload is enable we should not handle vlan slow
>> packets too.
>>
>> Signed-off-by: Haifeng Lin <haifeng.lin@huawei.com>
>> ---
>>  drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
>> index 09ce7bf..ca17898 100644
>> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
>> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
>> @@ -169,7 +169,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
>>  			/* Remove packet from array if it is slow packet or slave is not
>>  			 * in collecting state or bondign interface is not in promiscus
>>  			 * mode and packet address does not match. */
>> -			if (unlikely(hdr->ether_type == ether_type_slow_be ||
>> +			if (unlikely((hdr->ether_type == ether_type_slow_be &&
>> +				!bufs[j]->vlan_tci) ||
>>  				!collecting || (!promisc &&
>>  					!is_multicast_ether_addr(&hdr->d_addr) &&
>>  					!is_same_ether_addr(&bond_mac, &hdr->d_addr)))) {
>>
> 
> There are a few version of this patch, I guess this one is the correct
> one, can you please confirm?
> Also this one supersede following one, right?
> http://dpdk.org/dev/patchwork/patch/16840/

yes,this is

> 
> It helps a lot if you use versioning in the patches [PATCH -vN] and add
> a description of changes in commit log (after "---") between patch versions.
> 

ok,i think should not send patch so worry:)

I have a question to ask:
Is there any other packets' type also is 0x8809 except with lacp packets?
I saw some guests try to use this type to check link status between VM
but droped by lacp bond recv function.


> Thanks,
> ferruh
> 
> .
> 

^ permalink raw reply

* [PATCH v3] app/test: fix a segfault when lpm_perf_autotest is run more than 1 time
From: Nikita Kozlov @ 2016-11-01 11:55 UTC (permalink / raw)
  To: dev
In-Reply-To: <20161101112000.12670-1-nikita@elyzion.net>

num_route_entries need to be reseted.

Fixes: 17d60f5b5eea ("app/test: remove large IPv4 LPM data file")

Signed-off-by: Nikita Kozlov <nikita@elyzion.net>
---
 app/test/test_lpm_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index 608e17a..e7e1281 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -301,6 +301,7 @@ static void generate_large_route_rule_table(void)
 	uint32_t ip_class;
 	uint8_t  depth;
 
+	num_route_entries = 0;
 	memset(large_route_table, 0, sizeof(large_route_table));
 
 	for (ip_class = IP_CLASS_A; ip_class <= IP_CLASS_C; ip_class++) {
-- 
2.9.2

^ permalink raw reply related

* Re: [PATCH] app/test: fix a segfault when lpm_perf_autotest is run more than 1 time
From: Bruce Richardson @ 2016-11-01 11:20 UTC (permalink / raw)
  To: Nikita Kozlov; +Cc: dev
In-Reply-To: <20161101104742.12307-1-nikita@elyzion.net>

On Tue, Nov 01, 2016 at 11:47:42AM +0100, Nikita Kozlov wrote:
> num_route_entries need to be reseted.
> ---
>  app/test/test_lpm_perf.c | 1 +
>  1 file changed, 1 insertion(+)
> 
You forgot your signoff on the patch, but I confirm it does indeed fix
the issue. Also, as fixes line is needed to identify the commit that
introduced the bug.

Tested-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply

* [PATCH v2] app/test: fix a segfault when lpm_perf_autotest is run more than 1 time
From: Nikita Kozlov @ 2016-11-01 11:20 UTC (permalink / raw)
  To: dev
In-Reply-To: <20161101104742.12307-1-nikita@elyzion.net>

num_route_entries need to be reseted.

V2 : resubmitting the patch with a signed-off

Signed-off-by: Nikita Kozlov <nikita@elyzion.net>
---
 app/test/test_lpm_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index 608e17a..e7e1281 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -301,6 +301,7 @@ static void generate_large_route_rule_table(void)
 	uint32_t ip_class;
 	uint8_t  depth;
 
+	num_route_entries = 0;
 	memset(large_route_table, 0, sizeof(large_route_table));
 
 	for (ip_class = IP_CLASS_A; ip_class <= IP_CLASS_C; ip_class++) {
-- 
2.9.2

^ permalink raw reply related

* [PATCH] app/test: fix a segfault when lpm_perf_autotest is run more than 1 time
From: Nikita Kozlov @ 2016-11-01 10:47 UTC (permalink / raw)
  To: dev

num_route_entries need to be reseted.
---
 app/test/test_lpm_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index 608e17a..e7e1281 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -301,6 +301,7 @@ static void generate_large_route_rule_table(void)
 	uint32_t ip_class;
 	uint8_t  depth;
 
+	num_route_entries = 0;
 	memset(large_route_table, 0, sizeof(large_route_table));
 
 	for (ip_class = IP_CLASS_A; ip_class <= IP_CLASS_C; ip_class++) {
-- 
2.9.2

^ permalink raw reply related

* Re: [PATCH] net/bonding: not handle vlan slow packet
From: Ferruh Yigit @ 2016-11-01 10:46 UTC (permalink / raw)
  To: linhaifeng, dev, declan.doherty
In-Reply-To: <1477885947-35804-1-git-send-email-haifeng.lin@huawei.com>

Hi Haifeng,

On 10/31/2016 3:52 AM, linhaifeng wrote:
> From: Haifeng Lin <haifeng.lin@huawei.com>
> 
> if rx vlan offload is enable we should not handle vlan slow
> packets too.
> 
> Signed-off-by: Haifeng Lin <haifeng.lin@huawei.com>
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 09ce7bf..ca17898 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -169,7 +169,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
>  			/* Remove packet from array if it is slow packet or slave is not
>  			 * in collecting state or bondign interface is not in promiscus
>  			 * mode and packet address does not match. */
> -			if (unlikely(hdr->ether_type == ether_type_slow_be ||
> +			if (unlikely((hdr->ether_type == ether_type_slow_be &&
> +				!bufs[j]->vlan_tci) ||
>  				!collecting || (!promisc &&
>  					!is_multicast_ether_addr(&hdr->d_addr) &&
>  					!is_same_ether_addr(&bond_mac, &hdr->d_addr)))) {
> 

There are a few version of this patch, I guess this one is the correct
one, can you please confirm?
Also this one supersede following one, right?
http://dpdk.org/dev/patchwork/patch/16840/

It helps a lot if you use versioning in the patches [PATCH -vN] and add
a description of changes in commit log (after "---") between patch versions.

Thanks,
ferruh

^ permalink raw reply

* [PATCH v8] app/testpmd: fix DCB configuration
From: Bernard Iremonger @ 2016-11-01 10:36 UTC (permalink / raw)
  To: dev, rahul.r.shah, jingjing.wu, wenzhuo.lu
In-Reply-To: <1477665615-3723-1-git-send-email-bernard.iremonger@intel.com>

Data Centre Bridge (DCB) configuration fails when SRIOV is
enabled if nb_rxq and nb_txq are not set to 1.

The failure occurs during configuration of the ixgbe PMD when
it is started, in the ixgbe_check_mq_mode function.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 Changes in v8:
 revise commit message.

 Changes in v7:
 restore nb_rxq and nb_txq setting when max_vfs is 0

 app/test-pmd/testpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..96f5011 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,13 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		if (rte_port->dev_info.max_vfs > 0) {
+			nb_rxq = 1;
+			nb_txq = 1;
+		} else {
+			nb_rxq = rte_port->dev_info.max_rx_queues;
+			nb_txq = rte_port->dev_info.max_tx_queues;
+		}
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.4.3

^ permalink raw reply related

* Re: [PATCH v4] vhost: Add indirect descriptors support to the TX path
From: Thomas Monjalon @ 2016-11-01  9:39 UTC (permalink / raw)
  To: Yuanhan Liu, Maxime Coquelin; +Cc: dev, vkaplans, mst
In-Reply-To: <20161101081544.GP16751@yliu-dev.sh.intel.com>

2016-11-01 16:15, Yuanhan Liu:
> On Fri, Oct 28, 2016 at 09:58:51AM +0200, Maxime Coquelin wrote:
> > Agree, what we need is to be able to disable Virtio PMD features
> > without having to rebuild the PMD.
> 
> I want this feature (or more precisely, ability) long times ago.
> For example, I'd wish there is an option like "force_legacy" when
> both legacy and modern exist.

You can change the behaviour of the driver with a run-time parameter
as a struct rte_devargs.

^ permalink raw reply

* Re: [PATCH v4] vhost: Add indirect descriptors support to the TX path
From: Yuanhan Liu @ 2016-11-01  8:15 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: mst@redhat.com, dev@dpdk.org, vkaplans@redhat.com
In-Reply-To: <108f3c0a-bef5-5124-fde6-01fa9870c970@redhat.com>

On Fri, Oct 28, 2016 at 09:58:51AM +0200, Maxime Coquelin wrote:
> >From my experience, and as Michael pointed out, the best mode for small packets is obviously
> >ANY_LAYOUT so it uses a single descriptor per packet.
> Of course, having a single descriptor is in theory the best way.
> But, in current Virtio PMD implementation, with no offload supported, we
> never access the virtio header at transmit time, it is allocated and
> zeroed at startup.
> 
> For ANY_LAYOUT case, the virtio header is prepended to the packet, and
> need to be zeroed at packet transmit time. The performance impact is
> quite important, as show the measurements I made one month ago (txonly):
>  - 2 descs per packet: 11.6Mpps
>  - 1 desc per packet: 9.6Mpps
> 
> As Michael suggested, I tried to replace the memset by direct
> fields assignation, but it only recovers a small part of the drop.
> 
> What I suggested is to introduce a new feature, so that we can skip the
> virtio header when no offload is negotiated.
> 
> Maybe you have other ideas?
> 
> >So, disabling indirect descriptors may give you better pps for 64 bytes packets, but that doesn't mean you should not implement, or enable, it in your driver. That just means that the guest is not taking the right decision, and uses indirect while it should actually use any_layout.
> +1, it really depends on the use-case.
> >
> >Given virtio/vhost design (most decision comes from the guest), the host should be liberal in what it accepts, and not try to influence guest implementation by carefully picking the features it supports. Otherwise guests will never get a chance to make the right decisions either.
> Agree, what we need is to be able to disable Virtio PMD features
> without having to rebuild the PMD.

I want this feature (or more precisely, ability) long times ago.
For example, I'd wish there is an option like "force_legacy" when
both legacy and modern exist.

> It will certainly require an new API change to add this option.

I don't think it will work.

Firstly, generally, as discussed before, it's not a good idea to
introduce some PMD specific APIs.

Secondly, even if it's okay to do so, you need to let the application
(say testpmd) invoke it. Once you have done that, you need introduce
some CLI options to make sure that part is invoked.

And as stated before, it's also not a good idea to add virtio PMD
specific CLI options to testpmd. 

For this case, however, I think it makes more sense if test provides
some commands to enable/disable csum and tso stuff. With that, we
could enable it dynamically.

It has "tso set/show" commands though: it just doesn't look like the
right interface to me to enable/disable tso.

	--yliu

^ permalink raw reply

* [PATCH] net/mlx5: fix wrong use of vector instruction
From: Elad Persiko @ 2016-11-01  8:13 UTC (permalink / raw)
  To: dev; +Cc: Elad Persiko

Constraint alignment was not respected in Tx.

Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")

Signed-off-by: Elad Persiko <eladpe@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 21164ba..ba8e202 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -309,7 +309,7 @@ mlx5_tx_dbrec(struct txq *txq)
 	*txq->qp_db = htonl(txq->wqe_ci);
 	/* Ensure ordering between DB record and BF copy. */
 	rte_wmb();
-	rte_mov16(dst, (uint8_t *)data);
+	memcpy(dst, (uint8_t *)data, 16);
 	txq->bf_offset ^= (1 << txq->bf_buf_size);
 }
 
@@ -449,7 +449,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		wqe->eseg.mss = 0;
 		wqe->eseg.rsvd2 = 0;
 		/* Start by copying the Ethernet Header. */
-		rte_mov16((uint8_t *)raw, (uint8_t *)addr);
+		memcpy((uint8_t *)raw, ((uint8_t *)addr), 16);
 		length -= MLX5_WQE_DWORD_SIZE;
 		addr += MLX5_WQE_DWORD_SIZE;
 		/* Replace the Ethernet type by the VLAN if necessary. */
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH] pmd_ring: fix coverity issue
From: Mauricio Vasquez B @ 2016-11-01  3:48 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev

internals->data will never be NULL, so the check is not necessary.

Fixes: d082c0395bf6 ("ring: fix memory leak when detaching")
Coverity issue: 137873

Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
---
 drivers/net/ring/rte_eth_ring.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 6d2a8c1..5ca00ed 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -599,17 +599,15 @@ rte_pmd_ring_remove(const char *name)
 
 	eth_dev_stop(eth_dev);
 
-	if (eth_dev->data) {
-		internals = eth_dev->data->dev_private;
-		if (internals->action == DEV_CREATE) {
-			/*
-			 * it is only necessary to delete the rings in rx_queues because
-			 * they are the same used in tx_queues
-			 */
-			for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
-				r = eth_dev->data->rx_queues[i];
-				rte_ring_free(r->rng);
-			}
+	internals = eth_dev->data->dev_private;
+	if (internals->action == DEV_CREATE) {
+		/*
+		 * it is only necessary to delete the rings in rx_queues because
+		 * they are the same used in tx_queues
+		 */
+		for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
+			r = eth_dev->data->rx_queues[i];
+			rte_ring_free(r->rng);
 		}
 
 		rte_free(eth_dev->data->rx_queues);
-- 
1.9.1

^ permalink raw reply related

* Re: [RFC PATCH v2 2/3] lib: add bitrate statistics library
From: Remy Horton @ 2016-11-01  1:53 UTC (permalink / raw)
  To: dev; +Cc: Morten Brørup
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC359EA8CD@smartserver.smartshare.dk>


On 28/10/2016 15:39, Morten Brørup wrote:
> Comments below.
[..]
> When working with statistical calculations using integer arithmetic,
> you should round off the integer result by adding 0.5 to the result,
> which you do by adding half of the divisor to the dividend, like
> this:
>
> delta = (delta * alpha_percent + 50) / 100;
>
> The numbers in this particular case are probably very big, so not
> rounding off doesn't affect the result a lot; but then you should add
> a comment about why rounding down is acceptable.

A minor point, but will roll it into the next patchset.

^ permalink raw reply

* [PATCH v3] net/qede: fix advertising link speed capability
From: Rasesh Mody @ 2016-10-31 18:35 UTC (permalink / raw)
  To: thomas.monjalon, bruce.richardson; +Cc: dev, Dept-EngDPDKDev
In-Reply-To: <1477938901-24999-1-git-send-email-Rasesh.Mody@cavium.com>

From: Harish Patil <harish.patil@qlogic.com>

Fix to advertise device's link speed capability based on NVM
port configuration instead of returning driver supported speeds.

Fixes: 95e67b479506 ("net/qede: add 100G link speed capability")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c |    6 ++++--
 drivers/net/qede/qede_ethdev.h |    1 +
 drivers/net/qede/qede_if.h     |    1 +
 drivers/net/qede/qede_main.c   |   24 ++++++++++++++++++++++++
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index b91b478..59129f2 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -646,6 +646,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
+	struct qed_link_output link;
 
 	PMD_INIT_FUNC_TRACE(edev);
 
@@ -678,8 +679,9 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 				     DEV_TX_OFFLOAD_UDP_CKSUM |
 				     DEV_TX_OFFLOAD_TCP_CKSUM);
 
-	dev_info->speed_capa = ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G |
-			       ETH_LINK_SPEED_100G;
+	memset(&link, 0, sizeof(struct qed_link_output));
+	qdev->ops->common->get_link(edev, &link);
+	dev_info->speed_capa = rte_eth_speed_bitflag(link.adv_speed, 0);
 }
 
 /* return 0 means link status changed, -1 means not changed */
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 5eb3f52..a97e3d9 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -30,6 +30,7 @@
 #include "base/ecore_dev_api.h"
 #include "base/ecore_iov_api.h"
 #include "base/ecore_cxt.h"
+#include "base/nvm_cfg.h"
 
 #include "qede_logs.h"
 #include "qede_if.h"
diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h
index 2d38b1b..4936349 100644
--- a/drivers/net/qede/qede_if.h
+++ b/drivers/net/qede/qede_if.h
@@ -70,6 +70,7 @@ struct qed_link_output {
 	uint32_t advertised_caps;	/* In ADVERTISED defs */
 	uint32_t lp_caps;	/* In ADVERTISED defs */
 	uint32_t speed;		/* In Mb/s */
+	uint32_t adv_speed;	/* In Mb/s */
 	uint8_t duplex;		/* In DUPLEX defs */
 	uint8_t port;		/* In PORT defs */
 	bool autoneg;
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index 2d354e1..d2e476c 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -488,6 +488,7 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 	struct ecore_mcp_link_state link;
 	struct ecore_mcp_link_capabilities link_caps;
 	uint32_t media_type;
+	uint32_t adv_speed;
 	uint8_t change = 0;
 
 	memset(if_link, 0, sizeof(*if_link));
@@ -515,6 +516,29 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 
 	if_link->duplex = QEDE_DUPLEX_FULL;
 
+	/* Fill up the native advertised speed */
+	switch (params.speed.advertised_speeds) {
+	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G:
+		adv_speed = 10000;
+	break;
+	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G:
+		adv_speed = 25000;
+	break;
+	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G:
+		adv_speed = 40000;
+	break;
+	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G:
+		adv_speed = 50000;
+	break;
+	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G:
+		adv_speed = 100000;
+	break;
+	default:
+		DP_NOTICE(hwfn, false, "Unknown speed\n");
+		adv_speed = 0;
+	}
+	if_link->adv_speed = adv_speed;
+
 	if (params.speed.autoneg)
 		if_link->supported_caps |= QEDE_SUPPORTED_AUTONEG;
 
-- 
1.7.10.3

^ permalink raw reply related

* [PATCH v3] net/qede: fix advertising link speed capability
From: Rasesh Mody @ 2016-10-31 18:35 UTC (permalink / raw)
  To: thomas.monjalon, bruce.richardson; +Cc: dev, Dept-EngDPDKDev
In-Reply-To: <1477721677-25668-1-git-send-email-Rasesh.Mody@cavium.com>

v3:
 - check patch fixes

Fix to advertise device's link speed capability based on NVM
port configuration instead of returning driver supported speeds.

Fixes: 95e67b479506 ("net/qede: add 100G link speed capability")

Harish Patil (1):
  net/qede: fix advertising link speed capability

 drivers/net/qede/qede_ethdev.c |    6 ++++--
 drivers/net/qede/qede_ethdev.h |    1 +
 drivers/net/qede/qede_if.h     |    1 +
 drivers/net/qede/qede_main.c   |   24 ++++++++++++++++++++++++
 4 files changed, 30 insertions(+), 2 deletions(-)

-- 
1.7.10.3

^ permalink raw reply

* Re: mbuf changes
From: Morten Brørup @ 2016-10-31 16:05 UTC (permalink / raw)
  To: Olivier Matz, Bruce Richardson; +Cc: dev
In-Reply-To: <4427b23b-e9c0-4e43-9c28-fb7e56da745c@6wind.com>

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier Matz
> Sent: Tuesday, October 25, 2016 2:49 PM
> 
> We should keep in mind that today we have the seqn field but it is not
> used by any PMD. In case it is implemented, would it be a per-queue
> sequence number? Is it useful from an application view?
> 
> This field is only used by the librte_reorder library, and in my
> opinion, we should consider moving it in the second cache line since it
> is not filled by the PMD.

+1 because it is not filled by the NIC HW or PMD. If our argument is "better performance", I would prefer having the generic 64 bit m->userdata in cacheline0 than m->seqn.


^ 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