Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libibverbs/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,10 @@ int ibv_init_ah_from_wc(struct ibv_context *context, uint8_t port_num,

if (wc->wc_flags & IBV_WC_GRH) {
ah_attr->is_global = 1;
version = get_grh_header_version(grh);
if (wc->wc_flags & IBV_WC_WITH_NETWORK_HDR_TYPE)
version = (wc->wc_flags & IBV_WC_NETWORK_HDR_IPV6) ? 6 : 4;
else
version = get_grh_header_version(grh);

if (version == 4)
ret = set_ah_attr_by_ipv4(context, ah_attr,
Expand Down
2 changes: 2 additions & 0 deletions libibverbs/verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ enum ibv_wc_flags {
IBV_WC_TM_SYNC_REQ = 1 << 4,
IBV_WC_TM_MATCH = 1 << 5,
IBV_WC_TM_DATA_VALID = 1 << 6,
IBV_WC_WITH_NETWORK_HDR_TYPE = 1 << 7,

@rleon rleon May 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is user API enum. You should find a way to solve intel HW bug without exposing it to the users.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The challenge is that we cannot safely fix the GRH payload inside the provider:

  • At poll time (irdma_process_cqe): Even if the provider retrieves the buffer address, it cannot assume the memory is actually CPU-accessible.
  • At AH creation (ibv_init_ah_from_wc): The application provides a valid, CPU-accessible grh pointer, but by then we are in the core library. The hardware has already zeroed the checksum during Rx offload, causing the software heuristic to fail.

Since modifying the payload in poll_cq isn't viable, and extending wc_flags is undesirable, may I ask for your advice on how to best resolve this issue, assuming we cannot fix the zero checksum in HW?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that if you know what HW has limitation, you can internally store some mark in the irdma_ucontext/irdma_device and perform right flow based on that mark. If you need some help from the libibverbs, it is fine, we can do it. I just don't want to see this behavior is leaked to the applications.

Your PR is actually doing that conceptually, but implementation needs to be changed.

Thanks

IBV_WC_NETWORK_HDR_IPV6 = 1 << 8,
};

struct ibv_wc {
Expand Down
4 changes: 3 additions & 1 deletion providers/irdma/uverbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,9 @@ static void irdma_process_cqe(struct ibv_wc *entry, struct irdma_cq_poll_info *c

if (ib_qp->qp_type == IBV_QPT_UD) {
entry->src_qp = cur_cqe->ud_src_qpn;
entry->wc_flags |= IBV_WC_GRH;
entry->wc_flags |= (IBV_WC_GRH | IBV_WC_WITH_NETWORK_HDR_TYPE);
if (!cur_cqe->ipv4)
entry->wc_flags |= IBV_WC_NETWORK_HDR_IPV6;
} else {
entry->src_qp = cur_cqe->qp_id;
}
Expand Down