Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 364a97f5 authored by Roman Yeryomin's avatar Roman Yeryomin Committed by David S. Miller
Browse files

net: korina: optimize rx descriptor flags processing

parent 7ce103b4
Loading
Loading
Loading
Loading
+44 −43
Original line number Diff line number Diff line
@@ -363,11 +363,18 @@ static int korina_rx(struct net_device *dev, int limit)
		if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0)
			break;

		/* check that this is a whole packet
		 * WARNING: DMA_FD bit incorrectly set
		 * in Rc32434 (errata ref #077) */
		if (!(devcs & ETH_RX_LD))
			goto next;

		if (!(devcs & ETH_RX_ROK)) {
			/* Update statistics counters */
			dev->stats.rx_errors++;
			dev->stats.rx_dropped++;
			if (devcs & ETH_RX_CRC)
				dev->stats.rx_crc_errors++;
		if (devcs & ETH_RX_LOR)
			dev->stats.rx_length_errors++;
			if (devcs & ETH_RX_LE)
				dev->stats.rx_length_errors++;
			if (devcs & ETH_RX_OVR)
@@ -375,17 +382,11 @@ static int korina_rx(struct net_device *dev, int limit)
			if (devcs & ETH_RX_CV)
				dev->stats.rx_frame_errors++;
			if (devcs & ETH_RX_CES)
			dev->stats.rx_length_errors++;
		if (devcs & ETH_RX_MP)
			dev->stats.multicast++;
				dev->stats.rx_frame_errors++;

			goto next;
		}

		if ((devcs & ETH_RX_LD) != ETH_RX_LD) {
			/* check that this is a whole packet
			 * WARNING: DMA_FD bit incorrectly set
			 * in Rc32434 (errata ref #077) */
			dev->stats.rx_errors++;
			dev->stats.rx_dropped++;
		} else if ((devcs & ETH_RX_ROK)) {
		pkt_len = RCVPKT_LENGTH(devcs);

		/* must be the (first and) last
@@ -414,8 +415,8 @@ static int korina_rx(struct net_device *dev, int limit)
			dev->stats.multicast++;

		lp->rx_skb[lp->rx_next_done] = skb_new;
		}

next:
		rd->devcs = 0;

		/* Restore descriptor's curr_addr */