Skip to contentSkip to conversation

net: thunderx: Miscellaneous changes

PATCH In review [email protected] 2 participants 5 messages Mar 2, 2020

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

cover net: thunderx: Miscellaneous changes

From: Sunil Goutham <[email protected]>

This patchset has changes wrt driver performance optimization, load time optimization. And a change to PCI device regiatration table for timestamp device.

Geetha sowjanya (1):
net: thunderx: Reduce mbox wait response time.

Prakash Brahmajyosyula (1):
net: cavium: Register driver with PCI subsys IDs

Sunil Goutham (1):
net: thunderx: Adjust CQE_RX drop levels for better performance

 drivers/net/ethernet/cavium/common/cavium_ptp.c    | 10 +++++++++-
 drivers/net/ethernet/cavium/thunder/nicvf_main.c   |  9 ++++-----
 drivers/net/ethernet/cavium/thunder/nicvf_queues.h |  4 ++--
 3 files changed, 15 insertions(+), 8 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/3 net: thunderx: Adjust CQE_RX drop levels for better performance

From: Sunil Goutham <[email protected]>

With the current RX RED/DROP levels of 192/184 for CQE_RX, when packet incoming rate is high, LLC is getting polluted resulting in more cache misses and higher latency in packet processing. This slows down the whole process and performance loss. Hence reduced the levels to 224/216 (ie for a CQ size of 1024, Rx pkts will be red dropped or dropped when unused CQE are less than 128/160 respectively)

---
 drivers/net/ethernet/cavium/thunder/nicvf_queues.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/cavium/thunder/nicvf_queues.h +2 -2
index bc2427c..2460451 100644
@@ -100,8 +100,8 @@
  * RED accepts pkt if unused CQE < 2304 & >= 2560
  * DROPs pkts if unused CQE < 2304
  */
-#define RQ_PASS_CQ_LVL         192ULL
-#define RQ_DROP_CQ_LVL         184ULL
+#define RQ_PASS_CQ_LVL         224ULL
+#define RQ_DROP_CQ_LVL         216ULL
 
 /* RED and Backpressure levels of RBDR for pkt reception
  * For RBDR, level is a measure of fullness i.e 0x0 means empty
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/3 net: thunderx: Reduce mbox wait response time.

In reply to [email protected]

From: Geetha sowjanya <[email protected]>

Replace msleep() with usleep_range() as internally it uses hrtimers. This will put a cap on maximum wait time.

---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/ethernet/cavium/thunder/nicvf_main.c +4 -5
index 0169572..b4b3336 100644
@@ -126,8 +126,7 @@ static void nicvf_write_to_mbx(struct nicvf *nic, union nic_mbx *mbx)
 
 int nicvf_send_msg_to_pf(struct nicvf *nic, union nic_mbx *mbx)
 {
-	int timeout = NIC_MBOX_MSG_TIMEOUT;
-	int sleep = 10;
+	unsigned long timeout;
 	int ret = 0;
 
 	mutex_lock(&nic->rx_mode_mtx);
@@ -137,6 +136,7 @@ int nicvf_send_msg_to_pf(struct nicvf *nic, union nic_mbx *mbx)
 
 	nicvf_write_to_mbx(nic, mbx);
 
+	timeout = jiffies + msecs_to_jiffies(NIC_MBOX_MSG_TIMEOUT);
 	/* Wait for previous message to be acked, timeout 2sec */
 	while (!nic->pf_acked) {
 		if (nic->pf_nacked) {
@@ -146,11 +146,10 @@ int nicvf_send_msg_to_pf(struct nicvf *nic, union nic_mbx *mbx)
 			ret = -EINVAL;
 			break;
 		}
-		msleep(sleep);
+		usleep_range(8000, 10000);
 		if (nic->pf_acked)
 			break;
-		timeout -= sleep;
-		if (!timeout) {
+		if (time_after(jiffies, timeout)) {
 			netdev_err(nic->netdev,
 				   "PF didn't ACK to mbox msg 0x%02x from VF%d\n",
 				   (mbx->msg.msg & 0xFF), nic->vf_id);
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/3 net: cavium: Register driver with PCI subsys IDs

In reply to [email protected]

From: Prakash Brahmajyosyula <[email protected]>

Across Cavium's ThunderX and Marvell's OcteonTx2 silicons the PTP timestamping block's PCI device ID and vendor ID have remained same but the HW architecture has changed.

Hence added PCI subsystem IDs to the device table to avoid this driver from being probed on OcteonTx2 silicons.

---
 drivers/net/ethernet/cavium/common/cavium_ptp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/net/ethernet/cavium/common/cavium_ptp.c +9 -1
index b821c9e..81ff9ac 100644
@@ -13,6 +13,9 @@
 #define DRV_NAME "cavium_ptp"
 
 #define PCI_DEVICE_ID_CAVIUM_PTP	0xA00C
+#define PCI_SUBSYS_DEVID_88XX_PTP	0xA10C
+#define PCI_SUBSYS_DEVID_81XX_PTP	0XA20C
+#define PCI_SUBSYS_DEVID_83XX_PTP	0xA30C
 #define PCI_DEVICE_ID_CAVIUM_RST	0xA00E
 
 #define PCI_PTP_BAR_NO	0
@@ -321,7 +324,12 @@ static void cavium_ptp_remove(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id cavium_ptp_id_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP,
+			PCI_VENDOR_ID_CAVIUM, PCI_SUBSYS_DEVID_88XX_PTP) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP,
+			PCI_VENDOR_ID_CAVIUM, PCI_SUBSYS_DEVID_81XX_PTP) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP,
+			PCI_VENDOR_ID_CAVIUM, PCI_SUBSYS_DEVID_83XX_PTP) },
 	{ 0, }
 };
 
Signature · 1 line
2.7.4