octeontx2-af: Add mbox messages to install and delete MCAM rules
[linux-2.6-microblaze.git] / drivers / net / ethernet / marvell / octeontx2 / af / mbox.h
index f46de84..ac3118d 100644 (file)
@@ -188,10 +188,14 @@ M(NPC_MCAM_ALLOC_AND_WRITE_ENTRY, 0x600b, npc_mcam_alloc_and_write_entry,      \
                                          npc_mcam_alloc_and_write_entry_rsp)  \
 M(NPC_GET_KEX_CFG,       0x600c, npc_get_kex_cfg,                      \
                                   msg_req, npc_get_kex_cfg_rsp)        \
+M(NPC_INSTALL_FLOW,      0x600d, npc_install_flow,                            \
+                                 npc_install_flow_req, npc_install_flow_rsp)  \
+M(NPC_DELETE_FLOW,       0x600e, npc_delete_flow,                      \
+                                 npc_delete_flow_req, msg_rsp)         \
 /* NIX mbox IDs (range 0x8000 - 0xFFFF) */                             \
 M(NIX_LF_ALLOC,                0x8000, nix_lf_alloc,                           \
                                 nix_lf_alloc_req, nix_lf_alloc_rsp)    \
-M(NIX_LF_FREE,         0x8001, nix_lf_free, msg_req, msg_rsp)          \
+M(NIX_LF_FREE,         0x8001, nix_lf_free, nix_lf_free_req, msg_rsp)  \
 M(NIX_AQ_ENQ,          0x8002, nix_aq_enq, nix_aq_enq_req, nix_aq_enq_rsp)  \
 M(NIX_HWCTX_DISABLE,   0x8003, nix_hwctx_disable,                      \
                                 hwctx_disable_req, msg_rsp)            \
@@ -510,6 +514,12 @@ struct nix_lf_alloc_rsp {
        u8      sdp_links;  /* No. of SDP links present in HW */
 };
 
+struct nix_lf_free_req {
+       struct mbox_msghdr hdr;
+#define NIX_LF_DISABLE_FLOWS           BIT_ULL(0)
+       u64 flags;
+};
+
 /* NIX AQ enqueue msg */
 struct nix_aq_enq_req {
        struct mbox_msghdr hdr;
@@ -882,6 +892,70 @@ struct npc_get_kex_cfg_rsp {
        u8 mkex_pfl_name[MKEX_NAME_LEN];
 };
 
+struct flow_msg {
+       unsigned char dmac[6];
+       unsigned char smac[6];
+       __be16 etype;
+       __be16 vlan_etype;
+       __be16 vlan_tci;
+       union {
+               __be32 ip4src;
+               __be32 ip6src[4];
+       };
+       union {
+               __be32 ip4dst;
+               __be32 ip6dst[4];
+       };
+       u8 tos;
+       u8 ip_ver;
+       u8 ip_proto;
+       u8 tc;
+       __be16 sport;
+       __be16 dport;
+};
+
+struct npc_install_flow_req {
+       struct mbox_msghdr hdr;
+       struct flow_msg packet;
+       struct flow_msg mask;
+       u64 features;
+       u16 entry;
+       u16 channel;
+       u8 intf;
+       u8 set_cntr; /* If counter is available set counter for this entry ? */
+       u8 default_rule;
+       u8 append; /* overwrite(0) or append(1) flow to default rule? */
+       u16 vf;
+       /* action */
+       u32 index;
+       u16 match_id;
+       u8 flow_key_alg;
+       u8 op;
+       /* vtag rx action */
+       u8 vtag0_type;
+       u8 vtag0_valid;
+       u8 vtag1_type;
+       u8 vtag1_valid;
+       /* vtag tx action */
+       u16 vtag0_def;
+       u8  vtag0_op;
+       u16 vtag1_def;
+       u8  vtag1_op;
+};
+
+struct npc_install_flow_rsp {
+       struct mbox_msghdr hdr;
+       int counter; /* negative if no counter else counter number */
+};
+
+struct npc_delete_flow_req {
+       struct mbox_msghdr hdr;
+       u16 entry;
+       u16 start;/*Disable range of entries */
+       u16 end;
+       u8 all; /* PF + VFs */
+};
+
 enum ptp_op {
        PTP_OP_ADJFINE = 0,
        PTP_OP_GET_CLOCK = 1,