From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB342A0471 for ; Tue, 13 Aug 2019 05:31:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8FCDC1BE86; Tue, 13 Aug 2019 05:31:45 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 4F6AD1B952; Tue, 13 Aug 2019 05:31:43 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7D3Tue4014359; Mon, 12 Aug 2019 20:31:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=ZsiAE83ij0i2ULk6W46vwieTOettkdecUimFQY7o+ZM=; b=mvDC5HnBi9O3FIMk7pshLeDnEtMnMFw602s8JrUg69HgnmuHVJAk5Se/Zy17BusHVNTs amS5rbx54kbFvnNXTUZgEIOGR95zGIQLHE7VJfR7XbnfaWBVnwXlX+eom4l+iMA1QYUz NwN5J3FiBczuXS+RJ8K+4b/I43T1Yz4Ye/i7zvDk3/q3At/CU03zwnaek+EDIDOxVrEB VjgoN8Q52WSHwNmyeQVy6a/2NTaN5skkxvnhi/5enYoQgAThRr5oLhYNS8c2PlytZdOw ekumj7qqOGfmQcwv5jIMP0WBx4TRK8lNxottdRqzlkq4Grf4Jcl0ghxSsVDjFQjWyV3d Zg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2ubfacs4sw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 12 Aug 2019 20:31:42 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 12 Aug 2019 20:31:41 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.53) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 12 Aug 2019 20:31:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wb23iBBikCcXQjwrmbGgZ2KBl5g5ILNyTUZVf9zxtF9Ux/Il7jYeJuYsSNF/IhlNo+zIVkWgJvucEQXpeIR1NvW4Spj0P2RCs3apxVRi47cpl8BRaljcNZ9jGoveXH4YNrv0nftXadFaPUJxEVTrC4MFiJh+ibo2616SfdoqJc1DusFQfdDg4J4/QkcUWBhxhq7LMvgPviaXSbg9NEkMs/984nZzCl5ixnvU1uCGi/znC4zifdOu6qrWNREDJkB2vSz7PTLCclDbhAElNEbDDG/43MDeYK6/sWj/LiY/HHIP8p2fDQwVQtbwqSJ+NH9S66qewGV0MP7JjbmCqUe1IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZsiAE83ij0i2ULk6W46vwieTOettkdecUimFQY7o+ZM=; b=cIgg08fgAML3xycRO1JZ4zU5IXDpxVRv4YsXid972yyoKGi28SHsXvQHdtga2jMDM02SRgzN00GWvxye34FZqQpqxXcymjNqWnIYcdT++v7oYjN5r/0/3sASswp3RpFEDctV8CWFREZU/UhyAYDmT50EyvA57ppT3N39WsCzlB4JXxWTFrIH5GZUAIjUnfUW45dEOX8GnVsaSlZ+vYia74y6oTbS7hSEDri18BCa7oUIgG5cVn6HWHfbMztnyLwiWHXgjecqNEtvRRZHofHF7crEGCRWeGH0IibiJbQmjQkC6FQ3QfafNBczqw8EzWWiHMsByOucxzun69qYE60GaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZsiAE83ij0i2ULk6W46vwieTOettkdecUimFQY7o+ZM=; b=PsgTb5prdb0bpFqQNfcw5ov0vrdFOhWz1014djNCwPw/KK0v4DDuxmEHa+lLna4kt+2H/VL7G7ZrHxMG7pkWgqfVXP1Kt+eQXaVQ0zvm6/RvEhdUN1eELhSfDMb/62/d4Psm6J5YxSjIfEp4Ooixd+GsTYHwPZvEZ9e3uWF57lg= Received: from DM6PR18MB2425.namprd18.prod.outlook.com (20.179.104.19) by DM6PR18MB2956.namprd18.prod.outlook.com (20.179.50.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.20; Tue, 13 Aug 2019 03:31:40 +0000 Received: from DM6PR18MB2425.namprd18.prod.outlook.com ([fe80::68a1:7319:7e57:ff68]) by DM6PR18MB2425.namprd18.prod.outlook.com ([fe80::68a1:7319:7e57:ff68%6]) with mapi id 15.20.2157.022; Tue, 13 Aug 2019 03:31:40 +0000 From: Jerin Jacob Kollanukkaran To: "Ananyev, Konstantin" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] bpf: fix to allow ptr stack program type Thread-Index: AQHVTs+nMWveRMsge0ityptSWsh8rqb3OBoAgAAa2tCAABQpgIABCIGQ Date: Tue, 13 Aug 2019 03:31:39 +0000 Message-ID: References: <20190809162919.5967-1-jerinj@marvell.com> <2601191342CEEE43887BDE71AB977258018115CEAE@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258018115D7C8@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258018115D7C8@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [171.61.87.186] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 144cb0d3-6f06-4eb5-6c1b-08d71f9ec11d x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:DM6PR18MB2956; x-ms-traffictypediagnostic: DM6PR18MB2956: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 01283822F8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(136003)(396003)(39860400002)(366004)(13464003)(189003)(199004)(26005)(7696005)(71200400001)(9686003)(102836004)(76176011)(52536014)(478600001)(5660300002)(53936002)(53546011)(6506007)(99286004)(316002)(71190400001)(2501003)(25786009)(4326008)(6246003)(14454004)(54906003)(81156014)(81166006)(74316002)(486006)(11346002)(55016002)(6436002)(110136005)(3846002)(14444005)(2906002)(6116002)(229853002)(8936002)(476003)(66066001)(446003)(7736002)(186003)(66476007)(76116006)(66556008)(305945005)(66446008)(64756008)(33656002)(66946007)(86362001)(8676002)(256004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR18MB2956; H:DM6PR18MB2425.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: /TcstRbeqcnLPaZkKm7c+bl155WtPDy24YhNBgOIPXZcnQMWL89GQApjxDvOAmYHvJYLX6klHB+sM2LfBOXj4Xzhc0Sju4nAQcQ051DqIN4j+SWMWFmywtdQvmmIL9oQUY1/1WddGeAF3A1NslngEvilBiIznIFwLABsNQN7pRjsowBEVgZa+E+I8YXk5reDMzb7z19oq5kP4hBW7oi9wVPmHfQBbPMyla909VxRgMeLN5EK09tUu9qkR5UZ4ZXq50EvyDX7wsgl4x0LXOcd6LwicwANJutRFTRNmlSD65A5tFYST3inAj7nsqSZ87uSuHlOJIqP7dAqBk+BqpcMcMbkLouhTZxImF1hKb7qEZ9ITvIZKpILzxudwEmQsBdnSmKcDjGMQc9oKc2egFAE90Qjim97Av+Gq61svZwNhF0= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 144cb0d3-6f06-4eb5-6c1b-08d71f9ec11d X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Aug 2019 03:31:39.9760 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KEKcJdv8lWayv53qZoajgrXIRcF9vJ3CjUgyFAWt7Ez6k46SHxJJd0ohJJg9dSafpOdpl26ug4hsf5iLi5A0cA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB2956 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-13_01:2019-08-09,2019-08-13 signatures=0 Subject: Re: [dpdk-dev] [PATCH] bpf: fix to allow ptr stack program type 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" > -----Original Message----- > From: Ananyev, Konstantin > Sent: Monday, August 12, 2019 5:08 PM > To: Jerin Jacob Kollanukkaran ; dev@dpdk.org > Cc: thomas@monjalon.net; stable@dpdk.org > Subject: [EXT] RE: [dpdk-dev] [PATCH] bpf: fix to allow ptr stack program > type >=20 > External Email >=20 > ---------------------------------------------------------------------- >=20 > > > Hi Jerin, > > > > Hi Konstantin, > > > > > > > > > > > > > bpf_validate does not allow to execute RTE_BPF_ARG_PTR_STACK for > > > > no reason. > > > > > > I believe there is a reason, > > > ARG_PTR_STACK is reserved for memory within BPF program internal > > > stack only. > > > User that calls BPF program should never pass parameter with that typ= e. > > > > OK. > > Shouldn't we remove that from public header file > > (lib/librte_bpf/rte_bpf.h) then ? >=20 > Probably... or might be just put extra comments to mark it as internal? > The reason I left it here, so we can add new public values for enum here, > before RTE_BPF_ARG_PTR_STACK. > Of course in theory we can use for RTE_BPF_ARG_PTR_STACK some > reserved value instead. >=20 > > > > > If the user allocates parameter for bpf function on the stack, he > > > can still use RTE_BPF_ARG_PTR for it. > > > > I see the _stack_ is only allocated under RTE_BPF_ARG_PTR_STACK checks > in bpf_validate.c. > > Can you check? I agree that stack should be allocated for > RTE_BPF_ARG_PTR as well. >=20 > Not sure I understand your query here... > Each BPF program can use up to MAX_BPF_STACK_SIZE bytes for stack. > Though to avoid JIT to allocate unused space for the stack, in bpf_valida= te.c > we figure out does given BPF program really allocate things on the stack = and > if yes, how many bytes is needed. > This info is stored in rte_bpf.stack_sz and can be used later by the JIT. > Let say for x86 jit is used in emit_prolog(). I thought, stack will be allocated only when user gives RTE_BPF_ARG_PTR_STACK. I tested following program with RTE_BPF_ARG_PTR. It allocates stacks Properly. So everything is good. stdw [r10-64], 0xab mov r0, 0 exit I will modify this patch to following to avoid any confusion to user: 1) Change RTE_BPF_ARG_PTR_STACK to RTE_BPF_ARG_RESERVED in public header fi= le 2) In the implementation #define RTE_BPF_ARG_RESERVED BPF_ARG_PTR_STACK Is it OK?