On 11/1/2024 2:56 AM, Stephen Hemminger wrote: > On Fri, 1 Nov 2024 01:22:47 +0000 > Ferruh Yigit <ferruh.yi...@amd.com> wrote: > >> Hi Jiawen, >> >> Above are generic checks, we may add this function to ethdev driver >> header (ethdev_driver.h) so that any PMD can use it, what do you think? > > This is in the fastpath, and additional checks should not be added there. > Or at least put them under RTE_ETHDEV_DEBUG. >
It is in the datapath, and ideally there shouldn't be error checks in datapath. But if HW does not check for errors and doesn't recover from error conditions, driver may prefer to get the hit and do the checks. Not for all drivers, but for the drivers that intentionally wants do the check, I thought having a common helper function helps but I can see it can create confusion. @Jiawen, please continue as it is in next version, I mean have the checks function in the driver itself.