From owner-freebsd-net@freebsd.org Thu May 13 12:57:24 2021 Return-Path: Delivered-To: freebsd-net@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 3A2A363F8E7 for ; Thu, 13 May 2021 12:57:24 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FgsBV6plsz4sDH; Thu, 13 May 2021 12:57:22 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-vk1-f179.google.com with SMTP id s131so5401274vka.11; Thu, 13 May 2021 05:57:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5lCNdadkVY2QcEWEbMojHp8qJ6XjzD/ef3rf2qx1zlM=; b=shP/VDP4vdRS1TszOCZ05Bhqp6ZOfSnzE90DKW1aRfhtHVbqcwyHrq/fZ1nfdzhJaU GnbBD9J6BcL9UjXwM6zL3qtVYmJw8+Sfi751oQ4qxAXlAu1PS7MaOAz8Do9tutI6PcGn t0KdzVxkYQl1bhsX4gf7mPcqJ3Bzqeme7hsfOUSDop9AyeC7+kzTjRwn+vl6b+fAC0vR S88X8Smda2tsZJaXkU/SycjCpCAqB5wxOr4bS1qGim4kEY45pjEie89kIogv8xCpNxYL 2T+r3Q3FShmN4Y4URndjvYYVXMIHMNf2fFdq5DhtfeE7xy4fMkQafj3HJHpRLzdxF79q m+gg== X-Gm-Message-State: AOAM5308qb0VFvYgfRvGV/m3Jl5izqAXOePFoUePhdCBTupSgOvc8lpZ Vlwi+3d/5gx2PLuysfFZ/ktkf6ODPLYHZsyZj3M= X-Google-Smtp-Source: ABdhPJwN6ybTl6k1J61MMRKCs7ALY5GwX0R6vpkWv5kjuuy7M31dhtJWIW0lPKXx1F7yfY4PIIr87tGSVCJ5swFLT9A= X-Received: by 2002:a1f:aecf:: with SMTP id x198mr33532983vke.6.1620910641780; Thu, 13 May 2021 05:57:21 -0700 (PDT) MIME-Version: 1.0 References: <91e21d18a4214af4898dd09f11144493@EX16-05.ad.unipi.it> <5cdff6ae35a8482a96a4fb40d5bff034@EX16-05.ad.unipi.it> In-Reply-To: <5cdff6ae35a8482a96a4fb40d5bff034@EX16-05.ad.unipi.it> From: Luigi Rizzo Date: Thu, 13 May 2021 14:57:10 +0200 Message-ID: Subject: Re: Vector Packet Processing (VPP) portability on FreeBSD To: Francois ten Krooden Cc: Luigi Rizzo , Vincenzo Maffione , "freebsd-net@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4FgsBV6plsz4sDH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of rizzounipi@gmail.com designates 209.85.221.179 as permitted sender) smtp.mailfrom=rizzounipi@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[rizzo@iet.unipi.it,rizzounipi@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[rizzo@iet.unipi.it,rizzounipi@gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.221.179:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[unipi.it]; SPAMHAUS_ZRD(0.00)[209.85.221.179:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.179:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.179:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net] X-Mailman-Approved-At: Thu, 13 May 2021 17:39:12 +0000 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 May 2021 12:57:24 -0000 On Thu, May 13, 2021 at 1:27 PM Francois ten Krooden wrote: > > > On Thursday, 13 May 2021 13:05 Luigi Rizzo wrote: > > > > On Thu, May 13, 2021 at 10:42 AM Francois ten Krooden > > wrote: > > > > > > Hi > > > > > > Just for info I ran a test using TREX (https://trex-tgn.cisco.com/) > > > Where I just sent traffic in one direction through the box running FreeBSD > > with VPP using the netmap interfaces. > > > These were the results we found before significant packet loss started > > occuring. > > > +-------------+------------------+ > > > | Packet Size | Throughput (pps) | > > > +-------------+------------------+ > > > | 64 bytes | 1.008 Mpps | > > > | 128 bytes | 920.311 kpps | > > > | 256 bytes | 797.789 kpps | > > > | 512 bytes | 706.338 kpps | > > > | 1024 bytes | 621.963 kpps | > > > | 1280 bytes | 569.140 kpps | > > > | 1440 bytes | 547.139 kpps | > > > | 1518 bytes | 524.864 kpps | > > > +-------------+------------------+ > > > > Those numbers are way too low for netmap. > > > > I believe you are either using the emulated mode, or issuing a system call on > > every single packet. > > > > I am not up to date (Vincenzo may know better) but there used to be a sysctl > > variable to control the operating mode: > > > > https://www.freebsd.org/cgi/man.cgi?query=netmap&sektion=4 > > > > SYSCTL VARIABLES AND MODULE PARAMETERS > > Some aspects of the operation of netmap and VALE are controlled > > through > > sysctl variables on FreeBSD (dev.netmap.*) and module parameters on > > Linux > > (/sys/module/netmap/parameters/*): > > > > dev.netmap.admode: 0 > > Controls the use of native or emulated adapter mode. > > > > 0 uses the best available option; > > > > 1 forces native mode and fails if not available; > > > > 2 forces emulated hence never fails. > > > > If it still exists, try set it to 1. If the program fails, then you should figure out > > why native netmap support is not compiled in. > > Thank you. I did set this to 1 specifically now and it still works. So then it should be running in native mode. > > I will dig a bit into the function that processes the incoming packets. > The code I currently use was added to VPP in somewhere before 2016, so it might be that there is a bug in that code. Then try to instrument the code and see how many packets you are getting on every RXSYNC system call. If the value is mostly/always 0-1 then there is some bug with the (user) code that frees slots in the queue. cheers luigi > > Will try and see if I can find anything interesting there. > > > > > cheers > > luigi > > > > > > Important Notice: > > This e-mail and its contents are subject to the Nanoteq (Pty) Ltd e-mail legal notice available at: > http://www.nanoteq.com/AboutUs/EmailDisclaimer.aspx -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------