diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2017-12-01 11:01:47 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-03 10:10:02 -0500 |
commit | a7f99d0f2bbfe3b42ce398cdd37a97762e72cb56 (patch) | |
tree | ae1c99cb331fc717f3333cb3c4ce3b9fb57441a9 /drivers/net/hyperv/rndis_filter.c | |
parent | hv_netvsc: replace divide with mask when computing padding (diff) | |
download | linux-dev-a7f99d0f2bbfe3b42ce398cdd37a97762e72cb56.tar.xz linux-dev-a7f99d0f2bbfe3b42ce398cdd37a97762e72cb56.zip |
hv_netvsc: use reciprocal divide to speed up percent calculation
Every packet sent checks the available ring space. The calculation
can be sped up by using reciprocal divide which is multiplication.
Since ring_size can only be configured by module parameter, so it doesn't
have to be passed around everywhere. Also it should be unsigned
since it is number of pages.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/hyperv/rndis_filter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 7b637c7dd1e5..673492063307 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -1040,8 +1040,8 @@ static void netvsc_sc_open(struct vmbus_channel *new_sc) /* Set the channel before opening.*/ nvchan->channel = new_sc; - ret = vmbus_open(new_sc, nvscdev->ring_size * PAGE_SIZE, - nvscdev->ring_size * PAGE_SIZE, NULL, 0, + ret = vmbus_open(new_sc, netvsc_ring_bytes, + netvsc_ring_bytes, NULL, 0, netvsc_channel_cb, nvchan); if (ret == 0) napi_enable(&nvchan->napi); |