From patchwork Thu Apr 9 13:29:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kleber Sacilotto de Souza X-Patchwork-Id: 1268592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48yhnn4f81z9sT5; Thu, 9 Apr 2020 23:29:13 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jMXEz-0000UV-In; Thu, 09 Apr 2020 13:29:09 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jMXEx-0000U3-Ka for kernel-team@lists.ubuntu.com; Thu, 09 Apr 2020 13:29:07 +0000 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jMXEx-0004wM-Cd for kernel-team@lists.ubuntu.com; Thu, 09 Apr 2020 13:29:07 +0000 Received: by mail-wr1-f69.google.com with SMTP id w12so6324483wrl.23 for ; Thu, 09 Apr 2020 06:29:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MiXKrvGy4aHjTPBjRz+tAB0clzo42Ud8lO6tu9b/mcU=; b=mdzq4X8QkfUyHdFjRJ4uwyaQTqM/2c0Qj+dJ7Nb7bf882+5D4nyryRuBqHrHra1SrB 25UbvxX556oKBlArG7cIcjKYupXpkIlkXDwXHCMg/VFZ4Sj4Kcm0cQfuteSh1NLTSeGm 5ICTFq9cd17znWLLL6W+rJoOYYDehvtOE+5pQaBvSzjbD/uEO6SxvSm+IbWC9cxQOJSX vYQpCQYs8oDM+T4ksAjIG8WZZ/gOVXdUUYrcpaN8+hGmDQ/Pnm/YaEQVVs3PdvbR3UH3 u22O9mYRRL+V0tL2/aBREeFvm10dghzUSAX2TYCLdrWGuNMYhXRQPR2KWLXqOtB1Z5O5 umig== X-Gm-Message-State: AGi0PuYa+YJP1tb47FXSXF/BDK0AFxES2EUutBuOWAY9MNTjXb+0NQxa gmRqgJvhqMLaNNscSYsYJL8zJG873Jxc6ZR3RmLkVo8LcSMJ74/ZdCgoys0Hhy2pVXc2wN5IHEd ut0KHVKv2PINHGjtoHh7EtxUe9yIPSwXQp71GUKUVrg== X-Received: by 2002:a1c:ed1a:: with SMTP id l26mr10050356wmh.175.1586438946823; Thu, 09 Apr 2020 06:29:06 -0700 (PDT) X-Google-Smtp-Source: APiQypI5brM4WsYkPct/VjKXzbqkfEgf5XubTLSxnlt7VodZLDwjO+8o8bP7/Mt0aUXb1M+sSk+u7g== X-Received: by 2002:a1c:ed1a:: with SMTP id l26mr10050345wmh.175.1586438946582; Thu, 09 Apr 2020 06:29:06 -0700 (PDT) Received: from localhost (ip5f5aeb72.dynamic.kabel-deutschland.de. [95.90.235.114]) by smtp.gmail.com with ESMTPSA id z3sm3395050wma.22.2020.04.09.06.29.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 06:29:06 -0700 (PDT) From: Kleber Sacilotto de Souza To: kernel-team@lists.ubuntu.com Subject: [SRU][E][PATCH 2/2] UBUNTU: SAUCE: Revert "selftests/bpf: Test freeing sockmap/sockhash with a socket in it" Date: Thu, 9 Apr 2020 15:29:01 +0200 Message-Id: <20200409132901.4802-3-kleber.souza@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409132901.4802-1-kleber.souza@canonical.com> References: <20200409132901.4802-1-kleber.souza@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1871613 This reverts commit 7c57edd8018e70b4faebf0569a1fa3f35a21829c which is commit 5d3919a953c3c96c02fc7a337f8376cde43ae31f upstream. This commit has been backported to eoan/linux from v5.4.20 upstream stable, however due to missing dependencies prog_tests/sockmap_basic. can't be compiled: prog_tests/sockmap_basic.c: In function 'connected_socket_v4': prog_tests/sockmap_basic.c:22:6: warning: implicit declaration of function 'CHECK_FAIL' [-Wimplicit-function-declaration] 22 | if (CHECK_FAIL(s == -1)) | ^~~~~~~~~~ prog_tests/sockmap_basic.c:26:22: error: 'SOL_TCP' undeclared (first use in this function); did you mean 'SOL_TIPC'? 26 | err = setsockopt(s, SOL_TCP, TCP_REPAIR, &repair, sizeof(repair)); | ^~~~~~~ | SOL_TIPC prog_tests/sockmap_basic.c:26:22: note: each undeclared identifier is reported only once for each function it appears in prog_tests/sockmap_basic.c: In function 'test_sockmap_basic': prog_tests/sockmap_basic.c:75:6: warning: implicit declaration of function 'test__start_subtest' [-Wimplicit-function-declaration] 75 | if (test__start_subtest("sockmap create_update_free")) | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Kleber Sacilotto de Souza --- .../selftests/bpf/prog_tests/sockmap_basic.c | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 tools/testing/selftests/bpf/prog_tests/sockmap_basic.c diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c deleted file mode 100644 index 07f5b462c2ef..000000000000 --- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -// Copyright (c) 2020 Cloudflare - -#include "test_progs.h" - -static int connected_socket_v4(void) -{ - struct sockaddr_in addr = { - .sin_family = AF_INET, - .sin_port = htons(80), - .sin_addr = { inet_addr("127.0.0.1") }, - }; - socklen_t len = sizeof(addr); - int s, repair, err; - - s = socket(AF_INET, SOCK_STREAM, 0); - if (CHECK_FAIL(s == -1)) - goto error; - - repair = TCP_REPAIR_ON; - err = setsockopt(s, SOL_TCP, TCP_REPAIR, &repair, sizeof(repair)); - if (CHECK_FAIL(err)) - goto error; - - err = connect(s, (struct sockaddr *)&addr, len); - if (CHECK_FAIL(err)) - goto error; - - repair = TCP_REPAIR_OFF_NO_WP; - err = setsockopt(s, SOL_TCP, TCP_REPAIR, &repair, sizeof(repair)); - if (CHECK_FAIL(err)) - goto error; - - return s; -error: - perror(__func__); - close(s); - return -1; -} - -/* Create a map, populate it with one socket, and free the map. */ -static void test_sockmap_create_update_free(enum bpf_map_type map_type) -{ - const int zero = 0; - int s, map, err; - - s = connected_socket_v4(); - if (CHECK_FAIL(s == -1)) - return; - - map = bpf_create_map(map_type, sizeof(int), sizeof(int), 1, 0); - if (CHECK_FAIL(map == -1)) { - perror("bpf_create_map"); - goto out; - } - - err = bpf_map_update_elem(map, &zero, &s, BPF_NOEXIST); - if (CHECK_FAIL(err)) { - perror("bpf_map_update"); - goto out; - } - -out: - close(map); - close(s); -} - -void test_sockmap_basic(void) -{ - if (test__start_subtest("sockmap create_update_free")) - test_sockmap_create_update_free(BPF_MAP_TYPE_SOCKMAP); - if (test__start_subtest("sockhash create_update_free")) - test_sockmap_create_update_free(BPF_MAP_TYPE_SOCKHASH); -}