From owner-freebsd-net@freebsd.org Mon Jun 1 16:23:07 2020 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 8A61A33B2DB for ; Mon, 1 Jun 2020 16:23:07 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49bL7b354xz4Cgs for ; Mon, 1 Jun 2020 16:23:07 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 5FF67112AD for ; Mon, 1 Jun 2020 16:23:07 +0000 (UTC) (envelope-from vmaffione@freebsd.org) Received: by mail-qk1-f176.google.com with SMTP id c185so9596513qke.7 for ; Mon, 01 Jun 2020 09:23:07 -0700 (PDT) X-Gm-Message-State: AOAM530tDbJ59+z5BmJQ1TjBKM5uuoH8Rw862oIeW0iPQdzIVYhAg8+G B5AXSldvUYILIqDCObg0QGCHAUgBaeTZroWpDJY= X-Google-Smtp-Source: ABdhPJz8ury/8L+DyWl9P0pEGd71ccQj5ObtFcOPolMAT6GXX0zIHMxzu4MA+24tZkUVJGPDSQpx8bxKwYX0pkIGcyQ= X-Received: by 2002:a37:90c:: with SMTP id 12mr20009289qkj.96.1591028586867; Mon, 01 Jun 2020 09:23:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Vincenzo Maffione Date: Mon, 1 Jun 2020 18:22:55 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Netmap - Vale switch - tcp problem To: Anthony Arnaud Cc: Luigi Rizzo , "freebsd-net@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2020 16:23:07 -0000 Hi Anthony, I think there is more than a bug, drivers-related, that show up when you attach the interface to a vale switch. I've found and fixed some related to if_vtnet (see below). In any case, in my tests there is no difference between TCP traffic and other (UDP, ICMP, STP,...). The issues are not related to LRO, as I thought. There are still more bugs in vtnet and I'm trying to chase them. In the meanwhile it would help if you apply the patches below and try again with vtnet to see if the situation improves. They apply cleanly to 12.1 release. Regarding your problem with em devices, it is probably yet a different issue. It may be related to the iflib transition or not. It would help to try the same setup on stable/11 (which does not have iflib). I don't have an em device, but I will try with an emulated em in QEMU/KVM. Cheers, Vincenzo ------------------------------------------------------------------------ r361698 | vmaffione | 2020-06-01 16:14:29 +0000 (Mon, 01 Jun 2020) | 8 lines netmap: if_vtnet: avoid netmap ring wraparound netmap assumes the one "slot" is left unused to distinguish the empty ring and full ring conditions. This assumption was violated by vtnet_netmap_rxq_populate(). MFC after: 1 week ------------------------------------------------------------------------ r361697 | vmaffione | 2020-06-01 16:12:09 +0000 (Mon, 01 Jun 2020) | 8 lines netmap: if_vtnet: replace vtnet_free_used() The functionality contained in this function is duplicated, as it is already available in vtnet_txq_free_mbufs() and vtnet_rxq_free_mbufs(). MFC after: 1 week ------------------------------------------------------------------------ r361696 | vmaffione | 2020-06-01 16:10:44 +0000 (Mon, 01 Jun 2020) | 13 lines netmap: vtnet: fix RX virtqueue initialization bug The vtnet_netmap_rxq_populate() function erroneously assumed that kring->nr_hwcur = 0, i.e. the kring was in the initial state. However, this is not always the case: for example, when a vtnet reinit is triggered by some changes in the interface flags or capenable. This patch changes the behaviour of vtnet_netmap_kring_refill() so that it always starts publishing the netmap buffers starting from the current value of kring->nr_hwcur. MFC after: 1 week ------------------------------------------------------------------------ Il giorno lun 1 giu 2020 alle ore 15:19 Anthony Arnaud < antho.arnaudisce@gmail.com> ha scritto: > Hi Vincenzo, > > To simplify the scenario I have installed from scratch FBSD12.1 on a new > machine, without any virtualization env. > I have encountered the same problem, when i attach an ethernet interface > to vale switch (in this case an intel card em5) the tcp traffic disappears > and tcpdump shown only udp, icmp6 and stp packets. > If I detach the NIC from vale0 tcpdump shown all tcp traffic. > I'm using the netmap version included in FBSD 12.1, and I have compiled > vale-ctl presents in kernel sources (/src/tools/tools/netmap/) > I executed your steps. > There is something dark about that behaviour... > > Cheers > Anthon > >