X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Favf%2Fvirtchnl.h;h=1657c027e70f185e7e4527003080c1a9275a8a0d;hb=360b523b52a91bd0d1d7de1247141367c484d70f;hp=3b85b0ebd629c34db7747534e38ea52c99552404;hpb=43f64ce3a251f260a0ba3236f1baa3607c3e47f2;p=vpp.git diff --git a/src/plugins/avf/virtchnl.h b/src/plugins/avf/virtchnl.h index 3b85b0ebd62..1657c027e70 100644 --- a/src/plugins/avf/virtchnl.h +++ b/src/plugins/avf/virtchnl.h @@ -15,9 +15,22 @@ *------------------------------------------------------------------ */ +#ifndef _AVF_VIRTCHNL_H_ +#define _AVF_VIRTCHNL_H_ + #define VIRTCHNL_VERSION_MAJOR 1 #define VIRTCHNL_VERSION_MINOR 1 +#define foreach_avf_promisc_flags \ + _(0, UNICAST_PROMISC, "unicast") \ + _(1, MULTICAST_PROMISC, "multicast") + +enum +{ +#define _(a, b, c) FLAG_VF_ ##b = (1 << a), + foreach_avf_promisc_flags +#undef _ +}; #define AVFINT_DYN_CTLN(x) (0x00003800 + (0x4 * x)) #define AVFINT_ICR0 0x00004800 @@ -80,7 +93,12 @@ _(26, SET_RSS_HENA) \ _(27, ENABLE_VLAN_STRIPPING) \ _(28, DISABLE_VLAN_STRIPPING) \ - _(29, REQUEST_QUEUES) + _(29, REQUEST_QUEUES) \ + _(30, ENABLE_CHANNELS) \ + _(31, DISABLE_CHANNELS) \ + _(32, ADD_CLOUD_FILTER) \ + _(33, DEL_CLOUD_FILTER) + typedef enum { @@ -93,32 +111,36 @@ typedef enum typedef enum { VIRTCHNL_STATUS_SUCCESS = 0, - VIRTCHNL_ERR_PARAM = -5, + VIRTCHNL_STATUS_ERR_PARAM = -5, + VIRTCHNL_STATUS_ERR_NO_MEMORY = -18, VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH = -38, VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR = -39, VIRTCHNL_STATUS_ERR_INVALID_VF_ID = -40, + VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR = -53, VIRTCHNL_STATUS_NOT_SUPPORTED = -64, } virtchnl_status_code_t; #define foreach_avf_vf_cap_flag \ - _( 0, L2, "l2") \ - _( 1, IWARP, "iwarp") \ - _( 2, RSVD, "rsvd") \ - _( 3, RSS_AQ, "rss-aq") \ - _( 4, RSS_REG, "rss-reg") \ - _( 5, WB_ON_ITR, "wb-on-itr") \ - _( 6, REQ_QUEUES, "req-queues") \ - _(16, VLAN, "vlan") \ - _(17, RX_POLLING, "rx-polling") \ - _(18, RSS_PCTYPE_V2, "rss-pctype-v2") \ - _(19, RSS_PF, "rss-pf") \ - _(20, ENCAP, "encap") \ - _(21, ENCAP_CSUM, "encap-csum") \ - _(22, RX_ENCAP_CSUM, "rx-encap-csum") + _( 0, OFFLOAD_L2, "l2") \ + _( 1, OFFLOAD_IWARP, "iwarp") \ + _( 2, OFFLOAD_RSVD, "rsvd") \ + _( 3, OFFLOAD_RSS_AQ, "rss-aq") \ + _( 4, OFFLOAD_RSS_REG, "rss-reg") \ + _( 5, OFFLOAD_WB_ON_ITR, "wb-on-itr") \ + _( 6, OFFLOAD_REQ_QUEUES, "req-queues") \ + _( 7, CAP_ADV_LINK_SPEED, "adv-link-speed") \ + _(16, OFFLOAD_VLAN, "vlan") \ + _(17, OFFLOAD_RX_POLLING, "rx-polling") \ + _(18, OFFLOAD_RSS_PCTYPE_V2, "rss-pctype-v2") \ + _(19, OFFLOAD_RSS_PF, "rss-pf") \ + _(20, OFFLOAD_ENCAP, "encap") \ + _(21, OFFLOAD_ENCAP_CSUM, "encap-csum") \ + _(22, OFFLOAD_RX_ENCAP_CSUM, "rx-encap-csum") \ + _(23, OFFLOAD_ADQ, "offload-adq") typedef enum { -#define _(a, b, c) VIRTCHNL_VF_OFFLOAD_##b = (1 << a), +#define _(a, b, c) VIRTCHNL_VF_##b = (1 << a), foreach_avf_vf_cap_flag #undef _ } avf_vf_cap_flag_t; @@ -129,6 +151,13 @@ typedef enum VIRTCHNL_VSI_SRIOV = 6, } virtchnl_vsi_type_t; +typedef enum +{ + VIRTCHNL_VFR_INPROGRESS = 0, + VIRTCHNL_VFR_COMPLETED, + VIRTCHNL_VFR_VFACTIVE, +} virtchnl_vfr_states_t; + typedef struct { u16 vsi_id; @@ -150,21 +179,28 @@ typedef struct virtchnl_vsi_resource_t vsi_res[1]; } virtchnl_vf_resource_t; +#define foreach_virtchnl_event_code \ + _(0, UNKNOWN) \ + _(1, LINK_CHANGE) \ + _(2, RESET_IMPENDING) \ + _(3, PF_DRIVER_CLOSE) + typedef enum { - VIRTCHNL_EVENT_UNKNOWN = 0, - VIRTCHNL_EVENT_LINK_CHANGE, - VIRTCHNL_EVENT_RESET_IMPENDING, - VIRTCHNL_EVENT_PF_DRIVER_CLOSE, +#define _(a,b) VIRTCHNL_EVENT_##b = (a), + foreach_virtchnl_event_code +#undef _ } virtchnl_event_codes_t; #define foreach_virtchnl_link_speed \ + _(0, 2_5GB, "2.5 Gbps") \ _(1, 100MB, "100 Mbps") \ _(2, 1GB, "1 Gbps") \ _(3, 10GB, "10 Gbps") \ _(4, 40GB, "40 Gbps") \ _(5, 20GB, "20 Gbps") \ - _(6, 25GB, "25 Gbps") + _(6, 25GB, "25 Gbps") \ + _(7, 5GB, "5 Gbps") typedef enum { @@ -182,8 +218,13 @@ typedef struct struct { virtchnl_link_speed_t link_speed; - _Bool link_status; + u8 link_status; } link_event; + struct + { + u32 link_speed; + u8 link_status; + } link_event_adv; } event_data; int severity; } virtchnl_pf_event_t; @@ -352,6 +393,14 @@ typedef struct STATIC_ASSERT_SIZEOF (virtchnl_rss_lut_t, 6); +/* VIRTCHNL_OP_REQUEST_QUEUES */ +typedef struct +{ + u16 num_queue_pairs; +} virtchnl_vf_res_request_t; + +#endif /* AVF_VIRTCHNL_H */ + /* * fd.io coding-style-patch-verification: ON *