DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harold Huang <baymaxhuang@gmail.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, Chenbo Xia <chenbo.xia@intel.com>
Subject: Re: [PATCH] net/virtio: include ipv4 cksum to support cksum offload capability
Date: Mon, 7 Feb 2022 10:54:00 +0800	[thread overview]
Message-ID: <CAHJXk3ae6Oy7CJYU7nQzS-Wgk1ByVNWj_C-L0SgB+68YvaAVkQ@mail.gmail.com> (raw)
In-Reply-To: <f6d438c8-5b7f-d58b-a371-142571d88b87@redhat.com>

Hi, Maxime,

Maxime Coquelin <maxime.coquelin@redhat.com> 于2022年1月31日周一 18:04写道:
>
> Hi Harold,
>
> On 1/7/22 12:53, Harold Huang wrote:
> > Device cksum offload capability usually include ipv4 cksum, tcp and udp
> > cksum offload capability. The application such as OVS usually negotiate
> > with the drive like this to enable cksum offload.
> >
> > Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
> > ---
> >   drivers/net/virtio/virtio_ethdev.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> > index c2588369b2..65b03bf0e4 100644
> > --- a/drivers/net/virtio/virtio_ethdev.c
> > +++ b/drivers/net/virtio/virtio_ethdev.c
> > @@ -3041,6 +3041,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> >               dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_SCATTER;
> >       if (host_features & (1ULL << VIRTIO_NET_F_GUEST_CSUM)) {
> >               dev_info->rx_offload_capa |=
> > +                     RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
> >                       RTE_ETH_RX_OFFLOAD_TCP_CKSUM |
> >                       RTE_ETH_RX_OFFLOAD_UDP_CKSUM;
> >       }
> > @@ -3055,6 +3056,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> >                                   RTE_ETH_TX_OFFLOAD_VLAN_INSERT;
> >       if (host_features & (1ULL << VIRTIO_NET_F_CSUM)) {
> >               dev_info->tx_offload_capa |=
> > +                     RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
> >                       RTE_ETH_TX_OFFLOAD_UDP_CKSUM |
> >                       RTE_ETH_TX_OFFLOAD_TCP_CKSUM;
> >       }
>
> I'm not sure to understand why this is needed, as Vhost lib will always
> ensure the IP csum has been calculated. Could you please elaborate?

Thanks for your comments. Previously I want to enable tx checksum
offload for the tap device when I use DPDK virtio-user driver with
OVS. OVS assume checksum offload capability includes tcp, udp and ipv4
checksum offload:
https://github.com/openvswitch/ovs/blob/master/lib/netdev-dpdk.c#L1097.
But  AFAIK,  ipv4 checksum has always been calculated in the kernel.
And according to the virito-spec
(https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html),
VIRTIO_NET_F_GUEST_CSUM feature bit may only indicate TCP or UDP
checksum offload, right? Maybe I need to change OVS to adapt to
virtio-user driver to enable checksum offload.

>
> Thanks,
> Maxime
>

Thanks,
Harold

  reply	other threads:[~2022-02-07  2:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 11:53 Harold Huang
2022-01-31 10:03 ` Maxime Coquelin
2022-02-07  2:54   ` Harold Huang [this message]
2022-02-15 20:08 ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHJXk3ae6Oy7CJYU7nQzS-Wgk1ByVNWj_C-L0SgB+68YvaAVkQ@mail.gmail.com \
    --to=baymaxhuang@gmail.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).