From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mail.toke.dk (Postfix) with ESMTPS id 670009C776F for ; Mon, 28 Nov 2022 23:11:44 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NcjY4W60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669673503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5BMPgwHcrrlbhB+DA3tYoZ2wLQmTOscwvY24xCKdS00=; b=NcjY4W60z81midUr0xgiaxS1Dp7iAl6pant85Hs122AWfDSZnXAfUg5HRMOfa095F+6my2 9ZgBDSXg2VtHSL6IafgSxMPtlWz4Op0mkC8utUm6lQK1risFM+wM4s/aWug+Clh+6BiA3k vBV9269BOzbxw36Tfrbd9TPG5PCF+hQ= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-638-ZYuiLkEvN0C3aFH4v_PrxQ-1; Mon, 28 Nov 2022 17:11:40 -0500 X-MC-Unique: ZYuiLkEvN0C3aFH4v_PrxQ-1 Received: by mail-ej1-f71.google.com with SMTP id xc12-20020a170907074c00b007416699ea14so5128786ejb.19 for ; Mon, 28 Nov 2022 14:11:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5BMPgwHcrrlbhB+DA3tYoZ2wLQmTOscwvY24xCKdS00=; b=5Zj4oqs1JciRZTKATqnFVoGs6b/7WDdOI9VGqfATnSnVbbh2hvE0mToB2nd0+wCnMM EEmCAsioKA70+XXV1eKD2U3lXnIOAc0pypduu+h4xLeW/yQEHMyPjKeVRIrxv4VeEFB0 d91jEojZBL/+QkKWiUJNL+sgdzjtfJFzoWvHGlS54oT2t5ead/7nK8zuofKyUIgl/bh9 2nOv3Q9Hk9KB8w2DyetDLxMMEYKWR3X3iPm9WWPUXW+dR6H9RbudBZjZpCcvZRmPFq9x +xF3nh2VOWv7xGRuAOtdnw6CO13qC87xJ9lP1/8NLUFXwSHVtfuyZEFd/z/iRt4ksqcw iuOw== X-Gm-Message-State: ANoB5plDvLGAKRMCJoBjIlw5eBlheoupPRQF5HLG0gr02oAQVZ/sRLyc Xqi/SlrRv4eW9WbzLB1DEemCpNF2TaWkujMdovR+nXAiueO2RHeP0Cxi5AdDnytihPHww6teFWB WdjCtoq0GkcbsZSM233iM X-Received: by 2002:a05:6402:1814:b0:46a:b1ba:22b8 with SMTP id g20-20020a056402181400b0046ab1ba22b8mr17295918edy.316.1669673498388; Mon, 28 Nov 2022 14:11:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf7st7yCH/4V5YU/vN37QSzfbku3pyjeb6Q1i19qaft96cPj12mRMZj1zEN/rQhzerrf48Hkow== X-Received: by 2002:a05:6402:1814:b0:46a:b1ba:22b8 with SMTP id g20-20020a056402181400b0046ab1ba22b8mr17295888edy.316.1669673498075; Mon, 28 Nov 2022 14:11:38 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id l17-20020a056402125100b00463c367024bsm5474590edw.63.2022.11.28.14.11.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 14:11:37 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id ECC627EBE9E; Mon, 28 Nov 2022 23:11:36 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Stanislav Fomichev In-Reply-To: References: <20221121182552.2152891-1-sdf@google.com> <20221121182552.2152891-7-sdf@google.com> <874jupviyc.fsf@toke.dk> <20221123111431.7b54668e@kernel.org> <871qptuyie.fsf@toke.dk> <20221123174746.418920e5@kernel.org> <87edts2z8n.fsf@toke.dk> <874jun3m58.fsf@toke.dk> X-Clacks-Overhead: GNU Terry Pratchett Date: Mon, 28 Nov 2022 23:11:36 +0100 Message-ID: <871qpm20h3.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Message-ID-Hash: MJEJ3LQWESY5J5LQWVVWDQRVIAR6NFFT X-Message-ID-Hash: MJEJ3LQWESY5J5LQWVVWDQRVIAR6NFFT X-MailFrom: toke@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Maciej Fijalkowski , Jakub Kicinski , 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, haoluo@google.com, jolsa@kernel.org, Tariq Toukan , David Ahern , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v2 6/8] mlx4: Introduce mlx4_xdp_buff wrapper for xdp_buff List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Stanislav Fomichev writes: >> >> Why can't you simply have a pointer to xdp_buff in driver specific >> >> xdp_buff container which would point to xdp_buff that is stack based (or >> >> whatever else memory that will back it up - I am about to push a change >> >> that makes ice driver embed xdp_buff within a struct that represents Rx >> >> ring) for XDP path and for ZC the pointer to xdp_buff that you get from >> >> xsk_buff_pool ? This would satisfy both sides I believe and would let us >> >> keep the same container struct. >> >> >> >> struct mlx4_xdp_buff { >> >> struct xdp_buff *xdp; >> >> struct mlx4_cqe *cqe; >> >> struct mlx4_en_dev *mdev; >> >> struct mlx4_en_rx_ring *ring; >> >> struct net_device *dev; >> >> }; >> > >> > Nah this won't work from kfunc POV, probably no way to retrieve the >> > mlx4_xdp_buff based on xdp_buff ptr that needs to be used as an arg. >> > >> > Sorry I'll think more about it, in the meantime let's hear more voices >> > whether we should keep Stan's original approach + modify xdp_buff_xsk or >> > go with Toke's proposal. >> >> OK, so I played around with the mlx5 code a bit more, and I think the >> "wrapping struct + cb area" can be made to work without too many ugly >> casts; I'll send an updated version of the mlx5 patches with this >> incorporated tomorrow, after I've run some tests... > > I'll probably send a v3 sometime tomorrow (PST), so maybe wait for me > to make sure we are working on the same base? > Or LMK if you prefer to do it differently.. OK, I'll send you my mlx5 patches off-list so you can just incorporate those. Got stuck on some annoying build issues for the perf testing, so will defer that until your next version, then :) -Toke