Commit a19e5812 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
parents 7eebd219 169d07e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ static int hclge_comm_cmd_csq_clean(struct hclge_comm_hw *hw)
static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw)
{
	u32 head = hclge_comm_read_dev(hw, HCLGE_COMM_NIC_CSQ_HEAD_REG);
	return head == hw->cmq.csq.next_to_use;
	return head == (u32)hw->cmq.csq.next_to_use;
}

static u32 hclge_get_cmdq_tx_timeout(u16 opcode, u32 tx_timeout)
+5 −5
Original line number Diff line number Diff line
@@ -684,7 +684,7 @@ static int hns3_dbg_rx_queue_info(struct hnae3_handle *h,
				  char *buf, int len)
{
	char data_str[ARRAY_SIZE(rx_queue_info_items)][HNS3_DBG_DATA_STR_LEN];
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
	char *result[ARRAY_SIZE(rx_queue_info_items)];
	struct hns3_nic_priv *priv = h->priv;
	char content[HNS3_DBG_INFO_LEN];
@@ -789,7 +789,7 @@ static int hns3_dbg_tx_queue_info(struct hnae3_handle *h,
				  char *buf, int len)
{
	char data_str[ARRAY_SIZE(tx_queue_info_items)][HNS3_DBG_DATA_STR_LEN];
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
	char *result[ARRAY_SIZE(tx_queue_info_items)];
	struct hns3_nic_priv *priv = h->priv;
	char content[HNS3_DBG_INFO_LEN];
@@ -1034,7 +1034,7 @@ static int hns3_dbg_tx_bd_info(struct hns3_dbg_data *d, char *buf, int len)
static void
hns3_dbg_dev_caps(struct hnae3_handle *h, char *buf, int len, int *pos)
{
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
	unsigned long *caps = ae_dev->caps;
	u32 i, state;

@@ -1239,7 +1239,7 @@ static const struct hns3_dbg_func hns3_dbg_cmd_func[] = {
static int hns3_dbg_read_cmd(struct hns3_dbg_data *dbg_data,
			     enum hnae3_dbg_cmd cmd, char *buf, int len)
{
	const struct hnae3_ae_ops *ops = dbg_data->handle->ae_algo->ops;
	const struct hnae3_ae_ops *ops = hns3_get_ops(dbg_data->handle);
	const struct hns3_dbg_func *cmd_func;
	u32 i;

@@ -1364,7 +1364,7 @@ hns3_dbg_common_file_init(struct hnae3_handle *handle, u32 cmd)

int hns3_dbg_init(struct hnae3_handle *handle)
{
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	const char *name = pci_name(handle->pdev);
	int ret;
	u32 i;
+19 −19
Original line number Diff line number Diff line
@@ -547,9 +547,9 @@ void hns3_set_vector_coalesce_rx_ql(struct hns3_enet_tqp_vector *tqp_vector,
static void hns3_vector_coalesce_init(struct hns3_enet_tqp_vector *tqp_vector,
				      struct hns3_nic_priv *priv)
{
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
	struct hns3_enet_coalesce *tx_coal = &tqp_vector->tx_group.coal;
	struct hns3_enet_coalesce *rx_coal = &tqp_vector->rx_group.coal;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
	struct hns3_enet_coalesce *ptx_coal = &priv->tx_coal;
	struct hns3_enet_coalesce *prx_coal = &priv->rx_coal;

@@ -960,7 +960,7 @@ static void hns3_nic_set_rx_mode(struct net_device *netdev)

void hns3_request_update_promisc_mode(struct hnae3_handle *handle)
{
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);

	if (ops->request_update_promisc_mode)
		ops->request_update_promisc_mode(handle);
@@ -1304,7 +1304,7 @@ static int hns3_get_l4_protocol(struct sk_buff *skb, u8 *ol4_proto,
static bool hns3_tunnel_csum_bug(struct sk_buff *skb)
{
	struct hns3_nic_priv *priv = netdev_priv(skb->dev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
	union l4_hdr_info l4;

	/* device version above V3(include V3), the hardware can
@@ -1504,7 +1504,7 @@ static int hns3_handle_vtags(struct hns3_enet_ring *tx_ring,
	 * VLAN enabled, only one VLAN header is allowed in skb, otherwise it
	 * will cause RAS error.
	 */
	ae_dev = pci_get_drvdata(handle->pdev);
	ae_dev = hns3_get_ae_dev(handle);
	if (unlikely(skb_vlan_tagged_multi(skb) &&
		     ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2 &&
		     handle->port_base_vlan_state ==
@@ -1690,8 +1690,8 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, dma_addr_t dma,
#define HNS3_LIKELY_BD_NUM	1

	struct hns3_desc *desc = &ring->desc[ring->next_to_use];
	unsigned int frag_buf_num;
	int k, sizeoflast;
	unsigned int frag_buf_num, k;
	int sizeoflast;

	if (likely(size <= HNS3_MAX_BD_SIZE)) {
		desc->addr = cpu_to_le64(dma);
@@ -1863,7 +1863,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
				     unsigned int bd_num, u8 max_non_tso_bd_num)
{
	unsigned int tot_len = 0;
	int i;
	unsigned int i;

	for (i = 0; i < max_non_tso_bd_num - 1U; i++)
		tot_len += bd_size[i];
@@ -1891,7 +1891,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,

void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size)
{
	int i;
	u32 i;

	for (i = 0; i < MAX_SKB_FRAGS; i++)
		size[i] = skb_frag_size(&shinfo->frags[i]);
@@ -2207,9 +2207,9 @@ static int hns3_handle_tx_sgl(struct hns3_enet_ring *ring,
	struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use];
	u32 nfrag = skb_shinfo(skb)->nr_frags + 1;
	struct sg_table *sgt;
	int i, bd_num = 0;
	int bd_num = 0;
	dma_addr_t dma;
	u32 cb_len;
	u32 cb_len, i;
	int nents;

	if (skb_has_frag_list(skb))
@@ -2447,7 +2447,7 @@ static int hns3_nic_set_features(struct net_device *netdev,
	if ((netdev->features & NETIF_F_HW_TC) > (features & NETIF_F_HW_TC) &&
	    h->ae_algo->ops->cls_flower_active(h)) {
		netdev_err(netdev,
			   "there are offloaded TC filters active, cannot disable HW TC offload");
			   "there are offloaded TC filters active, cannot disable HW TC offload\n");
		return -EINVAL;
	}

@@ -2544,7 +2544,7 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
	struct hnae3_handle *handle = priv->ae_handle;
	struct rtnl_link_stats64 ring_total_stats;
	struct hns3_enet_ring *ring;
	unsigned int idx;
	int idx;

	if (test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
		return;
@@ -2770,7 +2770,7 @@ static int hns3_nic_change_mtu(struct net_device *netdev, int new_mtu)

static int hns3_get_timeout_queue(struct net_device *ndev)
{
	int i;
	unsigned int i;

	/* Find the stopped queue the same way the stack does */
	for (i = 0; i < ndev->num_tx_queues; i++) {
@@ -2851,7 +2851,7 @@ static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev)
	struct hns3_nic_priv *priv = netdev_priv(ndev);
	struct hnae3_handle *h = hns3_get_handle(ndev);
	struct hns3_enet_ring *tx_ring;
	int timeout_queue;
	u32 timeout_queue;

	timeout_queue = hns3_get_timeout_queue(ndev);
	if (timeout_queue >= ndev->num_tx_queues) {
@@ -3821,7 +3821,7 @@ static int hns3_gro_complete(struct sk_buff *skb, u32 l234info)
{
	__be16 type = skb->protocol;
	struct tcphdr *th;
	int depth = 0;
	u32 depth = 0;

	while (eth_type_vlan(type)) {
		struct vlan_hdr *vh;
@@ -4747,7 +4747,7 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)

static void hns3_nic_init_coal_cfg(struct hns3_nic_priv *priv)
{
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
	struct hns3_enet_coalesce *tx_coal = &priv->tx_coal;
	struct hns3_enet_coalesce *rx_coal = &priv->rx_coal;

@@ -5226,7 +5226,7 @@ static void hns3_info_show(struct hns3_nic_priv *priv)
static void hns3_set_cq_period_mode(struct hns3_nic_priv *priv,
				    enum dim_cq_period_mode mode, bool is_tx)
{
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle);
	struct hnae3_handle *handle = priv->ae_handle;
	int i;

@@ -5264,7 +5264,7 @@ void hns3_cq_period_mode_init(struct hns3_nic_priv *priv,

static void hns3_state_init(struct hnae3_handle *handle)
{
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	struct net_device *netdev = handle->kinfo.netdev;
	struct hns3_nic_priv *priv = netdev_priv(netdev);

@@ -5934,7 +5934,7 @@ static const struct hns3_hw_error_info hns3_hw_err[] = {
static void hns3_process_hw_error(struct hnae3_handle *handle,
				  enum hnae3_hw_error_type type)
{
	int i;
	u32 i;

	for (i = 0; i < ARRAY_SIZE(hns3_hw_err); i++) {
		if (hns3_hw_err[i].type == type) {
+2 −2
Original line number Diff line number Diff line
@@ -621,7 +621,7 @@ struct hns3_reset_type_map {
	enum hnae3_reset_type rst_type;
};

static inline int ring_space(struct hns3_enet_ring *ring)
static inline u32 ring_space(struct hns3_enet_ring *ring)
{
	/* This smp_load_acquire() pairs with smp_store_release() in
	 * hns3_nic_reclaim_one_desc called by hns3_clean_tx_ring.
@@ -692,7 +692,7 @@ static inline unsigned int hns3_page_order(struct hns3_enet_ring *ring)

/* iterator for handling rings in ring group */
#define hns3_for_each_ring(pos, head) \
	for (pos = (head).ring; (pos); pos = (pos)->next)
	for ((pos) = (head).ring; (pos); (pos) = (pos)->next)

#define hns3_get_handle(ndev) \
	(((struct hns3_nic_priv *)netdev_priv(ndev))->ae_handle)
+37 −37
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ static int hns3_get_sset_count(struct net_device *netdev, int stringset);
static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en)
{
	struct hnae3_handle *h = hns3_get_handle(ndev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
	int ret;

	if (!h->ae_algo->ops->set_loopback ||
@@ -171,7 +171,7 @@ static void hns3_lp_setup_skb(struct sk_buff *skb)
	 * the purpose of mac or serdes selftest.
	 */
	handle = hns3_get_handle(ndev);
	ae_dev = pci_get_drvdata(handle->pdev);
	ae_dev = hns3_get_ae_dev(handle);
	if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2)
		ethh->h_dest[5] += HNS3_NIC_LB_DST_MAC_ADDR;
	eth_zero_addr(ethh->h_source);
@@ -436,7 +436,7 @@ static void hns3_self_test(struct net_device *ndev,
		data[i] = HNS3_NIC_LB_TEST_UNEXECUTED;

	if (hns3_nic_resetting(ndev)) {
		netdev_err(ndev, "dev resetting!");
		netdev_err(ndev, "dev resetting!\n");
		goto failure;
	}

@@ -489,7 +489,7 @@ static const struct hns3_pflag_desc hns3_priv_flags[HNAE3_PFLAG_MAX] = {
static int hns3_get_sset_count(struct net_device *netdev, int stringset)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	const struct hnae3_ae_ops *ops = h->ae_algo->ops;
	const struct hnae3_ae_ops *ops = hns3_get_ops(h);

	if (!ops->get_sset_count)
		return -EOPNOTSUPP;
@@ -540,8 +540,8 @@ static void hns3_get_strings_tqps(struct hnae3_handle *handle, u8 **data)
static void hns3_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	const struct hnae3_ae_ops *ops = h->ae_algo->ops;
	int i;
	const struct hnae3_ae_ops *ops = hns3_get_ops(h);
	u32 i;

	if (!ops->get_strings)
		return;
@@ -569,7 +569,7 @@ static u64 *hns3_get_stats_tqps(struct hnae3_handle *handle, u64 *data)
	struct hns3_nic_priv *nic_priv = handle->priv;
	struct hns3_enet_ring *ring;
	u8 *stat;
	int i, j;
	u32 i, j;

	/* get stats for Tx */
	for (i = 0; i < kinfo->num_tqps; i++) {
@@ -692,7 +692,7 @@ static void hns3_get_pauseparam(struct net_device *netdev,
				struct ethtool_pauseparam *param)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);

	if (!test_bit(HNAE3_DEV_SUPPORT_PAUSE_B, ae_dev->caps))
		return;
@@ -706,7 +706,7 @@ static int hns3_set_pauseparam(struct net_device *netdev,
			       struct ethtool_pauseparam *param)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);

	if (!test_bit(HNAE3_DEV_SUPPORT_PAUSE_B, ae_dev->caps))
		return -EOPNOTSUPP;
@@ -725,7 +725,7 @@ static int hns3_set_pauseparam(struct net_device *netdev,
static void hns3_get_ksettings(struct hnae3_handle *h,
			       struct ethtool_link_ksettings *cmd)
{
	const struct hnae3_ae_ops *ops = h->ae_algo->ops;
	const struct hnae3_ae_ops *ops = hns3_get_ops(h);

	/* 1.auto_neg & speed & duplex from cmd */
	if (ops->get_ksettings_an_result)
@@ -751,7 +751,7 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
				   struct ethtool_link_ksettings *cmd)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
	const struct hnae3_ae_ops *ops;
	u8 module_type;
	u8 media_type;
@@ -794,7 +794,7 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
		break;
	default:

		netdev_warn(netdev, "Unknown media type");
		netdev_warn(netdev, "Unknown media type\n");
		return 0;
	}

@@ -814,7 +814,7 @@ static int hns3_check_ksettings_param(const struct net_device *netdev,
				      const struct ethtool_link_ksettings *cmd)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
	u8 module_type = HNAE3_MODULE_TYPE_UNKNOWN;
	u8 media_type = HNAE3_MEDIA_TYPE_UNKNOWN;
	u32 lane_num;
@@ -842,7 +842,7 @@ static int hns3_check_ksettings_param(const struct net_device *netdev,
	if (cmd->base.duplex == DUPLEX_HALF &&
	    media_type != HNAE3_MEDIA_TYPE_COPPER) {
		netdev_err(netdev,
			   "only copper port supports half duplex!");
			   "only copper port supports half duplex!\n");
		return -EINVAL;
	}

@@ -861,8 +861,8 @@ static int hns3_set_link_ksettings(struct net_device *netdev,
				   const struct ethtool_link_ksettings *cmd)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
	int ret;

	/* Chip don't support this mode. */
@@ -932,7 +932,7 @@ static u32 hns3_get_rss_key_size(struct net_device *netdev)
static u32 hns3_get_rss_indir_size(struct net_device *netdev)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);

	return ae_dev->dev_specs.rss_ind_tbl_size;
}
@@ -954,7 +954,7 @@ static int hns3_set_rss(struct net_device *netdev,
			struct netlink_ext_ack *extack)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);

	if (!h->ae_algo->ops->set_rss)
		return -EOPNOTSUPP;
@@ -1030,8 +1030,8 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
{
	enum hnae3_reset_type rst_type = HNAE3_NONE_RESET;
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	const struct hnae3_ae_ops *ops = h->ae_algo->ops;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
	const struct hnae3_ae_ops *ops = hns3_get_ops(h);
	const struct hns3_reset_type_map *rst_type_map;
	enum ethtool_reset_flags rst_flags;
	u32 i, size;
@@ -1195,7 +1195,7 @@ static int hns3_set_tx_push(struct net_device *netdev, u32 tx_push)
{
	struct hns3_nic_priv *priv = netdev_priv(netdev);
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
	u32 old_state = test_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state);

	if (!test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps) && tx_push)
@@ -1313,7 +1313,7 @@ static int hns3_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
static int hns3_nway_reset(struct net_device *netdev)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
	struct phy_device *phy = netdev->phydev;
	int autoneg;

@@ -1321,7 +1321,7 @@ static int hns3_nway_reset(struct net_device *netdev)
		return 0;

	if (hns3_nic_resetting(netdev)) {
		netdev_err(netdev, "dev resetting!");
		netdev_err(netdev, "dev resetting!\n");
		return -EBUSY;
	}

@@ -1390,7 +1390,7 @@ static int hns3_check_gl_coalesce_para(struct net_device *netdev,
				       struct ethtool_coalesce *cmd)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	u32 rx_gl, tx_gl;

	if (cmd->rx_coalesce_usecs > ae_dev->dev_specs.max_int_gl) {
@@ -1462,7 +1462,7 @@ static int hns3_check_ql_coalesce_param(struct net_device *netdev,
					struct ethtool_coalesce *cmd)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);

	if ((cmd->tx_max_coalesced_frames || cmd->rx_max_coalesced_frames) &&
	    !ae_dev->dev_specs.int_ql_max) {
@@ -1486,7 +1486,7 @@ hns3_check_cqe_coalesce_param(struct net_device *netdev,
			      struct kernel_ethtool_coalesce *kernel_coal)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);

	if ((kernel_coal->use_cqe_mode_tx || kernel_coal->use_cqe_mode_rx) &&
	    !hnae3_ae_dev_cq_supported(ae_dev)) {
@@ -1662,8 +1662,8 @@ static void hns3_get_fec_stats(struct net_device *netdev,
			       struct ethtool_fec_stats *fec_stats)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);

	if (!hnae3_ae_dev_fec_stats_supported(ae_dev) || !ops->get_fec_stats)
		return;
@@ -1713,8 +1713,8 @@ static int hns3_get_fecparam(struct net_device *netdev,
			     struct ethtool_fecparam *fec)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
	u8 fec_ability;
	u8 fec_mode;

@@ -1738,8 +1738,8 @@ static int hns3_set_fecparam(struct net_device *netdev,
			     struct ethtool_fecparam *fec)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
	u32 fec_mode;

	if (!test_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps))
@@ -1760,8 +1760,8 @@ static int hns3_get_module_info(struct net_device *netdev,
#define HNS3_SFF_8636_V1_3 0x03

	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
	struct hns3_sfp_type sfp_type;
	int ret;

@@ -1810,8 +1810,8 @@ static int hns3_get_module_eeprom(struct net_device *netdev,
				  struct ethtool_eeprom *ee, u8 *data)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
	struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
	const struct hnae3_ae_ops *ops = hns3_get_ops(handle);

	if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2 ||
	    !ops->get_module_eeprom)
@@ -1937,7 +1937,7 @@ static int hns3_set_tunable(struct net_device *netdev,
	int i, ret = 0;

	if (hns3_nic_resetting(netdev) || !priv->ring) {
		netdev_err(netdev, "failed to set tunable value, dev resetting!");
		netdev_err(netdev, "failed to set tunable value, dev resetting!\n");
		return -EBUSY;
	}

Loading