From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Nick <xerofoify@gmail.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 01/17] fm10k: Fix error handling in the function fm10k_setup_tc for certain function calls
Date: Thu, 3 Dec 2015 16:29:38 -0800 [thread overview]
Message-ID: <1449188994-64940-2-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1449188994-64940-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Nick <xerofoify@gmail.com>
This fixes the function fm10k_setup_tc to properly check if the
calls to either the function fm10k_init_queueing_scheme or the
function fm10k_mbx_request_irq fail by returning a error code to
signal that the call to either function has failed. Furthermore
if this arises exit immediately from the function fm10k_setup_tc
by returning the returned error code from the failed function call
to signal to the caller that setting up the tc on the device has
failed and the caller needs to handle this failed setup.
Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index 639263d..96364c7 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -1149,6 +1149,7 @@ static struct rtnl_link_stats64 *fm10k_get_stats64(struct net_device *netdev,
int fm10k_setup_tc(struct net_device *dev, u8 tc)
{
struct fm10k_intfc *interface = netdev_priv(dev);
+ int err;
/* Currently only the PF supports priority classes */
if (tc && (interface->hw.mac.type != fm10k_mac_pf))
@@ -1173,9 +1174,13 @@ int fm10k_setup_tc(struct net_device *dev, u8 tc)
netdev_reset_tc(dev);
netdev_set_num_tc(dev, tc);
- fm10k_init_queueing_scheme(interface);
+ err = fm10k_init_queueing_scheme(interface);
+ if (err)
+ return err;
- fm10k_mbx_request_irq(interface);
+ err = fm10k_mbx_request_irq(interface);
+ if (err)
+ return err;
if (netif_running(dev))
fm10k_open(dev);
--
2.5.0
next prev parent reply other threads:[~2015-12-04 0:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 0:29 [net-next 00/17][pull request] 100GbE Intel Wired LAN Driver Updates 2015-12-03 Jeff Kirsher
2015-12-04 0:29 ` Jeff Kirsher [this message]
2015-12-04 0:41 ` [net-next 01/17] fm10k: Fix error handling in the function fm10k_setup_tc for certain function calls Joe Perches
2015-12-04 0:29 ` [net-next 02/17] fm10k: set netdev features in one location Jeff Kirsher
2015-12-04 0:29 ` [net-next 03/17] fm10k: reset max_queues on init_hw_vf failure Jeff Kirsher
2015-12-04 0:29 ` [net-next 04/17] fm10k: always check init_hw for errors Jeff Kirsher
2015-12-04 0:29 ` [net-next 05/17] fm10k: reinitialize queuing scheme after calling init_hw Jeff Kirsher
2015-12-04 0:29 ` [net-next 06/17] fm10k: Correct typecast in fm10k_update_xc_addr_pf Jeff Kirsher
2015-12-04 0:29 ` [net-next 07/17] fm10k: explicitly typecast vlan values to u16 Jeff Kirsher
2015-12-04 0:29 ` [net-next 08/17] fm10k: add statistics for actual DWORD count of mbmem mailbox Jeff Kirsher
2015-12-04 0:29 ` [net-next 09/17] fm10k: rename mbx_tx_oversized statistic to mbx_tx_dropped Jeff Kirsher
2015-12-04 0:29 ` [net-next 10/17] fm10k: add TEB check to fm10k_gre_is_nvgre Jeff Kirsher
2015-12-04 0:54 ` Tom Herbert
2015-12-04 23:03 ` Jeff Kirsher
2015-12-04 0:29 ` [net-next 11/17] fm10k: Add support for ITR scaling based on PCIe link speed Jeff Kirsher
2015-12-04 0:29 ` [net-next 12/17] fm10k: introduce ITR_IS_ADAPTIVE macro Jeff Kirsher
2015-12-04 0:29 ` [net-next 13/17] fm10k: Update adaptive ITR algorithm Jeff Kirsher
2015-12-04 0:29 ` [net-next 14/17] fm10k: use macro for default Tx and Rx ITR values Jeff Kirsher
2015-12-04 0:29 ` [net-next 15/17] fm10k: change default Tx ITR to 25usec Jeff Kirsher
2015-12-04 0:29 ` [net-next 16/17] fm10k: TRIVIAL fix typo of hardware Jeff Kirsher
2015-12-04 0:29 ` [net-next 17/17] fm10k: TRIVIAL cleanup order at top of fm10k_xmit_frame Jeff Kirsher
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=1449188994-64940-2-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
--cc=xerofoify@gmail.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).