Skip to content

Commit 4d8bbbf

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Hopefully the last round of fixes this release, fingers crossed :) 1) Initialize static nf_conntrack_locks_all_lock properly, from Florian Westphal. 2) Need to cancel pending work when destroying IDLETIMER entries, from Liping Zhang. 3) Fix TX param usage when sending TSO over iwlwifi devices, from Emmanuel Grumbach. 4) NFACCT quota params not validated properly, from Phil Turnbull. 5) Resolve more glibc vs. kernel header conflicts, from Mikko Tapeli. 6) Missing IRQ free in ravb_close(), from Geert Uytterhoeven. 7) Fix infoleak in x25, from Kangjie Lu. 8) Similarly in thunderx driver, from Heinrich Schuchardt. 9) tc_ife.h uapi header not exported properly, from Jamal Hadi Salim. 10) Don't reenable PHY interreupts if device is in polling mode, from Shaohui Xie. 11) Packet scheduler actions late binding was not being handled properly at all, from Jamal Hadi Salim. 12) Fix binding of conntrack entries to helpers in openvswitch, from Joe Stringer" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits) gre: do not keep the GRE header around in collect medata mode openvswitch: Fix cached ct with helper. net sched: ife action fix late binding net sched: skbedit action fix late binding net sched: simple action fix late binding net sched: mirred action fix late binding net sched: ipt action fix late binding net sched: vlan action fix late binding net: phylib: fix interrupts re-enablement in phy_start tcp: refresh skb timestamp at retransmit time net: nps_enet: bug fix - handle lost tx interrupts net: nps_enet: Tx handler synchronization export tc ife uapi header net: thunderx: avoid exposing kernel stack net: fix a kernel infoleak in x25 module ravb: Add missing free_irq() call to ravb_close() uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h netfilter: nfnetlink_acct: validate NFACCT_QUOTA parameter iwlwifi: mvm: don't override the rate with the AMSDU len netfilter: IDLETIMER: fix race condition when destroy the target ...
2 parents 50c7389 + e271c7b commit 4d8bbbf

File tree

22 files changed

+258
-86
lines changed

22 files changed

+258
-86
lines changed

drivers/net/ethernet/cavium/thunder/nicvf_queues.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ static void nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs,
533533
nicvf_config_vlan_stripping(nic, nic->netdev->features);
534534

535535
/* Enable Receive queue */
536+
memset(&rq_cfg, 0, sizeof(struct rq_cfg));
536537
rq_cfg.ena = 1;
537538
rq_cfg.tcp_ena = 0;
538539
nicvf_queue_reg_write(nic, NIC_QSET_RQ_0_7_CFG, qidx, *(u64 *)&rq_cfg);
@@ -565,6 +566,7 @@ void nicvf_cmp_queue_config(struct nicvf *nic, struct queue_set *qs,
565566
qidx, (u64)(cq->dmem.phys_base));
566567

567568
/* Enable Completion queue */
569+
memset(&cq_cfg, 0, sizeof(struct cq_cfg));
568570
cq_cfg.ena = 1;
569571
cq_cfg.reset = 0;
570572
cq_cfg.caching = 0;
@@ -613,6 +615,7 @@ static void nicvf_snd_queue_config(struct nicvf *nic, struct queue_set *qs,
613615
qidx, (u64)(sq->dmem.phys_base));
614616

615617
/* Enable send queue & set queue size */
618+
memset(&sq_cfg, 0, sizeof(struct sq_cfg));
616619
sq_cfg.ena = 1;
617620
sq_cfg.reset = 0;
618621
sq_cfg.ldwb = 0;
@@ -649,6 +652,7 @@ static void nicvf_rbdr_config(struct nicvf *nic, struct queue_set *qs,
649652

650653
/* Enable RBDR & set queue size */
651654
/* Buffer size should be in multiples of 128 bytes */
655+
memset(&rbdr_cfg, 0, sizeof(struct rbdr_cfg));
652656
rbdr_cfg.ena = 1;
653657
rbdr_cfg.reset = 0;
654658
rbdr_cfg.ldwb = 0;

drivers/net/ethernet/ezchip/nps_enet.c

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void nps_enet_tx_handler(struct net_device *ndev)
145145
u32 tx_ctrl_nt = (tx_ctrl_value & TX_CTL_NT_MASK) >> TX_CTL_NT_SHIFT;
146146

147147
/* Check if we got TX */
148-
if (!priv->tx_packet_sent || tx_ctrl_ct)
148+
if (!priv->tx_skb || tx_ctrl_ct)
149149
return;
150150

151151
/* Ack Tx ctrl register */
@@ -160,7 +160,7 @@ static void nps_enet_tx_handler(struct net_device *ndev)
160160
}
161161

162162
dev_kfree_skb(priv->tx_skb);
163-
priv->tx_packet_sent = false;
163+
priv->tx_skb = NULL;
164164

