Skip to content

Commit 24d7239

Browse files
Oleg KuporosovIlan Smith
authored andcommitted
issue: 1115999 Fix DUMMY_SEND packets in new PostSend PRM
DUMMY_SEND packets should go to adapter with MLX5_OPCODE_NOP while new PostSend forced MLX5_OPCODE_SEND. The fix is to use OPCODE set in WR and translate it to MLX5_OPCODE_* values. Signed-off-by: Oleg Kuporosov <[email protected]>
1 parent fd1e74d commit 24d7239

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/vma/dev/qp_mgr_eth_mlx5.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#define qp_logfunc __log_info_func
5151
#define qp_logfuncall __log_info_funcall
5252

53+
//#define DBG_DUMP_WQE 1
54+
5355
#ifdef DBG_DUMP_WQE
5456
#define dbg_dump_wqe(addr, size) { \
5557
uint32_t* wqe = addr; \
@@ -410,6 +412,21 @@ inline int qp_mgr_eth_mlx5::fill_wqe(vma_ibv_send_wr *pswr)
410412
return 1;
411413
}
412414

415+
//! Maps vma_ibv_wr_opcode to real MLX5 opcode.
416+
//
417+
static inline uint32_t get_mlx5_opcode(vma_ibv_wr_opcode verbs_opcode)
418+
{
419+
switch (verbs_opcode) {
420+
case VMA_IBV_WR_NOP:
421+
return MLX5_OPCODE_NOP;
422+
423+
case VMA_IBV_WR_SEND:
424+
default:
425+
return MLX5_OPCODE_SEND;
426+
427+
}
428+
}
429+
413430
//! Send one RAW packet by MLX5 BlueFlame
414431
//
415432
int qp_mgr_eth_mlx5::send_to_wire(vma_ibv_send_wr *p_send_wqe, vma_wr_tx_packet_attr attr)
@@ -418,6 +435,8 @@ int qp_mgr_eth_mlx5::send_to_wire(vma_ibv_send_wr *p_send_wqe, vma_wr_tx_packet_
418435
struct mlx5_wqe_eth_seg* eth_seg = (struct mlx5_wqe_eth_seg*)((uint8_t*)m_sq_wqe_hot+sizeof(struct mlx5_wqe_ctrl_seg));
419436
eth_seg->cs_flags = (uint8_t)(attr & (VMA_TX_PACKET_L3_CSUM | VMA_TX_PACKET_L4_CSUM) & 0xff);
420437

438+
m_sq_wqe_hot->ctrl.data[0] = htonl((m_sq_wqe_counter << 8) | (get_mlx5_opcode(vma_send_wr_opcode(*p_send_wqe)) & 0xff) );
439+
421440
fill_wqe(p_send_wqe);
422441
m_sq_wqe_idx_to_wrid[m_sq_wqe_hot_index] = (uintptr_t)p_send_wqe->wr_id;
423442

@@ -432,7 +451,6 @@ int qp_mgr_eth_mlx5::send_to_wire(vma_ibv_send_wr *p_send_wqe, vma_wr_tx_packet_
432451
// Write only data[0] which is the single element which changes.
433452
// Other fields are already initialised in mlx5_init_sq.
434453
// memset(cur_seg, 0, 2*OCTOWORD);
435-
m_sq_wqe_hot->ctrl.data[0] = htonl((m_sq_wqe_counter << 8) | MLX5_OPCODE_SEND);
436454
m_sq_wqe_hot->ctrl.data[2] = m_n_unsignaled_count-1 == 0 ? htonl(8) : 0 ;
437455

438456
// Fill Ethernet segment with header inline

0 commit comments

Comments
 (0)