Skip to content

Commit

Permalink
Merge branch 'qlcnic'
Browse files Browse the repository at this point in the history
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: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Aug 5, 2014
2 parents f2294eb + cd1560e commit ff91a55
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 13 additions & 5 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit ff91a55

Please sign in to comment.