From owner-dev-commits-src-all@freebsd.org Mon Mar 29 14:39:12 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 23956579416; Mon, 29 Mar 2021 14:39:12 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8FZl4Qc3z3jr4; Mon, 29 Mar 2021 14:39:10 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1617028746; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K4YVBx+iMljHtlQzZFmlh3BrxTg6NznNegHFcmfO9ZM=; b=CTI+1Fpo6xLeS4Z27N3YRLT5QKoHW9xtwl0fdmfULy3cqLt4cPxxNNHs/IFjyg4ceXilFx r9zQ8h34fnW6+PcehbzNF0WDwg6/fX3t+kcoYuVC8Gvp4q1g68Bo6dEGTJE33bXIA3uyQP i0jZ/fuVfYVdW10IWfWDqUUncEhQY2g= Received: from skull.home.blih.net (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 7026ca56 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Mar 2021 14:39:06 +0000 (UTC) Date: Mon, 29 Mar 2021 16:39:02 +0200 From: Emmanuel Vadot To: Vincenzo Maffione Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21d0c01226eb - main - netmap: iflib: add nm_config callback Message-Id: <20210329163902.276b6025663539b2c181af0c@bidouilliste.com> In-Reply-To: <202103290959.12T9xdWL009393@gitrepo.freebsd.org> References: <202103290959.12T9xdWL009393@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4F8FZl4Qc3z3jr4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] 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: Mon, 29 Mar 2021 14:39:12 -0000 Hi Vincenzo, On Mon, 29 Mar 2021 09:59:39 GMT Vincenzo Maffione wrote: > The branch main has been updated by vmaffione: > > URL: https://cgit.FreeBSD.org/src/commit/?id=21d0c01226eb979556d6d792ec58eb54012fbc24 > > commit 21d0c01226eb979556d6d792ec58eb54012fbc24 > Author: you@x I don't think that you've setup your env correctly. > AuthorDate: 2021-03-29 09:26:12 +0000 > Commit: Vincenzo Maffione > CommitDate: 2021-03-29 09:31:18 +0000 > > netmap: iflib: add nm_config callback > > This per-driver callback is invoked by netmap when it wants > to align the number of TX/RX netmap rings and/or the number of > TX/RX netmap slots to the actual state configured in the hardware. > The alignment happens when netmap mode is switched on (with no > active netmap file descriptors for that netmap port), or when > collecting netmap port information. > > MFC after: 1 week > --- > sys/net/iflib.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/sys/net/iflib.c b/sys/net/iflib.c > index 05e99ba318df..f6cf1233a3b5 100644 > --- a/sys/net/iflib.c > +++ b/sys/net/iflib.c > @@ -829,6 +829,26 @@ iflib_netmap_register(struct netmap_adapter *na, int onoff) > return (status); > } > > +static int > +iflib_netmap_config(struct netmap_adapter *na, struct nm_config_info *info) > +{ > + if_t ifp = na->ifp; > + if_ctx_t ctx = ifp->if_softc; > + iflib_rxq_t rxq = &ctx->ifc_rxqs[0]; > + iflib_fl_t fl = &rxq->ifr_fl[0]; > + > + info->num_tx_rings = ctx->ifc_softc_ctx.isc_ntxqsets; > + info->num_rx_rings = ctx->ifc_softc_ctx.isc_nrxqsets; > + info->num_tx_descs = iflib_num_tx_descs(ctx); > + info->num_rx_descs = iflib_num_rx_descs(ctx); > + info->rx_buf_maxsize = fl->ifl_buf_size; > + nm_prinf("txr %u rxr %u txd %u rxd %u rbufsz %u", > + info->num_tx_rings, info->num_rx_rings, info->num_tx_descs, > + info->num_rx_descs, info->rx_buf_maxsize); > + > + return 0; > +} > + > static int > netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) > { > @@ -1279,6 +1299,7 @@ iflib_netmap_attach(if_ctx_t ctx) > na.nm_rxsync = iflib_netmap_rxsync; > na.nm_register = iflib_netmap_register; > na.nm_intr = iflib_netmap_intr; > + na.nm_config = iflib_netmap_config; > na.num_tx_rings = ctx->ifc_softc_ctx.isc_ntxqsets; > na.num_rx_rings = ctx->ifc_softc_ctx.isc_nrxqsets; > return (netmap_attach(&na)); -- Emmanuel Vadot