Răsfoiți Sursa

net: ethernet: ti: am65-cpsw-nuss: fix checksum offload for IPv4

Due to a typo receive checksum offload for IPv4 is effectively
ignored. Fix it.

Also, per TRM, CHECKSUM_ERROR bit makes sense only when IPV6 and
IPV4 are valid. Flip the if() check to reflect the same order.
This makes it easier to match code with TRM.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Sekhar Nori 6 ani în urmă
părinte
comite
febedbc31a
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      drivers/net/ethernet/ti/am65-cpsw-nuss.c

+ 3 - 3
drivers/net/ethernet/ti/am65-cpsw-nuss.c

@@ -720,9 +720,9 @@ static void am65_cpsw_nuss_rx_csum(struct sk_buff *skb, u32 csum_info)
 	if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM)))
 	if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM)))
 		return;
 		return;
 
 
-	if (!(csum_info & AM65_CPSW_RX_PSD_CSUM_ERR) &&
-	    (csum_info & (AM65_CPSW_RX_PSD_IPV6_VALID |
-			  AM65_CPSW_RX_PSD_IPV6_VALID))) {
+	if ((csum_info & (AM65_CPSW_RX_PSD_IPV6_VALID |
+			  AM65_CPSW_RX_PSD_IPV4_VALID)) &&
+			  !(csum_info & AM65_CPSW_RX_PSD_CSUM_ERR)) {
 		if (csum_info & AM65_CPSW_RX_PSD_IS_FRAGMENT) {
 		if (csum_info & AM65_CPSW_RX_PSD_IS_FRAGMENT) {
 			skb->ip_summed = CHECKSUM_COMPLETE;
 			skb->ip_summed = CHECKSUM_COMPLETE;
 			skb->csum = csum_unfold(csum_info &
 			skb->csum = csum_unfold(csum_info &