Netdev List
 help / color / mirror / Atom feed
* [PATCH 46/64] drivers: net: dmfe: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/dec/tulip/dmfe.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/dec/tulip/dmfe.c b/drivers/net/ethernet/dec/tulip/dmfe.c
index 07e10a4..6585f73 100644
--- a/drivers/net/ethernet/dec/tulip/dmfe.c
+++ b/drivers/net/ethernet/dec/tulip/dmfe.c
@@ -596,10 +596,8 @@ static int dmfe_open(struct net_device *dev)
 	netif_wake_queue(dev);
 
 	/* set and active a timer process */
-	init_timer(&db->timer);
+	setup_timer(&db->timer, dmfe_timer, (unsigned long)dev);
 	db->timer.expires = DMFE_TIMER_WUT + HZ * 2;
-	db->timer.data = (unsigned long)dev;
-	db->timer.function = dmfe_timer;
 	add_timer(&db->timer);
 
 	return 0;
-- 
2.7.4


^ permalink raw reply related

* [PATCH 47/64] drivers: net: bnxt: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index aacec8b..c25f5b5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7190,9 +7190,7 @@ static int bnxt_init_board(struct pci_dev *pdev, struct net_device *dev)
 
 	bp->stats_coal_ticks = BNXT_DEF_STATS_COAL_TICKS;
 
-	init_timer(&bp->timer);
-	bp->timer.data = (unsigned long)bp;
-	bp->timer.function = bnxt_timer;
+	setup_timer(&bp->timer, bnxt_timer, (unsigned long)bp);
 	bp->current_interval = BNXT_TIMER_INTERVAL;
 
 	clear_bit(BNXT_STATE_OPEN, &bp->state);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 49/64] drivers: net: adi: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/adi/bfin_mac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index a251de8..0658cde 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -1650,9 +1650,8 @@ static int bfin_mac_probe(struct platform_device *pdev)
 	ndev->netdev_ops = &bfin_mac_netdev_ops;
 	ndev->ethtool_ops = &bfin_mac_ethtool_ops;
 
-	init_timer(&lp->tx_reclaim_timer);
-	lp->tx_reclaim_timer.data = (unsigned long)lp;
-	lp->tx_reclaim_timer.function = tx_reclaim_skb_timeout;
+	setup_timer(&lp->tx_reclaim_timer, tx_reclaim_skb_timeout,
+		    (unsigned long)lp);
 
 	lp->flags = 0;
 	netif_napi_add(ndev, &lp->napi, bfin_mac_poll, CONFIG_BFIN_RX_DESC_NUM);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 50/64] drivers: net: can: sja1000: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/can/sja1000/peak_pcmcia.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/can/sja1000/peak_pcmcia.c b/drivers/net/can/sja1000/peak_pcmcia.c
index dd56133..4b8758e 100644
--- a/drivers/net/can/sja1000/peak_pcmcia.c
+++ b/drivers/net/can/sja1000/peak_pcmcia.c
@@ -692,9 +692,7 @@ static int pcan_probe(struct pcmcia_device *pdev)
 	}
 
 	/* init the timer which controls the leds */
-	init_timer(&card->led_timer);
-	card->led_timer.function = pcan_led_timer;
-	card->led_timer.data = (unsigned long)card;
+	setup_timer(&card->led_timer, pcan_led_timer, (unsigned long)card);
 
 	/* request the given irq */
 	err = request_irq(pdev->irq, &pcan_isr, IRQF_SHARED, PCC_NAME, card);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 51/64] drivers: net: caif: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/caif/caif_hsi.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 438966b..fed75e7 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -1211,17 +1211,14 @@ static int cfhsi_open(struct net_device *ndev)
 	init_waitqueue_head(&cfhsi->flush_fifo_wait);
 
 	/* Setup the inactivity timer. */
-	init_timer(&cfhsi->inactivity_timer);
-	cfhsi->inactivity_timer.data = (unsigned long)cfhsi;
-	cfhsi->inactivity_timer.function = cfhsi_inactivity_tout;
+	setup_timer(&cfhsi->inactivity_timer, cfhsi_inactivity_tout,
+		    (unsigned long)cfhsi);
 	/* Setup the slowpath RX timer. */
-	init_timer(&cfhsi->rx_slowpath_timer);
-	cfhsi->rx_slowpath_timer.data = (unsigned long)cfhsi;
-	cfhsi->rx_slowpath_timer.function = cfhsi_rx_slowpath;
+	setup_timer(&cfhsi->rx_slowpath_timer, cfhsi_rx_slowpath,
+		    (unsigned long)cfhsi);
 	/* Setup the aggregation timer. */
-	init_timer(&cfhsi->aggregation_timer);
-	cfhsi->aggregation_timer.data = (unsigned long)cfhsi;
-	cfhsi->aggregation_timer.function = cfhsi_aggregation_tout;
+	setup_timer(&cfhsi->aggregation_timer, cfhsi_aggregation_tout,
+		    (unsigned long)cfhsi);
 
 	/* Activate HSI interface. */
 	res = cfhsi->ops->cfhsi_up(cfhsi->ops);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 52/64] drivers: net: appletalk: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/appletalk/ltpc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index ac755d2..e4aa374 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -1165,9 +1165,7 @@ struct net_device * __init ltpc_probe(void)
 		dev->irq = 0;
 		/* polled mode -- 20 times per second */
 		/* this is really, really slow... should it poll more often? */
-		init_timer(&ltpc_timer);
-		ltpc_timer.function=ltpc_poll;
-		ltpc_timer.data = (unsigned long) dev;
+		setup_timer(&ltpc_timer, ltpc_poll, (unsigned long)dev);
 
 		ltpc_timer.expires = jiffies + HZ/20;
 		add_timer(&ltpc_timer);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 53/64] drivers: net: dscc: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/wan/dscc4.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index a043fb1..64f1764 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -1127,10 +1127,8 @@ static int dscc4_open(struct net_device *dev)
 done:
 	netif_start_queue(dev);
 
-        init_timer(&dpriv->timer);
+	setup_timer(&dpriv->timer, dscc4_timer, (unsigned long)dev);
         dpriv->timer.expires = jiffies + 10*HZ;
-        dpriv->timer.data = (unsigned long)dev;
-	dpriv->timer.function = dscc4_timer;
         add_timer(&dpriv->timer);
 	netif_carrier_on(dev);
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 54/64] drivers: net: hdlc_ppp: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/wan/hdlc_ppp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index 0d2e00e..c7721c7 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -610,9 +610,7 @@ static void ppp_start(struct net_device *dev)
 	for (i = 0; i < IDX_COUNT; i++) {
 		struct proto *proto = &ppp->protos[i];
 		proto->dev = dev;
-		init_timer(&proto->timer);
-		proto->timer.function = ppp_timer;
-		proto->timer.data = (unsigned long)proto;
+		setup_timer(&proto->timer, ppp_timer, (unsigned long)proto);
 		proto->state = CLOSED;
 	}
 	ppp->protos[IDX_LCP].pid = PID_LCP;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 55/64] drivers: net: hamradio: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/hamradio/6pack.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 021a8ec..97fe8df 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -623,9 +623,7 @@ static int sixpack_open(struct tty_struct *tty)
 
 	netif_start_queue(dev);
 
-	init_timer(&sp->tx_t);
-	sp->tx_t.function = sp_xmit_on_air;
-	sp->tx_t.data = (unsigned long) sp;
+	setup_timer(&sp->tx_t, sp_xmit_on_air, (unsigned long)sp);
 
 	init_timer(&sp->resync_t);
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 56/64] drivers: net: cpsw_ale: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/ti/cpsw_ale.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index ddd43e0..cd1185e 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -859,9 +859,7 @@ void cpsw_ale_start(struct cpsw_ale *ale)
 	cpsw_ale_control_set(ale, 0, ALE_ENABLE, 1);
 	cpsw_ale_control_set(ale, 0, ALE_CLEAR, 1);
 
-	init_timer(&ale->timer);
-	ale->timer.data	    = (unsigned long)ale;
-	ale->timer.function = cpsw_ale_timer;
+	setup_timer(&ale->timer, cpsw_ale_timer, (unsigned long)ale);
 	if (ale->ageout) {
 		ale->timer.expires = jiffies + ale->ageout;
 		add_timer(&ale->timer);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 57/64] drivers: net: stmmac: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1763e48..f41661a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2217,10 +2217,8 @@ static void stmmac_init_tx_coalesce(struct stmmac_priv *priv)
 {
 	priv->tx_coal_frames = STMMAC_TX_FRAMES;
 	priv->tx_coal_timer = STMMAC_COAL_TX_TIMER;
-	init_timer(&priv->txtimer);
+	setup_timer(&priv->txtimer, stmmac_tx_timer, (unsigned long)priv);
 	priv->txtimer.expires = STMMAC_COAL_TIMER(priv->tx_coal_timer);
-	priv->txtimer.data = (unsigned long)priv;
-	priv->txtimer.function = stmmac_tx_timer;
 	add_timer(&priv->txtimer);
 }
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 58/64] drivers: net: packetengines: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/packetengines/hamachi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/packetengines/hamachi.c b/drivers/net/ethernet/packetengines/hamachi.c
index 482b85e..77bc7cc 100644
--- a/drivers/net/ethernet/packetengines/hamachi.c
+++ b/drivers/net/ethernet/packetengines/hamachi.c
@@ -979,10 +979,8 @@ static int hamachi_open(struct net_device *dev)
 			   dev->name, readw(ioaddr + RxStatus), readw(ioaddr + TxStatus));
 	}
 	/* Set the timer to check for link beat. */
-	init_timer(&hmp->timer);
+	setup_timer(&hmp->timer, hamachi_timer, (unsigned long)dev);
 	hmp->timer.expires = RUN_AT((24*HZ)/10);			/* 2.4 sec. */
-	hmp->timer.data = (unsigned long)dev;
-	hmp->timer.function = hamachi_timer;				/* timer handler */
 	add_timer(&hmp->timer);
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 59/64] drivers: net: i40evf: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 1825d95..c243f9d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2686,9 +2686,8 @@ static void i40evf_init_task(struct work_struct *work)
 		ether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);
 	}
 
-	init_timer(&adapter->watchdog_timer);
-	adapter->watchdog_timer.function = &i40evf_watchdog_timer;
-	adapter->watchdog_timer.data = (unsigned long)adapter;
+	setup_timer(&adapter->watchdog_timer, &i40evf_watchdog_timer,
+		    (unsigned long)adapter);
 	mod_timer(&adapter->watchdog_timer, jiffies + 1);
 
 	adapter->tx_desc_count = I40EVF_DEFAULT_TXD;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 60/64] drivers: net: uli526x: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/dec/tulip/uli526x.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/dec/tulip/uli526x.c b/drivers/net/ethernet/dec/tulip/uli526x.c
