From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; spf=pass (mailfrom) smtp.mailfrom=intel.com (client-ip=134.134.136.126; helo=mgamail.intel.com; envelope-from=larysa.zaremba@intel.com; receiver=) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HeKjcqQu Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by mail.toke.dk (Postfix) with ESMTPS id B75FAA23823 for ; Tue, 22 Aug 2023 11:13:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692695613; x=1724231613; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=hxQRDi90Oi4AnDcoHiqQ+ywmPFA51+rPoKLf34YDSyE=; b=HeKjcqQusWXBNygMTgS4mInv/VhMNrR7AwrjpaQKoSSFwmxAO30gyu30 F1BsNvglglCDa0uSwmmis3TiwFvoFSH0U3rdxu5qeTpfzRviZIZEnO/OZ EyLUzmgbkLtAZNW2VORTJ9KGFNef5V1p0OEi3/skFZ2hb+Z9sTKsPzIqV UOwgB+34vZUx6gjr6thKho4fGczrbhIsd+l5te7sucTk2vitGz5odcaHY Pyjhb69ZAel24vQVPDMsLWfYASMxlUnxUc8y8mV/6dX41R5OfE07idN1q 2IzKf5a9HwAAxhJ7fanGY0iWPFi6T4LmVTm9pZbr6iXrKiHzRKSfFr3SY w==; X-IronPort-AV: E=McAfee;i="6600,9927,10809"; a="358821629" X-IronPort-AV: E=Sophos;i="6.01,192,1684825200"; d="scan'208";a="358821629" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2023 02:13:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10809"; a="765672860" X-IronPort-AV: E=Sophos;i="6.01,192,1684825200"; d="scan'208";a="765672860" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP; 22 Aug 2023 02:13:30 -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.27; Tue, 22 Aug 2023 02:13:29 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.27 via Frontend Transport; Tue, 22 Aug 2023 02:13:29 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 22 Aug 2023 02:13:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l9XNZuTSixNSXZywZ5zOJnB/LEq9fuoyJs4nadLJSo/202S397eybVq/W8SKDJOlVvGnjabANAcZDvJiimOeAwE1iPSMsUMAqj1snbDHl5YdksVKv+RvVLPgS1VPSoiOLKZHzWDhr60Wryi7xYItm2nVAVbfL6poNG1h0Xj5AynuTukuB3zqOS/PanCFPkSiIwU3xcbfxGb4Nh572gGT+gwL0BNXCQw4vE9bhQytBOh7SNY0hooOKiXpd9/5oG8LmYwVB4E6tNI+dMwOsCDrOrjw3XqkRzWQJGjiyNGCHK/kb/K76BS979iWtMjQ3Wd1i7c6BrFyQnn9lco9CLnUxA== 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=dKk8cxcCM8+mJ5RQQ11bApOgu9cZnpIjKT4m+VKKH1E=; b=j7g8Non51vKrunpMCA/yORBC7BQBURYLuk8cLAcO95QWhBtyycQRv0LrCmUlZGTkFRz/eqUNw3OB+459j9w6wgIK0Jxglq4/k4lTPPREYIKQ0iMSwsx29EIhLU+6TAl2kyinJge06YDHPMwim4KTO+vSmAQ//24VvA7Qd5v70PriSTT0Li6cQVkmJg8yBKzjAn8kOYiVsY7BzzJOt8BO9HERbxLvXHIA8aPQ89/2Fd4lZCiZGY5ugbqTqZ3J/LgeazZxix5L6/3URRQrgh5BfAd2DzWsWCxPIcMDSzAVEjK71CiqlLuHg5X7l7pX+5P3ZH9fZ0ryy94tWHz9Z80cWQ== 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 SN7PR11MB7540.namprd11.prod.outlook.com (2603:10b6:806:340::7) by DM4PR11MB5470.namprd11.prod.outlook.com (2603:10b6:5:39c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 09:13:22 +0000 Received: from SN7PR11MB7540.namprd11.prod.outlook.com ([fe80::2e3b:2384:e6ce:698a]) by SN7PR11MB7540.namprd11.prod.outlook.com ([fe80::2e3b:2384:e6ce:698a%7]) with mapi id 15.20.6699.020; Tue, 22 Aug 2023 09:13:22 +0000 Date: Tue, 22 Aug 2023 11:07:06 +0200 From: Larysa Zaremba To: Alexei Starovoitov Message-ID: References: <20230811161509.19722-1-larysa.zaremba@intel.com> <20230811161509.19722-14-larysa.zaremba@intel.com> <20230817215826.sx7t6mipx7pajuzo@macbook-pro-8.dhcp.thefacebook.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230817215826.sx7t6mipx7pajuzo@macbook-pro-8.dhcp.thefacebook.com> X-ClientProxiedBy: BE1P281CA0264.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:86::14) To SN7PR11MB7540.namprd11.prod.outlook.com (2603:10b6:806:340::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR11MB7540:EE_|DM4PR11MB5470:EE_ X-MS-Office365-Filtering-Correlation-Id: 694c2a6d-d33e-45c1-e64b-08dba2f0080b 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: k5ErlFEP0xVs0sXM2tkGytvy6XjTizYRQlFYToCCTk/e/nNCICvLx1sYHUPheIsh0oqkyot0XakzVPYkrAMHb305+C+vZzqCTd5kXKpq8AWt+aIOEKUlqxAsk54yLeDGzza8JRVTCxQ/uW7O0ou/inxH4/Dc+909ZErks0bwj1Fr+NRq9HT3mOiViL9UxR/SvFUbieHFDs2BDbDdppa3Uqr6wgZ+As7pq7CvIVhCpgPy3BcErs/IHVvLejyHHFSkzzsazXFEeyJ2v33DnF3vm7VFiPZVoJnDTtGosLNnCdsR7DQH9lD2+qytlUYTGMGLhr2cYTEce/dwu8v1IQ//WUm5Ybp5S82KsE3lZfA9tULyRbTpJ9mWEhuxEFUG2nVf4U7ERW2iRsm9hS5NYQ+76nwoGp3HVHnJvdwPvrnH0qMW03MeBlhZ9MPQ/WTu8an+3ZJL6eCEABjnHyHRpuLM7S2Whubcjt6clJQu+IvHCDDM82U4rxjgfrYrPf/S2EXFuWnRpA+uU0AwZk0Exhm/LkElZoXGU6175DdI5FyxaGLaniM/z7jXf7rLBm+jR/XY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR11MB7540.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(366004)(346002)(39860400002)(136003)(376002)(396003)(451199024)(1800799009)(186009)(2906002)(83380400001)(7416002)(6486002)(6506007)(38100700002)(5660300002)(44832011)(26005)(86362001)(8676002)(8936002)(82960400001)(4326008)(9686003)(6512007)(316002)(66476007)(54906003)(66556008)(66946007)(6916009)(478600001)(6666004)(41300700001)(33716001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DqhFB4D6wIFN06DHYCMI2RooApCx6SYtLYwCFCBIMPJW6uNkxj4+IuK7Um9x?= =?us-ascii?Q?XiNEmNYr4xx0wkz3mYSrPauHXt8XUyW7Kl8SMhAAwt+VCRHpKaxEPcu0n2mF?= =?us-ascii?Q?g+Ci3ObzZt9AhTP4BHq1S9ba2LDFA9aveyEAPL65jt22K2HEUFLwPReigf/m?= =?us-ascii?Q?JuvhZKnbXrfclLQy5O2xhUkSkCe52iGw1jIRezQR+k8CgcuG8uCcERlqJVXr?= =?us-ascii?Q?KKj/DUKfYyPVHBJ/yVvciKaqh9GUkznTZCh8HF1lNLcK4rhygntGEsxHtI7j?= =?us-ascii?Q?IM+pb1qHWyNcI3ZLCQYbvOlyPSQz2XfuIUuiZMSVsNwcoKzV9nf9nqhB6hCR?= =?us-ascii?Q?ko/wpDhsKxtml++R382VI+xmL4O2h+78YvEXaaF7dW6pIW5cO9WzMybp1Jbr?= =?us-ascii?Q?PDzio6aI4Zh+ZK3qAkldPb7YBch3hNkugfhMcLTI9boSh9sudk5O36lX58qc?= =?us-ascii?Q?E/9RKwy0LswurwKNlFBjx4CDd4nHnOk7xtZXrzae/IeJXskT5l6/XH48URJL?= =?us-ascii?Q?6t7OgbESApvRg8iSl1QtXiFJrxGz189HlzmB7oECMZqyTDARLowxYD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GdBYwInsQFUoNyepdHEfownk6F7tOviJjffv7?= =?us-ascii?Q?gcrnPPscgsOL42OqlwmzPbGcV6DV8wydqAGRSJ1YvNdkSIiDzcTV6V/2xphW?= =?us-ascii?Q?6kM5fe0ZA4VEYNZhfP1HqcV66GBISDkGrD4nUd8bgq+5SMM9UdP4/n7TjYW8?= =?us-ascii?Q?qA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 694c2a6d-d33e-45c1-e64b-08dba2f0080b X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7540.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 09:13:21.7215 (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: l2rHYLZDFDtJM1Q+RFWna5SCqeabJlA/RBisXcl8o/MB3B/XpcgX81CmzXCuLpSDHUR14g771VLIi9ErXL4Uz34BZh0n7Sd7FElTQ+8xEZI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5470 X-OriginatorOrg: intel.com Message-ID-Hash: N5YR4PXI3ZY2RVVLEHBJDHXUEDCGBXGZ X-Message-ID-Hash: N5YR4PXI3ZY2RVVLEHBJDHXUEDCGBXGZ X-MailFrom: larysa.zaremba@intel.com X-Mailman-Rule-Hits: member-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address CC: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org, Willem de Bruijn , Simon Horman X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v5 13/21] ice: Implement checksum hint List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, Aug 17, 2023 at 02:58:26PM -0700, Alexei Starovoitov wrote: > On Fri, Aug 11, 2023 at 06:15:01PM +0200, Larysa Zaremba wrote: > > Implement .xmo_rx_csum callback to allow XDP code to determine, > > whether HW has validated any checksums. > > > > Signed-off-by: Larysa Zaremba > > --- > > drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 26 +++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > > > diff --git a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > index 6ae57a98a4d8..f11a245705bc 100644 > > --- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > +++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > @@ -660,8 +660,34 @@ static int ice_xdp_rx_vlan_tag(const struct xdp_md *ctx, u16 *vlan_tci, > > return 0; > > } > > > > +/** > > + * ice_xdp_rx_csum - RX checksum XDP hint handler > > + * @ctx: XDP buff pointer > > + * @csum_status: status destination address > > + * @csum: not used > > + */ > > +static int ice_xdp_rx_csum(const struct xdp_md *ctx, > > + enum xdp_csum_status *csum_status, __wsum *csum) > > +{ > > + const struct ice_xdp_buff *xdp_ext = (void *)ctx; > > + const union ice_32b_rx_flex_desc *eop_desc; > > + enum ice_rx_csum_status status; > > + u16 ptype; > > + > > + eop_desc = xdp_ext->pkt_ctx.eop_desc; > > + ptype = ice_get_ptype(eop_desc); > > + > > + status = ice_get_rx_csum_status(eop_desc, ptype); > > + if (status & ICE_RX_CSUM_FAIL) > > + return -ENODATA; > > + > > + *csum_status = XDP_CHECKSUM_VERIFIED; > > + return 0; > > +} > > + > > const struct xdp_metadata_ops ice_xdp_md_ops = { > > .xmo_rx_timestamp = ice_xdp_rx_hw_ts, > > .xmo_rx_hash = ice_xdp_rx_hash, > > .xmo_rx_vlan_tag = ice_xdp_rx_vlan_tag, > > + .xmo_rx_csum = ice_xdp_rx_csum, > > timestamp hint is implemented by igc, mlx4, mlx5, stmmac > hash hint is implemneted by igc, mlx4, mlx5. > With above csum and vlan hints will be in ice only. > I'd like to see at least one more driver to implement them as well to make sure > the proposed API works for other vendors. I have no other vendors on my current setup :/ I could send an RFC of v5 + a compile-tested implementation for some other vendor, so you can see, how it might look. What do you think?