Skip to contentSkip to conversation

qed*: Bug fixes.

PATCH In review Manish Chopra 2 participants 8 messages Feb 6, 2019 – Feb 7, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover qed*: Bug fixes.

Hi David,

This series contains general qed/qede fixes.
Please consider applying this to "net"

Thanks,
Manish

Manish Chopra (2):
qed: Fix EQ full firmware assert.
qed*: Advance drivers version to 8.37.0.20

Rahul Verma (1):
qed: Change verbosity for coalescing message.

Sudarsana Reddy Kalluru (3):
qed: Assign UFP TC value to vlan priority in UFP mode.
qed: Consider TX tcs while deriving the max num_queues for PF.
qede: Fix system crash on configuring channels.

 drivers/net/ethernet/qlogic/qed/qed.h             |  2 +-
 drivers/net/ethernet/qlogic/qed/qed_l2.c          |  8 +++++---
 drivers/net/ethernet/qlogic/qed/qed_sp.h          |  1 +
 drivers/net/ethernet/qlogic/qed/qed_sp_commands.c |  3 +++
 drivers/net/ethernet/qlogic/qed/qed_spq.c         | 15 +++++++--------
 drivers/net/ethernet/qlogic/qede/qede.h           |  5 ++++-
 drivers/net/ethernet/qlogic/qede/qede_fp.c        | 13 +++++++++++++
 drivers/net/ethernet/qlogic/qede/qede_main.c      |  3 +++
 8 files changed, 37 insertions(+), 13 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/6 qed: Fix EQ full firmware assert.

When slowpath messages are sent with high rate, the resulting events can lead to a FW assert in case they are not handled fast enough (Event Queue Full assert). Attempt to send queued slowpath messages only after the newly evacuated entries in the EQ ring are indicated to FW.

---
 drivers/net/ethernet/qlogic/qed/qed_sp.h  |  1 +
 drivers/net/ethernet/qlogic/qed/qed_spq.c | 15 +++++++--------
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_sp.h +1 -0
index 4179c90..96ab77a 100644
@@ -382,6 +382,7 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn,
  * @param p_hwfn
  */
 void qed_consq_free(struct qed_hwfn *p_hwfn);
+int qed_spq_pend_post(struct qed_hwfn *p_hwfn);
 
 /**
  * @file
drivers/net/ethernet/qlogic/qed/qed_spq.c +7 -8
index eb88bbc..ba64ff9 100644
@@ -397,6 +397,11 @@ int qed_eq_completion(struct qed_hwfn *p_hwfn, void *cookie)
 
 	qed_eq_prod_update(p_hwfn, qed_chain_get_prod_idx(p_chain));
 
+	/* Attempt to post pending requests */
+	spin_lock_bh(&p_hwfn->p_spq->lock);
+	rc = qed_spq_pend_post(p_hwfn);
+	spin_unlock_bh(&p_hwfn->p_spq->lock);
+
 	return rc;
 }
 
@@ -767,7 +772,7 @@ static int qed_spq_post_list(struct qed_hwfn *p_hwfn,
 	return 0;
 }
 
-static int qed_spq_pend_post(struct qed_hwfn *p_hwfn)
+int qed_spq_pend_post(struct qed_hwfn *p_hwfn)
 {
 	struct qed_spq *p_spq = p_hwfn->p_spq;
 	struct qed_spq_entry *p_ent = NULL;
@@ -905,7 +910,6 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn,
 	struct qed_spq_entry	*p_ent = NULL;
 	struct qed_spq_entry	*tmp;
 	struct qed_spq_entry	*found = NULL;
-	int			rc;
 
 	if (!p_hwfn)
 		return -EINVAL;
@@ -963,12 +967,7 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn,
 		 */
 		qed_spq_return_entry(p_hwfn, found);
 
-	/* Attempt to post pending requests */
-	spin_lock_bh(&p_spq->lock);
-	rc = qed_spq_pend_post(p_hwfn);
-	spin_unlock_bh(&p_spq->lock);
-
-	return rc;
+	return 0;
 }
 
 int qed_consq_alloc(struct qed_hwfn *p_hwfn)
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/6 qed: Assign UFP TC value to vlan priority in UFP mode.

