The documentation describes NETIF_F_IP_CSUM as deprecated
so let's switch to NETIF_F_HW_CSUM and use the helper to
handle unhandled protocols.

Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org>
---
 drivers/net/ethernet/faraday/ftgmac100.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c 
b/drivers/net/ethernet/faraday/ftgmac100.c
index 98b8956..85b650a 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -637,7 +637,8 @@ static int ftgmac100_hard_start_xmit(struct sk_buff *skb,
                                csum_vlan |= FTGMAC100_TXDES1_TCP_CHKSUM;
                        else if (ip_proto == IPPROTO_UDP)
                                csum_vlan |= FTGMAC100_TXDES1_UDP_CHKSUM;
-               }
+               } else if (skb_checksum_help(skb))
+                       goto drop;
        }
        txdes->txdes1 = cpu_to_le32(csum_vlan);
 
@@ -1463,11 +1464,11 @@ static int ftgmac100_probe(struct platform_device *pdev)
         * when NCSI is enabled on the interface. It doesn't work
         * in that case.
         */
-       netdev->features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
+       netdev->features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM |
                NETIF_F_GRO | NETIF_F_SG;
        if (priv->use_ncsi &&
            of_get_property(pdev->dev.of_node, "no-hw-checksum", NULL))
-               netdev->features &= ~NETIF_F_IP_CSUM;
+               netdev->features &= ~NETIF_F_HW_CSUM;
 
        /* register network device */
        err = register_netdev(netdev);
-- 
2.9.3

Reply via email to