netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Cc: Leon Romanovsky <leonro@mellanox.com>,
	Jason Gunthorpe <jgg@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	Doug Ledford <dledford@redhat.com>, Eli Cohen <eli@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [PATCH mlx5-next 6/6] net/mlx5: Reduce command polling interval
Date: Wed,  8 Aug 2018 16:23:53 -0700	[thread overview]
Message-ID: <20180808232353.15514-7-saeedm@mellanox.com> (raw)
In-Reply-To: <20180808232353.15514-1-saeedm@mellanox.com>

From: Eli Cohen <eli@mellanox.com>

Use cond_resched() instead of usleep_range() to decrease the time
between polling attempts thus reducing overall driver load time.

Below is a comparison before and after the change, of loading eight
virtual functions.

Before:
real    0m8.785s
user    0m0.093s
sys     0m0.090s

After:
real    0m5.730s
user    0m0.097s
sys     0m0.087s

Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index 041c18faea46..fac5dd04578c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -211,7 +211,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent)
 			ent->ret = 0;
 			return;
 		}
-		usleep_range(5000, 10000);
+		cond_resched();
 	} while (time_before(jiffies, poll_end));
 
 	ent->ret = -ETIMEDOUT;
-- 
2.17.0

  parent reply	other threads:[~2018-08-09  1:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 23:23 [PATCH mlx5-next 0/6] Mellanox, mlx5 next updates 2018-08-09 Saeed Mahameed
2018-08-08 23:23 ` [PATCH mlx5-next 1/6] net/mlx5: Use max_num_eqs for calculation of required MSIX vectors Saeed Mahameed
2018-08-08 23:23 ` [PATCH mlx5-next 2/6] net/mlx5: Rename modify/query_vport state related enums Saeed Mahameed
2018-08-08 23:23 ` [PATCH mlx5-next 3/6] net/mlx5: E-Switch, Remove unused argument when creating legacy FDB Saeed Mahameed
2018-08-08 23:23 ` [PATCH mlx5-next 4/6] net/mlx5: Remove unused mlx5_query_vport_admin_state Saeed Mahameed
2018-08-08 23:23 ` [PATCH mlx5-next 5/6] net/mlx5: Unexport functions that need not be exported Saeed Mahameed
2018-08-09  4:34   ` Leon Romanovsky
2018-08-08 23:23 ` Saeed Mahameed [this message]
2018-08-09  2:37 ` [PATCH mlx5-next 0/6] Mellanox, mlx5 next updates 2018-08-09 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180808232353.15514-7-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=eli@mellanox.com \
    --cc=jgg@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).