@@ -230,6 +230,14 @@ int ibv_cmd_query_device_ex(struct ibv_context *context,
attr->max_wq_type_rq = resp->max_wq_type_rq;
}
+ if (attr_size >= offsetof(struct ibv_device_attr_ex, raw_packet_caps) +
+ sizeof(attr->raw_packet_caps)) {
+ if (resp->response_length >=
+ offsetof(struct ibv_query_device_resp_ex, raw_packet_caps) +
+ sizeof(resp->raw_packet_caps))
+ attr->raw_packet_caps = resp->raw_packet_caps;
+ }
+
return 0;
}
@@ -401,6 +401,17 @@ static void print_packet_pacing_caps(const struct ibv_packet_pacing_caps *caps)
}
}
+static void print_raw_packet_caps(uint32_t raw_packet_caps)
+{
+ printf("\traw packet caps:\n");
+ if (raw_packet_caps & IBV_RAW_PACKET_CAP_CVLAN_STRIPPING)
+ printf("\t\t\t\t\tC-VLAN stripping offload\n");
+ if (raw_packet_caps & IBV_RAW_PACKET_CAP_SCATTER_FCS)
+ printf("\t\t\t\t\tScatter FCS offload\n");
+ if (raw_packet_caps & IBV_RAW_PACKET_CAP_IP_CSUM)
+ printf("\t\t\t\t\tIP csum offload\n");
+}
+
static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
{
struct ibv_context *ctx;
@@ -499,6 +510,9 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
else
printf("\tcore clock not supported\n");
+ if (device_attr.raw_packet_caps)
+ print_raw_packet_caps(device_attr.raw_packet_caps);
+
printf("\tdevice_cap_flags_ex:\t\t0x%" PRIX64 "\n", device_attr.device_cap_flags_ex);
print_device_cap_flags_ex(device_attr.device_cap_flags_ex);
print_tso_caps(&device_attr.tso_caps);
@@ -290,7 +290,7 @@ struct ibv_query_device_resp_ex {
__u64 device_cap_flags_ex;
struct ibv_rss_caps_resp rss_caps;
__u32 max_wq_type_rq;
- __u32 reserved;
+ __u32 raw_packet_caps;
};
struct ibv_query_port {
@@ -32,6 +32,7 @@ struct ibv_tso_caps tso_caps; /* TCP segmentation offload c
struct ibv_rss_caps rss_caps; /* RSS capabilities */
uint32_t max_wq_type_rq; /* Max Work Queue from type RQ */
struct ibv_packet_pacing_caps packet_pacing_caps; /* Packet pacing capabilities */
+uint32_t raw_packet_caps; /* Raw packet capabilities, use enum ibv_raw_packet_caps */
.in -8
};
@@ -75,6 +76,14 @@ struct ibv_packet_pacing_caps {
uint32_t supported_qpts; /* Bitmap showing which QP types are supported. */
};
+enum ibv_raw_packet_caps {
+.in +8
+IBV_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0, /* CVLAN stripping is supported */
+IBV_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1, /* FCS scattering is supported */
+IBV_RAW_PACKET_CAP_IP_CSUM = 1 << 2, /* IP CSUM offload is supported */
+.in -8
+};
+
.fi
.SH "RETURN VALUE"
.B ibv_query_device_ex()
@@ -252,6 +252,12 @@ struct ibv_packet_pacing_caps {
uint32_t supported_qpts;
};
+enum ibv_raw_packet_caps {
+ IBV_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
+ IBV_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
+ IBV_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
+};
+
struct ibv_device_attr_ex {
struct ibv_device_attr orig_attr;
uint32_t comp_mask;
@@ -263,6 +269,7 @@ struct ibv_device_attr_ex {
struct ibv_rss_caps rss_caps;
uint32_t max_wq_type_rq;
struct ibv_packet_pacing_caps packet_pacing_caps;
+ uint32_t raw_packet_caps; /* Use ibv_raw_packet_caps */
};
enum ibv_mtu {