Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b4c6ed2 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'hns3-next'



Peng Li says:

====================
fix some bugs for HNS3 driver

This patchset fixes some bugs for HNS3 driver:
[Patch 1/12 - Patch 8/12] fix various bugs for PF driver.
[Patch 9/12 - Patch 12/12] fix issues when change the us mac address of
PF/VF device to an existent one in the mac_vlan table.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents daa13701 2097fdef
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ enum hclge_mbx_vlan_cfg_subcode {

#define HCLGE_MBX_MAX_MSG_SIZE	16
#define HCLGE_MBX_MAX_RESP_DATA_SIZE	8
#define HCLGE_MBX_RING_MAP_BASIC_MSG_NUM	3
#define HCLGE_MBX_RING_NODE_VARIABLE_NUM	3

struct hclgevf_mbx_resp_status {
	struct mutex mbx_mutex; /* protects against contending sync cmd resp */
+2 −1
Original line number Diff line number Diff line
@@ -338,7 +338,8 @@ struct hnae3_ae_ops {
				   u32 *tx_usecs_high, u32 *rx_usecs_high);

	void (*get_mac_addr)(struct hnae3_handle *handle, u8 *p);
	int (*set_mac_addr)(struct hnae3_handle *handle, void *p);
	int (*set_mac_addr)(struct hnae3_handle *handle, void *p,
			    bool is_first);
	int (*add_uc_addr)(struct hnae3_handle *handle,
			   const unsigned char *addr);
	int (*rm_uc_addr)(struct hnae3_handle *handle,
+8 −10
Original line number Diff line number Diff line
@@ -1120,7 +1120,7 @@ static int hns3_nic_net_set_mac_address(struct net_device *netdev, void *p)
	if (!mac_addr || !is_valid_ether_addr((const u8 *)mac_addr->sa_data))
		return -EADDRNOTAVAIL;

	ret = h->ae_algo->ops->set_mac_addr(h, mac_addr->sa_data);
	ret = h->ae_algo->ops->set_mac_addr(h, mac_addr->sa_data, false);
	if (ret) {
		netdev_err(netdev, "set_mac_address fail, ret=%d!\n", ret);
		return ret;
@@ -2080,15 +2080,13 @@ static void hns3_nic_reuse_page(struct sk_buff *skb, int i,
	desc = &ring->desc[ring->next_to_clean];
	size = le16_to_cpu(desc->rx.size);

	if (twobufs) {
	truesize = hnae_buf_size(ring);
	} else {
		truesize = ALIGN(size, L1_CACHE_BYTES);

	if (!twobufs)
		last_offset = hnae_page_size(ring) - hnae_buf_size(ring);
	}

	skb_add_rx_frag(skb, i, desc_cb->priv, desc_cb->page_offset + pull_len,
			size - pull_len, truesize - pull_len);
			size - pull_len, truesize);

	 /* Avoid re-using remote pages,flag default unreuse */
	if (unlikely(page_to_nid(desc_cb->priv) != numa_node_id()))
@@ -3048,7 +3046,7 @@ static void hns3_init_mac_addr(struct net_device *netdev)
	}

	if (h->ae_algo->ops->set_mac_addr)
		h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr);
		h->ae_algo->ops->set_mac_addr(h, netdev->dev_addr, true);

}

@@ -3503,7 +3501,7 @@ int hns3_set_channels(struct net_device *netdev,
		return 0;

	if (if_running)
		dev_close(netdev);
		hns3_nic_net_stop(netdev);

	hns3_clear_all_ring(h);

@@ -3546,7 +3544,7 @@ int hns3_set_channels(struct net_device *netdev,

open_netdev:
	if (if_running)
		dev_open(netdev);
		hns3_nic_net_open(netdev);

	return ret;
}
+16 −0
Original line number Diff line number Diff line
@@ -309,6 +309,9 @@ static void hns3_self_test(struct net_device *ndev,
	struct hnae3_handle *h = priv->ae_handle;
	int st_param[HNS3_SELF_TEST_TPYE_NUM][2];
	bool if_running = netif_running(ndev);
#if IS_ENABLED(CONFIG_VLAN_8021Q)
	bool dis_vlan_filter;
#endif
	int test_index = 0;
	u32 i;

@@ -323,6 +326,14 @@ static void hns3_self_test(struct net_device *ndev,
	if (if_running)
		dev_close(ndev);

#if IS_ENABLED(CONFIG_VLAN_8021Q)
	/* Disable the vlan filter for selftest does not support it */
	dis_vlan_filter = (ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
				h->ae_algo->ops->enable_vlan_filter;
	if (dis_vlan_filter)
		h->ae_algo->ops->enable_vlan_filter(h, false);
#endif

	set_bit(HNS3_NIC_STATE_TESTING, &priv->state);

	for (i = 0; i < HNS3_SELF_TEST_TPYE_NUM; i++) {
@@ -345,6 +356,11 @@ static void hns3_self_test(struct net_device *ndev,

	clear_bit(HNS3_NIC_STATE_TESTING, &priv->state);

#if IS_ENABLED(CONFIG_VLAN_8021Q)
	if (dis_vlan_filter)
		h->ae_algo->ops->enable_vlan_filter(h, true);
#endif

	if (if_running)
		dev_open(ndev);
}
+14 −0
Original line number Diff line number Diff line
@@ -205,9 +205,11 @@ static int hclge_ieee_setets(struct hnae3_handle *h, struct ieee_ets *ets)

static int hclge_ieee_getpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
{
	u64 requests[HNAE3_MAX_TC], indications[HNAE3_MAX_TC];
	struct hclge_vport *vport = hclge_get_vport(h);
	struct hclge_dev *hdev = vport->back;
	u8 i, j, pfc_map, *prio_tc;
	int ret;

	memset(pfc, 0, sizeof(*pfc));
	pfc->pfc_cap = hdev->pfc_max;
@@ -222,6 +224,18 @@ static int hclge_ieee_getpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
		}
	}

	ret = hclge_pfc_tx_stats_get(hdev, requests);
	if (ret)
		return ret;

	ret = hclge_pfc_rx_stats_get(hdev, indications);
	if (ret)
		return ret;

	for (i = 0; i < HCLGE_MAX_TC_NUM; i++) {
		pfc->requests[i] = requests[i];
		pfc->indications[i] = indications[i];
	}
	return 0;
}

Loading