From patchwork Fri Feb 20 13:57:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 44861 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A343821554 for ; Fri, 20 Feb 2015 13:58:12 +0000 (UTC) Received: by eeke53 with SMTP id e53sf3169513eek.3 for ; Fri, 20 Feb 2015 05:58:11 -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: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=NPRZAGdyrZeEhVCUPsTHa+S/o49G0hIHpCtEDXsaZuE=; b=D4i0ipCMMoAOLEIFDNTRS26gx+zXsmdhbX60Z/y5reh5l40rCZWPvrL41JQG7jC+AZ PbMIDnYHPyWAWmToYI/wDgJjIcY2SXMY25xxf7o1rLuU1ANXUCdSZSyjDCQVe0dLNIMV dKcssCdNGU8pQgqxvVbbQcjlKpyS1kzT9A5zI4abyWjnWEUYIUApSKikKJWS7JUfFl5Q sD52Gaq2M1CDNXzJV+ns5WyocmB8n7JgJYHmYGfioeX83vG8G5ADxRsW16xTT6xyR7mg I3djk3/QgyNzRxe9miJhKE7cZXckCIrsAyXjne6O3NAa+B4VT7UHh00KD55/ZmOTbBdA KsDg== X-Gm-Message-State: ALoCoQnM30d64yefOnZFv1BkoL0yURnxjQ0uc75AyjBjykKlt0man6/jT57yMmbfaNWiSknl/yoy X-Received: by 10.112.181.198 with SMTP id dy6mr1325542lbc.22.1424440691929; Fri, 20 Feb 2015 05:58:11 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.195 with SMTP id 3ls239375lao.47.gmail; Fri, 20 Feb 2015 05:58:11 -0800 (PST) X-Received: by 10.152.29.198 with SMTP id m6mr8929583lah.102.1424440691773; Fri, 20 Feb 2015 05:58:11 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id zv6si6750803lbb.175.2015.02.20.05.58.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Feb 2015 05:58:11 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labhs14 with SMTP id hs14so6275048lab.1 for ; Fri, 20 Feb 2015 05:58:11 -0800 (PST) X-Received: by 10.112.118.211 with SMTP id ko19mr8283701lbb.19.1424440691623; Fri, 20 Feb 2015 05:58:11 -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 h5csp1173236lbj; Fri, 20 Feb 2015 05:58:10 -0800 (PST) X-Received: by 10.140.81.74 with SMTP id e68mr6740409qgd.41.1424440689492; Fri, 20 Feb 2015 05:58:09 -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 r9si28040012qcg.13.2015.02.20.05.58.07 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 20 Feb 2015 05:58:09 -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 1YOo5k-0005x4-Rb; Fri, 20 Feb 2015 13:58:04 +0000 Received: from mail-lb0-f170.google.com ([209.85.217.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YOo5f-0005wr-7o for lng-odp@lists.linaro.org; Fri, 20 Feb 2015 13:57:59 +0000 Received: by lbvp9 with SMTP id p9so6444327lbv.0 for ; Fri, 20 Feb 2015 05:57:53 -0800 (PST) X-Received: by 10.152.87.134 with SMTP id ay6mr8390040lab.75.1424440673256; Fri, 20 Feb 2015 05:57:53 -0800 (PST) Received: from localhost.localdomain (broadband-46-188-125-106.2com.net. [46.188.125.106]) by mx.google.com with ESMTPSA id uf3sm5507353lbc.44.2015.02.20.05.57.50 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Feb 2015 05:57:51 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Fri, 20 Feb 2015 16:57:45 +0300 Message-Id: <1424440666-30218-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [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.52 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. Test for pkio is also adjusted to work with 9*1024=9216 bytes packets. https://bugs.linaro.org/show_bug.cgi?id=509 Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_packet_socket.c | 2 +- test/validation/odp_pktio.c | 10 +++++++--- test/validation/odp_pktio_run | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 41e57c1..3f971c9 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -586,7 +586,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 = 9216 + TPACKET_HDRLEN; 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..21cc598 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 9216 #define MAX_NUM_IFACES 2 #define TEST_SEQ_INVALID ((uint32_t)~0) #define TEST_SEQ_MAGIC 0x92749451 @@ -34,9 +34,11 @@ typedef struct { } pktio_info_t; /** structure of test packet UDP payload */ -typedef struct { +typedef struct __attribute__((__packed__)) { uint32be_t magic; uint32be_t seq; + char data[9162]; /* total size of eth packet 9216 */ + 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..b9d7e3c 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 9216 up + ip link set $IF1 mtu 9216 up # network needs a little time to come up sleep 1