Skip to contentSkip to conversation

net/ena/base: fix LLQ feature version sent to device

PATCH Superseded Shai Brandes 1 participant 1 message Oct 18 Network drivers

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 6/13 net/ena/base: fix LLQ feature version sent to device

During LLQ configuration the driver reads the supported LLQ feature version from the device with a GET feature command, but leaves the feature_version field zeroed in the subsequent SET feature command.

The device therefore never learns which LLQ version the driver negotiated, and falls back to interpreting the configuration according to the base version regardless of what the driver actually agreed to, which can lead to a Tx descriptor layout mismatch between driver and device.

Store the feature version reported in the GET response and echo it back in the SET command so the negotiated version is communicated to the device.

Fixes b68309be44c0 ("net/ena/base: update communication layer for the ENAv2")
---
 drivers/net/ena/base/ena_com.c | 4 ++++
 drivers/net/ena/base/ena_com.h | 1 +
 2 files changed, 5 insertions(+)
drivers/net/ena/base/ena_com.c +4 -0
index e9b9de21cb..d3f1063b6c 100644
@@ -784,6 +784,8 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev)
 		BIT(ENA_ADMIN_DISABLE_META_CACHING) |
 		BIT(ENA_ADMIN_LIMIT_TX_BURST);
 
+	cmd.feat_common.feature_version = llq_info->feature_version;
+
 	ret = ena_com_execute_admin_command_no_resp(admin_queue,
 						    (struct ena_admin_aq_entry *)&cmd,
 						    sizeof(cmd));
@@ -805,6 +807,8 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev,
 
 	memset(llq_info, 0, sizeof(*llq_info));
 
+	llq_info->feature_version = llq_features->feature_version;
+
 	supported_feat = llq_features->header_location_ctrl_supported;
 
 	if (likely(supported_feat & llq_default_cfg->llq_header_location)) {
drivers/net/ena/base/ena_com.h +1 -0
index c62fecdef2..7884d0dfc3 100644
@@ -93,6 +93,7 @@ struct ena_com_llq_info {
 	u16 descs_per_entry;
 	u16 max_entries_in_tx_burst;
 	bool disable_meta_caching;
+	u8 feature_version;
 };
 
 struct ena_com_io_cq {
Signature · 1 line
2.17.1