Skip to content

Commit f758cf0

Browse files
author
Nelson Escobar
committed
enic: enic rq extended cq defines
JIRA: https://issues.redhat.com/browse/RHEL-84863 commit 2be2eb7 Author: Satish Kharat <satishkh@cisco.com> Date: Tue Mar 4 19:56:39 2025 -0500 enic: enic rq extended cq defines Adds the defines for 32 and 64 byte receive queue completion queue descriptors. Adds devcmd define to get rq cq descriptor size/s supported by hw. Co-developed-by: Nelson Escobar <neescoba@cisco.com> Signed-off-by: Nelson Escobar <neescoba@cisco.com> Co-developed-by: John Daley <johndale@cisco.com> Signed-off-by: John Daley <johndale@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Link: https://patch.msgid.link/20250304-enic_cleanup_and_ext_cq-v2-3-85804263dad8@cisco.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Nelson Escobar <nescobar@redhat.com>
1 parent 0b87432 commit f758cf0

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

drivers/net/ethernet/cisco/enic/cq_enet_desc.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ static inline void cq_enet_wq_desc_dec(struct cq_enet_wq_desc *desc,
2424
color, q_number, completed_index);
2525
}
2626

27+
/*
28+
* Defines and Capabilities for CMD_CQ_ENTRY_SIZE_SET
29+
*/
30+
#define VNIC_RQ_ALL (~0ULL)
31+
32+
#define VNIC_RQ_CQ_ENTRY_SIZE_16 0
33+
#define VNIC_RQ_CQ_ENTRY_SIZE_32 1
34+
#define VNIC_RQ_CQ_ENTRY_SIZE_64 2
35+
36+
#define VNIC_RQ_CQ_ENTRY_SIZE_16_CAPABLE BIT(VNIC_RQ_CQ_ENTRY_SIZE_16)
37+
#define VNIC_RQ_CQ_ENTRY_SIZE_32_CAPABLE BIT(VNIC_RQ_CQ_ENTRY_SIZE_32)
38+
#define VNIC_RQ_CQ_ENTRY_SIZE_64_CAPABLE BIT(VNIC_RQ_CQ_ENTRY_SIZE_64)
39+
40+
#define VNIC_RQ_CQ_ENTRY_SIZE_ALL_BIT (VNIC_RQ_CQ_ENTRY_SIZE_16_CAPABLE | \
41+
VNIC_RQ_CQ_ENTRY_SIZE_32_CAPABLE | \
42+
VNIC_RQ_CQ_ENTRY_SIZE_64_CAPABLE)
43+
2744
/* Completion queue descriptor: Ethernet receive queue, 16B */
2845
struct cq_enet_rq_desc {
2946
__le16 completed_index_flags;
@@ -36,6 +53,45 @@ struct cq_enet_rq_desc {
3653
u8 type_color;
3754
};
3855

56+
/* Completion queue descriptor: Ethernet receive queue, 32B */
57+
struct cq_enet_rq_desc_32 {
58+
__le16 completed_index_flags;
59+
__le16 q_number_rss_type_flags;
60+
__le32 rss_hash;
61+
__le16 bytes_written_flags;
62+
__le16 vlan;
63+
__le16 checksum_fcoe;
64+
u8 flags;
65+
u8 fetch_index_flags;
66+
__le32 time_stamp;
67+
__le16 time_stamp2;
68+
__le16 pie_info;
69+
__le32 pie_info2;
70+
__le16 pie_info3;
71+
u8 pie_info4;
72+
u8 type_color;
73+
};
74+
75+
/* Completion queue descriptor: Ethernet receive queue, 64B */
76+
struct cq_enet_rq_desc_64 {
77+
__le16 completed_index_flags;
78+
__le16 q_number_rss_type_flags;
79+
__le32 rss_hash;
80+
__le16 bytes_written_flags;
81+
__le16 vlan;
82+
__le16 checksum_fcoe;
83+
u8 flags;
84+
u8 fetch_index_flags;
85+
__le32 time_stamp;
86+
__le16 time_stamp2;
87+
__le16 pie_info;
88+
__le32 pie_info2;
89+
__le16 pie_info3;
90+
u8 pie_info4;
91+
u8 reserved[32];
92+
u8 type_color;
93+
};
94+
3995
#define CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT (0x1 << 12)
4096
#define CQ_ENET_RQ_DESC_FLAGS_FCOE (0x1 << 13)
4197
#define CQ_ENET_RQ_DESC_FLAGS_EOP (0x1 << 14)

drivers/net/ethernet/cisco/enic/vnic_devcmd.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,25 @@ enum vnic_devcmd_cmd {
436436
* in: (u16) a2 = unsigned short int port information
437437
*/
438438
CMD_OVERLAY_OFFLOAD_CFG = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 73),
439+
440+
/*
441+
* Set extended CQ field in MREGS of RQ (or all RQs)
442+
* for given vNIC
443+
* in: (u64) a0 = RQ selection (VNIC_RQ_ALL for all RQs)
444+
* (u32) a1 = CQ entry size
445+
* VNIC_RQ_CQ_ENTRY_SIZE_16 --> 16 bytes
446+
* VNIC_RQ_CQ_ENTRY_SIZE_32 --> 32 bytes
447+
* VNIC_RQ_CQ_ENTRY_SIZE_64 --> 64 bytes
448+
*
449+
* Capability query:
450+
* out: (u32) a0 = errno, 0:valid cmd
451+
* (u32) a1 = value consisting of supported entries
452+
* bit 0: 16 bytes
453+
* bit 1: 32 bytes
454+
* bit 2: 64 bytes
455+
*/
456+
CMD_CQ_ENTRY_SIZE_SET = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 90),
457+
439458
};
440459

441460
/* CMD_ENABLE2 flags */

0 commit comments

Comments
 (0)