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

Commit 6e36d77c authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'hns3-next'



Huazhong Tan says:

====================
code optimizations & bugfixes for HNS3 driver

This patch-set includes code optimizations and bugfixes for the HNS3
ethernet controller driver.

[patch 1/10] removes the redundant core reset type

[patch 2/10 - 3/10] fixes two VLAN related issues

[patch 4/10] fixes a TM issue

[patch 5/10 - 10/10] includes some patches related to RAS & MSI-X error

Change log:
V1->V2: removes two patches which needs to change HNS's infiniband
	driver as well, they will be upstreamed later with the
	infiniband's one.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b7034146 00ea6e5f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -251,6 +251,7 @@ void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo)

		ae_algo->ops->uninit_ae_dev(ae_dev);
		hnae3_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 0);
		ae_dev->ops = NULL;
	}

	list_del(&ae_algo->node);
@@ -351,6 +352,7 @@ void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev)

		ae_algo->ops->uninit_ae_dev(ae_dev);
		hnae3_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 0);
		ae_dev->ops = NULL;
	}

	list_del(&ae_dev->node);
+3 −1
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ enum hnae3_reset_type {
	HNAE3_VF_FULL_RESET,
	HNAE3_FLR_RESET,
	HNAE3_FUNC_RESET,
	HNAE3_CORE_RESET,
	HNAE3_GLOBAL_RESET,
	HNAE3_IMP_RESET,
	HNAE3_UNKNOWN_RESET,
@@ -339,6 +338,8 @@ struct hnae3_ae_dev {
 *   Set vlan filter config of Ports
 * set_vf_vlan_filter()
 *   Set vlan filter config of vf
 * restore_vlan_table()
 *   Restore vlan filter entries after reset
 * enable_hw_strip_rxvtag()
 *   Enable/disable hardware strip vlan tag of packets received
 * set_gro_en
@@ -506,6 +507,7 @@ struct hnae3_ae_ops {
	void (*set_timer_task)(struct hnae3_handle *handle, bool enable);
	int (*mac_connect_phy)(struct hnae3_handle *handle);
	void (*mac_disconnect_phy)(struct hnae3_handle *handle);
	void (*restore_vlan_table)(struct hnae3_handle *handle);
};

struct hnae3_dcb_ops {
+7 −34
Original line number Diff line number Diff line
@@ -1548,15 +1548,11 @@ static int hns3_vlan_rx_add_vid(struct net_device *netdev,
				__be16 proto, u16 vid)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hns3_nic_priv *priv = netdev_priv(netdev);
	int ret = -EIO;

	if (h->ae_algo->ops->set_vlan_filter)
		ret = h->ae_algo->ops->set_vlan_filter(h, proto, vid, false);

	if (!ret)
		set_bit(vid, priv->active_vlans);

	return ret;
}

@@ -1564,33 +1560,11 @@ static int hns3_vlan_rx_kill_vid(struct net_device *netdev,
				 __be16 proto, u16 vid)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	struct hns3_nic_priv *priv = netdev_priv(netdev);
	int ret = -EIO;

	if (h->ae_algo->ops->set_vlan_filter)
		ret = h->ae_algo->ops->set_vlan_filter(h, proto, vid, true);

	if (!ret)
		clear_bit(vid, priv->active_vlans);

	return ret;
}

static int hns3_restore_vlan(struct net_device *netdev)
{
	struct hns3_nic_priv *priv = netdev_priv(netdev);
	int ret = 0;
	u16 vid;

	for_each_set_bit(vid, priv->active_vlans, VLAN_N_VID) {
		ret = hns3_vlan_rx_add_vid(netdev, htons(ETH_P_8021Q), vid);
		if (ret) {
			netdev_err(netdev, "Restore vlan: %d filter, ret:%d\n",
				   vid, ret);
			return ret;
		}
	}

	return ret;
}

@@ -1946,9 +1920,9 @@ static pci_ers_result_t hns3_error_detected(struct pci_dev *pdev,
	if (state == pci_channel_io_perm_failure)
		return PCI_ERS_RESULT_DISCONNECT;

	if (!ae_dev) {
	if (!ae_dev || !ae_dev->ops) {
		dev_err(&pdev->dev,
			"Can't recover - error happened during device init\n");
			"Can't recover - error happened before device initialized\n");
		return PCI_ERS_RESULT_NONE;
	}

@@ -1967,6 +1941,9 @@ static pci_ers_result_t hns3_slot_reset(struct pci_dev *pdev)

	dev_info(dev, "requesting reset due to PCI error\n");

	if (!ae_dev || !ae_dev->ops)
		return PCI_ERS_RESULT_NONE;

	/* request the reset */
	if (ae_dev->ops->reset_event) {
		if (!ae_dev->override_pci_need_reset)
@@ -4301,12 +4278,8 @@ static int hns3_reset_notify_restore_enet(struct hnae3_handle *handle)
	vlan_filter_enable = netdev->flags & IFF_PROMISC ? false : true;
	hns3_enable_vlan_filter(netdev, vlan_filter_enable);

	/* Hardware table is only clear when pf resets */
	if (!(handle->flags & HNAE3_SUPPORT_VF)) {
		ret = hns3_restore_vlan(netdev);
		if (ret)
			return ret;
	}
	if (handle->ae_algo->ops->restore_vlan_table)
		handle->ae_algo->ops->restore_vlan_table(handle);

	return hns3_restore_fd_rules(netdev);
}
+0 −1
Original line number Diff line number Diff line
@@ -550,7 +550,6 @@ struct hns3_nic_priv {
	struct notifier_block notifier_block;
	/* Vxlan/Geneve information */
	struct hns3_udp_tunnel udp_tnl[HNS3_UDP_TNL_MAX];
	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
	struct hns3_enet_coalesce tx_coal;
	struct hns3_enet_coalesce rx_coal;
};
+5 −1
Original line number Diff line number Diff line
@@ -173,7 +173,11 @@ static bool hclge_is_special_opcode(u16 opcode)
			     HCLGE_OPC_STATS_MAC,
			     HCLGE_OPC_STATS_MAC_ALL,
			     HCLGE_OPC_QUERY_32_BIT_REG,
			     HCLGE_OPC_QUERY_64_BIT_REG};
			     HCLGE_OPC_QUERY_64_BIT_REG,
			     HCLGE_QUERY_CLEAR_MPF_RAS_INT,
			     HCLGE_QUERY_CLEAR_PF_RAS_INT,
			     HCLGE_QUERY_CLEAR_ALL_MPF_MSIX_INT,
			     HCLGE_QUERY_CLEAR_ALL_PF_MSIX_INT};
	int i;

	for (i = 0; i < ARRAY_SIZE(spec_opcode); i++) {
Loading