From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2] net/virtio: cache Rx/Tx offload ability check
Date: Wed, 9 Nov 2016 13:24:10 +0800 [thread overview]
Message-ID: <20161109052410.GK12283@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <06d3ff0d-d145-597b-09af-c86c93d5cbfd@6wind.com>
On Tue, Nov 08, 2016 at 09:43:14AM +0100, Olivier Matz wrote:
> Hi Yuanhan,
>
> On 11/04/2016 03:29 PM, Yuanhan Liu wrote:
> > It's not a good idea to do the check of whether Rx/Tx offload is
> > enabled at the data path. Instead, we could do the check at init
> > stage and store the result, so that we could avoid the check again
> > and again at the critical datapath.
> >
> > Cc: Olivier Matz <olivier.matz@6wind.com>
> > Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> > ---
> > v2: - rebase on top of the bug fix patches
> > - define rx/tx_offload as uint8_t instead of int
> >
> > drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++++++
> > drivers/net/virtio/virtio_pci.h | 2 ++
> > drivers/net/virtio/virtio_rxtx.c | 31 +++++--------------------------
> > 3 files changed, 26 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> > index 1505f67..2adae58 100644
> > --- a/drivers/net/virtio/virtio_ethdev.c
> > +++ b/drivers/net/virtio/virtio_ethdev.c
> > @@ -1188,6 +1188,22 @@ rx_func_get(struct rte_eth_dev *eth_dev)
> > eth_dev->rx_pkt_burst = &virtio_recv_pkts;
> > }
> >
> > +static inline int
> > +rx_offload_enabled(struct virtio_hw *hw)
> > +{
> > + return vtpci_with_feature(hw, VIRTIO_NET_F_GUEST_CSUM) ||
> > + vtpci_with_feature(hw, VIRTIO_NET_F_GUEST_TSO4) ||
> > + vtpci_with_feature(hw, VIRTIO_NET_F_GUEST_TSO6);
> > +}
> > +
> > +static inline int
> > +tx_offload_enabled(struct virtio_hw *hw)
> > +{
> > + return vtpci_with_feature(hw, VIRTIO_NET_F_CSUM) ||
> > + vtpci_with_feature(hw, VIRTIO_NET_F_HOST_TSO4) ||
> > + vtpci_with_feature(hw, VIRTIO_NET_F_HOST_TSO6);
> > +}
>
> Do we need these functions to be inlined?
Nope, it was done simply by copy & paste. I could remove them in future
version.
> It looks better to do like this, but out of curiosity, do you see a
> performance improvement?
I didn't bother to have a try: I'd assume it brings no (at least
no obvious) improvements.
--yliu
prev parent reply other threads:[~2016-11-09 5:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 9:28 [PATCH] net/virtio: cache Rx/Tx offload enabled check Yuanhan Liu
2016-11-04 14:29 ` [PATCH v2] net/virtio: cache Rx/Tx offload ability check Yuanhan Liu
2016-11-08 8:43 ` Olivier Matz
2016-11-09 5:24 ` Yuanhan Liu [this message]
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=20161109052410.GK12283@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.