From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796222303; b=27VkLlQlxIVy+C00FsZeFORuIOtS/wFaGKq/cUiEtRLBUxSU4ayW2Rrzp4H+Hyi9+Ufr UCtF7J1swweaG7V9zIGvu2iXKMoqjtkGTh/pBCtM6wwFzaymP2GDWhtd885R/Wz5wJ3F6 c66EQ8y8psHS2hkgRL+HKnSTQ4IZ/bQ7/eawfWIoIkHJnM2ROuTnN7ZtlahhwXLaHbMX6 gdRsZPSSJ090paGhPxstjB+lTReoZjI5YurlElA9Neq5EWjCuSB7d4xx3GwJNZX/N5TEe zsriC0ltEPE7+6EcpX3OwuWmium7xbP/LLki09KNKiPUDmTIv2H9LXZLQHk5zUZRjUg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796222303; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=BiblagAwWZVB0nD9tdwa/5kPhDVbVwcAuWR1i5HUtwo=; b=l60JoU1Q7+p1YpWJUPMlXfleopRMbYiphYFp2QlGONmA7hxyMIikIKl3dLd1txUK8WtH EOMP4gIIGwi2aNbFKJUnCRXu8NAwTWQpOHYsw4VzFqWOK6S2xk4/CcwF0SDgv70RPctZ3 b0ePexwgfuHGpvSd9NVRtOQM/f2qqjNGKjqlBukykss6w4+tLmxFPYHuxgjMkFdF2Fc0P O11lUwHwbA1M6rOAaJzFFqPCNepBzkgrd8WrAB1YCGLWbN1bHCEp7L9q4XvdcEE/GKuk5 7vR3XAW+sfmeSp9DsECM8ztjUkU1fuFyaxvehFrCB1C632cE0sEQ+Irdb/D6/bRT9Mw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mVyZh768; arc=none smtp.remote-ip=95.215.58.47 Received: from mta1.migadu.com (out-47.mta1.migadu.com [95.215.58.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE71C606A31A for ; Wed, 2 Dec 2026 14:38:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BE71C606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mVyZh768 X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=vDVYh+sDBLKKVILHwWc8ElGwjc9r3a0YtDfDU0NiJfg=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796222301; v=1; x=1796827101; b=mVyZh768XDFGf3UtnCgxZiTdHNsGKeXdUOoO+7CDjvnfBemXOgdyjOR1I/WXL3/zA5JMVcxC k060URiumZ5UeZySvNdph9es1a/UqGtFzbaGaG0YOfGWeI52YDIlW/hu9ozzugvE2mQD0kZ9u0e xkz32YKAqaxPTB3HjZFvdznA= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 99f7f8f5c063dc27; Wed, 02 Dec 2026 14:38:20 +0000 X-Mizu-Trace-ID: 99f7f8f5c063dc27 X-Migadu-Flow: FLOW_OUT From: Jiayuan Chen To: bpf@vger.kernel.org Cc: Jiayuan Chen , John Fastabend , Jakub Sitnicki , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Simon Horman , Kuniyuki Iwashima , Neal Cardwell , Andrii Nakryiko , Eduard Zingerman , Ihor Solodrai , Alexei Starovoitov , Daniel Borkmann , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Shuah Khan , Sechang Lim , Mattia Meleleo , Michal Luczaj , Zijian Zhang , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH bpf v3 8/9] selftests/bpf: Fix errno expected by the wait send mem test of test_sockmap Date: Wed, 2 Dec 2026 22:30:47 +0800 Message-ID: <20261202143337.400831-9-jiayuan.chen@linux.dev> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261202143337.400831-1-jiayuan.chen@linux.dev> References: <20261202143337.400831-1-jiayuan.chen@linux.dev> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The test closes the redirect target while the sender waits for its send memory. A part of the data has gone out, so sendmsg() returns that part and the test calls sendmsg() again. With apply_bytes, the previous patch keeps the verdict for the bytes that were not sent. The next sendmsg() sends to the same target and returns -EPIPE, instead of running the prog again, which no longer finds the target in the map and returns SK_DROP, -EACCES. Accept -EPIPE as well. Signed-off-by: Jiayuan Chen --- tools/testing/selftests/bpf/test_sockmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index aaf2050e8845..771146268df7 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c @@ -566,7 +566,8 @@ static int msg_loop(int fd, int iov_count, int iov_length, int cnt, sent = sendmsg(fd, &msg, flags); if (!drop && sent < 0) { - if (opt->tx_wait_mem && errno == EACCES) { + if (opt->tx_wait_mem && + (errno == EACCES || errno == EPIPE)) { errno = 0; goto out_errno; } -- 2.43.0