summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/flower
diff options
context:
space:
mode:
authorSimon Horman <simon.horman@netronome.com>2017-08-16 09:37:44 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-16 11:36:44 -0700
commit2dff1962242111cc4517119f690587b87573ffc5 (patch)
tree063565dd88c2f1eb1295fb0c7f03855e9dc83027 /drivers/net/ethernet/netronome/nfp/flower
parentb985f870a5f08da0a2d6b45a3ea33f5558cf7e4e (diff)
nfp: process MTU updates from firmware flower app
Now that control message processing occurs in a workqueue rather than a BH handler MTU updates received from the firmware may be safely processed. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/flower')
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/cmsg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/cmsg.c b/drivers/net/ethernet/netronome/nfp/flower/cmsg.c
index 6c8c22491fe7..806924b82adc 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/cmsg.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/cmsg.c
@@ -150,10 +150,17 @@ nfp_flower_cmsg_portmod_rx(struct nfp_app *app, struct sk_buff *skb)
return;
}
- if (link)
+ if (link) {
+ u16 mtu = be16_to_cpu(msg->mtu);
+
netif_carrier_on(netdev);
- else
+
+ /* An MTU of 0 from the firmware should be ignored */
+ if (mtu)
+ dev_set_mtu(netdev, mtu);
+ } else {
netif_carrier_off(netdev);
+ }
rcu_read_unlock();
}