Skip to content

Commit e8b367b

Browse files
committed
Merge: idpf: driver update to v6.9-rc7
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4218 JIRA: https://issues.redhat.com/browse/RHEL-29553 Depends: !4135 Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Scott Weaver <scweaver@redhat.com>
2 parents c5a93e5 + 02cc1bd commit e8b367b

File tree

12 files changed

+1275
-1382
lines changed

12 files changed

+1275
-1382
lines changed

drivers/net/ethernet/intel/idpf/idpf.h

Lines changed: 13 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct idpf_vport_max_q;
1515
#include <linux/pci.h>
1616
#include <linux/bitfield.h>
1717
#include <linux/sctp.h>
18-
#include <linux/ethtool.h>
18+
#include <linux/ethtool_netlink.h>
1919
#include <net/gro.h>
2020
#include <linux/dim.h>
2121

@@ -37,8 +37,6 @@ struct idpf_vport_max_q;
3737
#define IDPF_MB_MAX_ERR 20
3838
#define IDPF_NUM_CHUNKS_PER_MSG(struct_sz, chunk_sz) \
3939
((IDPF_CTLQ_MAX_BUF_LEN - (struct_sz)) / (chunk_sz))
40-
#define IDPF_WAIT_FOR_EVENT_TIMEO_MIN 2000
41-
#define IDPF_WAIT_FOR_EVENT_TIMEO 60000
4240

4341
#define IDPF_MAX_WAIT 500
4442

