It has been suggested [1] that a major cleanup/rewrite of devbind would be beneficial in terms of long term maintainability of the code. I was in a coding mood over the weekend, and so I've went ahead and rewritten devbind.
Note that this is one giant patch, rather than a series of patches adjusting existing code. Making it a patch series is possible, however the internal code architecture diverges quite significantly from the original devbind script due to its copious usage of string operations/pattern matching and global variables, so it is unclear whether subdividing this patch would be worth the effort. Instead, as has been suggested [2], the patchset now consists of creating a new file, followed by a removal of old file and rename of the new file. It is expected that this will be squashed on apply. The script has become slightly bigger - 1000 lines instead of 800, however I would argue that since most of that increase is infrastructure, comments, and sacrificing code golf for code readability (such as expanding one-liners into multiple lines), the trade-off between being able to read and reason about what happens in the script is worth the added line count. [1] https://patches.dpdk.org/project/dpdk/patch/c2bf00195c2d43833a831a9cc9346b4606d6ea2e.1723810613.git.anatoly.bura...@intel.com/ [2] https://patches.dpdk.org/project/dpdk/cover/cover.1733151400.git.anatoly.bura...@intel.com/ Anatoly Burakov (2): usertools/devbind: update coding style usertools/devbind: replace devbind doc/guides/tools/devbind.rst | 11 + usertools/dpdk-devbind.py | 1683 ++++++++++++++++++---------------- 2 files changed, 924 insertions(+), 770 deletions(-) -- 2.43.5