From patchwork Tue Jan 30 03:51:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Safonov X-Patchwork-Id: 193829 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp983594dyb; Mon, 29 Jan 2024 19:52:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWF6jfUU/YMA+Zyc8INOluufmy27TvHWWG7mi67ysdmNfnZLQy3XS9JnB8Ia6WCJu0dO9v X-Received: by 2002:ac8:5e0b:0:b0:42a:7035:27e1 with SMTP id h11-20020ac85e0b000000b0042a703527e1mr10064457qtx.46.1706586768312; Mon, 29 Jan 2024 19:52:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706586768; cv=pass; d=google.com; s=arc-20160816; b=R5jeITkgw2k+oQ3fztAJK7/dWFPfDyfnGWkJdetQu4Weu0tHDeo2PyQDY7IRwox60S ZO5FbBiEXCJXxWeF7yEeaZeEQb/HitUYJ5GtWBnzdaFNCsy5weRepXc35ghZe8up6Yy2 +Jlm8wM5pEJhP0d4tMlMAyK2QuSbvyFCzT1iLFtsr/9d/7YUH4SmYpxtsyUYzUuBvMb1 aSYG7Sbck06bxtNWK28INyMyMY0wZqCzbGPknAFUGBm9P2Zm1NJ8px2oCoD9+D6nT8pg +AbCshbQyI29FjMqCQTH3MXEDrxwWH5ULtND/22nfRuG8Lz+oPFk1M0VELvYOYJ9WeeU XMdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=IBB0GD/+gXda5aeiB3X+LkFjStia1JqAQuf0Qc5+FME=; fh=uuYKeLeXbqJGZoGIz60yVjwWAOb2l0qc7NtFkAbukeo=; b=tdOsm+rkpzToo+B6y3+5nvSw/fYS0fEEwiE59dK/3Kb/HL0WFTI3unjXLDPMdlXmDi C8ierVF8ezdNA0s9GW1Cor0/pKgUGPEFtFXU2fThxZAdXNwvYTIr4vaQa8wOsd4qZy23 7tOQ1oJ1auia0Io2sFul1hyyctHYdhbaz+/4k2dTaDROhgLqMr8DHNtrFPWOoJXKJTlL 28Zcjj5P4StQT9bdjFZhpsYlzQwPDY/0dWrfw5hVU+l4PGkUop/BIyFe+K/s9AEoivFm yTuO+CV4f2V2XU0sM23ZqRQE/jywGqrIRyZoNzq5AIuzMVqcFda7H5vpjpwKi58I7utS wv3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=DKBNEd5N; arc=pass (i=1 spf=pass spfdomain=arista.com dkim=pass dkdomain=arista.com dmarc=pass fromdomain=arista.com); spf=pass (google.com: domain of linux-kernel+bounces-43917-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43917-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b22-20020a05620a119600b00783312ced4esi2323674qkk.490.2024.01.29.19.52.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 19:52:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43917-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=DKBNEd5N; arc=pass (i=1 spf=pass spfdomain=arista.com dkim=pass dkdomain=arista.com dmarc=pass fromdomain=arista.com); spf=pass (google.com: domain of linux-kernel+bounces-43917-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43917-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1ADC61C24A9F for ; Tue, 30 Jan 2024 03:52:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE9C0383A8; Tue, 30 Jan 2024 03:52:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arista.com header.i=@arista.com header.b="DKBNEd5N" Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE8CC376EA for ; Tue, 30 Jan 2024 03:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706586724; cv=none; b=Ur8BqXEf2A65mnyBGMj0h4ROG7D3tDQTIVlV3sRWd3V8k8D0pA0f/j3SvyH2AV2OopQiubzPRRneNFSfku5NCYnIBwQDQm1C8k1QPqYU74SLaqHJMgSnJ0KPJwrJkGUIneTsouMS7Zp8BknicbHYRhG8UTepfanuNmHf1gMhRpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706586724; c=relaxed/simple; bh=g3LZEPq6heJ2PjzSdX/5RGenjQC82aVAzQinn15OdBU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JEBdQ7RP/cnecnx/JvRkjNI2e9vu1xk2GtZ3HzH4peVlkvvNS9Ty5+o/SHpLC122jcZ4J+BbRU6OCyYju0hLXXypLSDNHiGHma8aaANTHxB/inItrJimJP1jVkQfVSy6zQttBvN0bV6Rtpd5JOjwaYiWDQmZ4DyVpxCRR900B9U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=arista.com; spf=pass smtp.mailfrom=arista.com; dkim=pass (2048-bit key) header.d=arista.com header.i=@arista.com header.b=DKBNEd5N; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=arista.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arista.com Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40f02b8d176so1215175e9.1 for ; Mon, 29 Jan 2024 19:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; t=1706586721; x=1707191521; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IBB0GD/+gXda5aeiB3X+LkFjStia1JqAQuf0Qc5+FME=; b=DKBNEd5NyO1LzWKUkgp61coQZ+2+d7CTpQzs5a/uQEuxa21S3RdpMKuffZ1yCeHRWS htCLIEgjwpvKgOrsggpt6cW+ia5bREhdbEdA66U3QIG+P4JB8tWSDv5MZLbs7LWCtaSj IBIJ6fQ7liOBIdr0F3pGQUSv3LpbLECJsNiRTLlvXLf0kCw5ijDJQOJvE7FZEAbly7Gu NEf05K/gCCqpC9lna5sePVq1HpRW1lMfXnH7aYMTm6nflmQvef95oVDuLm4TbX4H8dK3 rIAO6nk5maVdWmceQ0IOIP02xTtdtYt8CD157KY4O3nDOFx/jX9VThQW62aHHtaQhf+Q xwfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706586721; x=1707191521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IBB0GD/+gXda5aeiB3X+LkFjStia1JqAQuf0Qc5+FME=; b=KMB8jNuZCPzxLPTdh7wUuU/7zvclboallpoMjkGy+ReYQocROFw27ImD56b4/UjVML bLO05IJEevWIjIN0rBMXtCYEwpMXNFFPJ2n2o/jf6anvxdxWGe7YUwd/aYo4vf+3rm10 kUDXTm3iVEatXd8UB1FpMrRzwKg5WsBaF61Q67CSA2ia7y/nqcgrV83O/RNDWr1HmxLF umotvLHxeRpkXDcUFOinsFPFbgyvyLsUGCtF9jIygUpSYMh/sVGoIlDIGdyrdyzxHjuW mo7uttuL1JOfUlWHCtTHz2baCmohFThwYZ1d9lQOEuTLprdEhO8dDjlMXhJcrRLpjBYu zhWg== X-Gm-Message-State: AOJu0Yx1FAyGrirCau5ROTNKq3it44a4HRD2L4w0NOOukCT7lyo11yZI cPMkKUZg+gRFn5T8ZYPd00cRKlDuhEQVRn2/mVrWsa1F/bd95GrJQgEPT5kQEA== X-Received: by 2002:a5d:64e3:0:b0:33a:e9cc:69b0 with SMTP id g3-20020a5d64e3000000b0033ae9cc69b0mr4114355wri.11.1706586721013; Mon, 29 Jan 2024 19:52:01 -0800 (PST) Received: from Mindolluin.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id ay13-20020a5d6f0d000000b00337d6aa3912sm9513207wrb.10.2024.01.29.19.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 19:52:00 -0800 (PST) From: Dmitry Safonov To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Dmitry Safonov <0x7f454c46@gmail.com> Cc: Dmitry Safonov , Mohammad Nassiri , Simon Horman , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] selftests/net: Argument value mismatch when calling verify_counters() Date: Tue, 30 Jan 2024 03:51:52 +0000 Message-ID: <20240130-tcp-ao-test-key-mgmt-v2-1-d190430a6c60@arista.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240130-tcp-ao-test-key-mgmt-v2-0-d190430a6c60@arista.com> References: <20240130-tcp-ao-test-key-mgmt-v2-0-d190430a6c60@arista.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.13-dev-b6b4b X-Developer-Signature: v=1; a=ed25519-sha256; t=1706586711; l=1578; i=dima@arista.com; s=20231212; h=from:subject:message-id; bh=oDDbsLWpXr1cc2nzkZ+D8Lfqh5gwTIMhKVDrcVIHxuQ=; b=wOh80+80UVdeb8USEOeN8k210twHOJCkW6S4WeORL7Duxc0gwL3jIHLaEP1GvAkoXjSqJR4Na lIWOvijjVxnDjPY1gZnOmWexs8GlGDerBeQ8uimxPHJH2DCcgQRSp8y X-Developer-Key: i=dima@arista.com; a=ed25519; pk=hXINUhX25b0D/zWBKvd6zkvH7W2rcwh/CH6cjEa3OTk= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789485927194918014 X-GMAIL-MSGID: 1789485927194918014 From: Mohammad Nassiri The end_server() function only operates in the server thread and always takes an accept socket instead of a listen socket as its input argument. To align with this, invert the boolean values used when calling verify_counters() within the end_server() function. As a result of this typo, the test didn't correctly check for the non-symmetrical scenario, where i.e. peer-A uses a key <100:200> to send data, but peer-B uses another key <105:205> to send its data. So, in simple words, different keys for TX and RX. Fixes: 3c3ead555648 ("selftests/net: Add TCP-AO key-management test") Signed-off-by: Mohammad Nassiri Link: https://lore.kernel.org/all/934627c5-eebb-4626-be23-cfb134c01d1a@arista.com/ [amended 'Fixes' tag, added the issue description and carried-over to lkml] Signed-off-by: Dmitry Safonov --- tools/testing/selftests/net/tcp_ao/key-management.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/tcp_ao/key-management.c b/tools/testing/selftests/net/tcp_ao/key-management.c index c48b4970ca17..f6a9395e3cd7 100644 --- a/tools/testing/selftests/net/tcp_ao/key-management.c +++ b/tools/testing/selftests/net/tcp_ao/key-management.c @@ -843,7 +843,7 @@ static void end_server(const char *tst_name, int sk, synchronize_threads(); /* 4: verified => closed */ close(sk); - verify_counters(tst_name, true, false, begin, &end); + verify_counters(tst_name, false, true, begin, &end); synchronize_threads(); /* 5: counters */ }