Commit 5a2f3aa
bnxt_en: Refactor bnxt_need_reserve_rings()
bnxt_need_reserve_rings() checks 6 ring resources against the reserved
values to determine if a new reservation is needed. Factor out the code
to collect the total resources into a new helper function
bnxt_get_total_resources() to make the code cleaner and easier to read.
Instead of individual scalar variables, use the struct bnxt_hw_rings to
hold all the ring resources. Using the struct, hwr.cp replaces the nq
variable and the chip specific hwr.cp_p5 replaces cp on newer chips.
There is no change in behavior. This will make it easier to check the
RSS context resource in the next patch.
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260207235118.1987301-2-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent e5e2e43 commit 5a2f3aa
1 file changed
Lines changed: 30 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7951 | 7951 | | |
7952 | 7952 | | |
7953 | 7953 | | |
| 7954 | + | |
| 7955 | + | |
| 7956 | + | |
| 7957 | + | |
| 7958 | + | |
| 7959 | + | |
| 7960 | + | |
| 7961 | + | |
| 7962 | + | |
| 7963 | + | |
| 7964 | + | |
| 7965 | + | |
| 7966 | + | |
| 7967 | + | |
| 7968 | + | |
7954 | 7969 | | |
7955 | 7970 | | |
7956 | 7971 | | |
7957 | | - | |
7958 | | - | |
7959 | | - | |
7960 | | - | |
| 7972 | + | |
| 7973 | + | |
| 7974 | + | |
7961 | 7975 | | |
7962 | 7976 | | |
7963 | 7977 | | |
| |||
7967 | 7981 | | |
7968 | 7982 | | |
7969 | 7983 | | |
7970 | | - | |
7971 | | - | |
| 7984 | + | |
7972 | 7985 | | |
7973 | 7986 | | |
7974 | 7987 | | |
7975 | 7988 | | |
7976 | 7989 | | |
7977 | | - | |
7978 | | - | |
7979 | | - | |
7980 | | - | |
7981 | | - | |
7982 | | - | |
7983 | | - | |
7984 | | - | |
| 7990 | + | |
| 7991 | + | |
| 7992 | + | |
| 7993 | + | |
7985 | 7994 | | |
7986 | 7995 | | |
| 7996 | + | |
| 7997 | + | |
| 7998 | + | |
| 7999 | + | |
| 8000 | + | |
| 8001 | + | |
7987 | 8002 | | |
7988 | | - | |
| 8003 | + | |
7989 | 8004 | | |
7990 | 8005 | | |
7991 | 8006 | | |
| |||
0 commit comments