From patchwork Wed Dec 3 16:56:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 1745 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 2D9F47FCB; Wed, 3 Dec 2014 19:50:09 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 344A87E75 for ; Wed, 3 Dec 2014 19:50:06 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 03 Dec 2014 09:36:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="493007365" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 03 Dec 2014 09:33:24 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id sB3Gv0x9015654; Wed, 3 Dec 2014 16:57:00 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id sB3Gv0Rx003061; Wed, 3 Dec 2014 16:57:00 GMT Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id sB3Gux9B003057; Wed, 3 Dec 2014 16:56:59 GMT From: Bruce Richardson To: dev@dpdk.org Date: Wed, 3 Dec 2014 16:56:59 +0000 Message-Id: <1417625819-3024-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] examples: fix symmetric_mp, set NIC rx_drop_en bit 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" The symmetric_mp example app is set up to allow two processes to share a NIC port, with each pulling packets from one queue. In order to have the app continue working when one of the process dies, the drop_en bit should be set in the NIC configuration. Without this bit set, the NIC will stall once any queue fills. With the bit set, once a queue fills, all subsequent packets for that queue are discarded allowing other queues to continue operating as normal. This setting was missed when converting to use standardised defaults in commit 81f7ecd9. Signed-off-by: Bruce Richardson --- examples/multi_process/symmetric_mp/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 01faae9..2fc2acf 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -229,6 +229,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues) } }; const uint16_t rx_rings = num_queues, tx_rings = num_queues; + struct rte_eth_dev_info info; int retval; uint16_t q; @@ -241,6 +242,9 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues) printf("# Initialising port %u... ", (unsigned)port); fflush(stdout); + rte_eth_dev_info_get(port, &info); + info.default_rxconf.rx_drop_en = 1; + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval < 0) return retval; @@ -248,7 +252,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues) for (q = 0; q < rx_rings; q ++) { retval = rte_eth_rx_queue_setup(port, q, RX_RING_SIZE, rte_eth_dev_socket_id(port), - NULL, + &info.default_rxconf, mbuf_pool); if (retval < 0) return retval;