OSDN Git Service

net: hns3: fix port base vlan add fail when concurrent with reset
[uclinux-h8/linux.git] / drivers / net / ethernet / hisilicon / hns3 / hns3pf / hclge_main.h
index adfb26e..a0f619c 100644 (file)
@@ -169,6 +169,14 @@ enum HLCGE_PORT_TYPE {
 #define HCLGE_VECTOR0_ALL_MSIX_ERR_B   6U
 #define HCLGE_TRIGGER_IMP_RESET_B      7U
 
+#define HCLGE_TQP_MEM_SIZE             0x10000
+#define HCLGE_MEM_BAR                  4
+/* in the bar4, the first half is for roce, and the second half is for nic */
+#define HCLGE_NIC_MEM_OFFSET(hdev)     \
+       (pci_resource_len((hdev)->pdev, HCLGE_MEM_BAR) >> 1)
+#define HCLGE_TQP_MEM_OFFSET(hdev, i)  \
+       (HCLGE_NIC_MEM_OFFSET(hdev) + HCLGE_TQP_MEM_SIZE * (i))
+
 #define HCLGE_MAC_DEFAULT_FRAME \
        (ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN + ETH_DATA_LEN)
 #define HCLGE_MAC_MIN_FRAME            64
@@ -977,7 +985,9 @@ struct hclge_vlan_info {
 
 struct hclge_port_base_vlan_config {
        u16 state;
+       bool tbl_sta;
        struct hclge_vlan_info vlan_info;
+       struct hclge_vlan_info old_vlan_info;
 };
 
 struct hclge_vf_info {
@@ -1060,11 +1070,6 @@ static inline int hclge_get_queue_id(struct hnae3_queue *queue)
        return tqp->index;
 }
 
-static inline bool hclge_is_reset_pending(struct hclge_dev *hdev)
-{
-       return !!hdev->reset_pending;
-}
-
 int hclge_inform_reset_assert_to_vf(struct hclge_vport *vport);
 int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex);
 int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto,
@@ -1097,6 +1102,7 @@ void hclge_rm_vport_all_mac_table(struct hclge_vport *vport, bool is_del_list,
 void hclge_rm_vport_all_vlan_table(struct hclge_vport *vport, bool is_del_list);
 void hclge_uninit_vport_vlan_table(struct hclge_dev *hdev);
 void hclge_restore_mac_table_common(struct hclge_vport *vport);
+void hclge_restore_vport_port_base_vlan_config(struct hclge_dev *hdev);
 void hclge_restore_vport_vlan_table(struct hclge_vport *vport);
 int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
                                    struct hclge_vlan_info *vlan_info);