patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types
@ 2017-03-24  7:40 Rasesh Mody
  2017-03-24  7:40 ` [dpdk-stable] [PATCH 2/3] net/qede: fix VF's RSS configuration failure Rasesh Mody
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Rasesh Mody @ 2017-03-24  7:40 UTC (permalink / raw)
  To: dev, ferruh.yigit; +Cc: Harish Patil, stable, Dept-EngDPDKDev

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

Both UDP and TCP based RSS offload types are supported by the device.
This patch adds UDP protocol which got missed out in the original patch.

Fixes: 4c98f2768eef ("net/qede: support RSS hash configuration")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 0762111..798783b 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1497,6 +1497,8 @@ static void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf)
 	*rss_caps |= (hf & ETH_RSS_NONFRAG_IPV4_TCP)  ? ECORE_RSS_IPV4_TCP : 0;
 	*rss_caps |= (hf & ETH_RSS_NONFRAG_IPV6_TCP)  ? ECORE_RSS_IPV6_TCP : 0;
 	*rss_caps |= (hf & ETH_RSS_IPV6_TCP_EX)       ? ECORE_RSS_IPV6_TCP : 0;
+	*rss_caps |= (hf & ETH_RSS_NONFRAG_IPV4_UDP)  ? ECORE_RSS_IPV4_UDP : 0;
+	*rss_caps |= (hf & ETH_RSS_NONFRAG_IPV6_UDP)  ? ECORE_RSS_IPV6_UDP : 0;
 }
 
 static int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH 2/3] net/qede: fix VF's RSS configuration failure
  2017-03-24  7:40 [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Rasesh Mody
@ 2017-03-24  7:40 ` Rasesh Mody
  2017-03-24  7:40 ` [dpdk-stable] [PATCH 3/3] net/qede: prevent crash while changing MTU dynamically Rasesh Mody
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Rasesh Mody @ 2017-03-24  7:40 UTC (permalink / raw)
  To: dev, ferruh.yigit; +Cc: Harish Patil, stable, Dept-EngDPDKDev

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

The newer SR-IOV PF drivers expects RX/TX queues to be created before
applying RSS configuration. This patch addresses this requirement by
deferring RSS configuration till the queues are created. Even though
this issue is only seen in SR-IOV context, the changes will be made
applicable to PF also to keep the behavior consistent between VF/PF.

Fixes: 7ab35bf6b97b ("net/qede: fix RSS")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c |   18 +++---------------
 drivers/net/qede/qede_ethdev.h |    2 +-
 drivers/net/qede/qede_rxtx.c   |    9 +++++++++
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 798783b..e096f63 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -798,7 +798,7 @@ static void qede_prandom_bytes(uint32_t *buff)
 		buff[i] = rand();
 }
 
-static int qede_config_rss(struct rte_eth_dev *eth_dev)
+int qede_config_rss(struct rte_eth_dev *eth_dev)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
@@ -906,20 +906,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 	if (rc != 0)
 		return rc;
 
-	/* Do RSS configuration after vport-start */
-	switch (rxmode->mq_mode) {
-	case ETH_MQ_RX_RSS:
-		rc = qede_config_rss(eth_dev);
-		if (rc != 0) {
-			qdev->ops->vport_stop(edev, 0);
-			qede_dealloc_fp_resc(eth_dev);
-			return -EINVAL;
-		}
-	break;
-	case ETH_MQ_RX_NONE:
-		DP_INFO(edev, "RSS is disabled\n");
-	break;
-	default:
+	if (!(rxmode->mq_mode == ETH_MQ_RX_RSS ||
+	    rxmode->mq_mode == ETH_MQ_RX_NONE)) {
 		DP_ERR(edev, "Unsupported RSS mode\n");
 		qdev->ops->vport_stop(edev, 0);
 		qede_dealloc_fp_resc(eth_dev);
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 799a3ba..9a7e9c2 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -234,7 +234,7 @@ static uint16_t qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev,
 					struct ecore_arfs_config_params *param);
 
 /* Non-static functions */
-void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf);
+int qede_config_rss(struct rte_eth_dev *eth_dev);
 
 int qed_fill_eth_dev_info(struct ecore_dev *edev,
 				 struct qed_dev_eth_info *info);
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 380d8fb..6c2837e 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1702,6 +1702,15 @@ int qede_dev_start(struct rte_eth_dev *eth_dev)
 		return rc;
 	}
 
+	/* Newer SR-IOV PF driver expects RX/TX queues to be started before
+	 * enabling RSS. Hence RSS configuration is deferred upto this point.
+	 * Also, we would like to retain similar behavior in PF case, so we
+	 * don't do PF/VF specific check here.
+	 */
+	if (eth_dev->data->dev_conf.rxmode.mq_mode  == ETH_MQ_RX_RSS)
+		if (qede_config_rss(eth_dev))
+			return -1;
+
 	/* Bring-up the link */
 	qede_dev_set_link_state(eth_dev, true);
 
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH 3/3] net/qede: prevent crash while changing MTU dynamically
  2017-03-24  7:40 [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Rasesh Mody
  2017-03-24  7:40 ` [dpdk-stable] [PATCH 2/3] net/qede: fix VF's RSS configuration failure Rasesh Mody
