From: Jakub Kicinski <hidden> Date: 2017-12-07 02:33:44
On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote:
- Handled debugfs_create_dir failure in nsim_init()
- Fixed return value of nsim_module_init() when debugfs_create_dir fails
Signed-off-by: Prashant Bhole <redacted>
Why? Failing to expose the state via DebugFS is not fatal to the
driver.
From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote:
quoted
- Handled debugfs_create_dir failure in nsim_init()
- Fixed return value of nsim_module_init() when debugfs_create_dir
fails
Signed-off-by: Prashant Bhole <redacted>
Why? Failing to expose the state via DebugFS is not fatal to the driver.
Ok, my intention was to handle the return code properly, which is not needed
as per your comment.
Shall I remove the existing handling in nsim_module_init() in separate
patch? Because it will prevent netdevsim from loading when debugfs is
disabled.
Thanks,
Prashant
From: Jakub Kicinski <hidden> Date: 2017-12-07 06:05:30
On Thu, 7 Dec 2017 13:10:39 +0900, Prashant Bhole wrote:
quoted
From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote:
quoted
- Handled debugfs_create_dir failure in nsim_init()
- Fixed return value of nsim_module_init() when debugfs_create_dir
fails
Signed-off-by: Prashant Bhole <redacted>
Why? Failing to expose the state via DebugFS is not fatal to the driver.
Ok, my intention was to handle the return code properly, which is not needed
as per your comment.
Shall I remove the existing handling in nsim_module_init() in separate
patch?
I was going back and forth on the error handling quite a bit writing
that code. In the end I decided to leave the module_init check and
check for bpf prog directory. Former one is mostly useful to make sure
the is no duplicate directory with the same name, the latter to limit
possible false positive in the selftest..
Because it will prevent netdevsim from loading when debugfs is disabled.
Note that netdevsim depends on DEBUG_FS:
config NETDEVSIM
tristate "Simulated networking device"
depends on DEBUG_FS
From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
On Thu, 7 Dec 2017 13:10:39 +0900, Prashant Bhole wrote:
quoted
quoted
From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote:
quoted
- Handled debugfs_create_dir failure in nsim_init()
- Fixed return value of nsim_module_init() when debugfs_create_dir
fails
Signed-off-by: Prashant Bhole <redacted>
Why? Failing to expose the state via DebugFS is not fatal to the
driver.
quoted
Ok, my intention was to handle the return code properly, which is not
needed as per your comment.
Shall I remove the existing handling in nsim_module_init() in separate
patch?
I was going back and forth on the error handling quite a bit writing that
code. In
the end I decided to leave the module_init check and check for bpf prog
directory. Former one is mostly useful to make sure the is no duplicate
directory
with the same name, the latter to limit possible false positive in the
selftest..
Ok. Currently return value is checked with IS_ERR(). But when Debug FS is
enabled, debugfs_create_dir will never return error value. It returns either
NULL or a valid pointer. Shall I replace IS_ERR with NULL check or
IS_ERR_OR_NULL check?
-Prashant
From: Jakub Kicinski <hidden> Date: 2017-12-07 21:20:57
On Thu, 7 Dec 2017 17:56:37 +0900, Prashant Bhole wrote:
quoted
From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
On Thu, 7 Dec 2017 13:10:39 +0900, Prashant Bhole wrote:
quoted
quoted
From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote:
quoted
- Handled debugfs_create_dir failure in nsim_init()
- Fixed return value of nsim_module_init() when debugfs_create_dir
fails
Signed-off-by: Prashant Bhole <redacted>
Why? Failing to expose the state via DebugFS is not fatal to the driver.
Ok, my intention was to handle the return code properly, which is not
needed as per your comment.
Shall I remove the existing handling in nsim_module_init() in separate
patch?
I was going back and forth on the error handling quite a bit writing that code. In
the end I decided to leave the module_init check and check for bpf prog
directory. Former one is mostly useful to make sure the is no duplicate directory
with the same name, the latter to limit possible false positive in the selftest..
Ok. Currently return value is checked with IS_ERR(). But when Debug FS is
enabled, debugfs_create_dir will never return error value. It returns either
NULL or a valid pointer. Shall I replace IS_ERR with NULL check or
IS_ERR_OR_NULL check?