Commit 730b3ab
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>1 parent 4aa3b76 commit 730b3ab
1 file changed
+2
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
| 943 | + | |
947 | 944 | | |
948 | 945 | | |
949 | 946 | | |
| |||
1014 | 1011 | | |
1015 | 1012 | | |
1016 | 1013 | | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
| 1014 | + | |
1021 | 1015 | | |
1022 | 1016 | | |
1023 | 1017 | | |
| |||
0 commit comments