X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fbase%2Fice_parser.h;h=22c73b686b96e7e1b9b6a55fd2c383a65ec5116a;hb=3d6502ee01a92f445f84af6e0660c5a0044acc35;hp=ba3175e60f290047827692f0ded5fab7575868a7;hpb=0cbacf60dce73870725d3326068f98e4175eda1f;p=dpdk.git diff --git a/drivers/net/ice/base/ice_parser.h b/drivers/net/ice/base/ice_parser.h index ba3175e60f..22c73b686b 100644 --- a/drivers/net/ice/base/ice_parser.h +++ b/drivers/net/ice/base/ice_parser.h @@ -14,6 +14,8 @@ #include "ice_proto_grp.h" #include "ice_flg_rd.h" #include "ice_xlt_kb.h" +#include "ice_parser_rt.h" +#include "ice_tmatch.h" struct ice_parser { struct ice_hw *hw; /* pointer to the hardware structure */ @@ -50,8 +52,64 @@ struct ice_parser { struct ice_xlt_kb *xlt_kb_fd; /* load data from section ICE_SID_XLT_KEY_BUILDER_RSS */ struct ice_xlt_kb *xlt_kb_rss; + struct ice_parser_rt rt; /* parser runtime */ }; enum ice_status ice_parser_create(struct ice_hw *hw, struct ice_parser **psr); void ice_parser_destroy(struct ice_parser *psr); +void ice_parser_dvm_set(struct ice_parser *psr, bool on); +enum ice_status ice_parser_vxlan_tunnel_set(struct ice_parser *psr, + u16 udp_port, bool on); +enum ice_status ice_parser_geneve_tunnel_set(struct ice_parser *psr, + u16 udp_port, bool on); +enum ice_status ice_parser_ecpri_tunnel_set(struct ice_parser *psr, + u16 udp_port, bool on); + +struct ice_parser_proto_off { + u8 proto_id; /* hardware protocol ID */ + u16 offset; /* offset where the protocol header start */ +}; + +struct ice_parser_result { + u16 ptype; /* 16 bits hardware PTYPE */ + /* protocol and header offset pairs */ + struct ice_parser_proto_off po[16]; + int po_num; /* number of pairs must <= 16 */ + u64 flags_psr; /* 64 bits parser flags */ + u64 flags_pkt; /* 64 bits packet flags */ + u16 flags_sw; /* 16 bits key builder flag for SW */ + u16 flags_acl; /* 16 bits key builder flag for ACL */ + u16 flags_fd; /* 16 bits key builder flag for FD */ + u16 flags_rss; /* 16 bits key builder flag for RSS */ +}; + +enum ice_status ice_parser_run(struct ice_parser *psr, const u8 *pkt_buf, + int pkt_len, struct ice_parser_result *rslt); +void ice_parser_result_dump(struct ice_hw *hw, struct ice_parser_result *rslt); + +struct ice_parser_fv { + u8 proto_id; /* hardware protocol ID */ + u16 offset; /* offset from the start of the protocol header */ + u16 spec; /* 16 bits pattern to match */ + u16 msk; /* 16 bits pattern mask */ +}; + +struct ice_parser_profile { + struct ice_parser_fv fv[48]; /* field vector array */ + int fv_num; /* field vector number must <= 48 */ + u16 flags; /* 16 bits key builder flag */ + u16 flags_msk; /* key builder flag masker */ + /* 1024 bits PTYPE bitmap */ + ice_declare_bitmap(ptypes, ICE_FLOW_PTYPE_MAX); +}; + +enum ice_status ice_parser_profile_init(struct ice_parser_result *rslt, + const u8 *pkt_buf, const u8 *msk_buf, + int buf_len, enum ice_block blk, + bool prefix_match, + struct ice_parser_profile *prof); +void ice_parser_profile_dump(struct ice_hw *hw, + struct ice_parser_profile *prof); +bool ice_check_ddp_support_proto_id(struct ice_hw *hw, + enum ice_prot_id proto_id); #endif /* _ICE_PARSER_H_ */