summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ef100_nic.c
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2022-07-28 20:57:51 +0200
committerJakub Kicinski <kuba@kernel.org>2022-07-30 06:22:07 +0200
commite37f3b1561a038c0630e7364740d6d55f2b5d5b5 (patch)
tree2c2af3041ec49c5c3dd476db0892a159a71fa400 /drivers/net/ethernet/sfc/ef100_nic.c
parentsfc: move table locking into filter_table_{probe,remove} methods (diff)
downloadlinux-e37f3b1561a038c0630e7364740d6d55f2b5d5b5.tar.xz
linux-e37f3b1561a038c0630e7364740d6d55f2b5d5b5.zip
sfc: use a dynamic m-port for representor RX and set it promisc
Representors do not want to be subject to the PF's Ethernet address filters, since traffic from VFs will typically have a destination either elsewhere on the link segment or on an overlay network. So, create a dynamic m-port with promiscuous and all-multicast filters, and set it as the egress port of representor default rules. Since the m-port is an alias of the calling PF's own m-port, traffic will still be delivered to the PF's RXQs, but it will be subject to the VNRX filter rules installed on the dynamic m-port (specified by the v-port ID field of the filter spec). Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sfc/ef100_nic.c')
-rw-r--r--drivers/net/ethernet/sfc/ef100_nic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c
index 5fe18b383e20..8061efdaf82c 100644
--- a/drivers/net/ethernet/sfc/ef100_nic.c
+++ b/drivers/net/ethernet/sfc/ef100_nic.c
@@ -24,6 +24,7 @@
#include "ef100_tx.h"
#include "ef100_sriov.h"
#include "ef100_netdev.h"
+#include "tc.h"
#include "mae.h"
#include "rx_common.h"
@@ -383,7 +384,18 @@ static int ef100_filter_table_up(struct efx_nic *efx)
rc = efx_mcdi_filter_add_vlan(efx, 0);
if (rc)
goto fail_vlan0;
+ /* Drop the lock: we've finished altering table existence, and
+ * filter insertion will need to take the lock for read.
+ */
up_write(&efx->filter_sem);
+#ifdef CONFIG_SFC_SRIOV
+ rc = efx_tc_insert_rep_filters(efx);
+ /* Rep filter failure is nonfatal */
+ if (rc)
+ netif_warn(efx, drv, efx->net_dev,
+ "Failed to insert representor filters, rc %d\n",
+ rc);
+#endif
return 0;
fail_vlan0:
@@ -396,6 +408,9 @@ fail_unspec:
static void ef100_filter_table_down(struct efx_nic *efx)
{
+#ifdef CONFIG_SFC_SRIOV
+ efx_tc_remove_rep_filters(efx);
+#endif
down_write(&efx->filter_sem);
efx_mcdi_filter_del_vlan(efx, 0);
efx_mcdi_filter_del_vlan(efx, EFX_FILTER_VID_UNSPEC);