Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2238256rwd; Mon, 15 May 2023 09:00:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gKZDMRWI7meTCFoYVrI/5gPEbT2B1YqwMM1/pVMFlnp2j82q1+N2pMy4mkD1TW2Oxcdfz X-Received: by 2002:a17:902:c943:b0:1a9:2a9e:30a8 with SMTP id i3-20020a170902c94300b001a92a9e30a8mr50712126pla.9.1684166433842; Mon, 15 May 2023 09:00:33 -0700 (PDT) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a170902779200b001a99941abbfsi16078805pll.338.2023.05.15.09.00.16; Mon, 15 May 2023 09:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UtQjgHXE; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242110AbjEOPsv (ORCPT + 99 others); Mon, 15 May 2023 11:48:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjEOPst (ORCPT ); Mon, 15 May 2023 11:48:49 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEBAD1FDF; Mon, 15 May 2023 08:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684165728; x=1715701728; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=3mQZ7SnAbvZPcYFXJjkGRwzOfYXinWUlTjKwZvaNiq8=; b=UtQjgHXEbar3G59nYzlwClvHqCzzuQBHhnYu4spJOXTkR29YwvScg2WZ vK8gD2DP2bR2Ys7301WlgwJzaEL6g2o8vV+XXfJHTlJPVtiIfdptw6kfh QsBi/OpqkOwvWPrvx68XTmveupfq1g9xD0O9Oi4hoeDA91A8qBozSt8D5 n2HXpJXm8pCiOpMafTgm8Epw6tOz/DZgyvDRH5lpv1avNN4b5QkBYm+NC X5Q2yj17r1FHXNVjgcDdiQGjhf0KFgBIzr1iiUJ0gHhiySs+zWu2K1B5u z+LIPKqDC2VgubOI7xDhHCBXTTm38tqjtDkJiyf0KcO11ZXus3NgR6w7m w==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="340589663" X-IronPort-AV: E=Sophos;i="5.99,277,1677571200"; d="scan'208";a="340589663" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2023 08:48:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="731675824" X-IronPort-AV: E=Sophos;i="5.99,277,1677571200"; d="scan'208";a="731675824" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP; 15 May 2023 08:48:47 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 15 May 2023 08:48:47 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 15 May 2023 08:48:46 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Mon, 15 May 2023 08:48:46 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.102) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Mon, 15 May 2023 08:48:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l74XF8qoovh5Gtrdd+7duud+PRzc+G3vrHg8eDY+MwallEma0vLYq3ZvMwLTAjw0sNkH0Rp7vFd+4UCQI01QDN/6c1v9IayWcjHDkI04I3Z2im1vGG41qWj0lG8B7A7cXq9U8fFZFLvzDH2Mcfksr5wroNnV0rJssovHfXXpTpJ0w9u2Pt17XZU9cJO5Lk9Zo2m9SXp14Ss4PRrEQIkRnVBUylydxALMPyb9PpwRwkHmvgQjMAy8W2nQsBeo5RPiDN0V5VfwPIG+qsLdKQJkI6HNjQVfhdb/N227ST3L0KVqKWkBCtvwUxa40fbjhlHigULQZykdMnPe/LRG0oTYpw== 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=ssSIUrVPp5bcxQ9LaSoN0JHOXfX88KS7ReFe3w7ISlU=; b=lGyaFT8CgorlKLs360N4dzjBrMxORxhQ1k0/J24hRqCwJFtzB/MU/uvtJC95fxyJYS9dfu3urQcASMwvojQ8y+2bA+2DR03DKvt7iXO7xyPaFYdcv16ak4IcorL8LXRte8kK9M+uhaCostX0jWV7nP6nFHLnVpECRPBvsK7jbycLsonSOEfI70cb+bt3/ASMbWEbvwqdUNDSALIAmwFySCOJetHxrURATcE3klqFWXXNtthIZG/girOs24uj7LmRQVXDuuT2FpvxtYkkK6vN/Uo7RFCa/ZNUoJzcHgeZV7gyGKUgaWVFwow09O0gYSYsTH/WsNWafNIeOOvtsGarEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5471.namprd11.prod.outlook.com (2603:10b6:5:39d::10) by DM4PR11MB6480.namprd11.prod.outlook.com (2603:10b6:8:8d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Mon, 15 May 2023 15:48:39 +0000 Received: from DM4PR11MB5471.namprd11.prod.outlook.com ([fe80::907c:ffaa:352a:8913]) by DM4PR11MB5471.namprd11.prod.outlook.com ([fe80::907c:ffaa:352a:8913%6]) with mapi id 15.20.6387.030; Mon, 15 May 2023 15:48:39 +0000 Date: Mon, 15 May 2023 17:45:54 +0200 From: Larysa Zaremba To: Jesper Dangaard Brouer CC: Stanislav Fomichev , , , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Jakub Kicinski , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jiri Olsa , Jesse Brandeburg , "Tony Nguyen" , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , , , , Subject: Re: [PATCH RESEND bpf-next 10/15] ice: Implement VLAN tag hint Message-ID: References: <20230512152607.992209-1-larysa.zaremba@intel.com> <20230512152607.992209-11-larysa.zaremba@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: FR3P281CA0117.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::8) To DM4PR11MB5471.namprd11.prod.outlook.com (2603:10b6:5:39d::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5471:EE_|DM4PR11MB6480:EE_ X-MS-Office365-Filtering-Correlation-Id: 62f2ab86-d7ab-4f9b-d0e2-08db555bd9db X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YRTQGirnJlopIJ7kKt8hTpwb/XGhNCdrfZjBwEpvCtsj7H6rK4MCfe+EfANmY1X3vkJGlh2ZRHX2f2toX4TSssz6V/JS9Iubg4kjX16cxZQpP7GyeRKs2yqkwKe5svZXrg5FRZz+3ur9M3NwhMilbOkHM+2xrBA19mM9cITmk+miFq0Foh1di0massZrJZ3RhESD+zKVCxx8pSOAi541fNaMJJACcqJuEvKty0qbhU6HntWrPnxHX2q2IVygAuqYM4kk6cjECXHOo80WHinoaj8DRVmwxspGhXleleFkErYdlJFhFs4yr1vlmiusx1qZusq/e9yxUyEXdNHjfitaF4fE8zIOzsqxwasNnTtg9zo4KV4pXv5z33+CwtW1QFVVPsmNozPKo23dN3v13G/bhG9ePiBzdec4mOCHXDrVKt/TQgLbtLiIgFjXqcuOszOLiDonIYnkz0+LUixWADawhMHZAPLHspWqZ5Y/PloRjTRv7ceChbr4tUizXM1QaHj9Dlz88TFqN+VTLN0xRm3Nuf9Gj1RBT6R5SBGhag9KroSLafuXWdfuitYGe2rVqThF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5471.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(7916004)(136003)(366004)(376002)(39860400002)(396003)(346002)(451199021)(33716001)(83380400001)(66476007)(66556008)(9686003)(66946007)(6486002)(26005)(6506007)(6512007)(478600001)(54906003)(6666004)(7416002)(186003)(44832011)(86362001)(8676002)(8936002)(5660300002)(2906002)(41300700001)(4326008)(6916009)(316002)(82960400001)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lc5vbAsLotNMDVYSysp/hJFv6ZPFc8zOK06mDJsB0GiJDvzRIiAuZX80Blu0?= =?us-ascii?Q?WNVvV6xLSG+gO/JwdjEFEYDFwR4ICl+DEcqeFvnwsy9q2NXFYEFFZkRSPXIG?= =?us-ascii?Q?GBKxK8XiynlVLQ2rJP3HgNRmafAgPCqfMJGICI8L2ih5OAX0fLylsDan9VxG?= =?us-ascii?Q?k1dO8XCuZgs0T2EomvFCKoCbeFPLn9PudC8BCzScxHM2Np7tnvfgE32PU+UK?= =?us-ascii?Q?bGiic294+wd3IemAo5QdVrP/I6278PHwGbs9x70I+ItnhYtHeWbvclFfsQw5?= =?us-ascii?Q?KqVFJCoetHGp49vztz32lpE3hnCwcLB4fsV/m5VcOljRdC0B3usSiNIphOM0?= =?us-ascii?Q?D/gvHh9wnr2G0f1lDCJYKfl+o53Sdno5gQBJbalnveIXVvFcf4W7zEIqkq/v?= =?us-ascii?Q?KOg2lksmxtXFn0VxhC/ZtlgTnBSJm/cdLgo85AE6cW8QDIsL7M/tczQA2LS5?= =?us-ascii?Q?1zL16o9uW4BixKg8GxCI7dDJn+Pbz7ylfD95q7Cem3eKmS6un8r6T53erixt?= =?us-ascii?Q?dwOsQliepBbsv/55Os71q08/cC48yis3yTBfxU7JSI/89cgjjbApGSLuYdKS?= =?us-ascii?Q?eRsAGIZ5lgCagyltYQEvYtT+odVKzXcS1DwT0vPOw8CJLXO0iCRdRVtSrGaI?= =?us-ascii?Q?VdBD9kDm2fVhJxb3CiQ5Ixaa5x8DHCD6S3jR89bKfuUCMPEvwdcLdVkfIJuo?= =?us-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DdYlkzvlwuaSsgWWNK80YEKIuYk9?= =?us-ascii?Q?bg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 62f2ab86-d7ab-4f9b-d0e2-08db555bd9db X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5471.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2023 15:48:39.0948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0R1wj/BfqgVm3Z8S3Zah03D5gFWznzifLYEWABTcewMUXRJUTyl1UHtyb9KCcgR/7rTqV3QLDQq1NDHKj91Uuw/uuRUBf1cYz063BPNdtr0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6480 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 15, 2023 at 05:07:19PM +0200, Jesper Dangaard Brouer wrote: > > > On 15/05/2023 15.41, Larysa Zaremba wrote: > > > > + *vlan_tag = ice_get_vlan_tag_from_rx_desc(xdp_ext->eop_desc); > > > Should we also do the following: > > > > > > if (!*vlan_tag) > > > return -ENODATA; > > > > > > ? > > Oh, returning VLAN tag with zero value really made sense to me at the beginning, > > but after playing with different kinds of packets, I think returning error makes > > more sense. Will change. > > > > IIRC then VLAN tag zero is also a valid id, right? AFAIK, 0x000 is reseved and basically means "no vlan tag". When ice hardware returns such value in descriptor, it says "no vlan tag was stripped" and this doesn't necessarily mean there is no VLAN tag in the packet. For example, let us consider a packet: Ether/802.1ad(s-tag)/802.1q(c-tag)/... Hardware does not strip c-tag in such case and sends 0x000 in the descriptor, but packet clearly does contain a c-tag, so at least in ice, it is reasonable to not consider '0' a reliable value. I guess, for s-tag value of 0x000 should be more reliable, so maybe 'if (!*vlan_tag)' usage can be limited to c-tag function. > > --Jesper >