Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix get_mode #17

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions get_mode
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def main():
parser.add_argument('-v', '--verbose', dest='verbose',
default=False, action='store', type=bool,
help='Enable verbose output. This will show the settings')
parser.add_argument('-n', '--next_boot', action='store_true',
help='Get the next_boot mode of the BF')
args = parser.parse_args()

bf = common_bf.find_bf_pci_addresses_or_quit(args.id)
Expand All @@ -21,7 +23,7 @@ def main():
"INTERNAL_CPU_OFFLOAD_ENGINE"
]
all_cfg = " ".join(cfg)
ret = common_bf.run(f"mstconfig -d {bf} q {all_cfg}").out
ret = common_bf.run(f"mstconfig -e -d {bf} q {all_cfg}").out

save_next = False
settings = {}
Expand All @@ -31,8 +33,12 @@ def main():
if e.startswith("Configurations:"):
save_next = True
elif save_next:
k, v = e.split()
settings[k] = v.split("(")[1].split(")")[0]
if "different from default/current" in e:
save_next = False
continue
k, default, current, next_boot = e.lstrip('*').split()
config = next_boot if args.next_boot else current
settings[k] = config.split("(")[1].split(")")[0]

dpu_mode = {
'INTERNAL_CPU_MODEL': '1',
Expand Down
Loading