From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E0CD29CE7 for ; Mon, 26 Aug 2024 04:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724645132; cv=none; b=F3VzjBl2gCYel+DHgEJzR+vMRFOLD7rD8F+qwnxKG+p/R0wqWG/49drbXEmRJoDP/vWlZ1mHAP9afRhcrql4Icc3Ad7S9tldusIM8nTROfhrop7IGigAgDTlMpbk2dIvCbk9SH+gYilJIKWwYCWldVdXU35TBR6I9q3wUzavPF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724645132; c=relaxed/simple; bh=P7pkvocGjCUi4oDZDHORsy7qFuaIh9Gro0pnbZXyMDg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N4+QOEs1RMgw8y31cSTO/Atogy+p2UK4hQUEaw4bzXcpuy+Ye1Ol6jc4w8FHXlEI430jX6x+8ALqX8UcBm2O9GL0lMHS6nf8zHZMn4UkSLzFWQv6kdN4HPYw0VaXYlKNvNKRcHdWlmXbNr7LdwLG1y7C4sK6OG+SuJdbSzqx0XM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ZkoQRTdX; arc=none smtp.client-ip=95.215.58.187 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) header.d=linux.dev header.i=@linux.dev header.b="ZkoQRTdX" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724645127; 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=P7pkvocGjCUi4oDZDHORsy7qFuaIh9Gro0pnbZXyMDg=; b=ZkoQRTdXydQjcRgl6MvaTBSrwgG91rMtf45oAabydvvNO1qpwgvBQt/pUNJVs0WsSNpvNi NznfAsjPz9/jfFuVAB6qVYdRaAtepVC/gI315LlXLgQEhzyR4D7Yoaljp/beA9YlhIaUl9 ZyWq1CXuCQ0jSVcTofppeHkzgY1g774= Date: Sun, 25 Aug 2024 21:05:19 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next] bpf: Allow error injection for update_socket_protocol Content-Language: en-GB To: Gang Yan , Alexei Starovoitov Cc: netdev@vger.kernel.org, bpf@vger.kernel.org References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 8/25/24 8:29 PM, Gang Yan wrote: > Hi Alexei: > It's my honor to recieve your reply. The response to your concerns is attached below > for your review. > On Mon, Aug 26, 2024 at 10:57:12AM +0800, Gang Yan wrote: >> On Thu, Aug 22, 2024 at 8:33 AM Jakub Kicinski wrote: >>> On Thu, 22 Aug 2024 14:08:57 +0800 Gang Yan wrote: >>>> diff --git a/net/socket.c b/net/socket.c >>>> index fcbdd5bc47ac..63ce1caf75eb 100644 >>>> --- a/net/socket.c >>>> +++ b/net/socket.c >>>> @@ -1695,6 +1695,7 @@ __weak noinline int update_socket_protocol(int family, int type, int protocol) >>>> { >>>> return protocol; >>>> } >>>> +ALLOW_ERROR_INJECTION(update_socket_protocol, ERRNO); >>> IDK if this falls under BPF or directly net, but could you explain >>> what test will use this? I'd prefer not to add test hooks into the >>> kernel unless they are exercised by in-tree tests. >> This looks unnecessary. >> update_socket_protocol is already registered as fmodret. >> There is even selftest that excises this feature: >> tools/testing/selftests/bpf/progs/mptcpify.c >> >> It doesn't need to be part of the error-inject. > The 'update_socket_protocol' is a BPF interface designed primarily to > fix the socket protocol from TCP protocol to MPTCP protocol without > requiring modifications to user-space application codes. However, > when attempting to achieve this using the BCC tool in user-space, > the BCC tool doesn't support 'fmod_ret'. Therefore, this patch aims to > further expand capabilities, enabling the 'kprobe' method can overriding > the update_socket_protocol interface. Gang Yan, could you explore to add fmod_ret support in bcc? It should be similar to kfunc/kretfunc support. I am happy to review your patches. Thanks, Yonghong > > As a Python developer, the BCC tool is a commonly utilized instrument for > interacting with the kernel. If the kernel could permit the use of an > error-inject method to modify the `update_socket_protocol`, it would significantly > benefit the subsequent promotion and development of MPTCP applications. > Thank you for considering this enhancement. > > Best wishes! > Gang Yan > >