lkml.org 
[lkml]   [2024]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2024-05-27 18:24    [W:0.134 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site