Skip to content

Commit

Permalink
Merge branch 'net-thunderx-Miscellaneous-changes'
Browse files Browse the repository at this point in the history
Sunil Goutham says:

====================
net: thunderx: Miscellaneous changes

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

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 2, 2020
2 parents aeaf0cc + aa3afcc commit 6f2f92a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
10 changes: 9 additions & 1 deletion drivers/net/ethernet/cavium/common/cavium_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, }
};

Expand Down
9 changes: 4 additions & 5 deletions drivers/net/ethernet/cavium/thunder/nicvf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/cavium/thunder/nicvf_queues.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f2f92a

Please sign in to comment.