From patchwork Thu Feb 19 14:45:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 44841 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46F5D21572 for ; Thu, 19 Feb 2015 14:46:40 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id y19sf5309276wgg.1 for ; Thu, 19 Feb 2015 06:46:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=HUfQbVM8P/VZis1iQnVTOBsEOhJdNIV4vGiTP/P5MZs=; b=UeYkNNtPiflnM/Jjj6B6OdDhu+1U/3Wpwrxh6oE7q31M7GIKolXooOmuIZnbCCX6WF roS8J8F5FrwJvvn+XCwARvtblyMHqV1XI1GtmHgjn3YgcazAxVZoSNq/cqAaN6svSo+3 r5ijY/FRGe28nljvvQaUvplq9K4adX7F6XghWKVdIt9oX8PWcL8Z2hQ0EqqBAqsCW3Rw ORE/anhBsPfy/9Z1LuKAqmSna0y2ytcTt1D5Swa22AAxTbIdllCabNj9ZzcXL0cX3Odq Zb2YwZ+HKwt1qVSopypwSmSCximrtRifx5UEZvnAZIYAX+1r/L8p8uui6I6ImPSoGoY3 otYg== X-Gm-Message-State: ALoCoQna34VDn9yIU70/D34maS96oUvq3oj4+bu4nRA/bw4tbqCosuxv4SPfvsMX13B7xDiwjZfE X-Received: by 10.112.144.130 with SMTP id sm2mr647061lbb.9.1424357199551; Thu, 19 Feb 2015 06:46:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.39 with SMTP id kv7ls143789lac.76.gmail; Thu, 19 Feb 2015 06:46:39 -0800 (PST) X-Received: by 10.112.17.39 with SMTP id l7mr4209145lbd.114.1424357199279; Thu, 19 Feb 2015 06:46:39 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id n3si14900077lah.45.2015.02.19.06.46.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 06:46:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labhz20 with SMTP id hz20so11254lab.0 for ; Thu, 19 Feb 2015 06:46:39 -0800 (PST) X-Received: by 10.112.135.196 with SMTP id pu4mr4138860lbb.41.1424357199184; Thu, 19 Feb 2015 06:46:39 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp536812lbj; Thu, 19 Feb 2015 06:46:38 -0800 (PST) X-Received: by 10.140.232.6 with SMTP id d6mr12520281qhc.99.1424357197809; Thu, 19 Feb 2015 06:46:37 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id i204si16549232qhc.57.2015.02.19.06.46.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Feb 2015 06:46:37 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YOSN8-0006oO-Sd; Thu, 19 Feb 2015 14:46:34 +0000 Received: from mail-la0-f45.google.com ([209.85.215.45]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YOSMz-0006nb-EC for lng-odp@lists.linaro.org; Thu, 19 Feb 2015 14:46:25 +0000 Received: by labhs14 with SMTP id hs14so8101492lab.1 for ; Thu, 19 Feb 2015 06:46:19 -0800 (PST) X-Received: by 10.152.5.193 with SMTP id u1mr4192418lau.96.1424357179161; Thu, 19 Feb 2015 06:46:19 -0800 (PST) Received: from localhost.localdomain (ppp91-76-170-205.pppoe.mtu-net.ru. [91.76.170.205]) by mx.google.com with ESMTPSA id rm3sm4863822lbb.47.2015.02.19.06.46.17 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Feb 2015 06:46:18 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 19 Feb 2015 17:45:48 +0300 Message-Id: <1424357149-14761-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1424357149-14761-1-git-send-email-maxim.uvarov@linaro.org> References: <1424357149-14761-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [RFC/PATCH 1/2] linux-generic: mmap: jumbo frames support X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Support for jumbo frames for linux-generic with unsegmented buffers. https://bugs.linaro.org/show_bug.cgi?id=509 Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_packet_socket.c | 6 ++++-- test/validation/odp_pktio.c | 8 ++++++-- test/validation/odp_pktio_run | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 41e57c1..3e1451e 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -554,10 +554,12 @@ static inline unsigned pkt_mmap_v2_tx(int sock, struct ring *ring, ppd.v2->tp_h.tp_snaplen = pkt_len; ppd.v2->tp_h.tp_len = pkt_len; - odp_packet_copydata_out(pkt_table[i], 0, pkt_len, + ret = odp_packet_copydata_out(pkt_table[i], 0, pkt_len, (uint8_t *)ppd.raw + TPACKET2_HDRLEN - sizeof(struct sockaddr_ll)); + if (odp_unlikely(0 != ret)) + ODP_ABORT("unable to copy data"); mmap_tx_user_ready(ppd.raw); @@ -586,7 +588,7 @@ static inline unsigned pkt_mmap_v2_tx(int sock, struct ring *ring, static void mmap_fill_ring(struct ring *ring, unsigned blocks) { ring->req.tp_block_size = getpagesize() << 2; - ring->req.tp_frame_size = TPACKET_ALIGNMENT << 7; + ring->req.tp_frame_size = TPACKET_ALIGNMENT << 8; ring->req.tp_block_nr = blocks; ring->req.tp_frame_nr = ring->req.tp_block_size / diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 3f9de3c..d03f527 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -14,7 +14,7 @@ #include #define PKT_BUF_NUM 32 -#define PKT_BUF_SIZE 1856 +#define PKT_BUF_SIZE 9000 #define MAX_NUM_IFACES 2 #define TEST_SEQ_INVALID ((uint32_t)~0) #define TEST_SEQ_MAGIC 0x92749451 @@ -37,6 +37,8 @@ typedef struct { typedef struct { uint32be_t magic; uint32be_t seq; + char data[2500]; + uint32be_t magic2; } pkt_test_data_t; /** default packet pool */ @@ -66,6 +68,7 @@ static int pktio_pkt_set_seq(odp_packet_t pkt) pkt_test_data_t data; data.magic = TEST_SEQ_MAGIC; + data.magic2 = TEST_SEQ_MAGIC; data.seq = tstseq; l4_off = odp_packet_l4_offset(pkt); @@ -92,7 +95,8 @@ static uint32_t pktio_pkt_seq(odp_packet_t pkt) odp_packet_copydata_out(pkt, l4_off+ODPH_UDPHDR_LEN, sizeof(data), &data); - if (data.magic == TEST_SEQ_MAGIC) + if (data.magic == TEST_SEQ_MAGIC && + data.magic2 == TEST_SEQ_MAGIC) return data.seq; } diff --git a/test/validation/odp_pktio_run b/test/validation/odp_pktio_run index 08288e6..7b80719 100755 --- a/test/validation/odp_pktio_run +++ b/test/validation/odp_pktio_run @@ -56,8 +56,8 @@ setup_env1() echo "pktio: error: unable to create veth pair" exit $TEST_SKIPPED fi - ip link set $IF0 up - ip link set $IF1 up + ip link set $IF0 mtu 9000 up + ip link set $IF1 mtu 9000 up # network needs a little time to come up sleep 1