net/bnxt: cleanup VF representor device operations
[dpdk.git] / drivers / net / bnxt / bnxt.h
index 65862ab..f4b2a3f 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "tf_core.h"
 #include "bnxt_ulp.h"
+#include "bnxt_tf_common.h"
 
 /* Vendor ID */
 #define PCI_VENDOR_ID_BROADCOM         0x14E4
@@ -182,13 +183,6 @@ struct bnxt_led_cfg {
 #define BNXT_LED_DFLT_ENABLES(x)                        \
        rte_cpu_to_le_32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
 
-enum bnxt_hw_context {
-       HW_CONTEXT_NONE     = 0,
-       HW_CONTEXT_IS_RSS   = 1,
-       HW_CONTEXT_IS_COS   = 2,
-       HW_CONTEXT_IS_LB    = 3,
-};
-
 struct bnxt_vlan_table_entry {
        uint16_t                tpid;
        uint16_t                vid;
@@ -563,6 +557,13 @@ struct bnxt_rep_info {
                                     DEV_RX_OFFLOAD_SCATTER | \
                                     DEV_RX_OFFLOAD_RSS_HASH)
 
+#define  MAX_TABLE_SUPPORT 4
+#define  MAX_DIR_SUPPORT   2
+struct bnxt_dmabuf_info {
+       uint32_t entry_num;
+       int      fd[MAX_DIR_SUPPORT][MAX_TABLE_SUPPORT];
+};
+
 #define BNXT_HWRM_SHORT_REQ_LEN                sizeof(struct hwrm_short_input)
 
 struct bnxt_flow_stat_info {
@@ -637,8 +638,6 @@ struct bnxt {
 #define BNXT_FW_CAP_ADV_FLOW_COUNTERS  BIT(6)
 #define BNXT_FW_CAP_HCOMM_FW_STATUS    BIT(7)
 
-       uint32_t                flow_flags;
-#define BNXT_FLOW_FLAG_L2_HDR_SRC_FILTER_EN    BIT(0)
        pthread_mutex_t         flow_lock;
 
        uint32_t                vnic_cap_flags;
@@ -780,10 +779,12 @@ struct bnxt {
        uint16_t                port_svif;
 
        struct tf               tfp;
+       struct bnxt_dmabuf_info dmabuf;
        struct bnxt_ulp_context *ulp_ctx;
        struct bnxt_flow_stat_info *flow_stat;
        uint8_t                 flow_xstat;
        uint16_t                max_num_kflows;
+       uint16_t                tx_cfa_action;
 };
 
 #define BNXT_FC_TIMER  1 /* Timer freq in Sec Flow Counters */
@@ -797,8 +798,9 @@ struct bnxt_vf_representor {
        uint16_t                fw_fid;
        uint16_t                dflt_vnic_id;
        uint16_t                svif;
-       uint16_t                tx_cfa_action;
-       uint16_t                rx_cfa_code;
+       uint16_t                vfr_tx_cfa_action;
+       uint32_t                rep2vf_flow_id;
+       uint32_t                vf2rep_flow_id;
        /* Private data store of associated PF/Trusted VF */
        struct rte_eth_dev      *parent_dev;
        uint8_t                 mac_addr[RTE_ETHER_ADDR_LEN];
@@ -870,11 +872,14 @@ extern int bnxt_logtype_driver;
 extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_init(struct bnxt *bp);
 void bnxt_ulp_deinit(struct bnxt *bp);
-
-uint16_t bnxt_get_vnic_id(uint16_t port);
-uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif);
-uint16_t bnxt_get_fw_func_id(uint16_t port);
-uint16_t bnxt_get_parif(uint16_t port);
+int32_t bnxt_ulp_create_df_rules(struct bnxt *bp);
+void bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global);
+
+uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
+uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,
+                      enum bnxt_ulp_intf_type type);
+uint16_t bnxt_get_fw_func_id(uint16_t port, enum bnxt_ulp_intf_type type);
+uint16_t bnxt_get_parif(uint16_t port, enum bnxt_ulp_intf_type type);
 uint16_t bnxt_get_phy_port_id(uint16_t port);
 uint16_t bnxt_get_vport(uint16_t port);
 enum bnxt_ulp_intf_type
@@ -885,4 +890,9 @@ void bnxt_flow_cnt_alarm_cb(void *arg);
 int bnxt_flow_stats_req(struct bnxt *bp);
 int bnxt_flow_stats_cnt(struct bnxt *bp);
 uint32_t bnxt_get_speed_capabilities(struct bnxt *bp);
+
+int
+bnxt_filter_ctrl_op(struct rte_eth_dev *dev,
+                   enum rte_filter_type filter_type,
+                   enum rte_filter_op filter_op, void *arg);
 #endif