All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] net: thunderx: Miscellaneous changes
@ 2020-03-02  9:58 sunil.kovvuri
  2020-03-02  9:59 ` [PATCH 1/3] net: thunderx: Adjust CQE_RX drop levels for better performance sunil.kovvuri
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sunil.kovvuri @ 2020-03-02  9:58 UTC (permalink / raw
  To: netdev; +Cc: davem, Sunil Goutham

From: Sunil Goutham <sgoutham@marvell.com>

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(-)

-- 
2.7.4


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

* [PATCH 1/3] net: thunderx: Adjust CQE_RX drop levels for better performance
  2020-03-02  9:58 [PATCH 0/3] net: thunderx: Miscellaneous changes sunil.kovvuri
@ 2020-03-02  9:59 ` sunil.kovvuri
  2020-03-02  9:59 ` [PATCH 2/3] net: thunderx: Reduce mbox wait response time sunil.kovvuri
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: sunil.kovvuri @ 2020-03-02  9:59 UTC (permalink / raw
  To: netdev; +Cc: davem, Sunil Goutham

From: Sunil Goutham <sgoutham@marvell.com>

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)

Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/cavium/thunder/nicvf_queues.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
index bc2427c..2460451 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
@@ -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
-- 
2.7.4


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

* [PATCH 2/3] net: thunderx: Reduce mbox wait response time.
  2020-03-02  9:58 [PATCH 0/3] net: thunderx: Miscellaneous changes sunil.kovvuri
  2020-03-02  9:59 ` [PATCH 1/3] net: thunderx: Adjust CQE_RX drop levels for better performance sunil.kovvuri
@ 2020-03-02  9:59 ` sunil.kovvuri
  2020-03-02  9:59 ` [PATCH 3/3] net: cavium: Register driver with PCI subsys IDs sunil.kovvuri
  2020-03-02 19:14 ` [PATCH 0/3] net: thunderx: Miscellaneous changes David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: sunil.kovvuri @ 2020-03-02  9:59 UTC (permalink / raw
  To: netdev; +Cc: davem, Geetha sowjanya, Sunil Goutham

From: Geetha sowjanya <gakula@marvell.com>

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

Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index 0169572..b4b3336 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -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);
-- 
2.7.4


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

* [PATCH 3/3] net: cavium: Register driver with PCI subsys IDs
  2020-03-02  9:58 [PATCH 0/3] net: thunderx: Miscellaneous changes sunil.kovvuri
  2020-03-02  9:59 ` [PATCH 1/3] net: thunderx: Adjust CQE_RX drop levels for better performance sunil.kovvuri
  2020-03-02  9:59 ` [PATCH 2/3] net: thunderx: Reduce mbox wait response time sunil.kovvuri
@ 2020-03-02  9:59 ` sunil.kovvuri
  2020-03-02 19:14 ` [PATCH 0/3] net: thunderx: Miscellaneous changes David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: sunil.kovvuri @ 2020-03-02  9:59 UTC (permalink / raw
  To: netdev; +Cc: davem, Prakash Brahmajyosyula, Sunil Goutham

From: Prakash Brahmajyosyula <bprakash@marvell.com>

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.

Signed-off-by: Prakash Brahmajyosyula <bprakash@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/cavium/common/cavium_ptp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/common/cavium_ptp.c b/drivers/net/ethernet/cavium/common/cavium_ptp.c
index b821c9e..81ff9ac 100644
--- a/drivers/net/ethernet/cavium/common/cavium_ptp.c
+++ b/drivers/net/ethernet/cavium/common/cavium_ptp.c
@@ -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, }
 };
 
-- 
2.7.4


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

* Re: [PATCH 0/3] net: thunderx: Miscellaneous changes
  2020-03-02  9:58 [PATCH 0/3] net: thunderx: Miscellaneous changes sunil.kovvuri
                   ` (2 preceding siblings ...)
  2020-03-02  9:59 ` [PATCH 3/3] net: cavium: Register driver with PCI subsys IDs sunil.kovvuri
@ 2020-03-02 19:14 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-03-02 19:14 UTC (permalink / raw
  To: sunil.kovvuri; +Cc: netdev, sgoutham

From: sunil.kovvuri@gmail.com
Date: Mon,  2 Mar 2020 15:28:59 +0530

> From: Sunil Goutham <sgoutham@marvell.com>
> 
> This patchset has changes wrt driver performance optimization,
> load time optimization. And a change to PCI device regiatration
> table for timestamp device.

Series applied, thanks Sunil.

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

end of thread, other threads:[~2020-03-02 19:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-02  9:58 [PATCH 0/3] net: thunderx: Miscellaneous changes sunil.kovvuri
2020-03-02  9:59 ` [PATCH 1/3] net: thunderx: Adjust CQE_RX drop levels for better performance sunil.kovvuri
2020-03-02  9:59 ` [PATCH 2/3] net: thunderx: Reduce mbox wait response time sunil.kovvuri
2020-03-02  9:59 ` [PATCH 3/3] net: cavium: Register driver with PCI subsys IDs sunil.kovvuri
2020-03-02 19:14 ` [PATCH 0/3] net: thunderx: Miscellaneous changes David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.