Skip to content

Commit 9c095bd

Browse files
committed
Merge branch 'hns3-next'
Guangbin Huang says: ==================== net: hns3: updates for -next This series includes some updates for the HNS3 ethernet driver. Change logs: V1 -> V2: - Fix some sparse warnings of patch 3# and 4#. - Add patch #6 to fix sparse warnings of incorrect type of argument. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 1728c05 + 443edfd commit 9c095bd

File tree

11 files changed

+275
-166
lines changed

11 files changed

+275
-166
lines changed

drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ enum HCLGE_MBX_OPCODE {
4646
HCLGE_MBX_PUSH_PROMISC_INFO, /* (PF -> VF) push vf promisc info */
4747
HCLGE_MBX_VF_UNINIT, /* (VF -> PF) vf is unintializing */
4848
HCLGE_MBX_HANDLE_VF_TBL, /* (VF -> PF) store/clear hw table */
49+
HCLGE_MBX_GET_RING_VECTOR_MAP, /* (VF -> PF) get ring-to-vector map */
4950

5051
HCLGE_MBX_GET_VF_FLR_STATUS = 200, /* (M7 -> PF) get vf flr status */
5152
HCLGE_MBX_PUSH_LINK_STATUS, /* (M7 -> PF) get port link status */
@@ -92,8 +93,8 @@ struct hclge_ring_chain_param {
9293
struct hclge_basic_info {
9394
u8 hw_tc_map;
9495
u8 rsv;
95-
u16 mbx_api_version;
96-
u32 pf_caps;
96+
__le16 mbx_api_version;
97+
__le32 pf_caps;
9798
};
9899

99100
struct hclgevf_mbx_resp_status {
@@ -134,13 +135,13 @@ struct hclge_vf_to_pf_msg {
134135
};
135136

136137
struct hclge_pf_to_vf_msg {
137-
u16 code;
138+
__le16 code;
138139
union {
139140
/* used for mbx response */
140141
struct {
141-
u16 vf_mbx_msg_code;
142-
u16 vf_mbx_msg_subcode;
143-
u16 resp_status;
142+
__le16 vf_mbx_msg_code;
143+
__le16 vf_mbx_msg_subcode;
144+
__le16 resp_status;
144145
u8 resp_data[HCLGE_MBX_MAX_RESP_DATA_SIZE];
145146
};
146147
/* used for general mbx */
@@ -157,7 +158,7 @@ struct hclge_mbx_vf_to_pf_cmd {
157158
u8 rsv1[1];
158159
u8 msg_len;
159160
u8 rsv2;
160-
u16 match_id;
161+
__le16 match_id;
161162
struct hclge_vf_to_pf_msg msg;
162163
};
163164

@@ -168,7 +169,7 @@ struct hclge_mbx_pf_to_vf_cmd {
168169
u8 rsv[3];
169170
u8 msg_len;
170171
u8 rsv1;
171-
u16 match_id;
172+
__le16 match_id;
172173
struct hclge_pf_to_vf_msg msg;
173174
};
174175

@@ -178,6 +179,49 @@ struct hclge_vf_rst_cmd {
178179
u8 rsv[22];
179180
};
180181

182+
#pragma pack(1)
183+
struct hclge_mbx_link_status {
184+
__le16 link_status;
185+
__le32 speed;
186+
__le16 duplex;
187+
u8 flag;
188+
};
189+
190+
struct hclge_mbx_link_mode {
191+
__le16 idx;
192+
__le64 link_mode;
193+
};
194+
195+
struct hclge_mbx_port_base_vlan {
196+
__le16 state;
197+
__le16 vlan_proto;
198+
__le16 qos;
199+
__le16 vlan_tag;
200+
};
201+
202+
struct hclge_mbx_vf_queue_info {
203+
__le16 num_tqps;
204+
__le16 rss_size;
205+
__le16 rx_buf_len;
206+
};
207+
208+
struct hclge_mbx_vf_queue_depth {
209+
__le16 num_tx_desc;
210+
__le16 num_rx_desc;
211+
};
212+
213+
struct hclge_mbx_vlan_filter {
214+
u8 is_kill;
215+
__le16 vlan_id;
216+
__le16 proto;
217+
};
218+
219+
struct hclge_mbx_mtu_info {
220+
__le32 mtu;
221+
};
222+
223+
#pragma pack()
224+
181225
/* used by VF to store the received Async responses from PF */
182226
struct hclgevf_mbx_arq_ring {
183227
#define HCLGE_MBX_MAX_ARQ_MSG_SIZE 8
@@ -186,7 +230,7 @@ struct hclgevf_mbx_arq_ring {
186230
u32 head;
187231
u32 tail;
188232
atomic_t count;
189-
u16 msg_q[HCLGE_MBX_MAX_ARQ_MSG_NUM][HCLGE_MBX_MAX_ARQ_MSG_SIZE];
233+
__le16 msg_q[HCLGE_MBX_MAX_ARQ_MSG_NUM][HCLGE_MBX_MAX_ARQ_MSG_SIZE];
190234
};
191235

192236
#define hclge_mbx_ring_ptr_move_crq(crq) \

drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_rss.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ int hclge_comm_parse_rss_hfunc(struct hclge_comm_rss_cfg *rss_cfg,
106106
void hclge_comm_get_rss_hash_info(struct hclge_comm_rss_cfg *rss_cfg, u8 *key,
107107
u8 *hfunc);
108108
void hclge_comm_get_rss_indir_tbl(struct hclge_comm_rss_cfg *rss_cfg,
109-
u32 *indir, __le16 rss_ind_tbl_size);
109+
u32 *indir, u16 rss_ind_tbl_size);
110110
int hclge_comm_set_rss_algo_key(struct hclge_comm_hw *hw, const u8 hfunc,
111111
const u8 *key);
112112
int hclge_comm_init_rss_tuple_cmd(struct hclge_comm_rss_cfg *rss_cfg,

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,8 +1915,11 @@ static int hns3_set_tunable(struct net_device *netdev,
19151915
return ret;
19161916
}
19171917

1918-
netdev_info(netdev, "the active tx spare buf size is %u, due to page order\n",
1919-
priv->ring->tx_spare->len);
1918+
if (!priv->ring->tx_spare)
1919+
netdev_info(netdev, "the active tx spare buf size is 0, disable tx spare buffer\n");
1920+
else
1921+
netdev_info(netdev, "the active tx spare buf size is %u, due to page order\n",
1922+
priv->ring->tx_spare->len);
19201923

19211924
break;
19221925
default:

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,9 +1546,8 @@ static void hclge_init_tc_config(struct hclge_dev *hdev)
15461546
static int hclge_configure(struct hclge_dev *hdev)
15471547
{
15481548
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
1549-
const struct cpumask *cpumask = cpu_online_mask;
15501549
struct hclge_cfg cfg;
1551-
int node, ret;
1550+
int ret;
15521551

15531552
ret = hclge_get_cfg(hdev, &cfg);
15541553
if (ret)
@@ -1594,13 +1593,6 @@ static int hclge_configure(struct hclge_dev *hdev)
15941593
hclge_init_tc_config(hdev);
15951594
hclge_init_kdump_kernel_config(hdev);
15961595

1597-
/* Set the affinity based on numa node */
1598-
node = dev_to_node(&hdev->pdev->dev);
1599-
if (node != NUMA_NO_NODE)
1600-
cpumask = cpumask_of_node(node);
1601-
1602-
cpumask_copy(&hdev->affinity_mask, cpumask);
1603-
16041596
return ret;
16051597
}
16061598

@@ -3564,17 +3556,6 @@ static void hclge_get_misc_vector(struct hclge_dev *hdev)
35643556
hdev->num_msi_used += 1;
35653557
}
35663558

3567-
static void hclge_misc_affinity_setup(struct hclge_dev *hdev)
3568-
{
3569-
irq_set_affinity_hint(hdev->misc_vector.vector_irq,
3570-
&hdev->affinity_mask);
3571-
}
3572-
3573-
static void hclge_misc_affinity_teardown(struct hclge_dev *hdev)
3574-
{
3575-
irq_set_affinity_hint(hdev->misc_vector.vector_irq, NULL);
3576-
}
3577-
35783559
static int hclge_misc_irq_init(struct hclge_dev *hdev)
35793560
{
35803561
int ret;
@@ -11457,11 +11438,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
1145711438
timer_setup(&hdev->reset_timer, hclge_reset_timer, 0);
1145811439
INIT_DELAYED_WORK(&hdev->service_task, hclge_service_task);
1145911440

11460-
/* Setup affinity after service timer setup because add_timer_on
11461-
* is called in affinity notify.
11462-
*/
11463-
hclge_misc_affinity_setup(hdev);
11464-
1146511441
hclge_clear_all_event_cause(hdev);
1146611442
hclge_clear_resetting_state(hdev);
1146711443

@@ -11879,7 +11855,6 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
1187911855

1188011856
hclge_reset_vf_rate(hdev);
1188111857
hclge_clear_vf_vlan(hdev);
11882-
hclge_misc_affinity_teardown(hdev);
1188311858
hclge_state_uninit(hdev);
1188411859
hclge_ptp_uninit(hdev);
1188511860
hclge_uninit_rxd_adv_layout(hdev);

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,8 @@ struct hclge_vf_vlan_cfg {
780780
union {
781781
struct {
782782
u8 is_kill;
783-
u16 vlan;
784-
u16 proto;
783+
__le16 vlan;
784+
__le16 proto;
785785
};
786786
u8 enable;
787787
};
@@ -938,8 +938,6 @@ struct hclge_dev {
938938
DECLARE_KFIFO(mac_tnl_log, struct hclge_mac_tnl_stats,
939939
HCLGE_MAC_TNL_LOG_SIZE);
940940

941-
/* affinity mask and notify for misc interrupt */
942-
cpumask_t affinity_mask;
943941
struct hclge_ptp *ptp;
944942
struct devlink *devlink;
945943
struct hclge_comm_rss_cfg rss_cfg;

0 commit comments

Comments
 (0)