[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1bb2d174-ccae-43e3-80ec-872b9a140fbe@lunn.ch>
Date: Fri, 10 May 2024 18:40:58 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Justin Lai <justinlai0215@...ltek.com>
Cc: kuba@...nel.org, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, jiri@...nulli.us, horms@...nel.org,
pkshih@...ltek.com, larry.chiu@...ltek.com
Subject: Re: [PATCH net-next v18 06/13] rtase: Implement .ndo_start_xmit
function
> +static u32 rtase_tx_csum(struct sk_buff *skb, const struct net_device *dev)
> +{
> + u32 csum_cmd = 0;
> + u8 ip_protocol;
> +
> + switch (vlan_get_protocol(skb)) {
> + case htons(ETH_P_IP):
> + csum_cmd = RTASE_TX_IPCS_C;
> + ip_protocol = ip_hdr(skb)->protocol;
> + break;
> +
> + case htons(ETH_P_IPV6):
> + csum_cmd = RTASE_TX_IPV6F_C;
> + ip_protocol = ipv6_hdr(skb)->nexthdr;
> + break;
> +
> + default:
> + ip_protocol = IPPROTO_RAW;
> + break;
> + }
> +
> + if (ip_protocol == IPPROTO_TCP)
> + csum_cmd |= RTASE_TX_TCPCS_C;
> + else if (ip_protocol == IPPROTO_UDP)
> + csum_cmd |= RTASE_TX_UDPCS_C;
> + else
> + WARN_ON_ONCE(1);
I'm not so sure about this WARN_ON_ONCE(). It looks like if i send a
custom packet which is not IPv4 or IPv6 it will fire. There are other
protocols then IP. Connecting to an Ethernet switch using DSA tags
would be a good example. So i don't think you want this warning.
Andrew
Powered by blists - more mailing lists