@@ -805,6 +805,7 @@ struct hnae3_roce_private_info {
enum hnae3_pflag {
HNAE3_PFLAG_LIMIT_PROMISC,
+ HNAE3_PFLAG_PUSH_ENABLE,
HNAE3_PFLAG_MAX
};
@@ -5132,8 +5132,11 @@ static int hns3_client_init(struct hnae3_handle *handle)
if (hnae3_ae_dev_rxd_adv_layout_supported(ae_dev))
set_bit(HNS3_NIC_STATE_RXD_ADV_LAYOUT_ENABLE, &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);
+ handle->priv_flags |= BIT(HNAE3_PFLAG_PUSH_ENABLE);
+ set_bit(HNAE3_PFLAG_PUSH_ENABLE, &handle->supported_pflags);
+ }
set_bit(HNS3_NIC_STATE_INITED, &priv->state);
@@ -423,8 +423,25 @@ static void hns3_update_limit_promisc_mode(struct net_device *netdev,
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] = {
- { "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)