]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: eliminate an if statement in calculation of completed frames
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 16 May 2017 00:55:23 +0000 (17:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 May 2017 16:59:04 +0000 (12:59 -0400)
commit601e363409a4020b5679ea77f273b1230479c777
treed82997a70b766e41ee5a61be0eda23d1d0a905db
parent60f1c403981f024210ddac18d1409093e01f7b90
nfp: eliminate an if statement in calculation of completed frames

Given that our rings are always a power of 2, we can simplify the
calculation of number of completed TX descriptors by using masking
instead of if statement based on whether the index have wrapped
or not.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c