From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id ABF8D8E9E for ; Tue, 20 Oct 2015 17:31:25 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 20 Oct 2015 08:30:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,707,1437462000"; d="scan'208";a="830958889" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 20 Oct 2015 08:30:54 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t9KFUqAS004639; Tue, 20 Oct 2015 23:30:52 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t9KFUngu004696; Tue, 20 Oct 2015 23:30:51 +0800 Received: (from hxie5@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9KFUnnc004692; Tue, 20 Oct 2015 23:30:49 +0800 From: Huawei Xie To: dev@dpdk.org Date: Tue, 20 Oct 2015 23:30:07 +0800 Message-Id: <1445355007-4613-8-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1445355007-4613-1-git-send-email-huawei.xie@intel.com> References: <1443537953-23917-1-git-send-email-huawei.xie@intel.com> <1445355007-4613-1-git-send-email-huawei.xie@intel.com> Subject: [dpdk-dev] [PATCH v3 7/7] virtio: pick simple rx/tx func X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2015 15:31:26 -0000 simple rx/tx func is enabled when user specifies single segment and no offload support. merge-able should be disabled to use simple rxtx. Signed-off-by: Huawei Xie --- drivers/net/virtio/virtio_rxtx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 947fc46..71f8cd4 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -62,6 +62,10 @@ #define VIRTIO_DUMP_PACKET(m, len) do { } while (0) #endif + +#define VIRTIO_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \ + ETH_TXQ_FLAGS_NOOFFLOADS) + static int use_simple_rxtx; static void @@ -471,6 +475,14 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev, return -EINVAL; } + /* Use simple rx/tx func if single segment and no offloads */ + if ((tx_conf->txq_flags & VIRTIO_SIMPLE_FLAGS) == VIRTIO_SIMPLE_FLAGS) { + PMD_INIT_LOG(INFO, "Using simple rx/tx path"); + dev->tx_pkt_burst = virtio_xmit_pkts_simple; + dev->rx_pkt_burst = virtio_recv_pkts_vec; + use_simple_rxtx = 1; + } + ret = virtio_dev_queue_setup(dev, VTNET_TQ, queue_idx, vtpci_queue_idx, nb_desc, socket_id, &vq); if (ret < 0) { -- 1.8.1.4