diff --git a/src/urma/lib/urma/core/include/urma_cmd.h b/src/urma/lib/urma/core/include/urma_cmd.h index 5dda3e6fd18600c253c5e098d50e6ad9b557b445..c2efac0362379f220ba18627d2bfd1cfc5ec156b 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 3edbcaca1e0e69911fbd93dee2cab169eff72b78..065c0dc99e8138dace3fe1ae273b53623f5b5aac 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 a9921dda5488e97ad200b25180ffe77bed246f6f..fb4fbbe4222c0a4c381896447bfc1103d5f7153b 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 ade62a07188251f22f9743f3a280fe771058a634..5e772d8c0114823e01a483d1a97ddd66492c87d0 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 318323685591ed036b62be95ca3bcc8e101ba737..9e7c5e6d578cc9762c0098771b39e7bc53b32b00 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 04d7e526ccd8f7c7548b03c373a483c9505b558d..80242e04f3098d80ee839732278b0d6fee2da94a 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;