@@ -66,14 +64,12 @@ struct idpf_mac_filter {
6664

6765
/**
6866
* enum idpf_state - State machine to handle bring up
69-
* @__IDPF_STARTUP: Start the state machine
7067
* @__IDPF_VER_CHECK: Negotiate virtchnl version
7168
* @__IDPF_GET_CAPS: Negotiate capabilities
7269
* @__IDPF_INIT_SW: Init based on given capabilities
7370
* @__IDPF_STATE_LAST: Must be last, used to determine size
7471
*/
7572
enum idpf_state {
76-
__IDPF_STARTUP,
7773
__IDPF_VER_CHECK,
7874
__IDPF_GET_CAPS,
7975
__IDPF_INIT_SW,
@@ -87,6 +83,7 @@ enum idpf_state {
8783
* @IDPF_HR_RESET_IN_PROG: Reset in progress
8884
* @IDPF_REMOVE_IN_PROG: Driver remove in progress
8985
* @IDPF_MB_INTR_MODE: Mailbox in interrupt mode
86+
* @IDPF_VC_CORE_INIT: virtchnl core has been init
9087
* @IDPF_FLAGS_NBITS: Must be last
9188
*/
9289
enum idpf_flags {
@@ -95,6 +92,7 @@ enum idpf_flags {
9592
IDPF_HR_RESET_IN_PROG,
9693
IDPF_REMOVE_IN_PROG,
9794
IDPF_MB_INTR_MODE,
95+
IDPF_VC_CORE_INIT,
9896
IDPF_FLAGS_NBITS,
9997
};
10098

@@ -209,71 +207,6 @@ struct idpf_dev_ops {
209207
struct idpf_reg_ops reg_ops;
210208
};
211209

212-
/* These macros allow us to generate an enum and a matching char * array of
213-
* stringified enums that are always in sync. Checkpatch issues a bogus warning
214-
* about this being a complex macro; but it's wrong, these are never used as a
215-
* statement and instead only used to define the enum and array.
216-
*/
217-
#define IDPF_FOREACH_VPORT_VC_STATE(STATE) \
218-
STATE(IDPF_VC_CREATE_VPORT) \
219-
STATE(IDPF_VC_CREATE_VPORT_ERR) \
220-
STATE(IDPF_VC_ENA_VPORT) \
221-
STATE(IDPF_VC_ENA_VPORT_ERR) \
222-
STATE(IDPF_VC_DIS_VPORT) \
223-
STATE(IDPF_VC_DIS_VPORT_ERR) \
224-
STATE(IDPF_VC_DESTROY_VPORT) \
225-
STATE(IDPF_VC_DESTROY_VPORT_ERR) \
226-
STATE(IDPF_VC_CONFIG_TXQ) \
227-
STATE(IDPF_VC_CONFIG_TXQ_ERR) \
228-
STATE(IDPF_VC_CONFIG_RXQ) \
229-
STATE(IDPF_VC_CONFIG_RXQ_ERR) \
230-
STATE(IDPF_VC_ENA_QUEUES) \
231-
STATE(IDPF_VC_ENA_QUEUES_ERR) \
232-
STATE(IDPF_VC_DIS_QUEUES) \
233-
STATE(IDPF_VC_DIS_QUEUES_ERR) \
234-
STATE(IDPF_VC_MAP_IRQ) \
235-
STATE(IDPF_VC_MAP_IRQ_ERR) \
236-
STATE(IDPF_VC_UNMAP_IRQ) \
237-
STATE(IDPF_VC_UNMAP_IRQ_ERR) \
238-
STATE(IDPF_VC_ADD_QUEUES) \
239-
STATE(IDPF_VC_ADD_QUEUES_ERR) \
240-
STATE(IDPF_VC_DEL_QUEUES) \
241-
STATE(IDPF_VC_DEL_QUEUES_ERR) \
242-
STATE(IDPF_VC_ALLOC_VECTORS) \
243-
STATE(IDPF_VC_ALLOC_VECTORS_ERR) \
244-
STATE(IDPF_VC_DEALLOC_VECTORS) \
245-
STATE(IDPF_VC_DEALLOC_VECTORS_ERR) \
246-
STATE(IDPF_VC_SET_SRIOV_VFS) \
247-
STATE(IDPF_VC_SET_SRIOV_VFS_ERR) \
248-
STATE(IDPF_VC_GET_RSS_LUT) \
249-
STATE(IDPF_VC_GET_RSS_LUT_ERR) \
250-
STATE(IDPF_VC_SET_RSS_LUT) \
251-
STATE(IDPF_VC_SET_RSS_LUT_ERR) \
252-
STATE(IDPF_VC_GET_RSS_KEY) \
253-
STATE(IDPF_VC_GET_RSS_KEY_ERR) \
254-
STATE(IDPF_VC_SET_RSS_KEY) \
255-
STATE(IDPF_VC_SET_RSS_KEY_ERR) \
256-
STATE(IDPF_VC_GET_STATS) \
257-
STATE(IDPF_VC_GET_STATS_ERR) \
258-
STATE(IDPF_VC_ADD_MAC_ADDR) \
259-
STATE(IDPF_VC_ADD_MAC_ADDR_ERR) \
260-
STATE(IDPF_VC_DEL_MAC_ADDR) \
261-
STATE(IDPF_VC_DEL_MAC_ADDR_ERR) \
262-
STATE(IDPF_VC_GET_PTYPE_INFO) \
263-
STATE(IDPF_VC_GET_PTYPE_INFO_ERR) \
264-
STATE(IDPF_VC_LOOPBACK_STATE) \
265-
STATE(IDPF_VC_LOOPBACK_STATE_ERR) \
266-
STATE(IDPF_VC_NBITS)
267-
268-
#define IDPF_GEN_ENUM(ENUM) ENUM,
269-
#define IDPF_GEN_STRING(STRING) #STRING,
270-
271-
enum idpf_vport_vc_state {
272-
IDPF_FOREACH_VPORT_VC_STATE(IDPF_GEN_ENUM)
273-
};
274-
275-
extern const char * const idpf_vport_vc_state_str[];
276-
277210
/**
278211
* enum idpf_vport_reset_cause - Vport soft reset causes
279212
* @IDPF_SR_Q_CHANGE: Soft reset queue change
@@ -358,11 +291,7 @@ struct idpf_port_stats {
358291
* @port_stats: per port csum, header split, and other offload stats
359292
* @link_up: True if link is up
360293
* @link_speed_mbps: Link speed in mbps
361-
* @vc_msg: Virtchnl message buffer
362-
* @vc_state: Virtchnl message state
363-
* @vchnl_wq: Wait queue for virtchnl messages
364294
* @sw_marker_wq: workqueue for marker packets
365-
* @vc_buf_lock: Lock to protect virtchnl buffer
366295
*/
367296
struct idpf_vport {
368297
u16 num_txq;
@@ -408,21 +337,18 @@ struct idpf_vport {
408337
bool link_up;
409338
u32 link_speed_mbps;
410339

411-
char vc_msg[IDPF_CTLQ_MAX_BUF_LEN];
412-
DECLARE_BITMAP(vc_state, IDPF_VC_NBITS);
413-
414-
wait_queue_head_t vchnl_wq;
415340
wait_queue_head_t sw_marker_wq;
416-
struct mutex vc_buf_lock;
417341
};
418342

419343
/**
420344
* enum idpf_user_flags
345+
* @__IDPF_USER_FLAG_HSPLIT: header split state
421346
* @__IDPF_PROMISC_UC: Unicast promiscuous mode
422347
* @__IDPF_PROMISC_MC: Multicast promiscuous mode
423348
* @__IDPF_USER_FLAGS_NBITS: Must be last
424349
*/
425350
enum idpf_user_flags {
351+
__IDPF_USER_FLAG_HSPLIT = 0U,
426352
__IDPF_PROMISC_UC = 32,
427353
__IDPF_PROMISC_MC,
428354

@@ -474,15 +400,11 @@ struct idpf_vport_user_config_data {
474400
* enum idpf_vport_config_flags - Vport config flags
475401
* @IDPF_VPORT_REG_NETDEV: Register netdev
476402
* @IDPF_VPORT_UP_REQUESTED: Set if interface up is requested on core reset
477-
* @IDPF_VPORT_ADD_MAC_REQ: Asynchronous add ether address in flight
478-
* @IDPF_VPORT_DEL_MAC_REQ: Asynchronous delete ether address in flight
479403
* @IDPF_VPORT_CONFIG_FLAGS_NBITS: Must be last
480404
*/
481405
enum idpf_vport_config_flags {
482406
IDPF_VPORT_REG_NETDEV,
483407
IDPF_VPORT_UP_REQUESTED,
484-
IDPF_VPORT_ADD_MAC_REQ,
485-
IDPF_VPORT_DEL_MAC_REQ,
486408
IDPF_VPORT_CONFIG_FLAGS_NBITS,
487409
};
488410

@@ -553,11 +475,13 @@ struct idpf_vector_lifo {
553475
struct idpf_vport_config {
554476
struct idpf_vport_user_config_data user_config;
555477
struct idpf_vport_max_q max_q;
556-
void *req_qs_chunks;
478+
struct virtchnl2_add_queues *req_qs_chunks;
557479
spinlock_t mac_filter_list_lock;
558480
DECLARE_BITMAP(flags, IDPF_VPORT_CONFIG_FLAGS_NBITS);
559481
};
560482

483+
struct idpf_vc_xn_manager;
484+
561485
/**
562486
* struct idpf_adapter - Device data struct generated on probe
563487
* @pdev: PCI device struct given on probe
@@ -599,9 +523,7 @@ struct idpf_vport_config {
599523
* @stats_task: Periodic statistics retrieval task
600524
* @stats_wq: Workqueue for statistics task
601525
* @caps: Negotiated capabilities with device
602-
* @vchnl_wq: Wait queue for virtchnl messages
603-
* @vc_state: Virtchnl message state
604-
* @vc_msg: Virtchnl message buffer
526+
* @vcxn_mngr: Virtchnl transaction manager
605527
* @dev_ops: See idpf_dev_ops
606528
* @num_vfs: Number of allocated VFs through sysfs. PF does not directly talk
607529
* to VFs but is used to initialize them
@@ -657,10 +579,8 @@ struct idpf_adapter {
657579
struct delayed_work stats_task;
658580
struct workqueue_struct *stats_wq;
659581
struct virtchnl2_get_capabilities caps;
582+
struct idpf_vc_xn_manager *vcxn_mngr;
660583

661-
wait_queue_head_t vchnl_wq;
662-
DECLARE_BITMAP(vc_state, IDPF_VC_NBITS);
663-
char vc_msg[IDPF_CTLQ_MAX_BUF_LEN];
664584
struct idpf_dev_ops dev_ops;
665585
int num_vfs;
666586
bool crc_enable;
@@ -901,68 +821,21 @@ void idpf_mbx_task(struct work_struct *work);
901821
void idpf_vc_event_task(struct work_struct *work);
902822
void idpf_dev_ops_init(struct idpf_adapter *adapter);
903823
void idpf_vf_dev_ops_init(struct idpf_adapter *adapter);
904-
int idpf_vport_adjust_qs(struct idpf_vport *vport);
905-
int idpf_init_dflt_mbx(struct idpf_adapter *adapter);
906-
void idpf_deinit_dflt_mbx(struct idpf_adapter *adapter);
907-
int idpf_vc_core_init(struct idpf_adapter *adapter);
908-
void idpf_vc_core_deinit(struct idpf_adapter *adapter);
909824
int idpf_intr_req(struct idpf_adapter *adapter);
910825
void idpf_intr_rel(struct idpf_adapter *adapter);
911-
int idpf_get_reg_intr_vecs(struct idpf_vport *vport,
912-
struct idpf_vec_regs *reg_vals);
913826
u16 idpf_get_max_tx_hdr_size(struct idpf_adapter *adapter);
914-
int idpf_send_delete_queues_msg(struct idpf_vport *vport);
915-
int idpf_send_add_queues_msg(const struct idpf_vport *vport, u16 num_tx_q,
916-
u16 num_complq, u16 num_rx_q, u16 num_rx_bufq);
917827
int idpf_initiate_soft_reset(struct idpf_vport *vport,
918828
enum idpf_vport_reset_cause reset_cause);
919-
int idpf_send_enable_vport_msg(struct idpf_vport *vport);
920-
int idpf_send_disable_vport_msg(struct idpf_vport *vport);
921-
int idpf_send_destroy_vport_msg(struct idpf_vport *vport);
922-
int idpf_send_get_rx_ptype_msg(struct idpf_vport *vport);
923-
int idpf_send_ena_dis_loopback_msg(struct idpf_vport *vport);
924-
int idpf_send_get_set_rss_key_msg(struct idpf_vport *vport, bool get);
925-
int idpf_send_get_set_rss_lut_msg(struct idpf_vport *vport, bool get);
926-
int idpf_send_dealloc_vectors_msg(struct idpf_adapter *adapter);
927-
int idpf_send_alloc_vectors_msg(struct idpf_adapter *adapter, u16 num_vectors);
928829
void idpf_deinit_task(struct idpf_adapter *adapter);
929830
int idpf_req_rel_vector_indexes(struct idpf_adapter *adapter,
930831
u16 *q_vector_idxs,
931832
struct idpf_vector_info *vec_info);
932-
int idpf_vport_alloc_vec_indexes(struct idpf_vport *vport);
933-
int idpf_send_get_stats_msg(struct idpf_vport *vport);
934-
int idpf_get_vec_ids(struct idpf_adapter *adapter,
935-
u16 *vecids, int num_vecids,
936-
struct virtchnl2_vector_chunks *chunks);
937-
int idpf_recv_mb_msg(struct idpf_adapter *adapter, u32 op,
938-
void *msg, int msg_size);
939-
int idpf_send_mb_msg(struct idpf_adapter *adapter, u32 op,
940-
u16 msg_size, u8 *msg);
941833
void idpf_set_ethtool_ops(struct net_device *netdev);
942-
int idpf_vport_alloc_max_qs(struct idpf_adapter *adapter,
943-
struct idpf_vport_max_q *max_q);
944-
void idpf_vport_dealloc_max_qs(struct idpf_adapter *adapter,
945-
struct idpf_vport_max_q *max_q);
946-
int idpf_add_del_mac_filters(struct idpf_vport *vport,
947-
struct idpf_netdev_priv *np,
948-
bool add, bool async);
949-
int idpf_set_promiscuous(struct idpf_adapter *adapter,
950-
struct idpf_vport_user_config_data *config_data,
951-
u32 vport_id);
952-
int idpf_send_disable_queues_msg(struct idpf_vport *vport);
953-
void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q);
954-
u32 idpf_get_vport_id(struct idpf_vport *vport);
955-
int idpf_vport_queue_ids_init(struct idpf_vport *vport);
956-
int idpf_queue_reg_init(struct idpf_vport *vport);
957-
int idpf_send_config_queues_msg(struct idpf_vport *vport);
958-
int idpf_send_enable_queues_msg(struct idpf_vport *vport);
959-
int idpf_send_create_vport_msg(struct idpf_adapter *adapter,
960-
struct idpf_vport_max_q *max_q);
961-
int idpf_check_supported_desc_ids(struct idpf_vport *vport);
962834
void idpf_vport_intr_write_itr(struct idpf_q_vector *q_vector,
963835
u16 itr, bool tx);
964-
int idpf_send_map_unmap_queue_vector_msg(struct idpf_vport *vport, bool map);
965-
int idpf_send_set_sriov_vfs_msg(struct idpf_adapter *adapter, u16 num_vfs);
966836
int idpf_sriov_configure(struct pci_dev *pdev, int num_vfs);
967837

838+
u8 idpf_vport_get_hsplit(const struct idpf_vport *vport);
839+
bool idpf_vport_set_hsplit(const struct idpf_vport *vport, u8 val);
840+
968841
#endif /* !_IDPF_H_ */

drivers/net/ethernet/intel/idpf/idpf_controlq.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@ int idpf_ctlq_post_rx_buffs(struct idpf_hw *hw, struct idpf_ctlq_info *cq,
516516
/* Wrap to end of end ring since current ntp is 0 */
517517
cq->next_to_post = cq->ring_size - 1;
518518

519+
dma_wmb();
520+
519521
wr32(hw, cq->reg.tail, cq->next_to_post);
520522
}
521523

@@ -546,11 +548,6 @@ int idpf_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,
546548
int err = 0;
547549
u16 i;
548550

549-
if (*num_q_msg == 0)
550-
return 0;
551-
else if (*num_q_msg > cq->ring_size)
552-
return -EBADR;
553-
554551
/* take the lock before we start messing with the ring */
555552
mutex_lock(&cq->cq_lock);
556553

drivers/net/ethernet/intel/idpf/idpf_controlq_api.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ struct idpf_ctlq_msg {
6969
u8 context[IDPF_INDIRECT_CTX_SIZE];
7070
struct idpf_dma_mem *payload;
7171
} indirect;
72+
struct {
73+
u32 rsvd;
74+
u16 data;
75+
u16 flags;
76+
} sw_cookie;
7277
} ctx;
7378
};
7479

drivers/net/ethernet/intel/idpf/idpf_dev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "idpf.h"
55
#include "idpf_lan_pf_regs.h"
6+
#include "idpf_virtchnl.h"
67

78
#define IDPF_PF_ITR_IDX_SPACING 0x4
89

drivers/net/ethernet/intel/idpf/idpf_ethtool.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ static void idpf_get_ringparam(struct net_device *netdev,
318318
ring->rx_pending = vport->rxq_desc_count;
319319
ring->tx_pending = vport->txq_desc_count;
320320

321+
kring->tcp_data_split = idpf_vport_get_hsplit(vport);
322+
321323
idpf_vport_ctrl_unlock(netdev);
322324
}
323325

@@ -377,6 +379,14 @@ static int idpf_set_ringparam(struct net_device *netdev,
377379
new_rx_count == vport->rxq_desc_count)
378380
goto unlock_mutex;
379381

382+
if (!idpf_vport_set_hsplit(vport, kring->tcp_data_split)) {
383+
NL_SET_ERR_MSG_MOD(ext_ack,
384+
"setting TCP data split is not supported");
385+
err = -EOPNOTSUPP;
386+
387+
goto unlock_mutex;
388+
}
389+
380390
config_data = &vport->adapter->vport_config[idx]->user_config;
381391
config_data->num_req_txq_desc = new_tx_count;
382392
config_data->num_req_rxq_desc = new_rx_count;
@@ -1332,6 +1342,7 @@ static int idpf_get_link_ksettings(struct net_device *netdev,
13321342
static const struct ethtool_ops idpf_ethtool_ops = {
13331343
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
13341344
ETHTOOL_COALESCE_USE_ADAPTIVE,
1345+
.supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT,
13351346
.get_msglevel = idpf_get_msglevel,
13361347
.set_msglevel = idpf_set_msglevel,
13371348
.get_link = ethtool_op_get_link,

0 commit comments

Comments
 (0)