[dpdk-dev] [PATCH 2/5] vhost: do not inline packed and split functions

David Marchand david.marchand at redhat.com
Fri May 17 15:00:55 CEST 2019


On Fri, May 17, 2019 at 2:23 PM Maxime Coquelin <maxime.coquelin at redhat.com>
wrote:

> At runtime either packed Tx/Rx functions will always be called,
> or split Tx/Rx functions will always be called.
>
> This patch removes the forced inlining in order to reduce
> the I-cache pressure.
>

I just wonder if the compiler can't decide on its own to inline those
static functions.
We have __rte_noinline for this.


> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
>  lib/librte_vhost/virtio_net.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index a6a33a1013..35ae4992c2 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -771,7 +771,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct
> vhost_virtqueue *vq,
>         return error;
>  }
>
> -static __rte_always_inline uint32_t
> +static uint32_t
>  virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
>         struct rte_mbuf **pkts, uint32_t count)
>  {
> @@ -830,7 +830,7 @@ virtio_dev_rx_split(struct virtio_net *dev, struct
> vhost_virtqueue *vq,
>         return pkt_idx;
>  }
>
> -static __rte_always_inline uint32_t
> +static uint32_t
>  virtio_dev_rx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,
>         struct rte_mbuf **pkts, uint32_t count)
>  {
> @@ -1300,7 +1300,7 @@ get_zmbuf(struct vhost_virtqueue *vq)
>         return NULL;
>  }
>
> -static __rte_always_inline uint16_t
> +static uint16_t
>  virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
>         struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t
> count)
>  {
> @@ -1422,7 +1422,7 @@ virtio_dev_tx_split(struct virtio_net *dev, struct
> vhost_virtqueue *vq,
>         return i;
>  }
>
> -static __rte_always_inline uint16_t
> +static uint16_t
>  virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,
>         struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t
> count)
>  {
> --
> 2.21.0
>
>

-- 
David Marchand


More information about the dev mailing list