From owner-dev-commits-src-all@freebsd.org Wed Apr 7 21:58:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 978695C6465; Wed, 7 Apr 2021 21:58:59 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFyw33qF5z4rfG; Wed, 7 Apr 2021 21:58:59 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: vmaffione) by smtp.freebsd.org (Postfix) with ESMTPSA id 70E3A2C35D; Wed, 7 Apr 2021 21:58:59 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: by mail-pf1-f181.google.com with SMTP id o123so322892pfb.4; Wed, 07 Apr 2021 14:58:59 -0700 (PDT) X-Gm-Message-State: AOAM531cvsF/A8WBXFKtpNOJQ5QabQAIJVKNqtZePB+rainkhBtRgmCc 89V0RbMiY3jpkA50KTtFzY7aytrlzsXdkutZmGg= X-Google-Smtp-Source: ABdhPJzo3nLcm7Dxg3KdCCwshYW8D+vefPVZAb3yIE1VWExSEKSnPiGv1Jt4KNaUHH+EB3uyjOeqZ2CfAHb0sQcFvCo= X-Received: by 2002:a65:6483:: with SMTP id e3mr5271327pgv.208.1617832738383; Wed, 07 Apr 2021 14:58:58 -0700 (PDT) MIME-Version: 1.0 References: <202104072142.137LgrJC015011@gitrepo.freebsd.org> <20210407214622.gsedn2cuuj7mblq2@mutt-hbsd> In-Reply-To: <20210407214622.gsedn2cuuj7mblq2@mutt-hbsd> From: Vincenzo Maffione Date: Wed, 7 Apr 2021 23:58:45 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 15dc713ceb57 - main - netmap: vtnet: add support for netmap offsets To: Shawn Webb Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 21:58:59 -0000 Hi, Do you mean the whole commit? This adds vtnet support for "offsets" in the netmap buffers. Main use case is that applications can easily zerocopy push and pop protocol headers from packets. Cheers, Vincenzo On Wed, Apr 7, 2021, 11:46 PM Shawn Webb wrote: > Hey Vincenzo, > > On Wed, Apr 07, 2021 at 09:42:53PM +0000, Vincenzo Maffione wrote: > > The branch main has been updated by vmaffione: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=15dc713ceb57d0d61c1dc54b1d550da42d250730 > > > > commit 15dc713ceb57d0d61c1dc54b1d550da42d250730 > > Author: Vincenzo Maffione > > AuthorDate: 2021-04-07 21:32:20 +0000 > > Commit: Vincenzo Maffione > > CommitDate: 2021-04-07 21:32:20 +0000 > > > > netmap: vtnet: add support for netmap offsets > > > > Follow-up change to a6d768d845c173823785c71bb18b40074e7a8998. > > This change adds support for netmap offsets. > > --- > > sys/dev/netmap/if_vtnet_netmap.h | 16 ++++++++++------ > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > diff --git a/sys/dev/netmap/if_vtnet_netmap.h > b/sys/dev/netmap/if_vtnet_netmap.h > > index a05781255218..a423e71331be 100644 > > --- a/sys/dev/netmap/if_vtnet_netmap.h > > +++ b/sys/dev/netmap/if_vtnet_netmap.h > > @@ -84,12 +84,14 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int > flags) > > for (; nm_i != head; nm_i = nm_next(nm_i, lim)) { > > /* we use an empty header here */ > > struct netmap_slot *slot = &ring->slot[nm_i]; > > + uint64_t offset = nm_get_offset(kring, slot); > > u_int len = slot->len; > > uint64_t paddr; > > void *addr = PNMB(na, slot, &paddr); > > int err; > > > > - NM_CHECK_ADDR_LEN(na, addr, len); > > + (void)addr; > > What is this change for? > > Thanks, > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc >