[dpdk-dev] [dpdk-stable] [PATCH] net/ena: fix L4 cksum flags condition for TX

Thomas Monjalon thomas at monjalon.net
Mon Aug 5 19:44:25 CEST 2019


01/08/2019 14:08, Michał Krawczyk:
> czw., 1 sie 2019 o 13:45 Maciej Bielski <mba at semihalf.com> napisał(a):
> >
> > During an if-condition evaluation, a 2-bit flag evaluates to 'true' for
> > '0x1', '0x2' and '0x3'. Thus, from this perspective these flags are
> > indistinguishable. To make them distinct, respective bits must be
> > extracted with a mask and then checked for strict equality.
> >
> > Specifically here, even if `PKT_TX_UDP_CKSUM` (value '0x3') was set, the
> > expression `mbuf->ol_flags & PKT_TX_TCP` (the second flag of value
> > '0x1') is evaluated first and the result is 'true'. In consequence, for
> > UDP packets the execution flow enters an incorrect branch.
> >
> > Fixes: 56b8b9b7e5d2 (net/ena: convert to new Tx offloads API)
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Maciej Bielski <mba at semihalf.com>
> > Reported-by: Eduard Serra <eduser25 at gmail.com>
> Acked-by: Michal Krawczyk <mk at semihalf.com>

Applied, thanks





More information about the dev mailing list