DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/enic: pick the right Rx handler after changing MTU
@ 2018-07-14  0:54 John Daley
  2018-07-14  5:12 ` Hyong Youb Kim
  2018-07-18  2:02 ` [dpdk-dev] [PATCH v2] " John Daley
  0 siblings, 2 replies; 4+ messages in thread
From: John Daley @ 2018-07-14  0:54 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim

From: Hyong Youb Kim <hyonkim@cisco.com>

enic_set_mtu always reverts to the default Rx handler after changing
MTU. Try to use the simpler, non-scatter handler in this case as well.

Fixes: 1187012c1ede ("net/enic: add simple Rx handler")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index c8456c4b7..aa3f79df5 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -514,6 +514,20 @@ static void enic_prep_wq_for_simple_tx(struct enic *enic, uint16_t queue_idx)
 	}
 }
 
+static void pick_rx_handler(struct enic *enic)
+{
+	struct rte_eth_dev *eth_dev;
+
+	/* Use the non-scatter, simplified RX handler if possible. */
+	if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) {
+		PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler");
+		eth_dev = enic->rte_dev;
+		eth_dev->rx_pkt_burst = &enic_noscatter_recv_pkts;
+	} else {
+		PMD_INIT_LOG(DEBUG, " use the normal Rx handler");
+	}
+}
+
 int enic_enable(struct enic *enic)
 {
 	unsigned int index;
@@ -571,13 +585,7 @@ int enic_enable(struct enic *enic)
 		eth_dev->tx_pkt_burst = &enic_xmit_pkts;
 	}
 
-	/* Use the non-scatter, simplified RX handler if possible. */
-	if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) {
-		PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler");
-		eth_dev->rx_pkt_burst = &enic_noscatter_recv_pkts;
-	} else {
-		PMD_INIT_LOG(DEBUG, " use the normal Rx handler");
-	}
+	pick_rx_handler(enic);
 
 	for (index = 0; index < enic->wq_count; index++)
 		enic_start_wq(enic, index);
@@ -1550,7 +1558,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
 
 	/* put back the real receive function */
 	rte_mb();
-	eth_dev->rx_pkt_burst = enic_recv_pkts;
+	pick_rx_handler(enic);
 	rte_mb();
 
 	/* restart Rx traffic */
-- 
2.16.2

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

* Re: [dpdk-dev] [PATCH] net/enic: pick the right Rx handler after changing MTU
  2018-07-14  0:54 [dpdk-dev] [PATCH] net/enic: pick the right Rx handler after changing MTU John Daley
@ 2018-07-14  5:12 ` Hyong Youb Kim
  2018-07-18  2:02 ` [dpdk-dev] [PATCH v2] " John Daley
  1 sibling, 0 replies; 4+ messages in thread
From: Hyong Youb Kim @ 2018-07-14  5:12 UTC (permalink / raw)
  To: John Daley; +Cc: ferruh.yigit, dev

Hi Ferruh,

Please ignore this patch, as it never assigns the default handler to
rx_pkt_burst. We will send a v2. Sorry about that.

On Fri, Jul 13, 2018 at 05:54:52PM -0700, John Daley wrote:
> From: Hyong Youb Kim <hyonkim@cisco.com>
> 
> enic_set_mtu always reverts to the default Rx handler after changing
> MTU. Try to use the simpler, non-scatter handler in this case as well.
[...]
> +	/* Use the non-scatter, simplified RX handler if possible. */
> +	if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) {
> +		PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler");
> +		eth_dev = enic->rte_dev;
> +		eth_dev->rx_pkt_burst = &enic_noscatter_recv_pkts;
> +	} else {
> +		PMD_INIT_LOG(DEBUG, " use the normal Rx handler");

Here, we should set rx_pkt_burst = enic_recv_pkts

-Hyong

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

* [dpdk-dev] [PATCH v2] net/enic: pick the right Rx handler after changing MTU
  2018-07-14  0:54 [dpdk-dev] [PATCH] net/enic: pick the right Rx handler after changing MTU John Daley
  2018-07-14  5:12 ` Hyong Youb Kim
@ 2018-07-18  2:02 ` John Daley
  2018-07-18 13:10   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: John Daley @ 2018-07-18  2:02 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim

From: Hyong Youb Kim <hyonkim@cisco.com>

enic_set_mtu always reverts to the default Rx handler after changing
MTU. Try to use the simpler, non-scatter handler in this case as well.

Fixes: 35e2cb6a1795 ("net/enic: add simple Rx handler")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
v2: remember to actually assign default handler

 drivers/net/enic/enic_main.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index c8456c4b7..f04dc0878 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -514,6 +514,21 @@ static void enic_prep_wq_for_simple_tx(struct enic *enic, uint16_t queue_idx)
 	}
 }
 
+static void pick_rx_handler(struct enic *enic)
+{
+	struct rte_eth_dev *eth_dev;
+
+	/* Use the non-scatter, simplified RX handler if possible. */
+	eth_dev = enic->rte_dev;
+	if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) {
+		PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler");
+		eth_dev->rx_pkt_burst = &enic_noscatter_recv_pkts;
+	} else {
+		PMD_INIT_LOG(DEBUG, " use the normal Rx handler");
+		eth_dev->rx_pkt_burst = &enic_recv_pkts;
+	}
+}
+
 int enic_enable(struct enic *enic)
 {
 	unsigned int index;
@@ -571,13 +586,7 @@ int enic_enable(struct enic *enic)
 		eth_dev->tx_pkt_burst = &enic_xmit_pkts;
 	}
 
-	/* Use the non-scatter, simplified RX handler if possible. */
-	if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) {
-		PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler");
-		eth_dev->rx_pkt_burst = &enic_noscatter_recv_pkts;
-	} else {
-		PMD_INIT_LOG(DEBUG, " use the normal Rx handler");
-	}
+	pick_rx_handler(enic);
 
 	for (index = 0; index < enic->wq_count; index++)
 		enic_start_wq(enic, index);
@@ -1550,7 +1559,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
 
 	/* put back the real receive function */
 	rte_mb();
-	eth_dev->rx_pkt_burst = enic_recv_pkts;
+	pick_rx_handler(enic);
 	rte_mb();
 
 	/* restart Rx traffic */
-- 
2.16.2

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

* Re: [dpdk-dev] [PATCH v2] net/enic: pick the right Rx handler after changing MTU
  2018-07-18  2:02 ` [dpdk-dev] [PATCH v2] " John Daley
@ 2018-07-18 13:10   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-07-18 13:10 UTC (permalink / raw)
  To: John Daley; +Cc: dev, Hyong Youb Kim

On 7/18/2018 3:02 AM, John Daley wrote:
> From: Hyong Youb Kim <hyonkim@cisco.com>
> 
> enic_set_mtu always reverts to the default Rx handler after changing
> MTU. Try to use the simpler, non-scatter handler in this case as well.
> 
> Fixes: 35e2cb6a1795 ("net/enic: add simple Rx handler")
> 
> Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-07-18 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-14  0:54 [dpdk-dev] [PATCH] net/enic: pick the right Rx handler after changing MTU John Daley
2018-07-14  5:12 ` Hyong Youb Kim
2018-07-18  2:02 ` [dpdk-dev] [PATCH v2] " John Daley
2018-07-18 13:10   ` 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).