On Feb 17, 2024 / 00:50, Chaitanya Kulkarni wrote: > > +_nvme_passthru_logging_setup() > > +{ > > + ctrl_dev_passthru_logging=$(cat /sys/class/nvme/"$2"/passthru_err_log_enabled) > > + ns_dev_passthru_logging=$(cat /sys/class/nvme/"$2"/"$1"/passthru_err_log_enabled) > > + > > + _nvme_disable_passthru_admin_error_logging "$2" > > + _nvme_disable_passthru_io_error_logging "$1" "$2" > > +} > > + > > +_nvme_passthru_logging_cleanup() > > +{ > > + echo $ctrl_dev_passthru_logging > /sys/class/nvme/"$2"/passthru_err_log_enabled > > + echo $ns_dev_passthru_logging > /sys/class/nvme/"$2"/"$1"/passthru_err_log_enabled > > +} > > > > _nvme_err_inject_setup() > > { > > @@ -985,6 +1002,26 @@ _nvme_disable_err_inject() > > echo 0 > /sys/kernel/debug/"$1"/fault_inject/times > > } > > > > +_nvme_enable_passthru_admin_error_logging() > > +{ > > + echo on > /sys/class/nvme/"$1"/passthru_err_log_enabled > > +} > > + > > +_nvme_enable_passthru_io_error_logging() > > +{ > > + echo on > /sys/class/nvme/"$2"/"$1"/passthru_err_log_enabled > > +} > > + > > +_nvme_disable_passthru_admin_error_logging() > > +{ > > + echo off > /sys/class/nvme/"$1"/passthru_err_log_enabled > > +} > > + > > +_nvme_disable_passthru_io_error_logging() > > +{ > > + echo off > /sys/class/nvme/"$2"/"$1"/passthru_err_log_enabled > > +} > > + > > > > Thanks for the test, let's move these helper testcase itself if we get > second testcase ? I'd not bloat nvme rc file unless we have another > user for these function, also if you move these to testcase itself > then you don't really need to make these as a function ... FYI, we already have similar helper functions in nvme/rc: _nvme_err_inject_setup() _nvme_err_inject_cleanup() _nvme_enable_err_inject() _nvme_disable_err_inject() In the past, it was discussed where to place these functions and we concluded to place them in nvme/rc rather than nvme/039, so that they can be used in other test cases [1]. I guess Alan placed the new helper functions in nvme/rc to be consistent with the existing functions. [1] https://lore.kernel.org/linux-block/20220512115457.hoa6lhk4as63xrq3@shindev/