Skip to content

Commit

Permalink
qed*: Don't reset statistics on inner reload
Browse files Browse the repository at this point in the history
Several user APIs can cause driver to perform an inner-reload.
Currently, doing this would cause the HW/FW statistics of the
adapter to reset, which isn't the expected behavior [statistics
should only reset on explicit unloads].

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yuval Mintz authored and David S. Miller committed Jun 19, 2016
1 parent 3264398 commit a0d26d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/qlogic/qed/qed_l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,8 @@ static int qed_start_vport(struct qed_dev *cdev,
start.vport_id, start.mtu);
}

qed_reset_vport_stats(cdev);
if (params->clear_stats)
qed_reset_vport_stats(cdev);

return 0;
}
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/ethernet/qlogic/qede/qede_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3231,7 +3231,7 @@ static int qede_stop_queues(struct qede_dev *edev)
return rc;
}

static int qede_start_queues(struct qede_dev *edev)
static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
{
int rc, tc, i;
int vlan_removal_en = 1;
Expand Down Expand Up @@ -3462,6 +3462,7 @@ static void qede_unload(struct qede_dev *edev, enum qede_unload_mode mode)

enum qede_load_mode {
QEDE_LOAD_NORMAL,
QEDE_LOAD_RELOAD,
};

static int qede_load(struct qede_dev *edev, enum qede_load_mode mode)
Expand Down Expand Up @@ -3500,7 +3501,7 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode)
goto err3;
DP_INFO(edev, "Setup IRQs succeeded\n");

rc = qede_start_queues(edev);
rc = qede_start_queues(edev, mode != QEDE_LOAD_RELOAD);
if (rc)
goto err4;
DP_INFO(edev, "Start VPORT, RXQ and TXQ succeeded\n");
Expand Down Expand Up @@ -3555,7 +3556,7 @@ void qede_reload(struct qede_dev *edev,
if (func)
func(edev, args);

qede_load(edev, QEDE_LOAD_NORMAL);
qede_load(edev, QEDE_LOAD_RELOAD);

mutex_lock(&edev->qede_lock);
qede_config_rx_mode(edev->ndev);
Expand Down
1 change: 1 addition & 0 deletions include/linux/qed/qed_eth_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct qed_start_vport_params {
bool drop_ttl0;
u8 vport_id;
u16 mtu;
bool clear_stats;
};

struct qed_stop_rxq_params {
Expand Down

0 comments on commit a0d26d5

Please sign in to comment.