Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1939555imm; Thu, 2 Aug 2018 03:44:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc/h09YTqViAfGexnJmurFGI4kvWY31j0y5Hn701l1leG0ls+38M2WhT3h0yB4kM6R/NTsU X-Received: by 2002:a65:6110:: with SMTP id z16-v6mr2263179pgu.412.1533206668221; Thu, 02 Aug 2018 03:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533206668; cv=none; d=google.com; s=arc-20160816; b=FBwXpExBBp0/47g5YjW5pyuPgB0hwPIlSuFvn7FQWLq+anLewPeIvnL59CtRJu4FZW TLqiMhyTeaxGBzkgyn6W7N4IF57IBvJFEbzQ/4VREr4V6KJ+Fl5os5KgRbMFN5bmtLWt /1s30W6Fs92csBgN4KOFdPvw3BiYgyQ67E2EBwrfDMX843ESRCPkuCPzIpUMBu+RqPT5 MhP+z4fFi7lP4Je6/5Oxtsl0S0ENFI6lHMXiCl+GbDY3ZQeaUpitT2e1Fo/O/cRvuG0P UUdJCak4TZSnXa3Ie3sJ8ph85TPUgmCVGIUPcShcnFxWnUL3P9nE6h4+ETkHI78Xm4hL tC5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=Id4jwfz0q9isMi9biP7BRMmBaBZoQPc4/jgv8eLGMSk=; b=t4M12h/A/nQmLYtudOzBMdLEothGv3N7/YLj2H6WhWTkWp0+MbRW3Aiwf6P2vdxHwx KhAXlWR2o+raUtJr0VUF7gkWmKNj+rIsKZdFQy/839/F8lD+o87AiuEGhggvgIPBxtGk Ku0D93L+woYitnr5nLei0Dt0du8nENU65VsqWHU57p8ZRT0au352jmWzcaJGoWbSHIcE OkZhyuBNtD/R5A0EqXuYSGWOyeAfKhu+H5TvP3WMv8ExeZ0/Qypcut+3bNs+YYcXms3p Jfadk9LGPFhhha74FbG2NjRxMHgGiaD+zg/i7hYyQ+iHBJv5OzyD7VFJta1aDJ9Sj640 /KuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kg21ZREk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n68-v6si1720913pga.662.2018.08.02.03.44.13; Thu, 02 Aug 2018 03:44:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kg21ZREk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732110AbeHBMdB (ORCPT + 99 others); Thu, 2 Aug 2018 08:33:01 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:55377 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731938AbeHBMdA (ORCPT ); Thu, 2 Aug 2018 08:33:00 -0400 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20180802104223epoutp022d6dd129a3007c23cf64f98175ce0b35~HCzpty1ox2739427394epoutp02H for ; Thu, 2 Aug 2018 10:42:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180802104223epoutp022d6dd129a3007c23cf64f98175ce0b35~HCzpty1ox2739427394epoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1533206543; bh=Id4jwfz0q9isMi9biP7BRMmBaBZoQPc4/jgv8eLGMSk=; h=From:To:Cc:Subject:Date:References:From; b=kg21ZREkuEQgvcoUdm1wCp+fJ5PXi3HjwAtXes6nZlzlBF1R42CZhVhWLAKwptVq8 Qat+LnfqviwUnGoVt5O0ISLMP3kVRl3lOgg/NxxOO/Y7gJ5+bBlVd4XAk7r7EL9Tfc GP/USTMg3s8Q1ZfA2xY878jksnQu8ULH/Ms/sbs4= Received: from epsmges5p3new.samsung.com (unknown [182.195.40.194]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20180802104223epcas5p1e8b115131b504228e67f9c2502ffbdfc~HCzpO6sXm2544725447epcas5p1x; Thu, 2 Aug 2018 10:42:23 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id B6.C0.04304.F00E26B5; Thu, 2 Aug 2018 19:42:23 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20180802103616epcas5p48ec1e2ea3568b11683aa7b55254dffb0~HCuTv0d7l2131721317epcas5p4u; Thu, 2 Aug 2018 10:36:16 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180802103616epsmtrp12b664f70b8e33259f1d83c5321d8ca72~HCuTuWgDJ3158831588epsmtrp1W; Thu, 2 Aug 2018 10:36:16 +0000 (GMT) X-AuditID: b6c32a4b-221ff700000010d0-50-5b62e00f1fa6 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 31.BB.03759.0AED26B5; Thu, 2 Aug 2018 19:36:16 +0900 (KST) Received: from localhost.localdomain (unknown [107.108.92.210]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180802103614epsmtip21aeee95e8a78119d4071356c6daf4bfb~HCuR6Btw80115701157epsmtip2U; Thu, 2 Aug 2018 10:36:14 +0000 (GMT) From: Maninder Singh To: davem@davemloft.net, shuahkh@osg.samsung.com Cc: netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com, pankaj.m@samsung.com, a.sahrawat@samsung.com, Maninder Singh , Vaneet Narang Subject: [PATCH 1/1] selftest/net: fix FILE_SIZE for 32 bit architecture. Date: Thu, 2 Aug 2018 16:01:36 +0530 X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJKsWRmVeSWpSXmKPExsWy7bCmhi7/g6Rog6XPuCwu7k61mHO+hcXi 6bFH7Babv3ewWVzeNYfN4vD8NhaLYwvELO692cpkMfXLBxaLQyfnMjpweWxZeZPJY8GmUo8t /XfZPfq2rGL0+LxJLoA1KtUmIzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLCXEkhLzE3 1VbJxSdA1y0zB+gkJYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUrShoZGeoYG5npERkDaN tTIyBSpJSM1Ycv05e8F6noptEz4wNTC+5+xi5OSQEDCROHjnLVsXIxeHkMBuRomDKyazQDif GCXeNixlhHC+MUr8Xr6WEably/oPrBCJvYwSu58/har6wijR/LIRrIpNQE9i1a49LCC2iICB xL2Vc5hBipgF3jBKPD+/jwkkISzgKbH15n+g7RwcLAKqEp8fl0BskJM4eWwy2AYJgSlsEm1P m8DqeQXKJHZNO8sCUeQi0XZ3NhOELSzx6vgWdghbSuJlfxs7RHM7o8T1mddYoCYxSnS+XwlV ZS/x4MZRdpDNzAKaEut36UOEZSWmnloHNpRZgE+i9/cTqAW8EjvmwdiqEi03N7BC2NISnz9+ hDrIQ2L9rW9gNUICsRKr3l1nnsAoOwthwwJGxlWMkqkFxbnpqc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ku/ZIeZ2etIRqZiqkgq+vqxe/frjNWZmF9Yd3uTLocRSnJFoqMVc VJwIALxeisopAgAA Message-Id: <20180802103616epcas5p48ec1e2ea3568b11683aa7b55254dffb0~HCuTv0d7l2131721317epcas5p4u@epcas5p4.samsung.com> X-CMS-MailID: 20180802103616epcas5p48ec1e2ea3568b11683aa7b55254dffb0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180802103616epcas5p48ec1e2ea3568b11683aa7b55254dffb0 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org FILE_SZ is defined as (1UL << 35), it will overflow for 32 bit system and logic will break. Signed-off-by: Maninder Singh Signed-off-by: Vaneet Narang --- tools/testing/selftests/net/tcp_mmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c index e8c5dff..1d6ca12 100644 --- a/tools/testing/selftests/net/tcp_mmap.c +++ b/tools/testing/selftests/net/tcp_mmap.c @@ -85,7 +85,7 @@ #define MSG_ZEROCOPY 0x4000000 #endif -#define FILE_SZ (1UL << 35) +#define FILE_SZ (1ULL << 35) static int cfg_family = AF_INET6; static socklen_t cfg_alen = sizeof(struct sockaddr_in6); static int cfg_port = 8787; @@ -134,7 +134,7 @@ void hash_zone(void *zone, unsigned int length) void *child_thread(void *arg) { - unsigned long total_mmap = 0, total = 0; + unsigned long long total_mmap = 0, total = 0; struct tcp_zerocopy_receive zc; unsigned long delta_usec; int flags = MAP_SHARED; @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) { struct sockaddr_storage listenaddr, addr; unsigned int max_pacing_rate = 0; - unsigned long total = 0; + unsigned long long total = 0; char *host = NULL; int fd, c, on = 1; char *buffer; @@ -431,7 +431,7 @@ int main(int argc, char *argv[]) zflg = 0; } while (total < FILE_SZ) { - long wr = FILE_SZ - total; + unsigned long long wr = FILE_SZ - total; if (wr > chunk_size) wr = chunk_size; -- 1.9.1