Commit 9f5a9816 authored by Huazhong Tan's avatar Huazhong Tan Committed by David S. Miller

net: hns3: refactor hclge_config_tso()

Since parameters 'tso_mss_min' and 'tso_mss_max' only indicate
the minimum and maximum MSS, the hnae3_set_field() calls are
meaningless, remove them and change the type of these two
parameters to u16.
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 95163521
...@@ -1429,26 +1429,17 @@ static int hclge_configure(struct hclge_dev *hdev) ...@@ -1429,26 +1429,17 @@ static int hclge_configure(struct hclge_dev *hdev)
return ret; return ret;
} }
static int hclge_config_tso(struct hclge_dev *hdev, unsigned int tso_mss_min, static int hclge_config_tso(struct hclge_dev *hdev, u16 tso_mss_min,
unsigned int tso_mss_max) u16 tso_mss_max)
{ {
struct hclge_cfg_tso_status_cmd *req; struct hclge_cfg_tso_status_cmd *req;
struct hclge_desc desc; struct hclge_desc desc;
u16 tso_mss;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_TSO_GENERIC_CONFIG, false); hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_TSO_GENERIC_CONFIG, false);
req = (struct hclge_cfg_tso_status_cmd *)desc.data; req = (struct hclge_cfg_tso_status_cmd *)desc.data;
req->tso_mss_min = cpu_to_le16(tso_mss_min);
tso_mss = 0; req->tso_mss_max = cpu_to_le16(tso_mss_max);
hnae3_set_field(tso_mss, HCLGE_TSO_MSS_MIN_M,
HCLGE_TSO_MSS_MIN_S, tso_mss_min);
req->tso_mss_min = cpu_to_le16(tso_mss);
tso_mss = 0;
hnae3_set_field(tso_mss, HCLGE_TSO_MSS_MIN_M,
HCLGE_TSO_MSS_MIN_S, tso_mss_max);
req->tso_mss_max = cpu_to_le16(tso_mss);
return hclge_cmd_send(&hdev->hw, &desc, 1); return hclge_cmd_send(&hdev->hw, &desc, 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment