net: hns3: modify an incorrect type in struct hclgevf_cfg_gro_status_cmd
authorHuazhong Tan <tanhuazhong@huawei.com>
Thu, 28 May 2020 13:48:13 +0000 (21:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 May 2020 23:39:03 +0000 (16:39 -0700)
Modify field .gro_en in struct hclgevf_cfg_gro_status_cmd to u8
according to the UM, otherwise, it will overwrite the reserved
byte which may be used for other purpose.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index f830eef..40d6e60 100644 (file)
@@ -161,8 +161,8 @@ struct hclgevf_query_res_cmd {
 
 #define HCLGEVF_GRO_EN_B               0
 struct hclgevf_cfg_gro_status_cmd {
-       __le16 gro_en;
-       u8 rsv[22];
+       u8 gro_en;
+       u8 rsv[23];
 };
 
 #define HCLGEVF_RSS_DEFAULT_OUTPORT_B  4
index 59fcb80..be5789b 100644 (file)
@@ -2403,7 +2403,7 @@ static int hclgevf_config_gro(struct hclgevf_dev *hdev, bool en)
                                     false);
        req = (struct hclgevf_cfg_gro_status_cmd *)desc.data;
 
-       req->gro_en = cpu_to_le16(en ? 1 : 0);
+       req->gro_en = en ? 1 : 0;
 
        ret = hclgevf_cmd_send(&hdev->hw, &desc, 1);
        if (ret)