165165
if (netif_queue_stopped(ndev))
166166
netif_wake_queue(ndev);
@@ -183,6 +183,9 @@ static int nps_enet_poll(struct napi_struct *napi, int budget)
183183
work_done = nps_enet_rx_handler(ndev);
184184
if (work_done < budget) {
185185
u32 buf_int_enable_value = 0;
186+
u32 tx_ctrl_value = nps_enet_reg_get(priv, NPS_ENET_REG_TX_CTL);
187+
u32 tx_ctrl_ct =
188+
(tx_ctrl_value & TX_CTL_CT_MASK) >> TX_CTL_CT_SHIFT;
186189

187190
napi_complete(napi);
188191

@@ -192,6 +195,18 @@ static int nps_enet_poll(struct napi_struct *napi, int budget)
192195

193196
nps_enet_reg_set(priv, NPS_ENET_REG_BUF_INT_ENABLE,
194197
buf_int_enable_value);
198+
199+
/* in case we will get a tx interrupt while interrupts
200+
* are masked, we will lose it since the tx is edge interrupt.
201+
* specifically, while executing the code section above,
202+
* between nps_enet_tx_handler and the interrupts enable, all
203+
* tx requests will be stuck until we will get an rx interrupt.
204+
* the two code lines below will solve this situation by
205+
* re-adding ourselves to the poll list.
206+
*/
207+
208+
if (priv->tx_skb && !tx_ctrl_ct)
209+
napi_reschedule(napi);
195210
}
196211

197212
return work_done;
@@ -217,7 +232,7 @@ static irqreturn_t nps_enet_irq_handler(s32 irq, void *dev_instance)
217232
u32 tx_ctrl_ct = (tx_ctrl_value & TX_CTL_CT_MASK) >> TX_CTL_CT_SHIFT;
218233
u32 rx_ctrl_cr = (rx_ctrl_value & RX_CTL_CR_MASK) >> RX_CTL_CR_SHIFT;
219234

220-
if ((!tx_ctrl_ct && priv->tx_packet_sent) || rx_ctrl_cr)
235+
if ((!tx_ctrl_ct && priv->tx_skb) || rx_ctrl_cr)
221236
if (likely(napi_schedule_prep(&priv->napi))) {
222237
nps_enet_reg_set(priv, NPS_ENET_REG_BUF_INT_ENABLE, 0);
223238
__napi_schedule(&priv->napi);
@@ -387,8 +402,6 @@ static void nps_enet_send_frame(struct net_device *ndev,
387402
/* Write the length of the Frame */
388403
tx_ctrl_value |= length << TX_CTL_NT_SHIFT;
389404

390-
/* Indicate SW is done */
391-
priv->tx_packet_sent = true;
392405
tx_ctrl_value |= NPS_ENET_ENABLE << TX_CTL_CT_SHIFT;
393406
/* Send Frame */
394407
nps_enet_reg_set(priv, NPS_ENET_REG_TX_CTL, tx_ctrl_value);
@@ -465,7 +478,7 @@ static s32 nps_enet_open(struct net_device *ndev)
465478
s32 err;
466479

467480
/* Reset private variables */
468-
priv->tx_packet_sent = false;
481+
priv->tx_skb = NULL;
469482
priv->ge_mac_cfg_2_value = 0;
470483
priv->ge_mac_cfg_3_value = 0;
471484

@@ -534,6 +547,11 @@ static netdev_tx_t nps_enet_start_xmit(struct sk_buff *skb,
534547

535548
priv->tx_skb = skb;
536549

550+
/* make sure tx_skb is actually written to the memory
551+
* before the HW is informed and the IRQ is fired.
552+
*/
553+
wmb();
554+
537555
nps_enet_send_frame(ndev, skb);
538556

539557
return NETDEV_TX_OK;

drivers/net/ethernet/ezchip/nps_enet.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,12 @@
165165
* struct nps_enet_priv - Storage of ENET's private information.
166166
* @regs_base: Base address of ENET memory-mapped control registers.
167167
* @irq: For RX/TX IRQ number.
168-
* @tx_packet_sent: SW indication if frame is being sent.
169168
* @tx_skb: socket buffer of sent frame.
170169
* @napi: Structure for NAPI.
171170
*/
172171
struct nps_enet_priv {
173172
void __iomem *regs_base;
174173
s32 irq;
175-
bool tx_packet_sent;
176174
struct sk_buff *tx_skb;
177175
struct napi_struct napi;
178176
u32 ge_mac_cfg_2_value;

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,8 @@ static int ravb_close(struct net_device *ndev)
15061506
priv->phydev = NULL;
15071507
}
15081508

1509+
if (priv->chip_id == RCAR_GEN3)
1510+
free_irq(priv->emac_irq, ndev);
15091511
free_irq(ndev->irq, ndev);
15101512

15111513
napi_disable(&priv->napi[RAVB_NC]);

drivers/net/phy/phy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,11 @@ void phy_start(struct phy_device *phydev)
790790
break;
791791
case PHY_HALTED:
792792
/* make sure interrupts are re-enabled for the PHY */
793-
err = phy_enable_interrupts(phydev);
794-
if (err < 0)
795-
break;
793+
if (phydev->irq != PHY_POLL) {
794+
err = phy_enable_interrupts(phydev);
795+
if (err < 0)
796+
break;
797+
}
796798

797799
phydev->state = PHY_RESUMING;
798800
do_resume = true;

0 commit comments

Comments
 (0)