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")
Cc: [email protected]

Signed-off-by: Shai Brandes <[email protected]>
---
 drivers/net/ena/base/ena_com.c | 4 ++++
 drivers/net/ena/base/ena_com.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 9a118394d2..d218026220 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -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)) {
diff --git a/drivers/net/ena/base/ena_com.h b/drivers/net/ena/base/ena_com.h
index c4b4ea0620..e05933d6fe 100644
--- a/drivers/net/ena/base/ena_com.h
+++ b/drivers/net/ena/base/ena_com.h
@@ -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 {
-- 
2.17.1

Reply via email to