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)
commit730b3ab54af4f816cdf541a23c879c9379a480db
treed82997a70b766e41ee5a61be0eda23d1d0a905db
parent4aa3b7660aa79bb030aaa887dc16a60e02fa4348
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