[PATCH v1 03/14] net/zxdh: add agent channel
Stephen Hemminger
stephen at networkplumber.org
Mon Feb 10 18:30:47 CET 2025
On Mon, 10 Feb 2025 09:47:02 +0800
Bingbin Chen <chen.bingbin at zte.com.cn> wrote:
>
> +#define ZXDH_COMM_CHECK_DEV_RC_UNLOCK(dev_id, rc, becall, mutex)\
> +do {\
> + uint32_t temp_rc = rc;\
> + if ((temp_rc) != ZXDH_OK) {\
> + PMD_DRV_LOG(ERR, "ZXDH %s:%d [ErrorCode:0x%x]!-- %s"\
> + "Call %s Fail!", __FILE__, __LINE__, temp_rc, __func__, becall);\
> + if (zxdh_np_comm_mutex_unlock(mutex) != 0) { \
> + PMD_DRV_LOG(ERR, "File: [%s], Function:[%s], Line:%u mutex"\
> + "unlock failed!-->Return ERROR",\
> + __FILE__, __func__, __LINE__);\
> + } \
> + RTE_ASSERT(0);\
> + } \
> +} while (0)
Way to verbose and messy.
1. Your wrapper functions already log on error.
2. The messages are broken across lines and don't give any more information, just more words
3. The file and line is already logged by the PMD_DRV_LOG
4. RTE_ASSERT() is ignored unless RTE_ASSERT_DEBUG is enabled, and in that case it panics.
More information about the dev
mailing list