From patchwork Thu Apr 29 19:40:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valerio X-Patchwork-Id: 1471838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GmFyYpqQ; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FWQq03tf9z9sj0 for ; Fri, 30 Apr 2021 05:41:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D76EF419D4; Thu, 29 Apr 2021 19:41:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ciiD4f3OXXsI; Thu, 29 Apr 2021 19:41:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTP id 194744013A; Thu, 29 Apr 2021 19:41:12 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EDF98C000E; Thu, 29 Apr 2021 19:41:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 38CB9C0001 for ; Thu, 29 Apr 2021 19:41:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1189B419C3 for ; Thu, 29 Apr 2021 19:41:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3WfToYnfU7-f for ; Thu, 29 Apr 2021 19:41:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id DA6164013A for ; Thu, 29 Apr 2021 19:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619725268; 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; bh=g5Ut7bqwwNKrPsgisnbfK8HceXFAagn1/QEiP/NHFSw=; b=GmFyYpqQviClmkOUR++TnOqFZQpc9QdPcX+nrTPliAtsS9BBBFaIEo3S++WOcujwSj29Ep kBh8eq36uLpqfeppucVhXV8avR1C7gawp3EuD2JZ0bMiKp8Caxbe7HWJuVAdwqvBILWwvd Zo8nbszLpleLhVwIRt/ToK9IT2aq88g= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-80iqKwFWNQeKGeFfsDAkjQ-1; Thu, 29 Apr 2021 15:41:06 -0400 X-MC-Unique: 80iqKwFWNQeKGeFfsDAkjQ-1 Received: by mail-ed1-f70.google.com with SMTP id g17-20020aa7dd910000b029038843570b67so547633edv.9 for ; Thu, 29 Apr 2021 12:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=g5Ut7bqwwNKrPsgisnbfK8HceXFAagn1/QEiP/NHFSw=; b=FNJrANMJFXcUxgA6ot9M1cyo0HmSTWVmkIJxWwPcT1eihHLBT23xzgLHtCCcAt3Ejv rsxjnOc+V2HISndhecApggvjUJ7p7Zro4mtMVctaa4VLKdESDyAcUruYfl6HS6nUItiQ sFSyCuSG633oldIfp8w1xkJ2QE48OTIUrT+H+MKkOIooN8eeA4z4CaRByYD9MdX5Dq7f g9rhztQpDsk/znNkPp7rvSWkGaBgBmmvW5Z5KeryXXPSi0Fn9n9FiKKaAMSwYCf1u1uV k93IPPHBBwktUj1/reCOAbAGmLQTzce+fcrTlkpxC0MeyQ7CSVc9Md5iTadd13nlr9gi dJYw== X-Gm-Message-State: AOAM531oNYO1Cd2BLMtuRE4fvOjCXhDlRooT4ezKgB5khc63B92R6szm gznNNpWygbWC+JoiRB7G5u9xx5yCQ6ZURtMGaaGgF9asLbHZzR/3nG7GD6qYDJQelLgKp0FGCOo IzR9Uz9cX+tV+9O4HH8CjSl1oyND3NDN/j6AEvQ5KkrdTCHYiku7PVVB/SX5+uhq0 X-Received: by 2002:a17:906:ece1:: with SMTP id qt1mr116656ejb.385.1619725265153; Thu, 29 Apr 2021 12:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws2Y+Cye5rQUpDRO/HXuPSifJGhiuiwJpOCqW7qjTxiYhWpo5uABQxaJBwTFuXZm7Y/1O7BQ== X-Received: by 2002:a17:906:ece1:: with SMTP id qt1mr116628ejb.385.1619725264890; Thu, 29 Apr 2021 12:41:04 -0700 (PDT) Received: from localhost (net-37-119-128-110.cust.vodafonedsl.it. [37.119.128.110]) by smtp.gmail.com with ESMTPSA id f19sm3020412edu.12.2021.04.29.12.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 12:41:04 -0700 (PDT) From: Paolo Valerio To: dev@openvswitch.org Date: Thu, 29 Apr 2021 21:40:59 +0200 Message-ID: <161972525935.137484.11611813153589197465.stgit@fed.void> User-Agent: StGit/0.23 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pvalerio@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH] conntrack: add coverage counters for L3 bad checksum X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" similarly to what we already have for L4, add conntrack_l3csum_err for the received packets with L3 bad checksum. Although, it basically covers IPv4, let's keep the name generic. Signed-off-by: Paolo Valerio Acked-by: Eelco Chaudron --- lib/conntrack.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/conntrack.c b/lib/conntrack.c index 99198a601..70cdcc12a 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -45,6 +45,7 @@ VLOG_DEFINE_THIS_MODULE(conntrack); COVERAGE_DEFINE(conntrack_full); COVERAGE_DEFINE(conntrack_long_cleanup); +COVERAGE_DEFINE(conntrack_l3csum_err); COVERAGE_DEFINE(conntrack_l4csum_err); struct conn_lookup_ctx { @@ -1613,6 +1614,7 @@ extract_l3_ipv4(struct conn_key *key, const void *data, size_t size, } if (validate_checksum && csum(data, ip_len) != 0) { + COVERAGE_INC(conntrack_l3csum_err); return false; } @@ -2051,6 +2053,7 @@ conn_key_extract(struct conntrack *ct, struct dp_packet *pkt, ovs_be16 dl_type, bool hwol_bad_l3_csum = dp_packet_ip_checksum_bad(pkt); if (hwol_bad_l3_csum) { ok = false; + COVERAGE_INC(conntrack_l3csum_err); } else { bool hwol_good_l3_csum = dp_packet_ip_checksum_valid(pkt) || dp_packet_hwol_is_ipv4(pkt);