@ 2017-03-24  7:40 ` Rasesh Mody
  2017-03-28 12:18 ` [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Ferruh Yigit
  2017-03-30 14:27 ` Ferruh Yigit
  3 siblings, 0 replies; 6+ messages in thread
From: Rasesh Mody @ 2017-03-24  7:40 UTC (permalink / raw)
  To: dev, ferruh.yigit; +Cc: Harish Patil, stable, Dept-EngDPDKDev

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

The driver can handle dynamic MTU change without needing the port to be
stopped explicitly by the application. However, there is currently no
check to prevent I/Os from happening on a different thread while the
port is going thru' reset internally. This patch fixes this issue by
assigning RX/TX burst functions to a dummy function and also reconfigure
RX bufsize for each rx queue based on the new MTU value.

Fixes: 200645ac7909 ("net/qede: set MTU")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c |   57 ++++++++++++++++++++++++++++++----------
 drivers/net/qede/qede_rxtx.c   |    8 ++++++
 drivers/net/qede/qede_rxtx.h   |    4 +++
 3 files changed, 55 insertions(+), 14 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index e096f63..2f1d2b5 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1684,32 +1684,61 @@ static int qede_rss_reta_query(struct rte_eth_dev *eth_dev,
 
 int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 {
-	uint32_t frame_size;
-	struct qede_dev *qdev = dev->data->dev_private;
+	struct qede_dev *qdev = QEDE_INIT_QDEV(dev);
+	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
 	struct rte_eth_dev_info dev_info = {0};
+	struct qede_fastpath *fp;
+	uint32_t frame_size;
+	uint16_t rx_buf_size;
+	uint16_t bufsz;
+	int i;
 
+	PMD_INIT_FUNC_TRACE(edev);
 	qede_dev_info_get(dev, &dev_info);
-
-	/* VLAN_TAG = 4 */
-	frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + 4;
-
-	if ((mtu < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen))
+	frame_size = mtu + QEDE_ETH_OVERHEAD;
+	if ((mtu < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen)) {
+		DP_ERR(edev, "MTU %u out of range\n", mtu);
 		return -EINVAL;
-
+	}
 	if (!dev->data->scattered_rx &&
-	    frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)
+	    frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) {
+		DP_INFO(edev, "MTU greater than minimum RX buffer size of %u\n",
+			dev->data->min_rx_buf_size);
 		return -EINVAL;
-
+	}
+	/* Temporarily replace I/O functions with dummy ones. It cannot
+	 * be set to NULL because rte_eth_rx_burst() doesn't check for NULL.
+	 */
+	dev->rx_pkt_burst = qede_rxtx_pkts_dummy;
+	dev->tx_pkt_burst = qede_rxtx_pkts_dummy;
+	qede_dev_stop(dev);
+	rte_delay_ms(1000);
+	qdev->mtu = mtu;
+	/* Fix up RX buf size for all queues of the port */
+	for_each_queue(i) {
+		fp = &qdev->fp_array[i];
+		if (fp->type & QEDE_FASTPATH_RX) {
+			bufsz = (uint16_t)rte_pktmbuf_data_room_size(
+				fp->rxq->mb_pool) - RTE_PKTMBUF_HEADROOM;
+			if (dev->data->scattered_rx)
+				rx_buf_size = bufsz + QEDE_ETH_OVERHEAD;
+			else
+				rx_buf_size = mtu + QEDE_ETH_OVERHEAD;
+			rx_buf_size = QEDE_CEIL_TO_CACHE_LINE_SIZE(rx_buf_size);
+			fp->rxq->rx_buf_size = rx_buf_size;
+			DP_INFO(edev, "buf_size adjusted to %u\n", rx_buf_size);
+		}
+	}
+	qede_dev_start(dev);
 	if (frame_size > ETHER_MAX_LEN)
 		dev->data->dev_conf.rxmode.jumbo_frame = 1;
 	else
 		dev->data->dev_conf.rxmode.jumbo_frame = 0;
-
 	/* update max frame size */
 	dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
-	qdev->mtu = mtu;
-	qede_dev_stop(dev);
-	qede_dev_start(dev);
+	/* Reassign back */
+	dev->rx_pkt_burst = qede_recv_pkts;
+	dev->tx_pkt_burst = qede_xmit_pkts;
 
 	return 0;
 }
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 6c2837e..e630326 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1937,3 +1937,11 @@ void qede_dev_stop(struct rte_eth_dev *eth_dev)
 
 	DP_INFO(edev, "dev_state is QEDE_DEV_STOP\n");
 }
+
+uint16_t
+qede_rxtx_pkts_dummy(__rte_unused void *p_rxq,
+		     __rte_unused struct rte_mbuf **pkts,
+		     __rte_unused uint16_t nb_pkts)
+{
+	return 0;
+}
diff --git a/drivers/net/qede/qede_rxtx.h b/drivers/net/qede/qede_rxtx.h
index c27632e..eb8174f 100644
--- a/drivers/net/qede/qede_rxtx.h
+++ b/drivers/net/qede/qede_rxtx.h
@@ -265,6 +265,10 @@ uint16_t qede_xmit_prep_pkts(void *p_txq, struct rte_mbuf **tx_pkts,
 uint16_t qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts,
 			uint16_t nb_pkts);
 
+uint16_t qede_rxtx_pkts_dummy(__rte_unused void *p_rxq,
+			      __rte_unused struct rte_mbuf **pkts,
+			      __rte_unused uint16_t nb_pkts);
+
 /* Fastpath resource alloc/dealloc helpers */
 int qede_alloc_fp_resc(struct qede_dev *qdev);
 
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types
  2017-03-24  7:40 [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Rasesh Mody
  2017-03-24  7:40 ` [dpdk-stable] [PATCH 2/3] net/qede: fix VF's RSS configuration failure Rasesh Mody
  2017-03-24  7:40 ` [dpdk-stable] [PATCH 3/3] net/qede: prevent crash while changing MTU dynamically Rasesh Mody
@ 2017-03-28 12:18 ` Ferruh Yigit
  2017-03-28 21:20   ` Mody, Rasesh
  2017-03-30 14:27 ` Ferruh Yigit
  3 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2017-03-28 12:18 UTC (permalink / raw)
  To: Rasesh Mody, dev; +Cc: Harish Patil, stable, Dept-EngDPDKDev

On 3/24/2017 7:40 AM, Rasesh Mody wrote:
> From: Harish Patil <harish.patil@qlogic.com>
> 
> Both UDP and TCP based RSS offload types are supported by the device.
> This patch adds UDP protocol which got missed out in the original patch.
> 
> Fixes: 4c98f2768eef ("net/qede: support RSS hash configuration")
> 
> Signed-off-by: Harish Patil <harish.patil@qlogic.com>

This patchset looks like depends to other patchset, can you please confirm?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types
  2017-03-28 12:18 ` [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Ferruh Yigit
@ 2017-03-28 21:20   ` Mody, Rasesh
  0 siblings, 0 replies; 6+ messages in thread
From: Mody, Rasesh @ 2017-03-28 21:20 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: Harish Patil, stable, Dept-Eng DPDK Dev

> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
> Sent: Tuesday, March 28, 2017 5:19 AM
> 
> On 3/24/2017 7:40 AM, Rasesh Mody wrote:
> > From: Harish Patil <harish.patil@qlogic.com>
> >
> > Both UDP and TCP based RSS offload types are supported by the device.
> > This patch adds UDP protocol which got missed out in the original patch.
> >
> > Fixes: 4c98f2768eef ("net/qede: support RSS hash configuration")
> >
> > Signed-off-by: Harish Patil <harish.patil@qlogic.com>
> 
> This patchset looks like depends to other patchset, can you please confirm?

Yes, this patch set does depend on the v4 patchset.

Thanks!
-Rasesh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types
  2017-03-24  7:40 [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Rasesh Mody
                   ` (2 preceding siblings ...)
  2017-03-28 12:18 ` [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Ferruh Yigit
@ 2017-03-30 14:27 ` Ferruh Yigit
  3 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2017-03-30 14:27 UTC (permalink / raw)
  To: Rasesh Mody, dev; +Cc: Harish Patil, stable, Dept-EngDPDKDev

On 3/24/2017 7:40 AM, Rasesh Mody wrote:
> From: Harish Patil <harish.patil@qlogic.com>
> 
> Both UDP and TCP based RSS offload types are supported by the device.
> This patch adds UDP protocol which got missed out in the original patch.
> 
> Fixes: 4c98f2768eef ("net/qede: support RSS hash configuration")
> 
> Signed-off-by: Harish Patil <harish.patil@qlogic.com>

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-30 14:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24  7:40 [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Rasesh Mody
2017-03-24  7:40 ` [dpdk-stable] [PATCH 2/3] net/qede: fix VF's RSS configuration failure Rasesh Mody
2017-03-24  7:40 ` [dpdk-stable] [PATCH 3/3] net/qede: prevent crash while changing MTU dynamically Rasesh Mody
2017-03-28 12:18 ` [dpdk-stable] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Ferruh Yigit
2017-03-28 21:20   ` Mody, Rasesh
2017-03-30 14:27 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).