char *wqe;
struct sk_buff *skb;
struct mlxsw_rx_info rx_info;
+ u16 byte_count;
int err;
elem_info = mlxsw_pci_queue_elem_info_consumer_get(q);
rx_info.sys_port = mlxsw_pci_cqe_system_port_get(cqe);
rx_info.trap_id = mlxsw_pci_cqe_trap_id_get(cqe);
- skb_put(skb, mlxsw_pci_cqe_byte_count_get(cqe));
+ byte_count = mlxsw_pci_cqe_byte_count_get(cqe);
+ if (mlxsw_pci_cqe_crc_get(cqe))
+ byte_count -= ETH_FCS_LEN;
+ skb_put(skb, byte_count);
mlxsw_core_skb_receive(mlxsw_pci->core, skb, &rx_info);
put_new_skb:
*/
MLXSW_ITEM32(pci, cqe, trap_id, 0x08, 0, 8);
+/* pci_cqe_crc
+ * Length include CRC. Indicates the length field includes
+ * the packet's CRC.
+ */
+MLXSW_ITEM32(pci, cqe, crc, 0x0C, 8, 1);
+
/* pci_cqe_e
* CQE with Error.
*/