index 7fc248e..5fbbc0c 100644
--- a/drivers/net/ethernet/dec/tulip/uli526x.c
+++ b/drivers/net/ethernet/dec/tulip/uli526x.c
@@ -491,10 +491,8 @@ static int uli526x_open(struct net_device *dev)
 	netif_wake_queue(dev);
 
 	/* set and active a timer process */
-	init_timer(&db->timer);
+	setup_timer(&db->timer, uli526x_timer, (unsigned long)dev);
 	db->timer.expires = ULI526X_TIMER_WUT + HZ * 2;
-	db->timer.data = (unsigned long)dev;
-	db->timer.function = uli526x_timer;
 	add_timer(&db->timer);
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 61/64] drivers: net: enic: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/cisco/enic/enic_clsf.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/cisco/enic/enic_clsf.h b/drivers/net/ethernet/cisco/enic/enic_clsf.h
index 6aa9f89..4bfbf25 100644
--- a/drivers/net/ethernet/cisco/enic/enic_clsf.h
+++ b/drivers/net/ethernet/cisco/enic/enic_clsf.h
@@ -19,9 +19,8 @@ void enic_flow_may_expire(unsigned long data);
 
 static inline void enic_rfs_timer_start(struct enic *enic)
 {
-	init_timer(&enic->rfs_h.rfs_may_expire);
-	enic->rfs_h.rfs_may_expire.function = enic_flow_may_expire;
-	enic->rfs_h.rfs_may_expire.data = (unsigned long)enic;
+	setup_timer(&enic->rfs_h.rfs_may_expire, enic_flow_may_expire,
+		    (unsigned long)enic);
 	mod_timer(&enic->rfs_h.rfs_may_expire, jiffies + HZ/4);
 }
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 62/64] drivers: net: cxgb: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/chelsio/cxgb/sge.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c
index 0f13a7f..75e4399 100644
--- a/drivers/net/ethernet/chelsio/cxgb/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
@@ -2075,9 +2075,8 @@ struct sge *t1_sge_create(struct adapter *adapter, struct sge_params *p)
 			goto nomem_port;
 	}
 
-	init_timer(&sge->tx_reclaim_timer);
-	sge->tx_reclaim_timer.data = (unsigned long)sge;
-	sge->tx_reclaim_timer.function = sge_tx_reclaim_cb;
+	setup_timer(&sge->tx_reclaim_timer, sge_tx_reclaim_cb,
+		    (unsigned long)sge);
 
 	if (is_T2(sge->adapter)) {
 		init_timer(&sge->espibug_timer);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 63/64] drivers: net: bnx2x: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index c12b4d3..54d15713 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12414,10 +12414,8 @@ static int bnx2x_init_bp(struct bnx2x *bp)
 
 	bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ;
 
-	init_timer(&bp->timer);
+	setup_timer(&bp->timer, bnx2x_timer, (unsigned long)bp);
 	bp->timer.expires = jiffies + bp->current_interval;
-	bp->timer.data = (unsigned long) bp;
-	bp->timer.function = bnx2x_timer;
 
 	if (SHMEM2_HAS(bp, dcbx_lldp_params_offset) &&
 	    SHMEM2_HAS(bp, dcbx_lldp_dcbx_stat_offset) &&
-- 
2.7.4

^ permalink raw reply related

* [PATCH 64/64] drivers: net: lmc: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/wan/lmc/lmc_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 4698450..ae69d65 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1084,10 +1084,8 @@ static int lmc_open(struct net_device *dev)
      * Setup a timer for the watchdog on probe, and start it running.
      * Since lmc_ok == 0, it will be a NOP for now.
      */
-    init_timer (&sc->timer);
+    setup_timer(&sc->timer, lmc_watchdog, (unsigned long)dev);
     sc->timer.expires = jiffies + HZ;
-    sc->timer.data = (unsigned long) dev;
-    sc->timer.function = lmc_watchdog;
     add_timer (&sc->timer);
 
     lmc_trace(dev, "lmc_open out");
-- 
2.7.4

^ permalink raw reply related

* [PATCH 06/64] drivers: net: bcm63xx: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:04 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 4f3845a..f8bbbbf 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1857,9 +1857,8 @@ static int bcm_enet_probe(struct platform_device *pdev)
 	spin_lock_init(&priv->rx_lock);
 
 	/* init rx timeout (used for oom) */
-	init_timer(&priv->rx_timeout);
-	priv->rx_timeout.function = bcm_enet_refill_rx_timer;
-	priv->rx_timeout.data = (unsigned long)dev;
+	setup_timer(&priv->rx_timeout, bcm_enet_refill_rx_timer,
+		    (unsigned long)dev);
 
 	/* init the mib update lock&work */
 	mutex_init(&priv->mib_update_lock);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 08/64] drivers: net: am79c961: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:04 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/amd/am79c961a.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/amd/am79c961a.c b/drivers/net/ethernet/amd/am79c961a.c
