net: hns3: Modify parameter type from int to bool in set_gro_en
The second parameter to the hook function set_gro_en is always passed in true/false, so modify it's type from int to bool. Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6241e71e72
commit
1731be4c73
4 changed files with 12 additions and 20 deletions
|
@ -461,7 +461,7 @@ struct hnae3_ae_ops {
|
||||||
bool (*get_hw_reset_stat)(struct hnae3_handle *handle);
|
bool (*get_hw_reset_stat)(struct hnae3_handle *handle);
|
||||||
bool (*ae_dev_resetting)(struct hnae3_handle *handle);
|
bool (*ae_dev_resetting)(struct hnae3_handle *handle);
|
||||||
unsigned long (*ae_dev_reset_cnt)(struct hnae3_handle *handle);
|
unsigned long (*ae_dev_reset_cnt)(struct hnae3_handle *handle);
|
||||||
int (*set_gro_en)(struct hnae3_handle *handle, int enable);
|
int (*set_gro_en)(struct hnae3_handle *handle, bool enable);
|
||||||
u16 (*get_global_queue_id)(struct hnae3_handle *handle, u16 queue_id);
|
u16 (*get_global_queue_id)(struct hnae3_handle *handle, u16 queue_id);
|
||||||
void (*set_timer_task)(struct hnae3_handle *handle, bool enable);
|
void (*set_timer_task)(struct hnae3_handle *handle, bool enable);
|
||||||
int (*mac_connect_phy)(struct hnae3_handle *handle);
|
int (*mac_connect_phy)(struct hnae3_handle *handle);
|
||||||
|
|
|
@ -1349,6 +1349,7 @@ static int hns3_nic_set_features(struct net_device *netdev,
|
||||||
netdev_features_t changed = netdev->features ^ features;
|
netdev_features_t changed = netdev->features ^ features;
|
||||||
struct hns3_nic_priv *priv = netdev_priv(netdev);
|
struct hns3_nic_priv *priv = netdev_priv(netdev);
|
||||||
struct hnae3_handle *h = priv->ae_handle;
|
struct hnae3_handle *h = priv->ae_handle;
|
||||||
|
bool enable;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (changed & (NETIF_F_TSO | NETIF_F_TSO6)) {
|
if (changed & (NETIF_F_TSO | NETIF_F_TSO6)) {
|
||||||
|
@ -1359,38 +1360,29 @@ static int hns3_nic_set_features(struct net_device *netdev,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed & (NETIF_F_GRO_HW) && h->ae_algo->ops->set_gro_en) {
|
if (changed & (NETIF_F_GRO_HW) && h->ae_algo->ops->set_gro_en) {
|
||||||
if (features & NETIF_F_GRO_HW)
|
enable = !!(features & NETIF_F_GRO_HW);
|
||||||
ret = h->ae_algo->ops->set_gro_en(h, true);
|
ret = h->ae_algo->ops->set_gro_en(h, enable);
|
||||||
else
|
|
||||||
ret = h->ae_algo->ops->set_gro_en(h, false);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((changed & NETIF_F_HW_VLAN_CTAG_FILTER) &&
|
if ((changed & NETIF_F_HW_VLAN_CTAG_FILTER) &&
|
||||||
h->ae_algo->ops->enable_vlan_filter) {
|
h->ae_algo->ops->enable_vlan_filter) {
|
||||||
if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
|
enable = !!(features & NETIF_F_HW_VLAN_CTAG_FILTER);
|
||||||
h->ae_algo->ops->enable_vlan_filter(h, true);
|
h->ae_algo->ops->enable_vlan_filter(h, enable);
|
||||||
else
|
|
||||||
h->ae_algo->ops->enable_vlan_filter(h, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((changed & NETIF_F_HW_VLAN_CTAG_RX) &&
|
if ((changed & NETIF_F_HW_VLAN_CTAG_RX) &&
|
||||||
h->ae_algo->ops->enable_hw_strip_rxvtag) {
|
h->ae_algo->ops->enable_hw_strip_rxvtag) {
|
||||||
if (features & NETIF_F_HW_VLAN_CTAG_RX)
|
enable = !!(features & NETIF_F_HW_VLAN_CTAG_RX);
|
||||||
ret = h->ae_algo->ops->enable_hw_strip_rxvtag(h, true);
|
ret = h->ae_algo->ops->enable_hw_strip_rxvtag(h, enable);
|
||||||
else
|
|
||||||
ret = h->ae_algo->ops->enable_hw_strip_rxvtag(h, false);
|
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((changed & NETIF_F_NTUPLE) && h->ae_algo->ops->enable_fd) {
|
if ((changed & NETIF_F_NTUPLE) && h->ae_algo->ops->enable_fd) {
|
||||||
if (features & NETIF_F_NTUPLE)
|
enable = !!(features & NETIF_F_NTUPLE);
|
||||||
h->ae_algo->ops->enable_fd(h, true);
|
h->ae_algo->ops->enable_fd(h, enable);
|
||||||
else
|
|
||||||
h->ae_algo->ops->enable_fd(h, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
netdev->features = features;
|
netdev->features = features;
|
||||||
|
|
|
@ -7989,7 +7989,7 @@ static void hclge_get_link_mode(struct hnae3_handle *handle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hclge_gro_en(struct hnae3_handle *handle, int enable)
|
static int hclge_gro_en(struct hnae3_handle *handle, bool enable)
|
||||||
{
|
{
|
||||||
struct hclge_vport *vport = hclge_get_vport(handle);
|
struct hclge_vport *vport = hclge_get_vport(handle);
|
||||||
struct hclge_dev *hdev = vport->back;
|
struct hclge_dev *hdev = vport->back;
|
||||||
|
|
|
@ -2550,7 +2550,7 @@ void hclgevf_update_speed_duplex(struct hclgevf_dev *hdev, u32 speed,
|
||||||
hdev->hw.mac.duplex = duplex;
|
hdev->hw.mac.duplex = duplex;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hclgevf_gro_en(struct hnae3_handle *handle, int enable)
|
static int hclgevf_gro_en(struct hnae3_handle *handle, bool enable)
|
||||||
{
|
{
|
||||||
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
|
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue