From owner-freebsd-current@FreeBSD.ORG Tue Nov 11 23:00:39 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77E415D7; Tue, 11 Nov 2014 23:00:39 +0000 (UTC) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1A3BBCE; Tue, 11 Nov 2014 23:00:38 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id n3so3134676wiv.14 for ; Tue, 11 Nov 2014 15:00:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=91oRtIlJhmzF5WOsf8FHKvOBi9tX+XnGBClzOGBCftw=; b=y3Dc+jT4z5Hj4H5/bQ3Xnt18XINgXdfpmCuWjMIHKtLkLlZ3zq792niyD9eza+ndIm 3yphj3151vFSk7prGA+VueTJ+2smOxveON5CGjp2w9Cd4++DdX2fy4tsyCtXs4ly84qr uQsWKiuyoBig2iGwoTrvh6Jpu7esFQh8i6iAYiXPfSP6/fuuFqkPhHGOb2Ts9n6HxV2p U4iAe8N8Z7j4L1mzhM0uJPiSGdZ1soAw9+NjCGFGUFKfcVECdgG717XxEkxq78wAJwks fVGrtKwiwv6dDFZ5eNl2BJBCtHGlKfOG/eI8t/znzLvgOcL6xPKEMu4ZZ3Zn0cTUjAf7 a1Kg== MIME-Version: 1.0 X-Received: by 10.194.110.161 with SMTP id ib1mr60503125wjb.78.1415746837442; Tue, 11 Nov 2014 15:00:37 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.194.19.9 with HTTP; Tue, 11 Nov 2014 15:00:37 -0800 (PST) In-Reply-To: References: <560E07EA-2506-487E-88DD-E2B9F7ED9792@lastsummer.de> Date: Tue, 11 Nov 2014 15:00:37 -0800 X-Google-Sender-Auth: hyD23Y4KVrfC0TZiBl9ew2JimFE Message-ID: Subject: Re: netmap: extension to store user data per packet/slot? From: Luigi Rizzo To: Franco Fichtner Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Adrian Chadd , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2014 23:00:39 -0000 Franco, apparently you want some user-defined metadata to move along with the packet, but i do not think it is reasonable to put it in the slots. If we do that, what about timestamps, flow IDs, interface and queue index and all the rest of the things that we normally find in an mbuf/skbuf ? This is not going to scale. Also consider that at some point you may use a different arrangement (with packets passed along VALE switches or physical interfaces etc.) i believe the most reasonable place to put the extra info is at the end of the packet and possibly bump the length in the slot so you are safe in case the packet is copied. There is no timestamp appended to the packet at the moment, it was a feature i thought somebody may want to have, but between the relative scarcity of hardware that provides per-packet timestamps, and the questionable usefulness of the same, i doubt it will be available. cheers luigi On Tue, Nov 11, 2014 at 2:01 PM, Franco Fichtner wrote: > > On 11 Nov 2014, at 22:48, Adrian Chadd wrote: > > > Ah, I see. You're missing some unique identifier for each netmap > > buffer. I thought there was one already. Silly me. > > Exactly, and, no, thank you for making clear what is needed. :) > > A little more on this: I think struct netmap_slot is convenient > due to the fact that in zero-copy one wouldn't want to mess with > the actual buffer for speed and userland code already touches slot > internals for each ring transition so there is no performance > degradation. > > The key benefit is that if userland can use this storage freely > netmap(4) doesn't get in the way of building complex setups that > require decoupled logic and each ring "hop" may alter the state > as required. > > > Cheers, > Franco > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------