aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/sfc/ef100_rx.c
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2022-07-28 19:57:48 +0100
committerJakub Kicinski <kuba@kernel.org>2022-07-29 21:22:06 -0700
commitf50e8fcda6b8d39db9098f7e1146dc491696ab91 (patch)
tree9f560eb39c58de3058f8d889e3c2836b553b7ade /drivers/net/ethernet/sfc/ef100_rx.c
parentsfc: check ef100 RX packets are from the wire (diff)
downloadwireguard-linux-f50e8fcda6b8d39db9098f7e1146dc491696ab91.tar.xz
wireguard-linux-f50e8fcda6b8d39db9098f7e1146dc491696ab91.zip
sfc: receive packets from EF100 VFs into representors
If the source m-port of a packet in __ef100_rx_packet() is a VF, hand off the packet to the corresponding representor with efx_ef100_rep_rx_packet(). Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/sfc/ef100_rx.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_rx.c b/drivers/net/ethernet/sfc/ef100_rx.c
index b8da9e3b7bf2..65bbe37753e6 100644
--- a/drivers/net/ethernet/sfc/ef100_rx.c
+++ b/drivers/net/ethernet/sfc/ef100_rx.c
@@ -85,6 +85,24 @@ void __ef100_rx_packet(struct efx_channel *channel)
nic_data = efx->nic_data;
if (nic_data->have_mport && ing_port != nic_data->base_mport) {
+#ifdef CONFIG_SFC_SRIOV
+ struct efx_rep *efv;
+
+ rcu_read_lock();
+ efv = efx_ef100_find_rep_by_mport(efx, ing_port);
+ if (efv) {
+ if (efv->net_dev->flags & IFF_UP)
+ efx_ef100_rep_rx_packet(efv, rx_buf);
+ rcu_read_unlock();
+ /* Representor Rx doesn't care about PF Rx buffer
+ * ownership, it just makes a copy. So, we are done
+ * with the Rx buffer from PF point of view and should
+ * free it.
+ */
+ goto free_rx_buffer;
+ }
+ rcu_read_unlock();
+#endif
if (net_ratelimit())
netif_warn(efx, drv, efx->net_dev,
"Unrecognised ing_port %04x (base %04x), dropping\n",