index b11e910..0612dbe 100644
--- a/drivers/net/ethernet/amd/am79c961a.c
+++ b/drivers/net/ethernet/amd/am79c961a.c
@@ -728,9 +728,7 @@ static int am79c961_probe(struct platform_device *pdev)
 	am79c961_banner();
 
 	spin_lock_init(&priv->chip_lock);
-	init_timer(&priv->timer);
-	priv->timer.data = (unsigned long)dev;
-	priv->timer.function = am79c961_timer;
+	setup_timer(&priv->timer, am79c961_timer, (unsigned long)dev);
 
 	if (am79c961_hw_init(dev))
 		goto release;
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH net 1/3] net: mvpp2: fix the dma_mask and coherent_dma_mask settings for PPv2.2
From: David Miller @ 2017-09-21 17:07 UTC (permalink / raw)
  To: antoine.tenart
  Cc: andrew, gregory.clement, thomas.petazzoni, miquel.raynal, nadavh,
	linux, linux-kernel, mw, stefanc, netdev
In-Reply-To: <20170921142413.GH3568@kwain>

From: Antoine Tenart <antoine.tenart@free-electrons.com>
Date: Thu, 21 Sep 2017 16:24:13 +0200

> That's also the default when the platform does not allocate dma_mask.

That's the problem that needs to be fixed then.

^ permalink raw reply

* Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c
From: Yuchung Cheng @ 2017-09-21 17:07 UTC (permalink / raw)
  To: 10035198.1vE6NFrMDO
  Cc: Oleksandr Natalenko, Alexey Kuznetsov, Hideaki YOSHIFUJI, netdev,
	linux-kernel@vger.kernel.org
In-Reply-To: <20170921014620.GA20906@castle>

On Wed, Sep 20, 2017 at 6:46 PM, Roman Gushchin <guro@fb.com> wrote:
>
> > Hello.
> >
> > Since, IIRC, v4.11, there is some regression in TCP stack resulting in the
> > warning shown below. Most of the time it is harmless, but rarely it just
> > causes either freeze or (I believe, this is related too) panic in
> > tcp_sacktag_walk() (because sk_buff passed to this function is NULL).
> > Unfortunately, I still do not have proper stacktrace from panic, but will try
> > to capture it if possible.
> >
> > Also, I have custom settings regarding TCP stack, shown below as well. ifb is
> > used to shape traffic with tc.
> >
> > Please note this regression was already reported as BZ [1] and as a letter to
> > ML [2], but got neither attention nor resolution. It is reproducible for (not
> > only) me on my home router since v4.11 till v4.13.1 incl.
> >
> > Please advise on how to deal with it. I'll provide any additional info if
> > necessary, also ready to test patches if any.
> >
> > Thanks.
> >
> > [1] https://bugzilla.kernel.org/show_bug.cgi?id=195835
> > [2] https://www.spinics.net/lists/netdev/msg436158.html
>
> We're experiencing the same problems on some machines in our fleet.
> Exactly the same symptoms: tcp_fastretrans_alert() warnings and
> sometimes panics in tcp_sacktag_walk().
>
> Here is an example of a backtrace with the panic log:
do you still see the panics if you disable RACK?
sysctl net.ipv4.tcp_recovery=0?

also have you experience any sack reneg? could you post the output of
' nstat |grep -i TCP' thanks


