From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28668C61DBE for ; Thu, 27 Aug 2026 02:40:33 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 916F240E20; Thu, 27 Aug 2026 04:40:17 +0200 (CEST) Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by mails.dpdk.org (Postfix) with ESMTP id D377840DDB for ; Thu, 27 Aug 2026 04:39:56 +0200 (CEST) Received: from localhost.localdomain (unknown [118.112.177.181]) by APP-01 (Coremail) with SMTP id qwCowACnQPR7o49qQJWjBg--.25375S2; Thu, 27 Aug 2026 10:39:55 +0800 (CST) From: liujie5@linkdatatechnology.com To: stephen@networkplumber.org Cc: dev@dpdk.org Subject: [PATCH v4 37/44] net/sxe2: wrap command params fill debug log in macro Date: Thu, 27 Aug 2026 10:39:54 +0800 Message-ID: <20260827023954.1431875-1-liujie5@linkdatatechnology.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260826085836.993490-1-liujie5@linkdatatechnology.com> References: <20260826085836.993490-1-liujie5@linkdatatechnology.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowACnQPR7o49qQJWjBg--.25375S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Kr18Cw15ury7tF48tryfXrb_yoW8Zw18pF WFvw1YqFs0qF4UArn7Jr4xZa4aka1UAa4j9a1jgw1S9F9rXrykZFWUKryrK3WUuwsIqF1F yF4qgay8Wr1xXrUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUk2b7Iv0xC_Cr1lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84ACjcxK6I 8E87Iv6xkF7I0E14v26r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280aVAFwI0_Gr0_Cr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4kE6xkIj40Ew7xC0wCF04k2 0xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI 8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41l IxAIcVC0I7IYx2IY67AKxVW5JVW7JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMI IF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E 87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUVNtxUUUUU X-Originating-IP: [118.112.177.181] X-CM-SenderInfo: xolxyxrhv6zxpqngt3pdwhux5qro0w31of0z/ X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jie Liu sxe2_drv_cmd_params_fill() passes the opcode string as a parameter to __sxe2_drv_cmd_params_fill() just to emit a debug log, and the debug log is executed unconditionally on every command fill. Move the PMD_DEV_LOG_DEBUG into the macro body wrapped in a do/while block, dropping the opc_str parameter so the opcode stringization is performed at the call site and the macro is a proper multi-statement block. Cc: stephen@networkplumber.org Signed-off-by: Jie Liu --- drivers/net/sxe2/sxe2_cmd_chnl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/sxe2/sxe2_cmd_chnl.c b/drivers/net/sxe2/sxe2_cmd_chnl.c index 705d259412..b17d80d917 100644 --- a/drivers/net/sxe2/sxe2_cmd_chnl.c +++ b/drivers/net/sxe2/sxe2_cmd_chnl.c @@ -26,10 +26,9 @@ static void sxe2_drv_trace_id_alloc(uint64_t *trace_id) } static void __sxe2_drv_cmd_params_fill(struct sxe2_adapter *adapter, - struct sxe2_drv_cmd_params *cmd, uint32_t opc, const char *opc_str, + struct sxe2_drv_cmd_params *cmd, uint32_t opc, void *in_data, uint32_t in_len, void *out_data, uint32_t out_len) { - PMD_DEV_LOG_DEBUG(adapter, DRV, "cmd opcode:%s", opc_str); cmd->timeout = SXE2_DRV_CMD_DFLT_TIMEOUT; cmd->opcode = opc; cmd->vsi_id = adapter->vsi_ctxt.dpdk_vsi_id; @@ -44,8 +43,10 @@ static void __sxe2_drv_cmd_params_fill(struct sxe2_adapter *adapter, } #define sxe2_drv_cmd_params_fill(adapter, cmd, opc, in_data, in_len, out_data, out_len) \ - __sxe2_drv_cmd_params_fill(adapter, cmd, opc, #opc, in_data, in_len, out_data, out_len) - + do { \ + PMD_DEV_LOG_DEBUG(adapter, DRV, "cmd opcode:%s", #opc); \ + __sxe2_drv_cmd_params_fill(adapter, cmd, opc, in_data, in_len, out_data, out_len); \ + } while (0) int32_t sxe2_drv_dev_caps_get(struct sxe2_adapter *adapter, struct sxe2_drv_dev_caps_resp *dev_caps) { -- 2.52.0