Commit ca8ac489 authored by Erni Sri Satya Vennela's avatar Erni Sri Satya Vennela Committed by Paolo Abeni
Browse files

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: default avatarErni Sri Satya Vennela <ernis@linux.microsoft.com>
Reviewed-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: default avatarShradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: default avatarSaurabh Singh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: default avatarDipayaan Roy <dipayanroy@linux.microsoft.com>
Link: https://patch.msgid.link/1750144656-2021-5-git-send-email-ernis@linux.microsoft.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent a6d5edf1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -891,6 +891,10 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,
	}

	if (ctx->status_code && ctx->status_code != GDMA_STATUS_MORE_ENTRIES) {
		if (ctx->status_code == GDMA_STATUS_CMD_UNSUPPORTED) {
			err = -EOPNOTSUPP;
			goto out;
		}
		if (req_msg->req.msg_type != MANA_QUERY_PHY_STAT)
			dev_err(hwc->dev, "HWC: Failed hw_channel req: 0x%x\n",
				ctx->status_code);
+11 −0
Original line number Diff line number Diff line
@@ -847,6 +847,9 @@ static int mana_send_request(struct mana_context *ac, void *in_buf,
	err = mana_gd_send_request(gc, in_len, in_buf, out_len,
				   out_buf);
	if (err || resp->status) {
		if (err == -EOPNOTSUPP)
			return err;

		if (req->req.msg_type != MANA_QUERY_PHY_STAT)
			dev_err(dev, "Failed to send mana message: %d, 0x%x\n",
				err, resp->status);
@@ -1252,6 +1255,10 @@ int mana_query_link_cfg(struct mana_port_context *apc)
				sizeof(resp));

	if (err) {
		if (err == -EOPNOTSUPP) {
			netdev_info_once(ndev, "MANA_QUERY_LINK_CONFIG not supported\n");
			return err;
		}
		netdev_err(ndev, "Failed to query link config: %d\n", err);
		return err;
	}
@@ -1294,6 +1301,10 @@ int mana_set_bw_clamp(struct mana_port_context *apc, u32 speed,
				sizeof(resp));

	if (err) {
		if (err == -EOPNOTSUPP) {
			netdev_info_once(ndev, "MANA_SET_BW_CLAMP not supported\n");
			return err;
		}
		netdev_err(ndev, "Failed to set bandwidth clamp for speed %u, err = %d",
			   speed, err);
		return err;
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include "shm_channel.h"

#define GDMA_STATUS_MORE_ENTRIES	0x00000105
#define GDMA_STATUS_CMD_UNSUPPORTED	0xffffffff

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