0001
0002
0003
0004 #ifndef _IIDC_H_
0005 #define _IIDC_H_
0006
0007 #include <linux/auxiliary_bus.h>
0008 #include <linux/dcbnl.h>
0009 #include <linux/device.h>
0010 #include <linux/if_ether.h>
0011 #include <linux/kernel.h>
0012 #include <linux/netdevice.h>
0013
0014 enum iidc_event_type {
0015 IIDC_EVENT_BEFORE_MTU_CHANGE,
0016 IIDC_EVENT_AFTER_MTU_CHANGE,
0017 IIDC_EVENT_BEFORE_TC_CHANGE,
0018 IIDC_EVENT_AFTER_TC_CHANGE,
0019 IIDC_EVENT_CRIT_ERR,
0020 IIDC_EVENT_NBITS
0021 };
0022
0023 enum iidc_reset_type {
0024 IIDC_PFR,
0025 IIDC_CORER,
0026 IIDC_GLOBR,
0027 };
0028
0029 enum iidc_rdma_protocol {
0030 IIDC_RDMA_PROTOCOL_IWARP = BIT(0),
0031 IIDC_RDMA_PROTOCOL_ROCEV2 = BIT(1),
0032 };
0033
0034 #define IIDC_MAX_USER_PRIORITY 8
0035 #define IIDC_MAX_DSCP_MAPPING 64
0036 #define IIDC_DSCP_PFC_MODE 0x1
0037
0038
0039 struct iidc_rdma_qset_params {
0040
0041
0042
0043
0044 u32 teid;
0045 u16 qs_handle;
0046 u16 vport_id;
0047 u8 tc;
0048 };
0049
0050 struct iidc_qos_info {
0051 u64 tc_ctx;
0052 u8 rel_bw;
0053 u8 prio_type;
0054 u8 egress_virt_up;
0055 u8 ingress_virt_up;
0056 };
0057
0058
0059 struct iidc_qos_params {
0060 struct iidc_qos_info tc_info[IEEE_8021QAZ_MAX_TCS];
0061 u8 up2tc[IIDC_MAX_USER_PRIORITY];
0062 u8 vport_relative_bw;
0063 u8 vport_priority_type;
0064 u8 num_tc;
0065 u8 pfc_mode;
0066 u8 dscp_map[IIDC_MAX_DSCP_MAPPING];
0067 };
0068
0069 struct iidc_event {
0070 DECLARE_BITMAP(type, IIDC_EVENT_NBITS);
0071 u32 reg;
0072 };
0073
0074 struct ice_pf;
0075
0076 int ice_add_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset);
0077 int ice_del_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset);
0078 int ice_rdma_request_reset(struct ice_pf *pf, enum iidc_reset_type reset_type);
0079 int ice_rdma_update_vsi_filter(struct ice_pf *pf, u16 vsi_id, bool enable);
0080 void ice_get_qos_params(struct ice_pf *pf, struct iidc_qos_params *qos);
0081
0082
0083
0084
0085
0086
0087 struct iidc_auxiliary_dev {
0088 struct auxiliary_device adev;
0089 struct ice_pf *pf;
0090 };
0091
0092
0093
0094
0095
0096
0097 struct iidc_auxiliary_drv {
0098 struct auxiliary_driver adrv;
0099
0100
0101
0102
0103
0104 void (*event_handler)(struct ice_pf *pf, struct iidc_event *event);
0105 };
0106
0107 #endif