patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF
@ 2018-06-23 21:20 Rasesh Mody
  2018-06-23 21:20 ` [dpdk-stable] [PATCH 2/3] net/qede: fix legacy interrupt mode Rasesh Mody
  2018-06-27 10:37 ` [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Rasesh Mody @ 2018-06-23 21:20 UTC (permalink / raw)
  To: dev; +Cc: Shahed Shaikh, ferruh.yigit, Dept-EngDPDKDev, stable

From: Shahed Shaikh <shahed.shaikh@cavium.com>

We did not register unicast mac configuration handlers
for VF causing failure in bonding of VFs.

Also, mac_addr_set operation requires mac_remove followed
by mad_add.

Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 7a63d05..1cae474 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -957,7 +957,11 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev)
 	struct ecore_filter_ucast ucast;
 	int re;
 
+	if (!is_valid_assigned_ether_addr(mac_addr))
+		return -EINVAL;
+
 	qede_set_ucast_cmn_params(&ucast);
+	ucast.opcode = ECORE_FILTER_ADD;
 	ucast.type = ECORE_FILTER_MAC;
 	ether_addr_copy(mac_addr, (struct ether_addr *)&ucast.mac);
 	re = (int)qede_mac_int_ops(eth_dev, &ucast, 1);
@@ -979,6 +983,9 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev)
 		return;
 	}
 
+	if (!is_valid_assigned_ether_addr(&eth_dev->data->mac_addrs[index]))
+		return;
+
 	qede_set_ucast_cmn_params(&ucast);
 	ucast.opcode = ECORE_FILTER_REMOVE;
 	ucast.type = ECORE_FILTER_MAC;
@@ -1002,8 +1009,9 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev)
 		return -EPERM;
 	}
 
-	qede_mac_addr_add(eth_dev, mac_addr, 0, 0);
-	return 0;
+	qede_mac_addr_remove(eth_dev, 0);
+
+	return qede_mac_addr_add(eth_dev, mac_addr, 0, 0);
 }
 
 static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool flg)
@@ -3024,6 +3032,9 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev,
 	.mtu_set = qede_set_mtu,
 	.udp_tunnel_port_add = qede_udp_dst_port_add,
 	.udp_tunnel_port_del = qede_udp_dst_port_del,
+	.mac_addr_add = qede_mac_addr_add,
+	.mac_addr_remove = qede_mac_addr_remove,
+	.mac_addr_set = qede_mac_addr_set,
 };
 
 static void qede_update_pf_params(struct ecore_dev *edev)
@@ -3188,7 +3199,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 						ECORE_LEADING_HWFN(edev),
 						vf_mac,
 						&is_mac_forced);
