Skip to content

Commit

Permalink
liquidio VF: reduce load time of module
Browse files Browse the repository at this point in the history
Reduce the load time of the VF driver by decreasing the wait time between
iterations of the loop that polls for a mailbox response from the PF. Also
change the wait time units from jiffies to milliseconds.

Signed-off-by: Prasad Kanneganti <prasad.kanneganti@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Prasad Kanneganti authored and davem330 committed Jan 12, 2017
1 parent cb2336b commit a8ac1a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ int octeon_mbox_write(struct octeon_device *oct,
{
struct octeon_mbox *mbox = oct->mbox[mbox_cmd->q_no];
u32 count, i, ret = OCTEON_MBOX_STATUS_SUCCESS;
long timeout = LIO_MBOX_WRITE_WAIT_TIME;
unsigned long flags;

spin_lock_irqsave(&mbox->lock, flags);
Expand Down Expand Up @@ -158,7 +159,7 @@ int octeon_mbox_write(struct octeon_device *oct,
count = 0;

while (readq(mbox->mbox_write_reg) != OCTEON_PFVFSIG) {
schedule_timeout_uninterruptible(LIO_MBOX_WRITE_WAIT_TIME);
schedule_timeout_uninterruptible(timeout);
if (count++ == LIO_MBOX_WRITE_WAIT_CNT) {
ret = OCTEON_MBOX_STATUS_FAILED;
break;
Expand All @@ -171,7 +172,7 @@ int octeon_mbox_write(struct octeon_device *oct,
count = 0;
while (readq(mbox->mbox_write_reg) !=
OCTEON_PFVFACK) {
schedule_timeout_uninterruptible(10);
schedule_timeout_uninterruptible(timeout);
if (count++ == LIO_MBOX_WRITE_WAIT_CNT) {
ret = OCTEON_MBOX_STATUS_FAILED;
break;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/cavium/liquidio/octeon_mailbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#define OCTEON_PFVFSIG 0x1122334455667788
#define OCTEON_PFVFERR 0xDEADDEADDEADDEAD

#define LIO_MBOX_WRITE_WAIT_CNT 1000
#define LIO_MBOX_WRITE_WAIT_TIME 10
#define LIO_MBOX_WRITE_WAIT_CNT 1000
#define LIO_MBOX_WRITE_WAIT_TIME msecs_to_jiffies(1)

enum octeon_mbox_cmd_status {
OCTEON_MBOX_STATUS_SUCCESS = 0,
Expand Down

0 comments on commit a8ac1a5

Please sign in to comment.