Hello
I used UDP transmission interval of 1ms to transmit 1400 bytes. When there was a problem, macerr kept increasing and the upper layer could not receive any RX data. At this time, arp of my board could be sent to PC normally, and RX reception of the board seemed to be suspended.
I found this patch in the community https://lkml.org/lkml/2016/11/17/945 And in the kernel version 4.1.15 version of this patch, indeed no RX stop receiving phenomenon.Because the time of appearance is uncertain, I am not sure whether there is still a problem, the patch code does not adapt to my kernel, I do not know whether this modification is reasonable.
+static inline bool
+fec_enet_recover_rxq(struct fec_enet_private *fep, u16 queue_id)
+{
+int work_bit = (queue_id == 0) ? 2 : ((queue_id == 1) ? 0 : 1);
+if(readl(fep->hwp + FEC_R_DES_ACTIVE(queue_id)))
+return false;
+dev_notice_once(&fep->pdev->dev, "Recovered rx queue\n");
+fep->work_rx |= 1 << work_bit;
+return true;
+}
+static inline bool fec_enet_recover_rxqs(struct fec_enet_private *fep)
+{
+unsigned int q;
+bool ret = false;
+for (q = 0; q < fep->num_rx_queues; q++) {
+if (fec_enet_recover_rxq(fep, q))
+ret = true;
+}
+return ret;
+}
static int fec_enet_rx_napi(struct napi_struct *napi, int budget)
{
struct net_device *ndev = napi->dev;
struct fec_enet_private *fep = netdev_priv(ndev);
int pkts;
pkts = fec_enet_rx(ndev, budget);
fec_enet_tx(ndev);
if (pkts < budget) {
napi_complete(napi);
writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+if (fec_enet_recover_rxqs(fep) && napi_reschedule(napi)){
+writel(FEC_ENET_RXF | FEC_ENET_RXB, fep->hwp + FEC_IMASK);
+}
}
return pkts;
}
Can you give me some advice?
thanks