>
> 978.210080]  fuse
> [973978.214099]  sg
> [973978.217789]  loop
> [973978.221829]  efivarfs
> [973978.226544]  autofs4
> [973978.231109] CPU: 12 PID: 3806320 Comm: ld:srv:W20 Tainted: G        W       4.11.3-7_fbk1_1174_ga56eebf #7
> [973978.250563] Hardware name: Wiwynn Leopard-Orv2/Leopard-DDR BW, BIOS LBM06   10/28/2016
> [973978.266558] Call Trace:
> [973978.271615]  <IRQ>
> [973978.275817]  dump_stack+0x4d/0x70
> [973978.282626]  __warn+0xd3/0xf0
> [973978.288727]  warn_slowpath_null+0x1e/0x20
> [973978.296910]  tcp_fastretrans_alert+0xacf/0xbd0
> [973978.305974]  tcp_ack+0xbce/0x1390
> [973978.312770]  tcp_rcv_established+0x1ce/0x740
> [973978.321488]  tcp_v6_do_rcv+0x195/0x440
> [973978.329166]  tcp_v6_rcv+0x94c/0x9f0
> [973978.336323]  ip6_input_finish+0xea/0x430
> [973978.344330]  ip6_input+0x32/0xa0
> [973978.350968]  ? ip6_rcv_finish+0xa0/0xa0
> [973978.358799]  ip6_rcv_finish+0x4b/0xa0
> [973978.366289]  ipv6_rcv+0x2ec/0x4f0
> [973978.373082]  ? ip6_make_skb+0x1c0/0x1c0
> [973978.380919]  __netif_receive_skb_core+0x2d5/0x9a0
> [973978.390505]  __netif_receive_skb+0x16/0x70
> [973978.398875]  netif_receive_skb_internal+0x23/0x80
> [973978.408462]  napi_gro_receive+0x113/0x1d0
> [973978.416657]  mlx5e_handle_rx_cqe_mpwrq+0x5b6/0x8d0
> [973978.426398]  mlx5e_poll_rx_cq+0x7c/0x7f0
> [973978.434405]  mlx5e_napi_poll+0x8c/0x380
> [973978.442238]  ? mlx5_cq_completion+0x54/0xb0
> [973978.450770]  net_rx_action+0x22e/0x380
> [973978.458447]  __do_softirq+0x106/0x2e8
> [973978.465950]  irq_exit+0xb0/0xc0
> [973978.472396]  do_IRQ+0x4f/0xd0
> [973978.478495]  common_interrupt+0x86/0x86
> [973978.486329] RIP: 0033:0x7f8dee58d8ae
> [973978.493642] RSP: 002b:00007f8cb925f078 EFLAGS: 00000206
> [973978.504251]  ORIG_RAX: ffffffffffffff5f
> [973978.512085] RAX: 00007f8cb925f1a8 RBX: 0000000048000000 RCX: 00007f8764bd6a80
> [973978.526508] RDX: 00000000000001ba RSI: 00007f7cb4ca3410 RDI: 00007f7cb4ca3410
> [973978.540927] RBP: 000000000000000d R08: 00007f8764bd6b00 R09: 00007f8764bd6b80
> [973978.555347] R10: 0000000000002400 R11: 00007f8dee58e240 R12: d3273c84146e8c29
> [973978.569766] R13: 9dac83ddf04c235c R14: 00007f7cb4ca33b0 R15: 00007f7cb4ca4f50
> [973978.584189]  </IRQ>
> [973978.588650] ---[ end trace 5d1c83e12a57d039 ]---
> [973995.178183] BUG: unable to handle kernel
> [973995.186385] NULL pointer dereference
> [973995.193692]  at 0000000000000028
> [973995.200323] IP: tcp_sacktag_walk+0x2b7/0x460
> [973995.209032] PGD 102d856067
> [973995.214789] PUD fded0d067
> [973995.220385] PMD 0
> [973995.224577]
> [973995.227732] ------------[ cut here ]------------
> [973995.237128] Oops: 0000 [#1] SMP
> [973995.243575] Modules linked in:
> [973995.249868]  mptctl
> [973995.254251]  mptbase
> [973995.258792]  xt_DSCP
> [973995.263331]  xt_set
> [973995.267698]  ip_set_hash_ip
> [973995.273452]  cls_u32
> [973995.277993]  sch_sfq
> [973995.282535]  cls_fw
> [973995.286904]  sch_htb
> [973995.291444]  mpt3sas
> [973995.295982]  raid_class
> [973995.301044]  ip6table_mangle
> [973995.306973]  iptable_mangle
> [973995.312726]  cls_bpf
> [973995.317268]  tcp_diag
> [973995.321983]  udp_diag
> [973995.326697]  inet_diag
> [973995.331585]  ip6table_filter
> [973995.337513]  xt_NFLOG
> [973995.342226]  nfnetlink_log
> [973995.347807]  xt_comment
> [973995.352866]  xt_statistic
> [973995.358276]  iptable_filter
> [973995.364029]  xt_mark
> [973995.368572]  sb_edac
> [973995.373113]  edac_core
> [973995.378001]  x86_pkg_temp_thermal
> [973995.384795]  intel_powerclamp
> [973995.390897]  coretemp
> [973995.395608]  kvm_intel
> [973995.400498]  kvm
> [973995.404345]  irqbypass
> [973995.409235]  ses
> [973995.413078]  iTCO_wdt
> [973995.417794]  iTCO_vendor_support
> [973995.424415]  enclosure
> [973995.429301]  lpc_ich
> [973995.433843]  scsi_transport_sas
> [973995.440292]  mfd_core
> [973995.445007]  efivars
> [973995.449548]  ipmi_si
> [973995.454087]  ipmi_devintf
> [973995.459496]  i2c_i801
> [973995.464209]  ipmi_msghandler
> [973995.470138]  acpi_cpufreq
> [973995.475545]  button
> [973995.479914]  sch_fq_codel
> [973995.485319]  nfsd
> [973995.489341]  auth_rpcgss
> [973995.494573]  nfs_acl
> [973995.499114]  oid_registry
> [973995.504524]  lockd
> [973995.508717]  grace
> [973995.512912]  sunrpc
> [973995.517280]  megaraid_sas
> [973995.522689]  fuse
> [973995.526709]  sg
> [973995.530382]  loop
> [973995.534405]  efivarfs
> [973995.539118]  autofs4
> [973995.543660] CPU: 19 PID: 3806297 Comm: ld:srv:W0 Tainted: G        W       4.11.3-7_fbk1_1174_ga56eebf #7
> [973995.562936] Hardware name: Wiwynn Leopard-Orv2/Leopard-DDR BW, BIOS LBM06   10/28/2016
> [973995.578914] task: ffff880129e5c380 task.stack: ffffc900210cc000
> [973995.590914] RIP: 0010:tcp_sacktag_walk+0x2b7/0x460
> [973995.600648] RSP: 0000:ffff88203ef438e8 EFLAGS: 00010207
> [973995.611254] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 000000004e4ec474
> [973995.625677] RDX: 000000004e4ec2ad RSI: ffff8810361faa00 RDI: ffff881ffecf8840
> [973995.640102] RBP: ffff88203ef43940 R08: 0000000045729921 R09: 0000000000000000
> [973995.654519] R10: 00000000000085d6 R11: ffff881ffecf8998 R12: ffff881ffecf8840
> [973995.668938] R13: ffff88203ef43a48 R14: 0000000000000000 R15: ffff881ffecf8998
> [973995.683362] FS:  00007f8cc8cf7700(0000) GS:ffff88203ef40000(0000) knlGS:0000000000000000
> [973995.699686] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [973995.711331] CR2: 0000000000000028 CR3: 0000000104c1b000 CR4: 00000000003406e0
> [973995.725755] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [973995.740175] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [973995.754595] Call Trace:
> [973995.759652]  <IRQ>
> [973995.763855]  ? kprobe_perf_func+0x28/0x210
> [973995.772210]  tcp_sacktag_write_queue+0x5ff/0x9e0
> [973995.781615]  tcp_ack+0x677/0x1390
> [973995.788408]  tcp_rcv_established+0x1ce/0x740
> [973995.797112]  tcp_v6_do_rcv+0x195/0x440
> [973995.804767]  tcp_v6_rcv+0x94c/0x9f0
> [973995.811911]  ip6_input_finish+0xea/0x430
> [973995.819917]  ip6_input+0x32/0xa0
> [973995.826538]  ? ip6_rcv_finish+0xa0/0xa0
> [973995.834373]  ip6_rcv_finish+0x4b/0xa0
> [973995.841859]  ipv6_rcv+0x2ec/0x4f0
> [973995.848653]  ? ip6_fragment+0x9f0/0x9f0
> [973995.856489]  ? ip6_make_skb+0x1c0/0x1c0
> [973995.864323]  __netif_receive_skb_core+0x2d5/0x9a0
> [973995.873891]  __netif_receive_skb+0x16/0x70
> [973995.882244]  netif_receive_skb_internal+0x23/0x80
> [973995.891812]  napi_gro_receive+0x113/0x1d0
> [973995.899993]  mlx5e_handle_rx_cqe_mpwrq+0x5b6/0x8d0
> [973995.909735]  mlx5e_poll_rx_cq+0x7c/0x7f0
> [973995.917740]  mlx5e_napi_poll+0x8c/0x380
> [973995.925576]  ? mlx5_cq_completion+0x54/0xb0
> [973995.934101]  net_rx_action+0x22e/0x380
> [973995.941764]  __do_softirq+0x106/0x2e8
> [973995.949255]  irq_exit+0xb0/0xc0
> [973995.955696]  do_IRQ+0x4f/0xd0
> [973995.961798]  common_interrupt+0x86/0x86
> [973995.969634] RIP: 0033:0x7f8dec97a557
> [973995.976945] RSP: 002b:00007f8cc8cf2f48 EFLAGS: 00000206
> [973995.987552]  ORIG_RAX: ffffffffffffff20
> [973995.995386] RAX: 00007f7fa9e15230 RBX: 00007f8c2153a160 RCX: 00007f7fa9e15230
> [973996.009810] RDX: 0000000000000000 RSI: 00007f8cc8cf3040 RDI: 00007f8c204f90c0
> [973996.024230] RBP: 00007f8cc8cf2f80 R08: 0000000000000001 R09: 000131aa4c002c01
> [973996.038652] R10: 0000000000000000 R11: 0000000000000001 R12: 00007f8c2153a170
> [973996.053073] R13: 00007f8cc8cf3040 R14: 00007f8c204f90c0 R15: 00007f8c2153a120
> [973996.067494]  </IRQ>
> [973996.071858] Code:
> [973996.076051] b9
> [973996.079723] 01
> [973996.083383] 00
> [973996.087056] 00
> [973996.090730] 00
> [973996.094388] 85
> [973996.098062] c0
> [973996.101738] 0f
> [973996.105410] 8e
> [973996.109087] da
> [973996.112759] fd
> [973996.116433] ff
> [973996.120109] ff
> [973996.123783] 85
> [973996.127457] c0
> [973996.131132] 75
> [973996.134806] 28
> [973996.138481] 0f
> [973996.142156] b7
> [973996.145831] 43
> [973996.149504] 30
> [973996.153180] 41
> [973996.156835] 01
> [973996.160511] 45
> [973996.164168] 04
> [973996.167843] 48
> [973996.171517] 8b
> [973996.175190] 1b
> [973996.178848] 4c
> [973996.182521] 39
> [973996.186198] fb
> [973996.189872] 74
> [973996.193529] 8c
> [973996.197202] 49
> [973996.200877] 3b
> [973996.204534] 9c
> [973996.208209] 24
> [973996.211883] 50
> [973996.215559] 01
> [973996.219215] 00
> [973996.222889] 00
> [973996.226562] 74
> [973996.230221] c1
> [973996.233894] <8b>
> [973996.237916] 43
> [973996.241590] 28
> [973996.245264] 3b
> [973996.248921] 45
> [973996.252596] d4
> [973996.256271] 0f
> [973996.259929] 88
> [973996.263601] 9f
> [973996.267276] fd
> [973996.270935] ff
> [973996.274592] ff
> [973996.278267] eb
> [973996.281938] b3
> [973996.285614] 48
> [973996.289289] 8d
> [973996.292964] 43
> [973996.296638] 10
> [973996.300296] 8b
> [973996.303969] 4b
> [973996.307642] 28
> [973996.311325] RIP: tcp_sacktag_walk+0x2b7/0x460 RSP: ffff88203ef438e8
> [973996.324007] ------------[ cut here ]------------
> [973996.333399] CR2: 0000000000000028
> [973996.340218] ---[ end trace 5d1c83e12a57d03a ]---
> [973996.349605] Kernel panic - not syncing: Fatal exception in interrupt
> [973996.362521] Kernel Offset: disabled
> TBOOT: wait until all APs ready for txt shutdown
> TBOOT: IA32_FEATURE_CONTROL_MSR: 0000ff07
> TBOOT: CPU is SMX-capable
> TBOOT: CPU is VMX-capable
> TBOOT: SMX is enabled
> TBOOT: TXT chipset and all needed capabilities present
> TBOOT: TPM: Pcr 17 extend, return value = 0000003D
> TBOOT: TPM: Pcr 18 extend, return value = 0000003D
> TBOOT: TPM: Pcr 19 extend, return value = 0000003D
> TBOOT: cap'ed dynamic PCRs
> TBOOT: waiting for APs (0) to exit guests...
> TBOOT: .
> TBOOT:
> TBOOT: all APs exited guests
> TBOOT: calling txt_shutdown on AP
>
>
> Thanks!

^ permalink raw reply

* [PATCH 44/64] drivers: net: pxa168: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/marvell/pxa168_eth.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 9937249..91b1c15 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1496,9 +1496,8 @@ static int pxa168_eth_probe(struct platform_device *pdev)
 	netif_napi_add(dev, &pep->napi, pxa168_rx_poll, pep->rx_ring_size);
 
 	memset(&pep->timeout, 0, sizeof(struct timer_list));
-	init_timer(&pep->timeout);
-	pep->timeout.function = rxq_refill_timer_wrapper;
-	pep->timeout.data = (unsigned long)pep;
+	setup_timer(&pep->timeout, rxq_refill_timer_wrapper,
+		    (unsigned long)pep);
 
 	pep->smi_bus = mdiobus_alloc();
 	if (!pep->smi_bus) {
-- 
2.7.4

^ permalink raw reply related

* [PATCH 48/64] drivers: net: amd: use setup_timer() helper.
From: Allen Pais @ 2017-09-21 17:05 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, m.grzeschik, dmitry.tarnyagin, wg, mkl, mark.einon,
	linux, pcnet32, f.fainelli, bcm-kernel-feedback-list, venza, ajk,
	jes, romieu, khc, simon, davem, linux-can, adi-buildroot-devel,
	Allen Pais
In-Reply-To: <1506013525-29291-1-git-send-email-allen.lkml@gmail.com>

    Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/amd/a2065.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/amd/a2065.c b/drivers/net/ethernet/amd/a2065.c
index e22f976..998d30e 100644
--- a/drivers/net/ethernet/amd/a2065.c
+++ b/drivers/net/ethernet/amd/a2065.c
@@ -733,10 +733,9 @@ static int a2065_init_one(struct zorro_dev *z,
 	dev->watchdog_timeo = 5*HZ;
 	dev->dma = 0;
 
-	init_timer(&priv->multicast_timer);
-	priv->multicast_timer.data = (unsigned long) dev;
-	priv->multicast_timer.function =
-		(void (*)(unsigned long))lance_set_multicast;
+	setup_timer(&priv->multicast_timer,
+		    (void(*)(unsigned long))lance_set_multicast,
+		    (unsigned long)dev);
 
 	err = register_netdev(dev);
 	if (err) {
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH net] net: prevent dst uses after free
From: Martin KaFai Lau @ 2017-09-21 17:12 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Paweł Staszewski, Wei Wang, Cong Wang,
	Linux Kernel Network Developers, Eric Dumazet
In-Reply-To: <1506010546.29839.148.camel@edumazet-glaptop3.roam.corp.google.com>

On Thu, Sep 21, 2017 at 04:15:46PM +0000, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> In linux-4.13, Wei worked hard to convert dst to a traditional
> refcounted model, removing GC.
> 
> We now want to make sure a dst refcount can not transition from 0 back
> to 1.
> 
> The problem here is that input path attached a not refcounted dst to an
> skb. Then later, because packet is forwarded and hits skb_dst_force()
> before exiting RCU section, we might try to take a refcount on one dst
> that is about to be freed, if another cpu saw 1 -> 0 transition in
> dst_release() and queued the dst for freeing after one RCU grace period.
> 
> Lets unify skb_dst_force() and skb_dst_force_safe(), since we should
> always perform the complete check against dst refcount, and not assume
> it is not zero.
Acked-by: Martin KaFai Lau <kafai@fb.com>

> 
> Bugzilla : https://bugzilla.kernel.org/show_bug.cgi?id=197005
> 
> [  989.919496]  skb_dst_force+0x32/0x34
> [  989.919498]  __dev_queue_xmit+0x1ad/0x482
> [  989.919501]  ? eth_header+0x28/0xc6
> [  989.919502]  dev_queue_xmit+0xb/0xd
> [  989.919504]  neigh_connected_output+0x9b/0xb4
> [  989.919507]  ip_finish_output2+0x234/0x294
> [  989.919509]  ? ipt_do_table+0x369/0x388
> [  989.919510]  ip_finish_output+0x12c/0x13f
> [  989.919512]  ip_output+0x53/0x87
> [  989.919513]  ip_forward_finish+0x53/0x5a
> [  989.919515]  ip_forward+0x2cb/0x3e6
> [  989.919516]  ? pskb_trim_rcsum.part.9+0x4b/0x4b
> [  989.919518]  ip_rcv_finish+0x2e2/0x321
> [  989.919519]  ip_rcv+0x26f/0x2eb
> [  989.919522]  ? vlan_do_receive+0x4f/0x289
> [  989.919523]  __netif_receive_skb_core+0x467/0x50b
> [  989.919526]  ? tcp_gro_receive+0x239/0x239
> [  989.919529]  ? inet_gro_receive+0x226/0x238
> [  989.919530]  __netif_receive_skb+0x4d/0x5f
> [  989.919532]  netif_receive_skb_internal+0x5c/0xaf
> [  989.919533]  napi_gro_receive+0x45/0x81
> [  989.919536]  ixgbe_poll+0xc8a/0xf09
> [  989.919539]  ? kmem_cache_free_bulk+0x1b6/0x1f7
> [  989.919540]  net_rx_action+0xf4/0x266
> [  989.919543]  __do_softirq+0xa8/0x19d
> [  989.919545]  irq_exit+0x5d/0x6b
> [  989.919546]  do_IRQ+0x9c/0xb5
> [  989.919548]  common_interrupt+0x93/0x93
> [  989.919548]  </IRQ>
> 
> 
> Similarly dst_clone() can use dst_hold() helper to have additional
> debugging, as a follow up to commit 44ebe79149ff ("net: add debug
> atomic_inc_not_zero() in dst_hold()")
> 
> In net-next we will convert dst atomic_t to refcount_t for peace of
> mind.
> 
> Fixes: a4c2fd7f7891 ("net: remove DST_NOCACHE flag")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Wei Wang <weiwan@google.com>
> Reported-by: Paweł Staszewski <pstaszewski@itcare.pl>
> Bisected-by: Paweł Staszewski <pstaszewski@itcare.pl>
> ---
>  include/net/dst.h   |   22 ++++------------------
>  include/net/route.h |    2 +-
>  include/net/sock.h  |    2 +-
>  3 files changed, 6 insertions(+), 20 deletions(-)
> 
> diff --git a/include/net/dst.h b/include/net/dst.h
> index 93568bd0a3520bb7402f04d90cf04ac99c81cfbe..06a6765da074449e6f1fe42ee05e711e898ad372 100644
> --- a/include/net/dst.h
> +++ b/include/net/dst.h
> @@ -271,7 +271,7 @@ static inline void dst_use_noref(struct dst_entry *dst, unsigned long time)
>  static inline struct dst_entry *dst_clone(struct dst_entry *dst)
>  {
>  	if (dst)
> -		atomic_inc(&dst->__refcnt);
> +		dst_hold(dst);
>  	return dst;
>  }
>  
> @@ -311,21 +311,6 @@ static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb
>  	__skb_dst_copy(nskb, oskb->_skb_refdst);
>  }
>  
> -/**
> - * skb_dst_force - makes sure skb dst is refcounted
> - * @skb: buffer
> - *
> - * If dst is not yet refcounted, let's do it
> - */
> -static inline void skb_dst_force(struct sk_buff *skb)
> -{
> -	if (skb_dst_is_noref(skb)) {
> -		WARN_ON(!rcu_read_lock_held());
> -		skb->_skb_refdst &= ~SKB_DST_NOREF;
> -		dst_clone(skb_dst(skb));
> -	}
> -}
> -
>  /**
>   * dst_hold_safe - Take a reference on a dst if possible
>   * @dst: pointer to dst entry
> @@ -339,16 +324,17 @@ static inline bool dst_hold_safe(struct dst_entry *dst)
>  }
>  
>  /**
> - * skb_dst_force_safe - makes sure skb dst is refcounted
> + * skb_dst_force - makes sure skb dst is refcounted
>   * @skb: buffer
>   *
>   * If dst is not yet refcounted and not destroyed, grab a ref on it.
>   */
> -static inline void skb_dst_force_safe(struct sk_buff *skb)
> +static inline void skb_dst_force(struct sk_buff *skb)
>  {
>  	if (skb_dst_is_noref(skb)) {
>  		struct dst_entry *dst = skb_dst(skb);
>  
> +		WARN_ON(!rcu_read_lock_held());
>  		if (!dst_hold_safe(dst))
>  			dst = NULL;
>  
> diff --git a/include/net/route.h b/include/net/route.h
> index 1b09a9368c68d46f0c5ee8ce3cefe566000c1ec1..57dfc6850d378e4b96f13b140eef554d66c24cdf 100644
> --- a/include/net/route.h
> +++ b/include/net/route.h
> @@ -190,7 +190,7 @@ static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src,
>  	rcu_read_lock();
>  	err = ip_route_input_noref(skb, dst, src, tos, devin);
>  	if (!err) {
> -		skb_dst_force_safe(skb);
> +		skb_dst_force(skb);
>  		if (!skb_dst(skb))
>  			err = -EINVAL;
>  	}
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 03a362568357acc7278a318423dd3873103f90ca..a6b9a8d1a6df3f72df8f1aac0f577257fa6452d0 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -856,7 +856,7 @@ void sk_stream_write_space(struct sock *sk);
>  static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
>  {
>  	/* dont let skb dst not refcounted, we are going to leave rcu lock */
> -	skb_dst_force_safe(skb);
> +	skb_dst_force(skb);
>  
>  	if (!sk->sk_backlog.tail)
>  		sk->sk_backlog.head = skb;
> 
> 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox