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

Commit ce7d70af authored by Guo-Fu Tseng's avatar Guo-Fu Tseng Committed by David S. Miller
Browse files

jme: Tuning rxsum function



1. Use more efficient way to determine flag status.
2. Hardware dose not mark fragment bit against IPv6 packets,
   print TCP/UDP checksum warning message for IPv4 packets
   only.

Signed-off-by: default avatarGuo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d1dfa1d1
Loading
Loading
Loading
Loading
+13 −13
Original line number Original line Diff line number Diff line
@@ -880,27 +880,27 @@ jme_rxsum_ok(struct jme_adapter *jme, u16 flags)
	if (!(flags & (RXWBFLAG_TCPON | RXWBFLAG_UDPON | RXWBFLAG_IPV4)))
	if (!(flags & (RXWBFLAG_TCPON | RXWBFLAG_UDPON | RXWBFLAG_IPV4)))
		return false;
		return false;


	if (unlikely(!(flags & RXWBFLAG_MF) &&
	if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_TCPON | RXWBFLAG_TCPCS))
	(flags & RXWBFLAG_TCPON) && !(flags & RXWBFLAG_TCPCS))) {
			== RXWBFLAG_TCPON)) {
		msg_rx_err(jme, "TCP Checksum error.\n");
		if (flags & RXWBFLAG_IPV4)
		goto out_sumerr;
			msg_rx_err(jme, "TCP Checksum error\n");
		return false;
	}
	}


	if (unlikely(!(flags & RXWBFLAG_MF) &&
	if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_UDPON | RXWBFLAG_UDPCS))
	(flags & RXWBFLAG_UDPON) && !(flags & RXWBFLAG_UDPCS))) {
			== RXWBFLAG_UDPON)) {
		if (flags & RXWBFLAG_IPV4)
			msg_rx_err(jme, "UDP Checksum error.\n");
			msg_rx_err(jme, "UDP Checksum error.\n");
		goto out_sumerr;
		return false;
	}
	}


	if (unlikely((flags & RXWBFLAG_IPV4) && !(flags & RXWBFLAG_IPCS))) {
	if (unlikely((flags & (RXWBFLAG_IPV4 | RXWBFLAG_IPCS))
			== RXWBFLAG_IPV4)) {
		msg_rx_err(jme, "IPv4 Checksum error.\n");
		msg_rx_err(jme, "IPv4 Checksum error.\n");
		goto out_sumerr;
		return false;
	}
	}


	return true;
	return true;

out_sumerr:
	return false;
}
}


static void
static void