aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/pensando/ionic/ionic_phc.c
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2021-08-27 11:55:12 -0700
committerDavid S. Miller <davem@davemloft.net>2021-08-28 11:23:09 +0100
commitccbbd002a419b5b4df481be8d42c3c7a3ce86426 (patch)
tree4b88510ee950483c0a3d4e65fd6e269efc6f1aea /drivers/net/ethernet/pensando/ionic/ionic_phc.c
parentionic: pull hwstamp queue_lock up a level (diff)
downloadlinux-dev-ccbbd002a419b5b4df481be8d42c3c7a3ce86426.tar.xz
linux-dev-ccbbd002a419b5b4df481be8d42c3c7a3ce86426.zip
ionic: recreate hwstamp queues on ifup
The queues can be freed in ionic_close(). They need to be recreated after ionic_open(). It doesn't need to replay the whole config. It only needs to create the timestamping queues again. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic/ionic_phc.c')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_phc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
index c39790a6c436..eed2db69d708 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
@@ -222,6 +222,30 @@ void ionic_lif_hwstamp_replay(struct ionic_lif *lif)
netdev_info(lif->netdev, "hwstamp replay failed: %d\n", err);
}
+void ionic_lif_hwstamp_recreate_queues(struct ionic_lif *lif)
+{
+ int err;
+
+ if (!lif->phc || !lif->phc->ptp)
+ return;
+
+ mutex_lock(&lif->phc->config_lock);
+
+ if (lif->phc->ts_config_tx_mode) {
+ err = ionic_lif_create_hwstamp_txq(lif);
+ if (err)
+ netdev_info(lif->netdev, "hwstamp recreate txq failed: %d\n", err);
+ }
+
+ if (lif->phc->ts_config_rx_filt) {
+ err = ionic_lif_create_hwstamp_rxq(lif);
+ if (err)
+ netdev_info(lif->netdev, "hwstamp recreate rxq failed: %d\n", err);
+ }
+
+ mutex_unlock(&lif->phc->config_lock);
+}
+
int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr)
{
struct hwtstamp_config config;