06/10/2020 10:10, Olivier Matz:
> On Mon, Oct 05, 2020 at 07:39:45PM -0700, Stephen Hemminger wrote:
> > On Tue, 06 Oct 2020 00:55:19 +0200
> > Thomas Monjalon wrote:
> > >
> > > On 9/1/20 12:47 PM, Michael Pfeiffer wrote:
> > > > Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all
Hi,
On Tue, 2020-10-06 at 10:10 +0200, Olivier Matz wrote:
> On Mon, Oct 05, 2020 at 07:39:45PM -0700, Stephen Hemminger wrote:
> > On Tue, 06 Oct 2020 00:55:19 +0200
> > Thomas Monjalon wrote:
> > >
> > > On 9/1/20 12:47 PM, Michael Pfeiffer wrote:
> > > > Currently, rte_ipv4_cksum() and rte_ip
On Mon, Oct 05, 2020 at 07:39:45PM -0700, Stephen Hemminger wrote:
> On Tue, 06 Oct 2020 00:55:19 +0200
> Thomas Monjalon wrote:
> >
> > On 9/1/20 12:47 PM, Michael Pfeiffer wrote:
> > > Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all IPv4
> > > headers have sizeof(struct rte_ip
On Tue, 06 Oct 2020 00:55:19 +0200
Thomas Monjalon wrote:
> > - cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
> > + cksum = rte_raw_cksum(ipv4_hdr, (ipv4_hdr->version_ihl & 0xf) * 4);
> >
>
> Truly naive questions:
> - doesn't it deserve a static inline function rt
> - cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
> + cksum = rte_raw_cksum(ipv4_hdr, (ipv4_hdr->version_ihl & 0xf) * 4);
Truly naive questions:
- doesn't it deserve a static inline function rte_ipv4_hdr_len()?
- how generated code for "* 4" compares with "<< 2"?
On 9/1/20 12:47 PM, Michael Pfeiffer wrote:
> Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all IPv4
> headers have sizeof(struct rte_ipv4_hdr) bytes. This is not true for
> those (rare) packets with IPv4 options. Thus, both IPv4 and TCP/UDP
> checksums are calculated wrong.
>
> T
Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all IPv4
headers have sizeof(struct rte_ipv4_hdr) bytes. This is not true for
those (rare) packets with IPv4 options. Thus, both IPv4 and TCP/UDP
checksums are calculated wrong.
This patch fixes the issue by using the actual IPv4 heade
7 matches
Mail list logo