From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 8DC7FA046B for ; Mon, 24 Jun 2019 16:32:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 42ABB1BEE6; Mon, 24 Jun 2019 16:32:10 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 2A1D21B9B8 for ; Mon, 24 Jun 2019 16:32:08 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5OEMa2m021613; Mon, 24 Jun 2019 07:32:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=TSjAXobFcj85MdSEOU2Lt1aGUQ8JlRI+3yD/EgNAp6A=; b=mjbnqbtgUDrvH9epKOb7vtwdycEjzf5GYmU9O4KDq+asTyD2IFwMgnBhhYLLIk9TLR5U O4/yER/HYHqEIUTHPZEyNCxuN6zET4lbwxRxOXc9ALA1Nmim4Ot50LUgSbeO0Rafwu7m UKLdJchnt7GfHPSxwc1To68GW9+yQ7QWDNfxoSzyro5BAAJRVtV3yCElOM9ZrwxHYcj0 2yhAsA86MN7aQvlfD6LsBfrzaKFEJcPfDaBCONKzkc3IBiOSPoaXJmP/KnnhYI/MpH34 T+SpjetzoTKC/uqyWL2gHaCcOIksg2YKOypVMmO1TF79oxmIJw2jawyVtxmLgKSJmLB1 aw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2t9kujf3kh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Jun 2019 07:32:06 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 24 Jun 2019 07:32:04 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 24 Jun 2019 07:32:04 -0700 Received: from kk-box-0.marvell.com (unknown [10.95.131.179]) by maili.marvell.com (Postfix) with ESMTP id 955513F703F; Mon, 24 Jun 2019 07:32:03 -0700 (PDT) From: To: , "John W. Linville" CC: Krzysztof Kanas Date: Mon, 24 Jun 2019 16:32:00 +0200 Message-ID: <20190624143200.10369-1-kkanas@marvell.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-24_09:, , signatures=0 Subject: [dpdk-dev] [PATCH] net/af_packet: set default blocksize to pagesize X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Krzysztof Kanas Kernel validates block size to be aligned to page size. Code works on platforms with page size 4k, but on others e.g. Arm64 fails with default parameters. Signed-off-by: Krzysztof Kanas --- drivers/net/af_packet/rte_eth_af_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 4a660d5f013f..ec3d2cbb5202 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -32,7 +32,6 @@ #define ETH_AF_PACKET_FRAMECOUNT_ARG "framecnt" #define ETH_AF_PACKET_QDISC_BYPASS_ARG "qdisc_bypass" -#define DFLT_BLOCK_SIZE (1 << 12) #define DFLT_FRAME_SIZE (1 << 11) #define DFLT_FRAME_COUNT (1 << 9) @@ -811,7 +810,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev, struct rte_kvargs_pair *pair = NULL; unsigned k_idx; unsigned int blockcount; - unsigned int blocksize = DFLT_BLOCK_SIZE; + unsigned int blocksize; unsigned int framesize = DFLT_FRAME_SIZE; unsigned int framecount = DFLT_FRAME_COUNT; unsigned int qpairs = 1; @@ -821,6 +820,7 @@ rte_eth_from_packet(struct rte_vdev_device *dev, if (*sockfd < 0) return -1; + blocksize = getpagesize(); /* * Walk arguments for configurable settings */ -- 2.21.0