mae.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2019 Solarflare Communications Inc.
  5. * Copyright 2020-2022 Xilinx Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License version 2 as published
  9. * by the Free Software Foundation, incorporated herein by reference.
  10. */
  11. #ifndef EF100_MAE_H
  12. #define EF100_MAE_H
  13. /* MCDI interface for the ef100 Match-Action Engine */
  14. #include "net_driver.h"
  15. #include "tc.h"
  16. #include "mcdi_pcol.h" /* needed for various MC_CMD_MAE_*_NULL defines */
  17. int efx_mae_allocate_mport(struct efx_nic *efx, u32 *id, u32 *label);
  18. int efx_mae_free_mport(struct efx_nic *efx, u32 id);
  19. void efx_mae_mport_wire(struct efx_nic *efx, u32 *out);
  20. void efx_mae_mport_uplink(struct efx_nic *efx, u32 *out);
  21. void efx_mae_mport_vf(struct efx_nic *efx, u32 vf_id, u32 *out);
  22. void efx_mae_mport_mport(struct efx_nic *efx, u32 mport_id, u32 *out);
  23. int efx_mae_lookup_mport(struct efx_nic *efx, u32 selector, u32 *id);
  24. #define MAE_NUM_FIELDS (MAE_FIELD_ENC_VNET_ID + 1)
  25. struct mae_caps {
  26. u32 match_field_count;
  27. u32 action_prios;
  28. u8 action_rule_fields[MAE_NUM_FIELDS];
  29. };
  30. int efx_mae_get_caps(struct efx_nic *efx, struct mae_caps *caps);
  31. int efx_mae_match_check_caps(struct efx_nic *efx,
  32. const struct efx_tc_match_fields *mask,
  33. struct netlink_ext_ack *extack);
  34. int efx_mae_alloc_action_set(struct efx_nic *efx, struct efx_tc_action_set *act);
  35. int efx_mae_free_action_set(struct efx_nic *efx, u32 fw_id);
  36. int efx_mae_alloc_action_set_list(struct efx_nic *efx,
  37. struct efx_tc_action_set_list *acts);
  38. int efx_mae_free_action_set_list(struct efx_nic *efx,
  39. struct efx_tc_action_set_list *acts);
  40. int efx_mae_insert_rule(struct efx_nic *efx, const struct efx_tc_match *match,
  41. u32 prio, u32 acts_id, u32 *id);
  42. int efx_mae_delete_rule(struct efx_nic *efx, u32 id);
  43. #endif /* EF100_MAE_H */