From owner-freebsd-net@FreeBSD.ORG Tue Dec 30 16:10:52 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81E0C1AD for ; Tue, 30 Dec 2014 16:10:52 +0000 (UTC) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (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 002762513 for ; Tue, 30 Dec 2014 16:10:51 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id z11so4457997lbi.6 for ; Tue, 30 Dec 2014 08:10:50 -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=AFOUprc/AT/sUUNnqR1hs42arSFiU93X4XqWf7U2Tow=; b=cu9aLCcmajE0zhaGJJUb9+dmD8UEVc+t2tZodQbFhvy5daFjUDzcBq7pyxYE4zBkJ3 bo55JTMi4gS95FUDtELyFulzci3krfXHRzYd+BDNXSL20jwlu3XHRKW0WYixV31zHYL3 P1vsha1uHVhDUNWu3sETEP9vr6C70Uu5Em6+Uotco8l9lOZ25n2kKl9IbI00JrHVHpzv dvR7fXweFMkTK7igaj7bCqLAAH4VsF9ZStoaZuxUCFkVLA6237+WmzEE5lEdE7t5Mwtk GHf05s7W5xt6d1QLEgFMaxcbocebHvN4t0YYiPH7hLrS40oNMX3DEs5Mm/SzQ322gmSl IGdg== MIME-Version: 1.0 X-Received: by 10.112.219.98 with SMTP id pn2mr59219956lbc.74.1419955849968; Tue, 30 Dec 2014 08:10:49 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.174.169 with HTTP; Tue, 30 Dec 2014 08:10:49 -0800 (PST) In-Reply-To: References: Date: Tue, 30 Dec 2014 17:10:49 +0100 X-Google-Sender-Auth: uwYdHyX4oqsSKyjFmdpl_IvIA98 Message-ID: Subject: Re: Regarding Netmap internal memory allocation. From: Luigi Rizzo To: Carlos Ferreira Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 16:10:52 -0000 you don't need to recompile, on linux those values are accessible under /sys/modules/netmal_lin/parameters (on FreeBSD they are sysctl variables) cheers luigi On Tue, Dec 30, 2014 at 4:43 PM, Carlos Ferreira wrote: > Ok thanks. I was hoping not having to recompile the module, but it's ok. > Thank you for the info! > > > On 30 December 2014 at 15:38, Luigi Rizzo wrote: >> >> you can reduce the amount of ram (buffers, mostly) by >> tweaking the values in netmap_mem2.c :: >> struct netmap_obj_params netmap_params[NETMAP_POOLS_NR] = { >> ... >> } >> >> or you can simply modify the constant >> >> netmap_mem2.h:#define NETMAP_BUF_MAX_NUM 20*4096*2 >> >> to something smaller that suits an openwrt box >> (in which i am very interested, as I'd like to deploy one of these soon) >> >> cheers >> luigi >> >> >> On Tue, Dec 30, 2014 at 4:12 PM, Carlos Ferreira >> wrote: >> > Update: >> > >> > I noticed that the netmap module was still crashing, after changing the >> > OpenWRT VM ram to 256MB. I now raised to 1GB and it no longer crashed. >> > The >> > netmap module is now consuming about 350MB of Ram, which for my >> > objectives >> > is just too much... >> > >> > On 30 December 2014 at 14:06, Carlos Ferreira >> > wrote: >> > >> >> To Luigi and to whom may be able to help >> >> >> >> Hello all. >> >> >> >> Is it possible to reduce the size of the memory buffer allocated by the >> >> netmap module? >> >> I'm asking this because I was implementing some testing code, using >> >> NICs >> >> and a Tap device in an OpenWRT VM with 64MB of RAM. >> >> Because of the small RAM amount, the nm_open crashed when the program >> >> tried to netmap the tap device, after I previously netmapped one NIC >> >> successfully. >> >> After the crash, I bumped the VM RAM to 256MB and the test program ran >> >> well, but not without me noticing that the VM RAM consumption was >> >> increased about 90 MB by netmap. >> >> >> >> Resuming, I want to know if there is a way to reduce the memory buffer >> >> allocation, without recompiling the netmap kernel module. >> >> >> >> Thank you for the attention. >> >> >> >> -- >> >> >> >> Carlos Miguel Ferreira >> >> Researcher at Telecommunications Institute >> >> Aveiro - Portugal >> >> Work E-mail - cmf@av.it.pt >> >> Skype & GTalk -> carlosmf.pt@gmail.com >> >> LinkedIn -> http://www.linkedin.com/in/carlosmferreira >> >> >> > >> > >> > >> > -- >> > >> > Carlos Miguel Ferreira >> > Researcher at Telecommunications Institute >> > Aveiro - Portugal >> > Work E-mail - cmf@av.it.pt >> > Skype & GTalk -> carlosmf.pt@gmail.com >> > LinkedIn -> http://www.linkedin.com/in/carlosmferreira >> > _______________________________________________ >> > freebsd-net@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net >> > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> >> >> >> -- >> -----------------------------------------+------------------------------- >> 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) >> -----------------------------------------+------------------------------- > > > > > -- > > Carlos Miguel Ferreira > Researcher at Telecommunications Institute > Aveiro - Portugal > Work E-mail - cmf@av.it.pt > Skype & GTalk -> carlosmf.pt@gmail.com > LinkedIn -> http://www.linkedin.com/in/carlosmferreira -- -----------------------------------------+------------------------------- 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) -----------------------------------------+-------------------------------