From: Simon Horman <simon.horman@netronome.com>
To: David Miller <davem@davemloft.net>,
Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
Simon Horman <simon.horman@netronome.com>
Subject: [PATCH net-next 2/2] nfp: process MTU updates from firmware flower app
Date: Wed, 16 Aug 2017 09:37:44 +0200 [thread overview]
Message-ID: <1502869064-25842-3-git-send-email-simon.horman@netronome.com> (raw)
In-Reply-To: <1502869064-25842-1-git-send-email-simon.horman@netronome.com>
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>
---
drivers/net/ethernet/netronome/nfp/flower/cmsg.c | 11 +++++++++--
1 file 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();
}
--
2.1.4
next prev parent reply other threads:[~2017-08-16 7:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 7:37 [PATCH net-next 0/2] nfp: process MTU updates from firmware flower app Simon Horman
2017-08-16 7:37 ` [PATCH net-next 1/2] nfp: process control messages in workqueue in " Simon Horman
2017-08-16 7:37 ` Simon Horman [this message]
2017-08-16 18:36 ` [PATCH net-next 0/2] nfp: process MTU updates from firmware " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502869064-25842-3-git-send-email-simon.horman@netronome.com \
--to=simon.horman@netronome.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).