From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VJZfmHsa; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id D51E25A0265 for ; Thu, 02 Apr 2026 17:33:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775143991; 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=CC2GQGf1ej6xSboAwsG54Br2DtbGrk0hOZO4xLfgrLU=; b=VJZfmHsawCj+cOOHWcO4nCMOf+PnMzJC2aOB8UXpITaL76vC2VGmaYicKKTEAoT0fNppMN PEAtsnp4ZlxrPHWOmHgbgSS/PqA0b7ea80kgx5zaa8I47BttnXejtRJuwvWaaYi+VpybLV qXf0arR946MriAuREvKbN5Gj9jCVFuY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-96-MO0OwoNCMBG_qfjLaqTNUA-1; Thu, 02 Apr 2026 11:33:10 -0400 X-MC-Unique: MO0OwoNCMBG_qfjLaqTNUA-1 X-Mimecast-MFC-AGG-ID: MO0OwoNCMBG_qfjLaqTNUA_1775143989 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-487219e0800so6879245e9.2 for ; Thu, 02 Apr 2026 08:33:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775143989; x=1775748789; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CC2GQGf1ej6xSboAwsG54Br2DtbGrk0hOZO4xLfgrLU=; b=AdqefMl4adVaSktbAFvWyMmMFvm/PRCL+BC+x/O/4YyYyaREMOkYCZKcTKkppuxrYL yFk3pRCWzZAS9h2znY3osJdAt2f6Gmo6eqzQJ7idnPO9BD9opkUeP11T1myq1UNkL5o+ oDr6X+enHs1a53NBd1TVsxIp8Vbj6w+qItpj4xIlaTq0748rnSMhKFbwdEssCpKVivKB IFp45CuSuh4fClQkFXveSW6QGCSGcoxWZJ5wNiT5dHE6dxZGJueMREbg83l5C+lJf4a/ nsp8OzRUCPD6a6FvvGexo7qRtXectB96mqPhjMBmKwZEIUmdGzVFlP8VrLkd8VYFpUD6 3Lmw== X-Forwarded-Encrypted: i=1; AJvYcCXdJ9fWlBUgguuI2wpLoL7eA6lCaFF6T1rTTzWDWPK55B/ip3dafz65zY3SeiXFDKdL0qdgaIRj4cQ=@passt.top X-Gm-Message-State: AOJu0YzUH/QbJqOVBD/7nZeYFbbLRBb0GX1EIHSS2OjLMLZM6ktUKR9k scBb382ab/gSUgG/n5zANo6R9qbx65eMkaJ3TDeSnCoatBm+bHHMCqhOhN32OQx7i8qAY+WzR9/ 1dJ5CcTVMrq93WNGwHcF0gUGOpBseLUyM/x/abcEkqTxyWWYKoJHrpA== X-Gm-Gg: ATEYQzwJmJ/yDlpcfRzoUK+merYpBItcUNKImHswi9Tngel+f4DMSP0XLnW/LJT+C/q SVI6NUTJjgxNmh9ves7zfhwS/uGg/7v/CAn9ZgF8Lnsobzfk+4bAwTV9ycWP6unVEg4yI2gd9O2 YBQeAhT7aVqm5H7XkXEMu/ezgTaKhslJtOkKJbmLBzoM9rgtA8mOFNX5WNLrYh7ETvEoI6kIsmA LzOwE1dMlB9awYzm0xZ3kH4D18g1GsAV/8RtkNj8vAU6j6BPnpE+LgojTkRyYXk/n2DjtvbfF0c hKd392GIDt/n2zclCO21t3Gx7NrROg+fpaU69B+9UPIhyB09sX9moDRBox38OL0/4auB09Beacq nKrX3zWZL87VqD1CPPh4QgQkw/QnKtps+4CEmKJF4dVgMFm0ZLA== X-Received: by 2002:a05:600c:354d:b0:485:3f65:94a1 with SMTP id 5b1f17b1804b1-48883597cb9mr136225845e9.18.1775143989110; Thu, 02 Apr 2026 08:33:09 -0700 (PDT) X-Received: by 2002:a05:600c:354d:b0:485:3f65:94a1 with SMTP id 5b1f17b1804b1-48883597cb9mr136224965e9.18.1775143988539; Thu, 02 Apr 2026 08:33:08 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4d282esm8723460f8f.18.2026.04.02.08.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2026 08:33:08 -0700 (PDT) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v1 2/2] tap, tcp, udp: Use rate-limited logging Message-ID: <20260402173306.6eee89b6@elisabeth> In-Reply-To: References: <20260401182910.669164-1-anskuma@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Thu, 02 Apr 2026 17:33:07 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: xy_ChVvhtiq8MCqdc-uAxiMgJw7_oVfURWKHIAq_CPA_1775143989 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 6ET6KUKJBN5T2U7R7EJVIXR3C4SJNPIW X-Message-ID-Hash: 6ET6KUKJBN5T2U7R7EJVIXR3C4SJNPIW X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Anshu Kumari , passt-dev@passt.top, david@gibson.dropbear.id.au X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 2 Apr 2026 17:10:12 +0200 Laurent Vivier wrote: > On 4/1/26 20:29, Anshu Kumari wrote: > > [...] > > > +++ b/tap.c > > @@ -686,17 +686,11 @@ static bool tap4_is_fragment(const struct iphdr *iph, > > const struct timespec *now) > > { > > if (ntohs(iph->frag_off) & ~IP_DF) { > > - /* Ratelimit messages */ > > - static time_t last_message; > > static unsigned num_dropped; > > > > num_dropped++; > > - if (now->tv_sec - last_message > FRAGMENT_MSG_RATE) { > > the #define FRAGMENT_MSG_RATE can be removed from the file as it is unused now. > > > - warn("Can't process IPv4 fragments (%u dropped)", > > - num_dropped); > > - last_message = now->tv_sec; > > - num_dropped = 0; > > - } > > + warn_ratelimit(now, "Can't process IPv4 fragments (%u dropped)", > > + num_dropped); > > I don't think we should keep the num_dropped value here as it is never reset, the > "suppressed %u similar messages" will give the information. Wait, that was actually my suggestion based on the previous patch: https://archives.passt.top/passt-dev/20260324210145.1f530a59@elisabeth/ reporting here for convenience: --- If you just drop "(%u dropped)", it will be pretty hard to understand the rate at which fragments are being sent: is it one per second or a thousand? That makes a difference while debugging things. I would suggest to keep the 'num_dropped' counter, keep printing the number (without zeroing it, because you don't know when to do it here), and yes, it will wrap eventually (become 0 again), but the wrapping should be very obvious, and it's better than having no indication at all. --- -- Stefano