Skip to content

Commit 45756df

Browse files
jahurleydavem330
authored andcommitted
nfp: flower: allow tunnels to output to internal port
The neighbour table in the FW only accepts next hop entries if the egress port is an nfp repr. Modify this to allow the next hop to be an internal port. This means that if a packet is to egress to that port, it will recirculate back into the system with the internal port becoming its ingress port. Signed-off-by: John Hurley <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f41dd05 commit 45756df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,10 @@ nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app,
270270
struct flowi4 *flow, struct neighbour *neigh, gfp_t flag)
271271
{
272272
struct nfp_tun_neigh payload;
273+
u32 port_id;
273274

274-
/* Only offload representor IPv4s for now. */
275-
if (!nfp_netdev_is_nfp_repr(netdev))
275+
port_id = nfp_flower_get_port_id_from_netdev(app, netdev);
276+
if (!port_id)
276277
return;
277278

278279
memset(&payload, 0, sizeof(struct nfp_tun_neigh));
@@ -290,7 +291,7 @@ nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app,
290291
payload.src_ipv4 = flow->saddr;
291292
ether_addr_copy(payload.src_addr, netdev->dev_addr);
292293
neigh_ha_snapshot(payload.dst_addr, neigh, netdev);
293-
payload.port_id = cpu_to_be32(nfp_repr_get_port_id(netdev));
294+
payload.port_id = cpu_to_be32(port_id);
294295
/* Add destination of new route to NFP cache. */
295296
nfp_tun_add_route_to_cache(app, payload.dst_ipv4);
296297

0 commit comments

Comments
 (0)