From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CDF44383C; Fri, 5 Jan 2024 15:44:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED15C402E6; Fri, 5 Jan 2024 15:44:50 +0100 (CET) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by mails.dpdk.org (Postfix) with ESMTP id A952F402E4 for ; Fri, 5 Jan 2024 15:44:48 +0100 (CET) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 405EiVKx001882; Fri, 5 Jan 2024 14:44:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=TCvuusXWKwD6XzgzPQaLPvqwuEakPHUv0hv6rey7Ldc=; b=jYyyFkN788v6MnRQS+A5APG9yR0PPSqnvIbLLYs4jwdvQ6ci2PeHAiW/8ptGh5t1jDGN Cwh53+pijfVRnDrf2+FMOaJrjlh6qBwnQPsFnnjxy5xOBcBzbF+t1twS+ohrtzpkuPU7 QD3z2F5J00RBmcF1rCuWFqIN2Laim/iJeR+iC9re59G79andRFftqcgC2yPtnkdXHxTu G3iUqJaXpGqjxnjl7nnHiCJZE+7YM7awJby8F29+YrxvlZwdMe1+AWPnokXJflN5ZOYw 214894EBqi3XNifd7mmUUAeaG/8oMcvlhjQsaSkz/yxgh/IfMAGO3ThZ9js2Khc3WASP Fw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3vekqwg0hg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 Jan 2024 14:44:38 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 405ENETR010719; Fri, 5 Jan 2024 14:44:02 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ve175qa5p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 Jan 2024 14:44:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzrMiAjSNu2TbVEaB61LqdodheDYpqBn31jEuFzx959Sx0DUG3E7j5bdjdq4j58onN8xa4mGLjVRJfD5ngEy0TwWKeUXUs4poQZh7FjqfTS2URDU3d4gGKe0auSV24RjgEoMWpp7bqrpus842F0SmoGI6QWw6fDnrUoFkN3jdcy7embfWjph5ebzEAbUwr7K8i46UMPOB7hyRtiURRfMh5Ev+dQ1voqbaUEgqQFphz0MqWAStq7RFqV3gw90GiEuq7gjBWH3tU0F6JqZo+H1cIkD+Zn2UmydtOf7oviQ1dL0M/FZq+1gilEcTUGLZfyVhZxqMK4X0L+P8xC9Z+EwIg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TCvuusXWKwD6XzgzPQaLPvqwuEakPHUv0hv6rey7Ldc=; b=gwOgLetJmTuT9dGOmK3WxCZUr0o7ZPlhZ2agcqhXCs1NAPcqHykKIoiCo26TE1vrEvTBpIJb5MwMAj+T5+DE0sUury8atq48CIlVG9+84rbpbbmDuI68rouWaEEHLIIjVr7fmh7plIOedMHwU+S8OgAX9dQCLYEhgJatYsHsOt/ZqCJFf3FFbkaSXSKw6+8qcRyTdFn9SK5zdezl8WyObN0cqp5nbLdyAblUjXU1fKqCwHIchEF44diYSGMpE3rmnchaS4hUxNhe6fp2uLmJ2BJYenfMaRVN9lTsOBB1brmt0YoJx9qYq3Ky+52pYX55D/CMgw2a3BGfhI6aTJNRzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TCvuusXWKwD6XzgzPQaLPvqwuEakPHUv0hv6rey7Ldc=; b=iqgKZcUlVo9xwlEEpuP+UfM0yihETcGwGc3kyE4YxzCIroERiehvNEfCiiJfbE9oUHCavuvovhKGOZA1BOGzdsHXu9WugZbAtfIsK4PVMCefNZjFRhpz0axpc6MUKHG5S07p0RJTSPdryPj1M5UHXvYY5kv3jk2wQKAIGA6Tyq8= Received: from SJ0PR10MB4798.namprd10.prod.outlook.com (2603:10b6:a03:2df::8) by IA0PR10MB7253.namprd10.prod.outlook.com (2603:10b6:208:3de::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 14:44:01 +0000 Received: from SJ0PR10MB4798.namprd10.prod.outlook.com ([fe80::bfe7:9456:17cb:cb09]) by SJ0PR10MB4798.namprd10.prod.outlook.com ([fe80::bfe7:9456:17cb:cb09%7]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 14:44:00 +0000 From: Madhuker Mythri To: Stephen Hemminger CC: "ferruh.yigit@amd.com" , "dev@dpdk.org" Subject: RE: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the new Kernel-version upgrade requirements. Thread-Topic: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the new Kernel-version upgrade requirements. Thread-Index: AQHaPzO4tzDzcCULFEKTKYP0ti3cpbDKIr2AgAEnpNA= Date: Fri, 5 Jan 2024 14:44:00 +0000 Message-ID: References: <20240104172756.2213-1-madhuker.mythri@oracle.com> <20240104125705.3171fe53@hermes.local> In-Reply-To: <20240104125705.3171fe53@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB4798:EE_|IA0PR10MB7253:EE_ x-ms-office365-filtering-correlation-id: 26961744-5465-4c5a-48af-08dc0dfcc186 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pVbSh0aud5a3re9QYeagRwGISGbr5JtlzsjCWTsmLy8gt92/EQ9rMEY8ZLSypHL1pwgYKJZ17P91R/eqbN56bXT7DrFddP8nVIxX+jvKuk1LPcAVKyNJ5/Vf64hP37D7Bkk1Umifz3rCR7sawJUucx2zwHQdwZYzT4OCVr23OUoSIXBrFhD086LP30tltrrWvt4DcHS8XdIJrxDzTTqid0WWj40tFkxsN7Ovw6L/ws++j1AjNieeSzuxyEfupUR7fUyCyjRmiSUmVqlELl1rXY5ix2m8m/9W2Bet7gkP1QMD4Wn+bUvx/kyKj8hBlJu4GelSiqcJZG1cE8UiSvWmduwqS8xluoIfLuLu6DQPANwsDqX6N7N1NWEyFa7ziW9I9RMBNsBvQDZtY1JDgz8VJ+ve3omNdcQ/YUHER4n/MuW7NsCElTQ3KWgfk7LoKGLuFKCzSXVY/Q79jrL0lbKEa9jsE6VA3lLPmP/TZdi1daKp7b5TRt3Kzc3/cdn+9Bc60MPPZt/eqFSetSzh31t8ZHJiU3W2fempyDRfJKK3glDaCwjuhxnQLhTQD+kzyZxK09S2GzYxkuEQRsdhq2If1KcSlMsiKtBPrHoPhdg9tIv4Yc2ntss0i/SzTVmNKfh/g8rEESC6RzjbE1FiEjUg4gtGLS05mS+i+v2kJKHDKWM= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB4798.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(376002)(346002)(366004)(39860400002)(396003)(230273577357003)(230173577357003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(55016003)(2906002)(478600001)(5660300002)(44832011)(38070700009)(4326008)(52536014)(316002)(66556008)(76116006)(6916009)(54906003)(64756008)(66476007)(66446008)(66946007)(41300700001)(7696005)(71200400001)(33656002)(55236004)(6506007)(9686003)(53546011)(8936002)(8676002)(86362001)(26005)(83380400001)(38100700002)(122000001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gF1O0dLPWOdv1MUBe2HE6EPvnW/5ZfLoqBsvMLHshhCSqB5imHZmnDTANFkg?= =?us-ascii?Q?SXMguav7x/y+YIsAwIfF2mHmtmj4Ke3GM9ntGZrFTEWwTIX7Hp6y4VSvNzv7?= =?us-ascii?Q?xk14hj1yxxrJSgcbCkpJf22NY6TbhYyA4ufZXM+VYqXKVXkWq+vbBn9LwmIg?= =?us-ascii?Q?/EBsJKOXzQVCoAUGo/NbdMwftQ9BYQl220bHV74rYzHbmGm2tV6fF4m4WEUS?= =?us-ascii?Q?F54lMpg4e5aiIdIE5qfTZeDRI7xLZK46MxaedsbWAOyVbEIXYNSZboORk/Ln?= =?us-ascii?Q?865GDb2Kgei4N/G3OOCbu56XqZdsn86fy8SVuictxKOCjc0isrPvKl3z4a7A?= =?us-ascii?Q?sAblIjShNMkbfWBG3tve1XBGL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us-ascii?Q?hQdGo1Jnaz8z5u5/+2uda+mF+ZS6xigTORe1jFLTKvHS1fW41N9XHq4rghPa?= =?us-ascii?Q?1oz1QHaIioGfUzvT2GR1qrB6RvwapQpWwsDob4ttyUWCxV71S0swhHvmwEB2?= =?us-ascii?Q?SkcyRDboNsOrDiqK5418s80hf2hux3Pa/k+mKtVV3pDpTqz6O5Qy8woFw/Y3?= =?us-ascii?Q?8w1tk9QonlsLCxCQ9Z5w6sapnuY6rFi+Y21x1wX6f2hnrq4yIH8J1AIPWeHF?= =?us-ascii?Q?o/LISmznP/8STh80NPrLw5gdpojE0cL0/tH4s2QZ+hZqADa/bLW//5JLi5tH?= =?us-ascii?Q?dNjG1/2lHOpH5TN3iV37ZISsUOFCVR4D87RvmadRiKOeY6JneDXbUz6Hajmc?= =?us-ascii?Q?Xw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: LKxwDncYFxdyFvYQUn+os6QCjwAU9nGHskP+ZkipXNwPcbNm5sZbbxBiZTT/lY1oUDS68esbtvveeXEa0kUc+VoXJoZ0CvhZM5Tn1ye1/uUfYTnqanVZTZhEJrzjPvOAWIprayfKdHyxeVWqGsqupNqDkoM1Za9gOoxR0roW7kwFfGyuBJjRcz7XyqM34jyYCNTIaf/gEJQY0X0hE+dMSoTxWNsdSWQSqHjgEk6Ryz0Dv91ox/AQ611E16cukyH1Qgei5+ISfUwLR9cVW099VKUB6O7i/ymRkjbFtv2TBLMJWAQLkOOoFDbilu+9qz1BQXr9VlCym/1gSqxbCL7zN1uxY9mLmC4nTyjjS2cibQM2c199w1cwB8F9t/tWJazDKQwW/iBpemvgl3QjgsOHNLzJTdtdc8k08Bqpke8KV9z0E9h4GlUmBXFwzYw7WODNYnVTTvViZn2uGQwJsXvNGWV8bFTuJkLzFWC9UCEkuFRdZgdI+WZgi9tL/42XDyMHz7Eli1waCyoGSm0TMZeMmSVeg2xNULQUV62XkViF7x47R4X87otT2+iKsJIJ94FVH+iTlSM3POGM95fR3Yn3iM0yxWD3O1xD8HSXaMgZAbQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4798.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26961744-5465-4c5a-48af-08dc0dfcc186 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2024 14:44:00.9097 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vI/RiD+8wOQQydMRYn5mQSp5iqT0I0rebW1x47entp78WFDToZVibQ0JBqp/9ZjJdI4c8J/P73axLbaLrHGAc7QL1pwOSI57KxFJDyZ8H9o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7253 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-05_07,2024-01-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 bulkscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401050124 X-Proofpoint-GUID: JCcAYdO19B-uqcWLXFnQAsxMsmXK_DSo X-Proofpoint-ORIG-GUID: JCcAYdO19B-uqcWLXFnQAsxMsmXK_DSo X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Stephen, The BPF helper man pages implies in that way and the SKB data pointer acces= s was working till 5.4 kernel also, however from Kernel-5.15 version, we do= see eBPF verifier throws error when we use SKB data pointer access. So, I had used this helper functions and able to resolve the errors. This i= s helper functions are safe to use and also protects from any non-linear sk= b data buffer access also. So, I think using helper functions is better and safe way to access the SKB= data, instead of pointer access. Thanks, Madhuker. -----Original Message----- From: Stephen Hemminger =20 Sent: 05 January 2024 02:27 To: Madhuker Mythri Cc: ferruh.yigit@amd.com; dev@dpdk.org Subject: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per = the new Kernel-version upgrade requirements. On Thu, 4 Jan 2024 22:57:56 +0530 madhuker.mythri@oracle.com wrote: > ------------------------ >=20 > RCA: These errors started coming after from the Kernel-5.15 version, in = which lots of new BPF verification restrictions were added for safe executi= on of byte-code on to the Kernel, due to which existing BPF program verific= ation does not pass. > Here are the major BPF verifier restrictions observed: > 1) Need to use new BPF maps structure. > 2) Kernel SKB data pointer access not allowed. I noticed you are now using bpf_skb_load_bytes(), but the bpf helper man pa= ge implies it is not needed. long bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len) Description This helper was provided as an easy way to load data from a packet. It can be used to load len bytes from offset from the packet associated to skb, into the buffer pointed by to. Since Linux 4.7, usage of this helper has mostly been replaced by "direct packet access", enabling packet data to be manipulated with skb->data and skb->data_end pointing respectively to the first byte of packet data and to the byte after the last byte of packet data. However, it remains useful if one wishes to read large quantities of data at once from a packet into the eBPF stack. Return 0 on success, or a negative error in case of