From patchwork Wed Dec 2 21:31:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prankur gupta X-Patchwork-Id: 337603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 692C9C6369E for ; Wed, 2 Dec 2020 21:32:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 00EA5208FE for ; Wed, 2 Dec 2020 21:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730948AbgLBVcf (ORCPT ); Wed, 2 Dec 2020 16:32:35 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:56808 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729366AbgLBVcf (ORCPT ); Wed, 2 Dec 2020 16:32:35 -0500 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B2LQG3D020062 for ; Wed, 2 Dec 2020 13:31:54 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=facebook; bh=G1Y9hdvbK4qmmUhPaxvp/07XyNLgHhb2MpEGsGRireQ=; b=SbI4ZYF0leDFY+wFka9V9tzABq7CzVp0eIm/OZrok8Um9eonCmHWvu0lK7PSN6oVodRp DxAEmmU9U8m/d4AMVf+jFdHSYEEG5apBsVzyNrJwca4YFArge1lGYwl8leWjwYBABa5e FkkuW/cgQHln7JQqzvIGWH+zfff37+aCGsc= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 355wgw7uk9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2020 13:31:54 -0800 Received: from intmgw001.03.ash8.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 2 Dec 2020 13:31:53 -0800 Received: by devvm3178.ftw3.facebook.com (Postfix, from userid 201728) id 2485C476377B8; Wed, 2 Dec 2020 13:31:52 -0800 (PST) From: Prankur gupta To: CC: , Subject: [PATCH v4 bpf-next 0/2] Add support to set window_clamp from bpf setsockops Date: Wed, 2 Dec 2020 13:31:50 -0800 Message-ID: <20201202213152.435886-1-prankgup@fb.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-12-02_13:2020-11-30,2020-12-02 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 malwarescore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 adultscore=0 suspectscore=13 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012020130 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch contains support to set tcp window_field field from bpf setsockops. v2: Used TCP_WINDOW_CLAMP setsockopt logic for bpf_setsockopt (review comment addressed) v3: Created a common function for duplicated code (review comment addressed) v4: Removing logic to pass struct sock and struct tcp_sock together (review comment addressed) Prankur gupta (2): bpf: Adds support for setting window clamp selftests/bpf: Add Userspace tests for TCP_WINDOW_CLAMP include/net/tcp.h | 1 + net/core/filter.c | 3 ++ net/ipv4/tcp.c | 25 +++++++++----- tools/testing/selftests/bpf/bpf_tcp_helpers.h | 1 + .../selftests/bpf/prog_tests/tcpbpf_user.c | 4 +++ .../selftests/bpf/progs/test_tcpbpf_kern.c | 33 +++++++++++++++++++ tools/testing/selftests/bpf/test_tcpbpf.h | 2 ++ 7 files changed, 60 insertions(+), 9 deletions(-)