All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ouyang Changchun <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH v2] virtio: Fix crash issue for secondary process
Date: Fri, 27 Mar 2015 14:35:50 +0800	[thread overview]
Message-ID: <1427438150-6673-1-git-send-email-changchun.ouyang@intel.com> (raw)
In-Reply-To: <1426729537-24892-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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 <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---

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);
-- 
1.8.4.2

  parent reply	other threads:[~2015-03-27  6:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  1:45 [PATCH] virtio: Fix crash issue for secondary process Ouyang Changchun
     [not found] ` <1426729537-24892-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-20 21:58   ` Thomas Monjalon
2015-03-23 14:33     ` Xie, Huawei
2015-03-26  1:27       ` Xie, Huawei
2015-03-27  6:35   ` Ouyang Changchun [this message]
2015-03-27  7:37     ` [PATCH v2] " Xie, Huawei
     [not found]     ` <1427438150-6673-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-27  8:57       ` Thomas Monjalon
2015-03-27 13:23       ` [PATCH v3] " Ouyang Changchun
     [not found]         ` <1427462595-23701-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-30 20:09           ` Thomas Monjalon

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=1427438150-6673-1-git-send-email-changchun.ouyang@intel.com \
    --to=changchun.ouyang-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /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.