Commit b0390009 authored by Gatis Peisenieks's avatar Gatis Peisenieks Committed by David S. Miller

atl1c: enable rx csum offload on Mikrotik 10/25G NIC

Mikrotik 10/25G NIC supports hw checksum verification on rx for
IP/IPv6 + TCP/UDP packets. HW checksum offload helps reduce host
cpu load.

This enables the csum offload specifically for Mikrotik 10/25G NIC
as other HW supported by the driver is known to have problems with it.

TCP iperf3 to Threadripper 3960X with NIC improved 16.5 -> 20.0 Gbps
with mtu=1500.
Signed-off-by: default avatarGatis Peisenieks <gatis@mikrotik.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 545fa3fb
......@@ -241,6 +241,8 @@ struct atl1c_tpd_ext_desc {
#define RRS_PACKET_PROT_IS_IPV6_ONLY(word) \
((((word) >> RRS_PROT_ID_SHIFT) & RRS_PROT_ID_MASK) == 6)
#define RRS_MT_PROT_ID_TCPUDP BIT(19)
struct atl1c_recv_ret_status {
__le32 word0;
__le32 rss_hash;
......
......@@ -1671,6 +1671,11 @@ static irqreturn_t atl1c_intr(int irq, void *data)
static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter,
struct sk_buff *skb, struct atl1c_recv_ret_status *prrs)
{
if (adapter->hw.nic_type == athr_mt) {
if (prrs->word3 & RRS_MT_PROT_ID_TCPUDP)
skb->ip_summed = CHECKSUM_UNNECESSARY;
return;
}
/*
* The pid field in RRS in not correct sometimes, so we
* cannot figure out if the packet is fragmented or not,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment