Default rules are low-priority switching rules which the hardware uses in the absence of higher-priority rules. Each representor requires a corresponding rule matching traffic from its representee VF and delivering to the PF (where a check on INGRESS_MPORT in __ef100_rx_packet() will direct it to the representor). No rule is required in the reverse direction, because representor TX uses a TX override descriptor to bypass the MAE and deliver directly to the VF. Since inserting any rule into the MAE disables the firmware's own default rules, also insert a pair of rules to connect the PF to the physical network port and vice-versa. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
40 lines
1.5 KiB
C
40 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/****************************************************************************
|
|
* Driver for Solarflare network controllers and boards
|
|
* Copyright 2019 Solarflare Communications Inc.
|
|
* Copyright 2020-2022 Xilinx Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
* by the Free Software Foundation, incorporated herein by reference.
|
|
*/
|
|
|
|
#ifndef EF100_MAE_H
|
|
#define EF100_MAE_H
|
|
/* MCDI interface for the ef100 Match-Action Engine */
|
|
|
|
#include "net_driver.h"
|
|
#include "tc.h"
|
|
#include "mcdi_pcol.h" /* needed for various MC_CMD_MAE_*_NULL defines */
|
|
|
|
void efx_mae_mport_wire(struct efx_nic *efx, u32 *out);
|
|
void efx_mae_mport_uplink(struct efx_nic *efx, u32 *out);
|
|
void efx_mae_mport_vf(struct efx_nic *efx, u32 vf_id, u32 *out);
|
|
void efx_mae_mport_mport(struct efx_nic *efx, u32 mport_id, u32 *out);
|
|
|
|
int efx_mae_lookup_mport(struct efx_nic *efx, u32 selector, u32 *id);
|
|
|
|
int efx_mae_alloc_action_set(struct efx_nic *efx, struct efx_tc_action_set *act);
|
|
int efx_mae_free_action_set(struct efx_nic *efx, u32 fw_id);
|
|
|
|
int efx_mae_alloc_action_set_list(struct efx_nic *efx,
|
|
struct efx_tc_action_set_list *acts);
|
|
int efx_mae_free_action_set_list(struct efx_nic *efx,
|
|
struct efx_tc_action_set_list *acts);
|
|
|
|
int efx_mae_insert_rule(struct efx_nic *efx, const struct efx_tc_match *match,
|
|
u32 prio, u32 acts_id, u32 *id);
|
|
int efx_mae_delete_rule(struct efx_nic *efx, u32 id);
|
|
|
|
#endif /* EF100_MAE_H */
|