-			if (is_mac_exist && is_mac_forced) {
+			if (is_mac_exist) {
 				DP_INFO(edev, "VF macaddr received from PF\n");
 				ether_addr_copy((struct ether_addr *)&vf_mac,
 						&eth_dev->data->mac_addrs[0]);
-- 
1.7.10.3

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

* [dpdk-stable] [PATCH 2/3] net/qede: fix legacy interrupt mode
  2018-06-23 21:20 [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF Rasesh Mody
@ 2018-06-23 21:20 ` Rasesh Mody
  2018-06-27 10:37 ` [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Rasesh Mody @ 2018-06-23 21:20 UTC (permalink / raw)
  To: dev; +Cc: Shahed Shaikh, ferruh.yigit, david.marchand, Dept-EngDPDKDev, stable

From: Shahed Shaikh <shahed.shaikh@cavium.com>

qede pmd does not have support for legacy interrupt mode.
This causes slow path completion failure with uio_pci_generic module,
since it uses legacy interrupt (INTx) mode.

Fix this issue by installing legacy interrupt handler.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |   40 +++++++++++++++++++++++++++++++++++++---
 drivers/net/qede/qede_main.c   |    2 +-
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 1cae474..8bbfa95 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -339,6 +339,24 @@ static void qede_interrupt_action(struct ecore_hwfn *p_hwfn)
 }
 
 static void
+qede_interrupt_handler_intx(void *param)
+{
+	struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
+	struct qede_dev *qdev = eth_dev->data->dev_private;
+	struct ecore_dev *edev = &qdev->edev;
+	u64 status;
+
+	/* Check if our device actually raised an interrupt */
+	status = ecore_int_igu_read_sisr_reg(ECORE_LEADING_HWFN(edev));
+	if (status & 0x1) {
+		qede_interrupt_action(ECORE_LEADING_HWFN(edev));
+
+		if (rte_intr_enable(eth_dev->intr_handle))
+			DP_ERR(edev, "rte_intr_enable failed\n");
+	}
+}
+
+static void
 qede_interrupt_handler(void *param)
 {
 	struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
@@ -3063,6 +3081,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	/* Fix up ecore debug level */
 	uint32_t dp_module = ~0 & ~ECORE_MSG_HW;
 	uint8_t dp_level = ECORE_LEVEL_VERBOSE;
+	uint32_t int_mode;
 	int rc;
 
 	/* Extract key data structures */
@@ -3107,8 +3126,22 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 		return -ENODEV;
 	}
 	qede_update_pf_params(edev);
-	rte_intr_callback_register(&pci_dev->intr_handle,
-				   qede_interrupt_handler, (void *)eth_dev);
+
+	switch (pci_dev->intr_handle.type) {
+	case RTE_INTR_HANDLE_UIO_INTX:
+	case RTE_INTR_HANDLE_VFIO_LEGACY:
+		int_mode = ECORE_INT_MODE_INTA;
+		rte_intr_callback_register(&pci_dev->intr_handle,
+					   qede_interrupt_handler_intx,
+					   (void *)eth_dev);
+		break;
+	default:
+		int_mode = ECORE_INT_MODE_MSIX;
+		rte_intr_callback_register(&pci_dev->intr_handle,
+					   qede_interrupt_handler,
+					   (void *)eth_dev);
+	}
+
 	if (rte_intr_enable(&pci_dev->intr_handle)) {
 		DP_ERR(edev, "rte_intr_enable() failed\n");
 		return -ENODEV;
@@ -3116,7 +3149,8 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	/* Start the Slowpath-process */
 	memset(&params, 0, sizeof(struct qed_slowpath_params));
-	params.int_mode = ECORE_INT_MODE_MSIX;
+
+	params.int_mode = int_mode;
 	params.drv_major = QEDE_PMD_VERSION_MAJOR;
 	params.drv_minor = QEDE_PMD_VERSION_MINOR;
 	params.drv_rev = QEDE_PMD_VERSION_REVISION;
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index de5a7ca..2885e5d 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -281,7 +281,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	/* Start the slowpath */
 	memset(&hw_init_params, 0, sizeof(hw_init_params));
 	hw_init_params.b_hw_start = true;
-	hw_init_params.int_mode = ECORE_INT_MODE_MSIX;
+	hw_init_params.int_mode = params->int_mode;
 	hw_init_params.allow_npar_tx_switch = true;
 	hw_init_params.bin_fw_data = data;
 
-- 
1.7.10.3

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

* Re: [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF
  2018-06-23 21:20 [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF Rasesh Mody
  2018-06-23 21:20 ` [dpdk-stable] [PATCH 2/3] net/qede: fix legacy interrupt mode Rasesh Mody
@ 2018-06-27 10:37 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-06-27 10:37 UTC (permalink / raw)
  To: Rasesh Mody, dev; +Cc: Shahed Shaikh, Dept-EngDPDKDev, stable

On 6/23/2018 10:20 PM, Rasesh Mody wrote:
> From: Shahed Shaikh <shahed.shaikh@cavium.com>
> 
> We did not register unicast mac configuration handlers
> for VF causing failure in bonding of VFs.
> 
> Also, mac_addr_set operation requires mac_remove followed
> by mad_add.
> 
> Fixes: 86a2265e59d7 ("qede: add SRIOV support")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>

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

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

end of thread, other threads:[~2018-06-27 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-23 21:20 [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF Rasesh Mody
2018-06-23 21:20 ` [dpdk-stable] [PATCH 2/3] net/qede: fix legacy interrupt mode Rasesh Mody
2018-06-27 10:37 ` [dpdk-stable] [PATCH 1/3] net/qede: fix unicast MAC address handling in VF 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).