net/i40e: get ddp profile protocol info
[dpdk.git] / drivers / net / i40e / rte_pmd_i40e.h
index 4a867ad..b9fd18e 100644 (file)
@@ -71,6 +71,8 @@ struct rte_pmd_i40e_mb_event_param {
 enum rte_pmd_i40e_package_op {
        RTE_PMD_I40E_PKG_OP_UNDEFINED = 0,
        RTE_PMD_I40E_PKG_OP_WR_ADD,   /**< load package and add to info list */
+       RTE_PMD_I40E_PKG_OP_WR_DEL, /**< load package and delete from info list */
+       RTE_PMD_I40E_PKG_OP_WR_ONLY, /**< load package without modifying info list */
        RTE_PMD_I40E_PKG_OP_MAX = 32
 };
 
@@ -86,6 +88,12 @@ enum rte_pmd_i40e_package_info {
        RTE_PMD_I40E_PKG_INFO_HEADER,
        RTE_PMD_I40E_PKG_INFO_DEVID_NUM,
        RTE_PMD_I40E_PKG_INFO_DEVID_LIST,
+       RTE_PMD_I40E_PKG_INFO_PROTOCOL_NUM,
+       RTE_PMD_I40E_PKG_INFO_PROTOCOL_LIST,
+       RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM,
+       RTE_PMD_I40E_PKG_INFO_PCTYPE_LIST,
+       RTE_PMD_I40E_PKG_INFO_PTYPE_NUM,
+       RTE_PMD_I40E_PKG_INFO_PTYPE_LIST,
        RTE_PMD_I40E_PKG_INFO_MAX = 0xFFFFFFFF
 };
 
@@ -131,6 +139,25 @@ struct rte_pmd_i40e_profile_list {
        struct rte_pmd_i40e_profile_info p_info[1];
 };
 
+#define RTE_PMD_I40E_PROTO_NUM 6
+#define RTE_PMD_I40E_PROTO_UNUSED 0xFF
+
+/**
+ * Protocols information stored in profile
+ */
+struct rte_pmd_i40e_proto_info {
+       uint8_t proto_id;
+       char name[RTE_PMD_I40E_DDP_NAME_SIZE];
+};
+
+/**
+ * Packet classification/ packet type information stored in profile
+ */
+struct rte_pmd_i40e_ptype_info {
+       uint8_t ptype_id;
+       uint8_t protocols[RTE_PMD_I40E_PROTO_NUM];
+};
+
 /**
  * ptype mapping table only accept RTE_PTYPE_XXX or "user defined" ptype.
  * A ptype with MSB set will be regarded as a user defined ptype.
@@ -517,7 +544,9 @@ int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map);
  *   - (0) if successful.
  *   - (-ENODEV) if *port* invalid.
  *   - (-EINVAL) if bad parameter.
- *   - (1) if profile exists.
+ *   - (-EEXIST) if profile exists.
+ *   - (-EACCES) if profile does not exist.
+ *   - (-ENOTSUP) if operation not supported.
  */
 int rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff,
                                     uint32_t size,
@@ -633,4 +662,24 @@ int rte_pmd_i40e_ptype_mapping_replace(uint8_t port,
                                       uint8_t mask,
                                       uint32_t pkt_type);
 
+/**
+ * Add a VF MAC address.
+ *
+ * Add more MAC address for VF. The existing MAC addresses
+ * are still effective.
+ *
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param vf_id
+ *   VF id.
+ * @param mac_addr
+ *   VF MAC address.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
+ */
+int rte_pmd_i40e_add_vf_mac_addr(uint8_t port, uint16_t vf_id,
+                                struct ether_addr *mac_addr);
+
 #endif /* _PMD_I40E_H_ */