In reply to Manish Chopra

From: Sudarsana Reddy Kalluru <[email protected]>

In the case of Unified Fabric Port (UFP) mode, switch provides the traffic class (TC) value to be used for the traffic. Configure hardware to use this TC value for vlan priority.

---
 drivers/net/ethernet/qlogic/qed/qed_sp_commands.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/qlogic/qed/qed_sp_commands.c +3 -0
index 888274f..5a495fd 100644
@@ -604,6 +604,9 @@ int qed_sp_pf_update_stag(struct qed_hwfn *p_hwfn)
 
 	p_ent->ramrod.pf_update.update_mf_vlan_flag = true;
 	p_ent->ramrod.pf_update.mf_vlan = cpu_to_le16(p_hwfn->hw_info.ovlan);
+	if (test_bit(QED_MF_UFP_SPECIFIC, &p_hwfn->cdev->mf_bits))
+		p_ent->ramrod.pf_update.mf_vlan |=
+			cpu_to_le16(((u16)p_hwfn->ufp_info.tc << 13));
 
 	return qed_spq_post(p_hwfn, p_ent, NULL);
 }
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 3/6 qed: Consider TX tcs while deriving the max num_queues for PF.

In reply to Manish Chopra

From: Sudarsana Reddy Kalluru <[email protected]>

Max supported queues is derived incorrectly in the case of multi-CoS. Need to consider TCs while calculating num_queues for PF.

---
 drivers/net/ethernet/qlogic/qed/qed_l2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_l2.c +3 -2
index e68ca83..64ac95c 100644
@@ -2216,7 +2216,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
 			u16 num_queues = 0;
 
 			/* Since the feature controls only queue-zones,
-			 * make sure we have the contexts [rx, tx, xdp] to
+			 * make sure we have the contexts [rx, xdp, tcs] to
 			 * match.
 			 */
 			for_each_hwfn(cdev, i) {
@@ -2226,7 +2226,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
 				u16 cids;
 
 				cids = hwfn->pf_params.eth_pf_params.num_cons;
-				num_queues += min_t(u16, l2_queues, cids / 3);
+				cids /= (2 + info->num_tc);
+				num_queues += min_t(u16, l2_queues, cids);
 			}
 
 			/* queues might theoretically be >256, but interrupts'
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 4/6 qede: Fix system crash on configuring channels.

In reply to Manish Chopra

From: Sudarsana Reddy Kalluru <[email protected]>

Under heavy traffic load, when changing number of channels via ethtool (ethtool -L) which will cause interface to be reloaded, it was observed that some packets gets transmitted on old TX channel/queue id which doesn't really exist after the channel configuration leads to system crash.

Add a safeguard in the driver by validating queue id through ndo_select_queue() which is called before the ndo_start_xmit().

---
 drivers/net/ethernet/qlogic/qede/qede.h      |  3 +++
 drivers/net/ethernet/qlogic/qede/qede_fp.c   | 13 +++++++++++++
 drivers/net/ethernet/qlogic/qede/qede_main.c |  3 +++
 3 files changed, 19 insertions(+)
drivers/net/ethernet/qlogic/qede/qede.h +3 -0
index 613249d..cd40426 100644
@@ -494,6 +494,9 @@ struct qede_reload_args {
 
 /* Datapath functions definition */
 netdev_tx_t qede_start_xmit(struct sk_buff *skb, struct net_device *ndev);
+u16 qede_select_queue(struct net_device *dev, struct sk_buff *skb,
+		      struct net_device *sb_dev,
+		      select_queue_fallback_t fallback);
 netdev_features_t qede_features_check(struct sk_buff *skb,
 				      struct net_device *dev,
 				      netdev_features_t features);
drivers/net/ethernet/qlogic/qede/qede_fp.c +13 -0
index bdf816f..31b046e 100644
@@ -1695,6 +1695,19 @@ netdev_tx_t qede_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	return NETDEV_TX_OK;
 }
 
+u16 qede_select_queue(struct net_device *dev, struct sk_buff *skb,
+		      struct net_device *sb_dev,
+		      select_queue_fallback_t fallback)
+{
+	struct qede_dev *edev = netdev_priv(dev);
+	int total_txq;
+
+	total_txq = QEDE_TSS_COUNT(edev) * edev->dev_info.num_tc;
+
+	return QEDE_TSS_COUNT(edev) ?
+		fallback(dev, skb, NULL) % total_txq :  0;
+}
+
 /* 8B udp header + 8B base tunnel header + 32B option length */
 #define QEDE_MAX_TUN_HDR_LEN 48
 
drivers/net/ethernet/qlogic/qede/qede_main.c +3 -0
index 5a74fcb..9790f26 100644
@@ -631,6 +631,7 @@ static int qede_setup_tc_block(struct qede_dev *edev,
 	.ndo_open = qede_open,
 	.ndo_stop = qede_close,
 	.ndo_start_xmit = qede_start_xmit,
+	.ndo_select_queue = qede_select_queue,
 	.ndo_set_rx_mode = qede_set_rx_mode,
 	.ndo_set_mac_address = qede_set_mac_addr,
 	.ndo_validate_addr = eth_validate_addr,
@@ -666,6 +667,7 @@ static int qede_setup_tc_block(struct qede_dev *edev,
 	.ndo_open = qede_open,
 	.ndo_stop = qede_close,
 	.ndo_start_xmit = qede_start_xmit,
+	.ndo_select_queue = qede_select_queue,
 	.ndo_set_rx_mode = qede_set_rx_mode,
 	.ndo_set_mac_address = qede_set_mac_addr,
 	.ndo_validate_addr = eth_validate_addr,
@@ -684,6 +686,7 @@ static int qede_setup_tc_block(struct qede_dev *edev,
 	.ndo_open = qede_open,
 	.ndo_stop = qede_close,
 	.ndo_start_xmit = qede_start_xmit,
+	.ndo_select_queue = qede_select_queue,
 	.ndo_set_rx_mode = qede_set_rx_mode,
 	.ndo_set_mac_address = qede_set_mac_addr,
 	.ndo_validate_addr = eth_validate_addr,
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 5/6 qed: Change verbosity for coalescing message.

In reply to Manish Chopra

From: Rahul Verma <[email protected]>

Fix unnecessary logging of message in an expected default case where coalescing value read (via ethtool -c) migh not be valid unless they are configured explicitly in the hardware using ethtool -C.

---
 drivers/net/ethernet/qlogic/qed/qed_l2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qed/qed_l2.c +2 -1
index 64ac95c..58be1c4 100644
@@ -2871,7 +2871,8 @@ static int qed_get_coalesce(struct qed_dev *cdev, u16 *coal, void *handle)
 	p_hwfn = p_cid->p_owner;
 	rc = qed_get_queue_coalesce(p_hwfn, coal, handle);
 	if (rc)
-		DP_NOTICE(p_hwfn, "Unable to read queue coalescing\n");
+		DP_VERBOSE(cdev, QED_MSG_DEBUG,
+			   "Unable to read queue coalescing\n");
 
 	return rc;
 }
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 6/6 qed*: Advance drivers version to 8.37.0.20

In reply to Manish Chopra

Version update for qed/qede modules.

---
 drivers/net/ethernet/qlogic/qed/qed.h   | 2 +-
 drivers/net/ethernet/qlogic/qede/qede.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qed/qed.h +1 -1
index 24a9016..2d8a77c 100644
@@ -53,7 +53,7 @@
 extern const struct qed_common_ops qed_common_ops_pass;
 
 #define QED_MAJOR_VERSION		8
-#define QED_MINOR_VERSION		33
+#define QED_MINOR_VERSION		37
 #define QED_REVISION_VERSION		0
 #define QED_ENGINEERING_VERSION		20
 
drivers/net/ethernet/qlogic/qede/qede.h +1 -1
index cd40426..730997b 100644
@@ -56,7 +56,7 @@
 #include <net/tc_act/tc_gact.h>
 
 #define QEDE_MAJOR_VERSION		8
-#define QEDE_MINOR_VERSION		33
+#define QEDE_MINOR_VERSION		37
 #define QEDE_REVISION_VERSION		0
 #define QEDE_ENGINEERING_VERSION	20
 #define DRV_MODULE_VERSION __stringify(QEDE_MAJOR_VERSION) "."	\
Signature · 1 line
1.8.3.1