diff --git a/pasahost.h b/pasahost.h
index f371abec0c9e277cf81482fb25699e46a49286f9..e490b055bef2c11691952d080c5407fc0dd201de 100644 (file)
--- a/pasahost.h
+++ b/pasahost.h
*/
#define PASAHO_PAMOD_PATCH_MSG_LEN PASAHO_PAMOD_GROUP_7
+/**
+ * @def PASAHO_PAMOD_EMAC_CRC_VERIFY
+ * Instruct PDSP to perform Ethernet CRC verification for egress traffic. This command is provided as a workarond
+ * for the following GbE errata at some keystone devices. (Gen1 support only)
+ *
+ * The GbE switch may drop packets in TX path when:
+ * - full gigabit speeds are sustained and
+ * - the packet size is not a 32 bit multiple (1499, 1498, 1497, 1495, etc.) and
+ * - Ethernet CRC is included in the last 4 bytes of the packet sent to the switch
+ *
+ * @note The Ethernet CRC Verify command can not be combined with any other tx commands, all other commands will be ignored
+ * by PASS when this command is processed.
+ */
+
+#define PASAHO_PAMOD_EMAC_CRC_VERIFY PASAHO_PAMOD_GROUP_7
+
/**
* @def PASAHO_PAMOD_PATCH_MSG_TIME
- * Instruct PDSP to perform message time insert for packets such as Ethernet OAM.
+ * Instruct PDSP to perform message time insert for packets such as Ethernet OAM. (Gen2 support only)
*/
#define PASAHO_PAMOD_PATCH_MSG_TIME PASAHO_PAMOD_GROUP_7
typedef enum {
- PASAHO_SUB_CMD_DUMMY = 0, /**< Dummy */
- PASAHO_SUB_CMD_IP_FRAG, /**< IPv4 fragmentation */
- PASAHO_SUB_CMD_PATCH_MSG_LEN, /**< Message length Patching */
- PASAHO_SUB_CMD_INS_TIME, /**< Ethernet EOAM insert time at specified offset */
- PASAHO_SUB_CMD_INS_COUNT /**< Ethernet EOAM insert count at specified offset */
+ PASAHO_SUB_CMD_DUMMY = 0, /**< Dummy */
+ PASAHO_SUB_CMD_IP_FRAG = 1, /**< IPv4 fragmentation */
+ PASAHO_SUB_CMD_PATCH_MSG_LEN = 2, /**< Message length Patching */
+ PASAHO_SUB_CMD_INS_TIME = 3, /**< Ethernet EOAM insert time at specified offset (Gen2 only) */
+ PASAHO_SUB_CMD_INS_COUNT = 4, /**< Ethernet EOAM insert count at specified offset (Gen2 only) */
+ PASAHO_SUB_CMD_EMAC_CRC_VERIFY = 3 /**< Ethernet CRC Verification (Gen1 only)*/
} pasaho_SubCmdCode_e;
/*@}*/
/** @} */
where the paylaod data has been copied to word6/7 within
pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
+#define PASAHO_LINFO_READ_EOAM_TF_MATCH_CNT_GEN2(x) (x)->word5 /**< Extract the Ethernet OAM target flow match count, valid during
+ EOAM mode on LMM/LMR control packts only (PASS Gen2)*/
+#define PASAHO_LINFO_READ_EOAM_PKT_MEG_LEVEL_GEN2(x) PASAHO_READ_BITFIELD((x)->word2,24,8) /**< Extract the MEG Level during a valid EOAM packet measurement, valid during
+ EOAM mode only (PASS Gen2)*/
+#define PASAHO_LINFO_READ_EOAM_PKT_OPCODE_GEN2(x) PASAHO_READ_BITFIELD((x)->word2,16,8) /**< Extract the MEG Level during a valid EOAM packet measurement, valid during
+ EOAM mode only (PASS Gen2)*/
+
+
/*@}*/ /* PASAHO_long_info_command_gen2 macros */
/** @}*/ /* @name PASAHO Long Info Command Macros For Second Generation PASS */
#define PASAHO_LINFO_READ_TSTAMP_MSB2(x) PASAHO_LINFO_READ_TSTAMP_MSB2_GEN2(x) /**< Extract the most significant 32-bit of the 64-bit timestamp
where the paylaod data has been copied to word6/7 within
pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
+#define PASAHO_LINFO_READ_EOAM_TF_MATCH_CNT(x) PASAHO_LINFO_READ_EOAM_TF_MATCH_CNT_GEN2(x) /**< Extract the EOAM target flow match count for LMM/LMR packets */
+#define PASAHO_LINFO_READ_EOAM_PKT_MEG_LEVEL(x) PASAHO_LINFO_READ_EOAM_PKT_MEG_LEVEL_GEN2(x) /**< Extract the EOAM MEG level for that packet */
+#define PASAHO_LINFO_READ_EOAM_PKT_OPCODE(x) PASAHO_LINFO_READ_EOAM_PKT_OPCODE_GEN2(x) /**< Extract the EOAM Opcode for that packet */
+
#else
#define PASAHO_LINFO_READ_CMDID(x) PASAHO_LINFO_READ_CMDID_GEN1(x) /**< Extract the command ID defined at @ref pasahoCommands */
#define PASAHO_LINFO_READ_RECLEN(x) PASAHO_LINFO_READ_RECLEN_GEN1(x) /**< Extract the block length */
/** @} */
+/* EMAC CRC Verify command */
+/**
+ * @ingroup pasaho_if_structures
+ * @brief pasahoEmacCrcVerify_t defines the Ethernet CRC Verify command. The command structure is defined as 32 bit
+ * values to work with the hardware regardless of the device endianness.
+ *
+ * @details
+ */
+
+typedef struct pasahoEmacCrcVerify_s {
+ uint32_t word0; /**< Contains the Ethernet CRC Verify command information. @ref PASAHO_emac_crc_verify_command_macros */
+} pasahoEmacCrcVerify_t;
+
+/**
+ * @defgroup PASAHO_emac_crc_verify_command_macros PASAHO EMAC CRC Verify Command Macros
+ * @ingroup pasaho_if_macros
+ * @{
+ * @name PASAHO EMAC CRC Verify Command Macros
+ * Macros used by the PASAHO EMAC CRC Verify Command
+ *
+ */
+/*@{*/
+
+#define PASAHO_SET_SUB_CODE_EMAC_CRC_VERIFY(x) PASAHO_SET_BITFIELD((x)->word0, PASAHO_SUB_CMD_EMAC_CRC_VERIFY, 24, 5) /**< Set sub-command code to indicate EMAC CRC Verify command */
+#define PASAHO_SET_EMACPORT(x,v) PASAHO_SET_BITFIELD((x)->word0, (v), 20, 4) /**< Specifies the one-based destination EMAC port number
+ where 0 indicates standard ethernet switch forwarding */
+
+/*@}*/ /* @name PASAHO EMAC CRC Verify Command Macros */
+/** @}*/ /* PASAHO_emac_crc_verify_command_macros */
+
/* Insert Message time command */
/**
* @ingroup pasaho_if_structures