From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [RFC PATCH] virtio: virtio ring layout optimization and vectorization rx Date: Tue, 22 Sep 2015 10:37:18 +0200 Message-ID: <4527609.XBoLQSHpyv@xps13> References: <1442506651-16279-1-git-send-email-huawei.xie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Huawei Xie Return-path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id D03909E5 for ; Tue, 22 Sep 2015 10:38:24 +0200 (CEST) Received: by wicfx3 with SMTP id fx3so12555492wic.0 for ; Tue, 22 Sep 2015 01:38:24 -0700 (PDT) In-Reply-To: <1442506651-16279-1-git-send-email-huawei.xie@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-09-18 00:17, Huawei Xie: > --- a/config/common_linuxapp > +++ b/config/common_linuxapp > @@ -241,6 +241,7 @@ CONFIG_RTE_LIBRTE_ENIC_DEBUG=n > # Compile burst-oriented VIRTIO PMD driver > # > CONFIG_RTE_LIBRTE_VIRTIO_PMD=y > +CONFIG_RTE_VIRTIO_SIMPLE=y > CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_INIT=n > CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n > CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n -1 > @@ -1150,6 +1158,14 @@ rx_func_get(struct rte_eth_dev *eth_dev) > eth_dev->rx_pkt_burst = &virtio_recv_mergeable_pkts; > else > eth_dev->rx_pkt_burst = &virtio_recv_pkts; > + > +#ifdef RTE_VIRTIO_SIMPLE > + if (!vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) { > + printf("use simple rxtx\n"); > + eth_dev->rx_pkt_burst = &virtio_recv_pkts_simple; > + eth_dev->tx_pkt_burst = &virtio_xmit_pkts_simple; > + } > +#endif I thought it was clear we must avoid #ifdef for configuration. Please check how to add a runtime flag. Or better: keep only one path which works everywhere and well optimized.