[Patch v2] net/netvsc: fix the calculation of checksums based on mbuf flag

Ajit Khaparde ajit.khaparde at broadcom.com
Wed Apr 27 00:09:15 CEST 2022


On Tue, Apr 26, 2022 at 2:57 PM Ferruh Yigit <ferruh.yigit at xilinx.com> wrote:
>
> On 3/24/2022 5:46 PM, longli at linuxonhyperv.com wrote:
> > From: Long Li <longli at microsoft.com>
> >
> > The netvsc should use RTE_MBUF_F_TX_L4_MASK and check the masked value to
> > decide the correct way to calculate checksums.
> >
> > Not checking for RTE_MBUF_F_TX_L4_MASK results in incorrect RNDIS packets
> > sent to VSP and incorrect checksums calculated by the VSP.
> >
> > Fixes: 4e9c73e96e ("net/netvsc: add Hyper-V network device")
> > Cc: stable at dpdk.org
> > Signed-off-by: Long Li <longli at microsoft.com>
> > ---
> >   drivers/net/netvsc/hn_rxtx.c | 13 +++++++++----
> >   1 file changed, 9 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
> > index 028f176c7e..34f40be5b8 100644
> > --- a/drivers/net/netvsc/hn_rxtx.c
> > +++ b/drivers/net/netvsc/hn_rxtx.c
> > @@ -1348,8 +1348,11 @@ static void hn_encap(struct rndis_packet_msg *pkt,
> >                       *pi_data = NDIS_LSO2_INFO_MAKEIPV4(hlen,
> >                                                          m->tso_segsz);
> >               }
> > -     } else if (m->ol_flags &
> > -                (RTE_MBUF_F_TX_TCP_CKSUM | RTE_MBUF_F_TX_UDP_CKSUM | RTE_MBUF_F_TX_IP_CKSUM)) {
> > +     } else if ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) ==
> > +                     RTE_MBUF_F_TX_TCP_CKSUM ||
> > +                (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) ==
> > +                     RTE_MBUF_F_TX_UDP_CKSUM ||
> > +                (m->ol_flags & RTE_MBUF_F_TX_IP_CKSUM)) {
>
> As far as I can see following drivers also has similar issue, can
> maintainers (cc'ed) of below drivers check:
>
> bnxt
ACK

> dpaa
> hnic
> ionic
> liquidio
> mlx4
> mvneta
> mvpp2
> qede
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4218 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mails.dpdk.org/archives/stable/attachments/20220426/032522d6/attachment.bin>


More information about the stable mailing list