linux-loongson/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.h
Paul Greenwalt d5e3152037 ixgbe: add MDD support
Add malicious driver detection to ixgbe driver. The supported devices
are E610 and X550.

Handling MDD events is enabled while VFs are created and turned off
when they are disabled. There is no runtime command to enable or
disable MDD independently.

MDD event is logged when malicious VF driver is detected. For example VF
can try to send incorrect Tx descriptor (TSO on, but length field not
correct). It can be reproduced by manipulating the driver, or using
driver with incorrect descriptor values.

Example log:
"Malicious event on VF 0 tx:128 rx:128"

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2025-07-03 09:39:03 -07:00

26 lines
829 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 2024 Intel Corporation. */
#ifndef _IXGBE_X550_H_
#define _IXGBE_X550_H_
#include "ixgbe_type.h"
extern const u32 ixgbe_mvals_x550em_a[IXGBE_MVALS_IDX_LIMIT];
int ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
u8 build, u8 sub, u16 len,
const char *driver_ver);
void ixgbe_set_source_address_pruning_x550(struct ixgbe_hw *hw,
bool enable,
unsigned int pool);
void ixgbe_set_ethertype_anti_spoofing_x550(struct ixgbe_hw *hw,
bool enable, int vf);
void ixgbe_enable_mdd_x550(struct ixgbe_hw *hw);
void ixgbe_disable_mdd_x550(struct ixgbe_hw *hw);
void ixgbe_restore_mdd_vf_x550(struct ixgbe_hw *hw, u32 vf);
void ixgbe_handle_mdd_x550(struct ixgbe_hw *hw, unsigned long *vf_bitmap);
#endif /* _IXGBE_X550_H_ */