-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sfc: determine representee m-port for EF100 representors
An MAE port, or m-port, is a port (source/destination for traffic) on the Match-Action Engine (the internal switch on EF100). Representors will use their representee's m-port for two purposes: as a destination override on TX from the representor, and as a source match in 'default rules' to steer representee traffic (when not matched by e.g. a TC flower rule) to representor RX via the parent PF's receive queue. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Edward Cree
authored and
David S. Miller
committed
Jul 22, 2022
1 parent
e147955
commit da56552
Showing
5 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// 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. | ||
*/ | ||
|
||
#include "mae.h" | ||
#include "mcdi.h" | ||
#include "mcdi_pcol.h" | ||
|
||
void efx_mae_mport_vf(struct efx_nic *efx __always_unused, u32 vf_id, u32 *out) | ||
{ | ||
efx_dword_t mport; | ||
|
||
EFX_POPULATE_DWORD_3(mport, | ||
MAE_MPORT_SELECTOR_TYPE, MAE_MPORT_SELECTOR_TYPE_FUNC, | ||
MAE_MPORT_SELECTOR_FUNC_PF_ID, MAE_MPORT_SELECTOR_FUNC_PF_ID_CALLER, | ||
MAE_MPORT_SELECTOR_FUNC_VF_ID, vf_id); | ||
*out = EFX_DWORD_VAL(mport); | ||
} | ||
|
||
/* id is really only 24 bits wide */ | ||
int efx_mae_lookup_mport(struct efx_nic *efx, u32 selector, u32 *id) | ||
{ | ||
MCDI_DECLARE_BUF(outbuf, MC_CMD_MAE_MPORT_LOOKUP_OUT_LEN); | ||
MCDI_DECLARE_BUF(inbuf, MC_CMD_MAE_MPORT_LOOKUP_IN_LEN); | ||
size_t outlen; | ||
int rc; | ||
|
||
MCDI_SET_DWORD(inbuf, MAE_MPORT_LOOKUP_IN_MPORT_SELECTOR, selector); | ||
rc = efx_mcdi_rpc(efx, MC_CMD_MAE_MPORT_LOOKUP, inbuf, sizeof(inbuf), | ||
outbuf, sizeof(outbuf), &outlen); | ||
if (rc) | ||
return rc; | ||
if (outlen < sizeof(outbuf)) | ||
return -EIO; | ||
*id = MCDI_DWORD(outbuf, MAE_MPORT_LOOKUP_OUT_MPORT_ID); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* 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" | ||
|
||
void efx_mae_mport_vf(struct efx_nic *efx, u32 vf_id, u32 *out); | ||
|
||
int efx_mae_lookup_mport(struct efx_nic *efx, u32 selector, u32 *id); | ||
|
||
#endif /* EF100_MAE_H */ |