提交 ff91a550 编写于 作者: D David S. Miller

Merge branch 'qlcnic'

Rajesh Borundia says:

====================
qlcnic: Bug fixes

The patch series contains following bug fixes.

* Aggregating tx stats in adapter variable was resulting
  in increase of stats when user runs ifconfig command
  and no traffic is running. Instead aggregate tx stats
  in local variable and then assign it to adapter struct
  variable.
* Set_driver_version was called after registering netdev
  which was resulting in a race between FLR in open
  handler and set_driver_version command as open handler
  can be called simulatneously on another cpu even if probe
  is not complete. So call this command before registering
  netdev.
* dcbnl_ops should be initialized before registering netdev
  as they are referenced in open handler.
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
......@@ -136,7 +136,7 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
rsp = qlcnic_poll_rsp(adapter);
if (rsp == QLCNIC_CDRP_RSP_TIMEOUT) {
dev_err(&pdev->dev, "card response timeout.\n");
dev_err(&pdev->dev, "command timeout, response = 0x%x\n", rsp);
cmd->rsp.arg[0] = QLCNIC_RCODE_TIMEOUT;
} else if (rsp == QLCNIC_CDRP_RSP_FAIL) {
cmd->rsp.arg[0] = QLCRD32(adapter, QLCNIC_CDRP_ARG(1), &err);
......
......@@ -1290,17 +1290,25 @@ static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type)
void qlcnic_update_stats(struct qlcnic_adapter *adapter)
{
struct qlcnic_tx_queue_stats tx_stats;
struct qlcnic_host_tx_ring *tx_ring;
int ring;
memset(&tx_stats, 0, sizeof(tx_stats));
for (ring = 0; ring < adapter->drv_tx_rings; ring++) {
tx_ring = &adapter->tx_ring[ring];
adapter->stats.xmit_on += tx_ring->tx_stats.xmit_on;
adapter->stats.xmit_off += tx_ring->tx_stats.xmit_off;
adapter->stats.xmitcalled += tx_ring->tx_stats.xmit_called;
adapter->stats.xmitfinished += tx_ring->tx_stats.xmit_finished;
adapter->stats.txbytes += tx_ring->tx_stats.tx_bytes;
tx_stats.xmit_on += tx_ring->tx_stats.xmit_on;
tx_stats.xmit_off += tx_ring->tx_stats.xmit_off;
tx_stats.xmit_called += tx_ring->tx_stats.xmit_called;
tx_stats.xmit_finished += tx_ring->tx_stats.xmit_finished;
tx_stats.tx_bytes += tx_ring->tx_stats.tx_bytes;
}
adapter->stats.xmit_on = tx_stats.xmit_on;
adapter->stats.xmit_off = tx_stats.xmit_off;
adapter->stats.xmitcalled = tx_stats.xmit_called;
adapter->stats.xmitfinished = tx_stats.xmit_finished;
adapter->stats.txbytes = tx_stats.tx_bytes;
}
static u64 *qlcnic_fill_tx_queue_stats(u64 *data, void *stats)
......
......@@ -2323,14 +2323,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
if (err)
return err;
qlcnic_dcb_init_dcbnl_ops(adapter->dcb);
err = register_netdev(netdev);
if (err) {
dev_err(&pdev->dev, "failed to register net device\n");
return err;
}
qlcnic_dcb_init_dcbnl_ops(adapter->dcb);
return 0;
}
......@@ -2623,13 +2623,13 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
goto err_out_disable_mbx_intr;
if (adapter->portnum == 0)
qlcnic_set_drv_version(adapter);
err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac);
if (err)
goto err_out_disable_mbx_intr;
if (adapter->portnum == 0)
qlcnic_set_drv_version(adapter);
pci_set_drvdata(pdev, adapter);
if (qlcnic_82xx_check(adapter))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册