]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: flower: offload phys port MTU change
authorJohn Hurley <john.hurley@netronome.com>
Thu, 29 Mar 2018 01:50:07 +0000 (18:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Mar 2018 14:18:55 +0000 (10:18 -0400)
commitafcf7863fb14f0ee37ffa512614129d60d830093
treef9ce1b086110ad43f50eb0fb08d3a7bb4d689eef
parent28f3e91062fe0860aa6e677261b6c1da8fb475ba
nfp: flower: offload phys port MTU change

Trigger a port mod message to request an MTU change on the NIC when any
physical port representor is assigned a new MTU value. The driver waits
10 msec for an ack that the FW has set the MTU. If no ack is received the
request is rejected and an appropriate warning flagged.

Rather than maintain an MTU queue per repr, one is maintained per app.
Because the MTU ndo is protected by the rtnl lock, there can never be
contention here. Portmod messages from the NIC are also protected by
rtnl so we first check if the portmod is an ack and, if so, handle outside
rtnl and the cmsg work queue.

Acks are detected by the marking of a bit in a portmod response. They are
then verfied by checking the port number and MTU value expected by the
app. If the expected MTU is 0 then no acks are currently expected.

Also, ensure that the packet headroom reserved by the flower firmware is
considered when accepting an MTU change on any repr.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/cmsg.c
drivers/net/ethernet/netronome/nfp/flower/cmsg.h
drivers/net/ethernet/netronome/nfp/flower/main.c
drivers/net/ethernet/netronome/nfp/flower/main.h