提交 6b6cf708 编写于 作者: Y Yufeng Mo 提交者: Zheng Zengkai

net: hns3: add ethtool priv-flag for TX push

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4QHSV

----------------------------------------------------------------------

Add a control private flag in ethtool for enable/disable
TX push feature.
Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8fcb2208
...@@ -817,6 +817,7 @@ struct hnae3_roce_private_info { ...@@ -817,6 +817,7 @@ struct hnae3_roce_private_info {
enum hnae3_pflag { enum hnae3_pflag {
HNAE3_PFLAG_LIMIT_PROMISC, HNAE3_PFLAG_LIMIT_PROMISC,
HNAE3_PFLAG_PUSH_ENABLE,
HNAE3_PFLAG_MAX HNAE3_PFLAG_MAX
}; };
......
...@@ -5161,8 +5161,11 @@ static void hns3_state_init(struct hnae3_handle *handle) ...@@ -5161,8 +5161,11 @@ static void hns3_state_init(struct hnae3_handle *handle)
set_bit(HNS3_NIC_STATE_INITED, &priv->state); set_bit(HNS3_NIC_STATE_INITED, &priv->state);
if (test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps)) if (test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps)) {
set_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state); set_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state);
handle->priv_flags |= BIT(HNAE3_PFLAG_PUSH_ENABLE);
set_bit(HNAE3_PFLAG_PUSH_ENABLE, &handle->supported_pflags);
}
if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3) if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3)
set_bit(HNAE3_PFLAG_LIMIT_PROMISC, &handle->supported_pflags); set_bit(HNAE3_PFLAG_LIMIT_PROMISC, &handle->supported_pflags);
......
...@@ -440,8 +440,25 @@ static void hns3_update_limit_promisc_mode(struct net_device *netdev, ...@@ -440,8 +440,25 @@ static void hns3_update_limit_promisc_mode(struct net_device *netdev,
hns3_request_update_promisc_mode(handle); hns3_request_update_promisc_mode(handle);
} }
static void hns3_update_state(struct net_device *netdev,
enum hns3_nic_state state, bool enable)
{
struct hns3_nic_priv *priv = netdev_priv(netdev);
if (enable)
set_bit(state, &priv->state);
else
clear_bit(state, &priv->state);
}
static void hns3_update_push_state(struct net_device *netdev, bool enable)
{
hns3_update_state(netdev, HNS3_NIC_STATE_TX_PUSH_ENABLE, enable);
}
static const struct hns3_pflag_desc hns3_priv_flags[HNAE3_PFLAG_MAX] = { static const struct hns3_pflag_desc hns3_priv_flags[HNAE3_PFLAG_MAX] = {
{ "limit_promisc", hns3_update_limit_promisc_mode } { "limit_promisc", hns3_update_limit_promisc_mode },
{ "tx_push_enable", hns3_update_push_state }
}; };
static int hns3_get_sset_count(struct net_device *netdev, int stringset) static int hns3_get_sset_count(struct net_device *netdev, int stringset)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册