DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init
@ 2021-01-11 19:02 Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 1/6] net/ionic: revise configuration flag handling Andrew Boyer
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Andrew Boyer @ 2021-01-11 19:02 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer

This patch series fixes up configuration flag handling, fixes up
link autonegotiation, and reduces the init time.

DTS was used to identify the issues and verify the fixes.

Andrew Boyer (6):
  net/ionic: revise configuration flag handling
  net/ionic: combine queue init and enable commands
  net/ionic: set port admin state to up in port init
  net/ionic: don't add station MAC filter on init
  net/ionic: clear up confusion around FC autoneg
  net/ionic: correctly set link speed and autonegotiation

 drivers/net/ionic/ionic_ethdev.c | 123 +++++++++++++++----------------
 drivers/net/ionic/ionic_lif.c    | 120 ++++++++++++++++++++++--------
 drivers/net/ionic/ionic_lif.h    |   3 +-
 drivers/net/ionic/ionic_main.c   |  14 +---
 drivers/net/ionic/ionic_rxtx.c   |  14 ++--
 5 files changed, 161 insertions(+), 113 deletions(-)

-- 
2.17.1


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

* [dpdk-dev] [PATCH 1/6] net/ionic: revise configuration flag handling
  2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
@ 2021-01-11 19:02 ` Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 2/6] net/ionic: combine queue init and enable commands Andrew Boyer
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Boyer @ 2021-01-11 19:02 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer

Configuration flags come to the driver in dev_configure(). From there,
the driver calls ionic_lif_configure() to update the lif->feature
bitfield, and then programs the port.

Features like VLAN_RX_FILTER and RX_HASH cannot be disabled in the
device, so do nothing in response to requests to disable them. (The
device config would ideally show them enabled by default, but some
DTS tests fail if RSS_HASH is set but RSS is not.)

Move features from the per-queue to per-port lists. IONIC does not
really support per-queue configuration: the stack disallows disabling
a queue feature if it is enabled on the port, while the device
disallows enabling a queue feature if it is disabled on the port.
Thus all configuration is per-port.

Move the guts of ionic_vlan_offload_set() into a new function,
ionic_lif_configure_vlan_offload(), so it can be called by
ionic_lif_configure().

Move the check for DEV_RX_OFFLOAD_SCATTER from rx_queue_setup() up
into ionic_lif_configure().

Warn if rx_drop_en is not set.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 drivers/net/ionic/ionic_ethdev.c |  77 +++++++++---------------
 drivers/net/ionic/ionic_lif.c    | 100 ++++++++++++++++++++++++++-----
 drivers/net/ionic/ionic_lif.h    |   3 +-
 drivers/net/ionic/ionic_rxtx.c   |   6 +-
 4 files changed, 118 insertions(+), 68 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index fd7cd510e..5ff155f85 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -397,25 +397,16 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
 		ETH_LINK_SPEED_100G;
 
 	/*
-	 * Per-queue capabilities. Actually most of the offloads are enabled
-	 * by default on the port and can be used on selected queues (by adding
-	 * packet flags at runtime when required)
+	 * Per-queue capabilities
+	 * RTE does not support disabling a feature on a queue if it is
+	 * enabled globally on the device. Thus the driver does not advertise
+	 * capabilities like DEV_TX_OFFLOAD_IPV4_CKSUM as per-queue even
+	 * though the driver would be otherwise capable of disabling it on
+	 * a per-queue basis.
 	 */
 
-	dev_info->rx_queue_offload_capa =
-		DEV_RX_OFFLOAD_IPV4_CKSUM |
-		DEV_RX_OFFLOAD_UDP_CKSUM |
-		DEV_RX_OFFLOAD_TCP_CKSUM |
-		0;
-
-	dev_info->tx_queue_offload_capa =
-		DEV_TX_OFFLOAD_IPV4_CKSUM |
-		DEV_TX_OFFLOAD_UDP_CKSUM |
-		DEV_TX_OFFLOAD_TCP_CKSUM |
-		DEV_TX_OFFLOAD_VLAN_INSERT |
-		DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
-		DEV_TX_OFFLOAD_OUTER_UDP_CKSUM |
-		0;
+	dev_info->rx_queue_offload_capa = 0;
+	dev_info->tx_queue_offload_capa = 0;
 
 	/*
 	 * Per-port capabilities
@@ -423,15 +414,25 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
 	 */
 
 	dev_info->rx_offload_capa = dev_info->rx_queue_offload_capa |
+		DEV_RX_OFFLOAD_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_UDP_CKSUM |
+		DEV_RX_OFFLOAD_TCP_CKSUM |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_VLAN_STRIP |
 		DEV_RX_OFFLOAD_SCATTER |
+		DEV_RX_OFFLOAD_RSS_HASH |
 		0;
 
 	dev_info->tx_offload_capa = dev_info->tx_queue_offload_capa |
+		DEV_TX_OFFLOAD_IPV4_CKSUM |
+		DEV_TX_OFFLOAD_UDP_CKSUM |
+		DEV_TX_OFFLOAD_TCP_CKSUM |
+		DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_TX_OFFLOAD_OUTER_UDP_CKSUM |
 		DEV_TX_OFFLOAD_MULTI_SEGS |
 		DEV_TX_OFFLOAD_TCP_TSO |
+		DEV_TX_OFFLOAD_VLAN_INSERT |
 		0;
 
 	dev_info->rx_desc_lim = rx_desc_lim;
@@ -445,6 +446,11 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
 	dev_info->default_rxportconf.ring_size = IONIC_DEF_TXRX_DESC;
 	dev_info->default_txportconf.ring_size = IONIC_DEF_TXRX_DESC;
 
+	dev_info->default_rxconf = (struct rte_eth_rxconf) {
+		/* Packets are always dropped if no desc are available */
+		.rx_drop_en = 1,
+	};
+
 	return 0;
 }
 
@@ -502,34 +508,8 @@ static int
 ionic_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)
 {
 	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
-	struct rte_eth_rxmode *rxmode;
-	rxmode = &eth_dev->data->dev_conf.rxmode;
-	int i;
-
-	if (mask & ETH_VLAN_STRIP_MASK) {
-		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP) {
-			for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
-				struct ionic_qcq *rxq =
-					eth_dev->data->rx_queues[i];
-				rxq->offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
-			}
-			lif->features |= IONIC_ETH_HW_VLAN_RX_STRIP;
-		} else {
-			for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
-				struct ionic_qcq *rxq =
-					eth_dev->data->rx_queues[i];
-				rxq->offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
-			}
-			lif->features &= ~IONIC_ETH_HW_VLAN_RX_STRIP;
-		}
-	}
 
-	if (mask & ETH_VLAN_FILTER_MASK) {
-		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
-			lif->features |= IONIC_ETH_HW_VLAN_RX_FILTER;
-		else
-			lif->features &= ~IONIC_ETH_HW_VLAN_RX_FILTER;
-	}
+	ionic_lif_configure_vlan_offload(lif, mask);
 
 	ionic_lif_set_features(lif);
 
@@ -845,15 +825,12 @@ static int
 ionic_dev_configure(struct rte_eth_dev *eth_dev)
 {
 	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
-	int err;
 
 	IONIC_PRINT_CALL();
 
-	err = ionic_lif_configure(lif);
-	if (err) {
-		IONIC_PRINT(ERR, "Cannot configure LIF: %d", err);
-		return err;
-	}
+	ionic_lif_configure(lif);
+
+	ionic_lif_set_features(lif);
 
 	return 0;
 }
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 3e643d145..ed1595e62 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -1532,18 +1532,11 @@ ionic_lif_init(struct ionic_lif *lif)
 	if (err)
 		goto err_out_adminq_deinit;
 
-	lif->features =
-		  IONIC_ETH_HW_VLAN_TX_TAG
-		| IONIC_ETH_HW_VLAN_RX_STRIP
-		| IONIC_ETH_HW_VLAN_RX_FILTER
-		| IONIC_ETH_HW_RX_HASH
-		| IONIC_ETH_HW_TX_SG
-		| IONIC_ETH_HW_RX_SG
-		| IONIC_ETH_HW_TX_CSUM
-		| IONIC_ETH_HW_RX_CSUM
-		| IONIC_ETH_HW_TSO
-		| IONIC_ETH_HW_TSO_IPV6
-		| IONIC_ETH_HW_TSO_ECN;
+	/*
+	 * Configure initial feature set
+	 * This will be updated later by the dev_configure() step
+	 */
+	lif->features = IONIC_ETH_HW_RX_HASH | IONIC_ETH_HW_VLAN_RX_FILTER;
 
 	err = ionic_lif_set_features(lif);
 	if (err)
@@ -1589,9 +1582,31 @@ ionic_lif_deinit(struct ionic_lif *lif)
 	lif->state &= ~IONIC_LIF_F_INITED;
 }
 
-int
+void
+ionic_lif_configure_vlan_offload(struct ionic_lif *lif, int mask)
+{
+	struct rte_eth_dev *eth_dev = lif->eth_dev;
+	struct rte_eth_rxmode *rxmode = &eth_dev->data->dev_conf.rxmode;
+
+	/*
+	 * IONIC_ETH_HW_VLAN_RX_FILTER cannot be turned off, so
+	 * set DEV_RX_OFFLOAD_VLAN_FILTER and ignore ETH_VLAN_FILTER_MASK
+	 */
+	rxmode->offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
+
+	if (mask & ETH_VLAN_STRIP_MASK) {
+		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
+			lif->features |= IONIC_ETH_HW_VLAN_RX_STRIP;
+		else
+			lif->features &= ~IONIC_ETH_HW_VLAN_RX_STRIP;
+	}
+}
+
+void
 ionic_lif_configure(struct ionic_lif *lif)
 {
+	struct rte_eth_rxmode *rxmode = &lif->eth_dev->data->dev_conf.rxmode;
+	struct rte_eth_txmode *txmode = &lif->eth_dev->data->dev_conf.txmode;
 	struct ionic_identity *ident = &lif->adapter->ident;
 	uint32_t ntxqs_per_lif =
 		ident->lif.eth.config.queue_count[IONIC_QTYPE_TXQ];
@@ -1614,7 +1629,64 @@ ionic_lif_configure(struct ionic_lif *lif)
 	lif->nrxqcqs = nrxqs_per_lif;
 	lif->ntxqcqs = ntxqs_per_lif;
 
-	return 0;
+	/* Update the LIF configuration based on the eth_dev */
+
+	/*
+	 * NB: While it is true that RSS_HASH is always enabled on ionic,
+	 *     setting this flag unconditionally causes problems in DTS.
+	 * rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	 */
+
+	/* RX per-port */
+
+	if (rxmode->offloads & DEV_RX_OFFLOAD_IPV4_CKSUM ||
+	    rxmode->offloads & DEV_RX_OFFLOAD_UDP_CKSUM ||
+	    rxmode->offloads & DEV_RX_OFFLOAD_TCP_CKSUM)
+		lif->features |= IONIC_ETH_HW_RX_CSUM;
+	else
+		lif->features &= ~IONIC_ETH_HW_RX_CSUM;
+
+	if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER) {
+		lif->features |= IONIC_ETH_HW_RX_SG;
+		lif->eth_dev->data->scattered_rx = 1;
+	} else {
+		lif->features &= ~IONIC_ETH_HW_RX_SG;
+		lif->eth_dev->data->scattered_rx = 0;
+	}
+
+	/* Covers VLAN_STRIP */
+	ionic_lif_configure_vlan_offload(lif, ETH_VLAN_STRIP_MASK);
+
+	/* TX per-port */
+
+	if (txmode->offloads & DEV_TX_OFFLOAD_IPV4_CKSUM ||
+	    txmode->offloads & DEV_TX_OFFLOAD_UDP_CKSUM ||
+	    txmode->offloads & DEV_TX_OFFLOAD_TCP_CKSUM ||
+	    txmode->offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM ||
+	    txmode->offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+		lif->features |= IONIC_ETH_HW_TX_CSUM;
+	else
+		lif->features &= ~IONIC_ETH_HW_TX_CSUM;
+
+	if (txmode->offloads & DEV_TX_OFFLOAD_VLAN_INSERT)
+		lif->features |= IONIC_ETH_HW_VLAN_TX_TAG;
+	else
+		lif->features &= ~IONIC_ETH_HW_VLAN_TX_TAG;
+
+	if (txmode->offloads & DEV_TX_OFFLOAD_MULTI_SEGS)
+		lif->features |= IONIC_ETH_HW_TX_SG;
+	else
+		lif->features &= ~IONIC_ETH_HW_TX_SG;
+
+	if (txmode->offloads & DEV_TX_OFFLOAD_TCP_TSO) {
+		lif->features |= IONIC_ETH_HW_TSO;
+		lif->features |= IONIC_ETH_HW_TSO_IPV6;
+		lif->features |= IONIC_ETH_HW_TSO_ECN;
+	} else {
+		lif->features &= ~IONIC_ETH_HW_TSO;
+		lif->features &= ~IONIC_ETH_HW_TSO_IPV6;
+		lif->features &= ~IONIC_ETH_HW_TSO_ECN;
+	}
 }
 
 int
diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h
index 86d933606..4f48845eb 100644
--- a/drivers/net/ionic/ionic_lif.h
+++ b/drivers/net/ionic/ionic_lif.h
@@ -131,7 +131,8 @@ void ionic_lif_deinit(struct ionic_lif *lif);
 int ionic_lif_start(struct ionic_lif *lif);
 void ionic_lif_stop(struct ionic_lif *lif);
 
-int ionic_lif_configure(struct ionic_lif *lif);
+void ionic_lif_configure(struct ionic_lif *lif);
+void ionic_lif_configure_vlan_offload(struct ionic_lif *lif, int mask);
 void ionic_lif_reset(struct ionic_lif *lif);
 
 int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr);
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index d06f1246c..cf7ff6ce7 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -675,6 +675,9 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 		"Configuring skt %u RX queue %u with %u buffers, offloads %jx",
 		socket_id, rx_queue_id, nb_desc, offloads);
 
+	if (!rx_conf->rx_drop_en)
+		IONIC_PRINT(WARNING, "No-drop mode is not supported");
+
 	/* Validate number of receive descriptors */
 	if (!rte_is_power_of_2(nb_desc) ||
 			nb_desc < IONIC_MIN_RING_DESC ||
@@ -685,9 +688,6 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 		return -EINVAL; /* or use IONIC_DEFAULT_RING_DESC */
 	}
 
-	if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
-		eth_dev->data->scattered_rx = 1;
-
 	/* Free memory prior to re-allocation if needed... */
 	if (eth_dev->data->rx_queues[rx_queue_id] != NULL) {
 		void *rx_queue = eth_dev->data->rx_queues[rx_queue_id];
-- 
2.17.1


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

* [dpdk-dev] [PATCH 2/6] net/ionic: combine queue init and enable commands
  2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 1/6] net/ionic: revise configuration flag handling Andrew Boyer
@ 2021-01-11 19:02 ` Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 3/6] net/ionic: set port admin state to up in port init Andrew Boyer
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Boyer @ 2021-01-11 19:02 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer, Neel Patel

Adding F_ENA to the q_init command has the same effect as q_enable.
This reduces the startup time a bit.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
---
 drivers/net/ionic/ionic_lif.c  | 4 ++--
 drivers/net/ionic/ionic_rxtx.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index ed1595e62..673f789f3 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -1371,7 +1371,7 @@ ionic_lif_txq_init(struct ionic_qcq *qcq)
 			.opcode = IONIC_CMD_Q_INIT,
 			.type = q->type,
 			.index = q->index,
-			.flags = IONIC_QINIT_F_SG,
+			.flags = IONIC_QINIT_F_SG | IONIC_QINIT_F_ENA,
 			.intr_index = cq->bound_intr->index,
 			.ring_size = rte_log2_u32(q->num_descs),
 			.ring_base = q->base_pa,
@@ -1417,7 +1417,7 @@ ionic_lif_rxq_init(struct ionic_qcq *qcq)
 			.opcode = IONIC_CMD_Q_INIT,
 			.type = q->type,
 			.index = q->index,
-			.flags = IONIC_QINIT_F_SG,
+			.flags = IONIC_QINIT_F_SG | IONIC_QINIT_F_ENA,
 			.intr_index = cq->bound_intr->index,
 			.ring_size = rte_log2_u32(q->num_descs),
 			.ring_base = q->base_pa,
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index cf7ff6ce7..5d0e9d5d5 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -232,10 +232,10 @@ ionic_dev_tx_queue_start(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
 		err = ionic_lif_txq_init(txq);
 		if (err)
 			return err;
+	} else {
+		ionic_qcq_enable(txq);
 	}
 
-	ionic_qcq_enable(txq);
-
 	tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
 
 	return 0;
@@ -988,6 +988,8 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
 		err = ionic_lif_rxq_init(rxq);
 		if (err)
 			return err;
+	} else {
+		ionic_qcq_enable(rxq);
 	}
 
 	/* Allocate buffers for descriptor rings */
@@ -997,8 +999,6 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
 		return -1;
 	}
 
-	ionic_qcq_enable(rxq);
-
 	rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
 
 	return 0;
-- 
2.17.1


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

* [dpdk-dev] [PATCH 3/6] net/ionic: set port admin state to up in port init
  2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 1/6] net/ionic: revise configuration flag handling Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 2/6] net/ionic: combine queue init and enable commands Andrew Boyer
@ 2021-01-11 19:02 ` Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 4/6] net/ionic: don't add station MAC filter on init Andrew Boyer
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Boyer @ 2021-01-11 19:02 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer, Neel Patel

This reduces the startup time a bit.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
---
 drivers/net/ionic/ionic_main.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ionic/ionic_main.c b/drivers/net/ionic/ionic_main.c
index ce5d11311..467696a54 100644
--- a/drivers/net/ionic/ionic_main.c
+++ b/drivers/net/ionic/ionic_main.c
@@ -403,21 +403,13 @@ ionic_port_init(struct ionic_adapter *adapter)
 	for (i = 0; i < nwords; i++)
 		iowrite32(ident->port.config.words[i], &idev->dev_cmd->data[i]);
 
+	idev->port_info->config.state = IONIC_PORT_ADMIN_STATE_UP;
 	ionic_dev_cmd_port_init(idev);
 	err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
-	if (err) {
+	if (err)
 		IONIC_PRINT(ERR, "Failed to init port");
-		return err;
-	}
-
-	ionic_dev_cmd_port_state(idev, IONIC_PORT_ADMIN_STATE_UP);
-	err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
-	if (err) {
-		IONIC_PRINT(WARNING, "Failed to bring port UP");
-		return err;
-	}
 
-	return 0;
+	return err;
 }
 
 int
-- 
2.17.1


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

* [dpdk-dev] [PATCH 4/6] net/ionic: don't add station MAC filter on init
  2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
                   ` (2 preceding siblings ...)
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 3/6] net/ionic: set port admin state to up in port init Andrew Boyer
@ 2021-01-11 19:02 ` Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 5/6] net/ionic: clear up confusion around FC autoneg Andrew Boyer
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Boyer @ 2021-01-11 19:02 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer, Neel Patel

The address is not needed in the firmware.
This reduces the startup time a bit.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
---
 drivers/net/ionic/ionic_lif.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 673f789f3..f39b54e8e 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -1469,24 +1469,8 @@ ionic_station_set(struct ionic_lif *lif)
 	if (err)
 		return err;
 
-	if (!rte_is_zero_ether_addr((struct rte_ether_addr *)
-			lif->mac_addr)) {
-		IONIC_PRINT(INFO, "deleting station MAC addr");
-
-		ionic_lif_addr_del(lif, lif->mac_addr);
-	}
-
 	memcpy(lif->mac_addr, ctx.comp.lif_getattr.mac, RTE_ETHER_ADDR_LEN);
 
-	if (rte_is_zero_ether_addr((struct rte_ether_addr *)lif->mac_addr)) {
-		IONIC_PRINT(NOTICE, "empty MAC addr (VF?)");
-		return 0;
-	}
-
-	IONIC_PRINT(DEBUG, "adding station MAC addr");
-
-	ionic_lif_addr_add(lif, lif->mac_addr);
-
 	return 0;
 }
 
-- 
2.17.1


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

* [dpdk-dev] [PATCH 5/6] net/ionic: clear up confusion around FC autoneg
  2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
                   ` (3 preceding siblings ...)
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 4/6] net/ionic: don't add station MAC filter on init Andrew Boyer
@ 2021-01-11 19:02 ` Andrew Boyer
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 6/6] net/ionic: correctly set link speed and autonegotiation Andrew Boyer
  2021-01-18 17:09 ` [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Ferruh Yigit
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Boyer @ 2021-01-11 19:02 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer

IONIC does not support Flow-Control autonegotiation.

Always wait for completion after each dev cmd.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 drivers/net/ionic/ionic_ethdev.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 5ff155f85..838e93ef7 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -463,7 +463,8 @@ ionic_flow_ctrl_get(struct rte_eth_dev *eth_dev,
 	struct ionic_dev *idev = &adapter->idev;
 
 	if (idev->port_info) {
-		fc_conf->autoneg = idev->port_info->config.an_enable;
+		/* Flow control autoneg not supported */
+		fc_conf->autoneg = 0;
 
 		if (idev->port_info->config.pause_type)
 			fc_conf->mode = RTE_FC_FULL;
@@ -482,7 +483,12 @@ ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev,
 	struct ionic_adapter *adapter = lif->adapter;
 	struct ionic_dev *idev = &adapter->idev;
 	uint8_t pause_type = IONIC_PORT_PAUSE_TYPE_NONE;
-	uint8_t an_enable;
+	int err;
+
+	if (fc_conf->autoneg) {
+		IONIC_PRINT(WARNING, "Flow control autoneg not supported");
+		return -ENOTSUP;
+	}
 
 	switch (fc_conf->mode) {
 	case RTE_FC_NONE:
@@ -496,12 +502,12 @@ ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev,
 		return -ENOTSUP;
 	}
 
-	an_enable = fc_conf->autoneg;
-
 	ionic_dev_cmd_port_pause(idev, pause_type);
-	ionic_dev_cmd_port_autoneg(idev, an_enable);
+	err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
+	if (err)
+		IONIC_PRINT(WARNING, "Failed to configure flow control");
 
-	return 0;
+	return err;
 }
 
 static int
-- 
2.17.1


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

* [dpdk-dev] [PATCH 6/6] net/ionic: correctly set link speed and autonegotiation
  2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
                   ` (4 preceding siblings ...)
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 5/6] net/ionic: clear up confusion around FC autoneg Andrew Boyer
@ 2021-01-11 19:02 ` Andrew Boyer
  2021-01-18 17:10   ` Ferruh Yigit
  2021-01-18 17:09 ` [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Ferruh Yigit
  6 siblings, 1 reply; 9+ messages in thread
From: Andrew Boyer @ 2021-01-11 19:02 UTC (permalink / raw)
  To: dev; +Cc: Alfredo Cardigliano, Andrew Boyer

Don't assume autoneg in link_update().

Always call ionic_dev_cmd_port_autoneg() in start().

This allows the client to specify the link settings.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 drivers/net/ionic/ionic_ethdev.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 838e93ef7..2face7c63 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -276,7 +276,10 @@ ionic_dev_link_update(struct rte_eth_dev *eth_dev,
 
 	/* Initialize */
 	memset(&link, 0, sizeof(link));
-	link.link_autoneg = ETH_LINK_AUTONEG;
+
+	if (adapter->idev.port_info->config.an_enable) {
+		link.link_autoneg = ETH_LINK_AUTONEG;
+	}
 
 	if (!adapter->link_up ||
 	    !(lif->state & IONIC_LIF_F_UP)) {
@@ -869,7 +872,8 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)
 	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
 	struct ionic_adapter *adapter = lif->adapter;
 	struct ionic_dev *idev = &adapter->idev;
-	uint32_t allowed_speeds;
+	uint32_t speed = 0, allowed_speeds;
+	uint8_t an_enable;
 	int err;
 
 	IONIC_PRINT_CALL();
@@ -896,11 +900,23 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)
 		return err;
 	}
 
-	if (eth_dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) {
-		uint32_t speed = ionic_parse_link_speeds(dev_conf->link_speeds);
+	/* Configure link */
+	an_enable = (dev_conf->link_speeds & ETH_LINK_SPEED_FIXED) == 0;
 
-		if (speed)
-			ionic_dev_cmd_port_speed(idev, speed);
+	ionic_dev_cmd_port_autoneg(idev, an_enable);
+	err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
+	if (err)
+		IONIC_PRINT(WARNING, "Failed to %s autonegotiation",
+			an_enable ? "enable" : "disable");
+
+	if (!an_enable)
+		speed = ionic_parse_link_speeds(dev_conf->link_speeds);
+	if (speed) {
+		ionic_dev_cmd_port_speed(idev, speed);
+		err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
+		if (err)
+			IONIC_PRINT(WARNING, "Failed to set link speed %u",
+				speed);
 	}
 
 	ionic_dev_link_update(eth_dev, 0);
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init
  2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
                   ` (5 preceding siblings ...)
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 6/6] net/ionic: correctly set link speed and autonegotiation Andrew Boyer
@ 2021-01-18 17:09 ` Ferruh Yigit
  6 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2021-01-18 17:09 UTC (permalink / raw)
  To: Andrew Boyer, dev; +Cc: Alfredo Cardigliano

On 1/11/2021 7:02 PM, Andrew Boyer wrote:
> This patch series fixes up configuration flag handling, fixes up
> link autonegotiation, and reduces the init time.
> 
> DTS was used to identify the issues and verify the fixes.
> 
> Andrew Boyer (6):
>    net/ionic: revise configuration flag handling
>    net/ionic: combine queue init and enable commands
>    net/ionic: set port admin state to up in port init
>    net/ionic: don't add station MAC filter on init
>    net/ionic: clear up confusion around FC autoneg
>    net/ionic: correctly set link speed and autonegotiation
> 

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

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

* Re: [dpdk-dev] [PATCH 6/6] net/ionic: correctly set link speed and autonegotiation
  2021-01-11 19:02 ` [dpdk-dev] [PATCH 6/6] net/ionic: correctly set link speed and autonegotiation Andrew Boyer
@ 2021-01-18 17:10   ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2021-01-18 17:10 UTC (permalink / raw)
  To: Andrew Boyer, dev; +Cc: Alfredo Cardigliano

On 1/11/2021 7:02 PM, Andrew Boyer wrote:
> Don't assume autoneg in link_update().
> 
> Always call ionic_dev_cmd_port_autoneg() in start().
> 
> This allows the client to specify the link settings.
> 
> Signed-off-by: Andrew Boyer <aboyer@pensando.io>

     Fixes: 598f6726390f ("net/ionic: add basic port operations")
     Cc: stable@dpdk.org


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

end of thread, other threads:[~2021-01-18 17:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 19:02 [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init Andrew Boyer
2021-01-11 19:02 ` [dpdk-dev] [PATCH 1/6] net/ionic: revise configuration flag handling Andrew Boyer
2021-01-11 19:02 ` [dpdk-dev] [PATCH 2/6] net/ionic: combine queue init and enable commands Andrew Boyer
2021-01-11 19:02 ` [dpdk-dev] [PATCH 3/6] net/ionic: set port admin state to up in port init Andrew Boyer
2021-01-11 19:02 ` [dpdk-dev] [PATCH 4/6] net/ionic: don't add station MAC filter on init Andrew Boyer
2021-01-11 19:02 ` [dpdk-dev] [PATCH 5/6] net/ionic: clear up confusion around FC autoneg Andrew Boyer
2021-01-11 19:02 ` [dpdk-dev] [PATCH 6/6] net/ionic: correctly set link speed and autonegotiation Andrew Boyer
2021-01-18 17:10   ` Ferruh Yigit
2021-01-18 17:09 ` [dpdk-dev] [PATCH 0/6] net/ionic: fix device configuration and init 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).