From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f65.google.com (mail-vk0-f65.google.com [209.85.213.65]) by dpdk.org (Postfix) with ESMTP id 791A937B4 for ; Mon, 28 Mar 2016 22:52:16 +0200 (CEST) Received: by mail-vk0-f65.google.com with SMTP id e6so16778429vkh.1 for ; Mon, 28 Mar 2016 13:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=9eQK7cLeeDz5HOh/6X58C7MUfM+avN7m1PP+cMSLJ50=; b=yuBHO5DbDHnYfuprxAtaHcZAZ94UrDS8FGhz0ibE3wAFNp1FU8dW49+N03b07ZrCIr 45+czvKcAqaKAK0/lrbMfpPzaKu9O4aG/9b8XBnUGtBPnpA+VgDCv9ylTfjjZLQULTEJ sMJBcHnHCCDPuJdBYF9CKX8XLGFhOzweTuExYJsm1bGh3ooqUdx3SavdEcmmjHW+hKAM 7UB2+7rQ0aXFPDr1FOxXNKROIm4w+N1sFgBEJAK6JQVMY2UK5tjFJbCM0EA8RGGsJa3P 9CmiEsFX+Blurfwm8V1cBUQo12WuMAmoJ49xXBkJf7ZM7Jkq+d0CQQNkz4hRcEzamFn+ zRiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9eQK7cLeeDz5HOh/6X58C7MUfM+avN7m1PP+cMSLJ50=; b=VVcz8RIuPUY7nHDR40KZqdDD5Q3K0h9BWoul4/vqHI2u2UnswyIgLD1btrPAFslPtZ U6bNMkf9iykXPUsABcknyM7qmW0RONlA4kL3afcuWno7Ofi129ZdQeCing/DLuyUQn+T 9+sgei7G7bAMXyB63k1hiyp20WBccViqj6+1aFRhLb4nTMjKLWlKLeeD++wzdjWxh7dm 8gqhfFhX7k84G+Qkx14gf5WFQY8o+16iQt9c7BInOgfXh46b1tnSiacySIRPe4+wUnYE aCIFAZc4baKbXnoFtrN3p+UUe8vEbpSWiT5TFLbgSrSw8xAewTesP3YS1MYFs6UknJV/ vECA== X-Gm-Message-State: AD7BkJKyjrwHv5sdOZWjo6781XYO7I5QvCBzel8dxr6tZZZG2h/6aD6jA1223vG/cetkrg== X-Received: by 10.159.35.44 with SMTP id 41mr16421224uae.21.1459198336070; Mon, 28 Mar 2016 13:52:16 -0700 (PDT) Received: from localhost.localdomain ([23.79.237.14]) by smtp.gmail.com with ESMTPSA id v19sm4301389vkd.22.2016.03.28.13.52.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Mar 2016 13:52:15 -0700 (PDT) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org, cristian.dumitrescu@intel.com Date: Mon, 28 Mar 2016 16:51:34 -0400 Message-Id: <1459198297-49854-2-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1459198297-49854-1-git-send-email-rsanford@akamai.com> References: <1459198297-49854-1-git-send-email-rsanford@akamai.com> Subject: [dpdk-dev] [PATCH 1/4] app/test: enhance test_port_ring_writer 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: Mon, 28 Mar 2016 20:52:16 -0000 Add code to send two 60-packet bursts to a ring port_out. This tests a ring writer buffer overflow problem and fix (in patch 2/4). Signed-off-by: Robert Sanford --- app/test/test_table_ports.c | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/test/test_table_ports.c b/app/test/test_table_ports.c index 2532367..0c0ec0a 100644 --- a/app/test/test_table_ports.c +++ b/app/test/test_table_ports.c @@ -149,8 +149,8 @@ test_port_ring_writer(void) /* -- Traffic TX -- */ int expected_pkts, received_pkts; - struct rte_mbuf *mbuf[RTE_PORT_IN_BURST_SIZE_MAX]; - struct rte_mbuf *res_mbuf[RTE_PORT_IN_BURST_SIZE_MAX]; + struct rte_mbuf *mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; + struct rte_mbuf *res_mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; port_ring_writer_params.ring = RING_TX; port_ring_writer_params.tx_burst_sz = RTE_PORT_IN_BURST_SIZE_MAX; @@ -216,5 +216,28 @@ test_port_ring_writer(void) for (i = 0; i < RTE_PORT_IN_BURST_SIZE_MAX; i++) rte_pktmbuf_free(res_mbuf[i]); + /* TX Bulk - send two 60-packet bursts */ + uint64_t pkt_mask = 0xfffffffffffffff0ULL; + + for (i = 0; i < 4; i++) + mbuf[i] = NULL; + for (i = 4; i < 64; i++) + mbuf[i] = rte_pktmbuf_alloc(pool); + rte_port_ring_writer_ops.f_tx_bulk(port, mbuf, pkt_mask); + for (i = 4; i < 64; i++) + mbuf[i] = rte_pktmbuf_alloc(pool); + rte_port_ring_writer_ops.f_tx_bulk(port, mbuf, pkt_mask); + rte_port_ring_writer_ops.f_flush(port); + + expected_pkts = 2 * 60; + received_pkts = rte_ring_sc_dequeue_burst(port_ring_writer_params.ring, + (void **)res_mbuf, 2 * RTE_PORT_IN_BURST_SIZE_MAX); + + if (received_pkts != expected_pkts) + return -10; + + for (i = 0; i < received_pkts; i++) + rte_pktmbuf_free(res_mbuf[i]); + return 0; } -- 1.7.1