From 1be60f37d4eb1ca9987f26f4cfc4fda49d26ca3c Mon Sep 17 00:00:00 2001 From: chenyutao Date: Wed, 31 Dec 2025 14:59:23 +0800 Subject: [PATCH] urma: bug fix to exchange jetty info in RC trans_mode. Signed-off-by: chenyutao --- src/urma/lib/urma/core/include/urma_cmd.h | 2 ++ src/urma/lib/urma/core/include/urma_provider.h | 2 +- src/urma/lib/urma/core/urma_cmd.c | 4 +++- src/urma/lib/urma/core/urma_cmd_tlv.c | 2 ++ src/urma/lib/urma/core/urma_cmd_tlv.h | 2 ++ src/urma/lib/urma/core/urma_cp_api.c | 7 ++++--- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/urma/lib/urma/core/include/urma_cmd.h b/src/urma/lib/urma/core/include/urma_cmd.h index 5dda3e6..c2efac0 100644 --- a/src/urma/lib/urma/core/include/urma_cmd.h +++ b/src/urma/lib/urma/core/include/urma_cmd.h @@ -897,6 +897,8 @@ typedef struct urma_cmd_exchange_tp_info_t { struct urma_get_tp_cfg get_tp_cfg; uint64_t tp_handle; uint32_t tx_psn; + uint32_t src_jetty_id; + uint32_t dst_jetty_id; } in; struct { uint64_t peer_tp_handle; diff --git a/src/urma/lib/urma/core/include/urma_provider.h b/src/urma/lib/urma/core/include/urma_provider.h index 3edbcac..065c0dc 100644 --- a/src/urma/lib/urma/core/include/urma_provider.h +++ b/src/urma/lib/urma/core/include/urma_provider.h @@ -327,6 +327,6 @@ int urma_cmd_set_tp_attr(const urma_context_t *ctx, const uint64_t tp_handle, co int urma_cmd_get_tp_attr(const urma_context_t *ctx, const uint64_t tp_handle, uint8_t *tp_attr_cnt, uint32_t *tp_attr_bitmap, urma_tp_attr_value_t *tp_attr, urma_cmd_udrv_priv_t *udata); int urma_cmd_exchange_tp_info(urma_context_t *ctx, urma_get_tp_cfg_t *cfg, uint64_t local_tp_handle, uint32_t tx_psn, - uint64_t *peer_tp_handle, uint32_t *rx_psn); + uint64_t *peer_tp_handle, uint32_t *rx_psn, uint32_t src_jetty_id, uint32_t dst_jetty_id); #endif diff --git a/src/urma/lib/urma/core/urma_cmd.c b/src/urma/lib/urma/core/urma_cmd.c index a9921dd..fb4fbbe 100644 --- a/src/urma/lib/urma/core/urma_cmd.c +++ b/src/urma/lib/urma/core/urma_cmd.c @@ -2108,7 +2108,7 @@ int urma_cmd_get_tp_attr(const urma_context_t *ctx, const uint64_t tp_handle, ui } int urma_cmd_exchange_tp_info(urma_context_t *ctx, urma_get_tp_cfg_t *cfg, uint64_t local_tp_handle, uint32_t tx_psn, - uint64_t *peer_tp_handle, uint32_t *rx_psn) + uint64_t *peer_tp_handle, uint32_t *rx_psn, uint32_t src_jetty_id, uint32_t dst_jetty_id) { if (ctx == NULL || cfg == NULL || peer_tp_handle == NULL || rx_psn == NULL) { URMA_LOG_ERR("Invalid parameter.\n"); @@ -2119,6 +2119,8 @@ int urma_cmd_exchange_tp_info(urma_context_t *ctx, urma_get_tp_cfg_t *cfg, uint6 arg.in.get_tp_cfg = *cfg; arg.in.tp_handle = local_tp_handle; arg.in.tx_psn = tx_psn; + arg.in.src_jetty_id = src_jetty_id; + arg.in.dst_jetty_id = dst_jetty_id; int ret = urma_ioctl_exchange_tp_info(ctx->dev_fd, &arg); if (ret != URMA_SUCCESS) { diff --git a/src/urma/lib/urma/core/urma_cmd_tlv.c b/src/urma/lib/urma/core/urma_cmd_tlv.c index ade62a0..5e772d8 100644 --- a/src/urma/lib/urma/core/urma_cmd_tlv.c +++ b/src/urma/lib/urma/core/urma_cmd_tlv.c @@ -1057,6 +1057,8 @@ int urma_ioctl_exchange_tp_info(int ioctl_fd, urma_cmd_exchange_tp_info_t *arg) ATTR(a++, EXCHANGE_TP_INFO_IN_PEER_EID, arg->in.get_tp_cfg.peer_eid); ATTR(a++, EXCHANGE_TP_INFO_IN_TP_HANDLE, arg->in.tp_handle); ATTR(a++, EXCHANGE_TP_INFO_IN_TX_PSN, arg->in.tx_psn); + ATTR(a++, EXCHANGE_TP_INFO_IN_SRC_JETTY_ID, arg->in.src_jetty_id); + ATTR(a++, EXCHANGE_TP_INFO_IN_DST_JETTY_ID, arg->in.dst_jetty_id); ATTR(a++, EXCHANGE_TP_INFO_OUT_PEER_TP_HANDLE, arg->out.peer_tp_handle); ATTR(a++, EXCHANGE_TP_INFO_OUT_RX_PSN, arg->out.rx_psn); diff --git a/src/urma/lib/urma/core/urma_cmd_tlv.h b/src/urma/lib/urma/core/urma_cmd_tlv.h index 3183236..9e7c5e6 100644 --- a/src/urma/lib/urma/core/urma_cmd_tlv.h +++ b/src/urma/lib/urma/core/urma_cmd_tlv.h @@ -904,6 +904,8 @@ typedef enum urma_cmd_exchange_tp_info_type { EXCHANGE_TP_INFO_IN_PEER_EID, EXCHANGE_TP_INFO_IN_TP_HANDLE, EXCHANGE_TP_INFO_IN_TX_PSN, + EXCHANGE_TP_INFO_IN_SRC_JETTY_ID, + EXCHANGE_TP_INFO_IN_DST_JETTY_ID, EXCHANGE_TP_INFO_IN_NUM, /* Only for calculating number of types */ /* Out type */ EXCHANGE_TP_INFO_OUT_PEER_TP_HANDLE = URMA_CMD_OUT_TYPE_INIT, diff --git a/src/urma/lib/urma/core/urma_cp_api.c b/src/urma/lib/urma/core/urma_cp_api.c index 04d7e52..80242e0 100644 --- a/src/urma/lib/urma/core/urma_cp_api.c +++ b/src/urma/lib/urma/core/urma_cp_api.c @@ -556,8 +556,9 @@ static urma_target_jetty_t *urma_import_jfr_compat(urma_context_t *ctx, urma_rjf /* Only exchange tp info for RM TP */ if (trans_mode == URMA_TM_RM && rjfr->tp_type == URMA_RTP) { + /* Do not fill src_jetty_id/dst_jetty_id for RM mode */ int ret = urma_cmd_exchange_tp_info(ctx, &get_tp_cfg, active_tp_cfg.tp_handle, active_tp_cfg.tp_attr.tx_psn, - &active_tp_cfg.peer_tp_handle, &active_tp_cfg.tp_attr.rx_psn); + &active_tp_cfg.peer_tp_handle, &active_tp_cfg.tp_attr.rx_psn, 0, 0); if (ret != 0) { URMA_LOG_ERR("Failed to exchange tp info.\n"); errno = EIO; @@ -1084,7 +1085,7 @@ static urma_target_jetty_t *urma_import_jetty_compat(urma_context_t *ctx, urma_r /* Only exchange tp info for RM TP */ if (trans_mode == URMA_TM_RM && rjetty->tp_type == URMA_RTP) { int ret = urma_cmd_exchange_tp_info(ctx, &get_tp_cfg, active_tp_cfg.tp_handle, active_tp_cfg.tp_attr.tx_psn, - &active_tp_cfg.peer_tp_handle, &active_tp_cfg.tp_attr.rx_psn); + &active_tp_cfg.peer_tp_handle, &active_tp_cfg.tp_attr.rx_psn, 0, 0); if (ret != 0) { URMA_LOG_ERR("Failed to exchange tp info.\n"); errno = EIO; @@ -1200,7 +1201,7 @@ static urma_status_t urma_bind_jetty_compat(urma_jetty_t *jetty, urma_target_jet /* Only exchange tp info for RC TP */ if (tjetty->tp_type == URMA_RTP) { int ret = urma_cmd_exchange_tp_info(ctx, &get_tp_cfg, active_tp_cfg.tp_handle, active_tp_cfg.tp_attr.tx_psn, - &active_tp_cfg.peer_tp_handle, &active_tp_cfg.tp_attr.rx_psn); + &active_tp_cfg.peer_tp_handle, &active_tp_cfg.tp_attr.rx_psn, jetty->jetty_id.id, tjetty->id.id); if (ret != 0) { URMA_LOG_ERR("Failed to exchange tp info.\n"); return URMA_FAIL; -- Gitee