Skip to content

Commit 527a058

Browse files
author
Maxim Levitsky
committed
net: mana: Handle unsupported HWC commands
JIRA: https://issues.redhat.com/browse/RHEL-109583 commit ca8ac48 Author: Erni Sri Satya Vennela <ernis@linux.microsoft.com> Date: Tue Jun 17 00:17:36 2025 -0700 net: mana: Handle unsupported HWC commands If any of the HWC commands are not recognized by the underlying hardware, the hardware returns the response header status of -1. Log the information using netdev_info_once to avoid multiple error logs in dmesg. Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com> Reviewed-by: Saurabh Singh Sengar <ssengar@linux.microsoft.com> Reviewed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com> Link: https://patch.msgid.link/1750144656-2021-5-git-send-email-ernis@linux.microsoft.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Conflict: missing 'net: mana: Add support for net_shaper_ops' Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
1 parent a4523ed commit 527a058

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

drivers/net/ethernet/microsoft/mana/hw_channel.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,10 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,
890890
}
891891

892892
if (ctx->status_code && ctx->status_code != GDMA_STATUS_MORE_ENTRIES) {
893+
if (ctx->status_code == GDMA_STATUS_CMD_UNSUPPORTED) {
894+
err = -EOPNOTSUPP;
895+
goto out;
896+
}
893897
if (req_msg->req.msg_type != MANA_QUERY_PHY_STAT)
894898
dev_err(hwc->dev, "HWC: Failed hw_channel req: 0x%x\n",
895899
ctx->status_code);

drivers/net/ethernet/microsoft/mana/mana_en.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,9 @@ static int mana_send_request(struct mana_context *ac, void *in_buf,
773773
err = mana_gd_send_request(gc, in_len, in_buf, out_len,
774774
out_buf);
775775
if (err || resp->status) {
776+
if (err == -EOPNOTSUPP)
777+
return err;
778+
776779
if (req->req.msg_type != MANA_QUERY_PHY_STAT)
777780
dev_err(dev, "Failed to send mana message: %d, 0x%x\n",
778781
err, resp->status);

include/net/mana/gdma.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "shm_channel.h"
1111

1212
#define GDMA_STATUS_MORE_ENTRIES 0x00000105
13+
#define GDMA_STATUS_CMD_UNSUPPORTED 0xffffffff
1314

1415
/* Structures labeled with "HW DATA" are exchanged with the hardware. All of
1516
* them are naturally aligned and hence don't need __packed.

0 commit comments

Comments
 (0)