From patchwork Fri Mar 27 06:35:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ouyang Changchun X-Patchwork-Id: 4156 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 70BA45A62; Fri, 27 Mar 2015 07:36:03 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D1EE55A26 for ; Fri, 27 Mar 2015 07:36:00 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 26 Mar 2015 23:35:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,477,1422950400"; d="scan'208";a="473397259" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 26 Mar 2015 23:35:57 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t2R6Zt0r001451; Fri, 27 Mar 2015 14:35:55 +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 t2R6ZqhJ006706; Fri, 27 Mar 2015 14:35:54 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t2R6Zq90006702; Fri, 27 Mar 2015 14:35:52 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Fri, 27 Mar 2015 14:35:50 +0800 Message-Id: <1427438150-6673-1-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1426729537-24892-1-git-send-email-changchun.ouyang@intel.com> References: <1426729537-24892-1-git-send-email-changchun.ouyang@intel.com> Subject: [dpdk-dev] [PATCH v2] virtio: Fix crash issue for secondary process 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" It needs Rx function even in the case of secondary process, and it also needs check if it supports mergeable feature or not. Signed-off-by: Changchun Ouyang Acked-by: Huawei Xie --- Changes in v2: -- Check if it supports mergeable or not for the secondary process. lib/librte_pmd_virtio/virtio_ethdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c index 603be2d..0156b56 100644 --- a/lib/librte_pmd_virtio/virtio_ethdev.c +++ b/lib/librte_pmd_virtio/virtio_ethdev.c @@ -1115,8 +1115,13 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) eth_dev->dev_ops = &virtio_eth_dev_ops; eth_dev->tx_pkt_burst = &virtio_xmit_pkts; - if (rte_eal_process_type() == RTE_PROC_SECONDARY) + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) + eth_dev->rx_pkt_burst = &virtio_recv_mergeable_pkts; + else + eth_dev->rx_pkt_burst = &virtio_recv_pkts; return 0; + } /* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs = rte_zmalloc("virtio", ETHER_ADDR_LEN, 0);