From nobody Mon Sep 23 14:37:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XC5Fp57KTz52MJd; Mon, 23 Sep 2024 14:38:22 +0000 (UTC) (envelope-from phil@juniper.net) Received: from mx0a-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XC5Fp0rHPz4CsZ; Mon, 23 Sep 2024 14:38:22 +0000 (UTC) (envelope-from phil@juniper.net) Authentication-Results: mx1.freebsd.org; none Received: from pps.filterd (m0108159.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48NBU5kk012774; Mon, 23 Sep 2024 07:38:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=PPS1017; bh=dx D9hd6z3b99OnaDkmlLe1hKWbGiUrpj1ryj4GUxTQA=; b=dfMkBHdaFd6HkMOoOq br2PYodh9lF5sUqzf26Wu6YqG8J6SXWNTasheD0o1gy32YAQcNg0G1HhyNZIbHc+ gOS2Ph9y40p39GPwW3dMy0AtwIQrsH1qu7y0nHjEtmoIBauR7UehCmbKW492wRnk bZ5UoMEJFMbn0iOeuZW+l10srMTSR0ofhFKMQA80HvU2bYP5bpjgOetodfn2v3/O ANtMHW+Jo0wPWJzmk6rmbAUpBmuJfjUsOMUXuVC4S/iz1pA1CczqnI1CKnWZ9k16 zlCksl6kuCs8ODeOZ78E1VHoJfRW48uW2K8yf6Zlk7eqMqdixM5vR5ng/uXCI+7i Rqhw== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazlp17012037.outbound.protection.outlook.com [40.93.1.37]) by mx0a-00273201.pphosted.com (PPS) with ESMTPS id 41sv3uc3e0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Sep 2024 07:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hMvxc0OT1bC8hyT2jEMeBQV2u65tnReZmg66pNmBlewX0eQRpKG+T7La/dHWBubVjhymq1p0qKz6x0oS9ZAn/BJqWVo/A9i+QAk0ehZnNtL6TLlHVOf3yJrQ3Q9uVBrJeLnZPxXCXXpgTFkqnhCvdZbFR4GQXjozy+Uo+o1PNHf51UG64t32YliQ4xsh3Hc9BPwYw8aoEM7jQCo/1d2zQKOhBvg4dvjPsXzx5lTZr42S8TRqMK3hlqRiyBNx16NpAuttgVDiiBgtv60FE0pyBIhxyETs7b9XspyIyi4ShFXMznqkwHBtn+g5gYdaVN0Zj9S20Ndq6ztSHoNe2iXD3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dxD9hd6z3b99OnaDkmlLe1hKWbGiUrpj1ryj4GUxTQA=; b=OeLz2Q982/bkYwXhegJt/FIbB5cDfp1ZdYj6WUhZWI/W8ljRCkroFK5zzVxYTQeznsVi98b3j4dBn0hL858nCNEyQTQOqhHW36n9BDs4hkEVDRWCZLCLti61WMkkInz2hv14/RwPe12ZaTypjBr8tsjfPrXiPnmu3QBmtfb8sjlF4m2qpBD6uzhmdkqX1V6zPZbpx84LqH3piKGe1JmoD0yKc3kuFu8rrFdwCf/Io1OonR6aM/t7M3dxg58g9jDmlwq3TulDKVnEiMotee7yU8mV4Nih9+ZnVAVloNWw5nbX3QkLiFP4TGNSXWXGRT0d/4x3MQ9TfrEbx9whY+/Qew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.14) smtp.rcpttodomain=freebsd.org smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dxD9hd6z3b99OnaDkmlLe1hKWbGiUrpj1ryj4GUxTQA=; b=HpKftLV/YP4JgL9DUcquD0tbCUovNxwA0c/1oSRfJga+MzU1t74pxIPPQJbFo/BET+9+xzKYfaWEwyaNJWQ3tIrbtGeyxwI7XTTDQzDWS/1TwYHuRAZjSpYj41uJ8Q/z9Yf0QsGmNbaYmCpjs7mb+r7VVe6AJ0y3XhXWyEq3XOo= Received: from BN9PR03CA0985.namprd03.prod.outlook.com (2603:10b6:408:109::30) by SJ0PR05MB8695.namprd05.prod.outlook.com (2603:10b6:a03:388::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.24; Mon, 23 Sep 2024 14:38:00 +0000 Received: from BN3PEPF0000B06E.namprd21.prod.outlook.com (2603:10b6:408:109:cafe::80) by BN9PR03CA0985.outlook.office365.com (2603:10b6:408:109::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.23 via Frontend Transport; Mon, 23 Sep 2024 14:37:59 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.14) smtp.mailfrom=juniper.net; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.14 as permitted sender) Received: from p-exchfe-eqx-01.jnpr.net (66.129.239.14) by BN3PEPF0000B06E.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.0 via Frontend Transport; Mon, 23 Sep 2024 14:37:59 +0000 Received: from p-exchbe-eqx-01.jnpr.net (10.104.9.14) by p-exchfe-eqx-01.jnpr.net (10.104.9.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 23 Sep 2024 09:37:59 -0500 Received: from p-mailhub01.juniper.net (10.104.20.6) by p-exchbe-eqx-01.jnpr.net (10.104.9.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Mon, 23 Sep 2024 09:37:59 -0500 Received: from idleski.juniper.net (idleski.juniper.net [172.25.4.10]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 48NEbvNZ013041; Mon, 23 Sep 2024 07:37:58 -0700 (envelope-from phil@juniper.net) Received: from [10.0.0.203] (localhost [127.0.0.1]) by idleski.juniper.net (8.16.1/8.16.1) with ESMTP id 48NDfnEv012768; Mon, 23 Sep 2024 09:41:50 -0400 (EDT) (envelope-from phil@juniper.net) From: Phil Shafer To: Warner Losh CC: Mark Johnston , Warner Losh , , , , Bram Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output Date: Mon, 23 Sep 2024 10:37:55 -0400 X-Mailer: MailMate (1.14r5937) Message-ID: In-Reply-To: References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06E:EE_|SJ0PR05MB8695:EE_ X-MS-Office365-Filtering-Correlation-Id: c53a8fc4-24c6-4019-1cd1-08dcdbdd5296 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?HcgbfA7xkpR2KYam/K/2IG0qmaIdbmxlGo9PpBZEAb91H0qfbm1zjq8mLgqQ?= =?us-ascii?Q?hzcMFt45+QC2w6FmsRIPf5Vt7g5vp7wAQFokxCIkeapxDs2leqzJEJWDAyaq?= =?us-ascii?Q?xZqJ3340iXVTCyBn8Aebi2KwqWeGxHxTAisPxyMnZoZngTKJEX+XmXNDe1Y4?= =?us-ascii?Q?aSQ6aFqYwH3CxoYfh5OJAD2f47O86arR9xbFbj/oHIFb+7nfyjW/rYLWjMYw?= =?us-ascii?Q?pUqxOYAOi7WyOszkaHIke+qIqLdeyyMGUtwbV+B0XQgQ1PbJjw41mKXeahwW?= =?us-ascii?Q?lry+T63wiPykue7ZIiCgFTuw2c2rGsFHcd3UxHz+0NRs+jtkHrkpLyuJhqfb?= =?us-ascii?Q?T5Ujt+MNphh3LiyBYNBD0C9fNLbPD1JABIpEva0vTVLk0yrBG+3/9uLSzF7a?= =?us-ascii?Q?Hl+jMWJt0QXKeKywg7hCCsfB/k8PkXYhn8XcU+sHH13HRmeWbd8vZettJIhe?= =?us-ascii?Q?CcBiZCyRk0kSRYIraC56AfJ8d1Gt6d9kPxf6bbBDDdwq3kwAN7ZwxcNhZYHd?= =?us-ascii?Q?rVRZFuhcNBOOI7M20Hs+mxSZG+wwrtdo7K3bKFdvPVdkAJoi6RbvYk0/QGGv?= =?us-ascii?Q?mJT+KJcnr8LWTna7t6azQ66VSrq7ePzGKkETt0b79c9MfCvRFOV+UuA1HrDZ?= =?us-ascii?Q?HJ/5UUmnXzDB3mAfjzic7wujhyz6yAnIzCyuo77I4bDwmMVc7QWBleoCKet3?= =?us-ascii?Q?nIWBRMpnDP8dojhqVgMD+H90NRTGwMR2JJF6/g/L1/std7/6ZsIG3UdCNJz+?= =?us-ascii?Q?0JTzxBWzw4qbtWjWhyzQzga8iXAfM04Ksvrx0VqPvukl2vqYqD7FeIAdu4BF?= =?us-ascii?Q?Vczf+GdIx6PjAotgBHrPNGogUo9S35P3dGtmd+3cE5z1kLfHrm8Kh8SI8sbC?= =?us-ascii?Q?seABVbUMVYuxbY33Gt8Zu2fuENS2+XdsGgwKGAHWGQNshtBR4V8Yo1WZZjal?= =?us-ascii?Q?0LGt2OPrPQUtvNYHc0OfpylMa4oM/18BOGW4guY1zuQy+tXrsRv9lMNLM/HY?= =?us-ascii?Q?JIXp/y7bS6gyFQQwsL3ddB54TF5vk9GI6QyqrbFvtFeNxUgdQ4wkcJvisUHS?= =?us-ascii?Q?LxOgwRuIQk3LZC7oYUcYtHyFKgZGvCsdjsJZH5BQyr9Nw1mqdGN6X+R51u+K?= =?us-ascii?Q?2BvLBciU6m4bYwW9xuWqvEgQWwZQTR4RdlzWy0/HUSyaiaQ/+4NIuEiKm/K2?= =?us-ascii?Q?v7ddd2ORReKGwAUbjM4kbMvXSYSQabaxnNNvcRpSCCr7UC5mtNWZXN+8qFkU?= =?us-ascii?Q?AmWc4MmxueaVFewLMwSHDlFp/QPh5IKJf/qLGCN0wP6egSX9mP8xxZa2lXyP?= =?us-ascii?Q?S0zgbEUAKhEc8rIK4UNVnmZmbv5YN0cLztozwlDtX85dex+d8szBLDCS8esQ?= =?us-ascii?Q?uKbKi4E=3D?= X-Forefront-Antispam-Report: CIP:66.129.239.14;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:p-exchfe-eqx-01.jnpr.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1102; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 14:37:59.8186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c53a8fc4-24c6-4019-1cd1-08dcdbdd5296 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4;Ip=[66.129.239.14];Helo=[p-exchfe-eqx-01.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B06E.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR05MB8695 X-Proofpoint-ORIG-GUID: jWJejLYY3DWU6ybxTibOCvIZBoS-dmNU X-Proofpoint-GUID: jWJejLYY3DWU6ybxTibOCvIZBoS-dmNU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 impostorscore=0 suspectscore=0 spamscore=0 phishscore=0 mlxlogscore=880 lowpriorityscore=0 malwarescore=0 mlxscore=0 clxscore=1011 adultscore=0 priorityscore=1501 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409230108 X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:26211, ipnet:208.84.65.0/24, country:US] X-Rspamd-Queue-Id: 4XC5Fp0rHPz4CsZ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On 22 Sep 2024, at 12:29, Warner Losh wrote: >> Thanks, the tests seem to be fixed now. > Thanks for the quick shout out it was a problem... Just to confirm: the fix added the "e" (encoding-only) flag so this doesn= 't appear in text/html output, right? Thanks, Phil From nobody Mon Sep 23 16:18:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XC7V11b9dz5WBLX; Mon, 23 Sep 2024 16:19:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XC7V04xLPz4L6X; Mon, 23 Sep 2024 16:19:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-6c548eb3354so36297506d6.2; Mon, 23 Sep 2024 09:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727108338; x=1727713138; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=pR9xw0tD1p4nNccVdM5VckWT0zz3k2c2BhmPn4rQIqo=; b=AteHv10ZqGv7VWJ9FXta3KLfoQsxf/831CcU7R+7P7u69MZ7KqOPk9D/zJPfjWqtga jLIhIDmxVl0diaEVCdUCCwQ3qhoLr7NdV7ezIAmvq6qPdTYDm6YNgYjDzSvsG8PhHjkU efe0bFIqkHrRJTqa3OErM63ryTtlOwcx7Kgg3ew5Ftmqz3V/Sb0aCqXpryU41ZS6GKBb cqrz1PNEmTzQjAvYg/HGowKf/DrkaiKD/mx1Sdh7FjVcu32TzthSZQS05pUOJEl9hoXR NuNorlxq0+d9CoNMbLCtYGGm1n/8gtGVzrkP3aPDrBEqv94fp/f/cv5BjvsQ/j8fg5zX JeTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727108338; x=1727713138; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pR9xw0tD1p4nNccVdM5VckWT0zz3k2c2BhmPn4rQIqo=; b=Rg45G+u1nZ8atn9fYgMW721esFLNuHFw9IvZWTobxCjCeHJWcAIymQeyLMk2EdngB0 +ss5yKWcfX+lPf6FNt9qFQBSzV9QgDgGlyzy+acKEJVi3k00Dy4NU7oZD0yt0by9WBXD 8/FaaQUbLmexXrqxm5J4fxcrtaySG9fZQ/39Itqntk+VhA+A/aRb69/v0C2RkWawt6P7 bXqIhxQmXGQQKWiaX4tDr+KhZBxB8scVjuKm8LAbFWKqz12uAhd8K321NYYDipWILac4 G2uZR/2CeY0PygF9rdLcx1wOI5/sNjdMvSYmUZskuaY6rIOEHt5NUJ1tA2rkn5Egj77k PD3g== X-Forwarded-Encrypted: i=1; AJvYcCUxKgp/mYWxJyywG7+nEao/B+hfmQVhUPJaP0lnlNAPq0uKYeFqQ7K9EEGnoy/e4KtsyEMxfNtICNuvTveWfiQ=@freebsd.org, AJvYcCX9C4/wtpoF9D2w037rNYqTfv1aUt57UbqWdipHALjYLS0yJuYFLbPLPIs3ZIUOjnRgsDsATQjNv2SFnyYPlP57D4a5@freebsd.org, AJvYcCXT4c7ZXO2yCAaH6YKsTjzYeCymN7fZUCzxqYObuGUrlYe/P9Gf/H8uhrQMUl7ZO2wBvlU0+oD4DRXRubFZ4vBuYVBieTI=@freebsd.org, AJvYcCXmQj6xAH7C+IFFD7RRgMZlg1W4CaRVJxv5fMvKerPtVyTp+zm1GwN9C5Jjs9vQAE7U8uwD@freebsd.org X-Gm-Message-State: AOJu0YzsW4NFrOQqqGURNcFDfLUdz5XfbAkXb+kdzieCSCx3gdxRpYJA r+WJfEFIa0ix/lbwoHBTdtjg4iVw+5psjUJToqoHDhuNugqHqARL8QU1jZVMbG0= X-Google-Smtp-Source: AGHT+IHijU8+msBoWSBiN62b9Wp0Z5NuIzJWTPfDEyyr8MvyBMKol5H+oGFEuGIbHQ1ls8tR+SX8ZQ== X-Received: by 2002:a05:6214:5982:b0:6c5:ab33:6300 with SMTP id 6a1803df08f44-6c7bd4cf296mr179939876d6.6.1727108337700; Mon, 23 Sep 2024 09:18:57 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c75e495d6asm48416036d6.73.2024.09.23.09.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 09:18:56 -0700 (PDT) Date: Mon, 23 Sep 2024 12:18:53 -0400 From: Mark Johnston To: Phil Shafer Cc: Warner Losh , Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Bram Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output Message-ID: References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XC7V04xLPz4L6X X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Mon, Sep 23, 2024 at 10:37:55AM -0400, Phil Shafer wrote: > On 22 Sep 2024, at 12:29, Warner Losh wrote: > >> Thanks, the tests seem to be fixed now. > > Thanks for the quick shout out it was a problem... > > Just to confirm: the fix added the "e" (encoding-only) flag so this doesn't appear in text/html output, right? There is no fix yet, that I'm aware of, so far we've merely reverted the commit in question. But yes, the fix is to add the "e" field modifer, and more specifically to plumb it through to show_stat(). > > Thanks, > Phil From nobody Mon Sep 23 17:13:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XC8hK08g0z5WFRT; Mon, 23 Sep 2024 17:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XC8hJ6dhwz4RRs; Mon, 23 Sep 2024 17:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727111584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Db6830U6CxEqgorR85LYvVXUg3Qo8Ls1KC+I/+nNH2g=; b=gSbD0ffxY/v7AfIHnigpDv2mtCuNRr7gupRAxxNUxjw8C+D8Ddyyc5+Bl9gLrRS5pOhHLZ jaP05GYUgPu5L4yUijjzNiqWOaZH70Vs/3l33guT13AWuXl8JRwzv/crS0ougGjHhk6vuk EwJM69nbRVAc21rkVPLXyYjcILKT8N90Ad7y0Ry5MlzDwViVMR910DihSTGjiFYDIueCNh oPtJjdxELSUgtwrEc3bRXf5P2gpIcJLX0vY8dGjKkL97OI1RMpTaHXjAa+1JV8udmNHWDn MB7by3rDePL+x20dTPV0U4iDjJ6mWLNHMrmLyZGA1p/AzLqZ+NL1aThVbWMygg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727111584; a=rsa-sha256; cv=none; b=uA6jnXjiScsvBI9csLdFmcAZO+XA+zjf0uGJ8B+w+NzzThso+B+3oIl5/vT3MXkcNxnQ9R QcRxrs8CGQb8JSrSAlOkepu0rjz6qGSOSFQDCOiLCkdBxCsSMhFnIP1ZOJvURHcI6wWcWJ n3xos9dBIsmjTVzuz558hord3p78vwta76kbBAN5TRNsFw0QCnB6LaavHauOkUm+uUOaAt RD9cgFzrHVkLPZxQUovB6Tk4N9mH6sNo1afzZbK8E0axyroxPWehC8XncXSsRBdHqkNlPb HE7Dg5Z0ivBsXMUMKfA8ySOm48D7t02JsIuM+inHz6mnROGIhe+abQ5SbAfEhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727111584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Db6830U6CxEqgorR85LYvVXUg3Qo8Ls1KC+I/+nNH2g=; b=aRaWjSK1SdO4W9PN2bA4Wx0vurMMuJA7oK90GHObXfhC7IQwTNfKLTFF1yzzqp87tJJU3X VNFpkNPCLir44G7DslG0LCwQJepDiGkPsAZxMI2bihcdCnIsedvbAu8ntHk6E/k90canKG VYxk/tgIB/2nzmes63l5oPFn5sJ24VOcczBzUMEd3ibflKTMWsFKZIcx6T63WkCL215IN/ TXmHMpE00SLs/AWOcG+jrIhcJ4qSNJ+CkzLYRMSRbj20WH6V7vHi1/0GprSBt7hG8Gz3Yr ZHnTH7sjljNWXNr+HwvJ24Y0+Yk0Tz4f4rf7L6H/YK5GRyg2tWlZY/5B6dDQ6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XC8hJ66Dnztt1; Mon, 23 Sep 2024 17:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48NHD41l033692; Mon, 23 Sep 2024 17:13:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48NHD45j033689; Mon, 23 Sep 2024 17:13:04 GMT (envelope-from git) Date: Mon, 23 Sep 2024 17:13:04 GMT Message-Id: <202409231713.48NHD45j033689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 940fec94b5fc - main - swap_pager: deoptimize swapoff_object List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 940fec94b5fc001333d87c2935de97a4566a0289 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=940fec94b5fc001333d87c2935de97a4566a0289 commit 940fec94b5fc001333d87c2935de97a4566a0289 Author: Doug Moore AuthorDate: 2024-09-23 17:11:55 +0000 Commit: Doug Moore CommitDate: 2024-09-23 17:11:55 +0000 swap_pager: deoptimize swapoff_object Undo a change in swap_pager_swapoff_object that assumed a swap block would be valid after reacquiring a lock, when that validity cannot be assumed. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46753 --- sys/vm/swap_pager.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 44fe4f34bb39..954228dfaaf0 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1954,7 +1954,6 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) vm_object_pip_wakeupn(object, 1); KASSERT(vm_page_all_valid(m), ("%s: Page %p not all valid", __func__, m)); - swp_pager_force_dirty(&range, m, &sb->d[i]); vm_page_xunbusy(m); i = 0; /* Restart scan after object lock dropped. */ } From nobody Mon Sep 23 18:28:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCBMt6g9Gz5WL2D; Mon, 23 Sep 2024 18:28:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCBMt62MKz4Vvl; Mon, 23 Sep 2024 18:28:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727116138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHZb+rVJImXEqGu8MxHn3H/fvgazsrgReMtdm3z0xtE=; b=LrIBwQfX81K/mtzZuFiF7fiQuu22vMe63XJn/CkOnjyaK2zUjo+/qL4DlxApaXZ0kY7aku SL7xw3t9WHwZQ32fOnZXytEr8Jf5XEo3izQCe0CPWetrKrHjpoU5FlBjMhlWLQpzGR4c5z 1mOMzcK9h9j2IX5gJWpZx8ym+28qEuocRIcQvX4litaqBUb8MAbKgCRw2b2Dj8gbdWVQ4Z uxe89QrczJOgpulxgi5T6VdHjZL2/y6U/GD6z/+G/hiM9PrNEDLrsGLZg2zzvLsZ+0ouvU 2pSTfLG6tCCpVXaNmenD+DYbEEi7rExHT5zVoBGk5COKlVLWJqyFHw9Vh7XAaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727116138; a=rsa-sha256; cv=none; b=En9ZGp41RLe04qUawWYQCXJ73lkiVkpeuAYQKgQ7hsCgwizmD6tEkKPZLIHkiE6NI0O2jI StK7SDhpCSX+OM2POG/Q6WJZKmg2EAbYZpkKljJx0qNrxIim8yoHRP48omgU7fsJ0aCrOH 1hc9Yjq6OjZJLh/2MJ6saCzUW2kQqanx/P4aN1glsA2zO+zVxwhLpTq9ajRcyP98SKU6Zp mVzpUnM5RSAqO4g2FUbcY3Xy36SdOLS35ltNWkaDAvOQQ6q93Mge6lPY7Q0Y1GmoPOZQG0 HfICP4X0OGqyi6AuV6LRcUi2nIfXqiCjJgNcrUempBLyxeaxrTnVOvJSbgIRyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727116138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHZb+rVJImXEqGu8MxHn3H/fvgazsrgReMtdm3z0xtE=; b=A9+mCT5loYmgFAWhOp94smCuQE82ix7WKjrgi8Yj/ktFrGtkiTbNSqvVm/BkowDFYIt63q Oo1Ehpchtinkl7RwDrBBQoAwodXMye2C24d9KIEbqcrmbh37quU4TrdBmZ2L1tX1+DGwDY oyajBDnFevVAnRxTPPelUQld3vItyKXCNo92SQIWFNoPqm2IwQc9YYfdqU7fLYfwFr41y7 2xUXPR5FGQZhMhpm1lZEN6sORCPhhSF6sYzBMazydGGUoRl4GcgskeehbypQJS2reDRXET 7BQn4Jwj1wJ8JidZjKPMb2voR54nd3NaNrI0P1WwyJZyRlvBOXk06itAgIMRwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCBMt5dW0zwYX; Mon, 23 Sep 2024 18:28:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48NISwva053323; Mon, 23 Sep 2024 18:28:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48NISwxd053320; Mon, 23 Sep 2024 18:28:58 GMT (envelope-from git) Date: Mon, 23 Sep 2024 18:28:58 GMT Message-Id: <202409231828.48NISwxd053320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: f1aaef47a01a - main - swap_pager: update meta_free comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1aaef47a01ad2b690ea251a42cbff99511459cf Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=f1aaef47a01ad2b690ea251a42cbff99511459cf commit f1aaef47a01ad2b690ea251a42cbff99511459cf Author: Doug Moore AuthorDate: 2024-09-23 18:27:54 +0000 Commit: Doug Moore CommitDate: 2024-09-23 18:27:54 +0000 swap_pager: update meta_free comment Clarify the comment that introduces swp_page_meta_free. Reviewed by: markj, alc Differential Revision: https://reviews.freebsd.org/D46754 --- sys/vm/swap_pager.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 954228dfaaf0..aa0297daefe9 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2264,12 +2264,9 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, /* * SWP_PAGER_META_FREE() - free a range of blocks in the object's swap metadata * - * The requested range of blocks is freed, with any associated swap - * returned to the swap bitmap. - * - * This routine will free swap metadata structures as they are cleaned - * out. This routine does *NOT* operate on swap metadata associated - * with resident pages. + * Return freed swap blocks to the swap bitmap, and free emptied swblk + * metadata. With 'freed' set, provide a count of freed blocks that were + * not associated with valid resident pages. */ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, From nobody Mon Sep 23 19:35:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCCrG66v4z5WQBp; Mon, 23 Sep 2024 19:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCCrG5Mdvz4bny; Mon, 23 Sep 2024 19:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727120110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7FnlPCfVFTrljnVRm1D+8/SrlJZdfqOYiHUO28wYdIE=; b=vvuUU9A3wW4Fxmu+muMfhsqnO2xTzfHn4idqLvPSibzyyCRZ+9XiGUq4U0HTviWDlILeZS hVDneq09Y4SfEqA1ebLbHIIwvUI8Y0FhGCIfIu0bz8y1tsirygE+A+wQlSeimr4LoxeS2G u7eMBgOnFPFHwDE1zx8o1ZBy4bEJ1RR22f+mZLAl2TCi07UcMzYT8/YlscHa9vVCikpePX 7Auj7SglmBKhR8F9DWXk2uODl578A8eQR+Mo5QOtOSF8pfUheOWCUizREMOUuMoDuzLUGu BdayavbLA8smgop9IKmmdKrElODLHnCn7HS+bx+p42NMWkaPvtKYHMke2N07rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727120110; a=rsa-sha256; cv=none; b=OMwBPL5uAjZl5uwebAHj1q0KUglH1E7qxMKHZannxoH7I+J2mnvmtSRFwQalHQ0VncbaxY IwSZnA+IRJFV9a0XActVegMnCeas4QUVc9g3XC1lzlZ1KwBl1W3f2YRtshJnircoDpYg82 O+pi6r8dMby9zc2mz8tdfibDlMDQ9W2iQNkmJxu8+/DDY6in4n3KpHVODeWGph/oURYfPd UrBW+c1C16LQYoul3LU8OLTpmiwSJJ3BfM6d1KnaTDouunG82+aF0MvrsA7Xv+hqkZ20jP 6vBzi1NxIIziIyHoN8YHY1yncxE9oahqAQB2le/vge4l1nM1cdmZp10nnDm5xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727120110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7FnlPCfVFTrljnVRm1D+8/SrlJZdfqOYiHUO28wYdIE=; b=mG/6OPyMEt3QogQZ5psSmESSuoG9J5sGYWXCphyiUgQyLhT8USkYVwOQHaSRKGDF1qmbPJ 7fi4j3JH43HeZQYVaTJhHAxb4iIaygE1q5vCRGa5FVA00xmY6QoYCq1Pog+itqsZnKwyBn qw2BM476Pn+JvrAE0EXyXtx4CAnh4iJedBxw3BaaiqhUndWPE4VoR1Wq5bDBkf26pOsqLZ 2gno+36WBN+A3ZskNXreXFyyG1Ihr65d215+iZdU9SljtZI7EqbiGgbsewZeZ9EbXeNhro nqBq1NIudkboKOSpznNGhbzp+C7ylHCv2Ir5ZN26NRHrP3/ZUJgSxETutKRFvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCCrG4rGVzyKv; Mon, 23 Sep 2024 19:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48NJZA59072237; Mon, 23 Sep 2024 19:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48NJZARY072234; Mon, 23 Sep 2024 19:35:10 GMT (envelope-from git) Date: Mon, 23 Sep 2024 19:35:10 GMT Message-Id: <202409231935.48NJZARY072234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 0a7e5f1f02aa - main - tcpdump: Update to 4.99.5 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a7e5f1f02aad2ff5fff1c60f44c6975fd07e1d9 Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=0a7e5f1f02aad2ff5fff1c60f44c6975fd07e1d9 commit 0a7e5f1f02aad2ff5fff1c60f44c6975fd07e1d9 Merge: f1aaef47a01a 75d9de99aec2 Author: Joseph Mingrone AuthorDate: 2024-09-23 19:23:25 +0000 Commit: Joseph Mingrone CommitDate: 2024-09-23 19:23:25 +0000 tcpdump: Update to 4.99.5 Changes: https://git.tcpdump.org/tcpdump/blob/4a789712f187e3ac7b2c0044c3a3f8c71b83646e:/CHANGES Obtained from: https://www.tcpdump.org/release/tcpdump-4.99.5.tar.xz Sponsored by: The FreeBSD Foundation contrib/tcpdump/CHANGES | 131 +- contrib/tcpdump/CMakeLists.txt | 301 +- contrib/tcpdump/CONTRIBUTING.md | 269 +- contrib/tcpdump/CREDITS | 34 +- contrib/tcpdump/INSTALL.md | 35 +- contrib/tcpdump/Makefile.in | 98 +- contrib/tcpdump/VERSION | 2 +- contrib/tcpdump/addrtoname.c | 7 +- contrib/tcpdump/addrtostr.c | 24 +- contrib/tcpdump/af.c | 2 - contrib/tcpdump/autogen.sh | 25 + contrib/tcpdump/bpf_dump.c | 2 - contrib/tcpdump/checksum.c | 39 +- contrib/tcpdump/cmake/Modules/FindCRYPTO.cmake | 185 +- contrib/tcpdump/cmakeconfig.h.in | 14 +- contrib/tcpdump/config.guess | 62 +- contrib/tcpdump/config.h.in | 27 +- contrib/tcpdump/config.sub | 230 +- contrib/tcpdump/configure | 7188 ++++++++++++++---------- contrib/tcpdump/configure.ac | 476 +- contrib/tcpdump/cpack.c | 2 - contrib/tcpdump/diag-control.h | 95 +- contrib/tcpdump/doc/README.Win32.md | 200 - contrib/tcpdump/doc/README.haiku.md | 33 + contrib/tcpdump/doc/README.solaris.md | 5 + contrib/tcpdump/extract.h | 2 +- contrib/tcpdump/ftmacros.h | 2 +- contrib/tcpdump/funcattrs.h | 5 +- contrib/tcpdump/gmpls.c | 2 - contrib/tcpdump/in_cksum.c | 2 - contrib/tcpdump/install-sh | 689 ++- contrib/tcpdump/instrument-functions.c | 250 + contrib/tcpdump/interface.h | 2 +- contrib/tcpdump/ip.h | 1 - contrib/tcpdump/ipproto.c | 2 - contrib/tcpdump/l2vpn.c | 2 - contrib/tcpdump/machdep.c | 2 - contrib/tcpdump/makemib | 2 +- contrib/tcpdump/mib.h | 12 +- contrib/tcpdump/missing/datalinks.c | 2 - contrib/tcpdump/missing/dlnames.c | 2 - contrib/tcpdump/missing/getopt_long.c | 3 +- contrib/tcpdump/missing/getservent.c | 2 - contrib/tcpdump/missing/snprintf.c | 2 - contrib/tcpdump/missing/strlcat.c | 2 - contrib/tcpdump/missing/strlcpy.c | 2 - contrib/tcpdump/missing/strsep.c | 2 - contrib/tcpdump/mkdep | 28 +- contrib/tcpdump/nameser.h | 8 +- contrib/tcpdump/netdissect-alloc.c | 2 - contrib/tcpdump/netdissect.c | 16 +- contrib/tcpdump/netdissect.h | 75 +- contrib/tcpdump/nlpid.c | 2 - contrib/tcpdump/ntp.c | 2 - contrib/tcpdump/oui.c | 2 - contrib/tcpdump/parsenfsfh.c | 53 +- contrib/tcpdump/pflog.h | 45 +- contrib/tcpdump/print-802_11.c | 62 +- contrib/tcpdump/print-802_15_4.c | 32 +- contrib/tcpdump/print-ah.c | 2 - contrib/tcpdump/print-ahcp.c | 2 - contrib/tcpdump/print-aodv.c | 2 - contrib/tcpdump/print-aoe.c | 2 - contrib/tcpdump/print-ap1394.c | 2 - contrib/tcpdump/print-arcnet.c | 2 - contrib/tcpdump/print-arista.c | 2 - contrib/tcpdump/print-arp.c | 2 - contrib/tcpdump/print-ascii.c | 8 +- contrib/tcpdump/print-atalk.c | 2 - contrib/tcpdump/print-atm.c | 4 +- contrib/tcpdump/print-babel.c | 2 - contrib/tcpdump/print-bcm-li.c | 2 - contrib/tcpdump/print-beep.c | 2 - contrib/tcpdump/print-bfd.c | 8 +- contrib/tcpdump/print-bgp.c | 23 +- contrib/tcpdump/print-bootp.c | 43 +- contrib/tcpdump/print-brcmtag.c | 3 - contrib/tcpdump/print-bt.c | 2 - contrib/tcpdump/print-calm-fast.c | 2 - contrib/tcpdump/print-carp.c | 5 +- contrib/tcpdump/print-cdp.c | 10 +- contrib/tcpdump/print-cfm.c | 2 - contrib/tcpdump/print-chdlc.c | 2 - contrib/tcpdump/print-cip.c | 2 - contrib/tcpdump/print-cnfp.c | 2 - contrib/tcpdump/print-dccp.c | 2 - contrib/tcpdump/print-decnet.c | 2 - contrib/tcpdump/print-dhcp6.c | 70 +- contrib/tcpdump/print-domain.c | 12 +- contrib/tcpdump/print-dsa.c | 2 - contrib/tcpdump/print-dtp.c | 4 +- contrib/tcpdump/print-dvmrp.c | 4 +- contrib/tcpdump/print-eap.c | 3 +- contrib/tcpdump/print-egp.c | 2 - contrib/tcpdump/print-eigrp.c | 2 - contrib/tcpdump/print-enc.c | 2 - contrib/tcpdump/print-esp.c | 29 +- contrib/tcpdump/print-ether.c | 6 +- contrib/tcpdump/print-fddi.c | 5 +- contrib/tcpdump/print-forces.c | 2 - contrib/tcpdump/print-fr.c | 18 +- contrib/tcpdump/print-frag6.c | 26 +- contrib/tcpdump/print-ftp.c | 2 - contrib/tcpdump/print-geneve.c | 2 - contrib/tcpdump/print-geonet.c | 2 - contrib/tcpdump/print-gre.c | 2 - contrib/tcpdump/print-hncp.c | 2 - contrib/tcpdump/print-hsrp.c | 2 - contrib/tcpdump/print-http.c | 2 - contrib/tcpdump/print-icmp.c | 2 - contrib/tcpdump/print-icmp6.c | 15 +- contrib/tcpdump/print-igmp.c | 2 - contrib/tcpdump/print-igrp.c | 2 - contrib/tcpdump/print-ip-demux.c | 2 - contrib/tcpdump/print-ip.c | 68 +- contrib/tcpdump/print-ip6.c | 45 +- contrib/tcpdump/print-ip6opts.c | 2 - contrib/tcpdump/print-ipcomp.c | 2 - contrib/tcpdump/print-ipfc.c | 2 - contrib/tcpdump/print-ipnet.c | 2 - contrib/tcpdump/print-ipoib.c | 2 - contrib/tcpdump/print-ipx.c | 6 +- contrib/tcpdump/print-isakmp.c | 25 +- contrib/tcpdump/print-isoclns.c | 34 +- contrib/tcpdump/print-juniper.c | 5 +- contrib/tcpdump/print-krb.c | 11 +- contrib/tcpdump/print-l2tp.c | 2 - contrib/tcpdump/print-lane.c | 2 - contrib/tcpdump/print-ldp.c | 20 +- contrib/tcpdump/print-lisp.c | 14 +- contrib/tcpdump/print-llc.c | 2 - contrib/tcpdump/print-lldp.c | 4 +- contrib/tcpdump/print-lmp.c | 2 - contrib/tcpdump/print-loopback.c | 5 +- contrib/tcpdump/print-lspping.c | 2 - contrib/tcpdump/print-lwapp.c | 2 - contrib/tcpdump/print-lwres.c | 10 +- contrib/tcpdump/print-m3ua.c | 2 - contrib/tcpdump/print-macsec.c | 3 - contrib/tcpdump/print-mobile.c | 2 - contrib/tcpdump/print-mobility.c | 5 +- contrib/tcpdump/print-mpcp.c | 2 - contrib/tcpdump/print-mpls.c | 2 - contrib/tcpdump/print-mptcp.c | 2 - contrib/tcpdump/print-msdp.c | 2 - contrib/tcpdump/print-msnlb.c | 2 - contrib/tcpdump/print-nflog.c | 22 +- contrib/tcpdump/print-nfs.c | 29 +- contrib/tcpdump/print-nsh.c | 7 +- contrib/tcpdump/print-ntp.c | 4 - contrib/tcpdump/print-null.c | 2 - contrib/tcpdump/print-olsr.c | 16 +- contrib/tcpdump/print-openflow-1.0.c | 143 +- contrib/tcpdump/print-openflow-1.3.c | 15 +- contrib/tcpdump/print-openflow.c | 2 - contrib/tcpdump/print-ospf.c | 10 +- contrib/tcpdump/print-ospf6.c | 15 +- contrib/tcpdump/print-otv.c | 2 - contrib/tcpdump/print-pflog.c | 30 +- contrib/tcpdump/print-pgm.c | 2 - contrib/tcpdump/print-pim.c | 8 +- contrib/tcpdump/print-pktap.c | 2 - contrib/tcpdump/print-ppi.c | 2 - contrib/tcpdump/print-ppp.c | 11 +- contrib/tcpdump/print-pppoe.c | 2 - contrib/tcpdump/print-pptp.c | 2 - contrib/tcpdump/print-ptp.c | 45 +- contrib/tcpdump/print-radius.c | 173 +- contrib/tcpdump/print-raw.c | 2 - contrib/tcpdump/print-realtek.c | 2 - contrib/tcpdump/print-resp.c | 6 +- contrib/tcpdump/print-rip.c | 46 +- contrib/tcpdump/print-ripng.c | 2 - contrib/tcpdump/print-rpki-rtr.c | 40 +- contrib/tcpdump/print-rsvp.c | 2 - contrib/tcpdump/print-rt6.c | 4 +- contrib/tcpdump/print-rtsp.c | 2 - contrib/tcpdump/print-rx.c | 4 +- contrib/tcpdump/print-sctp.c | 7 +- contrib/tcpdump/print-sflow.c | 8 +- contrib/tcpdump/print-sip.c | 2 - contrib/tcpdump/print-sl.c | 2 - contrib/tcpdump/print-sll.c | 2 - contrib/tcpdump/print-slow.c | 2 - contrib/tcpdump/print-smb.c | 20 +- contrib/tcpdump/print-smtp.c | 2 - contrib/tcpdump/print-snmp.c | 12 +- contrib/tcpdump/print-someip.c | 3 - contrib/tcpdump/print-ssh.c | 2 - contrib/tcpdump/print-stp.c | 5 +- contrib/tcpdump/print-sunatm.c | 2 - contrib/tcpdump/print-sunrpc.c | 2 - contrib/tcpdump/print-symantec.c | 2 - contrib/tcpdump/print-syslog.c | 5 +- contrib/tcpdump/print-tcp.c | 64 +- contrib/tcpdump/print-telnet.c | 4 +- contrib/tcpdump/print-tftp.c | 2 - contrib/tcpdump/print-timed.c | 2 - contrib/tcpdump/print-tipc.c | 6 +- contrib/tcpdump/print-token.c | 2 - contrib/tcpdump/print-udld.c | 2 - contrib/tcpdump/print-udp.c | 101 +- contrib/tcpdump/print-unsupported.c | 2 - contrib/tcpdump/print-usb.c | 14 +- contrib/tcpdump/print-vjc.c | 2 - contrib/tcpdump/print-vqp.c | 2 - contrib/tcpdump/print-vrrp.c | 2 - contrib/tcpdump/print-vsock.c | 2 - contrib/tcpdump/print-vtp.c | 6 +- contrib/tcpdump/print-vxlan-gpe.c | 2 - contrib/tcpdump/print-vxlan.c | 2 - contrib/tcpdump/print-wb.c | 2 - contrib/tcpdump/print-whois.c | 2 - contrib/tcpdump/print-zep.c | 10 +- contrib/tcpdump/print-zephyr.c | 2 - contrib/tcpdump/print-zeromq.c | 26 +- contrib/tcpdump/print.c | 18 +- contrib/tcpdump/signature.c | 2 - contrib/tcpdump/smbutil.c | 19 +- contrib/tcpdump/status-exit-codes.h | 1 - contrib/tcpdump/strtoaddr.c | 2 - contrib/tcpdump/tcp.h | 6 +- contrib/tcpdump/tcpdump.1.in | 87 +- contrib/tcpdump/tcpdump.c | 107 +- contrib/tcpdump/udp.h | 14 +- contrib/tcpdump/util-print.c | 67 +- usr.sbin/tcpdump/tcpdump/config.h | 4 +- 227 files changed, 7690 insertions(+), 5092 deletions(-) diff --cc contrib/tcpdump/CONTRIBUTING.md index 26f226ebd973,000000000000..215e4c6831c4 mode 100644,000000..100644 --- a/contrib/tcpdump/CONTRIBUTING.md +++ b/contrib/tcpdump/CONTRIBUTING.md @@@ -1,191 -1,0 +1,394 @@@ +# Some Information for Contributors +Thank you for considering to make a contribution to tcpdump! Please use the +guidelines below to achieve the best results and experience for everyone. + +## How to report bugs and other problems +**To report a security issue (segfault, buffer overflow, infinite loop, arbitrary +code execution etc) please send an e-mail to security@tcpdump.org, do not use +the bug tracker!** + +To report a non-security problem (failure to compile, incorrect output in the +protocol printout, missing support for a particular protocol etc) please check +first that it reproduces with the latest stable release of tcpdump and the latest +stable release of libpcap. If it does, please check that the problem reproduces +with the current git master branch of tcpdump and the current git master branch of +libpcap. If it does (and it is not a security-related problem, otherwise see +above), please navigate to the +[bug tracker](https://github.com/the-tcpdump-group/tcpdump/issues) +and check if the problem has already been reported. If it has not, please open +a new issue and provide the following details: + +* tcpdump and libpcap version (`tcpdump --version`) +* operating system name and version and any other details that may be relevant + (`uname -a`, compiler name and version, CPU type etc.) +* custom `configure`/`cmake` flags, if any +* statement of the problem +* steps to reproduce + +Please note that if you know exactly how to solve the problem and the solution +would not be too intrusive, it would be best to contribute some development time +and to open a pull request instead as discussed below. + +Still not sure how to do? Feel free to +[subscribe to the mailing list](https://www.tcpdump.org/#mailing-lists) +and ask! + + +## How to add new code and to update existing code + - 0) Check that there isn't a pull request already opened for the changes you ++1) Check that there isn't a pull request already opened for the changes you + intend to make. + - 1) [Fork](https://help.github.com/articles/fork-a-repo/) the Tcpdump ++2) [Fork](https://help.github.com/articles/fork-a-repo/) the Tcpdump + [repository](https://github.com/the-tcpdump-group/tcpdump). + - 2) The easiest way to test your changes on multiple operating systems and ++3) The easiest way to test your changes on multiple operating systems and + architectures is to let the upstream CI test your pull request (more on + this below). + - 3) Setup your git working copy ++4) Setup your git working copy + ``` + git clone https://github.com//tcpdump.git + cd tcpdump + git remote add upstream https://github.com/the-tcpdump-group/tcpdump + git fetch upstream + ``` + - 4) Do a `touch .devel` in your working directory. ++5) Do a `touch .devel` in your working directory. + Currently, the effect is + * add (via `configure`, in `Makefile`) some warnings options (`-Wall`, + `-Wmissing-prototypes`, `-Wstrict-prototypes`, ...) to the compiler if it + supports these options, + * have the `Makefile` support `make depend` and the `configure` script run it. + - 5) Configure and build ++6) Configure and build + ``` + ./configure && make -s && make check + ``` + - 6) Add/update tests ++7) Add/update tests + The `tests` directory contains regression tests of the dissection of captured + packets. Those captured packets were saved running tcpdump with option + `-w sample.pcap`. Additional options, such as `-n`, are used to create relevant + and reproducible output; `-#` is used to indicate which particular packets + have output that differs. The tests are run with the `TZ` environment + variable set to `GMT0`, so that UTC, rather than the local time where the + tests are being run, is used when "local time" values are printed. The + actual test compares the current text output with the expected result + (`sample.out`) saved from a previous version. + + Any new/updated fields in a dissector must be present in a `sample.pcap` file + and the corresponding output file. + + Configuration is set in `tests/TESTLIST`. + Each line in this file has the following format: + ``` + test-name sample.pcap sample.out tcpdump-options + ``` + + The `sample.out` file can be produced as follows: + ``` + (cd tests && TZ=GMT0 ../tcpdump -# -n -r sample.pcap tcpdump-options > sample.out) + ``` + + Or, for convenience, use `./update-test.sh test-name` + + It is often useful to have test outputs with different verbosity levels + (none, `-v`, `-vv`, `-vvv`, etc.) depending on the code. + - 7) Test using `make check` (current build options) and `./build_matrix.sh` ++8) Test using `make check` (current build options) and `./build_matrix.sh` + (a multitude of build options, build systems and compilers). If you can, + test on more than one operating system. Don't send a pull request until + all tests pass. + - 8) Try to rebase your commits to keep the history simple. ++9) Try to rebase your commits to keep the history simple. + ``` + git fetch upstream + git rebase upstream/master + ``` + (If the rebase fails and you cannot resolve, issue `git rebase --abort` + and ask for help in the pull request comment.) + - 9) Once 100% happy, put your work into your forked repository using `git push`. ++10) Once 100% happy, put your work into your forked repository using `git push`. + - 10) [Initiate and send](https://help.github.com/articles/using-pull-requests/) ++11) [Initiate and send](https://help.github.com/articles/using-pull-requests/) + a pull request. + This will trigger the upstream repository CI tests. + + +## Code style and generic remarks - * A thorough reading of some other printers code is useful. ++1) A thorough reading of some other printers code is useful. + - * Put the normative reference if any as comments (RFC, etc.). ++2) To help learn how tcpdump works or to help debugging: ++ You can configure and build tcpdump with the instrumentation of functions: ++ ``` ++ $ ./configure --enable-instrument-functions ++ $ make -s clean all ++ ``` ++ ++ This generates instrumentation calls for entry and exit to functions. ++ Just after function entry and just before function exit, these ++ profiling functions are called and print the function names with ++ indentation and call level. ++ ++ If entering in a function, it prints also the calling function name with ++ file name and line number. There may be a small shift in the line number. ++ ++ In some cases, with Clang 11, the file number is unknown (printed '??') ++ or the line number is unknown (printed '?'). In this case, use GCC. ++ ++ If the environment variable INSTRUMENT is ++ - unset or set to an empty string, print nothing, like with no ++ instrumentation ++ - set to "all" or "a", print all the functions names ++ - set to "global" or "g", print only the global functions names ++ ++ This allows to run: ++ ``` ++ $ INSTRUMENT=a ./tcpdump ... ++ $ INSTRUMENT=g ./tcpdump ... ++ $ INSTRUMENT= ./tcpdump ... ++ ``` ++ or ++ ``` ++ $ export INSTRUMENT=global ++ $ ./tcpdump ... ++ ``` ++ ++ The library libbfd is used, therefore the binutils-dev package is required. + - * Put the format of packets/headers/options as comments if there is no ++3) Put the normative reference if any as comments (RFC, etc.). ++ ++4) Put the format of packets/headers/options as comments if there is no + published normative reference. + - * The printer may receive incomplete packet in the buffer, truncated at any ++5) The printer may receive incomplete packet in the buffer, truncated at any + random position, for example by capturing with `-s size` option. ++ This means that an attempt to fetch packet data based on the expected ++ format of the packet may run the risk of overrunning the buffer. ++ ++ Furthermore, if the packet is complete, but is not correctly formed, ++ that can also cause a printer to overrun the buffer, as it will be ++ fetching packet data based on the expected format of the packet. ++ ++ Therefore, integral, IPv4 address, and octet sequence values should ++ be fetched using the `GET_*()` macros, which are defined in ++ `extract.h`. ++ + If your code reads and decodes every byte of the protocol packet, then to + ensure proper and complete bounds checks it would be sufficient to read all - packet data using the `GET_*()` macros, typically: - ``` - GET_U_1(p) - GET_S_1(p) - GET_BE_U_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } - GET_BE_S_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } - ``` ++ packet data using the `GET_*()` macros. ++ + If your code uses the macros above only on some packet data, then the gaps + would have to be bounds-checked using the `ND_TCHECK_*()` macros: + ``` + ND_TCHECK_n(p), n in { 1, 2, 3, 4, 5, 6, 7, 8, 16 } + ND_TCHECK_SIZE(p) + ND_TCHECK_LEN(p, l) + ``` - For the `ND_TCHECK_*` macros (if not already done): ++ ++ where *p* points to the data not being decoded. For `ND_CHECK_n()`, ++ *n* is the length of the gap, in bytes. For `ND_CHECK_SIZE()`, the ++ length of the gap, in bytes, is the size of an item of the data type ++ to which *p* points. For `ND_CHECK_LEN()`, *l* is the length of the ++ gap, in bytes. ++ ++ For the `GET_*()` and `ND_TCHECK_*` macros (if not already done): + * Assign: `ndo->ndo_protocol = "protocol";` + * Define: `ND_LONGJMP_FROM_TCHECK` before including `netdissect.h` + * Make sure that the intersection of `GET_*()` and `ND_TCHECK_*()` is minimal, + but at the same time their union covers all packet data in all cases. + + You can test the code via: + ``` + sudo ./tcpdump -s snaplen [-v][v][...] -i lo # in a terminal + sudo tcpreplay -i lo sample.pcap # in another terminal + ``` + You should try several values for snaplen to do various truncation. + - * Do invalid packet checks in code: Think that your code can receive in input ++* The `GET_*()` macros that fetch integral values are: ++ ``` ++ GET_U_1(p) ++ GET_S_1(p) ++ GET_BE_U_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } ++ GET_BE_S_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } ++ GET_LE_U_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } ++ GET_LE_S_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } ++ ``` ++ ++ where *p* points to the integral value in the packet buffer. The ++ macro returns the integral value at that location. ++ ++ `U` indicates that an unsigned value is fetched; `S` indicates that a ++ signed value is fetched. For multi-byte values, `BE` indicates that ++ a big-endian value ("network byte order") is fetched, and `LE` ++ indicates that a little-endian value is fetched. *n* is the length, ++ in bytes, of the multi-byte integral value to be fetched. ++ ++ In addition to the bounds checking the `GET_*()` macros perform, ++ using those macros has other advantages: ++ ++ * tcpdump runs on both big-endian and little-endian systems, so ++ fetches of multi-byte integral values must be done in a fashion ++ that works regardless of the byte order of the machine running ++ tcpdump. The `GET_BE_*()` macros will fetch a big-endian value and ++ return a host-byte-order value on both big-endian and little-endian ++ machines, and the `GET_LE_*()` macros will fetch a little-endian ++ value and return a host-byte-order value on both big-endian and ++ little-endian machines. ++ ++ * tcpdump runs on machines that do not support unaligned access to ++ multi-byte values, and packet values are not guaranteed to be ++ aligned on the proper boundary. The `GET_BE_*()` and `GET_LE_*()` ++ macros will fetch values even if they are not aligned on the proper ++ boundary. ++ ++* The `GET_*()` macros that fetch IPv4 address values are: ++ ``` ++ GET_IPV4_TO_HOST_ORDER(p) ++ GET_IPV4_TO_NETWORK_ORDER(p) ++ ``` ++ ++ where *p* points to the address in the packet buffer. ++ `GET_IPV4_TO_HOST_ORDER()` returns the address in the byte order of ++ the host that is running tcpdump; `GET_IPV4_TO_NETWORK_ORDER()` ++ returns it in network byte order. ++ ++ Like the integral `GET_*()` macros, these macros work correctly on ++ both big-endian and little-endian machines and will fetch values even ++ if they are not aligned on the proper boundary. ++ ++* The `GET_*()` macro that fetches an arbitrary sequences of bytes is: ++ ``` ++ GET_CPY_BYTES(dst, p, len) ++ ``` ++ ++ where *dst* is the destination to which the sequence of bytes should ++ be copied, *p* points to the first byte of the sequence of bytes, and ++ *len* is the number of bytes to be copied. The bytes are copied in ++ the order in which they appear in the packet. ++ ++* To fetch a network address and convert it to a printable string, use ++ the following `GET_*()` macros, defined in `addrtoname.h`, to ++ perform bounds checks to make sure the entire address is within the ++ buffer and to translate the address to a string to print: ++ ``` ++ GET_IPADDR_STRING(p) ++ GET_IP6ADDR_STRING(p) ++ GET_MAC48_STRING(p) ++ GET_EUI64_STRING(p) ++ GET_EUI64LE_STRING(p) ++ GET_LINKADDR_STRING(p, type, len) ++ GET_ISONSAP_STRING(nsap, nsap_length) ++ ``` ++ ++ `GET_IPADDR_STRING()` fetches an IPv4 address pointed to by *p* and ++ returns a string that is either a host name, if the `-n` flag wasn't ++ specified and a host name could be found for the address, or the ++ standard XXX.XXX.XXX.XXX-style representation of the address. ++ ++ `GET_IP6ADDR_STRING()` fetches an IPv6 address pointed to by *p* and ++ returns a string that is either a host name, if the `-n` flag wasn't ++ specified and a host name could be found for the address, or the ++ standard XXXX::XXXX-style representation of the address. ++ ++ `GET_MAC48_STRING()` fetches a 48-bit MAC address (Ethernet, 802.11, ++ etc.) pointed to by *p* and returns a string that is either a host ++ name, if the `-n` flag wasn't specified and a host name could be ++ found in the ethers file for the address, or the standard ++ XX:XX:XX:XX:XX:XX-style representation of the address. ++ ++ `GET_EUI64_STRING()` fetches a 64-bit EUI pointed to by *p* and ++ returns a string that is the standard XX:XX:XX:XX:XX:XX:XX:XX-style ++ representation of the address. ++ ++ `GET_EUI64LE_STRING()` fetches a 64-bit EUI, in reverse byte order, ++ pointed to by *p* and returns a string that is the standard ++ XX:XX:XX:XX:XX:XX:XX:XX-style representation of the address. ++ ++ `GET_LINKADDR_STRING()` fetches an octet string, of length *length* ++ and type *type*, pointed to by *p* and returns a string whose format ++ depends on the value of *type*: ++ ++ * `LINKADDR_MAC48` - if the length is 6, the string has the same ++ value as `GET_MAC48_STRING()` would return for that address, ++ otherwise, the string is a sequence of XX:XX:... values for the bytes ++ of the address; ++ ++ * `LINKADDR_FRELAY` - the string is "DLCI XXX", where XXX is the ++ DLCI, if the address is a valid Q.922 header, and an error indication ++ otherwise; ++ ++ * `LINKADDR_EUI64`, `LINKADDR_ATM`, `LINKADDR_OTHER` - ++ the string is a sequence of XX:XX:... values for the bytes ++ of the address. ++ ++6) When defining a structure corresponding to a packet or part of a ++ packet, so that a pointer to packet data can be cast to a pointer to ++ that structure and that structure pointer used to refer to fields in ++ the packet, use the `nd_*` types for the structure members. ++ ++ Those types all are aligned only on a 1-byte boundary, so a ++ compiler will not assume that the structure is aligned on a boundary ++ stricter than one byte; there is no guarantee that fields in packets ++ are aligned on any particular boundary. ++ ++ This means that all padding in the structure must be explicitly ++ declared as fields in the structure. ++ ++ The `nd_*` types for integral values are: ++ ++ * `nd_uintN_t`, for unsigned integral values, where *N* is the number ++ of bytes in the value. ++ * `nd_intN_t`, for signed integral values, where *N* is the number ++ of bytes in the value. ++ ++ The `nd_*` types for IP addresses are: ++ ++ * `nd_ipv4`, for IPv4 addresses; ++ * `nd_ipv6`, for IPv6 addresses. ++ ++ The `nd_*` types for link-layer addresses are: ++ ++ * `nd_mac48`, for MAC-48 (Ethernet, 802.11, etc.) addresses; ++ * `nd_eui64`, for EUI-64 values. ++ ++ The `nd_*` type for a byte in a sequence of bytes is `nd_byte`; an ++ *N*-byte sequence should be declared as `nd_byte[N]`. ++ ++7) Do invalid packet checks in code: Think that your code can receive in input + not only a valid packet but any arbitrary random sequence of octets (packet + * built malformed originally by the sender or by a fuzz tester, + * became corrupted in transit or for some other reason). + + Print with: `nd_print_invalid(ndo); /* to print " (invalid)" */` + - * Use `struct tok` for indexed strings and print them with ++8) Use `struct tok` for indexed strings and print them with + `tok2str()` or `bittok2str()` (for flags). ++ All `struct tok` must end with `{ 0, NULL }`. + - * Avoid empty lines in output of printers. ++9) Avoid empty lines in output of printers. + - * A commit message must have: ++10) A commit message must have: + ``` + First line: Capitalized short summary in the imperative (50 chars or less) + + If the commit concerns a protocol, the summary line must start with + "protocol: ". + + Body: Detailed explanatory text, if necessary. Fold it to approximately + 72 characters. There must be an empty line separating the summary from + the body. + ``` + - * Avoid non-ASCII characters in code and commit messages. ++11) Avoid non-ASCII characters in code and commit messages. + - * Use the style of the modified sources. ++12) Use the style of the modified sources. + - * Don't mix declarations and code. ++13) Don't mix declarations and code. + - * Don't use `//` for comments. - Not all C compilers accept C++/C99 comments by default. ++14) tcpdump requires a compiler that supports C99 or later, so C99 ++ features may be used in code, but C11 or later features should not be ++ used. + - * Avoid trailing tabs/spaces ++15) Avoid trailing tabs/spaces diff --cc contrib/tcpdump/autogen.sh index 000000000000,000000000000..c84a6b5c5dd2 new file mode 100755 --- /dev/null +++ b/contrib/tcpdump/autogen.sh @@@ -1,0 -1,0 +1,25 @@@ ++#!/bin/sh -e ++ ++: "${AUTORECONF:=autoreconf}" ++ ++AUTORECONFVERSION=`$AUTORECONF --version 2>&1 | grep "^autoreconf" | sed 's/.*) *//'` ++ ++maj=`echo "$AUTORECONFVERSION" | cut -d. -f1` ++min=`echo "$AUTORECONFVERSION" | cut -d. -f2` ++# The minimum required version of autoconf is currently 2.69. ++if [ "$maj" = "" ] || [ "$min" = "" ] || \ ++ [ "$maj" -lt 2 ] || { [ "$maj" -eq 2 ] && [ "$min" -lt 69 ]; }; then ++ cat >&2 <<-EOF ++ Please install the 'autoconf' package version 2.69 or later. ++ If version 2.69 or later is already installed and there is no ++ autoconf default, it may be necessary to set the AUTORECONF ++ environment variable to enable the one to use, like: ++ AUTORECONF=autoreconf-2.69 ./autogen.sh ++ or ++ AUTORECONF=autoreconf-2.71 ./autogen.sh ++ EOF ++ exit 1 ++fi ++ ++echo "$AUTORECONF identification: $AUTORECONFVERSION" ++"$AUTORECONF" -f diff --cc contrib/tcpdump/config.guess index 69188da73d74,000000000000..f6d217a49f8f mode 100755,000000..100755 --- a/contrib/tcpdump/config.guess +++ b/contrib/tcpdump/config.guess @@@ -1,1774 -1,0 +1,1812 @@@ +#! /bin/sh +# Attempt to guess a canonical system name. - # Copyright 1992-2023 Free Software Foundation, Inc. ++# Copyright 1992-2024 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + - timestamp='2023-01-01' ++timestamp='2024-01-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + - Output the configuration name of the system \`$me' is run on. ++Output the configuration name of the system '$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. - Copyright 1992-2023 Free Software Foundation, Inc. ++Copyright 1992-2024 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" - Try \`$me --help' for more information." ++Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# Just in case it came from the environment. +GUESS= + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + - # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still - # use `HOST_CC' if defined, but it is deprecated. ++# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still ++# use 'HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case $UNAME_SYSTEM in +Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" ++ #if defined(__ANDROID__) ++ LIBC=android ++ #else + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu ++ #elif defined(__LLVM_LIBC__) ++ LIBC=llvm + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif ++ #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case $UNAME_VERSION in + Debian*) *** 5498 LINES SKIPPED *** From nobody Mon Sep 23 23:52:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCKYC5hMdz5Wjc1; Mon, 23 Sep 2024 23:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCKYC5DLtz41Kd; Mon, 23 Sep 2024 23:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727135551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GnRC7njLYc4bhKCWYlNYjVoV7rFk42sMLxQQTOFqFaQ=; b=Vq97rNCP1Nu4czUn7ggMWcJhvUm28UNzgwyV6ppCPdLXDzIPzAGRMch67L5PDP1dUqe0tT U101YCJnN5cQPOv1/AOQ4sQHKeJgWlTehQfBBVD8vbDji6L9FFrqlOgLg2fQfUHCDtJc2e vHWJCn9fGRSBDn382SnZzixmyUgzs9lpZZVgTOPruvkrPZB6qytI/qOh9w2slj0sxbDieM VrBLgKdJCEoH6JEkKQOH2litesUNyzMh/FQSYqko2jBNiQsEwzF4aEnXadL89GSbLm2ANn AArxQXmIHr2VfFMyeGwDUyHz6ZGugloV+t+64+lBC8W6TMkITmO69FbZVrnOWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727135551; a=rsa-sha256; cv=none; b=WFIZvFQSb9ml+7kxEHOjLhT12kBlvnK22yCpdPxDWm39iJytkG5WToiIB6Nm7cqFedIoRM l+FeMDPaqNkpyujAqhm3lxQCUqHqXYK8q3CBaw8ejDi2k4/TG1pSHmCLx4eahcsH0xPt6B 1N/d/Bvg9cDXjAGQLr5DJhCnfShd+dxpbDaHjK314f7z9hNUXpkzcKzLSoxbglF1BfHI/c HN2lQBA2XL19DQrwP688Uyj4ovgrQP+pokablIB4saM8bvc2zsRIt/IzLfOSNdz+1wS+Gs TGPf0G+Q/u71b4nQm8fmOrRmWqcZ0QpfgCvyqfXkf3sx26uQKMFtXbmoYNKqEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727135551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GnRC7njLYc4bhKCWYlNYjVoV7rFk42sMLxQQTOFqFaQ=; b=Pg9hskf5/zDrlNY4/Zznh1LaxCQEi60JtXXDGTq9WLjhvbVWYGDp8rLC5WpHPcJnUTgNvb tZhILuZQoFeWGMTtreuwQ+kO9E7ZaXIb/QhGbt7WzhmrFi9aCd+clvMGNURDp9izI9OqCa f+YOfK1lsjK75ZtraV1PIgQDnfTa/Yzgwgh3jgI5qpgHQXC82A29aDnGnRuADBa9EZbK7L cmRfSTod2cJvHT+ldUZhHPl6Oftfxyz5SN49TmiZKCuyOp+4JH48SPuFIWNE4Qml0bGzHO bf/KHbp6Nm/XuENeB1xTtEcd+kdlZ3tWRFATbkpdx42vX7v/89UKONyfTe9hTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCKYC4qG4z15GJ; Mon, 23 Sep 2024 23:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48NNqVuZ014618; Mon, 23 Sep 2024 23:52:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48NNqVRU014615; Mon, 23 Sep 2024 23:52:31 GMT (envelope-from git) Date: Mon, 23 Sep 2024 23:52:31 GMT Message-Id: <202409232352.48NNqVRU014615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 018a491dcea9 - main - dirdeps: Update Makefile.depend.host for hosttools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 018a491dcea9ed5402bc7f1f4d8b7b1cf5825b9b Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=018a491dcea9ed5402bc7f1f4d8b7b1cf5825b9b commit 018a491dcea9ed5402bc7f1f4d8b7b1cf5825b9b Author: Ka Ho Ng AuthorDate: 2024-09-23 23:49:38 +0000 Commit: Ka Ho Ng CommitDate: 2024-09-23 23:52:28 +0000 dirdeps: Update Makefile.depend.host for hosttools Sponsored by: Juniper Networks, Inc. --- usr.bin/clang/llvm-tblgen/Makefile.depend.host | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/clang/llvm-tblgen/Makefile.depend.host b/usr.bin/clang/llvm-tblgen/Makefile.depend.host index 2f7a10cf10d6..4ace687cb406 100644 --- a/usr.bin/clang/llvm-tblgen/Makefile.depend.host +++ b/usr.bin/clang/llvm-tblgen/Makefile.depend.host @@ -3,6 +3,7 @@ DIRDEPS = \ lib/clang/libllvmminimal \ lib/ncurses/tinfo \ + usr.bin/clang/llvm-min-tblgen \ .include From nobody Tue Sep 24 00:27:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCLKM26Rdz5WlZy; Tue, 24 Sep 2024 00:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCLKM1Yk8z44qS; Tue, 24 Sep 2024 00:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727137639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ZxCj0sKAUg7peeLLWRFLgSz7pGGjyOpal/QdxF/WXE=; b=fBUanhwFF5YHQn9NncpRhS1p0H4kyjmNdfw8Kb/Vv8Y0ajNCMWSw3h75Kq3N9DJsbWSlTs b/lRq/odYHl+Tpp5TQe4YfbiJbuqcl/F10UmCm7fg7U/p4nqTtiW/P6TneFBIAb19wfdj9 Lqt9NgXH1kEuhc3kyb+tAIujTXVknaVKR04lERNqxKxxet4Ey53gDotCPAKI8bdZrTTMMq 3ENP1re0UQHTXPklD8E8FcaNY2xV3OHjae3jlZKDrj2KdzTzmqQShAuqSsVaoVtx9kbgOi AjAhtg34PtoBoZSyl7e9nLILD70nfqO5Eia8MhuWdOfsAJxQSj60irH0BCRX6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727137639; a=rsa-sha256; cv=none; b=xXs7ovq70W+fpJ1TIwUAH45/0SprX/DmfYv43h9Vlr/HZVXHlc1KV9Ws0Ll0BKByflamuS uuIQCY+JjduRvRrSdhbfS5lY4GRoZ9ge0h4fwuRHnzJ1b2WeiC1bT394CKB/SJpoER1W1s Dn3v4iD6xnU2/A3ZbGQ9DZvpmuc8ZkkX/HvCUIZ2YPPXxCmwipZzlnf3bToEmUvOO3ur5X I+7LTIetYyP5TIUQ977xO8P0yCWt2ULN+G8pI/0/WuG5xhTVMyuOlb5QlrGUA/Z+o/nJSB dvXnigNNis0hGmhT1tLA25AutsLs41yeYF9QGqedgxgTfNnmieKvip3OQGlb/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727137639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ZxCj0sKAUg7peeLLWRFLgSz7pGGjyOpal/QdxF/WXE=; b=A7cFeNqvgpahmqdfmNKnwUkK3z4c8dck1C01UgTLVOKeOBGuEne5wZENIM++gXCJEZDMdp j3lWAzy1Ll/IQdIYbd3xekX6aaeoUbqO29ffn50ZPhlx3Epx2Fpa1fklxIdM5pRmU+/Lou O0BiNmuR+p+54pOvfj/OoW6C5jo/JEPtE0zjH8GdTIFRFrsh7+lt8j8XTqawoZVdG2UROT D8fG8yL6cHMRkXXPhZEGD4fZsjVV4foZHPxZ6WFssStzGbBDgTJIN7tAhXCM1OyG23+XO6 Tckr3cJr4JkvK0lfX2SZNlHgygdbq/FBbQX73fUBnHcKGJd3yG3aQe5WqnSdNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCLKM0m3Fz16Kx; Tue, 24 Sep 2024 00:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48O0RIOi066982; Tue, 24 Sep 2024 00:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48O0RIjZ066979; Tue, 24 Sep 2024 00:27:18 GMT (envelope-from git) Date: Tue, 24 Sep 2024 00:27:18 GMT Message-Id: <202409240027.48O0RIjZ066979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 8067debcd19f - main - dirdeps: update/fix Makefile.depend.host for hosttools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8067debcd19f18a60d79d91f3b5107eed2a6faae Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=8067debcd19f18a60d79d91f3b5107eed2a6faae commit 8067debcd19f18a60d79d91f3b5107eed2a6faae Author: Ka Ho Ng AuthorDate: 2024-09-24 00:15:48 +0000 Commit: Ka Ho Ng CommitDate: 2024-09-24 00:26:20 +0000 dirdeps: update/fix Makefile.depend.host for hosttools There were some leftover bits not picked up in 018a491dcea9. Sponsored by: Juniper Networks, Inc. --- usr.bin/clang/clang-tblgen/Makefile.depend.host | 1 - usr.bin/clang/llvm-min-tblgen/Makefile.depend.host | 11 +++++++++++ usr.bin/clang/llvm-tblgen/Makefile.depend.host | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/usr.bin/clang/clang-tblgen/Makefile.depend.host b/usr.bin/clang/clang-tblgen/Makefile.depend.host index 8127b03d8797..5ae6e1d38324 100644 --- a/usr.bin/clang/clang-tblgen/Makefile.depend.host +++ b/usr.bin/clang/clang-tblgen/Makefile.depend.host @@ -3,7 +3,6 @@ DIRDEPS = \ lib/clang/libclangminimal \ lib/clang/libllvmminimal \ - lib/ncurses/tinfo \ .include diff --git a/usr.bin/clang/llvm-min-tblgen/Makefile.depend.host b/usr.bin/clang/llvm-min-tblgen/Makefile.depend.host new file mode 100644 index 000000000000..e41a35dcde12 --- /dev/null +++ b/usr.bin/clang/llvm-min-tblgen/Makefile.depend.host @@ -0,0 +1,11 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + lib/clang/libllvmminimal \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.bin/clang/llvm-tblgen/Makefile.depend.host b/usr.bin/clang/llvm-tblgen/Makefile.depend.host index 4ace687cb406..1f33aa35999a 100644 --- a/usr.bin/clang/llvm-tblgen/Makefile.depend.host +++ b/usr.bin/clang/llvm-tblgen/Makefile.depend.host @@ -2,7 +2,6 @@ DIRDEPS = \ lib/clang/libllvmminimal \ - lib/ncurses/tinfo \ usr.bin/clang/llvm-min-tblgen \ From nobody Tue Sep 24 01:25:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCMc34Zw9z5X4vl; Tue, 24 Sep 2024 01:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCMc33zZGz4CfR; Tue, 24 Sep 2024 01:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727141107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xhCG//5EvfDrIKfotDaiBXWmI2ckEOj8fZK8YKAkcrc=; b=jheufYu/0jPfQPa/2a2Rkpgl6wucBGOJV8WtfWkNC7aqhmqXVAmsWV7BcBDpXRemUskXx7 TNSEv7MZfDKvAQzpIk23zLQFs1MkIHf5J6kSOg/kMK6uD+hqQAecmqsDE9KeL648MmOJGP Iw/aGO486yxtUuvk7lhGDoloY6gReciPyDwRPL2ka9CSc63Ju9QusraEO4q21Kp9f/BERn jYCjupLccOKjAediE+4pqI0ztDXwkGV2fcQTFl4dSLNuyJA3N/daEBUd0uK92pw/LeGcGz 4xQ13VLj5vTCKcUDE8M6cOdcNY9Lm/+89+I6OYbVB1e2yoGhlhdwfnZ8LIxvjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727141107; a=rsa-sha256; cv=none; b=QgvRW1Y07OGpQRl6E0GCw6B6dOgiVHM6kFg2eti/tYKgIGoCIHHLfJSltHKia+Gl4DirLp EsHdF3s9slzeMpBqb1qvcfCdo/twbfx+NSOg/cbJ2OZk5gF1MCxuIYejfiJZXi2JuuDeXD lG4TCCqrvr/6GAJKqci9OWNdIg1MsFicU7ycHW8IRa6UFLNOmxPT4VyGRjUn2pTetyQcff usZXyDXo9tx83hJWh8iLPWi5+k+PBybnxd2svDBZACMvAfHS8v1tWR076oVPRvDYh8tZ8m StvjxRh6qmT7QMdeYXpGVpqeM7KLCOwHNBaFMmPdy7IEVhavTnOn1hSZrr3U3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727141107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xhCG//5EvfDrIKfotDaiBXWmI2ckEOj8fZK8YKAkcrc=; b=tuDrEV3iSvozdMYm0z5OFhxD7LqEIoVrCWuBfrn8BHTcPOZgtV8sF3CdPUkaoHWF0vkBxl B/NeHDaxdvesqo0z3su8NVgc+fIOVmNb0+EpqTJuk44Al2tVVKbBEk6IzLUJSPHr1yJjl8 qlb3crur2HXRu6GZLbCQSsoCnE64+NNQm5s4xfL7v86/7Fcuo+mQq6DHQpfTgCaoNeC+0N 8oq0pwa1YXB5MrPYSH4Q+s/+DdNzEAGf/qyr/3jwgeeB3HIXytHkqhmXwc/yVID5+2crlM I+Bnqnw38eMZp27ZsJfu9WvckD0WLbm9hyOXTvc2SKQIzWspgz2J/Lv4/dlkIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCMc33ZWxz17mD; Tue, 24 Sep 2024 01:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48O1P7Uo068359; Tue, 24 Sep 2024 01:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48O1P7le068356; Tue, 24 Sep 2024 01:25:07 GMT (envelope-from git) Date: Tue, 24 Sep 2024 01:25:07 GMT Message-Id: <202409240125.48O1P7le068356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 306113630dd6 - main - libthr: add libsys for dirdeps build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 306113630dd67c55975acd20bfa08931e3aa6637 Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=306113630dd67c55975acd20bfa08931e3aa6637 commit 306113630dd67c55975acd20bfa08931e3aa6637 Author: Ka Ho Ng AuthorDate: 2024-09-24 01:23:48 +0000 Commit: Ka Ho Ng CommitDate: 2024-09-24 01:24:36 +0000 libthr: add libsys for dirdeps build Sponsored by: Juniper Networks, Inc. --- lib/libthr/Makefile.depend | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libthr/Makefile.depend b/lib/libthr/Makefile.depend index 40575a605e97..2f0697372a4a 100644 --- a/lib/libthr/Makefile.depend +++ b/lib/libthr/Makefile.depend @@ -6,6 +6,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libsys \ usr.bin/awk.host \ From nobody Tue Sep 24 01:25:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCMc509zRz5X53X; Tue, 24 Sep 2024 01:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCMc44wSCz4CmV; Tue, 24 Sep 2024 01:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727141108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9EXF9RyO3hmGKgcQOCf8u1Rh1EbdZl6VxQFty1GHb+w=; b=QQlWxtiUVR3hnPvz9rf2vIIjBl/9RdWW3u18utg9Or13SkstCzoKNngBsYaoHE9Q/2iw8H 4BX8GJT2LdIatspucmluMj61U0zJzT2IqWedshvCkgzKu9rdE9bGREaW/9+VwAgw4Vf+JY sbS304yqhLxHVwbkEt6qiS4r97/Akd6UhE0J0IGu3e/FITYWF13+1gLmvvbqhSH11Qt74a aD/Ki4i/+j7mBpsVUkTmEhK8Re3k6Lm/t8zeg+gznnpJczkkZuj80ZRfVkuXkoQ4auo8KC POf0YQZezwh0ro3p9UvT01UrYinpVTW6g0Y9nIXH1AgvsnwpIBRU0aOt2j8uag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727141108; a=rsa-sha256; cv=none; b=jUMvaQBxkymU9b8eSuLzsNUw8BdW5z6C9myyHxqxYDPjOPLD0URB+oj3vD3cO248giZ8mN zpX/HmMueLZmsmE9qomUKHzBxfIzXcR+yRrdLFx8XHYPhMIsDnxvbhtJtWJtYtMIS7sQpp J/JMQIB4vyQO34OQRrgrZ/3qUVZzVstZN6DlZLlc0JSKM66V6CEEyB5nF+dFXke6gF6aKh 8ywS8d9vywS2JS6M6WfkAVKgWIGeW3DcX4rKAAqYdfGK8noa7CePz7+3jOfvyrR45te8gi L2pQqZS6qEIKfbfCofK1ew/hVwZ1LpFVjRFsFT3FsWgJkPgh9mfEuJZjFuV0oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727141108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9EXF9RyO3hmGKgcQOCf8u1Rh1EbdZl6VxQFty1GHb+w=; b=Y2WJ+ogBuk6YpfUAJi0eOERgFoVN8xm+FiuK+2Qf1w7GU916XgjRoHOjttfI4Q2ckW28O/ oKLhKRZqEqrX3d2iVmlUJNt99Ns5HQN0r1WMUB/us9vG3SUopLkUMmR9RBiZ5B+g8+ejMD F1md4B8vF7IP555c327S9mTD4v3uxP919A/wHwIcn8THE00q/TZEof/jBQIYu3rELNVyiP nLDiCuX+HuSHFABMco4rr6noIMDY7um6aEL28pBrQqf6+2yvqDYDy4UmEJ5oU4+wXhf+I3 DWAYeBR61W69o+QKjwoug5MgaL14cTenxh2uOBhKjCtXInY4j0WX2i4B1j5Xvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCMc44XTdz17mF; Tue, 24 Sep 2024 01:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48O1P8o7068404; Tue, 24 Sep 2024 01:25:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48O1P8Qr068401; Tue, 24 Sep 2024 01:25:08 GMT (envelope-from git) Date: Tue, 24 Sep 2024 01:25:08 GMT Message-Id: <202409240125.48O1P8Qr068401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 1d910b5f8819 - main - dirdeps: update Makefile.depend for toolchain List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d910b5f88197de4f43c2c464bda1000e4df8ba8 Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=1d910b5f88197de4f43c2c464bda1000e4df8ba8 commit 1d910b5f88197de4f43c2c464bda1000e4df8ba8 Author: Ka Ho Ng AuthorDate: 2024-09-24 01:02:27 +0000 Commit: Ka Ho Ng CommitDate: 2024-09-24 01:24:45 +0000 dirdeps: update Makefile.depend for toolchain Sponsored by: Juniper Networks, Inc. --- lib/clang/libllvm/Makefile.depend | 1 + usr.bin/clang/llvm-min-tblgen/Makefile.depend | 24 ++++++++++++++++++++++++ usr.bin/clang/llvm-tblgen/Makefile.depend | 1 + 3 files changed, 26 insertions(+) diff --git a/lib/clang/libllvm/Makefile.depend b/lib/clang/libllvm/Makefile.depend index d2461af845e4..e3399cc28b1c 100644 --- a/lib/clang/libllvm/Makefile.depend +++ b/lib/clang/libllvm/Makefile.depend @@ -7,6 +7,7 @@ DIRDEPS = \ lib/libexecinfo \ lib/libz \ lib/msun \ + usr.bin/clang/llvm-min-tblgen.host \ usr.bin/clang/llvm-tblgen.host \ diff --git a/usr.bin/clang/llvm-min-tblgen/Makefile.depend b/usr.bin/clang/llvm-min-tblgen/Makefile.depend new file mode 100644 index 000000000000..bb8d5321da66 --- /dev/null +++ b/usr.bin/clang/llvm-min-tblgen/Makefile.depend @@ -0,0 +1,24 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libllvm \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libcxxrt \ + lib/libexecinfo \ + lib/libthr \ + lib/libz \ + lib/libzstd \ + lib/msun \ + lib/ncurses/tinfo \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.bin/clang/llvm-tblgen/Makefile.depend b/usr.bin/clang/llvm-tblgen/Makefile.depend index bb8d5321da66..a4c44d6cfcfb 100644 --- a/usr.bin/clang/llvm-tblgen/Makefile.depend +++ b/usr.bin/clang/llvm-tblgen/Makefile.depend @@ -15,6 +15,7 @@ DIRDEPS = \ lib/libzstd \ lib/msun \ lib/ncurses/tinfo \ + usr.bin/clang/llvm-min-tblgen.host \ .include From nobody Tue Sep 24 10:04:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCb795xCPz5XbcX; Tue, 24 Sep 2024 10:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCb795NF6z4xJH; Tue, 24 Sep 2024 10:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727172261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/Az2+hEVY9dm7EqGNecfi5Qs5v2VX2UW+jgma/07Yo=; b=oIxcDMADq3u48dGyTuXGrl7Kr01yJRXPA5FRvHY6toZ5vBmuMmI3Dq9jUAGSa9cArIpUiS k7kxFvnw99qQBTR89vdRsP3o+ywoet7OYbEOGQN6d1rBL+uw7j99hVuAAm7AC5rN4SdRgW PrtStT20DXoNh9Qh4wVsR6V9Ivpf5TOluL0IClCxrrVa9dh2pQHUrXzkOnyhsyrD42bfaR WtJ97TyYNWFzwUsXrEMtR2FP8TEL8rjW253z3ZiNeIdhnxYexzCzsCjCvwdY7f8T2Bwmp1 s8JIbBGM3upYXBOaeOyS2iSsduiqC3DytDzeGQABkQwRXHxtXzWu32Wj0FdKYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727172261; a=rsa-sha256; cv=none; b=XXwhuE1qxvZHJlFOsNlKEitSA5I7Dzb4KApdRQ6B3a0FrCRCxZB5WuLjfKp3rLTa0J6AOD nfLqV4yoa4YLckK8avYuA/2RJAlA3wBY/3eGH5ZuegOj/97Iaa4PwT1daDkKeO3/GTr8LF 7WvNJNDa+D9mWafmn4Br8aPEj+Rg2ZcZ6oAVIgJdLP6RpTQzfOqXL2k6vNo1W2Ni+erJ53 r0vY2a0FNpl2BmLQuLo54o1fUFPFl8jyB+r0DxxVmZsebN0S932lRRylK90PBgBP+tULZ1 LvOATxLJcB6cM3jdGn1F1T6xtTdpw87wZeAuD+35DLhjWYyDWddyqTBV1fBHlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727172261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/Az2+hEVY9dm7EqGNecfi5Qs5v2VX2UW+jgma/07Yo=; b=X0SbZIsyXON8E3V3/ztZmz0KG9GgWM+ofjGruOx/M1zwxoi/xPjzTt9gqJ/QNnBeTRBHrx 3i79SHeCfId9EsV+Utg6ULUQHtsOPsULkK2YDWzaIXgIz+E7VdtAXN1S+kUo6DWMfY3JPR sGlgY2YxXA1lxCBtp0keCCR6Huf0L+PT4TFpS8zk/iw2aw/1th5xhux0OnI32PQ3D5+qm4 p4Fklnkxcq0h0szLYTY40uB+YHrma/UCHDU4LuOWMz9474y7BCxOQN+ARplBRJxln0bfg2 A4v5nhvIsKgWtLzmkpp7qmuUVIjCjOJYt/LIL9mbly+olrxwX5QcZlYtG4Z1iA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCb7949pyzPVR; Tue, 24 Sep 2024 10:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OA4LdG058837; Tue, 24 Sep 2024 10:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OA4Laa058834; Tue, 24 Sep 2024 10:04:21 GMT (envelope-from git) Date: Tue, 24 Sep 2024 10:04:21 GMT Message-Id: <202409241004.48OA4Laa058834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: aa7d086ad946 - main - e1000: Add sysctls for some missing MAC stats List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa7d086ad94642fa40375db9976177fc9e54a2cf Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=aa7d086ad94642fa40375db9976177fc9e54a2cf commit aa7d086ad94642fa40375db9976177fc9e54a2cf Author: Kevin Bowling AuthorDate: 2024-09-24 09:39:33 +0000 Commit: Kevin Bowling CommitDate: 2024-09-24 10:00:18 +0000 e1000: Add sysctls for some missing MAC stats MFC after: 1 week Sponsored by: Blue Box Systems --- sys/dev/e1000/if_em.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index e2d8535143ef..5fb46c9f6dce 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4304,6 +4304,10 @@ em_update_stats_counters(struct e1000_softc *sc) sc->stats.roc += E1000_READ_REG(&sc->hw, E1000_ROC); sc->stats.rjc += E1000_READ_REG(&sc->hw, E1000_RJC); + sc->stats.mgprc += E1000_READ_REG(&sc->hw, E1000_MGTPRC); + sc->stats.mgpdc += E1000_READ_REG(&sc->hw, E1000_MGTPDC); + sc->stats.mgptc += E1000_READ_REG(&sc->hw, E1000_MGTPTC); + sc->stats.tor += E1000_READ_REG(&sc->hw, E1000_TORH); sc->stats.tot += E1000_READ_REG(&sc->hw, E1000_TOTH); @@ -4520,6 +4524,9 @@ em_add_hw_stats(struct e1000_softc *sc) SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "missed_packets", CTLFLAG_RD, &sc->stats.mpc, "Missed Packets"); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "recv_length_errors", + CTLFLAG_RD, &sc->stats.rlec, + "Receive Length Errors"); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", CTLFLAG_RD, &sc->stats.rnbc, "Receive No Buffers"); @@ -4560,6 +4567,18 @@ em_add_hw_stats(struct e1000_softc *sc) SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "xoff_txd", CTLFLAG_RD, &sc->stats.xofftxc, "XOFF Transmitted"); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "unsupported_fc_recvd", + CTLFLAG_RD, &sc->stats.fcruc, + "Unsupported Flow Control Received"); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_recvd", + CTLFLAG_RD, &sc->stats.mgprc, + "Management Packets Received"); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_drop", + CTLFLAG_RD, &sc->stats.mgpdc, + "Management Packets Dropped"); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_txd", + CTLFLAG_RD, &sc->stats.mgptc, + "Management Packets Transmitted"); /* Packet Reception Stats */ SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", From nobody Tue Sep 24 10:09:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCbG55Gdnz5Xbss; Tue, 24 Sep 2024 10:10:21 +0000 (UTC) (envelope-from ronald@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCbG54phMz4xr2; Tue, 24 Sep 2024 10:10:21 +0000 (UTC) (envelope-from ronald@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727172621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=50dr2e3nfGDISs9d0y5Z+DTRKHqr804auZDYIo/WbaE=; b=kXBvdz+Zrzd9+lDkInp4kPt78uOKkUSdkmXkKrh9dp1T+ZQPOmnlkabLVAYe7lsl2lcrQL /Qw/a75EdugEgdEZan4n15CHlKxr0SGivjDUaQx6YLZuNK4+ljqTdvxnqm5ZX6r61XN5rF vthXpq7YBo0to1aguyqhxqEHdpm1tk4MT/s8eJIthdUUBmo1+kYzjuSKWqQW/Kl8adr0qL V9yyRBY3kymPNtCZWGwbYzpFl+6d05K8U1PX0CFGtjtAJd3dddp31Ek+hzP87Himv5frmO 5dUotQin0vRWBma0UgbTZEUyL6yz3hYpqz8dwdACEmfJmrV0ThKepbklbuL6oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727172621; a=rsa-sha256; cv=none; b=G27IlyFCvGKZJmaId+iGs+cz9tDw9DohRvyK9XMn75zdgvpedg7bZEYc385S2mJhTiKfgg /XQAX24ttF5xGN4rAaJBk8/yDi/SLy9aqyzQ6ptwEKyjKUrCCWrFkx8sFzp1B9YF9AUcde NhycBR9VVJ4NG9B8T0aRJDG9oBNC6Xb6uMJxN2RO5i0E6eA+BqiDcvQSrghv7zystSNu55 +QRq44QDEb0uQkpqUKkM3MER0lDzyBgIjj2SvB+vz3NU9x+HFTjJM4nyI7IJ/zCmrCzKrM 1lShsgaAVOlDwLHyQt70ZNC9Qs3xG+ztmWjN/qLUcypWZsKPSBcYtRdmB9ghag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727172621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=50dr2e3nfGDISs9d0y5Z+DTRKHqr804auZDYIo/WbaE=; b=AwilxRa5s8PBXYyXhdGYtFKBS7n9Akf6Bo4JYz7bIdC/we8eaDQyJkS5CKgVzzlibSMB4A o6RJv8aFYOvcHXYbEU8He9f59DqoMsZjCgSntmT7bh9DdNyagw4mRJXNROP7yBt1LAtbRy JTLHGKAmQc8mq49vwhZBHTxBJ4Erwy/lM54ahL7YLIMedY53t8qS2i9o8LcuxQmeG6tr8Q NJjcbXlizKDpQp5ymONDp37HH9SkUK97AOQjK6fDrmYcgbYCWHzZ9U6DCCIpsL7GqHEI7R F2PCnQws8nxvS5FImTXqZDC8E489XpfT4YolydjjBWSjC0SkHFQg6F0tmSYZbQ== Received: from [192.168.1.142] (84-105-120-103.cable.dynamic.v4.ziggo.nl [84.105.120.103]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: ronald/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XCbG50Ldpz1RjP; Tue, 24 Sep 2024 10:10:20 +0000 (UTC) (envelope-from ronald@FreeBSD.org) Message-ID: <9ce619ca-07b0-47d6-9ed6-4c6fe5dbd801@FreeBSD.org> Date: Tue, 24 Sep 2024 12:09:03 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 0aabcd75dbc2 - main - EC2: Disable RSA host key generation for sshd To: Colin Percival , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202409180648.48I6mKNj004233@gitrepo.freebsd.org> Content-Language: en-US From: Ronald Klop In-Reply-To: <202409180648.48I6mKNj004233@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Op 18-09-2024 om 08:48 schreef Colin Percival: > The branch main has been updated by cperciva: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0aabcd75dbc2457be65e3c3c46948761ac5e50ed > > commit 0aabcd75dbc2457be65e3c3c46948761ac5e50ed > Author: Colin Percival > AuthorDate: 2024-09-11 05:00:07 +0000 > Commit: Colin Percival > CommitDate: 2024-09-18 06:47:58 +0000 > > EC2: Disable RSA host key generation for sshd > > These are largely obsolete, and generating them is responsible for > over 10% of the total boot time of EC2 instances. > Wouldn't it be a good idea to disable this in general in 15-CURRENT? It wouldn't affect existing installations. Regards, Ronald. > Sponsored by: Amazon > Differential Revision: https://reviews.freebsd.org/D46638 > --- > release/tools/ec2.conf | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf > index 2cca5fa713af..34434f86a0b1 100644 > --- a/release/tools/ec2.conf > +++ b/release/tools/ec2.conf > @@ -71,6 +71,9 @@ ec2_common() { > 's/^#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication no/' \ > ${DESTDIR}/etc/ssh/sshd_config > > + # RSA host keys are obsolete and also very slow to generate > + echo 'sshd_rsa_enable="NO"' >> ${DESTDIR}/etc/rc.conf > + > # Use FreeBSD Update mirrors hosted in AWS > sed -i '' -e 's/update.FreeBSD.org/aws.update.FreeBSD.org/' \ > ${DESTDIR}/etc/freebsd-update.conf > From nobody Tue Sep 24 10:16:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCbPJ6CWbz5Xbqy; Tue, 24 Sep 2024 10:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCbPJ5b6Tz4yFZ; Tue, 24 Sep 2024 10:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727172996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2JU7Q6a56uYUZ8EXZRfEFMGoYwVKFUVi/uSJEmfbBM4=; b=Ifqqu6IsbvRSZFrNJC35Xb7yIgxdtI5Pt92A5k9Ty4G/PXjC/vBk2zPyjRVUrRQAMwHh2j gdn6QChB1LdUlR/R2t4up6OdTTMr9EXP7l6jrFslC2nZTQps0FAxi4YunSA04iPEbZBb9R ZI+PyWP0npFvybwMN7bY9xLqmWDl0bIeZj7TeOZauorad8L5vDk0OBYt95hNEulN+ucq57 gdESIq0TZTGjUOVPD0NTziKICBz4trt5nrBy2EP3PAxURXpiGX+LjKUvXTY5tRbzFrBVe/ I3y52fYw/JeFaOIzsANCXKlCgcYmUwOPUsG5vA7AKnUg26FWrJytW1GoFrJ2UQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727172996; a=rsa-sha256; cv=none; b=N9rvigq0bdlgUJzHzZ3nTtOr4F0ApMaNhSCCr1xEBCxRaYWZZ4STG1i7A/O7L7bipHWeEi Vce4VEotNgkRqcRnrDBTRG4KTZ4Ea+evWk1HBugXBHKRsoQALbyD5VkZp4NFL/e9wsZiBQ A5rDxNd+GTAO1Q8pu3qr72ZmNzACyGX5zyj64ZE3LOlYGUD2u4ZY506LmLR8xa0V16KnBx z2VFTV3unuzFeilH8nTnMmcJDe7PNGF4v7e41lk5jPn0osD8RMEAL9jRvKtdLKhqMpbRmm bvEvIl7jvGptNpgaWni5eA4MePUCI8WNbvaY+o8fX8ZIgLQygz7+bZI0PWwD0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727172996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2JU7Q6a56uYUZ8EXZRfEFMGoYwVKFUVi/uSJEmfbBM4=; b=BIfHu+nm8GYzPEwF1Xe5KHzuPgs+A/+ikvrlSLoMkQNhn1ixgtNMeppdQAheVqDVWRLnvt cF+ruwurzlHHFWCZb6PZEJy4w4KenCixtv3CpG7f3dyGw02HEZSybR3NFR+ncpi2PN7giJ 26cdX0qFQ95ZDC3R1hm0Ud+78XFbix2jp7p50KjjbftSz7K7fBDaRoErIiLC+GSRCVpJWL 4LzPsa25Y5f1iWedO+uMgZI6HTARkLq+d7QYZDMik1EUoSWOcJphZ8Wv/D+bsyYPFYIy+a 4WhrlI964RUMuszB060WgSI9CPi//p9OCmwYq6Oo026wSKVO43GrlgKWsKqdow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCbPJ53n0zPyG; Tue, 24 Sep 2024 10:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OAGa3s076418; Tue, 24 Sep 2024 10:16:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OAGa9h076415; Tue, 24 Sep 2024 10:16:36 GMT (envelope-from git) Date: Tue, 24 Sep 2024 10:16:36 GMT Message-Id: <202409241016.48OAGa9h076415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 2e78e568c268 - main - e1000: Handle igb EEE sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e78e568c268e4ba846ab140d9ac6b42886f8ec7 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2e78e568c268e4ba846ab140d9ac6b42886f8ec7 commit 2e78e568c268e4ba846ab140d9ac6b42886f8ec7 Author: Kevin Bowling AuthorDate: 2024-09-24 10:12:40 +0000 Commit: Kevin Bowling CommitDate: 2024-09-24 10:15:58 +0000 e1000: Handle igb EEE sysctl MFC after: 1 week Sponsored by: Blue Box Systems --- sys/dev/e1000/if_em.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 5fb46c9f6dce..d06627bcfda1 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1094,7 +1094,10 @@ em_if_attach_pre(if_ctx_t ctx) " due to SOL/IDER session.\n"); /* Sysctl for setting Energy Efficient Ethernet */ - hw->dev_spec.ich8lan.eee_disable = eee_setting; + if (hw->mac.type < igb_mac_min) + hw->dev_spec.ich8lan.eee_disable = eee_setting; + else + hw->dev_spec._82575.eee_disable = eee_setting; SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "eee_control", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, em_sysctl_eee, "I", "Disable Energy Efficient Ethernet"); @@ -4981,11 +4984,17 @@ em_sysctl_eee(SYSCTL_HANDLER_ARGS) struct e1000_softc *sc = (struct e1000_softc *) arg1; int error, value; - value = sc->hw.dev_spec.ich8lan.eee_disable; + if (sc->hw.mac.type < igb_mac_min) + value = sc->hw.dev_spec.ich8lan.eee_disable; + else + value = sc->hw.dev_spec._82575.eee_disable; error = sysctl_handle_int(oidp, &value, 0, req); if (error || req->newptr == NULL) return (error); - sc->hw.dev_spec.ich8lan.eee_disable = (value != 0); + if (sc->hw.mac.type < igb_mac_min) + sc->hw.dev_spec.ich8lan.eee_disable = (value != 0); + else + sc->hw.dev_spec._82575.eee_disable = (value != 0); em_if_init(sc->ctx); return (0); From nobody Tue Sep 24 10:48:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCc6Z4C68z5Xdqw; Tue, 24 Sep 2024 10:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCc6Z3XSVz52W5; Tue, 24 Sep 2024 10:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727174934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=za/jhMlg2on0xIUDu/kN6seEpkDc8zvM1X7BMDoYcyA=; b=CQuoUSnkNGAAf/RICm9QTNwuaXcvtYWDrwFAun0nQvw4nwlCeIg+bCJUxkABE/EAe+MCLC 8JYOEYl7iBrJ7KKEY1YGLLi7dILYl/8yjHeBKzgtfuPjFAbB6WU/OG1JDFCA0C0Uns8VW6 R5ljRj8rlWuwW0zs5XiSd9CA0T9E8SExfLJ2SCwFRUakNrcbwn9/NMcA4ZpzQQO0NLRlk3 icJAI6vfcl5BEzMcxsFlOSm4nhqjYLxQ1PGE5gYfmHhdft1AfEldwUYasJAYPRK6u27x4P nKOwOhE/5dEWIe3AtzGxQpV5Q0RkRIdTAUeelyz9Q0hVOHs0RIvh3VusyymniQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727174934; a=rsa-sha256; cv=none; b=t/IiYLMJE1O3XKwih2Q8ojDe3zkRKztUtzqXHWnRZ/YVzdVDiak7GmLv6W74I+nHH2GOrI DYaqiHfE/MzO8xFlbnLlul8AyPpzYnyN9DA+xQIxyIDWoK1D2jgXewoKfFQke9FFBVXjmc UJfqVVJx/EFCfti10icX2azS00DrNZpA9AlHWLOM+v8AM37srafPkcWMqU4Lfo9Lf5MsS0 rFOhGPaBFt8JBSstkeyaD6+vp10orf7IFST5UNXcZOUSjcY2M9v4UFB7KQkvUuNFM++Abg vXBp5tCnG4HWE/wNKJG42indiIGev4tjmPmSH7GCwG35Z+Qxx/4Tu8Sfz5365g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727174934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=za/jhMlg2on0xIUDu/kN6seEpkDc8zvM1X7BMDoYcyA=; b=TmZ4bs7+QvT4CgAY92vvSDTqy3rtjs9f4stC8QYZ72TEXA104Xnp6aof0h2h1xGO5vkO26 nuTUuL9JjJCtXqkXIhR+FXx7hrBvJfZBIvYLHESbqLUtDACox5wUVseHhYKIENiBWGwLwF raJ5XO8p0zr8MCXGPfFFvVoR4hGvkbeMQ1Kmzjfjs1LJ1HOWG55OptHC1LoeMOLmY8Ac6Z fIvFxx6DycanE/TqcEuUwXcybpcvyyqLgdeS160oP4FFtPQUGgp8jJVW0qqfkJADm1Aal7 0MJsKz8SqBR4C01HoR2xWyY/8G/zx75MY7jf3qNbkyR+9kc69txM2Sb9eGiFrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCc6Z2kJ7zQTs; Tue, 24 Sep 2024 10:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OAmsr0027497; Tue, 24 Sep 2024 10:48:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OAmsEl027494; Tue, 24 Sep 2024 10:48:54 GMT (envelope-from git) Date: Tue, 24 Sep 2024 10:48:54 GMT Message-Id: <202409241048.48OAmsEl027494@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c9021340a326 - main - e1000: Add sysctl for igb(4) DMA Coalesce List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9021340a3266f924bf721182f14f2d265d8a82c Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c9021340a3266f924bf721182f14f2d265d8a82c commit c9021340a3266f924bf721182f14f2d265d8a82c Author: Kevin Bowling AuthorDate: 2024-09-24 10:25:24 +0000 Commit: Kevin Bowling CommitDate: 2024-09-24 10:47:05 +0000 e1000: Add sysctl for igb(4) DMA Coalesce This feature can increase efficiency at the expense of latency It does not work well with the default interrupt delay, but expose the otherwise unconnected code in the driver in case people want to experiment. See https://www.intel.com/content/dam/support/us/en/documents/network/adapter/pro100/sb/466827_intel_r__dma_coalescing_white_paper_v003.pdf MFC after: 1 week Sponsored by: Blue Box Systems --- sys/dev/e1000/if_em.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index d06627bcfda1..ad12171487f6 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -354,6 +354,7 @@ static void em_enable_vectors_82574(if_ctx_t); static int em_set_flowcntl(SYSCTL_HANDLER_ARGS); static int em_sysctl_eee(SYSCTL_HANDLER_ARGS); +static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS); static void em_if_led_func(if_ctx_t, int); static int em_get_regs(SYSCTL_HANDLER_ARGS); @@ -855,6 +856,12 @@ em_if_attach_pre(if_ctx_t ctx) CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, em_get_rs, "I", "Dump RS indexes"); + if (hw->mac.type >= e1000_i350) { + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "dmac", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, + igb_sysctl_dmac, "I", "DMA Coalesce"); + } + scctx->isc_tx_nsegments = EM_MAX_SCATTER; scctx->isc_nrxqsets_max = scctx->isc_ntxqsets_max = em_set_num_queues(ctx); if (bootverbose) @@ -4973,6 +4980,55 @@ em_set_flowcntl(SYSCTL_HANDLER_ARGS) return (error); } +/* + * Manage DMA Coalesce: + * Control values: + * 0/1 - off/on + * Legal timer values are: + * 250,500,1000-10000 in thousands + */ +static int +igb_sysctl_dmac(SYSCTL_HANDLER_ARGS) +{ + struct e1000_softc *sc = (struct e1000_softc *) arg1; + int error; + + error = sysctl_handle_int(oidp, &sc->dmac, 0, req); + + if ((error) || (req->newptr == NULL)) + return (error); + + switch (sc->dmac) { + case 0: + /* Disabling */ + break; + case 1: /* Just enable and use default */ + sc->dmac = 1000; + break; + case 250: + case 500: + case 1000: + case 2000: + case 3000: + case 4000: + case 5000: + case 6000: + case 7000: + case 8000: + case 9000: + case 10000: + /* Legal values - allow */ + break; + default: + /* Do nothing, illegal value */ + sc->dmac = 0; + return (EINVAL); + } + /* Reinit the interface */ + em_if_init(sc->ctx); + return (error); +} + /* * Manage Energy Efficient Ethernet: * Control values: From nobody Tue Sep 24 11:00:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCcNV6HX7z5Xf9h; Tue, 24 Sep 2024 11:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCcNV5n5tz53x1; Tue, 24 Sep 2024 11:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727175658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z9AC68vZdipUK4g9Fzn4t0G+1Mz7MtQWT5npRYH/jdw=; b=OssLBpbmTv0HKYZigS9N6L9U7Xtp+U58aDm3wh5Bo0KvxTCavdQ+53c+o9u5SrqWivysxf FbAsUUZU2MyK69eHUQ86YRxNa/xL1Rsb3pOBF1Q14mkWYvbYGyUk4g1sF6rGJeZ+cTVtdz G9Puuas5fOKYZForEcogl3O2ItodhCh+fkJmb94qWERWQKY/H8OG3IOC4IuedeGNnbnXBv +qFjGe4bZWx/12Hv/a7x/C5MA6kSlxzh1Ke4UfFOUZxXbjrTYEjRuyVN+YFeQMrmPdjR7/ fcQP/hI0Fz3diC/7wZD0hXaxj6NuvWTXac1cCsMWrOy3WjhNZXvPt5Ba6V8a1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727175658; a=rsa-sha256; cv=none; b=CbOO5QI16esfmYk5dq3vWxlP3V6tnnuWA+OfefYLLoSlRgeOijgnj47biEYygHJeSiTLID EiIjExCFy7PYt/RuAAFiBP516OmiF/5fKGK74xZfF13LVgIHBoRcwQMZd4myecdCwo2zxP 8Gfl1o5EsKzV9/uCcrEMvuNMtt5BsS5DjgSRSoVUAJZDApvp5vCqcJFEf8FtrwEmXOK2cG SWqv70ULW6zxH95aElzOXQav5ScrybCgk1J4oIM6YLMtowW6BOSm2lX2idTRflmBkSD/0s 5PacuxNbtpih0o5YJ5fYBrcgJfzI5WqJtg1zUsjJGZhvcHsMVGIq9PbNmp+ulQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727175658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z9AC68vZdipUK4g9Fzn4t0G+1Mz7MtQWT5npRYH/jdw=; b=UqC9L7w4JTTEPKNO7Ar1U53hzKw70C1kLUAfKZDQDm9SZdeG4RTSvwFkUS2GzWWV1Wnj5M HuNRWWQ29AELi3HqKauOAxOBu4d5HnAFuKh+h4hIZRZLkW27i0mokOGJOoKNaxLPiEBP8K gultHkwAeRxmDB2e2lu/o3IDh65EwECTdCQtDkBISVQA/Q6KbWwBxabkZQiRtQEpTnTg1z 3Uwgo6xQ4r+YO10IBieTF74mFuJhZBeEikLMguZfpeP+NpoQm7C9W6eiqQuco/Mudfn5BT /2Xjgxl4nA0dVSYwVtuDJzrDJjmaGVGtJG65tAZaeA1zNEylvMUfuoPjQmTExQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCcNV5FpmzQVj; Tue, 24 Sep 2024 11:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OB0wrR055503; Tue, 24 Sep 2024 11:00:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OB0w4v055500; Tue, 24 Sep 2024 11:00:58 GMT (envelope-from git) Date: Tue, 24 Sep 2024 11:00:58 GMT Message-Id: <202409241100.48OB0w4v055500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: bf085659dac9 - main - Revert "ixl: Increase tx/rx ring size to 8160" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf085659dac9dd32259d05311a0a78d068fd59ef Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=bf085659dac9dd32259d05311a0a78d068fd59ef commit bf085659dac9dd32259d05311a0a78d068fd59ef Author: Kevin Bowling AuthorDate: 2024-09-24 10:58:50 +0000 Commit: Kevin Bowling CommitDate: 2024-09-24 10:58:50 +0000 Revert "ixl: Increase tx/rx ring size to 8160" iflib enforces powerof2 on the ring size: panic: Assertion powerof2(sctx->isc_nrxd_max[i]) Revert until this change is better understood. Reported by: tuexen This reverts commit 14561f1eda85fabfba2d764ca11e064ed871224e. --- sys/dev/ixl/ixl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 042e4e3e6e1a..f45354d29300 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -122,7 +122,7 @@ * The driver currently always uses 32 byte Rx descriptors. */ #define IXL_DEFAULT_RING 1024 -#define IXL_MAX_RING 8160 +#define IXL_MAX_RING 4096 #define IXL_MIN_RING 64 #define IXL_RING_INCREMENT 32 From nobody Tue Sep 24 15:58:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCkzD1m8Sz5Xwn0; Tue, 24 Sep 2024 15:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCkzD1DLzz4Jjd; Tue, 24 Sep 2024 15:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727193480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OukdR4d4mSqQ7m4paToZRfkyh7x2O10rZM04Fjp0geQ=; b=KVXVdJ34toLGcQykrR8t/2aH94VkYWbDOEbMJDzvnCD9N1FmMEKxaIXeb8JZs/NKsGCE0Y skOmsH49NN7QGicdXpJ18UmmaL3QLiIKZThXoVFdI90755cO9H+PQZWfHXTrDbBHtjW5Jl MAo8SrPtNUpPkOm0YE0cnK0B8enAvep54mSigLthOSBm728P7MBDEI/VqCDGdd18siFWaD X6rSmYRCVlWHslp8GTGOGI9XiJHE62u5D48GphKCSkuc4MA2BbLMoJXS98k94xk7iVhwmg KrwbeJtkh388hHhMWi/0FbaA3QIIENoM4U6xcrJmBpEyx9MtPCZXgphPSupuEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727193480; a=rsa-sha256; cv=none; b=HHw3lmjtiXXjgeIyAfV68GXXtbDNc9wNFyuw5kngruivm6+4jIW4JHxTIhtxSruzAXAr+Y Rk8u4EUr9TwtVpezRu+MJ2acGGUDn8B2dCH8V+LzRn0Eq7/AfxiKzDCK5J8WbumwCLxTkQ dFDExzYI3ne8geFRFH2aZx3RT2wa5PpfLdnqDBXZW/+7HXwQ0qToRXy6QBrrU8ngR1Ftk/ xxXlJb4C0gmfEtkxm8Ol6AODMCnbRiGK24W9IJWW0vTu302pckYb5ZX4ldYjh3irp6Ob59 EcheCEZjVCq/e/Afa68hjU/MEz9DNjtjpqitIHm6jLxWgO5LLAhz3HKN1QEtpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727193480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OukdR4d4mSqQ7m4paToZRfkyh7x2O10rZM04Fjp0geQ=; b=ynis88yMKXwgXNqLisZy3YpevqRQ1RcX84tf6tDNN7VfNcbx7luZca6aszmnCKtDsjNg66 0rQ2C8rm5DwzK0xzl1/AjenUgb1tCJz3sglSUb4g4OJSGQC2JT43tVXUC6dgp/bb0wJWoS SSm1HorxMzpDk9ADLZObiPKz2jXuDB9udIzBXUazhfuzXQ4PErpjPj9nOnTOgxrimMkZrQ shSGD1uE1sxSlNejUDtkg6UPshqPdnNKr4BZo25w58hHxXcbMTxrSIgbSMkdT8AuGiT3Bf zIXlTPhVhcN9BECg/0WG+mz/RjNAVUL0otj9cBZyMkOLGdx2qeMyrzgLLKSWvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCkzD0qPWzb8m; Tue, 24 Sep 2024 15:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OFw0Pd056468; Tue, 24 Sep 2024 15:58:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OFw0Xq056465; Tue, 24 Sep 2024 15:58:00 GMT (envelope-from git) Date: Tue, 24 Sep 2024 15:58:00 GMT Message-Id: <202409241558.48OFw0Xq056465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 3883300afe0b - main - cxgbe/t4_tom: Do not set unresolved entries to STALE in t4_l2t_update. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3883300afe0bff5c5658274c4d8cfe773d08343e Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3883300afe0bff5c5658274c4d8cfe773d08343e commit 3883300afe0bff5c5658274c4d8cfe773d08343e Author: Navdeep Parhar AuthorDate: 2024-09-24 14:35:09 +0000 Commit: Navdeep Parhar CommitDate: 2024-09-24 15:53:11 +0000 cxgbe/t4_tom: Do not set unresolved entries to STALE in t4_l2t_update. An L2 entry in the driver's hash was marked STALE unconditionally if it changed in the kernel when its driver refcount is 0. Fix the driver to do this for VALID entries only. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_tom_l2t.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_tom_l2t.c b/sys/dev/cxgbe/tom/t4_tom_l2t.c index be42a887323f..8cc3e633444a 100644 --- a/sys/dev/cxgbe/tom/t4_tom_l2t.c +++ b/sys/dev/cxgbe/tom/t4_tom_l2t.c @@ -441,7 +441,8 @@ t4_l2_update(struct toedev *tod, if_t ifp, struct sockaddr *sa, mtx_lock(&e->lock); if (atomic_load_acq_int(&e->refcnt)) goto found; - e->state = L2T_STATE_STALE; + if (e->state == L2T_STATE_VALID) + e->state = L2T_STATE_STALE; mtx_unlock(&e->lock); break; } From nobody Tue Sep 24 16:42:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XClyy6vMCz5Y3SF; Tue, 24 Sep 2024 16:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XClyy6CVlz4Qny; Tue, 24 Sep 2024 16:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727196170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ddKRrgiEEGN6jXIYNT4pzGuNn6qjiwZSEPRv2Oh41hc=; b=eV4FXCMsHuNF/drzD51FIaVdL51fFKvC0fEqc12n5dXQytmkeGtrdVAegEmyAYSrbhTsT1 4BAikMPmqrSTV6sFVKrDn6fmaIMrSkdSOGk/hLqzYEUxGz3S615amMaBji1GKs/Psu53BZ osupg1D7YBmiOyEwofzBuPquAqmG2H/T5tbslXTZj/pB6gjwbEcnkOnhJ9y7fnXpSZSxHB zlCyuPNaYf8Ij32qGkI/ly6jcYVdRxlJvSP8Y7fBtdd9Ysa5pxILj4qmoOV3dAxWA1MfAM 7WWNZ/3L1CrBe6q63XaH+ZM5+HTQesU/MN/uJSx12NoiuQThEHy3kozCEVtYiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727196170; a=rsa-sha256; cv=none; b=Smzw3sDfxprT4LvGimMdM6R8gd2JyUyU1IDLK2hq7VdW/pmOse/E2f5WuRqH5XvSt7IKFM A9uMKgzXqI+c1GQqkN1c9tFqtSyjxxRWwercfwyxh/Bc9GLJkEn/D0IIzD35V1oxALqiit u7Ce7isphDOFmVvoG7h/qQTEMTSb3wxanR2WNZtb1siq2pZSFYIlHyWv+Rr36WGY0/18np njYi4Txt0q34wtLpJoWbXfp6KaPfNdFOfQVayLdcK1/XX4VjpXFnE/kdjbKh1OTD4DflPE Uk7hBN9rSRo/jKPRF7G4ELzXYjSkYONacvmpuqD8/AmZTUOAOlk2spH6yq73/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727196170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ddKRrgiEEGN6jXIYNT4pzGuNn6qjiwZSEPRv2Oh41hc=; b=Uwh/PgqQSR5Nh0RcWVuQ1HEBQutSJe//DeQzPyIVgQRLL2+jhkccXl4P1qhOUSxOiqAeTg fU5xust8SRQQqETsJ7mlvPKXrjlSWYRgPiv7yryqh0fpXho/P1XqdJgeVQwOX/n+I8/wC9 0hlpDzglR+rg9zE9MBDuhuHgXAhS9RRwQergtQpYrsuxYcQcstYYkRDmVKUFaips1EDs09 GFe/W8tEaIyMUTRrPOP69E+4ObnKv2gKZJ5qhWrpOksDDjN/2TYeZ94lYXTuocFsYpxQI0 +FJbaa0zfzxT8Vf20LxTE5Ga2wcyt1+z5L2OwLLfXtMtBTgsOjTXGbDxFZOlpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XClyy5dd5zcZ6; Tue, 24 Sep 2024 16:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OGgoNI040754; Tue, 24 Sep 2024 16:42:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OGgoWH040751; Tue, 24 Sep 2024 16:42:50 GMT (envelope-from git) Date: Tue, 24 Sep 2024 16:42:50 GMT Message-Id: <202409241642.48OGgoWH040751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 044f94adff55 - main - timeout(1): Update STANDARDS section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 044f94adff55f13130f03c0c170fa879c8febb5b Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=044f94adff55f13130f03c0c170fa879c8febb5b commit 044f94adff55f13130f03c0c170fa879c8febb5b Author: Gordon Bergling AuthorDate: 2024-09-24 16:42:18 +0000 Commit: Gordon Bergling CommitDate: 2024-09-24 16:42:18 +0000 timeout(1): Update STANDARDS section Update the STANDARDS section for timeout(1) to POSIX 1003.1-2024. Update mandoc to be able to render the new POSIX macro. Reviewed by: bapt, bcr Approved by: bapt Obtained from: OpenBSD MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45691 --- bin/timeout/timeout.1 | 8 +++++++- contrib/mandoc/st.c | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 9e624e809376..10e5fd70c393 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 26, 2023 +.Dd June 17, 2024 .Dt TIMEOUT 1 .Os .Sh NAME @@ -195,6 +195,12 @@ $ timeout -k 5s 1m fetch \\ .Xr nohup 1 , .Xr signal 3 , .Xr daemon 8 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2024 +specification. .Sh HISTORY The .Nm diff --git a/contrib/mandoc/st.c b/contrib/mandoc/st.c index ec754cc036f2..266df0081a95 100644 --- a/contrib/mandoc/st.c +++ b/contrib/mandoc/st.c @@ -37,6 +37,7 @@ LINE("-p1003.1-96", "ISO/IEC 9945-1:1996 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-2001", "IEEE Std 1003.1-2001 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-2004", "IEEE Std 1003.1-2004 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-2008", "IEEE Std 1003.1-2008 (\\(lqPOSIX.1\\(rq)") +LINE("-p1003.1-2024", "IEEE Std 1003.1-2024 (\\(lqPOSIX.1\\(rq)") LINE("-p1003.1-2013", "IEEE Std 1003.1-2008, 2013 Edition (\\(LqPOSIX.1\\(Rq)") LINE("-p1003.1-2016", "IEEE Std 1003.1-2008, 2016 Edition (\\(LqPOSIX.1\\(Rq)") LINE("-p1003.1", "IEEE Std 1003.1 (\\(lqPOSIX.1\\(rq)") From nobody Tue Sep 24 16:56:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCmGv544wz5Y3vv; Tue, 24 Sep 2024 16:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCmGv4Dn8z4RT3; Tue, 24 Sep 2024 16:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727196999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hJ0tK2HNNic+icqBWjjiBTqP4aGKZGyB/6L9FTSJhh4=; b=j1QPs6h3ylCXDTN85FHgaS5bB9HcFCmEqUo/VQy3DYtVlXAl/AmWYmtjk1i1HGXuUbmPHS 1zx+EuGCRu74hwnLCLlgVl7AMO4AszOO1kbMFYejhB25fYhF7lOuIE1ny6FS3AfChDhkKl I37e14gZU6RKRC9wmQ5ekrlSAmN5fe+9YF1OqvD+qLB47Z/5I8mv0JSQPdRF3mAQBG+wKZ K0zPc+/frJL5i1GwShsCaw9Bzl0F8JaKcl/flajnAR43QTJqlwAw2r3WZI1QJB3stvupD1 aSCA4ZiRC14lwkxai7TCzEE35TX1kMfsMhLNO3FsVBAsVwwqNg4WxGDdf0sBKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727196999; a=rsa-sha256; cv=none; b=PKRWY+IaXmW+F35HwxeOw2BaKJNzKC5xqHgS59NOMH3s0q/w87Xz4BtiH4MGAoL9hiNsHk VQBjVfGtgUSQzJJ1R0x4oTLowW3TnqD2wa7lyG0AGB1/fxPrSi3AWT4Xf8Hexz+mX60Frc UBv5fTvX0Bnha2juI7SfROaUZz8MZSR+GNl0K4xB6jHyoAfuP4u9IPlekOnTuZonKXHKer j+4Prj6Kbvuj6Rdd949eLUsNECweNBPY8pF+DlmOhcot52rv/v9SM7DhYsqZTt18yRB1cq exGYOT0SUZRNdH8M6mSmu+zWDQC+KJPUSowJ9Iupv781EunyBUTjuAOCstbUPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727196999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hJ0tK2HNNic+icqBWjjiBTqP4aGKZGyB/6L9FTSJhh4=; b=mDsoIhEYQjW7CDT71GTPGgrGY6QP1gvCW6/ZRdC81zrN+hP/pbOyIv5/4p8jDVQHOdXf7/ sV3zQucGvus9et3XN9qWKVM3Crm7O8ztAnmmlNu02HNJnqdP0NLhsQ+RbWN7S5Sf/U9wIA HYjDlmcSef0eTgRF0KC4umPJQFrdKnnW+2bvdMqxBfxst7eIyVM7Nx3/OgtVBOCaewMDpQ 3gvULYNPvX3lQIDGVs6gR72FFzxA0IDh7r87jRewszYmZK3mnhHsIDlXm+GdMC3T25zp6v RCyhrS4mr8eic4TMIFDRlOZGuG4Y0TQc2rX4XPTerhZGPWkkQ3pGO8eSMb67Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCmGv3qc2zcLR; Tue, 24 Sep 2024 16:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OGudBp058850; Tue, 24 Sep 2024 16:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OGudvI058847; Tue, 24 Sep 2024 16:56:39 GMT (envelope-from git) Date: Tue, 24 Sep 2024 16:56:39 GMT Message-Id: <202409241656.48OGudvI058847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3fb656f8ef21 - main - loader: Use printc instead of print to fit in 24,80 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fb656f8ef21332d96de8097521aaa51ddeb649d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3fb656f8ef21332d96de8097521aaa51ddeb649d commit 3fb656f8ef21332d96de8097521aaa51ddeb649d Author: Warner Losh AuthorDate: 2024-09-24 16:52:18 +0000 Commit: Warner Losh CommitDate: 2024-09-24 16:57:11 +0000 loader: Use printc instead of print to fit in 24,80 print automatically adds a newline, while printc does not. Use printc in preference to print for managing the autoboot message. This means we can use line 24 safely on a 24x80 terminal, restoring some functionality that was lost in 101afbc6ee2f0. Note: we still set the default curosor position to 25,1 in screen.lua, but real VT100s (and successors) will treat any row larger than the pnumber of rows in a cursor motion command to be the last physical row (this is so you can move to 9999,9999 and do a cursor location query to get the size of the screen). Keeping that as is looks better on a typical VGA console. Fixes: 101afbc6ee2f0 Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D46771 --- stand/lua/menu.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index ed84360d93b0..5820d80532b5 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -530,6 +530,7 @@ function menu.run() drawn_menu = nil screen.defcursor() + -- We explicitly want the newline print adds print("Exiting menu!") end @@ -544,7 +545,7 @@ function menu.autoboot(delay) if last == nil or last ~= time then last = time screen.setcursor(x, y) - print("Autoboot in " .. time .. + printc("Autoboot in " .. time .. " seconds. [Space] to pause ") screen.defcursor() end @@ -553,9 +554,12 @@ function menu.autoboot(delay) if ch == core.KEY_ENTER then break else - -- erase autoboot msg + -- Erase autoboot msg. While real VT100s + -- wouldn't scroll when receiving a char with + -- the cursor at (24, 79), bad emulators do. + -- Avoid the issue by stopping at 79. screen.setcursor(0, y) - print(string.rep(" ", 80)) + printc(string.rep(" ", 79)) screen.defcursor() return ch end From nobody Tue Sep 24 17:07:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCmWx2ZTxz5Y49L; Tue, 24 Sep 2024 17:07:57 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCmWx1kSPz4Rsl; Tue, 24 Sep 2024 17:07:57 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727197677; 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: in-reply-to:in-reply-to:references:references; bh=AJ81hgUfZwzNNy2mv2Y7c+WcCvirOA0rt0IkQ2wAoVA=; b=ysZR1p4aDb6wixoh1RWAunS441QyjXZ7AzG+6sm+2G3vV2tjUyUaju8kxqzOKPsOgjmHu2 9T13CNuVUPOq/Hk+vrf9LTGycMTVuNvVqjXZ303MDDnU91y3eMqhRe2BYcDA6C7WD94pDv x5edLbhgYHrDOphjZPD1qSmT88Fu4KdRlDVvPlQgv2iPDsQvGHseq5aJLI7YnqTfYQgKle wDqn/S7ZpJcJI1Z237O8U5AnU60QYTdQ7ttXa9ceGPNphnXCg3JrA9gvSmDKXd1kCWjVad ofKB3CMl3ao6XQJSM0DyBjwsmRTpcgKH2bkKDuj0SISOA68EbODfl/KftWOnpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727197677; a=rsa-sha256; cv=none; b=esEbPgnDhhh8vb0U/t15ewg27c/bgnWLpdIWHcHgF/dQzQe6H93e1Rm95Y318KGXJ2nfva gqwG6AayJy2ikQ7rmSwDJhvdgUTCkem/HA4B7jD0ZhDlf+d+Sp9W/f3diK76RPAAkI/bML GvlY6Q+Lik0XH9mSqtV5jxSWEAg+iwR171pcwZr7Ki1KUttBLgzf37NiJZ/ZoxogSshmCE X3FT9ZCsF5zXKugo4ufcu/dsLxDiuiX5RVmPoFrRAOA8KOluFs5VppZVma6P2jyM1zF7E1 G7Wu74FLI7yZ8Dw0/JI9i3f/iQqG3nQYTKC5nfRRHcI3QA6bZQOW59485IKhGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727197677; 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: in-reply-to:in-reply-to:references:references; bh=AJ81hgUfZwzNNy2mv2Y7c+WcCvirOA0rt0IkQ2wAoVA=; b=I+RtdceGy2dflW/fhfySiNXTgz6o2zxajI8lPLo4JA39vvlxAVkxnlsw+fTO5RqWBfWyZf 3+jDJRwYfNsAVN+Cej+qwrZQ5hp2bJI0HEFqtJzYIJ8kUtPLeY+1h4CCo1uBgMWjlDzqCK g/FDIKr9KrU8EJN/fbHQj1ZIw+krgPBe1QcS+KvN+9YQSYoRaitthPVJzbJXASZg3Z/svH wsU4ZYQ+rLW3tfTMTrlvVK1kAzYxVYKmN++2jUwTS6diCB0X4wDc6dgk7wv9jNTYq1GMkm J+xCKA0RLqbZluGKXli22fGNMK140axIJFwrQaeZ87oLp//mCyapwUjgf7frvg== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XCmWx10zqzLfW; Tue, 24 Sep 2024 17:07:57 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 729443C019B; Tue, 24 Sep 2024 17:07:56 +0000 (UTC) Date: Tue, 24 Sep 2024 17:07:56 +0000 From: Brooks Davis To: Gordon Bergling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 044f94adff55 - main - timeout(1): Update STANDARDS section Message-ID: References: <202409241642.48OGgoWH040751@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409241642.48OGgoWH040751@gitrepo.freebsd.org> On Tue, Sep 24, 2024 at 04:42:50PM +0000, Gordon Bergling wrote: > The branch main has been updated by gbe: > > URL: https://cgit.FreeBSD.org/src/commit/?id=044f94adff55f13130f03c0c170fa879c8febb5b > > commit 044f94adff55f13130f03c0c170fa879c8febb5b > Author: Gordon Bergling > AuthorDate: 2024-09-24 16:42:18 +0000 > Commit: Gordon Bergling > CommitDate: 2024-09-24 16:42:18 +0000 > > timeout(1): Update STANDARDS section > > Update the STANDARDS section for timeout(1) to > POSIX 1003.1-2024. > > Update mandoc to be able to render the > new POSIX macro. This should not have been a single commit. mandoc should have been updated first in it's own commit, ideally referencing the upstream commit or better as a full update of mandoc from upstream. -- Brooks From nobody Tue Sep 24 17:30:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCn20322Mz5Y54m; Tue, 24 Sep 2024 17:30:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCn201zDkz4W0G; Tue, 24 Sep 2024 17:30:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727199032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yykni52xMSm+xBnkkkVWxUXFGsUO3xvaoNMSICbRiSk=; b=wCC1CwFoBwR/+YsPl1DYUux16TVo/P1ib2ZuhIUzOW8DGmv5KIiUyEGAEYFTq146VJj/WX rJOM98AI2+WgkeXLxQoe9VqyBHvWSKqlH4EMltpGdCPGbr9ozlp9F3WGGpEeCINWz/S71K RMKQOMcayG0dgAJXgBb/CzzgrMLOUivzncxJ5F24HPGywjJ/EaP5gnoGjQZI4pXibZcn7L 9spfbJW4YRDMs5G6L2Az6axPGmGRe00d/f8Toi4qPbtnRw7SSq7xe1bod7bvCqEpYjXstk OZlSFznPu+37w3F1h1hMW54Tk/P2Be3UW/Yg1+mVcKHTeAJhw4n8FlZNIvLl9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727199032; a=rsa-sha256; cv=none; b=t1jMWwokzGjnaG1C+43oezzCCKPOulIGZ/G1Vlqhv8VwTKV7Y/au8+N+JRK9kvEQ7GGzBs 2cXM/T8fcvxuvIMmaJo290fURRGLcxYz0iZdYeRS5HW5Ksanw6jXQf6zZKzCZOkfBJH0Cz 7v0hiC63hxSZw+AyJNYffhAsEklVTSrtC3oMcM6+YMd7QpKIor6XHz39KSlusp4vNfk0xM y6/sJd5l57Xu8wMlGUn6syvL8OQw4rVbmgZYz4hAk7Nv3S++K1KmljX0zmA9T2slUA6y9R HBzQTJbVMLt9rBPC1jbwoZUIhnuMRSB+tg/Kd9Jasrxl2697bmLhneKhdYuvUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727199032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yykni52xMSm+xBnkkkVWxUXFGsUO3xvaoNMSICbRiSk=; b=b+RSF8M/QKZ5dEBbRRNVIfonpE/Zi7HgpfsxhZfRfzL0SjLAsCQKDWUimcWdq2K5GDVoIa VqGKtSlf/dojNZ9kwe4XpTRV/6NvfbOGZzQaqkX5kpBr1MacO2uo3Mssm9dnSSJEv6I12R JPTea7VdCC8H4hlOQmMhiJxVG4K2KcQ7OjrMtWvbNaBoKHlqNfzNEv93fswQCiBJEWhUMo B+SukMlAxv1S7U96ijL0H08wzVF1/GiHjmZXQ6ITaOxK13EwWLLEatpxIPLg5QAkvWM2Qe Ei9X7OpEQGe1rLlhKntMbPMyP6kzd/lE08ATC+OPtvMvZCYkAefup1fxgIc2QQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCn201Zt9zdnV; Tue, 24 Sep 2024 17:30:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OHUWut019664; Tue, 24 Sep 2024 17:30:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OHUW8F019661; Tue, 24 Sep 2024 17:30:32 GMT (envelope-from git) Date: Tue, 24 Sep 2024 17:30:32 GMT Message-Id: <202409241730.48OHUW8F019661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ce251baf42f3 - main - ipf.5: revert C style(9) applied to man page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce251baf42f32317b4b4ef60203d6f47204c47e9 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ce251baf42f32317b4b4ef60203d6f47204c47e9 commit ce251baf42f32317b4b4ef60203d6f47204c47e9 Author: Graham Percival AuthorDate: 2024-09-24 17:11:33 +0000 Commit: Mitchell Horne CommitDate: 2024-09-24 17:29:39 +0000 ipf.5: revert C style(9) applied to man page These changes were made by accident in: ipfilter: Adjust userland returns to conform to style(9) 2582ae5740181e0d2bab10003d66ae91c9b56329 That commit made similar mistakes in other man pages, but those have already been fixed. Signed-off-by: Graham Percival Reviewed by: mhorne Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1433 --- sbin/ipf/ipf/ipf.5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/ipf/ipf/ipf.5 b/sbin/ipf/ipf/ipf.5 index 7fbba17594ba..9cde8be0b1d5 100644 --- a/sbin/ipf/ipf/ipf.5 +++ b/sbin/ipf/ipf/ipf.5 @@ -223,7 +223,7 @@ To address this problem, a block rule can be qualified in two ways. The first of these is specific to TCP and instructs IPFilter to send back a reset (RST) packet. This packet indicates to the remote system that the packet it sent has been rejected and that it shouldn't make any further -attempts( to send packets to that port. Telling IPFilter to return a TCP); +attempts to send packets to that port. Telling IPFilter to return a TCP RST packet in response to something that has been received is achieved with the return-rst keyword like this: .PP @@ -239,18 +239,18 @@ For all of the other protocols handled by the IP protocol suite, to send back an error indicating that the received packet was dropped requires sending back an ICMP error packet. Whilst these can also be used for TCP, the sending host may not treat the received ICMP error as a hard error -in( the same way as it does the TCP RST packet. To return an ICMP error); +in the same way as it does the TCP RST packet. To return an ICMP error it is necessary to place return-icmp after the block keyword like this: .PP .nf block return-icmp in proto udp from any to 192.168.0.1/24 .fi .PP -When( electing to return an ICMP error packet, it is also possible to); +When electing to return an ICMP error packet, it is also possible to select what type of ICMP error is returned. Whilst the full compliment of ICMP unreachable codes can be used by specifying a number instead of the string below, only the following should be used in conjunction with -return-icmp.( Which return code to use is a choice to be made when); +return-icmp. Which return code to use is a choice to be made when weighing up the pro's and con's. Using some of the codes may make it more obvious that a firewall is being used rather than just the host not responding. From nobody Tue Sep 24 17:58:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCnff3BFzz5Y6Rm; Tue, 24 Sep 2024 17:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCnff2b0jz4dQn; Tue, 24 Sep 2024 17:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727200730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=USSEQyyJmi6e9ZCEuozN1AMAcin7u5GX6pqpQ9Ig+tg=; b=rhnFuDRWLjG35Zo1sQRsLN19Eede1fAZ6oSoHYpMOJvgAL4Uqz21oRBX1UPrmZBJBI9mRs UHlQpGKpMFKoy/6naQQtBXrJqC7qadz2xHqumNs2Krl9vpR9Ws1YDucA3Zy5ns/NuuLNea 4AZoy/oGuV0Kb+xcgX7HG2aBBP6W9Xire7rg0o+RRjmO8Hh+QISeO5Gd73EoXFXHnB6L2l xfveKgPGO1uBDhEhuV/4xqYeaybKKiDYRRzioQ9f9v2LFQuP0s8wU+GOv+xAJSjd3huJoV K0MhmjN0Ole9F9rwpchRzGfHR1JeP4xXXIta7MgtZkEEM93r26qWe5lAFPE/6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727200730; a=rsa-sha256; cv=none; b=ZBJBRFlx9f2p5AIjs3NnBlFpPC6D7V+bNsZQx8e1bUvKH17AEnMyh0ChRB7wQlsDMfdDmO jLHECQPTaW8siRJPipf1nX9vSD6g3J/WGTyulxdWVEfkgtl5/IPCG9cA1hcVb5qClI0StC dISH0c4wrzHb4TiBPemIViQaQ6S+nO1b4v397rsSdSm56dNJI2pV5dDvMttL99qdqdUaAq 8Tc1vmrPOHGmlypIvHGyUYGgdWSkuF9zRd8eIEXuwRCXKDQYiaXjnqm8opnCxtNmwB4nBW 37AWGPzNomySHY6pFl8t2S9B7ReZ5S0iK5YQZjn5nTDVvJCX8fSIfwmDS0i2ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727200730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=USSEQyyJmi6e9ZCEuozN1AMAcin7u5GX6pqpQ9Ig+tg=; b=Li6N91ViI6PBfAytYf0dYegoMNmbZQklNwAiDbMplZj5lDgwrKb0rZ4YOZT0OHb+bU/4OA 4Xnk3PnzpaJWKOjlQp5Hq1GMe+AncGfLcycJ3p4Ae1qwPTbm+g0fqNraHHXL+MGbhglxT3 5hylynCsGq+OvDGez/EOtpEHZV1UdSqGy2y0unzt9PtZKlNLab/kfxm9e0KUsZrm9QTbw3 Yj5x9Famt7U+cR/GalUkhaMUK63UzBasEjNiGgx59Hl450cN/29pJtBtu9UCcZ6jCa1j05 FSbAp6PO5OxlmV5e7keNZHlYu6FWcojHjAj9gVXWUoG7FgLarnx2nKSkEs77yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCnff25QXzdsn; Tue, 24 Sep 2024 17:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OHwoBJ061658; Tue, 24 Sep 2024 17:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OHwoYQ061655; Tue, 24 Sep 2024 17:58:50 GMT (envelope-from git) Date: Tue, 24 Sep 2024 17:58:50 GMT Message-Id: <202409241758.48OHwoYQ061655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3cf834d069d1 - main - linuxulator: ignore AT_NO_AUTOMOUNT for all stat variants List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cf834d069d1dcdbe464ea74624930eaf916715d Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3cf834d069d1dcdbe464ea74624930eaf916715d commit 3cf834d069d1dcdbe464ea74624930eaf916715d Author: Ed Maste AuthorDate: 2024-09-19 21:11:19 +0000 Commit: Ed Maste CommitDate: 2024-09-24 17:58:42 +0000 linuxulator: ignore AT_NO_AUTOMOUNT for all stat variants Commit ff39d74aa99a ignored AT_NO_AUTOMOUNT for statx(), but did not change fstat64() or newfstatat(), which also take an equivalent flags argument. Add a linux_to_bsd_stat_flags() helper and use it in all three places. PR: 281526 Reviewed by: trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46711 --- sys/compat/linux/linux_stats.c | 65 +++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 6c032cc569f8..03783d466211 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -485,6 +485,31 @@ linux_ustat(struct thread *td, struct linux_ustat_args *args) } #endif +/* + * Convert Linux stat flags to BSD flags. Return value indicates successful + * conversion (no unknown flags). + */ +static bool +linux_to_bsd_stat_flags(int linux_flags, int *out_flags) +{ + int flags, unsupported; + + unsupported = linux_flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | + LINUX_AT_EMPTY_PATH | LINUX_AT_NO_AUTOMOUNT); + if (unsupported != 0) { + *out_flags = unsupported; + return (false); + } + + flags = 0; + if (linux_flags & LINUX_AT_SYMLINK_NOFOLLOW) + flags |= AT_SYMLINK_NOFOLLOW; + if (linux_flags & LINUX_AT_EMPTY_PATH) + flags |= AT_EMPTY_PATH; + *out_flags = flags; + return (true); +} + #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) static int @@ -561,21 +586,16 @@ linux_fstat64(struct thread *td, struct linux_fstat64_args *args) int linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args) { - int error, dfd, flag, unsupported; + int error, dfd, flags; struct stat buf; - unsupported = args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH); - if (unsupported != 0) { - linux_msg(td, "fstatat64 unsupported flag 0x%x", unsupported); + if (!linux_to_bsd_stat_flags(args->flag, &flags)) { + linux_msg(td, "fstatat64 unsupported flags 0x%x", flags); return (EINVAL); } - flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ? - AT_SYMLINK_NOFOLLOW : 0; - flag |= (args->flag & LINUX_AT_EMPTY_PATH) ? - AT_EMPTY_PATH : 0; dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; - error = linux_kern_statat(td, flag, dfd, args->pathname, + error = linux_kern_statat(td, flags, dfd, args->pathname, UIO_USERSPACE, &buf); if (error == 0) error = stat64_copyout(&buf, args->statbuf); @@ -588,22 +608,16 @@ linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args) int linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args) { - int error, dfd, flag, unsupported; + int error, dfd, flags; struct stat buf; - unsupported = args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH); - if (unsupported != 0) { - linux_msg(td, "fstatat unsupported flag 0x%x", unsupported); + if (!linux_to_bsd_stat_flags(args->flag, &flags)) { + linux_msg(td, "fstatat unsupported flags 0x%x", flags); return (EINVAL); } - flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ? - AT_SYMLINK_NOFOLLOW : 0; - flag |= (args->flag & LINUX_AT_EMPTY_PATH) ? - AT_EMPTY_PATH : 0; - dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; - error = linux_kern_statat(td, flag, dfd, args->pathname, + error = linux_kern_statat(td, flags, dfd, args->pathname, UIO_USERSPACE, &buf); if (error == 0) error = newstat_copyout(&buf, args->statbuf); @@ -688,21 +702,14 @@ statx_copyout(struct stat *buf, void *ubuf) int linux_statx(struct thread *td, struct linux_statx_args *args) { - int error, dirfd, flags, unsupported; + int error, dirfd, flags; struct stat buf; - unsupported = args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | - LINUX_AT_EMPTY_PATH | LINUX_AT_NO_AUTOMOUNT); - if (unsupported != 0) { - linux_msg(td, "statx unsupported flags 0x%x", unsupported); + if (!linux_to_bsd_stat_flags(args->flags, &flags)) { + linux_msg(td, "statx unsupported flags 0x%x", flags); return (EINVAL); } - flags = (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) ? - AT_SYMLINK_NOFOLLOW : 0; - flags |= (args->flags & LINUX_AT_EMPTY_PATH) ? - AT_EMPTY_PATH : 0; - dirfd = (args->dirfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dirfd; error = linux_kern_statat(td, flags, dirfd, args->pathname, UIO_USERSPACE, &buf); From nobody Tue Sep 24 19:40:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCqwf60W1z5YCnb; Tue, 24 Sep 2024 19:41:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCqwf2W9Vz4sR1; Tue, 24 Sep 2024 19:41:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 48OJerVr031790; Tue, 24 Sep 2024 22:40:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 48OJerVr031790 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 48OJerDI031789; Tue, 24 Sep 2024 22:40:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 24 Sep 2024 22:40:52 +0300 From: Konstantin Belousov To: Gordon Bergling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 044f94adff55 - main - timeout(1): Update STANDARDS section Message-ID: References: <202409241642.48OGgoWH040751@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409241642.48OGgoWH040751@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4XCqwf2W9Vz4sR1 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Tue, Sep 24, 2024 at 04:42:50PM +0000, Gordon Bergling wrote: > The branch main has been updated by gbe: > > URL: https://cgit.FreeBSD.org/src/commit/?id=044f94adff55f13130f03c0c170fa879c8febb5b > > commit 044f94adff55f13130f03c0c170fa879c8febb5b > Author: Gordon Bergling > AuthorDate: 2024-09-24 16:42:18 +0000 > Commit: Gordon Bergling > CommitDate: 2024-09-24 16:42:18 +0000 > > timeout(1): Update STANDARDS section > > Update the STANDARDS section for timeout(1) to > POSIX 1003.1-2024. > > Update mandoc to be able to render the > new POSIX macro. > > Reviewed by: bapt, bcr > Approved by: bapt > Obtained from: OpenBSD > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D45691 > --- > bin/timeout/timeout.1 | 8 +++++++- > contrib/mandoc/st.c | 1 + > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 > index 9e624e809376..10e5fd70c393 100644 > --- a/bin/timeout/timeout.1 > +++ b/bin/timeout/timeout.1 > @@ -24,7 +24,7 @@ > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > .\" SUCH DAMAGE. > .\" > -.Dd June 26, 2023 > +.Dd June 17, 2024 > .Dt TIMEOUT 1 > .Os > .Sh NAME > @@ -195,6 +195,12 @@ $ timeout -k 5s 1m fetch \\ > .Xr nohup 1 , > .Xr signal 3 , > .Xr daemon 8 > +.Sh STANDARDS > +The > +.Nm > +utility is compliant with the > +.St -p1003.1-2024 > +specification. It is not. At very least, we do not support short versions of -f and -p options. (OTOH they should be simply an aliases for existing long options) From nobody Tue Sep 24 20:16:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCrjW69XQz5YFSN; Tue, 24 Sep 2024 20:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCrjW5fFhz3xDn; Tue, 24 Sep 2024 20:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727208991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RWNpCs818cHnEyENJOI594KBiDwio9B5/aek2ApYAvE=; b=sOeUNDYmvRB8COBu0rw1MbVX5dS1KqqcLNH0qxfkxZymY7Q4fZtRkTOxqJTotvAium8P44 nvxTl7ejU9h07QTjydXAOoEDwIDIWalPGb2oBQt8QFIpjkisPXwl3qwrwFkiAlxibqkcEa ndoYQsMzMwca+9gjFOHklq2m8T73MeZo1fGM4M4F3sIW78gS1e5yCFyhHyi15Hm9jFiRmw VkwF4rJ4Q5dvDIb5GHbWV5IzVV2dE8xdL7kezmqfZMYqvFnGdryUWDYmUVAuqPNkm8ysN8 WBfI27yjG+wf83ZCPa1anKOcsXSeIQMlmjnUtnlgFVx0iBAJHtXR3l2oNVrsFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727208991; a=rsa-sha256; cv=none; b=xr/2yzgj1hU4sg/QZAQXiGSWjRW+yLZ8Z8UvmfgjBudIr4FgBbdgTrso5PkVdofHt1irBA 1gMxCLtvTMVaYb1HzBqU3diJIz8y2kRjuFTSZWPFAzQd0AzLStPrIxjAlAVYKKgYmy9SFC RghvkH9TdSipI5eP+t1baiKshCWjYoYeSKbTWTvVQrKcDI+A2OkxCGWvZ82gQ52XaQPoCh RGJ4QP6Gxct60m9llWL4qqk9zqiINQ7yD5gCVCtieFhkhnbgbEL/oyxs7BdLsedZ/6KP88 poFZBXJF6O4aM3QOHt/SBZGdWVNTjNbnoQAQDQK4E5iCecbHI+i5R6elow7ozQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727208991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RWNpCs818cHnEyENJOI594KBiDwio9B5/aek2ApYAvE=; b=IdAb27fxd4OWJWRHKUeO2AYeYDPT7X8NVgBQNoC8qEM1zBw6CJTJnBDm0IQ7MpE2cybfUN wB0uOieSa9vw7497DZxu7gsfWc4/z4EXnVx4e4w2HYWBGWZACl1ejZy/6tWAvEEx1fry0n aAirqXddYMxXsDE7DtCjM7TqxVHgZ94qEplrKe74MZfB+CF54/3HedzWCsXlHpE3LUT6ro HEMVW8gX0sPWSwcuF+4BqREriV1cth7cUg/mAZWKxPEQa46lxHWPp83R7AM6lTrdzFY5a1 McrIfIX4ruxWLwa1NhjYax4b9RAYUSlS9oR4mLAOJq1qmpBT3XlzqD+iLl4PrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCrjW5FCwzjW4; Tue, 24 Sep 2024 20:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OKGVxU000213; Tue, 24 Sep 2024 20:16:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OKGVGE000210; Tue, 24 Sep 2024 20:16:31 GMT (envelope-from git) Date: Tue, 24 Sep 2024 20:16:31 GMT Message-Id: <202409242016.48OKGVGE000210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1b3fa1ac36d1 - main - nvmft: Defer datamove operations to a pool of taskqueue threads List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b3fa1ac36d1b48a906dc98d9d9f22447a213d47 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1b3fa1ac36d1b48a906dc98d9d9f22447a213d47 commit 1b3fa1ac36d1b48a906dc98d9d9f22447a213d47 Author: John Baldwin AuthorDate: 2024-09-24 20:16:11 +0000 Commit: John Baldwin CommitDate: 2024-09-24 20:16:11 +0000 nvmft: Defer datamove operations to a pool of taskqueue threads Some block devices may request datamove operations from an ithread context while holding locks. Queue datamove operations to a taskqueue backed by a thread pool to safely permit blocking allocations, etc. in datamove handling. Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D46551 --- sys/dev/nvmf/controller/ctl_frontend_nvmf.c | 52 +++++++++++++++++++++++++- sys/dev/nvmf/controller/nvmft_qpair.c | 57 +++++++++++++++++++++++++++++ sys/dev/nvmf/controller/nvmft_var.h | 5 +++ 3 files changed, 112 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c index a203bb1c90a6..bc061947a9a0 100644 --- a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c +++ b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c @@ -19,7 +19,9 @@ #include #include #include +#include #include +#include #include #include @@ -31,8 +33,10 @@ #include #include +#include #include #include +#include /* * Store pointers to the capsule and qpair in the two pointer members @@ -47,6 +51,9 @@ static int nvmft_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int flag, struct thread *td); static int nvmft_shutdown(void); +extern struct ctl_softc *control_softc; + +static struct taskqueue *nvmft_taskq; static TAILQ_HEAD(, nvmft_port) nvmft_ports; static struct sx nvmft_ports_lock; @@ -458,8 +465,8 @@ nvmft_datamove_in(struct ctl_nvmeio *ctnio, struct nvmft_qpair *qp, ctl_datamove_done((union ctl_io *)ctnio, true); } -static void -nvmft_datamove(union ctl_io *io) +void +nvmft_handle_datamove(union ctl_io *io) { struct nvmf_capsule *nc; struct nvmft_qpair *qp; @@ -478,6 +485,35 @@ nvmft_datamove(union ctl_io *io) nvmft_datamove_out(&io->nvmeio, qp, nc); } +void +nvmft_abort_datamove(union ctl_io *io) +{ + io->io_hdr.port_status = 1; + io->io_hdr.flags |= CTL_FLAG_ABORT; + ctl_datamove_done(io, true); +} + +static void +nvmft_datamove(union ctl_io *io) +{ + struct nvmft_qpair *qp; + + qp = NVMFT_QP(io); + nvmft_qpair_datamove(qp, io); +} + +void +nvmft_enqueue_task(struct task *task) +{ + taskqueue_enqueue(nvmft_taskq, task); +} + +void +nvmft_drain_task(struct task *task) +{ + taskqueue_drain(nvmft_taskq, task); +} + static void hip_add(uint64_t pair[2], uint64_t addend) { @@ -561,6 +597,17 @@ end: static int nvmft_init(void) { + int error; + + nvmft_taskq = taskqueue_create("nvmft", M_WAITOK, + taskqueue_thread_enqueue, &nvmft_taskq); + error = taskqueue_start_threads_in_proc(&nvmft_taskq, mp_ncpus, PWAIT, + control_softc->ctl_proc, "nvmft"); + if (error != 0) { + taskqueue_free(nvmft_taskq); + return (error); + } + TAILQ_INIT(&nvmft_ports); sx_init(&nvmft_ports_lock, "nvmft ports"); return (0); @@ -1115,6 +1162,7 @@ nvmft_shutdown(void) if (!TAILQ_EMPTY(&nvmft_ports)) return (EBUSY); + taskqueue_free(nvmft_taskq); sx_destroy(&nvmft_ports_lock); return (0); } diff --git a/sys/dev/nvmf/controller/nvmft_qpair.c b/sys/dev/nvmf/controller/nvmft_qpair.c index 6cb3ebd76884..e66d98f38225 100644 --- a/sys/dev/nvmf/controller/nvmft_qpair.c +++ b/sys/dev/nvmf/controller/nvmft_qpair.c @@ -34,6 +34,9 @@ struct nvmft_qpair { uint16_t sqtail; volatile u_int qp_refs; /* Internal references on 'qp'. */ + struct task datamove_task; + STAILQ_HEAD(, ctl_io_hdr) datamove_queue; + struct mtx lock; char name[16]; @@ -41,6 +44,7 @@ struct nvmft_qpair { static int _nvmft_send_generic_error(struct nvmft_qpair *qp, struct nvmf_capsule *nc, uint8_t sc_status); +static void nvmft_datamove_task(void *context, int pending); static void nvmft_qpair_error(void *arg, int error) @@ -114,6 +118,8 @@ nvmft_qpair_init(enum nvmf_trtype trtype, strlcpy(qp->name, name, sizeof(qp->name)); mtx_init(&qp->lock, "nvmft qp", NULL, MTX_DEF); qp->cids = BITSET_ALLOC(NUM_CIDS, M_NVMFT, M_WAITOK | M_ZERO); + STAILQ_INIT(&qp->datamove_queue); + TASK_INIT(&qp->datamove_task, 0, nvmft_datamove_task, qp); qp->qp = nvmf_allocate_qpair(trtype, true, handoff, nvmft_qpair_error, qp, nvmft_receive_capsule, qp); @@ -131,14 +137,25 @@ nvmft_qpair_init(enum nvmf_trtype trtype, void nvmft_qpair_shutdown(struct nvmft_qpair *qp) { + STAILQ_HEAD(, ctl_io_hdr) datamove_queue; struct nvmf_qpair *nq; + union ctl_io *io; + STAILQ_INIT(&datamove_queue); mtx_lock(&qp->lock); nq = qp->qp; qp->qp = NULL; + STAILQ_CONCAT(&datamove_queue, &qp->datamove_queue); mtx_unlock(&qp->lock); if (nq != NULL && refcount_release(&qp->qp_refs)) nvmf_free_qpair(nq); + + while (!STAILQ_EMPTY(&datamove_queue)) { + io = (union ctl_io *)STAILQ_FIRST(&datamove_queue); + STAILQ_REMOVE_HEAD(&datamove_queue, links); + nvmft_abort_datamove(io); + } + nvmft_drain_task(&qp->datamove_task); } void @@ -359,3 +376,43 @@ nvmft_finish_accept(struct nvmft_qpair *qp, rsp.status_code_specific.success.cntlid = htole16(ctrlr->cntlid); return (nvmft_send_connect_response(qp, &rsp)); } + +void +nvmft_qpair_datamove(struct nvmft_qpair *qp, union ctl_io *io) +{ + bool enqueue_task; + + mtx_lock(&qp->lock); + if (qp->qp == NULL) { + mtx_unlock(&qp->lock); + nvmft_abort_datamove(io); + return; + } + enqueue_task = STAILQ_EMPTY(&qp->datamove_queue); + STAILQ_INSERT_TAIL(&qp->datamove_queue, &io->io_hdr, links); + mtx_unlock(&qp->lock); + if (enqueue_task) + nvmft_enqueue_task(&qp->datamove_task); +} + +static void +nvmft_datamove_task(void *context, int pending __unused) +{ + struct nvmft_qpair *qp = context; + union ctl_io *io; + bool abort; + + mtx_lock(&qp->lock); + while (!STAILQ_EMPTY(&qp->datamove_queue)) { + io = (union ctl_io *)STAILQ_FIRST(&qp->datamove_queue); + STAILQ_REMOVE_HEAD(&qp->datamove_queue, links); + abort = (qp->qp == NULL); + mtx_unlock(&qp->lock); + if (abort) + nvmft_abort_datamove(io); + else + nvmft_handle_datamove(io); + mtx_lock(&qp->lock); + } + mtx_unlock(&qp->lock); +} diff --git a/sys/dev/nvmf/controller/nvmft_var.h b/sys/dev/nvmf/controller/nvmft_var.h index fc1f86754382..4fda297c8a85 100644 --- a/sys/dev/nvmf/controller/nvmft_var.h +++ b/sys/dev/nvmf/controller/nvmft_var.h @@ -110,6 +110,10 @@ void nvmft_populate_active_nslist(struct nvmft_port *np, uint32_t nsid, void nvmft_dispatch_command(struct nvmft_qpair *qp, struct nvmf_capsule *nc, bool admin); void nvmft_terminate_commands(struct nvmft_controller *ctrlr); +void nvmft_abort_datamove(union ctl_io *io); +void nvmft_handle_datamove(union ctl_io *io); +void nvmft_drain_task(struct task *task); +void nvmft_enqueue_task(struct task *task); /* nvmft_controller.c */ void nvmft_controller_error(struct nvmft_controller *ctrlr, @@ -138,6 +142,7 @@ struct nvmft_qpair *nvmft_qpair_init(enum nvmf_trtype trtype, void nvmft_qpair_shutdown(struct nvmft_qpair *qp); void nvmft_qpair_destroy(struct nvmft_qpair *qp); struct nvmft_controller *nvmft_qpair_ctrlr(struct nvmft_qpair *qp); +void nvmft_qpair_datamove(struct nvmft_qpair *qp, union ctl_io *io); uint16_t nvmft_qpair_id(struct nvmft_qpair *qp); const char *nvmft_qpair_name(struct nvmft_qpair *qp); void nvmft_command_completed(struct nvmft_qpair *qp, From nobody Tue Sep 24 20:18:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCrlW0LZsz5YFDH; Tue, 24 Sep 2024 20:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCrlV5L2hz3xZH; Tue, 24 Sep 2024 20:18:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727209094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2lID23N98dCVk7PJQaEBAzf3RVJJGqVMDGFKl5YRH3Q=; b=EmFhyf6HKkvbDLeTxZbnetf0Z1AKeGxBNFM4K0PEGC/WGLb/5PShSghRz75yXrM3dQVZjq klPjvU/oLKtqWLMWFYTzDtxO3DEJdxwuAFjD/rSkxOFO3qAb6fNMgjFfyJcpq5vi4CpInt 5NpLessw6aEIR9B9wqOUMmulvkixEqk/KDbHwjOmvCqMKFah3qcyUw80ZQSfyTwtZmNpGn Czi68CeoaEVtzCMNcfAKltwiaIkGKHU33v1JvLw/JrTLrQovSzPFhLXLLa531AvDpXm3ru +NUbo4gQceGTnDJf5rKcrMU5265daaWuIod+tUTZf6CRForXZLCXnWnm4JxT9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727209094; a=rsa-sha256; cv=none; b=SzNQRhM/8I5rn7SGuCW6tpyOSFtnq/Yw1pZ0q0UpGQ/jEoo+HB2m0CqECIqcZiAcHYDRIE HslE/8K7tET1IQjcq2q3vUjglrGolKwzI9L4psVabSVmvjYbDzDdA0QbOVNDGM2aFTksPK h+IrBjFpwmhCfr/KCxHqCKndnTu6OK5QDdpGZIJLxZf31O1TvCN2DA3vjqxrrQuhVimKiu W0G5utKyL/qkT/f/CmG9XXhwu+035pqm2vOKiZ2QzYFmytV0klEXC8Zgy8/mvlsLb/N9hS r6JtE+CdRDgp19cbowAeWG09xIaZgXe9vJeKP9rAHfCT4+e1ZOqutLJxyNLmOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727209094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2lID23N98dCVk7PJQaEBAzf3RVJJGqVMDGFKl5YRH3Q=; b=IdmpAMS3dBOg6yHDHqv8nUOwcHMtAXx8Cly0LEsWhUAUkk86g14JkuItNzb71NeJHKF0KV 3S6PBt9miEQV1BMPAGu1JPG5GQ1ByWdIO0IgHSwGUzGXBqddSRgCo5nb3iob5KUInl1NsX ZzfhSp5uHuom+pQT1UI8Io6lxNlg8Gh1B/x3P9xIB2dmtsJs2IoJkOomOLV8WGRGFacuzE LWYtG5QBn371KBV9kX1VN+gkUHnIUPGOGvgntWhMYQBIDA6vI594s/lrlQZcXcVNYVrUV2 DENO2USclFOJkCvoEpSr1G4fhkzV1ecj0DTa9cOjvlrxMZc5M4WtV9iCi5ppbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCrlV4y8qzk28; Tue, 24 Sep 2024 20:18:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OKIE0l000608; Tue, 24 Sep 2024 20:18:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OKIEvQ000605; Tue, 24 Sep 2024 20:18:14 GMT (envelope-from git) Date: Tue, 24 Sep 2024 20:18:14 GMT Message-Id: <202409242018.48OKIEvQ000605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 604919c47fa4 - main - loader: Fix 0 vs 1 confusion for column numbers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 604919c47fa4092db08dadd282851afc9cba0a90 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=604919c47fa4092db08dadd282851afc9cba0a90 commit 604919c47fa4092db08dadd282851afc9cba0a90 Author: Warner Losh AuthorDate: 2024-09-24 19:54:56 +0000 Commit: Warner Losh CommitDate: 2024-09-24 20:18:42 +0000 loader: Fix 0 vs 1 confusion for column numbers In two places we use '0' for a column number. However, the upper left hand corner of the screen is 1, 1. Fix those two confusions. Also, fix a comment that flipped the coordinates in a comment (I'm used to the vt100 convention where it's row, column (eg y, x)) and didn't notice the rest of the code uses x, y. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D46777 --- stand/lua/menu.lua | 4 ++-- stand/lua/screen.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index 5820d80532b5..72f5648cae91 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -556,9 +556,9 @@ function menu.autoboot(delay) else -- Erase autoboot msg. While real VT100s -- wouldn't scroll when receiving a char with - -- the cursor at (24, 79), bad emulators do. + -- the cursor at (79, 24), bad emulators do. -- Avoid the issue by stopping at 79. - screen.setcursor(0, y) + screen.setcursor(1, y) printc(string.rep(" ", 79)) screen.defcursor() return ch diff --git a/stand/lua/screen.lua b/stand/lua/screen.lua index 4437a34f95f1..89d5416815fd 100644 --- a/stand/lua/screen.lua +++ b/stand/lua/screen.lua @@ -32,7 +32,7 @@ local core = require("core") local screen = {} -- Module exports -screen.default_x = 0 +screen.default_x = 1 screen.default_y = 25 function screen.clear() From nobody Tue Sep 24 21:19:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt664jd2z5W5Bc; Tue, 24 Sep 2024 21:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt663qvHz43d1; Tue, 24 Sep 2024 21:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQ/3i2OfokJKt7eui5pYPz2P518Zj7f9kEIwe52PwNM=; b=K9e9GQlEaSMgw86WTc9fo79s8VnOfmEmmY6w+y3AOc95Te/huWSFO4StNCPE6nS15XtzPa bk3jLSALz8Pc596aU/Ga7Ew3rIrVStHx7mulCrUwYn58l1N2OKO1yLbze3xd+g5/iKQjAK gyKbzyjCAARqDEYWMcx7BwGojpHaGWQurvgjUOeZG3op/WB4FZbwR/WQtdgzFVibHs9Pzq jJk4HZJm2e0GLM5UPUB0zBNzdDUtyXYPDtbRzpM5Mv6sFjgEH2cnWThLyC37dZgyyVyxVk /R5ifyRqBQQQjf3E/p+2Vs2R+tTgu8OIxr/DHZfbrYxMwdO6swKhDhqog1gHxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212766; a=rsa-sha256; cv=none; b=I9As4vym/M9DvN/F2NmIG+tvL8dXpWTCQri5jCIhnmpEGTmBEmdBbZLsv/jI21uuOcmfTQ /k8CfD8PRjpxPcK0DVxJseRce9GGB0jiACSGRKpx4gLxAlTfDJEwyVEYlqZQ4chwzG7qmm t6Q+4KnDx/BgC8qxQULjL1g9w1cbbSV3ndBVKV0htQB7rE81CPm4TeZTSRbA5+S7VVEcSu Ba5UHYKUS3LxNfwRekwm0iJTf6bR/BDg/DXYOBxlwrjK+PeWiPIxMdPRCx/Nz2LAmKGqQL h5FiG254KrYZoC2WU9doaR3BqDOq2ZtMgIC23i2FIk1WXWQD52ZKRx+D9Xi+zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQ/3i2OfokJKt7eui5pYPz2P518Zj7f9kEIwe52PwNM=; b=UaQoXBcTQsriqVaxxuiwj6x315ZX32merq1YjSe69WONA2fO4Zs5jWGAajXr1dwUgbhMDc xIJaSAlDlexXZ/5J8/EwyixW9hZz8CEt3meF9IRMs6I5SMycKRnxXPizDmivZP+GzOetZY kdJyFGyWXNfGFIfZa98WQPREvmM+ujObWiKoiQHCRIzWYbVU5q/btng0NEMlM90AzvIbJV QYIR/Y0MOB8imhc2paSqFofx6wKWBAfMyDcbvPDNARLMGSXTdvyNXfH6B27JPH1rAjU9rG Joffn6zERPOgKRbhMVcQeF9YCqU8o+z4N5bujUa5ASP4ac/vocosBPGTlC92aA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt6639QfzlFL; Tue, 24 Sep 2024 21:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJQTj002723; Tue, 24 Sep 2024 21:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJOws002720; Tue, 24 Sep 2024 21:19:24 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:24 GMT Message-Id: <202409242119.48OLJOws002720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 413c5e9082a7 - main - Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 413c5e9082a7d1d25fd3a95f0e77a949621f1433 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=413c5e9082a7d1d25fd3a95f0e77a949621f1433 commit 413c5e9082a7d1d25fd3a95f0e77a949621f1433 Merge: 604919c47fa4 9c6b6723ca84 Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:06:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:06:19 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:19:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt680vQqz5YJWj; Tue, 24 Sep 2024 21:19:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt680BjNz43m8; Tue, 24 Sep 2024 21:19:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K3ODMULm1AvVPL96vADUXHzztL6NG62njI6/0TH/Bt0=; b=oBucT7kAYjEUqON4334WodfiAkRFzB5AHUlK+1aX3ktatuRj32jGb7/5boQH3AZqvWZJNt gk2ggsNZuxS5ju/vt2ZmZ9MXNrcIZrS9pJOfA0whgbLho2FBaHLPvrx4kzZzr3UdxrD35L 5LVhHu8agImfmvrTgq7Hqwh3SV4ugGjBSyuXnfehvwAMGe//Rh2PIK3LZL76flRCzVv7uV cfgZ+YIXkzb+hS2Il9RMR+HYnMFo1F8fV0FRp5ELYvO2QkOyPeDuhVmA3ChY6GAVMjkpz/ joZ2xRTWr++UHQ3UZR1TuAC6+BorOVJtm/KsJ5FTT6+JS6E5Vbw6ycbYHJS8uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212768; a=rsa-sha256; cv=none; b=h2wpPhz3Ki6YbJfYA/6M9WuLkTROhrDwDuo41KdewSPngZxbxN5of3srlX1SDrDi2OT6hk 4KahIFea3sl1ylML9xxnvO3PEECzNDYJV2vVQ8WfiLrYV+A0djAXcMxNQXJO7xOIF/QflN 3RN+e5ALB89/ZWYSDXH95dn5+UD0kVGi3KV9ZyHvyQHF4hcQozSv44zyOraua/1XAv1YQw nzvVmvEDtbbar7oPRBqYMEmdMIvakZS2GqIQDtjnqZwpm/7o8h/J8/FChXMdThnQmjSu2s qVr0aqjQlnUNWYppHeIJVXKlGNmKY37FHHviO4SSRwW6dkXwyiW5HG8luoLSHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K3ODMULm1AvVPL96vADUXHzztL6NG62njI6/0TH/Bt0=; b=pbKqWw4KXukxG74EOCGAMJHUG4m5fiuHh8kWDh4pYjg7UgU46RJPN5AQQ81Hr6wq4U9anr MBETZLQyJLaE4YXkDBfMyppVlxvKd2X/KW8Mn5NmDgrXIM1w76hkvsxLY/JKyOr+ktcrve ZMgitSV42LHcNi0lzIf6c2rxOhlkHvk88bRsH0PY/UFqyPunXAgIx8Wezi+zro+E0NimN+ HCGNH1lMcbzt0ow27HZYFP5GBXHBz6MSbfG5/EjheY/kNTelSxBhB1NG0EhxoJZehcb0vq Y2OGVwjtnauGj0bsAMc/3etWU5CT4poGMWNmha/XdqJt2ZDYme8Y1Y2o1UdNvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt676vqrzlGG; Tue, 24 Sep 2024 21:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJR1d002772; Tue, 24 Sep 2024 21:19:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJRd6002769; Tue, 24 Sep 2024 21:19:27 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:27 GMT Message-Id: <202409242119.48OLJRd6002769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 114f709b088c - main - Merge remote-tracking branch 'freebsd/vendor/Linux/ath10k' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 114f709b088c82b9676cb2275600465a5ae3e204 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=114f709b088c82b9676cb2275600465a5ae3e204 commit 114f709b088c82b9676cb2275600465a5ae3e204 Merge: 413c5e9082a7 e05a7642395e Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:16:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:16:34 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/ath10k' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:19:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt695tRJz5W5GK; Tue, 24 Sep 2024 21:19:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt693wSVz43dG; Tue, 24 Sep 2024 21:19:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9IOmUMQ+y55SM5Nz50gsxP3+g/qzpXjtAvNgHklaSI=; b=RFDjEBEsbLcJX1g/sfjJ72PKBVCaHKO+D/zTMzNNOi9bZrOXvdVuTr6wdseve6wKST0x8g HUHaj7+q/Fo6oP7bA+zR48FLhBVW+cLwTjHNbAsuogZOw254T7O3Hy8rVBTTM6lLNIGqy4 ua1u38VXDFnDrMKutB+Uzjs2raea8U3WWnhZpW2O7i9VSeGjE2b28UBsbWgbgCpiiKT2Jz XkbKs+s7Z2/9deDvLF/lL5LdXfk5fgPyQ6P48HdpnY9wzGsPkL1a22+Ltq16ayhV2+HZse VMp0EqS0dMulGS3I4pUlDp2fKxlSOSWtCtLvkbHlV7Nb6HqOuaNm8O0NGVQMIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212769; a=rsa-sha256; cv=none; b=vI8Xug3/Qcb+IbMjIcQRcU+hmJi0eJkxSq046iQG67Xwsio65ERIjQYBlkwgSIwQAfJFgb DKxCQDa4BW/lyb7c75naDB2TC/yFMBXcQviVj6SDNwid0uGXsPqZSGZrKnyqmrtibJcQ9N vsQ+px0Ujn3CS8Tx6KQW7JO3Te5mNV/wASLzbV17ujvhqvRuiru3ga8SAdlskr+iuCUdD/ Fo/SP5lYCmSMr9XSCwBzZjO7Gtfja0GTUCOXVSMr1IrkVPELvRSYpl3EgeO8OHl/WSNA3e pkkIcZ5MDDM/GplcaVUqWyAW3vNvqECvaGNYzmtXTsfFS73FAY1BL+9be6SE3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9IOmUMQ+y55SM5Nz50gsxP3+g/qzpXjtAvNgHklaSI=; b=jQ1DyclIECNGrEXhHe15ywPjQD1sMv+ztnK8lzUKkSpS1vrMxnhdYyPbBGnqWqOtO51Do6 sDPyyvKvcPGoNe4/HYDF4/LQzyNBDPFqdk50fUg+0tguRzjsIxlnuzcpwONe/tcG7Y+dzK HFkFyRYoFX83RDIOxsnqnDSRMGyuXVcYI7e+jQQrlX16R+z5/U+LMDihiFGwxG/HE7J6rB 9AaJEp5h9Q1r2Z3L4Eyzjq95D23kaMhYG6QtaMd6mAzkFlpdywl5JV0FPFtgR1p2ybrH79 e892N0i7fLp5wJ/DpnwdnTLCuUkr7B9sJ7uQk5Pb8ibL+dQ5BR9U8zUBVTEDmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt693XfHzlFM; Tue, 24 Sep 2024 21:19:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJT3K002817; Tue, 24 Sep 2024 21:19:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJTPq002814; Tue, 24 Sep 2024 21:19:29 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:29 GMT Message-Id: <202409242119.48OLJTPq002814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 182375d342bc - main - Merge remote-tracking branch 'freebsd/vendor/Linux/ath11k' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 182375d342bcd1c2786bf5efa04700aa2bdbd302 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=182375d342bcd1c2786bf5efa04700aa2bdbd302 commit 182375d342bcd1c2786bf5efa04700aa2bdbd302 Merge: 114f709b088c 60805fea02fb Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:16:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:16:49 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/ath11k' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:19:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt6C2QTWz5W5DX; Tue, 24 Sep 2024 21:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt6C0hQ5z43Vn; Tue, 24 Sep 2024 21:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KOBUnKUfMY2jDAXzcYmqVTUvDhmtjzQfDsb+ci8ik4g=; b=jguFtS19WK3CGMN34JbWF6GxemI5HSIUqzpfSl7ZAtLO0vBrYNfK+v8YNWH2t60m38LTsS tVJraGY2KozvFkSTqzwBpubKGBHamw64zY0Der4g96Q5jaFjylGTxumRVg9v+pEs6mezzX rtPL0cb+IOr6heGwiVLqUdOzrE+q0nh0So0UzAJCX0IPd0892yS7otS6N3PA2dluFXU0MO G/HqInEGYjV+Q+YjOxJi8D9RithcYUlzDk4cifKPhU9PoyYN7lUJ1yThoV7FZztt/YggXC r9cmrYzfZqQmLpXetlGqfY59Bg6mKu/AJ784CtmyCyCpIo2WAy7RrCt33YM/9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212771; a=rsa-sha256; cv=none; b=McdkblRsHRP8ZYdskAA+2QDl2PGcN84tBPIJUSqidEkTY/D00WZ4cVtgGF5Gf7ZAScp0yv wh+IJbxJg6JbXRWL6cQtklNWNe5M3whXu4pB2/g2ZWAvjoIK78LuZCsC3pCqPdUUxcJwPq PnIBZlyMUuGSkApkPQaIE/Vf9z6GGqTILBAhxzn91sLGOIHa3VJDnIMU0ppRTz8qIHkQW9 fXkvW1dZt/1GmlXttR9PlydiQFkbl8OImlS5JidrLbO6htdtl7TA8BshtHMt7Vc1Nmult9 5T/VUUgMYxNqCGqa7+v/QGnn+cs3mo1u+RQyM8OBAHFKOt9jM77BzVc7bonoLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KOBUnKUfMY2jDAXzcYmqVTUvDhmtjzQfDsb+ci8ik4g=; b=v2774IU2S0zzR4CA4c5qp5SlYN+rOGiWb5fWG/9vYqU/Qkss7glj2+mLj89bn+QqGqa5zb /ZBXogWyB9BUSjjE+NhXp94JE/T0kfWI2Hqm5RCwZ7lTZZJ6IGrncvosRD6Y5OBuLBdD+O gdsGGOVLgCvDjYTqUnK6sADtkBkvs4f7J15mKgBtp747VXiYngCtAgM6B7GqcQBrliLP2C fvgU8UlzTgAnbXV3Bskk0g/M4d1BOxYbyqg2kIakLI/+24TNCBJeD6TLGUhQz5VGmwf256 uBFsF8fXf1EXDAtrRQsCL12uzLZWyQ/yCLEm56HEpPMI8uOaYWHGgN3tZjahJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt6C0135zlT8; Tue, 24 Sep 2024 21:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJU0R002868; Tue, 24 Sep 2024 21:19:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJUpJ002865; Tue, 24 Sep 2024 21:19:30 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:30 GMT Message-Id: <202409242119.48OLJUpJ002865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d8f6658c9a37 - main - Merge remote-tracking branch 'freebsd/vendor/Linux/ath12k' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8f6658c9a37504b380f21b7904099ef37d06962 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d8f6658c9a37504b380f21b7904099ef37d06962 commit d8f6658c9a37504b380f21b7904099ef37d06962 Merge: 182375d342bc a4f8848c53b8 Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:17:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:17:04 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/ath12k' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:19:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt6D5SRvz5YJC6; Tue, 24 Sep 2024 21:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt6D4Br3z43hY; Tue, 24 Sep 2024 21:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o0thZD/YxhfhCWdCjrYs8TqzkRL6hQTf0ErC5kCNm+Y=; b=fkSNF+S8Ur/U4Upayxc2ZJd+dWj6IORsRPEwKhXbf1aQ9gttC8M8KA74YYbDR96azRw+2+ 3Z3O2v1dWzwlpN4sasdFmZ/IS8cA8r4xdU5hfGMemqPPeI+tAMEni0+6d3YyRfJNf2REfU 2J74aTeg8C+vKFISlfuTg5Q15y193e4kqkIYLpF5LIxOTLymQnDfJfymKCIwgPAY4Ip35W hCh/NG3R7iipEclBnyJvSQPNfMKKX9PhqKMUS/cH1VUmz/V3lRuIqSONJlXoKOghCSEHSQ dxRAfnmRCWkISdtIgABYkLhezrf8f1jMycimOdsAYLkTQZKHaoYDkXTFsw3ohw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212772; a=rsa-sha256; cv=none; b=FwcxEBi7nrnQdi7bJVYnl9oZQWsr2BgKBRNn2bnQsslhwoZI7XOVDmsk554b1ClIZFhipM 5e4p8N4bRNO/PtNjvaPCY6mawhnWXwRGN13dfeKQPaIJPOfQ7/dXpa7WqJP1iVunIuP6fn tBv772LEy35RgSUGXPjpgNMTGxxyyNfUcNDn5iLkrBwMBSIkNBkpcHCRpHDlBto5Gh7V5W s6I+KQhljrqfMwjhACrHpxhsGpSuJDAGGObO6O85hpGVGyElxo4SsY9Wc2vDiFPw7Il3t1 YIKsiW/ShTbFMv4m+urIPyyaADoYBsIQUzAtV/GYIP5LktpFlkiNdLMQmdEmAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o0thZD/YxhfhCWdCjrYs8TqzkRL6hQTf0ErC5kCNm+Y=; b=gro0jK2GYFNMCdycO05fc5XOSUvPvWKuQtORhtuC7i5HW0sCiYco+bLCSx6oEzXvLh90WX lhid3FPlE4VwcoybhWZ9xzEgunMXVeci6DjCP36GGXLKUJEzcYSwniyjPH9uyFcc5fmwza aYKFPgQOLFfgXmR0yhECx6V9BTSVaJv7PLoc3s7Mc0hbP1ZcVN3N3rvKGuLwvoNYBDKCtl lUeTGrzZYCaJrLyn6uLMEVl9cw1hs66FtO4JSEi+EUR9erA66a7+U5SnyDRfVTvnEgFygR 1qw7eT9jw8+QODvxvfUEk1+uV4/uceHJs+4J8B8zcyIcbJMPb3ptdrCEjfZ0kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt6D3qPmzlGH; Tue, 24 Sep 2024 21:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJWP1002916; Tue, 24 Sep 2024 21:19:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJWfJ002911; Tue, 24 Sep 2024 21:19:32 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:32 GMT Message-Id: <202409242119.48OLJWfJ002911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bbd5885bfc15 - main - Merge remote-tracking branch 'freebsd/vendor/Linux/iwlwifi' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbd5885bfc159556e1f3ceb0ff40de2d9242d00b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bbd5885bfc159556e1f3ceb0ff40de2d9242d00b commit bbd5885bfc159556e1f3ceb0ff40de2d9242d00b Merge: d8f6658c9a37 c6bcce0f5b92 Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:17:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:17:18 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/iwlwifi' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:19:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt6G3515z5W5DY; Tue, 24 Sep 2024 21:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt6G18Fxz43n3; Tue, 24 Sep 2024 21:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OyDLn4oqryYJhtKay7QrMIcAnBF9t7NQF6XNsg3o/oI=; b=o81otboPEbF1qVN3YiVbwFkqx3ljROanZZWwmpf3OHPDE94WtikCmsxOWZX2gd0SUze/Ra mxRY/S3KYGTDYrB7HaPh+JCDViQIBDF5PetCfRo5XcUUREUl3J7wuJ7iz0pl93DMiuQuBt Sp90wzvbDdwhvVUL/68tx50UZJ59bq1sZvb1gGm/Xad2v2ckjOu+rzo8T/BbJWkFHw4bPt 0CCGRtJW4zY6E49jf3b8vqHXd2YpFkH4aFUkx1t/q64BKzj36CwTkLQfz+SJC1Nhlh6flb rLz3DVB7NqtG5RMzJjRxeivYOIpsDPRVqJg0FGv8N9hfpdkPIXznsEnDJogKRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212774; a=rsa-sha256; cv=none; b=xKeXDl5xT99giUyFEwohw0gQ+dm/QwuSuGiRRRwxx25Ix3nZM13q8i4KR//7KLEyjHWcSj 7j9iZ7kkoZcpyLRsmiLVvTXqoC7O66srIrZeAjU4ZMsIoTWoeEWHjkz97pr2iajYq3ESKl 3nQb5GN78HyoTeefjggnsihNPldhYg5jTTUHtu8TvVe+ptB5Z8Bkh7DNWFjofYv+HVyo2v YqbP3ftg2min1bKnSC9EudDcewYaIBJXC5tW67usGexgkeQP3uEihEMdu1bOaxepdgaVgh 7yWZGOALReNC+nvMmVgWd0TEw78nuGAPD1Nvrp14uCQLkgEkXYa9BKP/3miZ0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OyDLn4oqryYJhtKay7QrMIcAnBF9t7NQF6XNsg3o/oI=; b=vRymJxPKc8J4kEMAvF4sT4doBb9amf8UbNSKu99jQDPBT6TzxRMi/rO/0Zhi9lotM0bzkD Yax/fxACGpcT44F7fvnSEqeOj5kaB0DTLfs94LRjzIYs4AGSu/H4FwlreK62KqQSzWGizp 6kFjlchF2XWoLZE/cxI5cDjlVWD7nkU2OWaZ0R7zTP+6UzlMOx9r4yxEwEAxkEkEZGrQ2l tTkaY3WiTJMyDpVtINZFm/v0mlKIXTCyzHCbNorJjI+dyfV00r1jzgWTi7+z0L6jFelkT0 4p4EwGwGqZqCRNEaf30KFRujMmGu3jMAhvg/kzK+RYMyvbaB74gE3fgjgD1fHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt6G0NQVzlXv; Tue, 24 Sep 2024 21:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJXlt002961; Tue, 24 Sep 2024 21:19:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJX4c002957; Tue, 24 Sep 2024 21:19:33 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:33 GMT Message-Id: <202409242119.48OLJX4c002957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c9f9342a481d - main - Merge remote-tracking branch 'freebsd/vendor/Linux/mt76' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9f9342a481d48d44b2129b84e4f58cf47d076a0 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c9f9342a481d48d44b2129b84e4f58cf47d076a0 commit c9f9342a481d48d44b2129b84e4f58cf47d076a0 Merge: bbd5885bfc15 2911a07e5602 Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:17:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:17:31 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/mt76' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:19:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt6J0bQtz5YJFN; Tue, 24 Sep 2024 21:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt6H4WKXz43qX; Tue, 24 Sep 2024 21:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XEwSwtR22+K/kikBP9raOH9IDVjEsr+MroRdDcCLdJM=; b=uxn6CtEiEoQGNSFrayd2vPz6n6jZdSpxthOO+X+dZV2T/Lckuf3qmARCvCbSKCGoEaiWD0 z4dFClLTaa++4LTWUk9my4aRLw/0nTIimFiOfNaEyZhVsZkFOOLT870DRORZCj0oBc6omq p45XoczdVqhAmwJRcQupwAb3bfXE8TvA/Sddt886XAi1hGB4m4XTlwW9Z+M4rhaF7LWLQc tKZexKKax/MZVURLK7NW9KEOtdcB+pd1e28/cVI3cC5gsse7SFCsStnLjniSNF/8TwjUcg V/FGxxyoduhOBT+xNM+q/x9hdh/4WBcsE8KJGaxrOuGvBJWnxGVI7DS+CWSYKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212775; a=rsa-sha256; cv=none; b=bIR1ZIq2KTop/gPjM++nzEh0qUiZnt7AKa+y58AX3DnZnT0Pvian7taacFLucC82xgx1qy T85ZaRUtZr3Ii4aYjKdGjth3h9lNIg3VSqKQxrZMFRKZ9ZgXFEl2x0s1XF1RKEyJ1Wa6fM HLHYCpQhncPQVx5YJsw9tSyAZEu2adLK31ivAN7JzbuATRU2qu8iW3P6YSq6rgGqadxAMQ Q3JgQtkmKPOEuzkihFibHys57WxV0okELI1UCESz1YdK28EC9LJldlVyqdEXOkrO6iToiC jO8MEtzUy5+tft42PucqyDFsvi++PibTumETxsra16AJX2kRdxApxBcPypH+NQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XEwSwtR22+K/kikBP9raOH9IDVjEsr+MroRdDcCLdJM=; b=VmBu01CPttyr0RfeXXyrSyKaOhPG7oea9aquaGvzmKjF0zb5dXMYHlelYJDdySmiCeQK0q 8/MIQEGv/V9GhFvz1pU43rrjx4ji44d04ScngyhVER2QNxgbBfeeS3c7s7nmwWgIqH3WI8 G5X9BHcDW84eoc9ZAw5cztddtdwkxi9UW1n2vvO702lODq0QRGwZIDyT30Q3eWlGy+qnrN toGoER+TSsE2i+hrrUB7Io4tBhM5PzviAJ7p2P9p+ApaDdT6md0kEv7Rt7Oq5U7VtZK8cw O6+eCylSyTuA1B5z0v856wkh/kSP6TiHpK5Bc+ENgMxRXxdA+JFkA8a/yPZR6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt6H46WTzlJs; Tue, 24 Sep 2024 21:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJZcW003004; Tue, 24 Sep 2024 21:19:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJZr9003001; Tue, 24 Sep 2024 21:19:35 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:35 GMT Message-Id: <202409242119.48OLJZr9003001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3c0de76f06ef - main - Merge remote-tracking branch 'freebsd/vendor/Linux/rtw88' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c0de76f06efb73d0eff6edcc11d32fd84ba7190 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3c0de76f06efb73d0eff6edcc11d32fd84ba7190 commit 3c0de76f06efb73d0eff6edcc11d32fd84ba7190 Merge: c9f9342a481d 1f3bff0d3082 Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:17:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:17:45 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/rtw88' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:19:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCt6K6Gy3z5YJFT; Tue, 24 Sep 2024 21:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCt6K2PSTz43l8; Tue, 24 Sep 2024 21:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=75rb24DJZu87QId24zoD1mbRP9BMECRM5shzjirm35o=; b=bRAO672KJIzbpm33PUFndLSb31jbLHxupHNUkDyG/6oSJ4aw+WOm6N/r7ssFK9hFIOWyKS zOjg31FWbi1ZKY7CWLjEQaRDv0k+vJTgEIO/D7syiXeg/PbfaBdA57zn11NAYPoTUG8Fio 7bPmU9qjdrpV7xEUhZhHFoMN4LCT3ArCnKWExy/LZeQzpM1T8vfLPpubzFFXG+H/C8mQ4V ZJkMsiCCFAN8OfE+Bf2rotBZoPw9XtgnQxsHw9aYnGqmHMpgjyPD/XZ2+vPrZcpzoPst37 1UpS1ViH3JMGkfMpE16yfEJImtR+mi8Ean+9ockkvUEQ0DHLUN9ZIJxhZwg0Bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727212777; a=rsa-sha256; cv=none; b=cA00NniHl0A1V2rDesIDnuLdKkNjcmylZeCzAreEjhSrPatrkEXm8EpkS58BIRQftsiEkz rAfmCn0KNMJ5o/UtadQ4AXztnCFQe+dnU4jxfz0gW/0EU2HT5x2gHNuRwVnMvutoLhRsR0 lvSmz289o0OWMZaeyDDhnL16u12xYXmbR23KT8BJ+M8yJ3CJE8bzs16Me6jR7CJkagINk/ 0zvAPPRrJheFMhMIvCorprA67Rj3OpjaI0lqMm3RKQ39C/cFSozGEWcBN0Zeq5gNKbvFSj sJrXOlSQD4BjkBd+MYj6Ef1McSvGAc8sM+1UIp7XjVpUmW+JL53WXX/BiKkcVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727212777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=75rb24DJZu87QId24zoD1mbRP9BMECRM5shzjirm35o=; b=n0Oanr+wZxPVrDOGOtAHnhr7DNpKvpnoy2GCa69X1EkiQHZN0ZtHu7aJ/2MmQvBDZjjw5L jwnQEYjW1B44a9m4dywSTBWAlJncORIjzCbHJvnC6ssb/ZLDM4JLmRfKEhXnnwQwEcZa/P iCdxeQATytMsas/7zGTOrARltB4Tk6jThi7syM4ivk2eznDnjHOY4iNQl7oheTOMHUYZAb J0OHzlT1yb4WibsOReUWtf/taB/fPTBFR4xipFU7vdO+V4qjD7J43xbmc10/1XPcW7x49D Hp8V0lFC/jRrW1ya8S2syyRMtROWack2G0z8dDDJMpecEzboQkEOygFGhtUBxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCt6K0n4yzlJt; Tue, 24 Sep 2024 21:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLJbEL003054; Tue, 24 Sep 2024 21:19:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLJa0A003051; Tue, 24 Sep 2024 21:19:36 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:19:36 GMT Message-Id: <202409242119.48OLJa0A003051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e3b12ef6f74e - main - Merge remote-tracking branch 'freebsd/vendor/Linux/rtw89' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3b12ef6f74e72e8250bcf55e5bcdfc029857913 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e3b12ef6f74e72e8250bcf55e5bcdfc029857913 commit e3b12ef6f74e72e8250bcf55e5bcdfc029857913 Merge: 3c0de76f06ef 6224ff21f3ff Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 21:17:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 21:17:56 +0000 Merge remote-tracking branch 'freebsd/vendor/Linux/rtw89' Sponsored by: The FreeBSD Foundation From nobody Tue Sep 24 21:33:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCtQ447Hnz5W5SB for ; Tue, 24 Sep 2024 21:33:16 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCtQ366cVz47HC for ; Tue, 24 Sep 2024 21:33:15 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso55926865e9.2 for ; Tue, 24 Sep 2024 14:33:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727213594; x=1727818394; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k/Agsjr7pDggAgOwa606BIzuh7y+2EFBqHcqpOhmxuo=; b=i+IVlgGW4XtClZzG2UJp5ynDCK7+2F4xG0Ym3czD77jCCfP6V4UtZKx9v7Xzyd0wmK w909OoWEWFGMs2PEd+V7OBRGKW2NXiZIM+JH0Jh24bdcdtb0O8xc35mahB6+DoE2WaYR U0oVRVqfdeA7tC0c4aFHgFU+bSzdBkoowyLQm18mo6cH0Fxhjsd+eLeCOyjnHI9Nsm/X kYLPegzJN382nevoI/CUnqwCsVZNigiyIZAbCAX9K2NluwmF/jguL9wHpd4ihnBLpMnb b/PkL7K77iVFRG5AFHuRL+ULFbwFRaGd5zI21HVrm5pmgknSMeYWpt7jrv7qvJvskevl GiBg== X-Forwarded-Encrypted: i=1; AJvYcCXmBp9hLtMGb4bGx1rmy2ENhQwlvMfttR5sGG2pK0VmeDoguNIGFvhydKrMZeNbynO+CfivmUWyCacQvaABCNBmAD5LYA==@freebsd.org X-Gm-Message-State: AOJu0YxBdCGYPr2h75TzHqeB6PWVfQlJVutMxJRa8mrB74omi9+2n8wO e3VqYYk1OHOO/7bsw7yOrJIjdg5rKR53TxwMJI6cWyEwvoSN+o7jEZ19WRcNNRDwEwFCSJi5hdu C X-Google-Smtp-Source: AGHT+IE0RqgOAfAMvT39kLk0eVMGLEtYGUzgDxhisDg+5T+pAUrrxsVekBcuA8kKgfSyE9H/rw4B+A== X-Received: by 2002:a5d:6290:0:b0:375:b52:7d75 with SMTP id ffacd0b85a97d-37cc24c9e66mr455769f8f.53.1727213593956; Tue, 24 Sep 2024 14:33:13 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf48c04esm1186490a12.14.2024.09.24.14.33.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2024 14:33:13 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Subject: Re: git: 413c5e9082a7 - main - Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' From: Jessica Clarke In-Reply-To: <202409242119.48OLJOws002720@gitrepo.freebsd.org> Date: Tue, 24 Sep 2024 22:33:02 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202409242119.48OLJOws002720@gitrepo.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3818.100.11.1.3) X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4XCtQ366cVz47HC X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On 24 Sep 2024, at 22:19, Bjoern A. Zeeb wrote: >=20 > The branch main has been updated by bz: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D413c5e9082a7d1d25fd3a95f0e77a949= 621f1433 >=20 > commit 413c5e9082a7d1d25fd3a95f0e77a949621f1433 > Merge: 604919c47fa4 9c6b6723ca84 > Author: Bjoern A. Zeeb > AuthorDate: 2024-09-24 21:06:19 +0000 > Commit: Bjoern A. Zeeb > CommitDate: 2024-09-24 21:06:19 +0000 >=20 > Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' >=20 > Sponsored by: The FreeBSD Foundation Hi Bjoern, This slew of merge commits has zero context for what they=E2=80=99re = actually importing beyond the branch name, which goes against the documentation for how to do vendor imports: > Include details about the changes being merged in the merge commit = message. -- = https://docs.freebsd.org/en/articles/committers-guide/#_updating_the_freeb= sd_source_tree This is unhelpful for anyone wanting to understand what you=E2=80=99re = doing. Jess From nobody Tue Sep 24 21:40:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCtZm3R3xz5W65l; Tue, 24 Sep 2024 21:40:48 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCtZm2yYLz47Qw; Tue, 24 Sep 2024 21:40:48 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727214048; 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: in-reply-to:in-reply-to:references:references; bh=cXrZXjmeFOVR+LTlYfvnsz/7yK3gZAbg7N0S6Vy6wL4=; b=m8ZpjfcWMZmPM7Z0rqw/fezasiXRlwYf80Zjo6inP+EDph+DW3Wr3LXHC/vIBHmA5KV3qd zTwZN/ryTyCkhLDhk77AAvDFNK5rYWtJJ+Es4gJH6xv2d7N4Oz4c0fuD2G1evnFNfyxeXX KSn7KdHQ+Vtzgy8HLpd/BlxvnV6Y92Z9RaiJ3wX677Tnr0qyjbIeXdBJd7/bPsK8gf9Eks 93luAZLgieN8rpDHooPwePIxs4m94XvcWBiJlX1smXkWbPA4vCgpGS7YwcKRdKThjFSuwe N7/251wMgeaMBKPZi+0julDIsZkAUGZxvFBgLZpan3SJav1aAg6FDt5LWaUO4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727214048; a=rsa-sha256; cv=none; b=s/HPy3ViCXNdjCV3QWJ4dlpWG/NRTgRmSAkYzcZiLgiulELyAS7r5T67N/VVEwKuVVOa0b Z+hFocQ1AaJK7W6oHcU6L6lr2jywmSBIEScxw6ezzduQVTd0AKCx0E63xJGpyANeLZxwPf Lq6S5tqoT5s5ZNvR9Kp9BqX5BVq5VlQDQ2n2zHvKsDoax5+5pP19m90EltNppBjPgViCP1 YlFygiUrqBpJwMeEslnXrAE+0jMQMEYDe26eVUibUZ9JkZcfUABlaLA+Ie2WxmPeufBnYU E8n3GoMZ8xA+qx6ccxcFqZ2g9zcGrkksJyS+dcEQBBQOnSfg8tfL/aTDClWgAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727214048; 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: in-reply-to:in-reply-to:references:references; bh=cXrZXjmeFOVR+LTlYfvnsz/7yK3gZAbg7N0S6Vy6wL4=; b=gQrNQDKEcPp7KT4dY4ZkoTxNuXx3O7b0sk1u3bTq1bvYmJEAFX3jTRF/2rywyUMaY153HW tKx3J3l+g9Q0SvKZEZbszLQgNPySvpgt+Qm/WJ+mr8Ekh9Vu7E/SWBqoJ0pO1MldmLDWM/ VKMtDFntSShNtqgu5Auu625Kd4FlBQZRIN0veMLAXmr5N0w9x+NWXmvqlHKzr6vXdpIwOo k4qOuHsVE6sm4U+Kdfo7HCcLaSvYnDFlsklHS1bnjbxcG0KorR5I8G4PkXdZ3ZrzIgsCj4 vvSUYOfqoaOsDXv7lJDcjCt5MdSZLDmpZmPEwV9s7ugElQ58S0UuEDgvvkFdfw== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XCtZl601LzSsx; Tue, 24 Sep 2024 21:40:47 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 24 Sep 2024 14:40:44 -0700 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e3b12ef6f74e - main - Merge remote-tracking branch 'freebsd/vendor/Linux/rtw89' Message-ID: References: <202409242119.48OLJa0A003051@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409242119.48OLJa0A003051@gitrepo.freebsd.org> On Tue, Sep 24, 2024 at 09:19:36PM +0000, Bjoern A. Zeeb wrote: B> The branch main has been updated by bz: B> B> URL: https://cgit.FreeBSD.org/src/commit/?id=e3b12ef6f74e72e8250bcf55e5bcdfc029857913 B> B> commit e3b12ef6f74e72e8250bcf55e5bcdfc029857913 B> Merge: 3c0de76f06ef 6224ff21f3ff B> Author: Bjoern A. Zeeb B> AuthorDate: 2024-09-24 21:17:56 +0000 B> Commit: Bjoern A. Zeeb B> CommitDate: 2024-09-24 21:17:56 +0000 B> B> Merge remote-tracking branch 'freebsd/vendor/Linux/rtw89' B> B> Sponsored by: The FreeBSD Foundation What happened? These merges don't bring anything. -- Gleb Smirnoff From nobody Tue Sep 24 21:41:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCtc40jbmz5W6wR for ; Tue, 24 Sep 2024 21:41:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCtc35wmCz48Qc for ; Tue, 24 Sep 2024 21:41:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2d8f06c2459so4018564a91.0 for ; Tue, 24 Sep 2024 14:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727214114; x=1727818914; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ED/D7NjL74msCvAyM32EHYNJaKozLRX3YoyPCNRkQpg=; b=leDCmi7Kwa9cA10ZxQP+DRSGox4z+GvKoeuCqGrscUbG6CLHB5pae95W6fzJDQtuGU 9QlSSftXqIDcQdRTkezcnJ3vD9YgZgDkMaXHimSb6f3kJAYbKq7a0iaHGkyI3ACtoqZ9 KyRMQH3YvF1gUdGvwBvDOQIKuArLk5ArOidUf3CcJW1bLyY6TwTwprIBoNd2tinN3INC X3YB+1arURnI9mlxuzrQMQ4V1i2wYnzgSmE/OsK4btqevgW8xvAyyFuc8sFqaVUA0uRs qbOqQ06eS/Ovb/zI0arQAvAPDHlLOilEXGeGYu3lFi+W74/pibX0wKdgYWik6DTUlJoL R1/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727214114; x=1727818914; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ED/D7NjL74msCvAyM32EHYNJaKozLRX3YoyPCNRkQpg=; b=X2xN8oXFasliBX0csxMkdMuMGcOYwP2qUfs4gxjQgDh0KRZmCxYy1R3kx61td6PRyQ vIkENlar2BYIBuEaJikIt5z7JZNjtc5eQxFE6KQnwcBK7s738mhBJ/zGD9Atl0yAUBcz fXWHgFnrsLBvXDWRgjj9CIA0Pvz0enAQfhjf3hpyPyBXJ7TDlTFytQFowH8hTasZpfkZ zKDAisXz/VMXuipnIEjEoPtoSK1csobl5w2wou8LQ1c3Hz4NrPO/KGZmonHgblO3ub6J mZut+Fw9ID76vTMLxwhxAAp1r8p2ItrnFfEcHfq6IE9cEEyImSWbdJEnHxRwbfubGblt 4uBA== X-Forwarded-Encrypted: i=1; AJvYcCW+g2KrAjxuXSnjRzoY0R2yuQj++Ler7Zx2brFAlfZtVMhANBWxgaYYF4UjJxbQdE73iVEKwRJZfQ/r/MGFhvUUPAZ6nw==@freebsd.org X-Gm-Message-State: AOJu0YxvXPitEaOu8DY/U2OXGA/I+inEoywXHRCznfGQ9exDhDAeQwbi zNTLzf2bIvZb6v4Q0ypesr475BngrbLWmzJDSIwpAHpxsRGRLz7ybERzgu2v+Wh1kxwMYLOSMh5 U2VJWyDsg+qbwqmlacxeIkFR5HIZlCr8NqdduQw== X-Google-Smtp-Source: AGHT+IGfubi79PHvyW9hSFK81C1qQvUiD9m/lZLbaMH1QRmkcpI0yFLKcYpYeiIDOKD/7gKsf3IS260D2MnDa/O30to= X-Received: by 2002:a17:90b:5205:b0:2c9:61ad:dcd9 with SMTP id 98e67ed59e1d1-2e06afb8f0dmr548978a91.27.1727214114509; Tue, 24 Sep 2024 14:41:54 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202409242119.48OLJa0A003051@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 24 Sep 2024 15:41:42 -0600 Message-ID: Subject: Re: git: e3b12ef6f74e - main - Merge remote-tracking branch 'freebsd/vendor/Linux/rtw89' To: Gleb Smirnoff Cc: "Bjoern A. Zeeb" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000bf37e10622e45f52" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XCtc35wmCz48Qc X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --000000000000bf37e10622e45f52 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Sep 24, 2024 at 3:40=E2=80=AFPM Gleb Smirnoff = wrote: > On Tue, Sep 24, 2024 at 09:19:36PM +0000, Bjoern A. Zeeb wrote: > B> The branch main has been updated by bz: > B> > B> URL: > https://cgit.FreeBSD.org/src/commit/?id=3De3b12ef6f74e72e8250bcf55e5bcdfc= 029857913 > B> > B> commit e3b12ef6f74e72e8250bcf55e5bcdfc029857913 > B> Merge: 3c0de76f06ef 6224ff21f3ff > B> Author: Bjoern A. Zeeb > B> AuthorDate: 2024-09-24 21:17:56 +0000 > B> Commit: Bjoern A. Zeeb > B> CommitDate: 2024-09-24 21:17:56 +0000 > B> > B> Merge remote-tracking branch 'freebsd/vendor/Linux/rtw89' > B> > B> Sponsored by: The FreeBSD Foundation > > What happened? These merges don't bring anything. > This is bootstrapping the vendor branches for software that previously was added to the tree w/o a vendor branch. Warner --000000000000bf37e10622e45f52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Sep 24, 2024 at 3:40=E2=80=AF= PM Gleb Smirnoff <glebius@freebsd= .org> wrote:
On Tue, Sep 24, 2024 at 09:19:36PM +0000, Bjoern A. Zeeb wrote:
B> The branch main has been updated by bz:
B>
B> URL: https:/= /cgit.FreeBSD.org/src/commit/?id=3De3b12ef6f74e72e8250bcf55e5bcdfc029857913=
B>
B> commit e3b12ef6f74e72e8250bcf55e5bcdfc029857913
B> Merge: 3c0de76f06ef 6224ff21f3ff
B> Author:=C2=A0 =C2=A0 =C2=A0Bjoern A. Zeeb <bz@FreeBSD.org>
B> AuthorDate: 2024-09-24 21:17:56 +0000
B> Commit:=C2=A0 =C2=A0 =C2=A0Bjoern A. Zeeb <bz@FreeBSD.org>
B> CommitDate: 2024-09-24 21:17:56 +0000
B>
B>=C2=A0 =C2=A0 =C2=A0Merge remote-tracking branch 'freebsd/vendor/L= inux/rtw89'
B>=C2=A0 =C2=A0 =C2=A0
B>=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0The FreeBSD Foundation
What happened? These merges don't bring anything.
=
This is bootstrapping the vendor branches for software that = previously was added
to the tree w/o a vendor branch.
<= br>
Warner
--000000000000bf37e10622e45f52-- From nobody Tue Sep 24 21:43:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCtfB1jfYz5W70H; Tue, 24 Sep 2024 21:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCtfB1402z49L5; Tue, 24 Sep 2024 21:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727214226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=geI6gIIkIoCkdRbHakT/9KgvZC0D4qhdFgA0cOn054w=; b=Ce+cDX5vAxDKjck7hpGDoN58QGpluEMWCNFbMoS8usvALoDrtsy8+subHKqa24IOmEEQLA POOUbrDZI7hJ7oVFbnB7WHzwMUnFQIdJPOwiUMtW80gpWzowEaULV/T5qQvrC4tSsMZB8j 7rvQ0FPxRAKZmwZXxecwvn99AJkuNxSvLRAo6aA1+ooDc+FyFGI2nMH+SSTtnjJ43CVqu2 75V+Nr8Ikp2PLJbjBrXUkDrGIf2RXq0j3jOSfQQ7Q4H6Xhdaa5NVt58u9ZKGiP9XSdY3kJ 7k1oIvIGFEm+j50G/W6itxyJ1WZzVKYnKo3BA7VC+6J864UkGPE29eWvy8TdCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727214226; a=rsa-sha256; cv=none; b=VFDz+mUVCY+xVqwe8hxOzunS5CE19AouJZ2Gknp1cU71htHodr6kRYoZ4pOHZbpVWDwne7 fX2fB4jPOX+n+9ilZCJ95gVbDU8Y7CQvKgC2/L8JbI+9ED+U2aFEdHwSNT5Mr04WpsXM5h WOs+Kq+QcxZqqDfS1Pzac1eOkmg9/ABbqi91FzqbOjmV+sZaZiV2fAlR0ltn+6bT5z3gQ9 Y6k143YhB/rmfosnKgwR76XrGs/gBNg2K5lnARHt7LOnYGXqz2iNoW3JQ/p8OR6Np0iMmx dLa/DzQxbsxN3e6MFqnopWzqQzxOxc2Q3Cj8KtP4tCcqSj5kxQH1RIAlhnwlkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727214226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=geI6gIIkIoCkdRbHakT/9KgvZC0D4qhdFgA0cOn054w=; b=FKRSgZx4+Ukl4pTby+jN2fKlNgTbbZZN/44XSH5xqNwDT3sb7pRcwcBM8McUWBj6RimoO7 iv/wTWM1zYauRFL02qVT7MZQMoH590C3aTyt41Yi2cKSrF6AwK6qWrIsVxQ3k2RcsnUeSL mr9K9kFqe2q2PrZ3xp6vcTXX0DEpKQv8Smfe9f0r5ZypWQwN06uacRrNQFzMSkeeF4mMEM o0tuSsloxUB2G6Ks8ojKfgvePmDXBmZRrYge5iQS2OvaCQKgd53gUFfhR4DX/aj6zf6UA2 NgnQISYXS5saipBJKIV37yXIwcbn3Mr0q3+1tmdpg7GnYbEJ4N3D05ZBolEktA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCtfB0gNGzm1m; Tue, 24 Sep 2024 21:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OLhjSh053748; Tue, 24 Sep 2024 21:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OLhj4f053745; Tue, 24 Sep 2024 21:43:45 GMT (envelope-from git) Date: Tue, 24 Sep 2024 21:43:45 GMT Message-Id: <202409242143.48OLhj4f053745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: a00c3a94bf64 - main - tcp: remove remnants of 20+ year old disabled code from d912c694ee00 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a00c3a94bf6436f1c412cd8fe66ef224621dab11 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a00c3a94bf6436f1c412cd8fe66ef224621dab11 commit a00c3a94bf6436f1c412cd8fe66ef224621dab11 Author: Gleb Smirnoff AuthorDate: 2024-09-24 21:36:10 +0000 Commit: Gleb Smirnoff CommitDate: 2024-09-24 21:36:10 +0000 tcp: remove remnants of 20+ year old disabled code from d912c694ee00 Fixes: 90ad2dc28747a3a5036d68ccc87d2352459f5cb1 --- sys/netinet/tcp.h | 2 -- sys/netinet/tcp_output.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index f789898e5785..794bfc62eca5 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -166,8 +166,6 @@ __tcp_set_flags(struct tcphdr *th, uint16_t flags) #define TCP_MAX_WINSHIFT 14 /* maximum window shift */ -#define TCP_MAXBURST 4 /* maximum segments in a burst */ - #define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ #define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) /* max space left for options */ diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 080dabf3232f..fe1f15c26338 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -211,9 +211,6 @@ tcp_default_output(struct tcpcb *tp) struct tcp_log_buffer *lgb; unsigned int wanted_cookie = 0; unsigned int dont_sendalot = 0; -#if 0 - int maxburst = TCP_MAXBURST; -#endif #ifdef INET6 struct ip6_hdr *ip6 = NULL; const bool isipv6 = (inp->inp_vflag & INP_IPV6) != 0; From nobody Tue Sep 24 21:48:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCtlQ1NQJz5W715 for ; Tue, 24 Sep 2024 21:48:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCtlQ0zQkz49rl for ; Tue, 24 Sep 2024 21:48:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7ae3d7222d4so5037593a12.3 for ; Tue, 24 Sep 2024 14:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727214497; x=1727819297; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=W4XE3t3y8IBskp5t2KNEoJWC1nC9Hvd30JbhBuV7nfg=; b=FW48GBUYVxoZchT+34NPWrAsCTKAMUYyKzdFfMiYAwQ7wZ6wZAFU8Gv906JLRJIKTX HTqJxfwIAr4O7Gwhh4GJQ2EGv20AHTR+ky4g9mbYTn2A09Xz22zEjIJFLim+HfCR8UOr TRrMMNX8J7mGnikWV9RrBEGVBO/a3LLhQ9PhK3GzlktXNEOR/gH1KuFHJE7lkjs/Auho 2OhbrWYm6cvg4baqu07p+oLey176q1B0f4Ew6anwEdCxgHsqExTJMwnZ2IH6RGWnoUt/ vjpdQoVySL3tJD3AA5XdMT/3TkaIZ+eq9YCPRKjNyzkjE8eYIBpBc8FAviy+avErx9hC 5lAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727214497; x=1727819297; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W4XE3t3y8IBskp5t2KNEoJWC1nC9Hvd30JbhBuV7nfg=; b=lTw/AKEXUZOPTatnkT/RVQILPhmiJXl9WA7g7IYdliRV+WGF7VFqydqzqR/MmXyxAv 2WHYgmWUeUJ21vckvIEaIfcjqXtUnluT4OTVXGlrFKKyBbgfwL7iauqc9cJ/iTEdpjGH HTITKiUvXkglGGEwNO0bAH+m5A3/8enOgm0yla/L5O77zfOIdtif80z6drsQQz9eqiI/ rCzUucj9YunvZTShiO9LXZgYQQoqz5E4QYieU2zy8QlKXVjsmZ8ngl8wFZpfYUy1ihkn dHjwmtbrXNsocmO4ICQ0Xsx1NtZeVziEJn35emLxhejXeRpW8bNQ5WUEu+/bjAyAE5eF 5M/w== X-Forwarded-Encrypted: i=1; AJvYcCVC+1CAxjWI8f++sXfII/1QzKRJsVmvaEbVdPw0owt75Xy4ppMLkNnqLDl3/xtFNkBfXHTqacwjIuJkrUeJdJw/RNKrJQ==@freebsd.org X-Gm-Message-State: AOJu0Yz2xGbiCILysbHy1hFQWlu2ZfsX9uT1X99PSodGoiohBv6nQTpn qc2aSclQpXw+YHFBM90fR+Y5Wv92b4hlH4bV8b8imGvLru7tWqZj2mMT8qdJuI36IA4rn9l+J6B PJe0v/+E5B2L2FLF7NXkGFvR10cjjOvlNWtrD+w== X-Google-Smtp-Source: AGHT+IHnfQDRPQYDseDuSKxLQUqWSwhYHNhmK/lFAaUrzVVABxoPqbp4l//HmhR/Ca6y6aUW2uOiCP/Uf2ikHP5M92M= X-Received: by 2002:a17:90a:9382:b0:2d8:8d34:5b8 with SMTP id 98e67ed59e1d1-2e06ae5e28amr737110a91.10.1727214496821; Tue, 24 Sep 2024 14:48:16 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202409242119.48OLJOws002720@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 24 Sep 2024 15:48:05 -0600 Message-ID: Subject: Re: git: 413c5e9082a7 - main - Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' To: Jessica Clarke Cc: "Bjoern A. Zeeb" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="00000000000088d00a0622e4765b" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XCtlQ0zQkz49rl X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --00000000000088d00a0622e4765b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Sep 24, 2024 at 3:33=E2=80=AFPM Jessica Clarke = wrote: > On 24 Sep 2024, at 22:19, Bjoern A. Zeeb wrote: > > > > The branch main has been updated by bz: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D413c5e9082a7d1d25fd3a95f0e77a94= 9621f1433 > > > > commit 413c5e9082a7d1d25fd3a95f0e77a949621f1433 > > Merge: 604919c47fa4 9c6b6723ca84 > > Author: Bjoern A. Zeeb > > AuthorDate: 2024-09-24 21:06:19 +0000 > > Commit: Bjoern A. Zeeb > > CommitDate: 2024-09-24 21:06:19 +0000 > > > > Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' > > > > Sponsored by: The FreeBSD Foundation > > Hi Bjoern, > This slew of merge commits has zero context for what they=E2=80=99re actu= ally > importing beyond the branch name, which goes against the documentation > for how to do vendor imports: > > > Include details about the changes being merged in the merge commit > message. > -- > https://docs.freebsd.org/en/articles/committers-guide/#_updating_the_free= bsd_source_tree > > This is unhelpful for anyone wanting to understand what you=E2=80=99re do= ing. > Agreed. However, I looked at these commits. This is bootstrapping vendor branches for software that had been directly added to the tree before. I should have had Bjoern mention this in these merge commits, but it didn't occur to me until after the commit. Warner --00000000000088d00a0622e4765b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


--00000000000088d00a0622e4765b-- From nobody Tue Sep 24 22:29:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCvfh3Hhqz5W9Sn; Tue, 24 Sep 2024 22:29:16 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCvfh2mlqz4F0S; Tue, 24 Sep 2024 22:29:16 +0000 (UTC) (envelope-from bz@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727216956; 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: in-reply-to:in-reply-to:references:references; bh=NrkHy59DwMCwMaKg2fWzxZZ/Br8qncskGCuj2PnY++4=; b=g9KRbG++Pe/RC1oo91J06pnZGBpy7fxO6v9/5tGICFBCmcwLy6biOi73XwqzBOnSe4G8AO iWcAb7Bq6qBwP87ZpWq8CUnCIozbvDpKOEfC56dsqrKmMK/XjeaNVBLgASp6jOlBuaKXis FNX2WFRYHwzSBXpRhRKFEhTM/gNhtRO742t8hK4v3iTQT0pv/Y/GegCm1FQEo2g9aiDzOO dXsxbk86GJh2LHdgBaIUJx/5lFL1JoIwSApgtbD8mcR2s+339TrZBGLY/SHPIO+JxR1AkU x7suNqGLWNLIL7Va0v9iduJTktjZi2ILUV5jByd8uBLB6Kx4Pt4+ANTE14EISQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727216956; a=rsa-sha256; cv=none; b=acxbaTPUTT2PpoLHj+2hZr92OiBkj2pZID8InraYN3dmq8hav6Hy7SEDj3ZohKaAUR+pBC puI8qH3uvzr3YEmDhOVE7tKxtULxHpA+2IFESQG7byqOBjJyZvKgUAzfWsy+qytcfFkahq 14m4pOhSyONiArU79gILuk1Q9f//HatLW91BHE3z343e9MG88jUrP+NViKJrENOCtBVvNt FHZw5ovbAzjuodyC1Eq1w+QKX94uADNOjVWHr1WqYU5VchVLnben9E//RmnXCNTCSbSnWH I1j+1Ynr8yp3HLJHFRe6YU6+zFYwxxFZf+sUWa6YLc7itThc3/TUR3fx9djuAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727216956; 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: in-reply-to:in-reply-to:references:references; bh=NrkHy59DwMCwMaKg2fWzxZZ/Br8qncskGCuj2PnY++4=; b=pax4qIrUn+GtqAQHBF5q+szrGGYsjqDn5ME/UB0YhTnVtILFZHr9uENCW+rkD3UQA0oi/d riCXbgKv+7L7+cgGRM2rR5cs10O0yVaP3NbJq4ppyDoK8jrqcsOCheLvEaIlDyF1Kjrknk EB0YLrTC9Ge/NDqnlOLSWP2NLupUQITaQMYjuh5Wk0mk7EsgcJzptunVrpsHInvZY6YaXS zxfNl51TKomUDPixubZqmSIg8mC8efDUjLbWAS1b+nXTKMzt7aocaot6YrrW/DPgQL5f0f /9taVK17fK3icV5GYePnJjGe2SzslEDr0L6r8aq/QBW2NT14fBzCC4pYGfhLvQ== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-256) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XCvfh1QdkzTcq; Tue, 24 Sep 2024 22:29:16 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 63C50A64806; Tue, 24 Sep 2024 22:29:08 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D872C2D029D8; Tue, 24 Sep 2024 22:29:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id iq36zNVNZvv2; Tue, 24 Sep 2024 22:29:10 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E21E32D029D2; Tue, 24 Sep 2024 22:29:10 +0000 (UTC) Date: Tue, 24 Sep 2024 22:29:10 +0000 (UTC) From: "Bjoern A. Zeeb" To: "src-committers@freebsd.org" cc: "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 413c5e9082a7 - main - Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' In-Reply-To: Message-ID: References: <202409242119.48OLJOws002720@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1098556516-1115143918-1727216662=:5181" Content-ID: <177po972-2q66-430n-n1q9-71p9332o2q8p@mnoonqbm.arg> This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1098556516-1115143918-1727216662=:5181 Content-Type: text/plain; CHARSET=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT Content-ID: On Tue, 24 Sep 2024, Warner Losh wrote: > On Tue, Sep 24, 2024 at 3:33 PM Jessica Clarke wrote: > >> On 24 Sep 2024, at 22:19, Bjoern A. Zeeb wrote: >>> >>> The branch main has been updated by bz: >>> >>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=413c5e9082a7d1d25fd3a95f0e77a949621f1433 >>> >>> commit 413c5e9082a7d1d25fd3a95f0e77a949621f1433 >>> Merge: 604919c47fa4 9c6b6723ca84 >>> Author: Bjoern A. Zeeb >>> AuthorDate: 2024-09-24 21:06:19 +0000 >>> Commit: Bjoern A. Zeeb >>> CommitDate: 2024-09-24 21:06:19 +0000 >>> >>> Merge remote-tracking branch 'freebsd/vendor/Linux/ath-common' >>> >>> Sponsored by: The FreeBSD Foundation >> >> Hi Bjoern, >> This slew of merge commits has zero context for what they’re actually >> importing beyond the branch name, which goes against the documentation >> for how to do vendor imports: >> >>> Include details about the changes being merged in the merge commit >> message. >> -- >> https://docs.freebsd.org/en/articles/committers-guide/#_updating_the_freebsd_source_tree >> >> This is unhelpful for anyone wanting to understand what you’re doing. >> > > Agreed. However, I looked at these commits. This is bootstrapping vendor > branches for software > that had been directly added to the tree before. I should have had Bjoern > mention this in these > merge commits, but it didn't occur to me until after the commit. It hadn't to me either given you and Ed had explained all this to me and cleaered my other concerns and given they were "empty" not actually "adding" anything. So here's the summary as I understand it: Multiple versions of the driver code had landed in freebsd/main before we created the vendor branches. We added the full import history to the vendor branches which was not linked to freebsd/main---and isn't apart from the current version in main now after these empty merges. These records of "no-change merges" finally add related history between the vendor branches and main to alllow us to use standard procedure for the vendor branches (subtree merges) in the future. This was done using what I'd call "git magic" provided by Ed no one else will hopefully ever need again. HTH. -- Bjoern A. Zeeb r15:7 --1098556516-1115143918-1727216662=:5181-- From nobody Tue Sep 24 22:58:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCwJt56Wgz5WC88; Tue, 24 Sep 2024 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCwJt3hCxz4HKQ; Tue, 24 Sep 2024 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727218734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W9tz3en01QB4CMDC3Pr+jmul2FrI7CUBwKuAFV7GOME=; b=N/8xuBptS5ePoM+f2Pn9SxTxdBVoiDVW0DQTV5hezzyLJqj3FfZhu0Y4SHfqYjQcNa1zuT xGjVi2HD86JlbwDVJ0BVAm9ljKeEA84hWf0zCcHDPJ7TKjnxOigqSKWrLCnd3ukyVTOIo5 xRdgXPMWpfb4Ea56hr+KO6tbr9LZEreHLbdNbIS0m7gS4A+WfaQRwLqZHHer7RkBI7xR/h vNoH7EKxjPOKdjaxWvGaxFW6lKsSmeoYffz4z61Wt3qPvYf3CCKlc92aIDZyWpZp+5Ttjv 2kK4xFp436crxDPW8GbbHloxbfF1aclHeZhYaTAUlhazTKCskNdG6YYej+Pf0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727218734; a=rsa-sha256; cv=none; b=gzP/gkknpCcL8xozLmzzrmdIsGD3BWRHpSUYDgyb0979r4P+5IVoTUnprKnRImLHWl3xXz hbq7Y51oIzyJsoHpRPMTi9BbkNBfhklwa3UfdQMuRFDNZ5z/+ReWdmUVW1xgIQYZyrDrcf ePGLBmixcXtJWIS54AkCtZgrLi6XmJSpKZpasWVpM9kWWEvGNX006dg/5eiNxdmm+XDIOQ +r1v+IntmSbEZ9o/mgEvAaznB8Ttu2m35S8SGccj+C7iRtZyVt9IPz8FOfNHNLjN8ZIgka wfwjvwu2klMpPZpy0lwx9px4YR3yC/LkVvwlMEJKZr7HMf7bkuvg9eURmsKwfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727218734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W9tz3en01QB4CMDC3Pr+jmul2FrI7CUBwKuAFV7GOME=; b=TmxN+YMSw0HyeLKpWqWh3A/fHF42VP6svavywgGTZnwXb8hI9t4LiY5t3g+Eh3Nin8m7zI y/ikOs9zojgLXasZCo0oYVw9HMtYb8KRcZX2BfdWr6QehzUNTkr/HHdGd/kQHKHjruyfhn Om7g68AUOjGbnDtrkfgMdqDw1hpX5JD0bOKXKnXSHOEAd/VGqMYbOCQwv8S+N7RgGUaJQd 3Z+JmI98J4bav6E9azRWkWu9dDAZN8On1UHThtGQTqHC7PLiTOB0Wb8iGNCNGDgXj9felm tcXvMbMC/r/qD+jQAVq6y7Gkn7SS9uDYdLpodm4XJUt0K1AnyAa23cfyS7gcyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCwJt3GnHznlH; Tue, 24 Sep 2024 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OMws92073681; Tue, 24 Sep 2024 22:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OMwspv073678; Tue, 24 Sep 2024 22:58:54 GMT (envelope-from git) Date: Tue, 24 Sep 2024 22:58:54 GMT Message-Id: <202409242258.48OMwspv073678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5b8f97d8db82 - main - usb: change LIST to SLIST to avoid LinuxKPI conflicts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b8f97d8db82e031c409d29313939423b7aac2cb Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5b8f97d8db82e031c409d29313939423b7aac2cb commit 5b8f97d8db82e031c409d29313939423b7aac2cb Author: Bjoern A. Zeeb AuthorDate: 2024-09-04 19:21:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-24 22:53:28 +0000 usb: change LIST to SLIST to avoid LinuxKPI conflicts In order to better integrate modern LinuxKPI USB this tries to reduce a contention point of "LIST". Given there is no need to use a LIST here change it to SLIST to avoid conflicts. It is a workaround which does not solve the actual problem (overlapping namespaces) but it helps us a lot for now. Sponsored by: The FreeBSD Foundation X-MFC? unclear Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46534 --- sys/dev/usb/controller/usb_controller.c | 6 +++--- sys/dev/usb/usb_bus.h | 2 +- sys/dev/usb/usb_dev.h | 2 +- sys/dev/usb/usb_device.c | 14 +++++++------- sys/dev/usb/usb_device.h | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c index 838bd6bf7621..d717ad56adea 100644 --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -653,8 +653,8 @@ usb_bus_cleanup(struct usb_proc_msg *pm) bus = ((struct usb_bus_msg *)pm)->bus; - while ((pd = LIST_FIRST(&bus->pd_cleanup_list)) != NULL) { - LIST_REMOVE(pd, pd_next); + while ((pd = SLIST_FIRST(&bus->pd_cleanup_list)) != NULL) { + SLIST_REMOVE(&bus->pd_cleanup_list, pd, usb_fs_privdata, pd_next); USB_BUS_UNLOCK(bus); usb_destroy_dev_sync(pd); @@ -847,7 +847,7 @@ usb_attach_sub(device_t dev, struct usb_bus *bus) bus->shutdown_msg[1].bus = bus; #if USB_HAVE_UGEN - LIST_INIT(&bus->pd_cleanup_list); + SLIST_INIT(&bus->pd_cleanup_list); bus->cleanup_msg[0].hdr.pm_callback = &usb_bus_cleanup; bus->cleanup_msg[0].bus = bus; bus->cleanup_msg[1].hdr.pm_callback = &usb_bus_cleanup; diff --git a/sys/dev/usb/usb_bus.h b/sys/dev/usb/usb_bus.h index b9197d3cd84a..ad7b661c2ac0 100644 --- a/sys/dev/usb/usb_bus.h +++ b/sys/dev/usb/usb_bus.h @@ -86,7 +86,7 @@ struct usb_bus { struct usb_bus_msg shutdown_msg[2]; #if USB_HAVE_UGEN struct usb_bus_msg cleanup_msg[2]; - LIST_HEAD(,usb_fs_privdata) pd_cleanup_list; + SLIST_HEAD(,usb_fs_privdata) pd_cleanup_list; #endif /* * This mutex protects the USB hardware: diff --git a/sys/dev/usb/usb_dev.h b/sys/dev/usb/usb_dev.h index 08ceb2555942..381fa1654c95 100644 --- a/sys/dev/usb/usb_dev.h +++ b/sys/dev/usb/usb_dev.h @@ -96,7 +96,7 @@ struct usb_fs_privdata { int fifo_index; struct cdev *cdev; - LIST_ENTRY(usb_fs_privdata) pd_next; + SLIST_ENTRY(usb_fs_privdata) pd_next; }; /* diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index dd571fcef299..0f3c6a959ad2 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1880,7 +1880,7 @@ usb_alloc_device(device_t parent_dev, struct usb_bus *bus, snprintf(udev->ugen_name, sizeof(udev->ugen_name), USB_GENERIC_NAME "%u.%u", device_get_unit(bus->bdev), device_index); - LIST_INIT(&udev->pd_list); + SLIST_INIT(&udev->pd_list); /* Create the control endpoint device */ udev->ctrl_dev = usb_make_dev(udev, NULL, 0, 0, @@ -2190,7 +2190,7 @@ usb_destroy_dev(struct usb_fs_privdata *pd) delist_dev(pd->cdev); USB_BUS_LOCK(bus); - LIST_INSERT_HEAD(&bus->pd_cleanup_list, pd, pd_next); + SLIST_INSERT_HEAD(&bus->pd_cleanup_list, pd, pd_next); /* get cleanup going */ usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->cleanup_msg[0], &bus->cleanup_msg[1]); @@ -2207,7 +2207,7 @@ usb_cdev_create(struct usb_device *udev) int inmode, outmode, inmask, outmask, mode; uint8_t ep; - KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("stale cdev entries")); + KASSERT(SLIST_FIRST(&udev->pd_list) == NULL, ("stale cdev entries")); DPRINTFN(2, "Creating device nodes\n"); @@ -2254,7 +2254,7 @@ usb_cdev_create(struct usb_device *udev) mode, UID_ROOT, GID_OPERATOR, 0600); if (pd != NULL) - LIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); + SLIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); } } @@ -2265,10 +2265,10 @@ usb_cdev_free(struct usb_device *udev) DPRINTFN(2, "Freeing device nodes\n"); - while ((pd = LIST_FIRST(&udev->pd_list)) != NULL) { + while ((pd = SLIST_FIRST(&udev->pd_list)) != NULL) { KASSERT(pd->cdev->si_drv1 == pd, ("privdata corrupt")); - LIST_REMOVE(pd, pd_next); + SLIST_REMOVE(&udev->pd_list, pd, usb_fs_privdata, pd_next); usb_destroy_dev(pd); } @@ -2358,7 +2358,7 @@ usb_free_device(struct usb_device *udev, uint8_t flag) mtx_destroy(&udev->device_mtx); #if USB_HAVE_UGEN - KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); + KASSERT(SLIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); #endif /* Uninitialise device */ diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h index 3fc5efb049fc..87596cc1d2bd 100644 --- a/sys/dev/usb/usb_device.h +++ b/sys/dev/usb/usb_device.h @@ -225,7 +225,7 @@ struct usb_device { struct usb_fifo *fifo[USB_FIFO_MAX]; struct usb_symlink *ugen_symlink; /* our generic symlink */ struct usb_fs_privdata *ctrl_dev; /* Control Endpoint 0 device node */ - LIST_HEAD(,usb_fs_privdata) pd_list; + SLIST_HEAD(,usb_fs_privdata) pd_list; char ugen_name[20]; /* name of ugenX.X device */ #endif usb_ticks_t plugtime; /* copy of "ticks" */ From nobody Tue Sep 24 23:53:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCxWS52bQz5WGNN; Tue, 24 Sep 2024 23:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCxWS4XD7z4LLm; Tue, 24 Sep 2024 23:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727221988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RgUlz/2+f9SOA9hZ2bhPT7J745FbybPDbL0TZGd5E9w=; b=uNMEwfKiV7AMLr/KbQQYiK/K33URJXlnYNNSMT2EhxMjeA8lrIc/Gbw4gM9hztBq4GojRG z/hn3ERn/6Eh3lHOkRXhX/5GyylDesrqXe10iM+ejLT2sVVejbDDYXiCwhsZEWwEFN0TqS zD1WTEJc3WlTkc+nUHJvcxRT+2UX5uitRLN1DI5NldLzfpNi/jOsxFuUs3gCFNK/JSG7Nn tf8deYBwmXUX2UL2UJBTCwYIBVtO8HsP9Jup0rEl050mNMctA/yJ9T0ZYpyJ15R+b8KVXj ILrgIbIFNFX+PUgZr93p4LsyzzJMycvVrnpO80c4QgLNI8vIqCpGuTaBXeFPmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727221988; a=rsa-sha256; cv=none; b=bUL6Y9b90V4ViOswvS6nwlhy0+Xw+oHBV9OhH2XUTx+LKWw9sD5J15V0NBLeHzbbxL2GfS XFSpxTNkgwapcXx97YH1Qg7Hs+BvtCkZ/8fHCcsqsQab2JEvJKx7o2oVJB8U94HHYun8zp O6FR44i/ljJeXggskN3fI7y9Hd2KyIu712sQfvL9mrWm4zuLdB2a1uOjL/H6AHlsunNtJ7 OhV4M//R/fe+3Dima1L9u/hkw0iSN43Cbgj1/wls9f/cv4c+kQTUSaO6VQr2j8/Z7OpzIN NbYM4RvWXNSDQ8LtQFRLRsxVMQKlxeUUFYyApKGrEJdU22BfgjeYYcYnlBOvQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727221988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RgUlz/2+f9SOA9hZ2bhPT7J745FbybPDbL0TZGd5E9w=; b=LH00L9ucpnXAkOutlo7OISdlXeMF3/oTzhv6/EIPiOLjc3D0mtihTU8MCyR37R3rCri8NK vj6aelap/8sIUz61BjZV5ir2eyO6yvIxxfjbTVo87edr+L6uQrCtApHN6F55c9p2TBaRTt roBk7AmWMYG0aT2H2/Pvvaa34Rc11E5DpAayCZxGzfj7qoMMmns822ZzegUuoeQMAvB3Sf FfCMJ5zEuYrsvS82c17ktdCL8uzbRmcaFJNTghW1+SFrIbxfIhZbx8ERgXCOEKZPvaT6pG TVcsp8duRTUnk28fmBo3NZyKIVX414GraIbADNdeHVSexp4Q5Z/RdUIZ0VHf1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XCxWS47NFzpq0; Tue, 24 Sep 2024 23:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48ONr805074368; Tue, 24 Sep 2024 23:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48ONr8xI074366; Tue, 24 Sep 2024 23:53:08 GMT (envelope-from git) Date: Tue, 24 Sep 2024 23:53:08 GMT Message-Id: <202409242353.48ONr8xI074366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: ee3da604dd01 - main - cxgbe(4): Clobber all tracer state on stop and redo only traceq on restart. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee3da604dd016439850dae77366796313e60f0e0 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=ee3da604dd016439850dae77366796313e60f0e0 commit ee3da604dd016439850dae77366796313e60f0e0 Author: Navdeep Parhar AuthorDate: 2024-09-24 23:28:29 +0000 Commit: Navdeep Parhar CommitDate: 2024-09-24 23:52:22 +0000 cxgbe(4): Clobber all tracer state on stop and redo only traceq on restart. Tracers have to be recreated after a restart but that's okay given that they are used for debugging only. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 4412e1ab95fb..307b9c27111a 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2095,6 +2095,8 @@ stop_lld(struct adapter *sc) if (pi->flags & HAS_TRACEQ) { pi->flags &= ~HAS_TRACEQ; sc->traceq = -1; + sc->tracer_valid = 0; + sc->tracer_enabled = 0; } } if (sc->flags & FULL_INIT_DONE) { @@ -2411,6 +2413,15 @@ restart_lld(struct adapter *sc) "interface: %d\n", rc); goto done; } + if (sc->traceq < 0 && IS_MAIN_VI(vi)) { + sc->traceq = sc->sge.rxq[vi->first_rxq].iq.abs_id; + t4_write_reg(sc, is_t4(sc) ? + A_MPS_TRC_RSS_CONTROL : + A_MPS_T5_TRC_RSS_CONTROL, + V_RSSCONTROL(pi->tx_chan) | + V_QUEUENUMBER(sc->traceq)); + pi->flags |= HAS_TRACEQ; + } ifp = vi->ifp; if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) From nobody Wed Sep 25 07:13:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XD7Hv4xHNz5WlbY; Wed, 25 Sep 2024 07:13:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XD7Hv4PMQz4GkJ; Wed, 25 Sep 2024 07:13:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727248427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c0Hd/OoUoAJQoBLA1kIYiyqXE/nL4btkTWsbx6rjpN0=; b=bL2wMTM1ciyMlvfkZ7re63S2DCGyqZIkkXv8+8KgcO/yu8e/FLR1IccSTAXbxQ/f8O5QFo PZ7wU9AT0lNmiX3ldc+0sbplJ2OhA//uPy3ffApM/wLxf/+sfBrEHggH4jGivJiHxsitmj 7a3PPDt7Xa9nPJffS6J2rbcoSFdQPOVWLAm979rNERfMbbqbdxTouRWjDyVnb+n4kx7QfK CHC+CILe4vxYY1ZUGL6oUToq6oZcVmuh6StaXzLip6QbKQJW7gzKO3Y8bkuX+4AycrtZlo Y+DG5ozBc7Ej5RYrs+uyK6UAU8LkQL365Xqa/er/B2aSxi8CUMUZjwGLVBoTtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727248427; a=rsa-sha256; cv=none; b=w90/hXtH0Xn2gFEW/POaGYDNEc1akLBU/XhaNSTjlUWn+Yb+k7SsHl5fnB8ls6oyh+70iz o9m88/hm2XY32zvJMaWxK0NolbmP1YuPvlBnuz0bJjbjqoLGBXUfbZqjr4zqmUJI7it6s+ 55/ds7zkHNq08Lpr5DHeNSdzV3Gw5UpGRhBDCz53X1LzrJzZEYqRAhbkv431ni3m72VKn6 glE9HX2FgvFvxFBm63CsAPk8T8ntnBGFcBhx2RbuYdQn2n1G/4CuwFnpPP8jQdViqR1OXk LV3yDxWKH5j5RXZiV4S9lSyBpQ22E1MgUlWUpYmHTNTGXqMze7sy+s4EMQRykA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727248427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c0Hd/OoUoAJQoBLA1kIYiyqXE/nL4btkTWsbx6rjpN0=; b=XT47eXvQ+Ee+fGyz9nuq0WgsYGFCjCZLgKli9a0q8Y++XwbhYIopLbobwsDtD5XjOf9sbs hPBa2+IthAj76Z1MfPPPIcwwZ/BefIdFCj5YTG1GOtWtxofbhy7yq/Cr4z/KuZWQthC6Dx eXZ2b1tlv/EdHt+2R9CWJ633KPTt1RVsgVPYdKh5ziELvse7ivfdOd3NzPd1x/F3EoUZZd Qe/et9mDUElp7GYz3vVPqaWl0CEcDf8Gth+sXA78tBeN0aGGs1woFwkg2srk5AsD60V5WD iPFFEfaUlGMOeStt5GL0HonAq3vTC/mkN2hmCPeZj1J3tgXdxVYmwbxwY0fnXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XD7Hv40Yhz12m9; Wed, 25 Sep 2024 07:13:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48P7Dl9X028713; Wed, 25 Sep 2024 07:13:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48P7Dl8t028710; Wed, 25 Sep 2024 07:13:47 GMT (envelope-from git) Date: Wed, 25 Sep 2024 07:13:47 GMT Message-Id: <202409250713.48P7Dl8t028710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c9c2452a2535 - main - unix tests: Skip random_eor_and_waitall unconditionally List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9c2452a25355db7d89bfc93fd9d50f46690949c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c9c2452a25355db7d89bfc93fd9d50f46690949c commit c9c2452a25355db7d89bfc93fd9d50f46690949c Author: Mark Johnston AuthorDate: 2024-09-21 12:41:06 +0000 Commit: Mark Johnston CommitDate: 2024-09-25 11:44:14 +0000 unix tests: Skip random_eor_and_waitall unconditionally This test always fails, I don't see any reason to make it conditional on the "CI" test parameter. There is at least one test bug here, we're using the wrong sysctl to obtain the receive buffer size, but fixing that is not sufficient. PR: 279354 Reviewed by: glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46726 --- tests/sys/kern/unix_seqpacket_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/sys/kern/unix_seqpacket_test.c b/tests/sys/kern/unix_seqpacket_test.c index ba3de0adb1e9..d142e228b036 100644 --- a/tests/sys/kern/unix_seqpacket_test.c +++ b/tests/sys/kern/unix_seqpacket_test.c @@ -1197,8 +1197,7 @@ ATF_TC_BODY(random_eor_and_waitall, tc) size_t off; int fd[2], eor; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/279354"); + atf_tc_skip("https://bugs.freebsd.org/279354"); arc4random_buf(params.seed, sizeof(params.seed)); printf("Using seed:"); @@ -1210,7 +1209,7 @@ ATF_TC_BODY(random_eor_and_waitall, tc) for (u_int i = 0; i < RANDOM_TESTSIZE / (u_int )sizeof(long); i++) ((long *)params.sendbuf)[i] = nrand48(¶ms.seed[0]); - ATF_REQUIRE(sysctlbyname("net.local.stream.recvspace", + ATF_REQUIRE(sysctlbyname("net.local.seqpacket.recvspace", ¶ms.recvspace, &(size_t){sizeof(u_long)}, NULL, 0) != -1); ATF_REQUIRE((recvbuf = malloc(RANDOM_RECVSIZE * params.recvspace)) != NULL); From nobody Wed Sep 25 09:19:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDB4s0Xbsz5XCrH; Wed, 25 Sep 2024 09:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDB4r74Pgz4V9L; Wed, 25 Sep 2024 09:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727255965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oZRKYpdgcjV6ouo9sQu+vjKQzFqkVS7UlIBrJZGm3WE=; b=KUgNbW7WLqsQ+pn2hWVG/ph1E4+5h2PJO3ALtYLuSl41+NzXIQJDhPmINkSRZVBt6jBbeo DC71ebuPbxPtnsf8okvRCLV1xTlBRUy3wjpz1MXFesW0E7tsrsOsq0slUTpoUiG3lw0ErG uGN8YHCslKEm9qd3Ybb3Yx1AcrS2sbW6ONKbyXAOwhm+Fw2rK3Z3n1CtXMEK1lVfnetHoo Vr5LyN5Xyfa/78oKeeL0tE2SVv/IHo3oXf1nW3u6dAhAOyVU/sxzHRhPzRlveHRmuvnMBH QfQmUlBdf7OzMWy2itazsPxFnihOpe4b6u/q07YMqa/Qytl+hd0wF0+UwOUVsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727255965; a=rsa-sha256; cv=none; b=EFnUPul4ZI7zjgx+Cf+2ZjTX+G4oBxjywpBb+KRpQatyrBx7chSSZlO1zlm1f1MpH/Y6Oq 9is7oygoaCkcBW9ZzqLVGNZImUE9/8o4ABhygyMslxb6V1RgqvYPXGnkSIoDwF6MsashcZ eBMymulfkgJoZH12FBuX9an41j4scx7u8JBjwzfYrSmnAUAWFbUGs13eqIBDtJeQHBGW26 X56v/uyoq0Hc13pGcokk/+HQIwl6oMblFir+QcS0slq3L6cyI8E3vT6WT+0FrcBjiSwfnF x882Ty0OAVrYM6bU1L55Rb2fU9nYEr92QvjhBpbnIMzXq2OcjFzt80EKvdLyTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727255965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oZRKYpdgcjV6ouo9sQu+vjKQzFqkVS7UlIBrJZGm3WE=; b=lJm8j5pohsfxrKfbMhoC0IRLX+hcUCb7Wkj3ZKHGaqEL4jbay6YXD2Zo3TRHYM+mWJ8ix0 EUKyPYrh61N/DTjwa3U6wgi6mm2A6aoZ/sVYAzxQ58aNJnzllM1F03+Gn1Ry9d3s+hCjJk I+3WfR90YqSfxcZiEgqvkUo4ivB4gzagdDxlqhBuHwq2Y+a0k1nIztTwJ+DjMdSsRWbxJq ONB8idpuvaDDRFlcrjHWLltZxrXoCRPgcWCF9HU5FPl9D/fUqwhMY7otvDIAmLB4W/kjpb 8Bl0xoHZE1ZHh9J53OTyh3yhJlQO51PA2hpl9Fn9ehPBTn5tJWfezA6I3GfARQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDB4r6gvvz16Lv; Wed, 25 Sep 2024 09:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48P9JOq9033722; Wed, 25 Sep 2024 09:19:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48P9JO1J033719; Wed, 25 Sep 2024 09:19:24 GMT (envelope-from git) Date: Wed, 25 Sep 2024 09:19:24 GMT Message-Id: <202409250919.48P9JO1J033719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 7b7e39221ec9 - main - pf tests: Speed up divert-to.sh test cases List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b7e39221ec9f525a86b26d24d70260e51faa907 Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=7b7e39221ec9f525a86b26d24d70260e51faa907 commit 7b7e39221ec9f525a86b26d24d70260e51faa907 Author: Igor Ostapenko AuthorDate: 2024-09-25 09:18:06 +0000 Commit: Igor Ostapenko CommitDate: 2024-09-25 09:18:06 +0000 pf tests: Speed up divert-to.sh test cases Reviewed by: kp Approved by: kp (mentor) Differential Revision: https://reviews.freebsd.org/D46671 --- tests/sys/netpfil/pf/divert-to.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/divert-to.sh b/tests/sys/netpfil/pf/divert-to.sh index c7118c397032..b27d321d7825 100644 --- a/tests/sys/netpfil/pf/divert-to.sh +++ b/tests/sys/netpfil/pf/divert-to.sh @@ -104,7 +104,7 @@ in_div_body() sleep 1 # divapp is expected to "eat" the packet - atf_check -s not-exit:0 -o ignore ping -c1 192.0.2.2 + atf_check -s not-exit:0 -o ignore ping -c1 -t1 192.0.2.2 wait $divapp_pid } @@ -183,7 +183,7 @@ out_div_body() sleep 1 # divapp is expected to "eat" the packet - atf_check -s not-exit:0 -o ignore ping -c1 192.0.2.2 + atf_check -s not-exit:0 -o ignore ping -c1 -t1 192.0.2.2 wait $divapp_pid } From nobody Wed Sep 25 09:37:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDBVD5q7gz5XDdH; Wed, 25 Sep 2024 09:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDBVD5JFSz4Wsy; Wed, 25 Sep 2024 09:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727257076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qaskU+XS46JKphl3xEXWNRCxvNLg/3qyYu+8G2VjDfo=; b=fQhZYukCwn4ci9ihldBEaax5K2By2i0snW1DGTM639l5yUR+WBwMliIY7FzXTH9///WQnF LKBTI4NHAHvoPBA3i1RpKTycEacRhdvVXh+4pHiICNlBy3JhrJGTgJGaNobY9pwkEfNr42 WRkgJjJLswVo4weqr6ga5AdHbuFBzxYwT+dhj8rma9v/9YRM9ChTm27uvJkDSwDBRVJ0+D mjHsBSmCAFBTfZnWvu39CAsH1AVZYVt4MBoFeZlDCKyZT5Ah5LvWt6yr/jQRowctOXof7Z 6hf3Eh95gY7FQI6tSZUVeRfm8UVgPJouSRl+gzK+Ez48j8GkbUCxdl8GwbnqiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727257076; a=rsa-sha256; cv=none; b=DN2IpRZsxH367A1sUjH9XzKKBnItiDWc/9L21Y0omrQWc3CrUQkHEiW7ITKTz7ZUd44G/S 4/1P1jLYukCThAImu++vdJdGf6iFzsfZ6aG2AbUtqDpQz4gTVNn1kyuk8X7qoNyW2uSfyU pzzM4Bn2jkYCfxCy2tUxl2jQySkhw7NHtdokDHT53jsBH1sgzLhdxjonYE6gz741y7OUJC GfJBr+iozgoUL12L7Qne2uXBALLQGclFImRzrO66PuvIUU2vwSG3RYPqmJK9E3w2o0GTNU jKK769rCHNZeYyLUaGRH1BEYCcBA5KgjtbzHDLJe/crowd24IGe+9L7HGX+UOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727257076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qaskU+XS46JKphl3xEXWNRCxvNLg/3qyYu+8G2VjDfo=; b=HjgnEdtwPBYPMCXK5F0eSwazqitFoclZaTGQsr/1Mx9BoJJ8Phv2wNi/rSW3dmiNHpXaPv 7oySkaxU/mSMjXHXY7aH5R0P3POZeFDucv9RtqAaVfiygT1mrZOrpVKAimxbZiqK8JMJla JV8RaggixrM5jwXb5haxLEj3g4qJp94O03GPodj5nsZBRjiEo157cLwNsgW8NT8l1wv7QZ lZPzlLWSZ0S8VwssUkg2Fh3eJRah6XrZlL3Qw17ikcuA2VfF9iKgwEwnJXUd2aZI7iHuAo EpLMJMUI/YMcOF+VfB7ry272H2IEPj7smlgBAfYra3nKXsFhVlLLBbFYoc/mjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDBVD4kp0z16CW; Wed, 25 Sep 2024 09:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48P9buZ4067259; Wed, 25 Sep 2024 09:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48P9buYL067256; Wed, 25 Sep 2024 09:37:56 GMT (envelope-from git) Date: Wed, 25 Sep 2024 09:37:56 GMT Message-Id: <202409250937.48P9buYL067256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 930a1e6f3d2d - main - e1000: Delay safe_pause switch until SI_SUB_CLOCKS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 930a1e6f3d2dd629774f1b48b1acf7ba482ab659 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=930a1e6f3d2dd629774f1b48b1acf7ba482ab659 commit 930a1e6f3d2dd629774f1b48b1acf7ba482ab659 Author: Joyu Liao AuthorDate: 2024-09-25 09:19:13 +0000 Commit: Kevin Bowling CommitDate: 2024-09-25 09:37:37 +0000 e1000: Delay safe_pause switch until SI_SUB_CLOCKS Based on sysinit_sub_id, SI_SUB_CLOCKS is after SI_SUB_CONFIGURE. SI_SUB_CONFIGURE  = 0x3800000,  /* Configure devices */   At this stage, the variable “cold†will be set to 0. SI_SUB_CLOCKS    = 0x4800000,  /* real-time and stat clocks*/ At this stage, the clock configuration will be done, and the real-time clock can be used. In the e1000 driver, if the API safe_pause_* are called between SI_SUB_CONFIGURE and SI_SUB_CLOCKS stages, it will choose the wrong clock source. The API safe_pause_* uses “cold†the value of which is updated in SI_SUB_CONFIGURE, to decide if the real-time clock source is ready. However, the real-time clock is not ready til the SI_SUB_CLOCKS routines are done. Obtained from: Juniper Networks MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42920 --- sys/dev/e1000/e1000_osdep.c | 10 ++++++++++ sys/dev/e1000/e1000_osdep.h | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_osdep.c b/sys/dev/e1000/e1000_osdep.c index 8016ee352068..8b598f18cf12 100644 --- a/sys/dev/e1000/e1000_osdep.c +++ b/sys/dev/e1000/e1000_osdep.c @@ -34,6 +34,16 @@ #include "e1000_api.h" +int e1000_use_pause_delay = 0; + +static void +e1000_enable_pause_delay(void *use_pause_delay) +{ + *((int *)use_pause_delay) = 1; +} + +SYSINIT(enable_pause_delay, SI_SUB_CLOCKS, SI_ORDER_ANY, e1000_enable_pause_delay, &e1000_use_pause_delay); + /* * NOTE: the following routines using the e1000 * naming style are provided to the shared diff --git a/sys/dev/e1000/e1000_osdep.h b/sys/dev/e1000/e1000_osdep.h index bddb97afd8b9..893979025f01 100644 --- a/sys/dev/e1000/e1000_osdep.h +++ b/sys/dev/e1000/e1000_osdep.h @@ -79,9 +79,11 @@ ms_scale(int x) { } } +extern int e1000_use_pause_delay; + static inline void safe_pause_us(int x) { - if (cold) { + if (!e1000_use_pause_delay) { DELAY(x); } else { pause("e1000_delay", max(1, x/(1000000/hz))); @@ -90,7 +92,7 @@ safe_pause_us(int x) { static inline void safe_pause_ms(int x) { - if (cold) { + if (!e1000_use_pause_delay) { DELAY(x*1000); } else { pause("e1000_delay", ms_scale(x)); From nobody Wed Sep 25 10:40:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDCsx4fxQz5XJff; Wed, 25 Sep 2024 10:40:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDCsx49Kyz4hY0; Wed, 25 Sep 2024 10:40:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727260805; 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: in-reply-to:in-reply-to:references:references; bh=VnfVuseIuo5i7S3CBF+OCdTMPay4cpv4MwYJbHRi5fY=; b=KVCHMxtvaITyYfQbDYw2diQvwPObs/8Y8ORrb4zq0pyRSFbkBnvGLqqPJf3W4ri++HaasM vw41O9ggjys7hnBeSryJItvU2rxRNvYlGZlpptGy2WmRgkPC+Bw2jkj7PPmSLQJHXBxM7m KM6MdTr01qfsC1LUbXhY1uVsZQUN/yYhmwoNGcEKHjJOZMf7QeSFq4OXjnvkC75NglO6Xo 5+WI5Zjk/m1nzWUVE51q9VbDNNF5UsKlDBdqnD6SmAdvMiD3X7KcX84QSCAQWU/FL6WWEJ PlbnzZyP1SMuY0uY98HUWA5uFG2BTwevpD1ZJHSSSoCuU2xN8/2gmhVYggRqvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727260805; 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: in-reply-to:in-reply-to:references:references; bh=VnfVuseIuo5i7S3CBF+OCdTMPay4cpv4MwYJbHRi5fY=; b=PB7UGWmOMagoV2E1a9WjQoJG72SPORS2jXgjMcwzXqyQfPY2jYyE3wI/SXtByVRPkcXfq9 c3pAihcttezy5B2pcx2ZG2tYt4QTpaGL4+pxLxtXPbuebQBAH6TPuFNTSMR+LJVewFkZsy e/PWCIclY0jZ9+DlJIixzivWIGJBexa+VTFbWPwdJGj9q8Bs3EEl5hFmjuzLW1fy/04+e/ SFmLVbnzP9fIIaUpEzrO7tO4weIK5upVWFhYm0pThtjKzOJovzdOqJR1sIvgune+FFWBf3 i+ce6HbPSDdkvEXs6uCAbqjFC7MQUxkFtG1UCLEMNS55EbiGWttC+9dSiO9nwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727260805; a=rsa-sha256; cv=none; b=IlpLu7kZ2k/EWuwUxiOKhMgpfBQ/8t+EEFE6tx4Hpt1n0uKJYo5k/g7wg+58JTRQhpUCri ByfTuVa+aJDW8ffDjRU9qc/2wP7beeJFRbLNT8shf51TBYEISanqq+g+Z/+S9kvFzePhBr GCob0hqUnrrMj5n4W+5utDzxyLItubehpovnnURzILBDZ0G2n3LTDiZpWzknLveA0ovvxB 0FISpNLWIO7+SvzELZlURbSCJC5MhAW6xKfF/j7Lso6VbxqsarcnRGy7D/LWSFDrJyO0OG CGdBxxhY+bCKaEnin6IqV6Zlx/vu6ntGQE6RrvWmZmi7gTs7um8aE8bcgjHJog== Received: from localhost (p200300cb871c2d03658d866ea04c78ac.dip0.t-ipconnect.de [IPv6:2003:cb:871c:2d03:658d:866e:a04c:78ac]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XDCsx1M8kzjhs; Wed, 25 Sep 2024 10:40:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Date: Wed, 25 Sep 2024 12:40:03 +0200 From: Gordon Bergling To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 044f94adff55 - main - timeout(1): Update STANDARDS section Message-ID: References: <202409241642.48OGgoWH040751@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Xok2D7IXjPZ1fyqy" Content-Disposition: inline In-Reply-To: X-Url: X-Operating-System: Darwin 23.6.0 arm64 X-Host-Uptime: 12:23 up 8 days, 14:31, 4 users, load averages: 4.00 3.05 2.56 --Xok2D7IXjPZ1fyqy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Brooks, On Tue, Sep 24, 2024 at 05:07:56PM +0000, Brooks Davis wrote: > On Tue, Sep 24, 2024 at 04:42:50PM +0000, Gordon Bergling wrote: > > The branch main has been updated by gbe: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D044f94adff55f13130f03c0c= 170fa879c8febb5b > >=20 > > commit 044f94adff55f13130f03c0c170fa879c8febb5b > > Author: Gordon Bergling > > AuthorDate: 2024-09-24 16:42:18 +0000 > > Commit: Gordon Bergling > > CommitDate: 2024-09-24 16:42:18 +0000 > >=20 > > timeout(1): Update STANDARDS section > > =20 > > Update the STANDARDS section for timeout(1) to > > POSIX 1003.1-2024. > > =20 > > Update mandoc to be able to render the > > new POSIX macro. >=20 > This should not have been a single commit. mandoc should have been > updated first in it's own commit, ideally referencing the upstream commit > or better as a full update of mandoc from upstream. mandoc has not seen a release in a while, but has many single commits in the OpenBSD tree. I wasn't sure about tracking so many individual commits so I just took the one needed for the man page update. Dragonfly and also OpenBSD has a few updates to timeout(1), which I am about to backport for FreeBSD. The man page was the easiest part. I could revert that change, but I hope it can stay that way it is now, so that I can focus and bringing the updates for timeout(1) to phabricator. --Gordon --Xok2D7IXjPZ1fyqy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAmbz6IMACgkQOQX2V8rP 09wlmAgAySsXFCo+L1iQiWm4N1UG9RTKlpqQqKSmUE8zEg3Yimcnk5Xd/gnQOT63 JEfrNqzKIrYGz981btpDw5kJXm9MmgVGbJrTJmzfkd+UwnEg3U1LudTTT4A8237b YOMOxfiMqeC52fqqb5ywc397/2skLjCOtaBcxVEVHOZFzSoMpLlJt4ZLciBlLtX3 zZgEY1XLXGW4s92WQ0v+1lf43gRMZd660rTfAfFfpXdVqs9PBhL8nU8I8IcmV7h2 /9QsX0b5rWq3cqNi+VbXOqHIsONy4JcI2CR9Z8tcbReSMBgrNkATsembG/S4B54e uG7eyXdyiQ3HTJGn0ceIIwIRsZixnQ== =4bCM -----END PGP SIGNATURE----- --Xok2D7IXjPZ1fyqy-- From nobody Wed Sep 25 10:44:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDCyT36RSz5XJVH; Wed, 25 Sep 2024 10:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDCyT2Xkbz4jG9; Wed, 25 Sep 2024 10:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727261041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XDpx+9g6eIH52eFqpJ5QwAejC/f9JHZBIdxw3l6nDM4=; b=elJjc6qp+QqQdB0uAq/4f0MIrPiOXT94b/QJcqlrpTK4BzDkLLtPBkajqKJqrnjCrlu0HE 7svAoUgs1GFk0ApoCfyDmy/59cH/LaOJqQdYx75D338HBPerCZj9+jLs39swdq0hJn43TO r1PUjN8qS0uKgkw3Z+O+VdEH1EDtD61iRU2BCtF77Gamuh1UOipHsN5tNfwiqzcAbOvgfV dSEHfCQdJBRL9RGEdJssRaKjp3/xnMrfrmrCQ1/nFGdjF7gkn/PCMte6fBHJit1a5uje6x RfGiCs0vCtKx1HuVMvUY4V7GjLKgFDVPZBimwmBwERpNNwFXFxJGsIeUGyFjAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727261041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XDpx+9g6eIH52eFqpJ5QwAejC/f9JHZBIdxw3l6nDM4=; b=LUpsyYGKcKz+b32IAlp8WGf10F7uFR0WADpRgGE0bIOCwq6fcLitosLgbPxg92ecpYyTbC H/Eq7hOghFwIUTPv7OXaOk7qXudcMVWrJiU7iWl+CngupY8zxYApLq3fPi6JIDdpR3xwKE ZPE39qjcS7o1zgz3pPksHJz5iox/UPbsuwD58TmuyRvU1vk5+3VpdJws4LekTuwrLRW8FD 5/n5uO8JAnPOlsj+5GbGH6ykjhkS5cNkx2NsIc7SFQ9tOZn6ZNqIg8z3VCMgBwnLvyPoKl nV8FjwtaEyRHmhNfAl4ziH/8f6hzBmggu0pluj6AP6m55puXhYkR3nBBMVm8KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727261041; a=rsa-sha256; cv=none; b=PhUnE/MtBYlbsl5bkJVurZkBDlINIqa8gdBlxIoCPaYLJDKvJ1fMe/zhwrhvbY/aly922I RNWOuPZPQ1ZQtgsq67EcilKlGlqk3pMEQSgDIaw9GolO8ut8kIVRryZtTMs3mI1N+HS52+ kn0+h9Q3BqipOwlwKPicBf9fiMKxeQ6p8FySZgB/wEUtQIL2RnHCMsYri1gp2ma/T2vul9 IiG1kC5qar8gN/+O6PXC+IaIWiKQn4A4jCV4DJg/ZuASNHq0FuiSWDWzyNmijaG/k3eh29 tfEaZLGUyyL6c59+5L6OiK2ZFYOMvlI0+OwiAiA3BK5LSN4DKDS3fNrBtu0S9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDCyT27tdz1822; Wed, 25 Sep 2024 10:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PAi131085268; Wed, 25 Sep 2024 10:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PAi1dB085265; Wed, 25 Sep 2024 10:44:01 GMT (envelope-from git) Date: Wed, 25 Sep 2024 10:44:01 GMT Message-Id: <202409251044.48PAi1dB085265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6aeaadf68def - main - pf tests: Remove nargs from single arguments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6aeaadf68def9bb6355c7462c5527574698367df Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6aeaadf68def9bb6355c7462c5527574698367df commit 6aeaadf68def9bb6355c7462c5527574698367df Author: Kajetan Staszkiewicz AuthorDate: 2024-09-25 08:35:33 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:43:27 +0000 pf tests: Remove nargs from single arguments Using nargs=1 causes arguments to produce lists from which we must then get the real value. The same applies to defaults, the must be provided as arrays too. Remove nargs=1 so that values and defaults can be accessed directly. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46772 --- tests/sys/netpfil/common/pft_ping.py | 73 ++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index a24a1e00150a..21b08c75a7da 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -408,17 +408,15 @@ def parse_args(): description="Ping test tool") # Parameters of sent ping request - parser.add_argument('--sendif', nargs=1, - required=True, + parser.add_argument('--sendif', required=True, help='The interface through which the packet(s) will be sent') - parser.add_argument('--to', nargs=1, - required=True, + parser.add_argument('--to', required=True, help='The destination IP address for the ping request') parser.add_argument('--ping-type', choices=('icmp', 'tcpsyn'), help='Type of ping: ICMP (default) or TCP SYN', default='icmp') - parser.add_argument('--fromaddr', nargs=1, + parser.add_argument('--fromaddr', help='The source IP address for the ping request') # Where to look for packets to analyze. @@ -431,36 +429,36 @@ def parse_args(): # Packet settings parser_send = parser.add_argument_group('Values set in transmitted packets') - parser_send.add_argument('--send-flags', nargs=1, type=str, + parser_send.add_argument('--send-flags', type=str, help='IPv4 fragmentation flags') - parser_send.add_argument('--send-frag-length', nargs=1, type=int, - help='Force IP fragmentation with given fragment length') - parser_send.add_argument('--send-hlim', nargs=1, type=int, + parser_send.add_argument('--send-frag-length', type=int, + help='Force IP fragmentation with given fragment length') + parser_send.add_argument('--send-hlim', type=int, help='IPv6 Hop Limit or IPv4 Time To Live') - parser_send.add_argument('--send-mss', nargs=1, type=int, + parser_send.add_argument('--send-mss', type=int, help='TCP Maximum Segment Size') - parser_send.add_argument('--send-seq', nargs=1, type=int, + parser_send.add_argument('--send-seq', type=int, help='TCP sequence number') - parser_send.add_argument('--send-length', nargs=1, type=int, - default=[len(PAYLOAD_MAGIC)], help='ICMP Echo Request payload size') - parser_send.add_argument('--send-tc', nargs=1, type=int, + parser_send.add_argument('--send-length', type=int, default=len(PAYLOAD_MAGIC), + help='ICMP Echo Request payload size') + parser_send.add_argument('--send-tc', type=int, help='IPv6 Traffic Class or IPv4 DiffServ / ToS') parser_send.add_argument('--send-tcpopt-unaligned', action='store_true', - help='Include unaligned TCP options') + help='Include unaligned TCP options') parser_send.add_argument('--send-nop', action='store_true', - help='Include a NOP IPv4 option') + help='Include a NOP IPv4 option') # Expectations parser_expect = parser.add_argument_group('Values expected in sniffed packets') - parser_expect.add_argument('--expect-flags', nargs=1, type=str, + parser_expect.add_argument('--expect-flags', type=str, help='IPv4 fragmentation flags') - parser_expect.add_argument('--expect-hlim', nargs=1, type=int, + parser_expect.add_argument('--expect-hlim', type=int, help='IPv6 Hop Limit or IPv4 Time To Live') - parser_expect.add_argument('--expect-mss', nargs=1, type=int, + parser_expect.add_argument('--expect-mss', type=int, help='TCP Maximum Segment Size') - parser_send.add_argument('--expect-seq', nargs=1, type=int, + parser_send.add_argument('--expect-seq', type=int, help='TCP sequence number') - parser_expect.add_argument('--expect-tc', nargs=1, type=int, + parser_expect.add_argument('--expect-tc', type=int, help='IPv6 Traffic Class or IPv4 DiffServ / ToS') parser.add_argument('-v', '--verbose', action='store_true', @@ -478,31 +476,26 @@ def main(): if args.verbose: LOGGER.setLevel(logging.DEBUG) - # Dig out real values of program arguments - send_if = args.sendif[0] - reply_ifs = args.replyif - recv_ifs = args.recvif - dst_address = args.to[0] - - # Standardize parameters which have nargs=1. + # Split parameters into send and expect parameters. Parameters might be + # missing from the command line, always fill the dictionaries with None. send_params = {} expect_params = {} for param_name in ('flags', 'hlim', 'length', 'mss', 'seq', 'tc', 'frag_length'): param_arg = vars(args).get(f'send_{param_name}') - send_params[param_name] = param_arg[0] if param_arg else None + send_params[param_name] = param_arg if param_arg else None param_arg = vars(args).get(f'expect_{param_name}') - expect_params[param_name] = param_arg[0] if param_arg else None + expect_params[param_name] = param_arg if param_arg else None expect_params['length'] = send_params['length'] send_params['tcpopt_unaligned'] = args.send_tcpopt_unaligned send_params['nop'] = args.send_nop - send_params['src_address'] = args.fromaddr[0] if args.fromaddr else None + send_params['src_address'] = args.fromaddr if args.fromaddr else None # We may not have a default route. Tell scapy where to start looking for routes - sp.conf.iface6 = send_if + sp.conf.iface6 = args.sendif # Configuration sanity checking. - if not (reply_ifs or recv_ifs): + if not (args.replyif or args.recvif): raise Exception('With no reply or recv interface specified no traffic ' 'can be sniffed and verified!' ) @@ -514,22 +507,22 @@ def main(): else: defrag = False - if recv_ifs: + if args.recvif: sniffer_params = copy(expect_params) sniffer_params['src_address'] = None - sniffer_params['dst_address'] = dst_address - for iface in recv_ifs: + sniffer_params['dst_address'] = args.to + for iface in args.recvif: LOGGER.debug(f'Installing receive sniffer on {iface}') sniffers.append( setup_sniffer(iface, args.ping_type, 'request', sniffer_params, defrag, )) - if reply_ifs: + if args.replyif: sniffer_params = copy(expect_params) - sniffer_params['src_address'] = dst_address + sniffer_params['src_address'] = args.to sniffer_params['dst_address'] = None - for iface in reply_ifs: + for iface in args.replyif: LOGGER.debug(f'Installing reply sniffer on {iface}') sniffers.append( setup_sniffer(iface, args.ping_type, 'reply', @@ -538,7 +531,7 @@ def main(): LOGGER.debug(f'Installed {len(sniffers)} sniffers') - send_ping(dst_address, send_if, args.ping_type, send_params) + send_ping(args.to, args.sendif, args.ping_type, send_params) err = 0 sniffer_num = 0 From nobody Wed Sep 25 12:34:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDGPt5qfHz5XQcT; Wed, 25 Sep 2024 12:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDGPt58Msz4vTw; Wed, 25 Sep 2024 12:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xHiNIzuSznN62dUTkEXbjedp58FESY54nyYZdKzBdNk=; b=g8JpCB0jc/OWMPRFVvuNCgo39+KO0MgK2m6/eQ7iuz4ip6Rj6WPEJEYm8ZxtyA1frrPdVf 4qG39XqeIvWRmY5nl2uECIaVcX3VZithVaCJDFjzuCGjZQj7EjTUiPGJrdzK+iceQdS0hp IvfuRL4HIZ5Z5kZuZQX0EmLvKPnrXzDzSKS20NhrKuxSBlLX5i1osXDC6hIOMriO32guDs SXKpz8CRs39T0dU2pmVdtSsEs/H9XGkG0Kcx34E6TxAYbgKkg/mjle4UGzHoTZbxkiBHc3 CCfzEjg3lgNUN1e9gXso+aE3U/JJTu6CrMVpYf4q1YU8QUjNpDEtetG0LNRojw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xHiNIzuSznN62dUTkEXbjedp58FESY54nyYZdKzBdNk=; b=Ke9Pd5/6dhFR45J+d9DQiJxgmpisne/pjjVNmTnR3AuLwFQETD+TM1qwJ856aHHEAjRNgx KJ2LGgtlmlkZt8aSC3g/dYYCCGcOTrot9nE/z+C4yHyn5rqaaAs6VIeDPa4oGDUUrEV+i2 WtzXl79ZmZPi7LWgaZ2HfZdBaa7XwEzz8QMQf/Y26T+z/MNnwASxqgb7AkjAOcAfW24svp lV2qYvJvLnXUiVBBmw2usrq0+k7tT0uzwtwVAtpLeqKtay7EswoIWh8igWKJdP8MBcJnoE oNt7WEaD0PvCN3qbKMOAU6RDFF8XhJxKk//zmMTBw4MIPNGKVr24h8pphNMFLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727267666; a=rsa-sha256; cv=none; b=dmIuyzbOXobl3t1QkSbIP2O8nT1oMbuhg9yb9FmY+Om7KfKBkwKLeKPYPGTyXxkO6mFpuj Pp6nGKmbHUCJMnH+vJzVicAY8CRMK1VZTpAJoHAAd+UUr27idoSZgaXaMD3TVo2SGUIelF 5w3qMhc9+RWqD4sOKRRemMnNYaAIFmFKh7Yv6Ip8wliFq2dsMW7fgkUDn1VSc4exWukI/c tIWuyLl+oD0dand9AYSPbNX4oaH2Pn5Bs+3eMVnD28qp70IP11XAZI5mbWQqBB78WFveGN HXLCftilOFznpq6yRM3wCeYF0X9uBBrknHWRKciamOijkic8yiIEFb9JW2/9cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDGPt4KBlz1CRL; Wed, 25 Sep 2024 12:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PCYQba071582; Wed, 25 Sep 2024 12:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PCYQ8L071579; Wed, 25 Sep 2024 12:34:26 GMT (envelope-from git) Date: Wed, 25 Sep 2024 12:34:26 GMT Message-Id: <202409251234.48PCYQ8L071579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4f9e688708f1 - main - pf: merge pf_scrub_ip() and pf_scrub_ip6() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f9e688708f1bead81954c429f7eca5109ee454b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f9e688708f1bead81954c429f7eca5109ee454b commit 4f9e688708f1bead81954c429f7eca5109ee454b Author: Kristof Provost AuthorDate: 2024-09-06 11:32:53 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:44:18 +0000 pf: merge pf_scrub_ip() and pf_scrub_ip6() Merge pf_scrub_ip() and pf_scrub_ip6() into a single function. Call pf_scrub with the right arugments in the rule case so that match rules will work as expected. OK henning@ Obtained from: OpenBSD, claudio , 48c45e6969 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46597 --- sys/net/pfvar.h | 9 +++----- sys/netpfil/pf/pf.c | 4 ++-- sys/netpfil/pf/pf_norm.c | 60 +++++++++++++++++++++++++----------------------- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 0dfa58979f16..61752a146b57 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2642,12 +2642,9 @@ void pf_rule_to_actions(struct pf_krule *, struct pf_rule_actions *); int pf_normalize_mss(struct mbuf *m, int off, struct pf_pdesc *pd); -#ifdef INET -void pf_scrub_ip(struct mbuf *, struct pf_pdesc *); -#endif /* INET */ -#ifdef INET6 -void pf_scrub_ip6(struct mbuf *, struct pf_pdesc *); -#endif /* INET6 */ +#if defined(INET) || defined(INET6) +void pf_scrub(struct mbuf *, struct pf_pdesc *); +#endif struct pfi_kkif *pf_kkif_create(int); void pf_kkif_free(struct pfi_kkif *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index d4adf1363cdf..456fdd0aa9bd 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9221,7 +9221,7 @@ done: REASON_SET(&reason, PFRES_MEMORY); } - pf_scrub_ip(m, &pd); + pf_scrub(m, &pd); if (pd.proto == IPPROTO_TCP && pd.act.max_mss) pf_normalize_mss(m, off, &pd); @@ -9676,7 +9676,7 @@ done: REASON_SET(&reason, PFRES_MEMORY); } - pf_scrub_ip6(m, &pd); + pf_scrub(m, &pd); if (pd.proto == IPPROTO_TCP && pd.act.max_mss) pf_normalize_mss(m, off, &pd); diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 284660767224..926529330619 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2267,14 +2267,20 @@ sctp_drop: return (PF_DROP); } -#ifdef INET +#if defined(INET) || defined(INET6) void -pf_scrub_ip(struct mbuf *m, struct pf_pdesc *pd) +pf_scrub(struct mbuf *m, struct pf_pdesc *pd) { + struct ip *h = mtod(m, struct ip *); +#ifdef INET6 + struct ip6_hdr *h6 = mtod(m, struct ip6_hdr *); +#endif /* Clear IP_DF if no-df was requested */ - if (pd->act.flags & PFSTATE_NODF && h->ip_off & htons(IP_DF)) { + if (pd->af == AF_INET && pd->act.flags & PFSTATE_NODF && + h->ip_off & htons(IP_DF)) + { u_int16_t ip_off = h->ip_off; h->ip_off &= htons(~IP_DF); @@ -2282,48 +2288,44 @@ pf_scrub_ip(struct mbuf *m, struct pf_pdesc *pd) } /* Enforce a minimum ttl, may cause endless packet loops */ - if (pd->act.min_ttl && h->ip_ttl < pd->act.min_ttl) { + if (pd->af == AF_INET && pd->act.min_ttl && + h->ip_ttl < pd->act.min_ttl) { u_int16_t ip_ttl = h->ip_ttl; h->ip_ttl = pd->act.min_ttl; h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_ttl, h->ip_ttl, 0); } - +#ifdef INET6 + /* Enforce a minimum ttl, may cause endless packet loops */ + if (pd->af == AF_INET6 && pd->act.min_ttl && + h6->ip6_hlim < pd->act.min_ttl) + h6->ip6_hlim = pd->act.min_ttl; +#endif /* Enforce tos */ if (pd->act.flags & PFSTATE_SETTOS) { - u_int16_t ov, nv; + if (pd->af == AF_INET) { + u_int16_t ov, nv; - ov = *(u_int16_t *)h; - h->ip_tos = pd->act.set_tos | (h->ip_tos & IPTOS_ECN_MASK); - nv = *(u_int16_t *)h; + ov = *(u_int16_t *)h; + h->ip_tos = pd->act.set_tos | (h->ip_tos & IPTOS_ECN_MASK); + nv = *(u_int16_t *)h; - h->ip_sum = pf_cksum_fixup(h->ip_sum, ov, nv, 0); + h->ip_sum = pf_cksum_fixup(h->ip_sum, ov, nv, 0); +#ifdef INET6 + } else if (pd->af == AF_INET6) { + h6->ip6_flow &= IPV6_FLOWLABEL_MASK | IPV6_VERSION_MASK; + h6->ip6_flow |= htonl((pd->act.set_tos | IPV6_ECN(h6)) << 20); +#endif + } } /* random-id, but not for fragments */ - if (pd->act.flags & PFSTATE_RANDOMID && !(h->ip_off & ~htons(IP_DF))) { + if (pd->af == AF_INET && + pd->act.flags & PFSTATE_RANDOMID && !(h->ip_off & ~htons(IP_DF))) { uint16_t ip_id = h->ip_id; ip_fillid(h); h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0); } } -#endif /* INET */ - -#ifdef INET6 -void -pf_scrub_ip6(struct mbuf *m, struct pf_pdesc *pd) -{ - struct ip6_hdr *h = mtod(m, struct ip6_hdr *); - - /* Enforce a minimum ttl, may cause endless packet loops */ - if (pd->act.min_ttl && h->ip6_hlim < pd->act.min_ttl) - h->ip6_hlim = pd->act.min_ttl; - - /* Enforce tos. Set traffic class bits */ - if (pd->act.flags & PFSTATE_SETTOS) { - h->ip6_flow &= IPV6_FLOWLABEL_MASK | IPV6_VERSION_MASK; - h->ip6_flow |= htonl((pd->act.set_tos | IPV6_ECN(h)) << 20); - } -} #endif From nobody Wed Sep 25 12:34:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDGPv6BlPz5XQ8t; Wed, 25 Sep 2024 12:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDGPv5YMrz4vTx; Wed, 25 Sep 2024 12:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wKQRqdsaQZl0D0dvGO80jmG/se8GNcI0B2Tvu+dr7Pw=; b=OkCQ4JHy6Resb9sOG1MI2hlHU18v2PLkfpL+TYYsR4tJ6OPHi5534xM5OUIOnrTw7UM3/I 91bGT+yw4joBsmvKqzv82DrJ36qtVTehIOvhcNtcMFgDB521K/0Q1yAkgwFEDthSGxKhff m7Scc20q4id3qzW8/sb4yJZFAGqUdHi5pljglH74wAohz1CM/4KyZTolxtrLdsZa3TOHO5 ZFD+Y8CqXHJmMaee0ViUNASZ3go0nWaEA0o11jTi+ioht6fsWB6WMAb0A9ev1eSdvsZkMv yeMHk7QvOpOgeXQsACLdhVQnopFUzWBWqF9icQr5wxlsR12Ye0PbPvmaxQMRrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wKQRqdsaQZl0D0dvGO80jmG/se8GNcI0B2Tvu+dr7Pw=; b=hepnbbBWCZanUtOgbMuHpfNaMB+Xn3Cw2EDp2G1R3lqsKVT2n5V4a1Un0JGxUfv81OIALh UdEgyWKXxIQL6qbBxp6vewj3Wvm2RtuJrYFwQaj8pDmFTk/HWiCXC213wbUaWwyRej+EYn O5b+JMWZQP0Xk3uB/FOCc5nLS/XJL/wJMYPJ0rWzjBmoh7XTF764HK2g5RO91UVLX2kyDx sQpSNdnMeKrkman8zcdHbAk8bExW8l21nW8zXtu/BD+LoUUK4seLacNnZFtepafMBkVgi5 34UZ4Ke9SBkxN5jCwQRPs+BM4c+EWXhmQDvCUhHz9c0fDAwoHma7cSHquFMUeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727267667; a=rsa-sha256; cv=none; b=Q1I7pboUAfJPwlDGmhU338hjnpzu1mLMLU1ex8QVjeSTgK3SKqKGrpMelEg/OjFaVWauqm OOABMBtbkVLEkKrTVbFR6yR0b/jYXU5if+Fb/9vTdzK5D3yg4r4DTYvOApkE6ajSV4qNFz lnl8T3KxYS1YEYbsqCD1VH+ifDtnZuIjJCPbWlX4WIsWP7lMfwapictBt+9MtNP36S3MHQ 41N2RPx9WK5p0yt/DfTaJO4dWH1WJ7ah6gU7I5z/iR53zq8ZJ/K7WR+pvoob2Yq/dznH5W 3htMEkjmehHoVW1h7xLNWrZxsNH9KWHwF5Dr72ijp8VCEJlZqFOEUh4+Ir9sxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDGPv58cqz1CRM; Wed, 25 Sep 2024 12:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PCYRuq071633; Wed, 25 Sep 2024 12:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PCYR0q071630; Wed, 25 Sep 2024 12:34:27 GMT (envelope-from git) Date: Wed, 25 Sep 2024 12:34:27 GMT Message-Id: <202409251234.48PCYR0q071630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: dd04fa71a8cb - main - pf: remove unused argument 'h' from various function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd04fa71a8cbd43047c41453b54c2224bf40ddb9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dd04fa71a8cbd43047c41453b54c2224bf40ddb9 commit dd04fa71a8cbd43047c41453b54c2224bf40ddb9 Author: Kristof Provost AuthorDate: 2024-09-06 14:24:38 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:44:22 +0000 pf: remove unused argument 'h' from various function Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46598 --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 52 ++++++++++++++++++++++++------------------------ sys/netpfil/pf/pf_norm.c | 4 ++-- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 61752a146b57..9ad079f9f95b 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2405,7 +2405,7 @@ int pf_match_port(u_int8_t, u_int16_t, u_int16_t, u_int16_t); void pf_normalize_init(void); void pf_normalize_cleanup(void); -int pf_normalize_tcp(struct pfi_kkif *, struct mbuf *, int, int, void *, +int pf_normalize_tcp(struct pfi_kkif *, struct mbuf *, int, int, struct pf_pdesc *); void pf_normalize_tcp_cleanup(struct pf_kstate *); int pf_normalize_tcp_init(struct mbuf *, int, struct pf_pdesc *, @@ -2416,7 +2416,7 @@ int pf_normalize_tcp_stateful(struct mbuf *, int, struct pf_pdesc *, int pf_normalize_sctp_init(struct mbuf *, int, struct pf_pdesc *, struct pf_state_peer *, struct pf_state_peer *); int pf_normalize_sctp(int, struct pfi_kkif *, struct mbuf *, int, - int, void *, struct pf_pdesc *); + int, struct pf_pdesc *); u_int32_t pf_state_expires(const struct pf_kstate *); void pf_purge_expired_fragments(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 456fdd0aa9bd..e65d848d7cc9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -336,7 +336,7 @@ static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, int, struct pf_state_key_cmp *, int, struct pf_addr *, int, struct pf_addr *, int); static int pf_test_fragment(struct pf_krule **, struct pfi_kkif *, - struct mbuf *, void *, struct pf_pdesc *, + struct mbuf *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); static int pf_tcp_track_full(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, @@ -345,23 +345,23 @@ static int pf_tcp_track_sloppy(struct pf_kstate **, struct pf_pdesc *, u_short *); static int pf_test_state_tcp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, - void *, struct pf_pdesc *, u_short *); + struct pf_pdesc *, u_short *); static int pf_test_state_udp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, - void *, struct pf_pdesc *); + struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, - void *, struct pf_pdesc *, u_short *); + struct pf_pdesc *, u_short *); static void pf_sctp_multihome_detach_addr(const struct pf_kstate *); static void pf_sctp_multihome_delayed(struct pf_pdesc *, int, struct pfi_kkif *, struct pf_kstate *, int); static int pf_test_state_sctp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, - void *, struct pf_pdesc *, u_short *); + struct pf_pdesc *, u_short *); static int pf_test_state_other(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, struct pf_pdesc *); static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, @@ -5586,7 +5586,7 @@ drop: static int pf_test_fragment(struct pf_krule **rm, struct pfi_kkif *kif, - struct mbuf *m, void *h, struct pf_pdesc *pd, struct pf_krule **am, + struct mbuf *m, struct pf_pdesc *pd, struct pf_krule **am, struct pf_kruleset **rsm) { struct pf_krule *r, *a = NULL; @@ -6235,7 +6235,7 @@ pf_synproxy(struct pf_pdesc *pd, struct pf_kstate **state, u_short *reason) static int pf_test_state_tcp(struct pf_kstate **state, struct pfi_kkif *kif, - struct mbuf *m, int off, void *h, struct pf_pdesc *pd, + struct mbuf *m, int off, struct pf_pdesc *pd, u_short *reason) { struct pf_state_key_cmp key; @@ -6326,7 +6326,7 @@ pf_test_state_tcp(struct pf_kstate **state, struct pfi_kkif *kif, static int pf_test_state_udp(struct pf_kstate **state, struct pfi_kkif *kif, - struct mbuf *m, int off, void *h, struct pf_pdesc *pd) + struct mbuf *m, int off, struct pf_pdesc *pd) { struct pf_state_peer *src, *dst; struct pf_state_key_cmp key; @@ -6398,7 +6398,7 @@ pf_test_state_udp(struct pf_kstate **state, struct pfi_kkif *kif, static int pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, - struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) + struct mbuf *m, int off, struct pf_pdesc *pd, u_short *reason) { struct pf_state_key_cmp key; struct pf_state_peer *src, *dst; @@ -6976,7 +6976,7 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, static int pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, - struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) + struct mbuf *m, int off, struct pf_pdesc *pd, u_short *reason) { struct pf_addr *saddr = pd->src, *daddr = pd->dst; u_int16_t *icmpsum, virtual_id, virtual_type; @@ -8692,7 +8692,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, *action = PF_DROP; else *action = pf_test_fragment(r, kif, - m, h, pd, a, ruleset); + m, pd, a, ruleset); if (*action == PF_DROP) REASON_SET(reason, PFRES_FRAG); return (-1); @@ -9063,7 +9063,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, /* handle fragments that didn't get reassembled by normalization */ if (h->ip_off & htons(IP_MF | IP_OFFMASK)) { - action = pf_test_fragment(&r, kif, m, h, &pd, &a, &ruleset); + action = pf_test_fragment(&r, kif, m, &pd, &a, &ruleset); goto done; } @@ -9080,10 +9080,10 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, if ((pd.hdr.tcp.th_flags & TH_ACK) && pd.p_len == 0) use_2nd_queue = 1; - action = pf_normalize_tcp(kif, m, 0, off, h, &pd); + action = pf_normalize_tcp(kif, m, 0, off, &pd); if (action == PF_DROP) goto done; - action = pf_test_state_tcp(&s, kif, m, off, h, &pd, &reason); + action = pf_test_state_tcp(&s, kif, m, off, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) V_pfsync_update_state_ptr(s); @@ -9110,7 +9110,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, if (action != PF_PASS) break; - action = pf_test_state_tcp(&s, kif, m, off, h, + action = pf_test_state_tcp(&s, kif, m, off, &pd, &reason); if (action != PF_PASS || s == NULL) { action = PF_DROP; @@ -9131,7 +9131,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, } case IPPROTO_UDP: { - action = pf_test_state_udp(&s, kif, m, off, h, &pd); + action = pf_test_state_udp(&s, kif, m, off, &pd); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) V_pfsync_update_state_ptr(s); @@ -9144,10 +9144,10 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, } case IPPROTO_SCTP: { - action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); + action = pf_normalize_sctp(dir, kif, m, 0, off, &pd); if (action == PF_DROP) goto done; - action = pf_test_state_sctp(&s, kif, m, off, h, &pd, + action = pf_test_state_sctp(&s, kif, m, off, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) @@ -9162,7 +9162,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, } case IPPROTO_ICMP: { - action = pf_test_state_icmp(&s, kif, m, off, h, &pd, &reason); + action = pf_test_state_icmp(&s, kif, m, off, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) V_pfsync_update_state_ptr(s); @@ -9528,10 +9528,10 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb if ((pd.hdr.tcp.th_flags & TH_ACK) && pd.p_len == 0) use_2nd_queue = 1; - action = pf_normalize_tcp(kif, m, 0, off, h, &pd); + action = pf_normalize_tcp(kif, m, 0, off, &pd); if (action == PF_DROP) goto done; - action = pf_test_state_tcp(&s, kif, m, off, h, &pd, &reason); + action = pf_test_state_tcp(&s, kif, m, off, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) V_pfsync_update_state_ptr(s); @@ -9558,7 +9558,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb if (action != PF_PASS) break; - action = pf_test_state_tcp(&s, kif, m, off, h, + action = pf_test_state_tcp(&s, kif, m, off, &pd, &reason); if (action != PF_PASS || s == NULL) { action = PF_DROP; @@ -9580,7 +9580,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_UDP: { - action = pf_test_state_udp(&s, kif, m, off, h, &pd); + action = pf_test_state_udp(&s, kif, m, off, &pd); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) V_pfsync_update_state_ptr(s); @@ -9593,10 +9593,10 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_SCTP: { - action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); + action = pf_normalize_sctp(dir, kif, m, 0, off, &pd); if (action == PF_DROP) goto done; - action = pf_test_state_sctp(&s, kif, m, off, h, &pd, + action = pf_test_state_sctp(&s, kif, m, off, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) @@ -9618,7 +9618,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_ICMPV6: { - action = pf_test_state_icmp(&s, kif, m, off, h, &pd, &reason); + action = pf_test_state_icmp(&s, kif, m, off, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) V_pfsync_update_state_ptr(s); diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 926529330619..c4cc482c62f0 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1385,7 +1385,7 @@ again: int pf_normalize_tcp(struct pfi_kkif *kif, struct mbuf *m, int ipoff, - int off, void *h, struct pf_pdesc *pd) + int off, struct pf_pdesc *pd) { struct pf_krule *r, *rm = NULL; struct tcphdr *th = &pd->hdr.tcp; @@ -2193,7 +2193,7 @@ pf_scan_sctp(struct mbuf *m, int off, struct pf_pdesc *pd, int pf_normalize_sctp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, - int off, void *h, struct pf_pdesc *pd) + int off, struct pf_pdesc *pd) { struct pf_krule *r, *rm = NULL; struct sctphdr *sh = &pd->hdr.sctp; From nobody Wed Sep 25 12:34:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDGPx32Sfz5XQLC; Wed, 25 Sep 2024 12:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDGPw6qDwz4vlc; Wed, 25 Sep 2024 12:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qcSbMfKsRkSL6qT9FRB5kEzPBpL1Rc5wsVpCTO+mICo=; b=hZEUpESpxNwF4Ub86tYXJMrWJD1MNyorfSYqDj7nW2+4Gj4k8mtwGChA5tKijLMFbAP+a/ dYe+1gZ6241mNhYDfLnaMEocmqxhWMcxGAPKyVumf+qqkVowaZu66vXPqLi67qkJmETEZ3 g+POLQmX3uoVk60t4+UgpYXGKAmtj04bFATNpgLf9ITUqxmYFlYLquzkJHOXL2TFtDYcta Y6RNVOPJXrg3j4dQb967Hl7v5DYHPTVCvk47sJgQyFWnkgJE3z17Uuq2L30551vmk3744X Mgnz8v9Ch83xV4sxCYaLDy+FjuN6G63Jwb7QcRbiksXHa8Uw5JKcBVIkv21wfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qcSbMfKsRkSL6qT9FRB5kEzPBpL1Rc5wsVpCTO+mICo=; b=ABBzQiy34+CalM8ilr8/P90ziDqpXSD7rVlHavsGCMS1IbWkFDUEC/FSCb6cB3v8EXhUxr DHEEz7CUFmgdTmZ9LQH6xErRG0rTF+BKBdj9Af1zHmdx3i3k3ZyLOswj4TUuB8MBEAwhrs W7aOTcs6vLVw9+Oe/FhSV+m7LyBSvQWvJ5gNHzCPQhvvVAavnRTW6vgjwiPcityYxHQsBD KtIhvQag8qNxgleDwHmBec10iCHu0kCjhGHFwEb1e+nGWqOGmKTho219DSYQ4jWKpJaHQy eOKV/F1OQE3+NlidIEqhtQQTNG0DHfcrXW52ocCmR7E0WFh7fr2Lr5zdoigRhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727267669; a=rsa-sha256; cv=none; b=xAuHQENbgTxpdPzckkE7J2Abxmbe+C21fzjv5lgddURel5PTqUnBQNVOrWcf18lCwEJ6Yo EL0LM47xOcEfbqAQpL1RLCFGtoegYQY80/ij0bm/fKFHlgKiBQMgsSoQW7sKeG1sQ3EpCo d/omIUWcDR59EcS5BOat4cigJ3MqplerIv+qp2zopl4n6kzfY1EvmqyknYZPxQ7iFnuQ87 CC1nzJQf332Sf0sGg/70PViN247j/e7zsxGg/SYSibx28+wXrEMizqNEKeK1E+1DLdPLdR v0FzwlC6oq4XLFlKsAj68TVymzYRYJHTdTB+ROr+RAkTnmyoORtR6NDahDZ0Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDGPw6DY4z1CX3; Wed, 25 Sep 2024 12:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PCYS5g071686; Wed, 25 Sep 2024 12:34:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PCYSaM071683; Wed, 25 Sep 2024 12:34:28 GMT (envelope-from git) Date: Wed, 25 Sep 2024 12:34:28 GMT Message-Id: <202409251234.48PCYSaM071683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 905db4aa8877 - main - pf: dedupe layer 4 protocol code in pf_setup_pdesc() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 905db4aa88775865097714c170f4503da385747c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=905db4aa88775865097714c170f4503da385747c commit 905db4aa88775865097714c170f4503da385747c Author: Kristof Provost AuthorDate: 2024-09-10 18:17:13 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:44:30 +0000 pf: dedupe layer 4 protocol code in pf_setup_pdesc() In pf_setup_pdesc() the code for analysing TCP and UDP headers was the same for v4 and v6. Deduplicate by moving the protocol switch after the address family switch. ok henning@ claudio@ Obtained from: OpenBSD, bluhm , 72cf18cc6e Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46647 --- sys/netpfil/pf/pf.c | 255 ++++++++++++++++++++-------------------------------- 1 file changed, 97 insertions(+), 158 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e65d848d7cc9..215f2655d9d4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8590,78 +8590,6 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, if (h->ip_off & htons(IP_MF | IP_OFFMASK)) return (0); - switch (h->ip_p) { - case IPPROTO_TCP: { - struct tcphdr *th = &pd->hdr.tcp; - - if (!pf_pull_hdr(m, *off, th, sizeof(*th), action, - reason, AF_INET)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = sizeof(*th); - pd->p_len = pd->tot_len - *off - (th->th_off << 2); - pd->sport = &th->th_sport; - pd->dport = &th->th_dport; - break; - } - case IPPROTO_UDP: { - struct udphdr *uh = &pd->hdr.udp; - - if (!pf_pull_hdr(m, *off, uh, sizeof(*uh), action, - reason, AF_INET)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = sizeof(*uh); - if (uh->uh_dport == 0 || - ntohs(uh->uh_ulen) > m->m_pkthdr.len - *off || - ntohs(uh->uh_ulen) < sizeof(struct udphdr)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - pd->sport = &uh->uh_sport; - pd->dport = &uh->uh_dport; - break; - } - case IPPROTO_SCTP: { - if (!pf_pull_hdr(m, *off, &pd->hdr.sctp, sizeof(pd->hdr.sctp), - action, reason, AF_INET)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = sizeof(pd->hdr.sctp); - pd->p_len = pd->tot_len - *off; - - pd->sport = &pd->hdr.sctp.src_port; - pd->dport = &pd->hdr.sctp.dest_port; - if (pd->hdr.sctp.src_port == 0 || pd->hdr.sctp.dest_port == 0) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - if (pf_scan_sctp(m, *off, pd, kif) != PF_PASS) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - break; - } - case IPPROTO_ICMP: { - if (!pf_pull_hdr(m, *off, &pd->hdr.icmp, ICMP_MINLEN, - action, reason, AF_INET)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = ICMP_MINLEN; - break; - } - } break; } #endif @@ -8750,103 +8678,114 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, } } while (!terminal); - switch (pd->proto) { - case IPPROTO_TCP: { - struct tcphdr *th = &pd->hdr.tcp; + break; + } +#endif + default: + panic("pf_setup_pdesc called with illegal af %u", af); + } - if (!pf_pull_hdr(m, *off, th, sizeof(*th), action, - reason, AF_INET6)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = sizeof(*th); - pd->p_len = pd->tot_len - *off - (th->th_off << 2); - pd->sport = &th->th_sport; - pd->dport = &th->th_dport; - break; + switch (pd->proto) { + case IPPROTO_TCP: { + struct tcphdr *th = &pd->hdr.tcp; + + if (!pf_pull_hdr(m, *off, th, sizeof(*th), action, + reason, af)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); } - case IPPROTO_UDP: { - struct udphdr *uh = &pd->hdr.udp; + *hdrlen = sizeof(*th); + pd->p_len = pd->tot_len - *off - (th->th_off << 2); + pd->sport = &th->th_sport; + pd->dport = &th->th_dport; + break; + } + case IPPROTO_UDP: { + struct udphdr *uh = &pd->hdr.udp; - if (!pf_pull_hdr(m, *off, uh, sizeof(*uh), action, - reason, AF_INET6)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = sizeof(*uh); - if (uh->uh_dport == 0 || - ntohs(uh->uh_ulen) > m->m_pkthdr.len - *off || - ntohs(uh->uh_ulen) < sizeof(struct udphdr)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - pd->sport = &uh->uh_sport; - pd->dport = &uh->uh_dport; - break; + if (!pf_pull_hdr(m, *off, uh, sizeof(*uh), action, + reason, af)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); } - case IPPROTO_SCTP: { - if (!pf_pull_hdr(m, *off, &pd->hdr.sctp, sizeof(pd->hdr.sctp), - action, reason, AF_INET6)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = sizeof(pd->hdr.sctp); - pd->p_len = pd->tot_len - *off; - - pd->sport = &pd->hdr.sctp.src_port; - pd->dport = &pd->hdr.sctp.dest_port; - if (pd->hdr.sctp.src_port == 0 || pd->hdr.sctp.dest_port == 0) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - if (pf_scan_sctp(m, *off, pd, kif) != PF_PASS) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - break; + *hdrlen = sizeof(*uh); + if (uh->uh_dport == 0 || + ntohs(uh->uh_ulen) > m->m_pkthdr.len - *off || + ntohs(uh->uh_ulen) < sizeof(struct udphdr)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); } - case IPPROTO_ICMPV6: { - size_t icmp_hlen = sizeof(struct icmp6_hdr); + pd->sport = &uh->uh_sport; + pd->dport = &uh->uh_dport; + break; + } + case IPPROTO_SCTP: { + if (!pf_pull_hdr(m, *off, &pd->hdr.sctp, sizeof(pd->hdr.sctp), + action, reason, af)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + *hdrlen = sizeof(pd->hdr.sctp); + pd->p_len = pd->tot_len - *off; - if (!pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, - action, reason, AF_INET6)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - /* ICMP headers we look further into to match state */ - switch (pd->hdr.icmp6.icmp6_type) { - case MLD_LISTENER_QUERY: - case MLD_LISTENER_REPORT: - icmp_hlen = sizeof(struct mld_hdr); - break; - case ND_NEIGHBOR_SOLICIT: - case ND_NEIGHBOR_ADVERT: - icmp_hlen = sizeof(struct nd_neighbor_solicit); - break; - } - if (icmp_hlen > sizeof(struct icmp6_hdr) && - !pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, - action, reason, AF_INET6)) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } - *hdrlen = icmp_hlen; + pd->sport = &pd->hdr.sctp.src_port; + pd->dport = &pd->hdr.sctp.dest_port; + if (pd->hdr.sctp.src_port == 0 || pd->hdr.sctp.dest_port == 0) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + if (pf_scan_sctp(m, *off, pd, kif) != PF_PASS) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + break; + } + case IPPROTO_ICMP: { + if (!pf_pull_hdr(m, *off, &pd->hdr.icmp, ICMP_MINLEN, + action, reason, af)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + *hdrlen = ICMP_MINLEN; + break; + } + case IPPROTO_ICMPV6: { + size_t icmp_hlen = sizeof(struct icmp6_hdr); + + if (!pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, + action, reason, af)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + /* ICMP headers we look further into to match state */ + switch (pd->hdr.icmp6.icmp6_type) { + case MLD_LISTENER_QUERY: + case MLD_LISTENER_REPORT: + icmp_hlen = sizeof(struct mld_hdr); + break; + case ND_NEIGHBOR_SOLICIT: + case ND_NEIGHBOR_ADVERT: + icmp_hlen = sizeof(struct nd_neighbor_solicit); break; } + if (icmp_hlen > sizeof(struct icmp6_hdr) && + !pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, + action, reason, af)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); } + *hdrlen = icmp_hlen; break; } -#endif - default: - panic("pf_setup_pdesc called with illegal af %u", af); } return (0); } From nobody Wed Sep 25 12:34:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDGPy26W9z5XQZp; Wed, 25 Sep 2024 12:34:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDGPy0XkZz4vrS; Wed, 25 Sep 2024 12:34:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KPqLjEwDW4a/PPGtcwTXx8V7YpEJ7AfbMVlpAJmcSGc=; b=c7Q5j7xoN3e5kzbLD1ajzEYuV8vMVvaEsFTh3gTHgM7AKfiKZkEGW6rZ5GQlb5f3iL3k/n 8OEDfo3pAOgYX0kisyUrFHk5tRHsQXasS3vgmRoSir9kJQszutvQQ3iaEbznHw4g7xP6Ok PeEcLO1oDccOVaoQLwSoOSCi7nHw/c8VAtJqpuGjYhSMjqWb2ooS87Hedh0jBDmEa2+Ql9 ZdMhZfG9NQ9rRDEaFGIwVXDbHLXOR6I7HiulFuBg1ORLA7t7SgoThsqaVFZZPcpFadqGY3 IN2iGlbiqKCk34ZIOqtJL3f5ozuvlHtpfTsyQFocDMEImYLS8xFvNJlcZkHR/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KPqLjEwDW4a/PPGtcwTXx8V7YpEJ7AfbMVlpAJmcSGc=; b=ozjBXfpA8bZcLKBS3xVjQju/Aqme1ZJMfvYp41YPSGGYh2PLUxyGTgnh+pLm0eBFL3gxi/ XjLNGpKTHidYqhSaNztHDJU1vjn809CAYGVzXCMRvs79RblfdUM69zGTNbOYdMeZ+bMrs+ vP8++cI4kXuCRzHJ88emg9bDvf0UqLBgLom0ddwO0rdBVLSuA0gZckdp+F4CNrhF6yZ5tR rpH+YBSEQe633mgedUwE2okASPkaZnG1HDNJa5xmcXKkBXWpBpw4j3F4SHwaXAMQEq+nxF vhcOzacCQxrmN9oAQL3vOih/+y8ECXM9rwyB5a7WzIdVoxxjNs8vflg8uOpkEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727267670; a=rsa-sha256; cv=none; b=YMILcYITIdKts//dDrywWM6K6t/u+Rxk6/AmJQJ1F1wXZ2Bk+Zs2DhDhbyYOhivxuUcBP4 eDavcAcYnZZtMmIidJR41XGcgQqMStH0gkFQeeQPacnr43FFhxpjCkw6oS35MccIiR9Vr5 SdpCg0mIrNP2M/6swqjEWKVHyzPG/AhdK4DrkeuYUnR9pZFUzKm9hQDH/yRBIfTfWFntS6 NaG5Z1GHeVcl4huStEMQX37X7KlwFVsGlMRs37+uJpmX0G1utRQ4KPZKUFQUKNicFW0nfW v+QdUJtegVcmYMR83e1WpsI/7vJL9O1TMlfPRO3Sei1rD9YzwbevuNsWSLknAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDGPy06l3z1CX4; Wed, 25 Sep 2024 12:34:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PCYTDi071725; Wed, 25 Sep 2024 12:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PCYTwC071722; Wed, 25 Sep 2024 12:34:29 GMT (envelope-from git) Date: Wed, 25 Sep 2024 12:34:29 GMT Message-Id: <202409251234.48PCYTwC071722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6d51791d2832 - main - pf: remove pointless CURVNET_SET List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d51791d2832fb428b99d4c0ab22b392980bd27b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6d51791d2832fb428b99d4c0ab22b392980bd27b commit 6d51791d2832fb428b99d4c0ab22b392980bd27b Author: Kristof Provost AuthorDate: 2024-09-11 07:13:21 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:44:34 +0000 pf: remove pointless CURVNET_SET We're already in the correct vnet when the pfil hook is called. Remove the pointless set/restore. Reviewed by: glebius, zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46648 --- sys/netpfil/pf/pf_ioctl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index e205c5ca0c38..dcdab6029558 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -6442,6 +6442,8 @@ pf_eth_check_in(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test_eth(PF_IN, flags, ifp, m, inp); return (pf_check_return(chk, m)); @@ -6453,6 +6455,8 @@ pf_eth_check_out(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test_eth(PF_OUT, flags, ifp, m, inp); return (pf_check_return(chk, m)); @@ -6465,6 +6469,8 @@ pf_check_in(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test(PF_IN, flags, ifp, m, inp, NULL); return (pf_check_return(chk, m)); @@ -6476,6 +6482,8 @@ pf_check_out(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test(PF_OUT, flags, ifp, m, inp, NULL); return (pf_check_return(chk, m)); @@ -6489,15 +6497,15 @@ pf_check6_in(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + /* * In case of loopback traffic IPv6 uses the real interface in * order to support scoped addresses. In order to support stateful * filtering we have change this to lo0 as it is the case in IPv4. */ - CURVNET_SET(ifp->if_vnet); chk = pf_test6(PF_IN, flags, (*m)->m_flags & M_LOOP ? V_loif : ifp, m, inp, NULL); - CURVNET_RESTORE(); return (pf_check_return(chk, m)); } @@ -6508,9 +6516,9 @@ pf_check6_out(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; - CURVNET_SET(ifp->if_vnet); + CURVNET_ASSERT_SET(); + chk = pf_test6(PF_OUT, flags, ifp, m, inp, NULL); - CURVNET_RESTORE(); return (pf_check_return(chk, m)); } From nobody Wed Sep 25 12:34:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDGPz45nVz5XQgB; Wed, 25 Sep 2024 12:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDGPz2PMgz3wbf; Wed, 25 Sep 2024 12:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgQO8dEUh+95YJVozSQV9eb+mZOIkEE2uE9h9Fh7PAc=; b=L0rtwEUsmDwWtdFiflKKHgBbYITf2hOYdoZHp0hPjwa9LV00+bTaUxQP3OZ8Z24+cufpKL 22T3hAvllIaUm0KiXka+IIC4iEbdMXI2UIDQlvSuDTKqu//e/P8splpc5pTmLptHcdISs4 ddw/fdpQ6WVUlqWWWYmmBGy8NSnjh+vaHre7mrW1vib9iFBWcm/mVC6ifXtdM02ABobvl1 io3wqNdLsyKuoPTmFlih9eDGoO5NVTEaarFzo/hzdrxyvRhG4O+700YbjiEoXgy7nXkUy8 Na4Ps8LywNFbhg3x3swxLdNybg3tV/JQTNDbEP7lRLgRCmgTlRMALoniQjeHrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgQO8dEUh+95YJVozSQV9eb+mZOIkEE2uE9h9Fh7PAc=; b=xLxhAqyy6nobKlEzw9cNNnGmGo2s2xhf3CwQXD0d9VX92AUGTKgP5EyLbnvuWlJD2mNF40 MdaojZnEB/t+P1z4AQE9MXVXLB4hraFqeU0uHVMi5vlaf8AIFLhYyv+cZIK5xDe/Xsx8K1 hm0xaRGDeNDckDV0gDbc0Kjw8f1ImsrFQI7depgiVafDrdYL/uzpII9XxpK+nX/+EWeeIm Z0CARTeaH9yFHbzHfFFYbJb3xg+Q9qC4JzMZu0DrEA+Janr9WY84VtTGrRgsgKur7OhlcM 1SC+2MnfOrgTUDHypSDAtO6wf/TqUlVzKSTevAy5I/vX2jMviLiGaFphcwIG5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727267671; a=rsa-sha256; cv=none; b=I4jUiTRVuI8bCsY3kUF8pbG0NSeVndeR/xf2xlh1ombU7EI2yoJwrrFNMVlFPu/U+MfuER DxU+VxH1yvetGYZaffkVUkpxNCEdC1zhKxBcSJ95YvW1oOeooyEfh2BMRgZR0eYpEy+k6s 9p4kV++BFVeEKVKeoaeA39nl26cMJHtjkZjtWmZTFNKaajmCPkWI3e+LDji/6UqI4RtnN6 f9kO7+vIjRXGsAvA1FgcL0xQ4v05OOqqg6m8FkgHJvF9FiSVTTu1FOxdK9DBp0CEhQ2sxP ZdcGS/blZmgKDW+UiI4MAmx0Vn6jnf5JZJve+G814fVS9r3/YUEJz4sGBkqUGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDGPz0xF2z1CP2; Wed, 25 Sep 2024 12:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PCYVxO071780; Wed, 25 Sep 2024 12:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PCYVt6071777; Wed, 25 Sep 2024 12:34:31 GMT (envelope-from git) Date: Wed, 25 Sep 2024 12:34:31 GMT Message-Id: <202409251234.48PCYVt6071777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 85ea6992935c - main - pf tests: Make TCP port numbers configurable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85ea6992935ced034dea1c88755542c1b4969368 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=85ea6992935ced034dea1c88755542c1b4969368 commit 85ea6992935ced034dea1c88755542c1b4969368 Author: Kajetan Staszkiewicz AuthorDate: 2024-09-25 10:46:37 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:46:48 +0000 pf tests: Make TCP port numbers configurable This will be useful for state maximums testing. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46773 --- tests/sys/netpfil/common/pft_ping.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 21b08c75a7da..befe757406be 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -123,7 +123,10 @@ def send_tcp_syn(dst_address, sendif, send_params): ip = prepare_ipv6(dst_address, send_params) else: ip = prepare_ipv4(dst_address, send_params) - tcp = sp.TCP(dport=666, flags='S', options=opts, seq=seq) + tcp = sp.TCP( + sport=send_params.get('sport'), dport=send_params.get('dport'), + flags='S', options=opts, seq=seq, + ) req = ether / ip / tcp sp.sendp(req, iface=sendif, verbose=False) @@ -439,6 +442,10 @@ def parse_args(): help='TCP Maximum Segment Size') parser_send.add_argument('--send-seq', type=int, help='TCP sequence number') + parser_send.add_argument('--send-sport', type=int, + help='TCP source port') + parser_send.add_argument('--send-dport', type=int, default=666, + help='TCP destination port') parser_send.add_argument('--send-length', type=int, default=len(PAYLOAD_MAGIC), help='ICMP Echo Request payload size') parser_send.add_argument('--send-tc', type=int, @@ -480,7 +487,10 @@ def main(): # missing from the command line, always fill the dictionaries with None. send_params = {} expect_params = {} - for param_name in ('flags', 'hlim', 'length', 'mss', 'seq', 'tc', 'frag_length'): + for param_name in ( + 'flags', 'hlim', 'length', 'mss', 'seq', 'tc', 'frag_length', + 'sport', 'dport', + ): param_arg = vars(args).get(f'send_{param_name}') send_params[param_name] = param_arg if param_arg else None param_arg = vars(args).get(f'expect_{param_name}') From nobody Wed Sep 25 13:58:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDJHB1YcXz5XW9V; Wed, 25 Sep 2024 13:58:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDJHB0RLtz47QX; Wed, 25 Sep 2024 13:58:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727272726; 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=ofbVuE+VIGNbRIUaXqaKsI9zcEQRtnGRQ1z06fmVjY0=; b=E+evtcATFrQIN9/5xPFpBl8S5PLmYCZzztP4T95ZK1ccmDsvctmUy3RDDOSrEM1HLOxiDZ Zh91VBBQkKiNFtJILbUD9CYaEJ4gyFw0OYWOqaXUhBDwaNBcPmJgKCebHuNjW0qQIZf5yf Ka8JVRVyFsY83qQr75iCSu2sdFLNk8bpQCRjwI/zrmn63sAT8z09kwZwFS42lvAMOeNnru az7JvRU2W2dW7Gj09ZXwqcZP8bMSev7vG7ud1tBRolrXy8aQCrgT4kkEUjqMPKhCO0PRl9 Q6ulHP0nJDU0OpAyiSui96bIqhp51YML2WCkZXUhWXVKC4cTNuokOQvATd6lPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727272726; 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=ofbVuE+VIGNbRIUaXqaKsI9zcEQRtnGRQ1z06fmVjY0=; b=rpJpMimtkdiIBElaSN2NglxJ4yjrIuYKQoYpFq5Bo0C7B3WE8xwAjB6aHpBbF9uKbqs7Z8 PPfdkMA8pZ24CjixApluIeO/06s70S5aviuWacHvXrir/xx8gVeYm7PHyrCRqoSUDAg1lH liNLSLV2njYcncyM1xjHpLZjSRmzh2cOufk+dXSLRT4p3J+K4ahd/NCw6EBQc5ZQ3Hd+B/ 0x4mEQ2mqUgjDmkg1mdtUIWmza3Hq44sYgMtezWOPT03cHdvCyOeUgTU7NbDDwXQxIcJuO CPOeWQ757HxW43IKwXZVI/3tk11aOmOXL5Vvzy/PPBWhnZCQd/WtubGfavp40A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727272726; a=rsa-sha256; cv=none; b=q6EHSqNez5HI7HY7sV/VdEPxrmZCx5SUVCEecsXhqIf0YZhoViUVicm/ceYfaysS+oCEUo SUTeAQkBWGLfiUiHtYgOQf9/+GUsPQ/ryz4dNZ3XXQ0QjPkj89wJzpBcplZzI3HQWp9vw0 7HjJlVem06rVZS2E2WIBTj5hc7Vx3U0QBBbU1w7rI96lXWgFszsf+P8d0rbWysQcGs+kcI 4r/pyf8f88BKiMh9bDUpV+sXI+wtRg9PNET74hM6P60WAiDqxFkbxR9mPUX3Z+tGFoYdEH 4GSDZnqcaTw1kKyUZ+iadW+moxiLDizuL5Rp5LytvaBkuTfyoFZOzS7DVx5iMg== Received: from [IPV6:2601:5c0:4200:b830:7d5c:2819:6552:855e] (unknown [IPv6:2601:5c0:4200:b830:7d5c:2819:6552:855e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XDJH955Z6z12qY; Wed, 25 Sep 2024 13:58:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Wed, 25 Sep 2024 09:58:44 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f08247fd888e - main - Assert that mbufs are writable if we write to them Content-Language: en-US To: Drew Gallatin , Kristof Provost , Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202409111118.48BBIQ2h065089@gitrepo.freebsd.org> <2b1955e2-fbf1-41cb-b256-a9a257b16a83@FreeBSD.org> <1f61b6de-0fe2-4343-b4ad-f0866785a4bc@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/13/24 11:45, Drew Gallatin wrote: > I think you also need to remove M_EXTPG from M_WRITABLE(). Attached a trivial, untested patch. Yes, I came back to testing this yesterday and ran into that as well. However, as part of this I also tried to audit all the calls to M_WRITABLE and most of them are assuming they can use mtod() to get a pointer. I think what might be a better approach is to add a new M_WRITABLE_EXTPG() variant that doesn't check M_EXTPG and leave M_WRITABLE as-is. Places like m_copyback that are M_EXTPG aware would use the new macro. This still requires the patch to not set M_RDONLY in all M_EXTPG mbufs. The other thing we might want to do though is set M_RDONLY on encrypted data after KTLS has encrypted it as there is no good reason to modify encrypted data. > Drew > > On Thu, Sep 12, 2024, at 5:40 AM, John Baldwin wrote: >> On 9/12/24 05:03, John Baldwin wrote: >>> I think part of the motivation for marking M_EXTPG as read-only is that you can't "write" >>> to m_data via mtod() or the like. That said, M_EXTPG aren't really read-only. It >>> depends on the backing store. M_EXTPG were first merged into FreeBSD prior to KTLS to >>> support sendfile, and in that case, they should be M_RDONLY because they alias pages >>> from the file's VM object. However, M_EXTPG mbufs allocated via functions like >>> m_uiotombuf_nomap should not be M_RDONLY. I think this originated in the original >>> import of KTLS which doesn't push setting M_RDONLY out to the callers of mb_alloc_extpgs, >>> and a few other places that hardcode M_RDONLY with M_EXTPG (_mb_unmapped_to_ext should >>> preserve M_RDONLY from the original mbuf instead of forcing M_RDONLY). >>> >>> I can take a stab at a patch but won't have time to really test it until after Euro. >> >> Patch available below. Compile tested but not run-tested: >> >> https://github.com/freebsd/freebsd-src/compare/main...bsdjhb:freebsd:m_extpg_rdonly >> >>> On 9/11/24 16:56, Drew Gallatin wrote: >>>> M_EXTPGS mbufs are marked read-only because they refer to external data. The original crypto code, (before kTLS was converted to OCF), used to just build an iovec using PHYS_TO_DMAP() on the page array. I think this case was missed during the conversion to OCF. >>>> >>>> I'm not sure what the best thing to do is, as they should be read only, except this one specific case.... I'd be tempted to just nerf the KASSERT for EXTPGS. >>>> >>>> On Wed, Sep 11, 2024, at 11:02 AM, Kristof Provost wrote: >>>>> On 11 Sep 2024, at 16:45, Mark Johnston wrote: >>>>>> On Wed, Sep 11, 2024 at 11:18:26AM +0000, Kristof Provost wrote: >>>>>>> The branch main has been updated by kp: >>>>>>> >>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=f08247fd888e6f7db0ecf2aaa39377144ac40b4c >>>>>>> >>>>>>> commit f08247fd888e6f7db0ecf2aaa39377144ac40b4c >>>>>>> Author: Kristof Provost >>>>>>> AuthorDate: 2024-09-10 20:15:31 +0000 >>>>>>> Commit: Kristof Provost >>>>>>> CommitDate: 2024-09-11 11:17:48 +0000 >>>>>>> >>>>>>> Assert that mbufs are writable if we write to them >>>>>>> >>>>>>> m_copyback() modifies the mbuf, so it must be a writable mbuf. >>>>>> >>>>>> This change still triggers a panic for me when running KTLS tests. I >>>>>> note that EXTPG mbufs always have M_RDONLY set, but I'm not quite sure >>>>>> why. I suspect such mbufs need special handling with respect to the new >>>>>> assertion. >>>>>> >>>>>> syzbot also triggered this panic: >>>>>> https://syzkaller.appspot.com/bug?extid=58c918369f9dc323409d >>>>>> >>>>> Yeah, I saw that one before I went out for a bike ride. >>>>> >>>>> Clearly something is wrong. Either ktls is using read-only buffers or the M_WRITABLE() macro isn’t quite smart enough to spot this specific case. >>>>> >>>>> I’m not familiar enough with ktls to easily tell which. >>>>> >>>>> I’ll back this assertion change out for now, so we’re not panicing test machines while we figure this out. >>>>> >>>>> Best regards, >>>>> Kristof >>>>> >>>> >>> >> >> -- >> John Baldwin >> >> > -- John Baldwin From nobody Wed Sep 25 14:02:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDJMM0XSNz5XW7k; Wed, 25 Sep 2024 14:02:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDJMM03tzz492g; Wed, 25 Sep 2024 14:02:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727272943; 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=7rsCOFFpN1b+sP0l0FMmt653WWTb3CXduVFeboZNMWU=; b=xl7sUVqLMqcjC0qu1SRZtkKSCHcs6QobOrd0vc1B2ADlVTPKUO7A94+NxSTn3koPnjJrt9 zCvx1/DZ73lrd+qGRgfSEMtsc1OsQdU8YynGQQnq1WcHPRntgCbfoYj0UcHkEqZuSOpV67 50iLrNjAmF8KQQymCYStPC3uSLFDbkK9FBkuSDyqq3hga7MclP/Vy2dv2gZqu5qOJi6ZhX 2eW9kqSLPpmyQWdRw3r7dpbq9teGXC4aTTy9xvTAf4etG4B6cRuitZuF2O25D2jDxAgsl+ ZV/FI8L6YHYYnzCW69DjK9YZpA2P1zFSo+XPW6d4PBfIvTV+vMWLktz7ViwwEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727272943; 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=7rsCOFFpN1b+sP0l0FMmt653WWTb3CXduVFeboZNMWU=; b=mZcijuwXnbh84Z0Hlf/PIe+/SlUzC3SkMj7FQJckamqHdIf0+y5Z8xVCtsQrSl/D+vLoVS OB2UTlx08ZU0hgWdBJEqdVOCvTupM3lztOL4uSk3wU7NLpr+a9CrQhx5fb0pdQ0bnaIQse +HApkcwCa27qmfEQmdwzNbHoURA4tVMuBUP7fcv7kvgvIyO6N97DsDdqF51ZsdjF2hL8yb 5+CV1+o0x7Q1MoXiu3DqfvKoLJxuYPAiG80mIo3vZPuoT94mxNk+rYheULy5Bep4Vzh69r 6mhKX3+7bMsMLA3Zd1f9yn81Zx8n5bxVlRUlUyaEDYDhj5U8LfGqA+rz06FjZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727272943; a=rsa-sha256; cv=none; b=BY/9Rv0WUrv/fTCXwoFA23wB+pDFAmNSUlhI7y70ZWRnVpnmkShz864BLaNi0hTGZogao4 LyuFNQQgTUqg6SNap/mECIUDv/pmtn2ZnIYDTkI+mreZJ29d6SHhIAX6nq6WYDNx8qdmnu i0T5OxoX0L/0pj7vya9Jo2/EnCuGXfCALx5Ujxt7HKBHdRP2mOfGjEMzk5UTkxmyf4XvHY VzKmDesvUE16UlnCBN3nfdEgObDiBv5sGgRRIysJ5XNDbnei7sHix8P8htJZUu0MsgCqfc g1nlEIQ6q8A28vyIOdhSvyT9PPYWWIg4IN/3vUT5taHfRwSy6DbngFoLZnr6Kw== Received: from [IPV6:2601:5c0:4200:b830:7d5c:2819:6552:855e] (unknown [IPv6:2601:5c0:4200:b830:7d5c:2819:6552:855e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XDJML5Dzmz13H2; Wed, 25 Sep 2024 14:02:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <88935da3-253c-4145-b958-f7137485ee31@FreeBSD.org> Date: Wed, 25 Sep 2024 10:02:22 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: a52b30ff98cd - main - sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf Content-Language: en-US To: Konstantin Belousov , =?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202409202109.48KL9RZ1078677@gitrepo.freebsd.org> <867cb5z2c3.fsf@ltc.des.dev> <86y13lx7l5.fsf@ltc.des.dev> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/21/24 16:51, Konstantin Belousov wrote: > On Sat, Sep 21, 2024 at 07:03:18PM +0200, Dag-Erling Smørgrav wrote: >> Konstantin Belousov writes: >>> Dag-Erling Smørgrav writes: >>>> Konstantin Belousov writes: >>>>> commit a52b30ff98cdab82af140285fa7fcdf1036fef27 >>>>> >>>>> sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf >>>>> >>>>> Tested by: yasu >>>>> Sponsored by: The FreeBSD Foundation >>>> > MFC after: 1 week >>>> This appears to be the opposite of the patch which you posted on >>>> -current and which yasu@ tested [...] >>> Before committing anything, I did a self-review and remembered that I >>> have did a lot of considerations when implementing swap accounting and >>> decided that ruid is the right target for charge. >>> >>> Besides stating the obvious fact above, what do you expect me to answer/ >>> react to your mail? >> >> My point is that the commit message claims the patch was tested by yasu@ >> when in fact it wasn't. If you're convinced that this is the correct >> solution then that's fine, and it does appear to work, but don't claim >> that it's been tested by others when it hasn't. > > The main part of the patch was to ensure consistency in updates: it must > be either always uidinfo, or always ruidinfo. Which one specifically > would affect the limit's semantic, but not the buggy behavior you reported. In similar situations with reviews I've sometimes added a "(earlier version)" suffix after the annotation, e.g.: Reviewed by: foo (earlier version) Using a similar annotation here might have been clearer. -- John Baldwin From nobody Wed Sep 25 14:09:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDJW90dG2z5XWNV; Wed, 25 Sep 2024 14:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDJW85y3kz4BtD; Wed, 25 Sep 2024 14:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727273348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FPAa8l3oORb0ali3i0vuc/8tdzVbb+FIi44zBOuMgGA=; b=b+2FEpJb2el5LL9Nfr1W5MKLkW6jUPe+gJnHsKnIqDlB3qTFHK5JWvBqflHCLRZmacV3fv ZRYC17D/8KdY8vfw3mkfRyGo/LusdkkebDEU6/T/fM7ihCHGtlzif0IXPVK+fIHRL1+mpf runibcW9yv0CQw+3+Unv/Vf8fy9fzPyjzY7Onv1Nz9PxFtSwSkPExNo50dAUiAEgCafMzh FxSYTf5vrPHBPdra69UrGxAR5b7ukn9WoHelUrFLDdeEkDOXr9y8SDbouFXWr4MvgRdngX f5pvsajndh40Nu5aoGyzOmoNgq5Cvc45qLmOJJkxRTiB3u9u0LvIfLpfstoxAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727273348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FPAa8l3oORb0ali3i0vuc/8tdzVbb+FIi44zBOuMgGA=; b=GmKPRLBdR4C65/XC32p5BEver/lhWSBRPQ/E/vuhPTtLE7GuiA1ugGRRWeNTWG+MqeWt+J 3qAvAAl8yAbyIW6VhpvJPIqwcKqBxvgwUt2PUnbeVVJ06XUj+tPcEuQq5X0/3PKS0Qi5rq cSSKOJEWymyixtXak1Fo2v7Bd0G6KDCxAoC6o59PKwcBR6KPn/vHSehxsmgaeWGlmu7LCP LZjz2H4LwB0UKIlQ0fVKN0Bd7gtL0iqJsLZYABFPZhaf3ExcwpTWDzTup0EY3EdSYer3CB UglTnX0IKSpaQW8iEp5mTVhIO0UKLaQfKmdSpjenKlFn1Cilockm5pz7nr9WoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727273348; a=rsa-sha256; cv=none; b=AxNbzmEmmtVlyrWTGahY30FhxHKBRc1BmkIzG0jAJwy+4qW18qLwhiWsGKl77Qd7BgffbZ xL0FLHZr85r0Bzu4El1DC1SJoWWAm+HKvckbEcuaECq9ZCM17iy0dDi46jLz0qzlDxjrwI 18nyX/AEegKtbrPdm17TsicU+cjt42x1fLfmx3Z6z9IBhapkCNDqZOmSJQm+Q6d/lxQhXK xaJHvY7jYawOnEhiMwJXoYtzlzDg3BFuMIW0pfk875SdBMAz7d5M+euU0ck4xqhFqaWJEv 5iuLSEeYfKaGGpSlb3UawSNbUL+xz53eBepn5/IQCr5VptaA9LWeLNxA8pfElg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDJW85Y7zzGGN; Wed, 25 Sep 2024 14:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PE98Qm025719; Wed, 25 Sep 2024 14:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PE98fW025716; Wed, 25 Sep 2024 14:09:08 GMT (envelope-from git) Date: Wed, 25 Sep 2024 14:09:08 GMT Message-Id: <202409251409.48PE98fW025716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: c7a33fe37d76 - main - ntp: Improve descriptions in man pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7a33fe37d7688cb21c743f68256680e003210ad Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c7a33fe37d7688cb21c743f68256680e003210ad commit c7a33fe37d7688cb21c743f68256680e003210ad Author: Alexander Ziaee AuthorDate: 2024-08-05 19:37:42 +0000 Commit: Cy Schubert CommitDate: 2024-09-25 12:40:17 +0000 ntp: Improve descriptions in man pages + ntpd added to ntp.conf(5) description (search keywords) + expand NTP so these pages are shown when `apropos time` + "standard" => "reference" for increased consistency - removed redundant or duplicated search keywords ntp.org bug: https://bugs.ntp.org/show_bug.cgi?id=3936 MFC after: 3 days Reviewed by: Harlan Stenn Reviewed by: Cy Schubert --- contrib/ntp/ntpd/ntp.conf.def | 2 +- contrib/ntp/ntpd/ntp.keys.def | 2 +- contrib/ntp/ntpd/ntpd-opts.def | 2 +- contrib/ntp/ntpq/ntpq-opts.def | 2 +- contrib/ntp/sntp/sntp-opts.def | 2 +- contrib/ntp/util/ntp-keygen-opts.def | 2 +- usr.sbin/ntp/doc/ntp-keygen.8 | 2 +- usr.sbin/ntp/doc/ntp.conf.5 | 2 +- usr.sbin/ntp/doc/ntp.keys.5 | 2 +- usr.sbin/ntp/doc/ntpd.8 | 2 +- usr.sbin/ntp/doc/ntpq.8 | 2 +- usr.sbin/ntp/doc/sntp.8 | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/ntp/ntpd/ntp.conf.def b/contrib/ntp/ntpd/ntp.conf.def index 444e3b35e351..aba3c25ab464 100644 --- a/contrib/ntp/ntpd/ntp.conf.def +++ b/contrib/ntp/ntpd/ntp.conf.def @@ -9,7 +9,7 @@ autogen definitions options; // file name. prog-name = "ntp.conf"; file-path = "/etc/ntp.conf"; -prog-title = "Network Time Protocol (NTP) daemon configuration file format"; +prog-title = "Network Time Protocol daemon (ntpd) configuration format"; /* explain: Additional information whenever the usage routine is invoked */ explain = <<- _END_EXPLAIN diff --git a/contrib/ntp/ntpd/ntp.keys.def b/contrib/ntp/ntpd/ntp.keys.def index e73ce4d06a1b..b0c9717e5906 100644 --- a/contrib/ntp/ntpd/ntp.keys.def +++ b/contrib/ntp/ntpd/ntp.keys.def @@ -10,7 +10,7 @@ autogen definitions options; // file name. prog-name = "ntp.keys"; file-path = "/etc/ntp.keys"; -prog-title = "NTP symmetric key file format"; +prog-title = "Network Time Protocol symmetric key format"; /* explain: Additional information whenever the usage routine is invoked */ explain = <<- _END_EXPLAIN diff --git a/contrib/ntp/ntpd/ntpd-opts.def b/contrib/ntp/ntpd/ntpd-opts.def index 00d35115dc43..6d4952a637c2 100644 --- a/contrib/ntp/ntpd/ntpd-opts.def +++ b/contrib/ntp/ntpd/ntpd-opts.def @@ -5,7 +5,7 @@ autogen definitions options; #include copyright.def prog-name = "ntpd"; -prog-title = "NTP daemon program"; +prog-title = "set clock via Network Time Protocol daemon"; argument = "[ ... ]"; #include ntpdbase-opts.def diff --git a/contrib/ntp/ntpq/ntpq-opts.def b/contrib/ntp/ntpq/ntpq-opts.def index 85655a9d66cc..1189e81efe40 100644 --- a/contrib/ntp/ntpq/ntpq-opts.def +++ b/contrib/ntp/ntpq/ntpq-opts.def @@ -7,7 +7,7 @@ autogen definitions options; #include autogen-version.def prog-name = "ntpq"; -prog-title = "standard NTP query program"; +prog-title = "query Network Time Protocol servers"; argument = '[ host ...]'; flag = { diff --git a/contrib/ntp/sntp/sntp-opts.def b/contrib/ntp/sntp/sntp-opts.def index 7664b1bf08b9..d468b6ef8bf5 100644 --- a/contrib/ntp/sntp/sntp-opts.def +++ b/contrib/ntp/sntp/sntp-opts.def @@ -6,7 +6,7 @@ autogen definitions options; #include copyright.def prog-name = "sntp"; -prog-title = "standard Simple Network Time Protocol client program"; +prog-title = "reference Simple Network Time Protocol client"; argument = '[ hostname-or-IP ...]'; #include homerc.def diff --git a/contrib/ntp/util/ntp-keygen-opts.def b/contrib/ntp/util/ntp-keygen-opts.def index 632dbbec778d..5c06bded15fd 100644 --- a/contrib/ntp/util/ntp-keygen-opts.def +++ b/contrib/ntp/util/ntp-keygen-opts.def @@ -7,7 +7,7 @@ autogen definitions options; #include autogen-version.def prog-name = "ntp-keygen"; -prog-title = "Create a NTP host key"; +prog-title = "create a Network Time Protocol host key"; package = ntp; include = '#include '; diff --git a/usr.sbin/ntp/doc/ntp-keygen.8 b/usr.sbin/ntp/doc/ntp-keygen.8 index ad7b844d27de..3e8ffd9dbf58 100644 --- a/usr.sbin/ntp/doc/ntp-keygen.8 +++ b/usr.sbin/ntp/doc/ntp-keygen.8 @@ -8,7 +8,7 @@ .\" and the template file agmdoc-cmd.tpl .Sh NAME .Nm ntp-keygen -.Nd Create a NTP host key +.Nd create a Network Time Protocol host key .Sh SYNOPSIS .Nm .\" Mixture of short (flag) options and long options diff --git a/usr.sbin/ntp/doc/ntp.conf.5 b/usr.sbin/ntp/doc/ntp.conf.5 index 9e23a2294c48..71fb7c668db2 100644 --- a/usr.sbin/ntp/doc/ntp.conf.5 +++ b/usr.sbin/ntp/doc/ntp.conf.5 @@ -8,7 +8,7 @@ .\" and the template file agmdoc-cmd.tpl .Sh NAME .Nm ntp.conf -.Nd Network Time Protocol (NTP) daemon configuration file format +.Nd Network Time Protocol daemon (ntpd) configuration format .Sh SYNOPSIS .Nm .Op Fl \-option\-name diff --git a/usr.sbin/ntp/doc/ntp.keys.5 b/usr.sbin/ntp/doc/ntp.keys.5 index d235f3b5f7dd..6bec2880163e 100644 --- a/usr.sbin/ntp/doc/ntp.keys.5 +++ b/usr.sbin/ntp/doc/ntp.keys.5 @@ -12,7 +12,7 @@ .Sh NAME .Nm ntp.keys -.Nd NTP symmetric key file format +.Nd Network Time Protocol symmetric key format .Sh SYNOPSIS .Nm .Op Fl \-option\-name diff --git a/usr.sbin/ntp/doc/ntpd.8 b/usr.sbin/ntp/doc/ntpd.8 index 74bc07793048..83beac3632a9 100644 --- a/usr.sbin/ntp/doc/ntpd.8 +++ b/usr.sbin/ntp/doc/ntpd.8 @@ -8,7 +8,7 @@ .\" and the template file agmdoc-cmd.tpl .Sh NAME .Nm ntpd -.Nd NTP daemon program +.Nd set clock via Network Time Protocol daemon .Sh SYNOPSIS .Nm .\" Mixture of short (flag) options and long options diff --git a/usr.sbin/ntp/doc/ntpq.8 b/usr.sbin/ntp/doc/ntpq.8 index e6c66ed71d97..21f15926a0ab 100644 --- a/usr.sbin/ntp/doc/ntpq.8 +++ b/usr.sbin/ntp/doc/ntpq.8 @@ -8,7 +8,7 @@ .\" and the template file agmdoc-cmd.tpl .Sh NAME .Nm ntpq -.Nd standard NTP query program +.Nd query Network Time Protocol servers .Sh SYNOPSIS .Nm .\" Mixture of short (flag) options and long options diff --git a/usr.sbin/ntp/doc/sntp.8 b/usr.sbin/ntp/doc/sntp.8 index 94c3c2816035..4509b6efa222 100644 --- a/usr.sbin/ntp/doc/sntp.8 +++ b/usr.sbin/ntp/doc/sntp.8 @@ -8,7 +8,7 @@ .\" and the template file agmdoc-cmd.tpl .Sh NAME .Nm sntp -.Nd standard Simple Network Time Protocol client program +.Nd reference Simple Network Time Protocol client .Sh SYNOPSIS .Nm .\" Mixture of short (flag) options and long options From nobody Wed Sep 25 14:20:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDJmY1zZwz5XWxs; Wed, 25 Sep 2024 14:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDJmY1R4Rz4F55; Wed, 25 Sep 2024 14:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727274045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r5QEKVgNx+J6mLfrp6/NIGFKc0It8pK7TincangCw2g=; b=EE/722fmD5s1jEwJHO8cwUvYD9TwjJGPvx8uGVJGb4h+UUx/E8VLODpi+ez/XKgsf30DEY H6tgT7fg85JCfC1oGP7anO5BCEjxUUui7pFtL6bFGbvQP3NYNGYkRNx79xHXmNRvizJzVd HwyFmZs+Mx/DUjeM5l9jHwSpPK46XJZKOM6ooB+DVPBPyOIC8LohqFXb093o6F9/OzU12D nhopQsHL7AZZc1GVhvA1Chq4xoGBHvHJdqOqodizr/uEkcYxw1gCIR8Zognp5xLf7kDqIl ERJTh+baGSwQSZ23Mxl0/cXqlbdf8uALCkMZDqONwY6pd/W7/0N+UAQHVTEqAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727274045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r5QEKVgNx+J6mLfrp6/NIGFKc0It8pK7TincangCw2g=; b=EDVhhIFJoGtp6YtedARJn8ij0x4chQ/tTcvyaGk4P4BxnAQ2z3KMrqvJkuVTpQBg5Wn83H mErpoIvU5AtrOEJmudgKwUmTEgnjg8+Xb8B4mwray2Y8hAODoLB2rmwm5e2+r0n+EyDkGU hKbD5Nc/oDbeDtVWRGr/XJZDTodb1VYFb3zbmGxcFcfa5e5fdy7Y7RjIlpj6mJF3cye712 1VZurtFEBP8ZCygKryl9i8urHf2GpRVVri4aDyvafD/oePeAkOKZYsRWZ31CGpAwNAskzt kry0Im7B9FahMA02wFXDxSdNAhIM+SAhTo6JXAqP2ZbQG8H77ey1T5G4K4q1Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727274045; a=rsa-sha256; cv=none; b=MqTHN5u8yeNttZXvVTQqYnNbNzqmKmKy2CdSoEcuxnhO4Hj2WK+f4DLJtW9oMmlzHP069y y0xulKBsVDg7z9BUnxg/lcWoS11oy16QBDtaedKmW/bsxF1JjVX4ksPjI47M2lh7fZi21M Q7T7bLUiVscswq+fmvx9n1fAslxPFr8nmSXNC5S4nDirqVcpl/JEpTOOjkmGwp0dwSOa61 GaksJ7sotRZ4wXGDzFHbz33SBTBXYLzY+kapNMEhkiRO2Gk28ccnzxMWfmWgQBktz5uokT al6cF+k4G/J5e7hQHQUeGYhioCeyRL+8JonrUSbwo+GLfeWz/rjn11TA8DE+Pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDJmY0vngzGFF; Wed, 25 Sep 2024 14:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PEKjdH052607; Wed, 25 Sep 2024 14:20:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PEKj7i052604; Wed, 25 Sep 2024 14:20:45 GMT (envelope-from git) Date: Wed, 25 Sep 2024 14:20:45 GMT Message-Id: <202409251420.48PEKj7i052604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0063ef79f9e6 - main - ctl_report_supported_opcodes: Rename invalid label to invalid_options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0063ef79f9e6b9ad47969af3b94ae63e7888852c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0063ef79f9e6b9ad47969af3b94ae63e7888852c commit 0063ef79f9e6b9ad47969af3b94ae63e7888852c Author: John Baldwin AuthorDate: 2024-09-25 14:20:22 +0000 Commit: John Baldwin CommitDate: 2024-09-25 14:20:22 +0000 ctl_report_supported_opcodes: Rename invalid label to invalid_options This error handling is specific to an invalid value in the REPORTING OPTIONS field of a REPORT SUPPORTED OPERATION CODES command. While here, reuse the label for another case. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D46775 --- sys/cam/ctl/ctl.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 1505e0886f57..b1367cd79fab 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7456,33 +7456,26 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) break; case RSO_OPTIONS_OC: if (ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid_options; } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - goto invalid; + goto invalid_options; } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; case RSO_OPTIONS_OC_ASA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && service_action >= 32) { - goto invalid; + goto invalid_options; } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: -invalid: +invalid_options: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 25 14:21:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDJnW3mrfz5XXCQ; Wed, 25 Sep 2024 14:21:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDJnW3LK4z4Fnk; Wed, 25 Sep 2024 14:21:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727274095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkiRFreVUFCqQm1yhy9C1vPTEbMgFlk919hGWDuF5IQ=; b=bjlm5eRJNnQXinlZT+L6ciVp2brvEmY3hc6nIoFetWKKoe0OvpWAA0FEWPo8MWZ0H073WI 1Z7b760CVaoj9XfdPkntPAJzLoQiFBQ9Ap03ifL94SKCd/Eq6Xrqkwlm2wAVYtJuwCVo18 YGJnCnhPOxCU+gu3aEI6o7N4D8+O8YCWH7IxdLBGvUYHUQo8KELe3G78oPaYaRDKB1Vn/i x7mN1LM7z8QOjgEMgMFEEvVGHVmjwOTdM71YGtyJmcyU2kgQ5673ogciUyfaPt5lDiWG7g SU+MxLoCGSLdRQ07WVqtu9WfoTavAePYsH6LgXwHCgzQue8gwRecAraOBHCFew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727274095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkiRFreVUFCqQm1yhy9C1vPTEbMgFlk919hGWDuF5IQ=; b=orG5GmgjNfPirpmXI9SbusgMC/HHnmUJwgbm1Cm6xh+lgA4mUyYJqY1xnM51x+BV+Dpt7K kK6ZM6M8JWEpmc/AWmsh2EeD4Qoy6/T2PrWxm2hzr2Eqyatw/HErfTTBkqCh8kJAgFmHLg T77ZjsrwKc8coSuvdsda/qArWq/W9cL2LLwj9NTuXYXuRo8UYv0QRp+7+WHatXwBLR3V8I rb7aIZloho3ESSOBE9SuGlLPjnVk+BYFIOotJxnO7Ai8VEKMtr78XgJQNiSRhDo/z9sVK3 73ISJqH+YvqF1AcUMxG6fa3t1+Vt9dRK31W4nvvlsHz7U0PLi7Q4Gr7Fzz9Dvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727274095; a=rsa-sha256; cv=none; b=OZ4xrFRylxBd2xpn0Ot+g0eb+35WjTTPNty8RZpORC2IyFrM2Wd9WgG4Fcl8tE5yZt5+ZW Xn1gFnMZrzVBvCLgRcnzD6uAo/M630Rh79b7UKV5b4n2g1PCUWt+2pYpJ/VdBAuKeybcCM Ze3WxqDI0hspFG0dcGcCxVXSAgOscUp2eWYtyyCWZwFA4VkUE3YsP9dtHj9MIzoNyLdtWN UEshsHIEUbqIMQPJfmEQWIlHA3qznRz7ZdLJN1X/fvF9zIoVYW+ZigrnvxYkWfhg6L1uKh us0bwvyXHiL2IKzbTA20xtuHPHRlV0ulTjPUUerbJfhc8VxrQ83FtddtyyoPqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDJnW2dJMzGN4; Wed, 25 Sep 2024 14:21:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PELZnb057305; Wed, 25 Sep 2024 14:21:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PELZU3057302; Wed, 25 Sep 2024 14:21:35 GMT (envelope-from git) Date: Wed, 25 Sep 2024 14:21:35 GMT Message-Id: <202409251421.48PELZU3057302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b1d324d98761 - main - ctl: Move extern for control_softc into List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1d324d98761a8640aef94c76cbccafc22c8dcc8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b1d324d98761a8640aef94c76cbccafc22c8dcc8 commit b1d324d98761a8640aef94c76cbccafc22c8dcc8 Author: John Baldwin AuthorDate: 2024-09-25 14:21:18 +0000 Commit: John Baldwin CommitDate: 2024-09-25 14:21:18 +0000 ctl: Move extern for control_softc into Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D46778 --- sys/cam/ctl/ctl_backend.c | 2 -- sys/cam/ctl/ctl_backend_block.c | 2 -- sys/cam/ctl/ctl_backend_ramdisk.c | 1 - sys/cam/ctl/ctl_frontend.c | 2 -- sys/cam/ctl/ctl_private.h | 1 + sys/dev/nvmf/controller/ctl_frontend_nvmf.c | 2 -- 6 files changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl_backend.c b/sys/cam/ctl/ctl_backend.c index a2249b5d8f44..c2b5e0f32fcc 100644 --- a/sys/cam/ctl/ctl_backend.c +++ b/sys/cam/ctl/ctl_backend.c @@ -59,8 +59,6 @@ #include #include -extern struct ctl_softc *control_softc; - int ctl_backend_register(struct ctl_backend_driver *be) { diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 55a5ce0d047a..8c2174249a95 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -225,8 +225,6 @@ struct ctl_be_block_io { void (*beio_cont)(struct ctl_be_block_io *beio); /* to continue processing */ }; -extern struct ctl_softc *control_softc; - static int cbb_num_threads = 32; SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CAM Target Layer Block Backend"); diff --git a/sys/cam/ctl/ctl_backend_ramdisk.c b/sys/cam/ctl/ctl_backend_ramdisk.c index 49ed05f54a58..dc73c22bce41 100644 --- a/sys/cam/ctl/ctl_backend_ramdisk.c +++ b/sys/cam/ctl/ctl_backend_ramdisk.c @@ -132,7 +132,6 @@ struct ctl_be_ramdisk_softc { }; static struct ctl_be_ramdisk_softc rd_softc; -extern struct ctl_softc *control_softc; static int ctl_backend_ramdisk_init(void); static int ctl_backend_ramdisk_shutdown(void); diff --git a/sys/cam/ctl/ctl_frontend.c b/sys/cam/ctl/ctl_frontend.c index 1e4d130950c4..6c7796bf0c82 100644 --- a/sys/cam/ctl/ctl_frontend.c +++ b/sys/cam/ctl/ctl_frontend.c @@ -64,8 +64,6 @@ #include #include -extern struct ctl_softc *control_softc; - int ctl_frontend_register(struct ctl_frontend *fe) { diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 821aa0aa681b..f27a8f2d423a 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -426,6 +426,7 @@ struct ctl_softc { #ifdef _KERNEL +extern struct ctl_softc *control_softc; extern const struct ctl_cmd_entry ctl_cmd_table[256]; extern const struct ctl_nvme_cmd_entry nvme_admin_cmd_table[256]; extern const struct ctl_nvme_cmd_entry nvme_nvm_cmd_table[256]; diff --git a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c index bc061947a9a0..3d09ee901886 100644 --- a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c +++ b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c @@ -51,8 +51,6 @@ static int nvmft_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int flag, struct thread *td); static int nvmft_shutdown(void); -extern struct ctl_softc *control_softc; - static struct taskqueue *nvmft_taskq; static TAILQ_HEAD(, nvmft_port) nvmft_ports; static struct sx nvmft_ports_lock; From nobody Wed Sep 25 15:14:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDKyW55KJz5XLcF; Wed, 25 Sep 2024 15:14:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDKyW4Gvwz4NFq; Wed, 25 Sep 2024 15:14:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727277267; 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=mjZWp98Gqkbai8fj9xjwOEWnGRBDEoMSB2VpLoytxwk=; b=xs0fwnuZtQTmuEqORe/QO2Fadj8eVRs473w2na6gy9nXQ/vrvnSF/3XgB+ScFshmsbQqky tLGLWg2BSn2+q8aNogzQoQW9uZjYVKN/fehT9OrB/NOWLmnl8cyJeRBoa6BMSSPaSrIsoD dUsM1r5iDBgIj/58cjDSotYhtW4MwLkJjI5oHQYHzVFjRDzHGRx4kGJAO8LCqQBuT089gl jLqGc2cpZih6bOvtr+ev8+kIcDIQlUIXvHpbvfGuCbpspaJJkylviRafu590h/qLIPW+YJ fz/wLUAZ9E4UwjMAz2pBwCInkCkJipyMZqsoeEi1nA/ttkRPhJzKB3E6JuqL6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727277267; 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=mjZWp98Gqkbai8fj9xjwOEWnGRBDEoMSB2VpLoytxwk=; b=w5EFpjdzpmgPO5xKNf7roxab7TWXMwGI+jDGwAFlGoXa39c3x6H3m7KCCBdcXtHdRR62Zv ui8MrDQ90KF/dqvq41slxw7Ml3PsDqfQcv270TIiRz9av1ovMyHA9OSVXkDFiW9woFPo1t PsQu5RW5mucjQc4yVTJWqMEnWcfqDSsyai4Z9SaSVKDsZd31/tNHgDsi4DkXdqUtkBnxhL emV/MougfmwN3yL239OSzablRNSyvR3p8Vxyt7GF7OoiBY6qAr9MiGvRT38vaFqV1pBqA1 gs8KMR35eO/FTr/Ik1xzjlrVEgFMjqbSSfigDRbWNOINJvZEUHBbIt6GemXVNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727277267; a=rsa-sha256; cv=none; b=OFgoPqI4vP4/9grPeppWhrjEHoJpR46S3SaJi0Nptuj19emxjnvo+yzDJR9umfB9m0jx/P hw5mpsMvnI4Ait9VfWkY5TmVJfgdydetueS51qjhKVa8OTtDozuFxmYi1MOllemNwZS+Dz 7B0T7S+fNgvALzX7Sdbjp6kwRWf4VgctUQi1O7FmoiO6WYIa/xryzdCfc7hnXbs26x4VCA uRd1O5fju2hb35HnDDujYdVDbXvbHE8eQZfSQ9dUXDXppPbyH6MFdw3xO/oeWm3o1sXpy4 2nba2/fDepPahB080VYiWHsZXKIlOdRc16trqAlRmBHMu7KS+gyFB6Fso+yfDg== Received: from [IPV6:2601:5c0:4200:b830:7d5c:2819:6552:855e] (unknown [IPv6:2601:5c0:4200:b830:7d5c:2819:6552:855e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XDKyW1rwfz14XW; Wed, 25 Sep 2024 15:14:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <84f27dd0-27a3-4fa9-83c2-df2d7ca0ccbd@FreeBSD.org> Date: Wed, 25 Sep 2024 11:14:26 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f08247fd888e - main - Assert that mbufs are writable if we write to them Content-Language: en-US From: John Baldwin To: Drew Gallatin , Kristof Provost , Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202409111118.48BBIQ2h065089@gitrepo.freebsd.org> <2b1955e2-fbf1-41cb-b256-a9a257b16a83@FreeBSD.org> <1f61b6de-0fe2-4343-b4ad-f0866785a4bc@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/25/24 09:58, John Baldwin wrote: > On 9/13/24 11:45, Drew Gallatin wrote: >> I think you also need to remove M_EXTPG from M_WRITABLE(). Attached a trivial, untested patch. > > Yes, I came back to testing this yesterday and ran into that as well. However, as part of this > I also tried to audit all the calls to M_WRITABLE and most of them are assuming they can use > mtod() to get a pointer. I think what might be a better approach is to add a new > M_WRITABLE_EXTPG() variant that doesn't check M_EXTPG and leave M_WRITABLE as-is. Places > like m_copyback that are M_EXTPG aware would use the new macro. This still requires the > patch to not set M_RDONLY in all M_EXTPG mbufs. The other thing we might want to do though > is set M_RDONLY on encrypted data after KTLS has encrypted it as there is no good reason to > modify encrypted data. I've uploaded a series of reviews starting with https://reviews.freebsd.org/D46783 >> Drew >> >> On Thu, Sep 12, 2024, at 5:40 AM, John Baldwin wrote: >>> On 9/12/24 05:03, John Baldwin wrote: >>>> I think part of the motivation for marking M_EXTPG as read-only is that you can't "write" >>>> to m_data via mtod() or the like. That said, M_EXTPG aren't really read-only. It >>>> depends on the backing store. M_EXTPG were first merged into FreeBSD prior to KTLS to >>>> support sendfile, and in that case, they should be M_RDONLY because they alias pages >>>> from the file's VM object. However, M_EXTPG mbufs allocated via functions like >>>> m_uiotombuf_nomap should not be M_RDONLY. I think this originated in the original >>>> import of KTLS which doesn't push setting M_RDONLY out to the callers of mb_alloc_extpgs, >>>> and a few other places that hardcode M_RDONLY with M_EXTPG (_mb_unmapped_to_ext should >>>> preserve M_RDONLY from the original mbuf instead of forcing M_RDONLY). >>>> >>>> I can take a stab at a patch but won't have time to really test it until after Euro. >>> >>> Patch available below. Compile tested but not run-tested: >>> >>> https://github.com/freebsd/freebsd-src/compare/main...bsdjhb:freebsd:m_extpg_rdonly >>> >>>> On 9/11/24 16:56, Drew Gallatin wrote: >>>>> M_EXTPGS mbufs are marked read-only because they refer to external data. The original crypto code, (before kTLS was converted to OCF), used to just build an iovec using PHYS_TO_DMAP() on the page array. I think this case was missed during the conversion to OCF. >>>>> >>>>> I'm not sure what the best thing to do is, as they should be read only, except this one specific case.... I'd be tempted to just nerf the KASSERT for EXTPGS. >>>>> >>>>> On Wed, Sep 11, 2024, at 11:02 AM, Kristof Provost wrote: >>>>>> On 11 Sep 2024, at 16:45, Mark Johnston wrote: >>>>>>> On Wed, Sep 11, 2024 at 11:18:26AM +0000, Kristof Provost wrote: >>>>>>>> The branch main has been updated by kp: >>>>>>>> >>>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=f08247fd888e6f7db0ecf2aaa39377144ac40b4c >>>>>>>> >>>>>>>> commit f08247fd888e6f7db0ecf2aaa39377144ac40b4c >>>>>>>> Author: Kristof Provost >>>>>>>> AuthorDate: 2024-09-10 20:15:31 +0000 >>>>>>>> Commit: Kristof Provost >>>>>>>> CommitDate: 2024-09-11 11:17:48 +0000 >>>>>>>> >>>>>>>> Assert that mbufs are writable if we write to them >>>>>>>> >>>>>>>> m_copyback() modifies the mbuf, so it must be a writable mbuf. >>>>>>> >>>>>>> This change still triggers a panic for me when running KTLS tests. I >>>>>>> note that EXTPG mbufs always have M_RDONLY set, but I'm not quite sure >>>>>>> why. I suspect such mbufs need special handling with respect to the new >>>>>>> assertion. >>>>>>> >>>>>>> syzbot also triggered this panic: >>>>>>> https://syzkaller.appspot.com/bug?extid=58c918369f9dc323409d >>>>>>> >>>>>> Yeah, I saw that one before I went out for a bike ride. >>>>>> >>>>>> Clearly something is wrong. Either ktls is using read-only buffers or the M_WRITABLE() macro isn’t quite smart enough to spot this specific case. >>>>>> >>>>>> I’m not familiar enough with ktls to easily tell which. >>>>>> >>>>>> I’ll back this assertion change out for now, so we’re not panicing test machines while we figure this out. >>>>>> >>>>>> Best regards, >>>>>> Kristof >>>>>> >>>>> >>>> >>> >>> -- >>> John Baldwin >>> >>> >> > -- John Baldwin From nobody Wed Sep 25 15:26:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDLDY1zvgz5XM4L; Wed, 25 Sep 2024 15:26:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDLDY1Y5Fz4QWg; Wed, 25 Sep 2024 15:26:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727277997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZOVeIXDuudh5gaugYljbsR1ypnKdOboz4mE49qJQto=; b=dxsseyHixk7VYA9temPr8RZjeenNvMWX08KwmDBvqPN4YI9IaT8dH5pQjNFmHCerTnH7zN 7xAM5I0klYDWcCqo82/CuRxlBYEY98tftYAGDPqdC0nf1kdMI6hgBGnwJTrc1l0eXzoRsh Chu/x+yU7NJwlqQoZNfLqXteFj5JfAm4qnLsjrEQFdrNK8qFUMunvcVUBQN0esYimh0d// hf7ODgfajNDO5uUVpa4b+PCg53K+Q0clpmYAiBV3db4acrGZWGhWgQmJOvKV/OxgOGwwpJ Nc2EQyUzkFWoXG0DDv/YZVBmY4s8XE2o+z3myPHfcM75e5lQ7eYYWsqGD7tp1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727277997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZOVeIXDuudh5gaugYljbsR1ypnKdOboz4mE49qJQto=; b=rHEetQppATeSOugry6kv96fyr84pbGT7jcjonmpKKkxPj3p5GTxvMi59b4r84e36d3ccYS tuyAtSVVmcFGOSWAn/SNCEX++6922HzUO+kv78oEV9L9H7c4WFmpMpGD5JkKJWAEsJ4kg+ W6KunnnE4doe+skM/+d00sMZAth3EyiUpAX28TsI9cs0C0AOCZd7M3cmJmitEzDmWhJyJ1 G6c+WmGUxTzUBzZPH4SYJ4BLleuQrYjQcZOg6D5WoBIwgdB2jsHzj7odSpFdp/VFtORTju n3ONTMZjmMCww9H4sAoMowEbJRayk/09CK7U4aXfdW4IOdCDnLiw3rOT/Xdh5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727277997; a=rsa-sha256; cv=none; b=PDbPtFAzQLgwAFcjEU5ONfLsKuhEifJ0glb0myBBwxstRxZbqaUW+mSK8/MUAR8IkHdJIT GLgDOBG71IsVt+H16HjldwNqxpwP1ANvIIJd78zLqjxRbMST8G3Mvp7yLyZWTcp3wvDOfn 2UQ/UuTBPPVcyW+Tr9G8P5nuaCeDGgrLrnzKZx0cH6tAEvO20znkH40CtQSgqgu3HIWbeg R+i/PEcXgXrXMujB84YWVLm7k2i9jcm+4Nts0+WK063ffAamIMkDmOZ6VN6LNlykGRzZBU vncM35VJHuqIUIcZHAYw3fGNN90oJ+cVv9Y88ew5jrhLKylQO7TQo0gWJZxr5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDLDY192VzJKf; Wed, 25 Sep 2024 15:26:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PFQb5N061466; Wed, 25 Sep 2024 15:26:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PFQbZD061463; Wed, 25 Sep 2024 15:26:37 GMT (envelope-from git) Date: Wed, 25 Sep 2024 15:26:37 GMT Message-Id: <202409251526.48PFQbZD061463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 67bd1d072190 - main - pf tests: Add max states test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67bd1d0721908c8ae386723873e422a3f4156932 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=67bd1d0721908c8ae386723873e422a3f4156932 commit 67bd1d0721908c8ae386723873e422a3f4156932 Author: Kajetan Staszkiewicz AuthorDate: 2024-09-25 12:39:38 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 15:26:17 +0000 pf tests: Add max states test Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46774 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/max_states.sh | 61 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 8444c92fb8d5..38548336377a 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -24,6 +24,7 @@ ATF_TESTS_SH+= altq \ macro \ map_e \ match \ + max_states \ mbuf \ modulate \ names \ diff --git a/tests/sys/netpfil/pf/max_states.sh b/tests/sys/netpfil/pf/max_states.sh new file mode 100755 index 000000000000..677d6f473d97 --- /dev/null +++ b/tests/sys/netpfil/pf/max_states.sh @@ -0,0 +1,61 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Kajetan Staszkiewicz +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + + +max_states_head() +{ + atf_set descr 'Max states per rule' + atf_set require.user root +} + +max_states_body() +{ + setup_router_dummy_ipv6 + + pft_set_rules router \ + "block" \ + "pass quick inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in on ${epair_tester}b keep state (max 3)" \ + "pass out on ${epair_server}a keep state" + + # The exact limit is off by 1 + ping_dummy_check_request exit:0 --ping-type=tcpsyn --send-sport=4201 + ping_dummy_check_request exit:0 --ping-type=tcpsyn --send-sport=4202 + ping_dummy_check_request exit:1 --ping-type=tcpsyn --send-sport=4203 +} + +max_states_cleanup() +{ + pft_cleanup +} + + +atf_init_test_cases() +{ + atf_add_test_case "max_states" +} From nobody Wed Sep 25 17:15:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDNf20ySDz5XSxv; Wed, 25 Sep 2024 17:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDNf206WNz4byJ; Wed, 25 Sep 2024 17:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727284522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pk1uOpDvdBIgT+WyQg+MpTA/MD6YTOW3hOIQcjwSeNY=; b=OdzTq4t2U0wHKOsxrZxu3XjliUy4wZDsaeLI2SMK82s1Gr2ZTtsUVuCzMf3g2jGHfeNROX NYl2sTwhI+x1wadSW/sRahNtLnia3PNpXyL4E6NSZCGcgSK6lGU0kloVUgt7md4v7eVY45 4GHysffS5CFe2RAt7iaUfLVuqxtS7JJtwlFedvijXkJY40RVIRz5x3y1ardFIQ5lr0uMie wk3RJvNxHmDjitq/T3Imsoz+2ZIIzWid+Q1D2iim57agLk3Y2A2rlT2fzL39r2q0Hb/rny V5OyN9IlQ+DRfYbuPrUZorztiODqaFK8chOKCm7p6tzpFS4+Guc4/IatHRhEXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727284522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pk1uOpDvdBIgT+WyQg+MpTA/MD6YTOW3hOIQcjwSeNY=; b=LHIeYjNrbddAjo/yplzOQEwTTXg0TX/ivWIE3j1JLBHvWV/EnO74L/Z8o7dH81SzRRTAfG DUsD/k5Rit1vMmdlwNTOTTrWLAaN5Kd8YzB6mwkYRqwNTUmGvo8+Fe6vw/9FUxvHQMZ0nN F1xfmfjEo9kWTX/XmItXiCVQut5zqfptwGESQsya3vRP8WYfx6rsDYHep2i5vMt/BiMrKH Ua/3AaHWR8lVjb8qwkb4/k0dOt73tbPW8Z067VrkkfoyQ2X1tEjDBBnl6bYSVJZ44CIPok 7lwNtSZDR/fslNYV1l2dkwdHMUBiGngFMbsGZjh9FIapXAHKWxZEhobKU4LH4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727284522; a=rsa-sha256; cv=none; b=m7IaTOuKzhuU2pF1KIj+RWI0xu2DR6XElAT7ST9/VodBmQTtJy2KvGFobQJ7wE3+Ko8NoJ crtxEHbujTs1P1DOtZ7bI6+nMz4y+xTn647y4FS+tU8MVwIc4LH8V0zMFtVKShmrAM5nLp ROIDmaw6XS64ejC5C08iritoWRwt6hwFP9RgE4NkYmxAIP8FHoIBSxQSNAJ+sOxcPKPyYO sE+kdRhxHkqT1cLTif6z+1U06iEh+ie6PwxodaechB/5jYbxdxyYNAmaHdl7XSg1p2AC20 ZqUygiI5Z39pFYmVXNnlYaW/BkL0sX6pXUa1cYMUF2EFHAE8xCr5xqplXukfPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDNf16q9jzLdk; Wed, 25 Sep 2024 17:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PHFLYL047268; Wed, 25 Sep 2024 17:15:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PHFLuQ047265; Wed, 25 Sep 2024 17:15:21 GMT (envelope-from git) Date: Wed, 25 Sep 2024 17:15:21 GMT Message-Id: <202409251715.48PHFLuQ047265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: cf73401c4f7a - main - diff3: Fix merge mode. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf73401c4f7af063c91a0c8e4d5b46e08f06db87 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=cf73401c4f7af063c91a0c8e4d5b46e08f06db87 commit cf73401c4f7af063c91a0c8e4d5b46e08f06db87 Author: Dag-Erling Smørgrav AuthorDate: 2024-09-25 17:14:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-25 17:14:55 +0000 diff3: Fix merge mode. This is mostly thj@'s work, with some tweaks and cleanup by me. There are still some cases where our output differs from GNU diff3, but it's much better than before and I'd rather commit what I have now than let it continue to languish in a metaphorical drawer. MFC after 3 weeks Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D46762 --- usr.bin/diff3/diff3.c | 255 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 179 insertions(+), 76 deletions(-) diff --git a/usr.bin/diff3/diff3.c b/usr.bin/diff3/diff3.c index c72ea0747589..f20b1d74678d 100644 --- a/usr.bin/diff3/diff3.c +++ b/usr.bin/diff3/diff3.c @@ -79,7 +79,6 @@ #include #include - /* * "from" is first in range of changed lines; "to" is last+1 * from=to=line after point of insertion for added lines. @@ -90,6 +89,7 @@ struct range { }; struct diff { +#define DIFF_TYPE1 1 #define DIFF_TYPE2 2 #define DIFF_TYPE3 3 int type; @@ -147,6 +147,7 @@ static void keep(int, struct range *); static void merge(int, int); static void prange(struct range *, bool); static void repos(int); +static void separate(const char *); static void edscript(int) __dead2; static void Ascript(int) __dead2; static void mergescript(int) __dead2; @@ -154,7 +155,7 @@ static void increase(void); static void usage(void); static void printrange(FILE *, struct range *); -static const char diff3_version[] = "FreeBSD diff3 20220517"; +static const char diff3_version[] = "FreeBSD diff3 20240925"; enum { DIFFPROG_OPT, @@ -189,49 +190,110 @@ usage(void) "[-L label3] file1 file2 file3\n"); } +static int +strtoi(char *str, char **end) +{ + intmax_t num; + + errno = 0; + num = strtoimax(str, end, 10); + if ((end != NULL && *end == str) || + num < 0 || num > INT_MAX || + errno == EINVAL || errno == ERANGE) + err(1, "error in diff output"); + return (int)num; +} + +/* + * Read diff hunks into the array pointed to by *dd. + * + * The output from `diff foo bar` consists of a series of hunks describing + * an addition (lines in bar not present in foo), change (lines in bar + * different from lines in foo), or deletion (lines in foo not present in + * bar). Each record starts with a line of the form: + * + * a[,b]xc[,d] + * + * where a, b, c, and d are nonnegative integers (b and d are printed only + * if they differ from a and c, respectively), and x is either 'a' for an + * addition, 'c' for a change, or 'd' for a deletion. This is then + * followed by a series of lines (which we ignore) giving the added, + * changed, or deleted text. + * + * For an addition, a == b is the last line in 'foo' before the addition, + * while c through d is the range of lines in 'bar' to be added to 'foo'. + * + * For a change, a through b is the range of lines in 'foo' to be replaced + * and c through d is the range of lines in 'bar' to replace them with. + * + * For a deletion, a through b is the range of lines in 'foo' to remove + * and c == d is the line in 'bar' which corresponds to the last line + * before the deletion. + * + * The observant reader will have noticed that x is not really needed and + * that we can fully describe any hunk using only a, b, c, and d: + * + * - an addition replaces a zero-length range in one file with a + * non-zero-length range from the other + * + * - a change replaces a non-zero-length range in one file with a + * non-zero-length range from the other + * + * - a deletion replaces a non-zero-length range in one file with a + * zero-length range from the other + */ static int readin(int fd, struct diff **dd) { int a, b, c, d; - size_t i; + int i; char kind, *p; FILE *f; f = fdopen(fd, "r"); if (f == NULL) err(2, "fdopen"); - for (i = 0; (p = getchange(f)); i++) { + for (i = 0; (p = getchange(f)) != NULL; i++) { + if ((size_t)i >= szchanges - 1) + increase(); #if DEBUG (*dd)[i].line = strdup(p); #endif /* DEBUG */ - if (i >= szchanges - 1) - increase(); - a = b = (int)strtoimax(p, &p, 10); - if (*p == ',') { - p++; - b = (int)strtoimax(p, &p, 10); - } + a = b = strtoi(p, &p); + if (*p == ',') + b = strtoi(p + 1, &p); kind = *p++; - c = d = (int)strtoimax(p, &p, 10); - if (*p == ',') { - p++; - d = (int)strtoimax(p, &p, 10); - } + c = d = strtoi(p, &p); + if (*p == ',') + d = strtoi(p + 1, &p); + if (*p != '\n') + errx(1, "error in diff output"); if (kind == 'a') a++; - if (kind == 'd') + else if (kind == 'c') + /* nothing */ ; + else if (kind == 'd') c++; + else + errx(1, "error in diff output"); b++; d++; + if (b < a || d < c) + errx(1, "error in diff output"); (*dd)[i].old.from = a; (*dd)[i].old.to = b; (*dd)[i].new.from = c; (*dd)[i].new.to = d; + if (i > 0) { + if ((*dd)[i].old.from < (*dd)[i - 1].old.to || + (*dd)[i].new.from < (*dd)[i - 1].new.to) + errx(1, "diff output out of order"); + } } - if (i) { - (*dd)[i].old.from = (*dd)[i - 1].old.to; - (*dd)[i].new.from = (*dd)[i - 1].new.to; + if (i > 0) { + (*dd)[i].old.from = (*dd)[i].old.to = (*dd)[i - 1].old.to; + (*dd)[i].new.from = (*dd)[i].new.to = (*dd)[i - 1].new.to; } fclose(f); return (i); @@ -264,7 +326,7 @@ getchange(FILE *b) { char *line; - while ((line = get_line(b, NULL))) { + while ((line = get_line(b, NULL)) != NULL) { if (isdigit((unsigned char)line[0])) return (line); } @@ -305,15 +367,23 @@ merge(int m1, int m2) d2 = d23; j = 0; - while (t1 = d1 < d13 + m1, t2 = d2 < d23 + m2, t1 || t2) { + for (;;) { + t1 = (d1 < d13 + m1); + t2 = (d2 < d23 + m2); + if (!t1 && !t2) + break; + /* first file is different from the others */ if (!t2 || (t1 && d1->new.to < d2->new.from)) { /* stuff peculiar to 1st file */ if (eflag == EFLAG_NONE) { - printf("====1\n"); + separate("1"); change(1, &d1->old, false); keep(2, &d1->new); change(3, &d1->new, false); + } else if (eflag == EFLAG_OVERLAP) { + j = edit(d2, dup, j, DIFF_TYPE1); + printdiff(d2); } d1++; continue; @@ -321,7 +391,7 @@ merge(int m1, int m2) /* second file is different from others */ if (!t1 || (t2 && d2->new.to < d1->new.from)) { if (eflag == EFLAG_NONE) { - printf("====2\n"); + separate("2"); keep(1, &d2->new); change(3, &d2->new, false); change(2, &d2->old, false); @@ -359,7 +429,7 @@ merge(int m1, int m2) * dup = 1 means files 1 and 2 identical */ if (eflag == EFLAG_NONE) { - printf("====%s\n", dup ? "3" : ""); + separate(dup ? "3" : ""); change(1, &d1->old, dup); change(2, &d2->old, false); d3 = d1->old.to > d1->old.from ? d1 : d2; @@ -400,6 +470,12 @@ merge(int m1, int m2) edscript(j); } +static void +separate(const char *s) +{ + printf("====%s\n", s); +} + /* * The range of lines rold.from thru rold.to in file i is to be changed. * It is to be printed only if it does not duplicate something to be @@ -555,7 +631,6 @@ printrange(FILE *p, struct range *r) char *line = NULL; size_t len = 0; int i = 1; - ssize_t rlen = 0; /* We haven't been asked to print anything */ if (r->from == r->to) @@ -570,7 +645,7 @@ printrange(FILE *p, struct range *r) * files with lots of ranges. */ fseek(p, 0L, SEEK_SET); - while ((rlen = getline(&line, &len, p)) > 0) { + while (getline(&line, &len, p) > 0) { if (i >= r->from) printf("%s", line); if (++i > r->to - 1) @@ -591,20 +666,31 @@ edscript(int n) old = &de[n].old; delete = (new->from == new->to); - if (!oflag || !overlap[n]) { - prange(old, delete); - } else { - printf("%da\n", old->to - 1); - printf("%s\n", divider); - } - printrange(fp[2], new); - if (!oflag || !overlap[n]) { - if (!delete) + if (de[n].type == DIFF_TYPE1) { + if (delete) + printf("%dd\n", new->from - 1); + else if (old->from == new->from && old->to == new->to) { + printf("%dc\n", old->from); + printrange(fp[2], old); printf(".\n"); + } + continue; } else { - printf("%s %s\n.\n", newmark, f3mark); - printf("%da\n%s %s\n.\n", old->from - 1, - oldmark, f1mark); + if (!oflag || !overlap[n]) { + prange(old, delete); + } else { + printf("%da\n", old->to - 1); + printf("%s\n", divider); + } + printrange(fp[2], new); + if (!oflag || !overlap[n]) { + if (!delete) + printf(".\n"); + } else { + printf("%s %s\n.\n", newmark, f3mark); + printf("%da\n%s %s\n.\n", old->from - 1, + oldmark, f1mark); + } } } if (iflag) @@ -639,10 +725,7 @@ Ascript(int n) prange(old, deletenew); printrange(fp[2], new); } else { - startmark = new->to; - - if (!deletenew) - startmark--; + startmark = new->to - 1; printf("%da\n", startmark); printf("%s %s\n", newmark, f3mark); @@ -711,25 +794,43 @@ mergescript(int i) { struct range r, *new, *old; int n; + bool delete = false; r.from = 1; r.to = 1; - for (n = 1; n < i+1; n++) { + for (n = 1; n <= i; n++) { new = &de[n].new; old = &de[n].old; - /* print any lines leading up to here */ - r.to = old->from; - printrange(fp[0], &r); + /* + * Print any lines leading up to here. If we are merging don't + * print deleted ranges. + */ + delete = (new->from == new->to); + if (de[n].type == DIFF_TYPE1 && delete) + r.to = new->from - 1; + else if (de[n].type == DIFF_TYPE3 && (old->from == old->to)) { + r.from = old->from - 1; + r.to = new->from; + } else + r.to = old->from; - if (de[n].type == DIFF_TYPE2) { + printrange(fp[0], &r); + switch (de[n].type) { + case DIFF_TYPE1: + /* If this isn't a delete print it */ + if (!delete) + printrange(fp[2], new); + break; + case DIFF_TYPE2: printf("%s %s\n", oldmark, f2mark); printrange(fp[1], old); printf("%s\n", divider); printrange(fp[2], new); printf("%s %s\n", newmark, f3mark); - } else if (de[n].type == DIFF_TYPE3) { + break; + case DIFF_TYPE3: if (!oflag || !overlap[n]) { printrange(fp[2], new); } else { @@ -737,20 +838,27 @@ mergescript(int i) printf("%s %s\n", oldmark, f1mark); printrange(fp[0], old); - printf("%s %s\n", orgmark, f2mark); - if (old->from == old->to) { - struct range or; - or.from = old->from - 1; - or.to = new->to; - printrange(fp[1], &or); - } else - printrange(fp[1], old); + if (eflag != EFLAG_OVERLAP) { + printf("%s %s\n", orgmark, f2mark); + if (old->from == old->to) { + struct range or; + or.from = old->from - 1; + or.to = new->to; + printrange(fp[1], &or); + } else { + printrange(fp[1], old); + } + } printf("%s\n", divider); printrange(fp[2], new); printf("%s %s\n", newmark, f3mark); } + break; + default: + printf("Error: Unhandled diff type - exiting\n"); + exit(EXIT_FAILURE); } if (old->from == old->to) @@ -758,6 +866,7 @@ mergescript(int i) else r.from = old->to; } + /* * Print from the final range to the end of 'myfile'. Any deletions or * additions to this file should have been handled by now. @@ -768,21 +877,14 @@ mergescript(int i) */ new = &de[n-1].new; old = &de[n-1].old; - if ((old->from == new->from) && - (old->to == new->to)) + + if (old->from == new->from && old->to == new->to) r.from--; else if (new->from == new->to) r.from = old->from; - /* - * If the range is a 3 way merge then we need to skip a line in the - * trailing output. - */ - if (de[n-1].type == DIFF_TYPE3) - r.from++; - r.to = INT_MAX; - printrange(fp[0], &r); + printrange(fp[2], &r); exit(overlapcnt > 0); } @@ -797,25 +899,25 @@ increase(void) newsz = szchanges == 0 ? 64 : 2 * szchanges; incr = newsz - szchanges; - p = reallocarray(d13, newsz, sizeof(struct diff)); + p = reallocarray(d13, newsz, sizeof(*p)); if (p == NULL) err(1, NULL); - memset(p + szchanges, 0, incr * sizeof(struct diff)); + memset(p + szchanges, 0, incr * sizeof(*p)); d13 = p; - p = reallocarray(d23, newsz, sizeof(struct diff)); + p = reallocarray(d23, newsz, sizeof(*p)); if (p == NULL) err(1, NULL); - memset(p + szchanges, 0, incr * sizeof(struct diff)); + memset(p + szchanges, 0, incr * sizeof(*p)); d23 = p; - p = reallocarray(de, newsz, sizeof(struct diff)); + p = reallocarray(de, newsz, sizeof(*p)); if (p == NULL) err(1, NULL); - memset(p + szchanges, 0, incr * sizeof(struct diff)); + memset(p + szchanges, 0, incr * sizeof(*p)); de = p; - q = reallocarray(overlap, newsz, sizeof(char)); + q = reallocarray(overlap, newsz, 1); if (q == NULL) err(1, NULL); - memset(q + szchanges, 0, incr * sizeof(char)); + memset(q + szchanges, 0, incr * 1); overlap = q; szchanges = newsz; } @@ -919,7 +1021,7 @@ main(int argc, char **argv) if (kq == -1) err(2, "kqueue"); - e = malloc(2 * sizeof(struct kevent)); + e = malloc(2 * sizeof(*e)); if (e == NULL) err(2, "malloc"); @@ -1007,6 +1109,7 @@ main(int argc, char **argv) } nleft -= nke; } + free(e); merge(m, n); return (EXIT_SUCCESS); From nobody Wed Sep 25 17:15:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDNf31Qp1z5XTLT; Wed, 25 Sep 2024 17:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDNf30kGpz4bbQ; Wed, 25 Sep 2024 17:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727284523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YhUiJeRGpweO4E3NAzagit1NDeo/Gw/VwpweyKQy3zM=; b=WkpIvBN2a0n+03TMcG+LTmrNkvgy11hwwq99Tk/g3nIVtxYXLfnG3opeQaPFrq+2VbZ5XS O/YKXLvJKQ+D87Yf4UfK+60i+4VIVSnOvYvUQ11J9g0d+jFiLi9dNYDMK+xKJrxCi8IgCE 3kVztUL/z+Cw0mjaWdZYA+zhIsnVaaba533AojBhATApuBsYttzt8y2Imk4CM7t0IQx1Ni RKr3/MxmwJynBzWB40nu2QeNnWo3mLpv0/PMSwHVEwGwCU2BaM8FWhjR89xXG+AGFjEwZ4 G3O4azSX6yrO2J+Xlx9RV+GtidBxd3BQOdlpNsQAIiXTYN8Smps3TMZwuuZnKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727284523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YhUiJeRGpweO4E3NAzagit1NDeo/Gw/VwpweyKQy3zM=; b=XOUD4eSBTHJmE/P9nl048BBOpQOVddEG17PfKBESnS9mHrfibtpjmxG9C+3wCIZhJELWwT fxvooeeMgL9HPtHHOWaN6/Gq/gQDpaho7yb6B9/QEY5ftryHVM++HUxvl9qGYtpkc3ohnC tW2aKr/inUbiI8/10ZIKt7danET1/R+MN7v7cA3dXgt/bC263r74GsH5t5DtDs3F75gwvv hlLmfAAtJRtgYbEnh35RojkE7Wf7HcTCUn/lsekbSWeXycYcdkulzc8h2LmgLHmQj01sMr cPf9kAGhBIaeTrKjl8ejhSj/QgNL2eyR0kV24zluzlo2btLnH+J9T0iB8noKZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727284523; a=rsa-sha256; cv=none; b=NSfzcSFEUzLoY9E9okgsmIlxZbf6znwrgPGFdumE/Q6qEPUamSFDuEfpORcw1s7JDybvBU i9T626VvK0ldjUNT8n2bBWDLpg2IcsdmgJoZ5+YCzA26fxEdiMDxAxHB2LWtZ9uaoc7R29 HO0iMxVir98fA6SYNY/WtK+ifbk33DUPSqhPDW02G6eAOFjEeWB66DKsfWBJNs4K7fxIWc jMbFIxmJWSc4crgJ4pOwlYPOOZLTNoYrIOqVvWnANp2d4+cg7u4zONRSiBe/ruSp0ag0Ni c1djytlLsO00AnW9Cs7U9pXRKf1mdMva7xtBurHZVE0dqZ0y9xipvavzW8d+yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDNf30Kq3zLVx; Wed, 25 Sep 2024 17:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PHFMMJ047315; Wed, 25 Sep 2024 17:15:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PHFMnQ047312; Wed, 25 Sep 2024 17:15:22 GMT (envelope-from git) Date: Wed, 25 Sep 2024 17:15:22 GMT Message-Id: <202409251715.48PHFMnQ047312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d2c2d5f4945a - main - stdio: Disable USE_XPRINTF envar. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2c2d5f4945a2bf5b03494fb292c9c6a6099241d Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c2d5f4945a2bf5b03494fb292c9c6a6099241d commit d2c2d5f4945a2bf5b03494fb292c9c6a6099241d Author: Dag-Erling Smørgrav AuthorDate: 2024-09-25 17:14:36 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-25 17:14:55 +0000 stdio: Disable USE_XPRINTF envar. As xprintf has not kept up with our standard printf(3) implementation, it is becoming increasingly dangerous to continue to allow it to take over if USE_XPRINTF is defined. Remove that code, while still allowing applications which know about xprintf to select it. Reviewed by: phk Differential Revision: https://reviews.freebsd.org/D46765 --- lib/libc/stdio/vfprintf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 99ed11c6cb1d..785340ab2a24 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -450,8 +450,6 @@ __vfprintf(FILE *fp, locale_t locale, int serrno, const char *fmt0, va_list ap) val = GETARG (int); \ } - if (__use_xprintf == 0 && getenv("USE_XPRINTF")) - __use_xprintf = 1; if (__use_xprintf > 0) return (__xvprintf(fp, fmt0, ap)); From nobody Wed Sep 25 20:34:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDSxP4dM5z5XgFC for ; Wed, 25 Sep 2024 20:28:57 +0000 (UTC) (envelope-from a.munoz3327@gmail.com) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDSxN3KzKz54X7 for ; Wed, 25 Sep 2024 20:28:56 +0000 (UTC) (envelope-from a.munoz3327@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Vq1oNKxg; spf=pass (mx1.freebsd.org: domain of a.munoz3327@gmail.com designates 2a00:1450:4864:20::62d as permitted sender) smtp.mailfrom=a.munoz3327@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a8d2daa2262so29191766b.1 for ; Wed, 25 Sep 2024 13:28:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727296135; x=1727900935; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YMyY/nK1z9b/96HL9Na1B/2RZetlvykHGWV7m0XVa0c=; b=Vq1oNKxgR2VbvtkuSiF1N+W+xhdAcF+oir7895sTFCbkNZzjX/NFEgUZbd/RI/1l4t pXjCKMsgtVdu9sinddWUdApMs4yRWV2k++TJ4p0UIEOhbJv/RtfrXmCtAUG6cMYYCo5b m8tehLpEjvkkQ9SP294fMXmJMxd++Hg2wgyaUr1YibblAHi6gmNb0CIHgyKz/4VC37HO LLnm+NFzqG9Q4U8YH5ff87w+nZ8w/uYsbef5R+sR7NxI+C3wCRQzngw9aRzrmNYN2SaK Qv0FtxCyCuQ9rGizFZTVwweVf35RJ94ytUZUd9S8bqkB2bzVm6x5l+gQYSerkJwfPK85 zn+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727296135; x=1727900935; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YMyY/nK1z9b/96HL9Na1B/2RZetlvykHGWV7m0XVa0c=; b=kBdF2XuaC8vrhp3VAdI54Rfj8QqwSY4Fl/Nz1vm+FDPmlY713SZ2bf5Ka4/vzzT5wj CX1dvHPJjyXPshFXDE5+7yNFExw3rwmDwjdMf5AmR9nDGHa4Q9QbDXSLT7g6ZCLHNpuz haHpVYopE21YwS3iU2NikCfyc/PSTYd2QRwrWELekTjvsUFJOx404ua0u3caTIp16gic 6ehISdWGWZL/eFCF6/y9JZpAED71OXKbTB8TJqlmoNXCEql21i5pF0wtLMYD/VoIXrZc 5jqt/P5rlLfID8o1c7Mo9pOnGglC5Akf1GdwWsFV4e2irvtnjngVL+DveW9To/wWBHdB s5eA== X-Forwarded-Encrypted: i=1; AJvYcCWRwt0iYP/YzYyAtbDpvkOpuAe3NqmMGK9sZJ0d8jFLV+ruVsnp/Y8dHhDRlftVIjDIDNTaRMAj4SCRiRaqxcIiLWpzMg==@freebsd.org X-Gm-Message-State: AOJu0YzjBqgdLOe7Xq4TphE7xA/O3ObNHxHEWzYvLCxc/JfJqnd6sAYd WJZctXozR6LzohRlLzrPdBrIxmLhtXegeKxRRUQRaf7a3IhPtmUFMMCEfDs9R1o7QyAuR8dd/wd 4T8t/4C8CGVAqBoEsEJ6c/BW9IOc= X-Google-Smtp-Source: AGHT+IHPOrvj8FF5Ii2TzBRjsKiyUDSJCqhVlLzJkMU/HufEZpkQc1hF23EP2ySqPAkOQZW7DLairv9igo2GgiZTNto= X-Received: by 2002:a17:907:d587:b0:a8d:439d:5c3c with SMTP id a640c23a62f3a-a93a0320878mr384420466b.8.1727296135246; Wed, 25 Sep 2024 13:28:55 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <1B971CC2-DD1F-488B-A80B-98EF29256D50.ref@yahoo.com> <1B971CC2-DD1F-488B-A80B-98EF29256D50@yahoo.com> In-Reply-To: From: Ayrton Munoz Date: Wed, 25 Sep 2024 16:34:58 -0400 Message-ID: Subject: Re: git: 85918beb387f - main - intrng: Add support for multiple interrupt roots To: Warner Losh Cc: Mark Millard , "" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.77 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.77)[-0.774]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[gmail.com]; FREEMAIL_CC(0.00)[yahoo.com,freebsd.org]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62d:from]; RCVD_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4XDSxN3KzKz54X7 X-Spamd-Bar: --- Warner and mmel just got to the PR before I got a chance to address a few tiny nits but what got committed is fine with me. Thanks for double checking Mark! On Sun, Sep 22, 2024 at 2:19=E2=80=AFPM Warner Losh wrote: > > > > On Sun, Sep 22, 2024, 7:01=E2=80=AFPM Mark Millard wr= ote: >> >> From: Warner Losh wrote on >> Date: Sun, 22 Sep 2024 13:19:21 UTC : >> >> > The branch main has been updated by imp: >> > >> > URL: https://cgit.FreeBSD.org/src/commit/?id=3D85918beb387f179abc93a6c= 613801fb9761ff1e2 >> > >> > commit 85918beb387f179abc93a6c613801fb9761ff1e2 >> > Author: Ayrton Munoz >> > AuthorDate: 2024-07-21 18:10:20 +0000 >> > Commit: Warner Losh >> > CommitDate: 2024-09-22 13:18:34 +0000 >> > >> > intrng: Add support for multiple interrupt roots >> > >> > Different types of interrupts may require using different exception >> > vectors so this commit adds support multiple interrupt roots to handle >> > these cases. Archs may opt-in to multiple interrupt roots by defining >> > INTR_ROOT_NUM as the number of roots in their intr.h. Based off >> > https://reviews.freebsd.org/D40161. >> > >> > Signed-off-by: Ayrton Munoz >> > Co-authored-by: Kyle Evans >> > Co-authored-by: Andrew Turner >> > Reviewed-by: imp,mmel,mhorne >> > Pull-Request: https://github.com/freebsd/freebsd-src/pull/1363 >> . . . >> > +/* >> > + * Archs may define multiple roots with INTR_ROOT_NUM to support diff= erent kinds >> > + * of interrupts (e.g. arm64 FIQs which use a different exception vec= tor than >> > + * IRQs). >> > + */ >> > +#if !defined(INTR_ROOT_NUM) >> > +#define INTR_ROOT_NUM 1 >> > +#endif >> > + >> >> . . . >> >> When I was reading the: >> >> https://github.com/freebsd/freebsd-src/pull/1363 >> >> conversation I saw: >> >> -#define INTR_ROOT_NUM 2 >> +#define INTR_ROOT_COUNT 2 >> >> and related discussion with 2 thumbs up, including one by ayrtonm. >> >> A similar point goes for: >> >> -void *arg, uint32_t rootnum) >> +void *arg, uint32_t roottype) >> >> with another ayrtonm thumbs up at the end. (I've not checked >> if there are more distinctions.) >> >> Such leaves me wondering if what was committed was actually >> the final intended code: Is it? > > > I thought it was... If we need a fllowup, i can do that... > > Warner > >> =3D=3D=3D >> Mark Millard >> marklmi at yahoo.com >> From nobody Wed Sep 25 20:32:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDT1B4dBMz5Xgm3 for ; Wed, 25 Sep 2024 20:32:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDT195LYtz55MN for ; Wed, 25 Sep 2024 20:32:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=bHyFDkJu; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::102c) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2db89fb53f9so232668a91.3 for ; Wed, 25 Sep 2024 13:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727296332; x=1727901132; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qVkFRTJmV+iAZaxCJrOU9ZNx+wHe6P7z4v1yLX93zV0=; b=bHyFDkJu62duRGATSpYzQ1TeLrTj62W+SKWQSyUPgGUs1tUkXYImdK8/XiBCJogSqd y9d5vWqeW0qsf8ym3Zi59x4Q7Aq3tt20Q6aPzpE8UJFzGWO/RxOi0bnDE4zvY8l7+paj eCiMYLRFFQ5et9cJe8x5Zi742Dth5hpVpgrfUp0mfklpJKeslT88ERVtYJGQ8ndpEG4D ABYAoCY0r6hf8zt3ekJUouOz0twpV115mn5UYSZFjIgWnLWKA4puQn8i4Goo37Ex2syo X0bGnaKiUyFZNvfKz6ZtKk7vSNc+PUapwSJTro8BWexfx8bsT7HdUUZAbJLFCIy+3PCX qC2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727296332; x=1727901132; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qVkFRTJmV+iAZaxCJrOU9ZNx+wHe6P7z4v1yLX93zV0=; b=sKLK+b9ftaIv4lgpOpxrN6Rv6YEH3Wz8cmnjJ9T5eRX4aD0XdKMBJkjZU4IyPPIxDP yjwHk0UxconG7RZwJcfiGHkap1L/2Xd1IANr47ViLYvX1wCa+/yE5IlsqZtJO5xGHmYx SntOlRnYKFDiBOYQU7+M+lIZoPhIsosYW5aJw8HeAkCuUyhxf9nR1RcSi4CPgEA2bFlb 4zHMfeHzb8x6fk6Uk/XLwoeqiaRIaOxyGdLuYbym25wuC8dJJuqZ8JIEWZmB1ez5AUPP 8rdHE1Vhg7Ei7rMywO3IRbHCb/j6SqLGQh8HsjDRMpDgUPG9nAF8HVc2kPhjm7gOq716 JrOA== X-Forwarded-Encrypted: i=1; AJvYcCUrOq/38rFeWgU+dTnUMsvwQsoM3MN+87X6YuVr5BhdPHZySGgWQ+UGAeAQ8IkvgilSX5FqNcDNprx5BbsfZfGjuzyh1g==@freebsd.org X-Gm-Message-State: AOJu0YzycsjkQ+PZlb4o1ye7jY7PH+biuiy4PAxYxlhcUWk/oJTLaZ9y 2eFFcfiKSHtcEte9vqNMgwXjXV8HJ9Ii4bEVEquLAI/d1UE6sZQKVpIJHtChB5I7m34TXU+AzQI zCm36OBjf+syLMJocIVTPf9XPwbLrYqPR0Pce8hUBmqTYR+RK X-Google-Smtp-Source: AGHT+IEYNnSyu8bCiZxE1z8EtaHQPnEfRIuNpkGtJai56/eHX1jvcDFYIOK4Sc3w+iHGA89uyj3pFfaS4V3z6JTjVjw= X-Received: by 2002:a17:90b:890:b0:2e0:77aa:fecf with SMTP id 98e67ed59e1d1-2e077aaffa5mr2598602a91.41.1727296332359; Wed, 25 Sep 2024 13:32:12 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <1B971CC2-DD1F-488B-A80B-98EF29256D50.ref@yahoo.com> <1B971CC2-DD1F-488B-A80B-98EF29256D50@yahoo.com> In-Reply-To: From: Warner Losh Date: Wed, 25 Sep 2024 14:32:00 -0600 Message-ID: Subject: Re: git: 85918beb387f - main - intrng: Add support for multiple interrupt roots To: Ayrton Munoz Cc: Mark Millard , "" Content-Type: multipart/alternative; boundary="0000000000005008030622f7845b" X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.996]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+]; TO_DN_ALL(0.00)[]; FREEMAIL_CC(0.00)[yahoo.com,freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::102c:from] X-Rspamd-Queue-Id: 4XDT195LYtz55MN X-Spamd-Bar: -- --0000000000005008030622f7845b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If there are any tweaks, we can do those. It will be way easier than the initial push. But if not, that's fine too. Warner On Wed, Sep 25, 2024, 2:28=E2=80=AFPM Ayrton Munoz = wrote: > Warner and mmel just got to the PR before I got a chance to address a > few tiny nits but what got committed is fine with me. Thanks for > double checking Mark! > > > On Sun, Sep 22, 2024 at 2:19=E2=80=AFPM Warner Losh wrot= e: > > > > > > > > On Sun, Sep 22, 2024, 7:01=E2=80=AFPM Mark Millard = wrote: > >> > >> From: Warner Losh wrote on > >> Date: Sun, 22 Sep 2024 13:19:21 UTC : > >> > >> > The branch main has been updated by imp: > >> > > >> > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D85918beb387f179abc93a6c613801fb= 9761ff1e2 > >> > > >> > commit 85918beb387f179abc93a6c613801fb9761ff1e2 > >> > Author: Ayrton Munoz > >> > AuthorDate: 2024-07-21 18:10:20 +0000 > >> > Commit: Warner Losh > >> > CommitDate: 2024-09-22 13:18:34 +0000 > >> > > >> > intrng: Add support for multiple interrupt roots > >> > > >> > Different types of interrupts may require using different exception > >> > vectors so this commit adds support multiple interrupt roots to hand= le > >> > these cases. Archs may opt-in to multiple interrupt roots by definin= g > >> > INTR_ROOT_NUM as the number of roots in their intr.h. Based off > >> > https://reviews.freebsd.org/D40161. > >> > > >> > Signed-off-by: Ayrton Munoz > >> > Co-authored-by: Kyle Evans > >> > Co-authored-by: Andrew Turner > >> > Reviewed-by: imp,mmel,mhorne > >> > Pull-Request: https://github.com/freebsd/freebsd-src/pull/1363 > >> . . . > >> > +/* > >> > + * Archs may define multiple roots with INTR_ROOT_NUM to support > different kinds > >> > + * of interrupts (e.g. arm64 FIQs which use a different exception > vector than > >> > + * IRQs). > >> > + */ > >> > +#if !defined(INTR_ROOT_NUM) > >> > +#define INTR_ROOT_NUM 1 > >> > +#endif > >> > + > >> > >> . . . > >> > >> When I was reading the: > >> > >> https://github.com/freebsd/freebsd-src/pull/1363 > >> > >> conversation I saw: > >> > >> -#define INTR_ROOT_NUM 2 > >> +#define INTR_ROOT_COUNT 2 > >> > >> and related discussion with 2 thumbs up, including one by ayrtonm. > >> > >> A similar point goes for: > >> > >> -void *arg, uint32_t rootnum) > >> +void *arg, uint32_t roottype) > >> > >> with another ayrtonm thumbs up at the end. (I've not checked > >> if there are more distinctions.) > >> > >> Such leaves me wondering if what was committed was actually > >> the final intended code: Is it? > > > > > > I thought it was... If we need a fllowup, i can do that... > > > > Warner > > > >> =3D=3D=3D > >> Mark Millard > >> marklmi at yahoo.com > >> > --0000000000005008030622f7845b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If there are any tweaks, we can do those. It will be way = easier than the initial push. But if not, that's=C2=A0fine too.

Warner=C2=A0

On Wed, Sep 25, 202= 4, 2:28=E2=80=AFPM Ayrton Munoz <a.munoz3327@gmail.com> wrote:
Warner and mmel just got to the PR before I got a chance to address a few tiny nits but what got committed is fine with me. Thanks for
double checking Mark!


On Sun, Sep 22, 2024 at 2:19=E2=80=AFPM Warner Losh <imp@bsdimp.com> = wrote:
>
>
>
> On Sun, Sep 22, 2024, 7:01=E2=80=AFPM Mark Millard <marklmi@yahoo.co= m> wrote:
>>
>> From: Warner Losh <imp_at_FreeBSD.org> wrote on
>> Date: Sun, 22 Sep 2024 13:19:21 UTC :
>>
>> > The branch main has been updated by imp:
>> >
>> > URL: https://cgit.FreeBSD.org/src/commit/?id=3D85918beb387f179abc93a= 6c613801fb9761ff1e2
>> >
>> > commit 85918beb387f179abc93a6c613801fb9761ff1e2
>> > Author: Ayrton Munoz <a.munoz3327@gmail.com>
>> > AuthorDate: 2024-07-21 18:10:20 +0000
>> > Commit: Warner Losh <imp@FreeBSD.org>
>> > CommitDate: 2024-09-22 13:18:34 +0000
>> >
>> > intrng: Add support for multiple interrupt roots
>> >
>> > Different types of interrupts may require using different exc= eption
>> > vectors so this commit adds support multiple interrupt roots = to handle
>> > these cases. Archs may opt-in to multiple interrupt roots by = defining
>> > INTR_ROOT_NUM as the number of roots in their intr.h. Based o= ff
>> > https://reviews.freebsd.org/D40161. >> >
>> > Signed-off-by: Ayrton Munoz <a.munoz3327@gmail.com&= gt;
>> > Co-authored-by: Kyle Evans <kevans@FreeBSD.org>
>> > Co-authored-by: Andrew Turner <andrew@FreeBSD.org>
>> > Reviewed-by: imp,mmel,mhorne
>> > Pull-Request: https://githu= b.com/freebsd/freebsd-src/pull/1363
>> . . .
>> > +/*
>> > + * Archs may define multiple roots with INTR_ROOT_NUM to sup= port different kinds
>> > + * of interrupts (e.g. arm64 FIQs which use a different exce= ption vector than
>> > + * IRQs).
>> > + */
>> > +#if !defined(INTR_ROOT_NUM)
>> > +#define INTR_ROOT_NUM 1
>> > +#endif
>> > +
>>
>> . . .
>>
>> When I was reading the:
>>
>> https://github.com/freebsd/fre= ebsd-src/pull/1363
>>
>> conversation I saw:
>>
>> -#define INTR_ROOT_NUM 2
>> +#define INTR_ROOT_COUNT 2
>>
>> and related discussion with 2 thumbs up, including one by ayrtonm.=
>>
>> A similar point goes for:
>>
>> -void *arg, uint32_t rootnum)
>> +void *arg, uint32_t roottype)
>>
>> with another ayrtonm thumbs up at the end. (I've not checked >> if there are more distinctions.)
>>
>> Such leaves me wondering if what was committed was actually
>> the final intended code: Is it?
>
>
> I thought it was... If we need a fllowup, i can do that...
>
> Warner
>
>> =3D=3D=3D
>> Mark Millard
>> marklmi at yahoo.com
>>
--0000000000005008030622f7845b-- From nobody Wed Sep 25 20:34:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDT3V4YmKz5XgGH; Wed, 25 Sep 2024 20:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDT3V3yqTz5686; Wed, 25 Sep 2024 20:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727296454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7OGYwGNx8vcgeIFfc3a7nGye5Peyo4Lyovy4yC+ODR0=; b=E4ggzspi94v5DrAImHN2qxkg0cafQ6zDKimAkgA8t+jZQ+LgrzC3XCMQEeVDruTAKrxQCy 49WJijA1RYEkbIsMC3LnnOY1lodKgl3kPKq5ynAKKdGfVgC5d4jpmNdkw1Ars5LooEPKrK Ujtv0bJ3vLWKEW/5aHs63QPr5xz2zn4MynHSBO7xEcWbTMguIHgPxMrAGAtib4VrHMq2h/ 4NS65bRG/FaYZManS9kYhEKBA0Zs1ra9nqVXwQD2AWBa0t3UyFkjvMKpX/+2kRbn1L5+Jm MO5JMGGQcB9gJjkCxBz2vxAVrAIbb7ddW1XJVxCKqFHtoGLw/9aHLFP4r9/mxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727296454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7OGYwGNx8vcgeIFfc3a7nGye5Peyo4Lyovy4yC+ODR0=; b=SSQceWoZV9c/1SER7lAFTl58rqKYjZQtw2EKnjXmlifTuXHZPBB4IxGhezD+YjPlNIr6of VZV2VErJxHyCuLTQWTwAULgMxABeYhdYoVFDG9vl0EHysKzfHhLrFde0a3agnHZ0nJj2wk Gk8Pix/3z08GmsjeID1lL7a0genBQ8TsCILs1NYs+HHGB5qLC4rzkhR81qjydA1zli+wok dy5ITe+LFDxCsD7fcrx8ep4rXC+Yj5ZvZAyjutxpKtRLPPG6gR0w6obrVNxeX3mX6lOJuR LkFJMNssESq6GPspFKQJVheBwTlU890B6mpIO7lGjHT73/x1uVo4rUyUzubmKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727296454; a=rsa-sha256; cv=none; b=j9iR1KgeU8iqW9KiiF7sRPlmGLec6mLgF/Y5Y9MOx6/ZmedLgN9TbJ7BpgfJ/tB6oiK39O NJxuCeB+eiQDtC2VGqtmo+sCLPKKtNAM8IdysA5m/KZ+ptMJqN9Pa3peqeQkOZmejo/uEs oyTjNGJYM7xBOthKbP6WXUHeE4Kix52kqeHpzxBzJLXJESHRjVZF88UaXvxGWTgyvWSrPa OdZzAtWQcmXD9hKDW5+0tw+X6dhUrxETRdWwJ5U9xRznjBGpEQmThgdfHvuTSmlfBessQO di5odYzScgpHbV3LKz5Nxjc1B2elRU4dUErgKov89/lgrTmE4enEF91gD1RG6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDT3V3SCqzS8T; Wed, 25 Sep 2024 20:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PKYEEv086471; Wed, 25 Sep 2024 20:34:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PKYEJ7086468; Wed, 25 Sep 2024 20:34:14 GMT (envelope-from git) Date: Wed, 25 Sep 2024 20:34:14 GMT Message-Id: <202409252034.48PKYEJ7086468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 36a001923836 - main - iflib: Simplify iflib_legacy_setup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36a001923836e280e750b76947b8705fcc47b0b7 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=36a001923836e280e750b76947b8705fcc47b0b7 commit 36a001923836e280e750b76947b8705fcc47b0b7 Author: Krzysztof Galazka AuthorDate: 2024-09-25 20:28:52 +0000 Commit: Kevin Bowling CommitDate: 2024-09-25 20:33:34 +0000 iflib: Simplify iflib_legacy_setup Follow the pattern from iflib_irq_alloc_generic function and use iflib_fast_intr as a handler for RX only interrupts. Also remove some intermediate variables and use consistent way for referencing queue's structures. Signed-off-by: Krzysztof Galazka Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46061 --- sys/net/iflib.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 9df01edc14d6..a2e2c3efa1ad 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -6424,15 +6424,11 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filter, void *filter_arg, int * device_t dev; struct grouptask *gtask; struct resource *res; - struct taskqgroup *tqg; - void *q; int err, tqrid; bool rx_only; - q = &ctx->ifc_rxqs[0]; - info = &rxq[0].ifr_filter_info; - gtask = &rxq[0].ifr_task; - tqg = qgroup_if_io_tqg; + info = &rxq->ifr_filter_info; + gtask = &rxq->ifr_task; tqrid = *rid; rx_only = (ctx->ifc_sctx->isc_flags & IFLIB_SINGLE_IRQ_RX_ONLY) != 0; @@ -6440,17 +6436,17 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filter, void *filter_arg, int * info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; - info->ifi_ctx = rx_only ? ctx : q; + info->ifi_ctx = rxq; dev = ctx->ifc_dev; /* We allocate a single interrupt resource */ - err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr_ctx : + err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr : iflib_fast_intr_rxtx, NULL, info, name); if (err != 0) return (err); - NET_GROUPTASK_INIT(gtask, 0, _task_fn_rx, q); + NET_GROUPTASK_INIT(gtask, 0, _task_fn_rx, rxq); res = irq->ii_res; - taskqgroup_attach(tqg, gtask, q, dev, res, name); + taskqgroup_attach(qgroup_if_io_tqg, gtask, rxq, dev, res, name); GROUPTASK_INIT(&txq->ift_task, 0, _task_fn_tx, txq); taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, dev, res, From nobody Wed Sep 25 22:19:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDWNc6f9Pz5XmvN; Wed, 25 Sep 2024 22:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDWNc68jDz42lk; Wed, 25 Sep 2024 22:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727302752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yaRhOe1USNyvSMsQNAVDESb/MZx2VgPsn5aDl1h4kio=; b=hr8nsdrtTTeKvbgkL40dFyx9WVw/Dq0W77talhP2de0x+7RodYQZNninDPjA6MRC1vRIoP Mk3aFFDyX3w90o0S8BGq+xuslIg80QI8aZH7OvasbZQlPwoLyIKc82aNeYCME1QywyNbwh 7uKcpzOm6WOflhUit6R1u1baFR619lqTJDcG+oLRtzjBvSJqT1IANAIIfh2N+5Rekplzqm sn/zI2IvNvGMynVBG+uStGJYIvxFM4v8pyhmysqKQ4U4Yzk4vK/WQtO9eTePQLXtCtvYGB 7/KbyJ7pZjrzAddSWrXQOhOeNUldhGMJz8npmycSn7kcszShvpiBwN01rIN2Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727302752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yaRhOe1USNyvSMsQNAVDESb/MZx2VgPsn5aDl1h4kio=; b=Lh8hVH153Ba4o+BtsWnbXuidB7ETpiwww0VLQ2lZdSMNcPiSM8ID7riRMedvwzjapkgYZk uOdc8vjdeEBQP4KiBI7u3HETAn2CxcHiE+lvF1NUTE8FsN2FeEVVvGvvtd50SQLDnCqhii PS8ycecsh9N8w77nabtV6c0OWWwLEdPldGshY1kthIMSeMlsqzK2PB1+FPTVQ38gvRaCKK 6GbBudUa0+L2PHLSSzIYv06E8PNLN/oR1GM+dfclLy+D5RXSPWCwQS1VvCbVXVmrstqQce 0CaqOKUOhAkMEiRgKOWX5xgFonvZgfwD4GUhbSTxrKCX1OYV2NwW5hVH4Q4+Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727302752; a=rsa-sha256; cv=none; b=XtmkoTWaYgLjIX68OXnEvCUD6jlfSeN/SbvtOS6cTKwE3KHSAL0OdUJKVP1knCEvly1bg5 9RhR8ZsAxRL376+J9J7jVIP6QYnau56sm2xxYh1uwxI7Za8Mf6US1tJuwC5XAOumrpQrsx MtAA57C3jQMPaJYW5S2sSnnv8JD6vGRBGRVfpm/n5g+5w5QAC/EHWsGI4EMv+fhEiMWn+3 28+ejyGp6ItgzVeQGqmotmxuFmiBi1tq05SpaTLkTcvfGKjlTD+mT9/hQA5mPtNuXZux49 6whwr6cB6C8ZmK4hC59r5UPW+PGNUjKzIOSPPGmMId2CfmKzCkkaSpC2CsyJGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDWNc4sDszWJN; Wed, 25 Sep 2024 22:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48PMJCIS057167; Wed, 25 Sep 2024 22:19:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PMJCP9057164; Wed, 25 Sep 2024 22:19:12 GMT (envelope-from git) Date: Wed, 25 Sep 2024 22:19:12 GMT Message-Id: <202409252219.48PMJCP9057164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 6a4f0c063718 - main - pci_iov: Add a device_printf if out of bus numbers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a4f0c063718781c5e3eddbeff0da7b89d290d1e Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=6a4f0c063718781c5e3eddbeff0da7b89d290d1e commit 6a4f0c063718781c5e3eddbeff0da7b89d290d1e Author: Val Packett AuthorDate: 2024-09-25 22:17:16 +0000 Commit: Kevin Bowling CommitDate: 2024-09-25 22:17:16 +0000 pci_iov: Add a device_printf if out of bus numbers Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20591 --- sys/dev/pci/pci_iov.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 1f1138b2d336..31bbb74e791f 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -736,6 +736,7 @@ pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg) /* We don't yet support allocating extra bus numbers for VFs. */ if (pci_get_bus(dev) != PCI_RID2BUS(last_rid)) { + device_printf(dev, "not enough PCIe bus numbers for VFs\n"); error = ENOSPC; goto out; } From nobody Thu Sep 26 01:12:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDbDV4vH7z5XyXF; Thu, 26 Sep 2024 01:12:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDbDV4GSZz4Jm7; Thu, 26 Sep 2024 01:12:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727313146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rd7oYLUz4hqVVa181sz26Y+VyywRvKXOPJwhQDg3kY8=; b=t790uoPYWCkbpOdtAcaByBWsAwLJt7Tttj83wZvhsLuR6plaSp6BVrGEgAiouJH+ytwk3S JN+bRUewKShcUuL7sGILlbJ31cinLLfWVDRWTxMYK/fLsy6c1LMuZxCfCM2oQ+iSjMrYkI uljPoMNfTU4CfR171Oi5d0biV1EiCK+WVn4W0r0sIQJ3Xsq4IYkKFqy/nRDwssN33SCWki uKuKXcVhSLjG2jM/aY2U6Ivz5MJ+m18aLHCs+l4tIZqTmP2jhzFd2uMRWzotnKsZiVr206 YYMI5zCOAk83TrbrXoNB3iK6RqiuUPE/RSX/XqkRgVPdkBNrIjnaDhwo6QYwUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727313146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rd7oYLUz4hqVVa181sz26Y+VyywRvKXOPJwhQDg3kY8=; b=IHNyLJr9bcU4RMjm86LAoOKbh4zPCnNN5/d1uLELa6GeljiK9A4iZAVBpAAtgV/qGx3Lmu 2PdcZfVKYfIjkbRD9D9yGUvLqLbhqPL6VdWZlLHAHxHEvWxXDiJaUIvx+6Pj1Qr9K9DVOq SBBCapH0ZqUuc1grkNkKqBu8hsFhPQLEIlnTEdYOCfbGyR0T6i4TPSRIaAKjiECdX/m6Hn iAaPODt0ysxf8WOrvCeWU9ocRMGh98IlD92ArqNntNsd2tG1b2qS6eTcnBJ+QCvA7lN1X1 dn9zFDJ2wzsDye8z/nkaws6HDHxwf5CUhzLAGk/jNPjANe9tNPjJfoZJpaxZBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727313146; a=rsa-sha256; cv=none; b=oMAS6tiNYyZ/SFaucZ2wA35CJGsSsM+1H7ot1d0p6gdPV3VC5o5Hht19yyuyjBCieXKyzR D9Umo4DHhjjvgzOLfCAUC9rqA09PjTHUuma2tPRYkTkfGdIEVtO3+tITTVihqwu189QDFT NdOGhXB6WTT/X0a4Sp3iVyL6xijukBCMxnhfsrNw7sp+Ypqt1V8k+JFwgPMYtUas7EYXo/ Ar41NmU9GOUdmX1kssNa5oI/0oblAkwvg5KdkEHlcLoMMZn0bh7qI8jTiiqZTTrSuk/lPS LPLr6ECoycdQuK5sAOMG6gPWd2m3cae6OCkpQeYULMhxQVHZzKz+zJecx6f5HQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDbDV3tlrzc35; Thu, 26 Sep 2024 01:12:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q1CQmw060877; Thu, 26 Sep 2024 01:12:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q1CQB9060874; Thu, 26 Sep 2024 01:12:26 GMT (envelope-from git) Date: Thu, 26 Sep 2024 01:12:26 GMT Message-Id: <202409260112.48Q1CQB9060874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: aec2ae8b57fc - main - nvmf: Always use xpt_done instead of xpt_done_direct List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aec2ae8b57fc638fa3ba9fac9d2067f2049ab613 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aec2ae8b57fc638fa3ba9fac9d2067f2049ab613 commit aec2ae8b57fc638fa3ba9fac9d2067f2049ab613 Author: John Baldwin AuthorDate: 2024-09-26 01:10:44 +0000 Commit: John Baldwin CommitDate: 2024-09-26 01:10:44 +0000 nvmf: Always use xpt_done instead of xpt_done_direct The last reference on a pending I/O request might be held by an mbuf in the socket buffer. When this mbuf is freed, the I/O request is completed which triggers completion of the CCB. However, this can occur with locks held (e.g. with so_snd locked when the mbuf is freed by sbdrop()) raising a LOR between so_snd and the CAM device lock. Instead, defer CCB completion processing to a thread where locks are not held. Sponsored by: Chelsio Communications --- sys/dev/nvmf/host/nvmf_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvmf/host/nvmf_sim.c b/sys/dev/nvmf/host/nvmf_sim.c index 4bf68553cb49..8850174edf24 100644 --- a/sys/dev/nvmf/host/nvmf_sim.c +++ b/sys/dev/nvmf/host/nvmf_sim.c @@ -58,7 +58,7 @@ nvmf_ccb_done(union ccb *ccb) xpt_done(ccb); } else { ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done_direct(ccb); + xpt_done(ccb); } } From nobody Thu Sep 26 01:15:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDbHw5xZLz5XyZy; Thu, 26 Sep 2024 01:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDbHw5Q0qz4K2m; Thu, 26 Sep 2024 01:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727313324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NbXMsSHjXOF/oS9g7m764L2i7a2oCCZFlNF9Tu9Vo8A=; b=q9UUbNvj4jaBRwUQxfvcmwYwiRy9fsnD7bdtL+jpX2mVs/RYHRvIpDmEkDZZD3r4f/ReEJ ubnDzudnAenddRtGxqK3zflycPAlQkgenrYm0pJjBudL5+LIt3pKVR/qqn3OxF564ga9qF DPWtrDcoeC8Y1NEVHn3o5RJuSjHDEw9MXyCSEthFrCWwSnohk+0rkK3cQ+10Ut2/ENonUk R9p7wsay4tKCZTtJrXZnTKJ7HwMNzMkbPXGWbQiZqmEuynoQpCxRtxyM+Jm+QYMVHDvmne j+KqqSyANN5Y8D5KLDzboBrZNz/RDlM+ol+w+Xfv9OcJKUONYpaN9FEV+1a3Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727313324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NbXMsSHjXOF/oS9g7m764L2i7a2oCCZFlNF9Tu9Vo8A=; b=mId3Wx8GRjq6AQFN6hIOrQfPxyfnOO7moRsz2hTvL+r/dVSCBiLJ12tvSqL+2xiSW5b6V3 O+gQll8Du8uapx0vjJlJFMrbbgOgZ28mqaz2g9sPzeUq92wUb7x4I3qkgpm/KwEU3PW1vo J0/EBUhDMWJZFVEsnCmJwSb5rKM6jSk4+uOzhOZL8kjOare1PP2T4E6VZv7DluFqdYK0b+ sHkcimgLGV+67FqSt1aQA1qzg/UQ66zyaxVRIbUrxS+ttDoy7iciZoUUIfkE4Ot8soNfyV 6G2CYpEruIrjFqIa2W6xqbSRerw1mAjJV3vKQ9YfBO6761l/FU76R8gxhnNycg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727313324; a=rsa-sha256; cv=none; b=g6QJM34Q8clKH01smerP+XDBkPeZDsGd9AYSISqObCu78ZpvEd/fY3jZH++7sTTfXZ0P1/ Igt3jmisFNv+OBSHtlO2ygv7N/izkwpgcqyzJ96nWWcfuwtN4k/T+MYZTiTQ3EY3HfvvG2 BgKPHRLD9OkFcPnq018KyCNbwlu9S78powXjmWyGCCNwhH2mIymaiRayq0uE1U2pznKnWR GGbcEPskmxVMXB1hJxqnbD0HiHPJ5xyb1N6dKlxNkUbw9rAqQ8JSC9zo6qkE8uIL3ZH8HP ftxvBnsKDmPpqOFWwyRxEoDk1i2s21tpue48RDE8EUytDx+HMMVJrCPJrSU3OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDbHw51FXzbby; Thu, 26 Sep 2024 01:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q1FOv6061330; Thu, 26 Sep 2024 01:15:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q1FOHV061327; Thu, 26 Sep 2024 01:15:24 GMT (envelope-from git) Date: Thu, 26 Sep 2024 01:15:24 GMT Message-Id: <202409260115.48Q1FOHV061327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ef052adf09f2 - main - nvmf: Narrow scope of sim lock in nvmf_sim_io List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef052adf09f25a20e694c3375cc7a0edd4cb0a52 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ef052adf09f25a20e694c3375cc7a0edd4cb0a52 commit ef052adf09f25a20e694c3375cc7a0edd4cb0a52 Author: John Baldwin AuthorDate: 2024-09-26 01:14:06 +0000 Commit: John Baldwin CommitDate: 2024-09-26 01:14:06 +0000 nvmf: Narrow scope of sim lock in nvmf_sim_io nvmf_submit_request() handles races with concurrent queue pair destruction (or the queue pair being destroyed between nvmf_allocate_request and nvmf_submit_request), so the lock is not needed here. This avoids holding the lock across transport-specific logic such as queueing mbufs for PDUs to a socket buffer, etc. Holding the lock across nvmf_allocate_request() ensures that the queue pair pointers in the softc are still valid as shutdown attempts will block on the lock before destroying the queue pairs. Sponsored by: Chelsio Communications --- sys/dev/nvmf/host/nvmf_sim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/nvmf/host/nvmf_sim.c b/sys/dev/nvmf/host/nvmf_sim.c index 8850174edf24..de9e958d8afd 100644 --- a/sys/dev/nvmf/host/nvmf_sim.c +++ b/sys/dev/nvmf/host/nvmf_sim.c @@ -125,8 +125,8 @@ nvmf_sim_io(struct nvmf_softc *sc, union ccb *ccb) qp = sc->admin; req = nvmf_allocate_request(qp, &nvmeio->cmd, nvmf_ccb_complete, ccb, M_NOWAIT); + mtx_unlock(&sc->sim_mtx); if (req == NULL) { - mtx_unlock(&sc->sim_mtx); nvmeio->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); return; @@ -150,7 +150,6 @@ nvmf_sim_io(struct nvmf_softc *sc, union ccb *ccb) ("%s: incoming CCB is not in-progress", __func__)); ccb->ccb_h.status |= CAM_SIM_QUEUED; nvmf_submit_request(req); - mtx_unlock(&sc->sim_mtx); } static void From nobody Thu Sep 26 02:07:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDcSF3gnJz5Y2T6; Thu, 26 Sep 2024 02:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDcSF36yNz4P4P; Thu, 26 Sep 2024 02:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727316461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nd9GqNaOWFKuQFW5jDwb0mRx/SUzEkuj99wMzIn9qw0=; b=r7Wh/32+Dn6VRUvpAFBuxy3nK5SDQd/Ae+zxxev9+X7PoMLfXF9cP391jtKl89rxEw3zl6 qqMlvbTwfCp3PWMgPH+ncMWM7IKMr96xmKVC7x8C+3hPgFHW5BdbEnN3hN9Guo+PgeuVSw /tDHvVh1NWIg9n+wpS61yea04XhJJJkrBaw4S5TqG3tnEoRQF4bZD42g49rwdP/xEizdhR GGxpocL/x3HlTKI1wQuvM0eYA4SaVz+a4oVtonksLV+q2mFCQNVZ+2hj3RGILkNQ45Opjp oEPmbI0pFHwJV1an2lCMjp5bDdptRUZb9hcAvgOamGfs4R7P0P0Ohh9iXx1VIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727316461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nd9GqNaOWFKuQFW5jDwb0mRx/SUzEkuj99wMzIn9qw0=; b=GM923Ax1QKOPHw2Bm4l9S0SenMEyDXW/7Bia2xmD/MkFxc8QSvPt/ggB7QpO0/s62RO2zB eN4k4UqEWhtGA9MlrRO/Z2jDoAbRv2hCkkU6fggfiG81Fq0iVpqfhyGXscIUXrQxk9fgrT +lUyBgKG716Qh/j95qdPJwAcuv+5BN5SioZRF7+11y6rQF0aPibn1NYaR6l8iNwtuvZPJH j4vkoC1rGJb9K52mIuT/HFrAzvJkWPSUgRh/evkOY6p7HImLFPSEpiVyK4aQexHRtu/YDp MNXt7wTFJk9KWl9eH0Sasxe+6+HDJuRXaXKpO/gQQjuiMZMpEv5k35YPbOarQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727316461; a=rsa-sha256; cv=none; b=s6NemQUw4fXSvyjNdv6q0LChN0PGTKW5A7ezo2zpsXeKJg869WXndX0El7JmxM8eDFIBGr aDpgbJ/1KbjPaJrBuVmq8GBj5lO9dn2i3UeCcw9MnilJ/7Lv2p1zsmDWHSriPe4n3wFHV3 zegq/W4be4VDzKtsbXDMxWMqEUj4OEBlMNLQMDT9mSNIj81k9aG12j9jxuWscNpqNayvKa pnbuE8AqkYqddHEeHXNCqEBXBK4eAoYm4tml6g+Ovbh9D88Z0JfkzM5BNaHqaJumVhl6+O NLpcar8U6u7InHRwgjKPGcQ+h905aJSxLVntspGJGZ7hkJbkOf2QB7q+TG+7Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDcSF2NVlzdKY; Thu, 26 Sep 2024 02:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q27fKF045613; Thu, 26 Sep 2024 02:07:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q27fmE045610; Thu, 26 Sep 2024 02:07:41 GMT (envelope-from git) Date: Thu, 26 Sep 2024 02:07:41 GMT Message-Id: <202409260207.48Q27fmE045610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Greg Lehey Subject: git: b7b7800043e1 - main - Explain the relationship between -p and -Z. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grog X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7b7800043e1dbef65aa9116822010f1a6074f0f Auto-Submitted: auto-generated The branch main has been updated by grog: URL: https://cgit.FreeBSD.org/src/commit/?id=b7b7800043e1dbef65aa9116822010f1a6074f0f commit b7b7800043e1dbef65aa9116822010f1a6074f0f Author: Greg Lehey AuthorDate: 2024-09-26 02:07:02 +0000 Commit: Greg Lehey CommitDate: 2024-09-26 02:07:02 +0000 Explain the relationship between -p and -Z. --- usr.sbin/makefs/makefs.8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index 4601e6278046..fdcb94cc4dd0 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -214,7 +214,9 @@ is a comma separated list of options. Valid file system specific options are detailed below. .It Fl p Deprecated. -See the +Create a sparse file for +.Sy ffs . +This is the same as the preferred .Fl Z flag. .It Fl R Ar roundup-size From nobody Thu Sep 26 06:05:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDjkD5wtvz5YGSt; Thu, 26 Sep 2024 06:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDjkD39X8z4m9p; Thu, 26 Sep 2024 06:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727330708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wxwd7zf2doNkHelNqK6yI2Kx8gJ/91by93b2Vqkr6C4=; b=EWyC4YR80UZO+VXVwxbCgk+lF8v/MuUIQu6vna/pcdUB240oRjbpixhL7AUaAPpjOd/AhC lIYIcTwBrPestnYIqpr7KOcqSvdGCPBOUZjwfEZp2F74G/OLPCgUt3QGLyRe1as8t/THwF N2L1Fkbzv/FCYIczdSOqxjgvHXU9b0R1ygNuNu0l8YHDiFvDbTL5nib4xckyt+Uac3kDCY lCfa139s2QisQpszUnxJNP5xXFf5N9wJ/F1+0faLhht4zS24TZWKBld0ipVsRIHB0FxDQT pAyM/jwwfjzPUT368G43AMjMpl+DKaMwQ4ANZimjdKFqYya0QOq3zN2lkhShwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727330708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wxwd7zf2doNkHelNqK6yI2Kx8gJ/91by93b2Vqkr6C4=; b=A/+F5z1IJnNJvqfdXSY+6XtpOaj/+OthVH6gXUqUnDFgB4X2qK/K16m378I+7974Gun7mb 78XhkqbYPlMISKilHrecv0pnfcMV3tZYzALMgKbZwe11QT+LxOIGmTUrLLCuljA75eBS/x y6PCuOVySYYJBPiDanhnaMV52F8t1RAW3DjlfK2k9Q09A6YGU5SuB7L46+hGWvYwbuTKCX c6yHjDXHb4y8/up3UFZiY+YgiYLzvGhrP7r+dZC7UkbmZVbqNkURSDzzuO81+3mP7iwPTX wP+uIRSsgie+UH4i1f7qbNQmlCe0zD2QuMVpLi6FZ1ZAPxLZvf1UUFWkYLzkCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727330708; a=rsa-sha256; cv=none; b=ZQYr41fTuOYsTL3vc0NR5EzyoUvdY85hd9ah00SNFi0vdtqP9QhOInBcZGJ4Hb/EVanmOW S9OYVLI9Km16tfGd0BTbw3QrtGwuxI0CfZjisFyGRWxL1rz48EwileFxSlstKF0bma4Wi/ WIj+YfKMZUQwxOAA3I9EZ6TWAby9SAST6hB8igXHwhaMrq8Dq18TnKS6fW/O1OUKt+PZAu u+yeX4ywE2f+EKxCl3WHp2dkOvhY03swniXlziPEHRx06B/fhZ4QCcnS8fAeEVeE8SrcHw xWdbCp4fiVljWR5AyRzB8GehtstwMvEf8J6ZXC7q1An5CmIcOJWg8N4zV1oAXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDjkD2nXjzlSG; Thu, 26 Sep 2024 06:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q6581D053817; Thu, 26 Sep 2024 06:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q658Gp053814; Thu, 26 Sep 2024 06:05:08 GMT (envelope-from git) Date: Thu, 26 Sep 2024 06:05:08 GMT Message-Id: <202409260605.48Q658Gp053814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3f2792166aee - main - MAC: improve consistency in error handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f2792166aeed4baf07d351bcb12a9d196c443eb Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3f2792166aeed4baf07d351bcb12a9d196c443eb commit 3f2792166aeed4baf07d351bcb12a9d196c443eb Author: Michael Tuexen AuthorDate: 2024-09-26 06:02:06 +0000 Commit: Michael Tuexen CommitDate: 2024-09-26 06:04:54 +0000 MAC: improve consistency in error handling Whenever mac_syncache_init() returns an error, ensure that *label = NULL. This simplifies the error handling by the caller. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46701 --- sys/security/mac/mac_inet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/security/mac/mac_inet.c b/sys/security/mac/mac_inet.c index 29a355071065..9770fa840f95 100644 --- a/sys/security/mac/mac_inet.c +++ b/sys/security/mac/mac_inet.c @@ -485,6 +485,7 @@ mac_syncache_init(struct label **label) MAC_POLICY_PERFORM_NOSLEEP(syncache_destroy_label, *label); mac_labelzone_free(*label); + *label = NULL; } return (error); } else From nobody Thu Sep 26 06:08:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDjpP01KLz5YGlb; Thu, 26 Sep 2024 06:08:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDjpN6Gxnz4mCw; Thu, 26 Sep 2024 06:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727330924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MBuM2URTHhlLjATQUICETvw1Ya6wsSz+xUWJVGxpeyU=; b=LoO3OBcBlcj4v1tll7N6dXmjoZjKaWyyPcZVnGF3r75bay25tUPpa8sitHo2v1/QnYn42A mJO0T4yHxXCMZcGKZ7NsVHDQdPsRAD4mdRAfE16ocWutQ8gHKqW8BfZBTwzeDj8cUngByY vhd6RK+igrpYR4rFxZ/3NU3JPhcLWALldANxUSPubqbCAWgTLYKLDG+pLxgQ5GVx4qOg7z k7fTgGDF4da2byuXsEXdG7rAEXlenZlHzMhltMR5xDgqpaNgeleeX74H9kaD8mQdSzy1Z6 lWn+wsXkTBXPnbj/ThOLg+ZcKfHWRZ5sY6j2yO1kCPIA24Pmg2J10kqIPr1pCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727330924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MBuM2URTHhlLjATQUICETvw1Ya6wsSz+xUWJVGxpeyU=; b=skCuIVPqYDnIVjaAT7BAJjrLeGvldPk/4ajmc+zi2a9FGyXiXtn1byNWbHhH4qHKmVc2vR yvxY1XItKtFkvo0gf2+xQ/mp7VFmHZQkMyo/9P2ukG3v/gWTFSxthR/IBbcpGxznN0Qa42 mH6pI6mzsQzXwwONw29tHCoCzkq7nzUPz9pAEDaIT1BnCsfUSGViUud/aG6gpoi1OIT5vH zVs67Tc/2CQbf+K43ZdhIr6OqWP9tgauALZLNtUpqvxk5eNjJQF5UYCpf6JKyI0ppHQ8qJ aRHnN2Uu5duyUtA+nhaDQCrbW+qBq9w6nc7jhTX3g606fYf0qAOChwNYfKG3ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727330924; a=rsa-sha256; cv=none; b=m4d0dniDDrL2gqWSW4h0LQXJJIDCACx+34KTYfj2lHmudbej3PBAKFiy+nb8sXA/1I7R9I VSJbGChNjoG9CzsBJFL8Q9mSSmQPjxV/DzHLlkPzgj53UENX/EK55yx29Yn1NezjmUw//P 4amORXTB83uEKzc+fa37ImEuJt3zUwYEMyo7L5oStTkFiuR8gCfbDJ4L32rtISemdTaNVm rSyEFzPluN8ZI7I+pP9Ld+3nHcIK7HSU+Rv4yQ6uWGhFMOMCRVF+sNsJ3uUJyhBwwrjJkP Ravq9nk0PshF97yNdmrbeESvZawfr4bOcZelUMlh3N4aO0cCWNaEvpUrjSKcqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDjpN5sjnzlSK; Thu, 26 Sep 2024 06:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q68ihA054406; Thu, 26 Sep 2024 06:08:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q68iSB054403; Thu, 26 Sep 2024 06:08:44 GMT (envelope-from git) Date: Thu, 26 Sep 2024 06:08:44 GMT Message-Id: <202409260608.48Q68iSB054403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 2fb778fab893 - main - MAC: improve handling of listening sockets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fb778fab893b4a8a86ecfa20acf2e23bb2cdae8 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2fb778fab893b4a8a86ecfa20acf2e23bb2cdae8 commit 2fb778fab893b4a8a86ecfa20acf2e23bb2cdae8 Author: Michael Tuexen AuthorDate: 2024-09-26 06:06:24 +0000 Commit: Michael Tuexen CommitDate: 2024-09-26 06:06:24 +0000 MAC: improve handling of listening sockets so_peerlabel can only be used when the socket is not listening. Reviewed by: markj MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46755 --- sys/kern/uipc_socket.c | 5 +++++ sys/security/mac/mac_internal.h | 1 + sys/security/mac/mac_socket.c | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index e83422e3a29f..189e8ca5b498 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -153,6 +153,7 @@ #include #include +#include #include @@ -1485,6 +1486,10 @@ solisten_proto(struct socket *so, int backlog) sbrcv_timeo = so->so_rcv.sb_timeo; sbsnd_timeo = so->so_snd.sb_timeo; +#ifdef MAC + mac_socketpeer_label_free(so->so_peerlabel); +#endif + if (!(so->so_proto->pr_flags & PR_SOCKBUF)) { sbdestroy(so, SO_SND); sbdestroy(so, SO_RCV); diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h index aa407598600a..89f74a65c803 100644 --- a/sys/security/mac/mac_internal.h +++ b/sys/security/mac/mac_internal.h @@ -242,6 +242,7 @@ struct label *mac_pipe_label_alloc(void); void mac_pipe_label_free(struct label *label); struct label *mac_socket_label_alloc(int flag); void mac_socket_label_free(struct label *label); +void mac_socketpeer_label_free(struct label *label); struct label *mac_vnode_label_alloc(void); void mac_vnode_label_free(struct label *label); diff --git a/sys/security/mac/mac_socket.c b/sys/security/mac/mac_socket.c index e9f94404734a..b03f98bbfdb5 100644 --- a/sys/security/mac/mac_socket.c +++ b/sys/security/mac/mac_socket.c @@ -170,7 +170,7 @@ mac_socket_label_free(struct label *label) mac_labelzone_free(label); } -static void +void mac_socketpeer_label_free(struct label *label) { @@ -185,8 +185,10 @@ mac_socket_destroy(struct socket *so) if (so->so_label != NULL) { mac_socket_label_free(so->so_label); so->so_label = NULL; - mac_socketpeer_label_free(so->so_peerlabel); - so->so_peerlabel = NULL; + if (!SOLISTENING(so)) { + mac_socketpeer_label_free(so->so_peerlabel); + so->so_peerlabel = NULL; + } } } @@ -618,10 +620,15 @@ mac_getsockopt_peerlabel(struct ucred *cred, struct socket *so, buffer = malloc(mac->m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); intlabel = mac_socket_label_alloc(M_WAITOK); SOCK_LOCK(so); - mac_socket_copy_label(so->so_peerlabel, intlabel); + if (SOLISTENING(so)) + error = EINVAL; + else + mac_socket_copy_label(so->so_peerlabel, intlabel); SOCK_UNLOCK(so); - error = mac_socketpeer_externalize_label(intlabel, elements, buffer, - mac->m_buflen); + if (error == 0) { + error = mac_socketpeer_externalize_label(intlabel, elements, buffer, + mac->m_buflen); + } mac_socket_label_free(intlabel); if (error == 0) error = copyout(buffer, mac->m_string, strlen(buffer)+1); From nobody Thu Sep 26 06:12:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDjtM3pNxz5YH75; Thu, 26 Sep 2024 06:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDjtM1d2qz4msL; Thu, 26 Sep 2024 06:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727331131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzII8kzZfDPg1JdfbfPMZgFoke1pB5zPtOf4Ffww+fg=; b=fYkzoTnz5X6UCXh8pw+aHdyfzcaJHH+D+KJbQq9BwVyofOHxLbHtMTSnKOUPKBA9nCKS/L QwEmGU+W3SdnlFHJRmNrhwDhpaZ+jOHPeeI/tFTvJWhME3DTOdWEZgVCLaGmO1IiSLuwol hUyJOsYFsUC9okfYW+NWl23FEQV9Gj91AvjBnYkQsX6kSgTkzHDHZ7hsIAxfQgd5fCTUPR cvo3ESXrzvc/oQgqZqFlwuG/MGE0CkLFX2W1RJMUscu2o7lwSxtvIGaNCHg1oMk8bQsLLd QxjUYIPoIysKx+CAUxhiMO2GS7vPjze9mK+UCBjoSukCd27PUF/Um5ydkTrGDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727331131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzII8kzZfDPg1JdfbfPMZgFoke1pB5zPtOf4Ffww+fg=; b=qU3M7XxBiiNsyqpzRLH0EAkkN453e9fJ48YlYSOy+4791qVRcVhKobJncHQvXnN0hTVSaO xWgtGtTYYUT491kbpO0YZ108TudCsfuNuIXl1o3NubwH6O/jd6xM2lOG6fWCh9USKSwMK2 2zG8T945BHArBdLuWAE+sodvc4mrcI7wXUB8Z387Yi3WyDWUXoDRESty16d/Kaui9Q87ol rhtKEiTZa5v6BuM5zDqH0fDtLm9ew+TElfIGaZjeZtxqVJHWPHFbaNXqmaXDoYhYnESDB8 0vKRqeEUWn4cOuddBlBtRXEcdr/plHouLyQaJePn9QqpzHKdyify4uQk/yRTlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727331131; a=rsa-sha256; cv=none; b=dJIUzJUkuEY+/Oo7nKL7T4XOyxnzPK9lWz5EXgmRJBfYujA/XTDL+kjgRuEO2AL9i/bm3w xZ1SEpVD6NxaYkUXeJdS55YPKmYu2GD2t30PL+wfjsTXYV5T+t5yK+hN6N2yZPAukabhBL wh+etTCrtfhrqRlJBT1bPZfPmqArATkheVRKybkrbZhcKib/bm5vAfpDLmYI7dZex19/X7 O9yETb6YnY+11q3kFqB5OxF9TvbcyZVty1N3VqDj04z3/InFGeSa+mCxsmylt8DMbaq/Xk 9FT+F/K/OOmrkOSgAWamQPzsK/oGoaZhsP/3w8ghbY7hemuIakW3cQwzVQ/pYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDjtM1DnyzllG; Thu, 26 Sep 2024 06:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q6CBfR066549; Thu, 26 Sep 2024 06:12:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q6CB3V066546; Thu, 26 Sep 2024 06:12:11 GMT (envelope-from git) Date: Thu, 26 Sep 2024 06:12:11 GMT Message-Id: <202409260612.48Q6CB3V066546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 78e1b031d2e8 - main - tcp: improve MAC error handling for SYN segments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78e1b031d2e8ef0e1cbc8874891f5476dc7868bc Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=78e1b031d2e8ef0e1cbc8874891f5476dc7868bc commit 78e1b031d2e8ef0e1cbc8874891f5476dc7868bc Author: Michael Tuexen AuthorDate: 2024-09-26 06:10:01 +0000 Commit: Michael Tuexen CommitDate: 2024-09-26 06:10:01 +0000 tcp: improve MAC error handling for SYN segments Don't leak a maclabel when SYN segments are processed which results in an error due to MD5 signature handling. Tweak the #idef MAC to allow additional upcoming changes. Reviewed by: markj MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46766 --- sys/netinet/tcp_syncache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 80bf12474c1c..ed131421207d 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1372,7 +1372,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, int autoflowlabel = 0; #endif #ifdef MAC - struct label *maclabel; + struct label *maclabel = NULL; #endif struct syncache scs; struct ucred *cred; @@ -1763,10 +1763,11 @@ donenoprobe: tfo_expanded: if (cred != NULL) crfree(cred); + if (sc == NULL || sc == &scs) { #ifdef MAC - if (sc == &scs) mac_syncache_destroy(&maclabel); #endif + } return (rv); } From nobody Thu Sep 26 09:16:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDnz92m3lz5Wm1k; Thu, 26 Sep 2024 09:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDnz90gD8z4441; Thu, 26 Sep 2024 09:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727342197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xtn26OwEtNQSuua9eqpToml74XFechz1MAO4K09O0G4=; b=p427LH0ekO4IFiLvSg3JcQNZbieuFhJRFVtu65EXqC8X0VJ3hhgTon6guwiNUVz4GADZ7U DWUdUPPRXh5oeqDUZCAjZALTmQimCK7rj96aXpuRChmbDc66I04WzPCpc40NAL03MiH46u gp2DmveMvXjuE5rz/PH9x5IbgNbQNaA7hq44a/XXZGgyaRpcAfy2uHUEPzwl4tCaQuba5A EbsK/xUwuH9dPDPzi6szPzF9VYG5HJ1OS/8s191PDK4XXKoMgev4IwZxCqB6QHiPBsh/9r ttqFO5robeurHxv7/UBrRxceCmRC9Dv1KLsXPU1h7kaIAD92o0NPwJxLVsz8cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727342197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xtn26OwEtNQSuua9eqpToml74XFechz1MAO4K09O0G4=; b=tC+D2K7aeGwdoJCCJl+A6kpaNucUcRNx4MPobPNpXkuqFW9NP3Wl+AIfuZ6Ytc24mUs9+p wzvNB04t7c8AjO65869wCB56udVRyWQxsgg5Nevmh2pspHYi9iacyU7fPqCVwi0KO5dZJV Hbjvs2NWh5hkjiNW2DkQrT1tfG6WTsPZQBXLU2Qs9hN4qOb/le2WAKFZ9ayonDET3ADPOn oKBwIMjFZSsdzZhJugFyQvXTHIQsIfBezNI3aA3r97of7w/5cwAEk2r9HVmU2mvLBvulgN mnrgQOR6f/LMWB3pZ3RrBGOvoAi29nPZnSjvahX6AfwVlqpTCsRWgJeqdxoOsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727342197; a=rsa-sha256; cv=none; b=Ed0ITR8s7huq3YJRMm+JRks09o+C16ToKMkclGDKx73IvLQu9EEAYtCG57wHWQYNsfzgqq Co/bTr7v9bVsWMgHhaoEgEdZtw8WKjKy9m8PybR601NAa4Ugq4CZ2yc6dIZvHmC25QndpB uU+G3jHVQ9b1xTHpv7tmEi8XL3Wu4a7WGLP4mSBGc1mKksHreAOb2/bzZoXD5/xrrcntwC 8bNZcKBW1wR2gRnXjFEKag/L9lswz7jpAiMH52Nu0QvIoDh8iQSb0Awbl32vegcqiHvJFS KPZRqebKKU1OFScwEa+kph8QLCt94eCdiKYgmO9ASYqkBBvnQnqWHrsrhQdIPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDnz90HpxzrLV; Thu, 26 Sep 2024 09:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q9GaGp077383; Thu, 26 Sep 2024 09:16:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q9GaFt077380; Thu, 26 Sep 2024 09:16:36 GMT (envelope-from git) Date: Thu, 26 Sep 2024 09:16:36 GMT Message-Id: <202409260916.48Q9GaFt077380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 99adbd1b3f3b - main - gpioc: Fix handling of priv data during open List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99adbd1b3f3b2c198a8994c9681655978a7d9a1f Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=99adbd1b3f3b2c198a8994c9681655978a7d9a1f commit 99adbd1b3f3b2c198a8994c9681655978a7d9a1f Author: Tom Jones AuthorDate: 2024-09-26 09:13:41 +0000 Commit: Tom Jones CommitDate: 2024-09-26 09:16:17 +0000 gpioc: Fix handling of priv data during open Fix the ordering of priv data creation with setting priv data. This handles failure better and resolves a panic when repeatedly running tools/tools/gpioevents. Explicitly initialise more fields in priv data while we are here. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46568 --- sys/dev/gpio/gpioc.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 4ebf958d6974..b9d95338e211 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -677,19 +677,18 @@ static int gpioc_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct gpioc_cdevpriv *priv; - int err; + int err = 0; priv = malloc(sizeof(*priv), M_GPIOC, M_WAITOK | M_ZERO); priv->sc = dev->si_drv1; - priv->report_option = GPIO_EVENT_REPORT_DETAIL; - err = devfs_set_cdevpriv(priv, gpioc_cdevpriv_dtor); - if (err != 0) { - gpioc_cdevpriv_dtor(priv); - return (err); - } + mtx_init(&priv->mtx, "gpioc priv", NULL, MTX_DEF); knlist_init_mtx(&priv->selinfo.si_note, &priv->mtx); + priv->async = false; + priv->report_option = GPIO_EVENT_REPORT_DETAIL; + priv->sigio = NULL; + /* * Allocate a circular buffer for events. The scheme we use for summary * reporting assumes there will always be a pair of events available to @@ -701,7 +700,13 @@ gpioc_open(struct cdev *dev, int oflags, int devtype, struct thread *td) priv->events = malloc(priv->numevents * sizeof(struct gpio_event_detail), M_GPIOC, M_WAITOK | M_ZERO); - return (0); + priv->evidx_head = priv->evidx_tail = 0; + SLIST_INIT(&priv->pins); + + err = devfs_set_cdevpriv(priv, gpioc_cdevpriv_dtor); + if (err != 0) + gpioc_cdevpriv_dtor(priv); + return (err); } static int From nobody Thu Sep 26 11:06:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDrPg1mNhz5X7hB; Thu, 26 Sep 2024 11:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDrPg19FHz4HFY; Thu, 26 Sep 2024 11:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=76wrbo6lLReda9upTYDzp27aqVbuDqmCW8OfToJdP2Q=; b=oDxZJL73zryUvw5j1l7xFRKWy48/J83gmjuLy2BkvvcrYib9uYOy1ilzcv1LrlWHQVbvAa atB6mWtCR6gd/NxVVm5cwlmvVrGWKtWje5HbCLS/uWCObpBLBlWg2hYpEsTlnjGH5gNJ1S CnMXbtjzba0Xasa7dsdFNQc0zgdQbQRhQgW2H1Uav/v073zqOY8sMIvVFdO8q8GuyBCYB6 DuyNNm16uYTFtcXwBZwLYgxbXOp43ux2A57y+rSB2hQqPJXhj+0BxKkXWe6xhkYkRQLDSB se4kW0ssRmmSqDcE55IM2qR7dK6bEe/595gf4V2xtY60eqE9+CFUT8nAM7TvEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=76wrbo6lLReda9upTYDzp27aqVbuDqmCW8OfToJdP2Q=; b=LWZMiflKN05hbAC8Ql0wRheUXQ319ARAgwssazJz1JFp9yVIuSdE2GDb1NRNQ0UIfnmNTz bAIkjeeNGj7WHTW0idB2ZicdGwwLfsSsb7lpQuUW3gxR46+yMUvr51R2F0B9v8QCYvkIsT dxAjJLjeHPwwUVU1SSm9fiXOy5GP79kVO+XLITFv/xkyBzWuJTTD0WsGQ78TuAfKUgLtm9 72duPhgS0hMKuCHD1FQFqEtoySfKVlLUcfsZ3a0JYWLoV9vHveCaf7kCNLg1tQX7ueqJG/ 10/afae2kAJDnH4QKC0vTCoX5BPltWqyVJ8B7q+bgBLzzHFXUg//+dg0RyAgcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727348775; a=rsa-sha256; cv=none; b=q2wMAMs0YMmrReES5Z5ZDeVtmALiSZlP5Y8vkuwTpdKdzEMaigHRDl8uGLaoD6DUiW8KpZ bGVrTqedvMfT/rw4rUEFDES2muOVqQeUMhELywmC8v1GABwobOGHV7n3sQ9MP/xx7AL+Sb SSZtWUhuVPyAOZv3icUNEOaw+o8JK4uQyZw7GRuWpmT1oJ8mL+nplRHY3lIcc9nju+GtDM Qi9xdd+jTAF+4JmooPUuxvw8w/0RR0vyTUtUxBDF6tgGI56kKZFczQicVO8NRk/8hpXcvw fiHP+L4gwMNsqN6ffEsz3SERU8ETxBHojl1JC+5O6wpSojwhqyan3OiLLMDt6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDrPg0dgPztQd; Thu, 26 Sep 2024 11:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QB6E2k063376; Thu, 26 Sep 2024 11:06:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QB6EwX063373; Thu, 26 Sep 2024 11:06:14 GMT (envelope-from git) Date: Thu, 26 Sep 2024 11:06:14 GMT Message-Id: <202409261106.48QB6EwX063373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 504981357aa3 - main - nuageinit: Lua check and lint files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 504981357aa36365784458cfe8d9e23097bfac7b Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=504981357aa36365784458cfe8d9e23097bfac7b commit 504981357aa36365784458cfe8d9e23097bfac7b Author: Jose Luis Duran AuthorDate: 2024-07-29 18:40:52 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 10:58:00 +0000 nuageinit: Lua check and lint files Mostly white space, style, and luacheck compliance. Signed-off-by: Jose Luis Duran --- libexec/nuageinit/nuage.lua | 56 +++++----- libexec/nuageinit/nuageinit | 158 ++++++++++++++------------- libexec/nuageinit/tests/Makefile | 10 +- libexec/nuageinit/tests/addgroup.lua | 1 + libexec/nuageinit/tests/addsshkey.lua | 3 + libexec/nuageinit/tests/adduser.lua | 1 + libexec/nuageinit/tests/dirname.lua | 7 +- libexec/nuageinit/tests/err.lua | 1 + libexec/nuageinit/tests/nuage.sh | 21 +++- libexec/nuageinit/tests/nuageinit.sh | 187 ++++++++++++++++---------------- libexec/nuageinit/tests/sethostname.lua | 1 + libexec/nuageinit/tests/utils.sh | 18 ++- libexec/nuageinit/tests/warn.lua | 1 + libexec/nuageinit/yaml.lua | 1 + 14 files changed, 258 insertions(+), 208 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 116ab143ccfa..d35d3725fa99 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -1,15 +1,17 @@ +--- -- SPDX-License-Identifier: BSD-2-Clause -- -- Copyright(c) 2022 Baptiste Daroussin +local lfs = require("lfs") local pu = require("posix.unistd") local function warnmsg(str) - io.stderr:write(str.."\n") + io.stderr:write(str .. "\n") end local function errmsg(str) - io.stderr:write(str.."\n") + io.stderr:write(str .. "\n") os.exit(1) end @@ -28,15 +30,17 @@ local function mkdir_p(path) if lfs.attributes(path, "mode") ~= nil then return true end - local r,err = mkdir_p(dirname(path)) + local r, err = mkdir_p(dirname(path)) if not r then - return nil,err.." (creating "..path..")" + return nil, err .. " (creating " .. path .. ")" end return lfs.mkdir(path) end local function sethostname(hostname) - if hostname == nil then return end + if hostname == nil then + return + end local root = os.getenv("NUAGE_FAKE_ROOTDIR") if not root then root = "" @@ -44,12 +48,12 @@ local function sethostname(hostname) local hostnamepath = root .. "/etc/rc.conf.d/hostname" mkdir_p(dirname(hostnamepath)) - local f,err = io.open(hostnamepath, "w") + local f, err = io.open(hostnamepath, "w") if not f then - warnmsg("Impossible to open "..hostnamepath .. ":" ..err) + warnmsg("Impossible to open " .. hostnamepath .. ":" .. err) return end - f:write("hostname=\""..hostname.."\"\n") + f:write('hostname="' .. hostname .. '"\n') f:close() end @@ -62,7 +66,7 @@ local function splitlist(list) elseif type(list) == "table" then ret = list else - warnmsg("Invalid type ".. type(list) ..", expecting table or string") + warnmsg("Invalid type " .. type(list) .. ", expecting table or string") end return ret end @@ -77,7 +81,7 @@ local function adduser(pwd) if root then cmd = cmd .. "-R " .. root .. " " end - local f = io.popen(cmd .. " usershow " ..pwd.name .. " -7 2>/dev/null") + local f = io.popen(cmd .. " usershow " .. pwd.name .. " -7 2> /dev/null") local pwdstr = f:read("*a") f:close() if pwdstr:len() ~= 0 then @@ -89,10 +93,10 @@ local function adduser(pwd) if not pwd.homedir then pwd.homedir = "/home/" .. pwd.name end - local extraargs="" + local extraargs = "" if pwd.groups then local list = splitlist(pwd.groups) - extraargs = " -G ".. table.concat(list, ',') + extraargs = " -G " .. table.concat(list, ",") end -- pw will automatically create a group named after the username -- do not add a -g option in this case @@ -108,23 +112,23 @@ local function adduser(pwd) local precmd = "" local postcmd = "" if pwd.passwd then - precmd = "echo "..pwd.passwd .. "| " + precmd = "echo " .. pwd.passwd .. "| " postcmd = " -H 0 " elseif pwd.plain_text_passwd then - precmd = "echo "..pwd.plain_text_passwd .. "| " + precmd = "echo " .. pwd.plain_text_passwd .. "| " postcmd = " -h 0 " end cmd = precmd .. "pw " if root then cmd = cmd .. "-R " .. root .. " " end - cmd = cmd .. "useradd -n ".. pwd.name .. " -M 0755 -w none " - cmd = cmd .. extraargs .. " -c '".. pwd.gecos - cmd = cmd .. "' -d '" .. pwd.homedir .. "' -s "..pwd.shell .. postcmd + cmd = cmd .. "useradd -n " .. pwd.name .. " -M 0755 -w none " + cmd = cmd .. extraargs .. " -c '" .. pwd.gecos + cmd = cmd .. "' -d '" .. pwd.homedir .. "' -s " .. pwd.shell .. postcmd local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add user "..pwd.name); + warnmsg("nuageinit: fail to add user " .. pwd.name) warnmsg(cmd) return nil end @@ -149,7 +153,7 @@ local function addgroup(grp) if root then cmd = cmd .. "-R " .. root .. " " end - local f = io.popen(cmd .. " groupshow " ..grp.name .. " 2>/dev/null") + local f = io.popen(cmd .. " groupshow " .. grp.name .. " 2> /dev/null") local grpstr = f:read("*a") f:close() if grpstr:len() ~= 0 then @@ -158,16 +162,16 @@ local function addgroup(grp) local extraargs = "" if grp.members then local list = splitlist(grp.members) - extraargs = " -M " .. table.concat(list, ',') + extraargs = " -M " .. table.concat(list, ",") end cmd = "pw " if root then cmd = cmd .. "-R " .. root .. " " end - cmd = cmd .. "groupadd -n ".. grp.name .. extraargs + cmd = cmd .. "groupadd -n " .. grp.name .. extraargs local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add group ".. grp.name); + warnmsg("nuageinit: fail to add group " .. grp.name) warnmsg(cmd) return false end @@ -196,7 +200,7 @@ local function addsshkey(homedir, key) local f = io.open(ak_path, "a") if not f then - warnmsg("nuageinit: impossible to open "..ak_path) + warnmsg("nuageinit: impossible to open " .. ak_path) return end f:write(key .. "\n") @@ -214,12 +218,12 @@ end local n = { warn = warnmsg, err = errmsg, + dirname = dirname, + mkdir_p = mkdir_p, sethostname = sethostname, adduser = adduser, addgroup = addgroup, - addsshkey = addsshkey, - dirname = dirname, - mkdir_p = mkdir_p, + addsshkey = addsshkey } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 622e294bb531..50d77dfef9f5 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -1,18 +1,18 @@ #!/usr/libexec/flua - +--- -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright(c) 2022 Baptiste Daroussin local nuage = require("nuage") +local ucl = require("ucl") local yaml = require("yaml") if #arg ~= 2 then - nuage.err("Usage ".. arg[0] .." [config-2|nocloud]") + nuage.err("Usage " .. arg[0] .. " [config-2|nocloud]") end local path = arg[1] local citype = arg[2] -local ucl = require("ucl") local default_user = { name = "freebsd", @@ -30,9 +30,9 @@ end local function open_config(name) nuage.mkdir_p(root .. "/etc/rc.conf.d") - local f,err = io.open(root .. "/etc/rc.conf.d/" .. name, "w") + local f, err = io.open(root .. "/etc/rc.conf.d/" .. name, "w") if not f then - nuage.err("nuageinit: unable to open "..name.." config: " .. err) + nuage.err("nuageinit: unable to open " .. name .. " config: " .. err) end return f end @@ -40,17 +40,17 @@ end local function get_ifaces() local parser = ucl.parser() -- grab ifaces - local ns = io.popen('netstat -i --libxo json') + local ns = io.popen("netstat -i --libxo json") local netres = ns:read("*a") ns:close() - local res,err = parser:parse_string(netres) + local res, err = parser:parse_string(netres) if not res then nuage.warn("Error parsing netstat -i --libxo json outout: " .. err) return nil end local ifaces = parser:get_object() local myifaces = {} - for _,iface in pairs(ifaces["statistics"]["interface"]) do + for _, iface in pairs(ifaces["statistics"]["interface"]) do if iface["network"]:match("") then local s = iface["address"] myifaces[s:lower()] = iface["name"] @@ -67,7 +67,7 @@ local function config2_network(p) return end f:close() - local res,err = parser:parse_file(p .. "/network_data.json") + local res, err = parser:parse_file(p .. "/network_data.json") if not res then nuage.warn("nuageinit: error parsing network_data.json: " .. err) return @@ -80,7 +80,7 @@ local function config2_network(p) return end local mylinks = {} - for _,v in pairs(obj["links"]) do + for _, v in pairs(obj["links"]) do local s = v["ethernet_mac_address"]:lower() mylinks[v["id"]] = ifaces[s] end @@ -91,66 +91,72 @@ local function config2_network(p) local ipv6 = {} local ipv6_routes = {} local ipv4 = {} - for _,v in pairs(obj["networks"]) do + for _, v in pairs(obj["networks"]) do local interface = mylinks[v["link"]] if v["type"] == "ipv4_dhcp" then - network:write("ifconfig_"..interface.."=\"DHCP\"\n") + network:write("ifconfig_" .. interface .. '="DHCP"\n') end if v["type"] == "ipv4" then - network:write("ifconfig_"..interface.."=\"inet "..v["ip_address"].." netmask " .. v["netmask"] .. "\"\n") + network:write( + "ifconfig_" .. interface .. '="inet ' .. v["ip_address"] .. " netmask " .. v["netmask"] .. '"\n' + ) if v["gateway"] then - routing:write("defaultrouter=\""..v["gateway"].."\"\n") + routing:write('defaultrouter="' .. v["gateway"] .. '"\n') end if v["routes"] then - for i,r in ipairs(v["routes"]) do + for i, r in ipairs(v["routes"]) do local rname = "cloudinit" .. i .. "_" .. interface - if v["gateway"] and v["gateway"] == r["gateway"] then goto next end + if v["gateway"] and v["gateway"] == r["gateway"] then + goto next + end if r["network"] == "0.0.0.0" then - routing:write("defaultrouter=\""..r["gateway"].."\"\n") + routing:write('defaultrouter="' .. r["gateway"] .. '"\n') goto next end - routing:write("route_".. rname .. "=\"-net ".. r["network"] .. " ") - routing:write(r["gateway"] .. " " .. r["netmask"] .. "\"\n") + routing:write("route_" .. rname .. '="-net ' .. r["network"] .. " ") + routing:write(r["gateway"] .. " " .. r["netmask"] .. '"\n') ipv4[#ipv4 + 1] = rname ::next:: end end end if v["type"] == "ipv6" then - ipv6[#ipv6+1] = interface - ipv6_routes[#ipv6_routes+1] = interface - network:write("ifconfig_"..interface.."_ipv6=\"inet6 "..v["ip_address"].."\"\n") + ipv6[#ipv6 + 1] = interface + ipv6_routes[#ipv6_routes + 1] = interface + network:write("ifconfig_" .. interface .. '_ipv6="inet6 ' .. v["ip_address"] .. '"\n') if v["gateway"] then - routing:write("ipv6_defaultrouter=\""..v["gateway"].."\"\n") - routing:write("ipv6_route_"..interface.."=\""..v["gateway"]) - routing:write(" -prefixlen 128 -interface "..interface.."\"\n") + routing:write('ipv6_defaultrouter="' .. v["gateway"] .. '"\n') + routing:write("ipv6_route_" .. interface .. '="' .. v["gateway"]) + routing:write(" -prefixlen 128 -interface " .. interface .. '"\n') end -- TODO compute the prefixlen for the routes --if v["routes"] then - -- for i,r in ipairs(v["routes"]) do + -- for i, r in ipairs(v["routes"]) do -- local rname = "cloudinit" .. i .. "_" .. mylinks[v["link"]] -- -- skip all the routes which are already covered by the default gateway, some provider -- -- still list plenty of them. - -- if v["gateway"] == r["gateway"] then goto next end - -- routing:write("ipv6_route_" .. rname .. "\"\n") - -- ipv6_routes[#ipv6_routes+1] = rname + -- if v["gateway"] == r["gateway"] then + -- goto next + -- end + -- routing:write("ipv6_route_" .. rname .. '"\n') + -- ipv6_routes[#ipv6_routes + 1] = rname -- ::next:: -- end --end end end if #ipv4 > 0 then - routing:write("static_routes=\"") - routing:write(table.concat(ipv4, " ") .. "\"\n") + routing:write('static_routes="') + routing:write(table.concat(ipv4, " ") .. '"\n') end if #ipv6 > 0 then - network:write("ipv6_network_interfaces=\"") - network:write(table.concat(ipv6, " ") .. "\"\n") - network:write("ipv6_default_interface=\""..ipv6[1].."\"\n") + network:write('ipv6_network_interfaces="') + network:write(table.concat(ipv6, " ") .. '"\n') + network:write('ipv6_default_interface="' .. ipv6[1] .. '"\n') end if #ipv6_routes > 0 then - routing:write("ipv6_static_routes=\"") - routing:write(table.concat(ipv6, " ") .. "\"\n") + routing:write('ipv6_static_routes="') + routing:write(table.concat(ipv6, " ") .. '"\n') end network:close() routing:close() @@ -158,7 +164,7 @@ end if citype == "config-2" then local parser = ucl.parser() - local res,err = parser:parse_file(path..'/meta_data.json') + local res, err = parser:parse_file(path .. "/meta_data.json") if not res then nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) @@ -175,32 +181,32 @@ if citype == "config-2" then -- network config2_network(path) elseif citype == "nocloud" then - local f,err = io.open(path.."/meta-data") + local f, err = io.open(path .. "/meta-data") if err then - nuage.err("nuageinit: error parsing nocloud meta-data: ".. err) + nuage.err("nuageinit: error parsing nocloud meta-data: " .. err) end local obj = yaml.eval(f:read("*a")) f:close() if not obj then nuage.err("nuageinit: error parsing nocloud meta-data") end - local hostname = obj['local-hostname'] + local hostname = obj["local-hostname"] if not hostname then - hostname = obj['hostname'] + hostname = obj["hostname"] end if hostname then nuage.sethostname(hostname) end else - nuage.err("Unknown cloud init type: ".. citype) + nuage.err("Unknown cloud init type: " .. citype) end -- deal with user-data local ud = nil local f = nil -userdatas = { "user-data", "user_data" } -for _,v in pairs(userdatas) do - f = io.open(path..'/' .. v, "r") +userdatas = {"user-data", "user_data"} +for _, v in pairs(userdatas) do + f = io.open(path .. "/" .. v, "r") if f then ud = v break @@ -209,33 +215,33 @@ end if not f then os.exit(0) end -local line = f:read('*l') +local line = f:read("*l") f:close() if line == "#cloud-config" then - f = io.open(path.."/" .. ud) + f = io.open(path .. "/" .. ud) local obj = yaml.eval(f:read("*a")) f:close() if not obj then nuage.err("nuageinit: error parsing cloud-config file: " .. ud) end if obj.groups then - for n,g in pairs(obj.groups) do + for n, g in pairs(obj.groups) do if (type(g) == "string") then local r = nuage.addgroup({name = g}) if not r then - nuage.warn("nuageinit: failed to add group: ".. g) + nuage.warn("nuageinit: failed to add group: " .. g) end elseif type(g) == "table" then - for k,v in pairs(g) do + for k, v in pairs(g) do nuage.addgroup({name = k, members = v}) end else - nuage.warn("nuageinit: invalid type : "..type(g).." for users entry number "..n); + nuage.warn("nuageinit: invalid type: " .. type(g) .. " for users entry number " .. n) end end end if obj.users then - for n,u in pairs(obj.users) do + for n, u in pairs(obj.users) do if type(u) == "string" then if u == "default" then nuage.adduser(default_user) @@ -249,12 +255,12 @@ if line == "#cloud-config" then end local homedir = nuage.adduser(u) if u.ssh_authorized_keys then - for _,v in ipairs(u.ssh_authorized_keys) do + for _, v in ipairs(u.ssh_authorized_keys) do nuage.addsshkey(homedir, v) end end else - nuage.warn("nuageinit: invalid type : "..type(u).." for users entry number "..n); + nuage.warn("nuageinit: invalid type : " .. type(u) .. " for users entry number " .. n) end ::unext:: end @@ -264,7 +270,7 @@ if line == "#cloud-config" then end if obj.ssh_authorized_keys then local homedir = nuage.adduser(default_user) - for _,k in ipairs(obj.ssh_authorized_keys) do + for _, k in ipairs(obj.ssh_authorized_keys) do nuage.addsshkey(homedir, k) end end @@ -273,48 +279,52 @@ if line == "#cloud-config" then nuage.mkdir_p(root .. "/etc/rc.conf.d") local network = open_config("network") local routing = open_config("routing") - local ipv6={} - for _,v in pairs(obj.network.ethernets) do - if not v.match then goto next end - if not v.match.macaddress then goto next end + local ipv6 = {} + for _, v in pairs(obj.network.ethernets) do + if not v.match then + goto next + end + if not v.match.macaddress then + goto next + end if not ifaces[v.match.macaddress] then - nuage.warn("nuageinit: not interface matching: "..v.match.macaddress) + nuage.warn("nuageinit: not interface matching: " .. v.match.macaddress) goto next end local interface = ifaces[v.match.macaddress] if v.dhcp4 then - network:write("ifconfig_"..interface.."=\"DHCP\"\n") + network:write("ifconfig_" .. interface .. '="DHCP"\n') elseif v.addresses then - for _,a in pairs(v.addresses) do + for _, a in pairs(v.addresses) do if a:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)") then - network:write("ifconfig_"..interface.."=\"inet "..a.."\"\n") + network:write("ifconfig_" .. interface .. '="inet ' .. a .. '"\n') else - network:write("ifconfig_"..interface.."_ipv6=\"inet6 "..a.."\"\n") - ipv6[#ipv6 +1] = interface + network:write("ifconfig_" .. interface .. '_ipv6="inet6 ' .. a .. '"\n') + ipv6[#ipv6 + 1] = interface end end end if v.gateway4 then - routing:write("defaultrouter=\""..v.gateway4.."\"\n") + routing:write('defaultrouter="' .. v.gateway4 .. '"\n') end if v.gateway6 then - routing:write("ipv6_defaultrouter=\""..v.gateway6.."\"\n") - routing:write("ipv6_route_"..interface.."=\""..v.gateway6) - routing:write(" -prefixlen 128 -interface "..interface.."\"\n") + routing:write('ipv6_defaultrouter="' .. v.gateway6 .. '"\n') + routing:write("ipv6_route_" .. interface .. '="' .. v.gateway6) + routing:write(" -prefixlen 128 -interface " .. interface .. '"\n') end ::next:: end if #ipv6 > 0 then - network:write("ipv6_network_interfaces=\"") - network:write(table.concat(ipv6, " ") .. "\"\n") - network:write("ipv6_default_interface=\""..ipv6[1].."\"\n") + network:write('ipv6_network_interfaces="') + network:write(table.concat(ipv6, " ") .. '"\n') + network:write('ipv6_default_interface="' .. ipv6[1] .. '"\n') end network:close() routing:close() end else - local res,err = os.execute(path..'/' .. ud) + local res, err = os.execute(path .. "/" .. ud) if not res then - nuage.err("nuageinit: error executing user-data script: ".. err) + nuage.err("nuageinit: error executing user-data script: " .. err) end end diff --git a/libexec/nuageinit/tests/Makefile b/libexec/nuageinit/tests/Makefile index d5b3bd9dcc82..ccb81c090445 100644 --- a/libexec/nuageinit/tests/Makefile +++ b/libexec/nuageinit/tests/Makefile @@ -2,12 +2,12 @@ PACKAGE= tests ATF_TESTS_SH= nuage utils nuageinit -${PACKAGE}FILES+= warn.lua -${PACKAGE}FILES+= err.lua -${PACKAGE}FILES+= dirname.lua -${PACKAGE}FILES+= sethostname.lua +${PACKAGE}FILES+= addgroup.lua ${PACKAGE}FILES+= addsshkey.lua ${PACKAGE}FILES+= adduser.lua -${PACKAGE}FILES+= addgroup.lua +${PACKAGE}FILES+= dirname.lua +${PACKAGE}FILES+= err.lua +${PACKAGE}FILES+= sethostname.lua +${PACKAGE}FILES+= warn.lua .include diff --git a/libexec/nuageinit/tests/addgroup.lua b/libexec/nuageinit/tests/addgroup.lua index 60a0d8346793..a36a5e24c7b3 100644 --- a/libexec/nuageinit/tests/addgroup.lua +++ b/libexec/nuageinit/tests/addgroup.lua @@ -1,6 +1,7 @@ #!/usr/libexec/flua local n = require("nuage") + if n.addgroup() then n.err("addgroup should not accept empty value") end diff --git a/libexec/nuageinit/tests/addsshkey.lua b/libexec/nuageinit/tests/addsshkey.lua index 3aa5f7619ec2..47e102c162a9 100644 --- a/libexec/nuageinit/tests/addsshkey.lua +++ b/libexec/nuageinit/tests/addsshkey.lua @@ -1,2 +1,5 @@ +#!/usr/libexec/flua + local n = require("nuage") + n.addsshkey(".", "mykey") diff --git a/libexec/nuageinit/tests/adduser.lua b/libexec/nuageinit/tests/adduser.lua index 9366d2abd0f4..cef6be0c0e0c 100644 --- a/libexec/nuageinit/tests/adduser.lua +++ b/libexec/nuageinit/tests/adduser.lua @@ -1,6 +1,7 @@ #!/usr/libexec/flua local n = require("nuage") + if n.adduser() then n.err("adduser should not accept empty value") end diff --git a/libexec/nuageinit/tests/dirname.lua b/libexec/nuageinit/tests/dirname.lua index d1268e48575c..7e3a2c835502 100644 --- a/libexec/nuageinit/tests/dirname.lua +++ b/libexec/nuageinit/tests/dirname.lua @@ -1,8 +1,11 @@ +#!/usr/libexec/flua + local n = require("nuage") + print(n.dirname("/my/path/path1")) if n.dirname("path") then - nuage.err("Expecting nil for n.dirname(\"path\")") + n.err('Expecting nil for n.dirname("path")') end if n.dirname() then - nuage.err("Expecting nil for n.dirname") + n.err("Expecting nil for n.dirname") end diff --git a/libexec/nuageinit/tests/err.lua b/libexec/nuageinit/tests/err.lua index c62fa1098f09..567d4f2df66e 100644 --- a/libexec/nuageinit/tests/err.lua +++ b/libexec/nuageinit/tests/err.lua @@ -1,4 +1,5 @@ #!/usr/libexec/flua local n = require("nuage") + n.err("plop") diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 29842bff3d6b..4e2353176b16 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -1,9 +1,16 @@ +#- +# Copyright (c) 2022 Baptiste Daroussin +# +# SPDX-License-Identifier: BSD-2-Clause +# + atf_test_case sethostname atf_test_case addsshkey atf_test_case adduser atf_test_case addgroup -sethostname_body() { +sethostname_body() +{ export NUAGE_FAKE_ROOTDIR="$(pwd)" atf_check /usr/libexec/flua $(atf_get_srcdir)/sethostname.lua if [ ! -f etc/rc.conf.d/hostname ]; then @@ -12,7 +19,8 @@ sethostname_body() { atf_check -o inline:"hostname=\"myhostname\"\n" cat etc/rc.conf.d/hostname } -addsshkey_body() { +addsshkey_body() +{ atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua if [ ! -f .ssh/authorized_keys ]; then atf_fail "ssh key not added" @@ -24,7 +32,8 @@ addsshkey_body() { atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys } -adduser_body() { +adduser_body() +{ export NUAGE_FAKE_ROOTDIR="$(pwd)" if [ $(id -u) -ne 0 ]; then atf_skip "root required" @@ -38,7 +47,8 @@ adduser_body() { atf_check -o inline:"impossible_username::1001:1001::0:0:impossible_username User:/home/impossible_username:/bin/sh\n" grep impossible_username etc/master.passwd } -addgroup_body() { +addgroup_body() +{ export NUAGE_FAKE_ROOTDIR="$(pwd)" mkdir etc printf "wheel:*:0:root\n" > etc/group @@ -46,7 +56,8 @@ addgroup_body() { atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group } -atf_init_test_cases() { +atf_init_test_cases() +{ atf_add_test_case sethostname atf_add_test_case addsshkey atf_add_test_case adduser diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index b5078e256853..64ac066fefbf 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -1,8 +1,13 @@ +#- +# Copyright (c) 2022 Baptiste Daroussin +# +# SPDX-License-Identifier: BSD-2-Clause +# + atf_test_case args atf_test_case nocloud atf_test_case nocloud_userdata_script atf_test_case nocloud_user_data_script -atf_test_case nocloud_userdata_cloudconfig atf_test_case nocloud_userdata_cloudconfig_users atf_test_case nocloud_network atf_test_case config2 @@ -12,7 +17,6 @@ atf_test_case config2_pubkeys_meta_data atf_test_case config2_network atf_test_case config2_network_static_v4 - args_body() { atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit @@ -43,8 +47,8 @@ nocloud_userdata_script_body() here=$(pwd) mkdir -p media/nuageinit printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho "yeah"\n" > ${here}/media/nuageinit/user-data - chmod 755 ${here}/media/nuageinit/user-data + printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user-data + chmod 755 ${here}/media/nuageinit/user-data atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud } @@ -53,8 +57,8 @@ nocloud_user_data_script_body() here=$(pwd) mkdir -p media/nuageinit printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho "yeah"\n" > ${here}/media/nuageinit/user_data - chmod 755 ${here}/media/nuageinit/user_data + printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user_data + chmod 755 ${here}/media/nuageinit/user_data atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud } @@ -68,16 +72,16 @@ nocloud_userdata_cloudconfig_users_body() mkdir -p media/nuageinit printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data mkdir -p etc - cat > etc/master.passwd < etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group < etc/group << EOF wheel:*:0:root users:*:1: EOF - cat > media/nuageinit/user-data < media/nuageinit/user-data << EOF #cloud-config groups: - admingroup: [root,sys] @@ -115,12 +119,12 @@ nocloud_network_body() here=$(pwd) mkdir -p media/nuageinit mkdir -p etc - cat > etc/master.passwd < etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group < etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -135,16 +139,15 @@ EOF myiface=$1 myaddr=$(ifconfig $myiface ether | awk '/ether/ { print $2 }') printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - cat > media/nuageinit/user-data < media/nuageinit/user-data << EOF #cloud-config -# network: version: 2 ethernets: # opaque ID for physical interfaces, only referred to by other stanzas id0: match: - macaddress: '${myaddr}' + macaddress: "$myaddr" addresses: - 192.168.14.2/24 - 2001:1::1/64 @@ -153,13 +156,13 @@ network: EOF export NUAGE_FAKE_ROOTDIR=$(pwd) atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud - cat > network < network << EOF ifconfig_${myiface}="inet 192.168.14.2/24" ifconfig_${myiface}_ipv6="inet6 2001:1::1/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF - cat > routing < routing << EOF defaultrouter="192.168.14.1" ipv6_defaultrouter="2001:1::2" ipv6_route_${myiface}="2001:1::2 -prefixlen 128 -interface ${myiface}" @@ -176,7 +179,7 @@ config2_body() atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 cat > media/nuageinit/meta_data.json << EOF { - "hostname": "cloudimg", + "hostname": "cloudimg" } EOF export NUAGE_FAKE_ROOTDIR=$(pwd) @@ -195,17 +198,16 @@ config2_pubkeys_body() touch media/nuageinit/meta_data.json cat > media/nuageinit/user-data << EOF #cloud-config - ssh_authorized_keys: - "ssh-rsa AAAAB3NzaC1y...== Generated by Nova" EOF mkdir -p etc - cat > etc/master.passwd < etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group < etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -225,17 +227,16 @@ config2_pubkeys_user_data_body() touch media/nuageinit/meta_data.json cat > media/nuageinit/user_data << EOF #cloud-config - ssh_authorized_keys: - "ssh-rsa AAAAB3NzaC1y...== Generated by Nova" EOF mkdir -p etc - cat > etc/master.passwd < etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group < etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -251,37 +252,37 @@ config2_pubkeys_meta_data_body() atf_skip "root required" fi mkdir -p media/nuageinit - cat > media/nuageinit/meta_data.json < media/nuageinit/meta_data.json << EOF { - "uuid": "uuid_for_this_instance", - "admin_pass": "a_generated_password", - "public_keys": { - "tdb": "ssh-ed25519 my_key_id tdb@host" - }, - "keys": [ - { - "name": "tdb", - "type": "ssh", - "data": "ssh-ed25519 my_key_id tdb@host" - } - ], - "hostname": "freebsd-14-test.novalocal", - "name": "freebsd-14-test", - "launch_index": 0, - "availability_zone": "nova", - "random_seed": "long_random_seed", - "project_id": "my_project_id", - "devices": [], - "dedicated_cpus": [] + "uuid": "uuid_for_this_instance", + "admin_pass": "a_generated_password", + "public_keys": { + "tdb": "ssh-ed25519 my_key_id tdb@host" + }, + "keys": [ + { + "name": "tdb", + "type": "ssh", + "data": "ssh-ed25519 my_key_id tdb@host" + } + ], + "hostname": "freebsd-14-test.novalocal", + "name": "freebsd-14-test", + "launch_index": 0, + "availability_zone": "nova", + "random_seed": "long_random_seed", + "project_id": "my_project_id", + "devices": [], + "dedicated_cpus": [] } EOF mkdir -p etc - cat > etc/master.passwd < etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group < etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -289,7 +290,8 @@ EOF atf_check -o inline:"ssh-ed25519 my_key_id tdb@host\n" cat home/freebsd/.ssh/authorized_keys } -config2_network_body() { +config2_network_body() +{ here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json @@ -300,13 +302,13 @@ config2_network_body() { set -- $mynetworks myiface=$1 myaddr=$(ifconfig $myiface ether | awk '/ether/ { print $2 }') -cat > media/nuageinit/network_data.json < media/nuageinit/network_data.json << EOF { "links": [ { "ethernet_mac_address": "$myaddr", "id": "iface0", - "mtu": null, + "mtu": null } ], "networks": [ @@ -315,39 +317,39 @@ cat > media/nuageinit/network_data.json < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d71e2c037c94 - main - nuageinit: Silence an fstyp(8) warning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d71e2c037c942dbe2a9fd2630d5cf155dd1bf7db Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d71e2c037c942dbe2a9fd2630d5cf155dd1bf7db commit d71e2c037c942dbe2a9fd2630d5cf155dd1bf7db Author: Jose Luis Duran AuthorDate: 2024-07-26 01:59:36 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 10:58:42 +0000 nuageinit: Silence an fstyp(8) warning Silence a warning emitted by fread(3) in fstyp(8)'s read_buf(), when detecting the file system type of the cloud-init device: % fstyp /dev/iso9660/cidata fstyp: fread: Invalid argument cd9660 Also rephrase slightly a comment while here. Signed-off-by: Jose Luis Duran --- libexec/rc/rc.d/nuageinit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit index 8da0b1aed741..a44761ea1d9e 100755 --- a/libexec/rc/rc.d/nuageinit +++ b/libexec/rc/rc.d/nuageinit @@ -18,8 +18,8 @@ nuageinit_start() { local citype # detect cloud init provider - # according to the specification of the config drive - # it either formatted in vfat or iso9660 and labeled + # according to the specification, the config drive + # is either formatted in vfat or iso9660 and labeled # config-2 for f in iso9660 msdosfs; do drive="/dev/$f/[cC][oO][nN][fF][iI][gG]-2" @@ -39,7 +39,7 @@ nuageinit_start() err 1 "Impossible to find a cloud init provider" fi mkdir -p /media/nuageinit - fs=$(fstyp $drive) + fs=$(fstyp $drive 2> /dev/null) mount -t $fs $drive /media/nuageinit # according to the specification, the content is either # in the openstack or ec2 directory From nobody Thu Sep 26 11:06:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDrPj5FPTz5X7qc; Thu, 26 Sep 2024 11:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDrPj2tW1z4H8h; Thu, 26 Sep 2024 11:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=09TOVnQiXXADqOQ8FR1f/IzQbJQT9/BoDNEq6Wmkib4=; b=fVLbTRVMpYXT7QFH1Gwq2+hyc142I2AfGzK1h41CNaY9Igw8eLjLTsKggcEhyoob7x9Piv S74i26YS2DdwnBoMmo2GmxkOFT/9hQKBgJMiJpY/eoq4lc/RVZe4zFnHqgdLfVAEp6Xcjl wOp3eRdya20C8po4siSqJuhrSmHxjkzfTgeuikitAzj3unkEPMvmNfVjExI8aCDvP7JayF dezYzO6+YMUYxl3dwvXCUU9j7EL7K5VJA7n4l+KlKMkHfWt7wbu/LeX/cCIA0D5OmjwJJY RHr6cLI7RVKG9gQ3hrazKFJ6MorvPryD3fAhnEW/uL8Xt4ZefgnInLf0zsSQlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=09TOVnQiXXADqOQ8FR1f/IzQbJQT9/BoDNEq6Wmkib4=; b=yRRGSA21MkQBcq/xfzoztvH7cHkM2nX7bUtvpRsxsfTxf0ScMw3IUm5ZcL64y4kD8wXjZG 8ZelDM8eA5A6gFjIjdEe6gw5S+EWrmR9bxI0zOiDMcooAZLioHtP96eQQBla0O9+sqJeOm medKfUbixIgTX9YNf1lW1U80QODcE/Ek2bH2JqR7YyoET1u/5SacJAhDDVNVi/mLHnn8vM ISRR+9epPip0/9c8191C+2iggQzzVyKhvLzW/OWkOomMw/fz5MvtMymsWSZ2QG189uk4FX lRPFNxm7YW/g/1JkOibT6horMG6eCH1MzfcWcJECilStp/5ZpTqAd0ejWRbL+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727348777; a=rsa-sha256; cv=none; b=l6qsn6+iSMMzT209ZurfWhIpWIjtabno7CwYdw3l0ljJ58vWEBY202fDggVfYgU5ygezUO 6T9hXHghsLZ0aRKrR9RN0GMkssqUHor/TxQWmH1X4uY5OPojyT2pWBEX4lJCcDfLpHdRkI NQ5PVJqQdcxnDXf4h+Akpb7AkS4Yk0J1UpXt4dl6IGuSd6ryUaRuReUwP9KxKwSm5L/y9M XEftdBtkfvl0qDQV02ZoDiI7fpCdNcURkSVfSo48qw/1QGBFhT55NBL1fy5jZ2h+2fQTrT e70NmZIBhgm7UpCnXcUOEnilaC/SfkPzecAp8/xIU3zSURvHFsYDYjPnlXfemw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDrPj1nVxzv7L; Thu, 26 Sep 2024 11:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QB6HaP063470; Thu, 26 Sep 2024 11:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QB6HFO063467; Thu, 26 Sep 2024 11:06:17 GMT (envelope-from git) Date: Thu, 26 Sep 2024 11:06:17 GMT Message-Id: <202409261106.48QB6HFO063467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 9b2d92addc31 - main - nuageinit: Replace os.execute with Lua libraries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b2d92addc31ba6f5696c85d184a45d43e9073dc Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9b2d92addc31ba6f5696c85d184a45d43e9073dc commit 9b2d92addc31ba6f5696c85d184a45d43e9073dc Author: Jose Luis Duran AuthorDate: 2024-07-30 00:37:10 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 10:59:00 +0000 nuageinit: Replace os.execute with Lua libraries Prefer posix.sys.stat's chmod() to os.execute(). While here, change the name of the locals to be more descriptive. Signed-off-by: Jose Luis Duran --- libexec/nuageinit/nuage.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index d35d3725fa99..1f035036f802 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -3,8 +3,9 @@ -- -- Copyright(c) 2022 Baptiste Daroussin +local unistd = require("posix.unistd") +local sys_stat = require("posix.sys.stat") local lfs = require("lfs") -local pu = require("posix.unistd") local function warnmsg(str) io.stderr:write(str .. "\n") @@ -206,12 +207,12 @@ local function addsshkey(homedir, key) f:write(key .. "\n") f:close() if chownak then - os.execute("chmod 0600 " .. ak_path) - pu.chown(ak_path, dirattrs.uid, dirattrs.gid) + sys_stat.chmod(ak_path, 384) + unistd.chown(ak_path, dirattrs.uid, dirattrs.gid) end if chowndotssh then - os.execute("chmod 0700 " .. dotssh_path) - pu.chown(dotssh_path, dirattrs.uid, dirattrs.gid) + sys_stat.chmod(dotssh_path, 448) + unistd.chown(dotssh_path, dirattrs.uid, dirattrs.gid) end end From nobody Thu Sep 26 11:06:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDrPk5zSgz5X7wD; Thu, 26 Sep 2024 11:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDrPk4g60z4HCB; Thu, 26 Sep 2024 11:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=96EofNjN2cXWfZHkm/WrOxrsY3U9k0abKdM/2kvebwc=; b=HnI/JGrdm4S3BLgt0AOOBsg59jy3zJs3qrMqBTuDWQJJ+wJdzc0QrS8BAlxaYU8OVpQAVX fDnZvUWK0AuhAUU/N5Bsm2thZEaYiXA/eY5Q8/MJCD1YsNK2kmPsRmyWWHcb8qtoEYg08x 4H2NdPvW5prkdNZQ6w9jttYpIaOi4CyQv3eJZ00fVPVJMN7mri2HH62RHFD6k2Q9HbTpJC wnbxESrDv/7CRB5iNyRjJD2F9+X7S9rGhd2+Nnvr95utIxExoyN0a4THcAB6fLry5WA/Ud N0avffi5kiluLDWr+BmHByrLRHUy3I1oW3zjg0FyY+x3RGu1rtyyBm3kCsiZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=96EofNjN2cXWfZHkm/WrOxrsY3U9k0abKdM/2kvebwc=; b=Rugg6cQK/qT3j+MlpddSdDzi76Mp1U67pCpLAU8yRHTPuns+svO3As2MpVg7XwrlypR92c zVDasl/isEH1JEi1Zu2qTH7x4ttRjuCQP3yunJ7DWzGppPMTUJtovZ3Gf7SGBnPoB4DaaE 4EHhIH6Qb0LBW08LjJpUYkD2mqX3cIEmg7KS1QoU228KMbzZHVyA0LzJavnxlPUVIJvS8Z O5lETALP/DZRfYJU8hJIdnMJN4ZiNT8bG86LBn/RnpNNnGHEg1XHanIFazmwqxLaHNlS8s Z/ef2zUOA9tM79HY42PnzqUA+b0/KfX+0ENLNR7CEXlaFlVT0iV/SaGPX/IaZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727348778; a=rsa-sha256; cv=none; b=xiJi9do1FQBVYsKlAPq82ZPBXCu/vMUA74cKEJm0rWtZWVNgAyEQu8qswloK3IReNTnQ2V 5eMkf4jS7HDQy9t2jeFwcqTekNRm4ptkdYiXdHUhKXDNxJZikOwBnXBs69VajZpCAkFIXd QJS7ig4Ul+JxKtlRqBBM45GEjF7tGwEmsFWGBCkAMOy9AM7sgKW3xEGpQKRkSp/Jwod5U3 clURA9Sn5W000QwfdbzhhIkgZmXO9gATdktgBH9eyH7NHirs4hu7NECbXc/Yl2xw4ALDr/ ux1KrDiXGlpi7JMy1S7asadyJ7rAGTUX04bET1r5nKy/6G47+6U7MilobOkXIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDrPk32yWztg9; Thu, 26 Sep 2024 11:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QB6Ilw063514; Thu, 26 Sep 2024 11:06:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QB6IcC063511; Thu, 26 Sep 2024 11:06:18 GMT (envelope-from git) Date: Thu, 26 Sep 2024 11:06:18 GMT Message-Id: <202409261106.48QB6IcC063511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 945632ca7611 - main - nuageinit: Standardize warning/error messages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 945632ca76117029e7bd1f46d17ccb378973daf7 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=945632ca76117029e7bd1f46d17ccb378973daf7 commit 945632ca76117029e7bd1f46d17ccb378973daf7 Author: Jose Luis Duran AuthorDate: 2024-07-30 01:18:11 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 10:59:14 +0000 nuageinit: Standardize warning/error messages Standardize the utilities from nuage.lua, to return nil on failure, plus an error message as a second result, and some value different from nil on success. Make warnmsg() and errmsg() append "nuageinit: " by default. Pass an optional second parameter as false to avoid printing this tag. Signed-off-by: Jose Luis Duran --- libexec/nuageinit/nuage.lua | 21 ++++++++++++++------- libexec/nuageinit/nuageinit | 26 +++++++++++++------------- libexec/nuageinit/tests/nuage.sh | 4 ++-- libexec/nuageinit/tests/nuageinit.sh | 4 ++-- libexec/nuageinit/tests/utils.sh | 4 ++-- 5 files changed, 33 insertions(+), 26 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 1f035036f802..c27b66b23be2 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -7,12 +7,19 @@ local unistd = require("posix.unistd") local sys_stat = require("posix.sys.stat") local lfs = require("lfs") -local function warnmsg(str) - io.stderr:write(str .. "\n") +local function warnmsg(str, prepend) + if not str then + return + end + local tag = "" + if prepend ~= false then + tag = "nuageinit: " + end + io.stderr:write(tag .. str .. "\n") end -local function errmsg(str) - io.stderr:write(str .. "\n") +local function errmsg(str, prepend) + warnmsg(str, prepend) os.exit(1) end @@ -129,7 +136,7 @@ local function adduser(pwd) local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add user " .. pwd.name) + warnmsg("fail to add user " .. pwd.name) warnmsg(cmd) return nil end @@ -172,7 +179,7 @@ local function addgroup(grp) cmd = cmd .. "groupadd -n " .. grp.name .. extraargs local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add group " .. grp.name) + warnmsg("fail to add group " .. grp.name) warnmsg(cmd) return false end @@ -201,7 +208,7 @@ local function addsshkey(homedir, key) local f = io.open(ak_path, "a") if not f then - warnmsg("nuageinit: impossible to open " .. ak_path) + warnmsg("impossible to open " .. ak_path) return end f:write(key .. "\n") diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 50d77dfef9f5..8c289fea6b1d 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -9,7 +9,7 @@ local ucl = require("ucl") local yaml = require("yaml") if #arg ~= 2 then - nuage.err("Usage " .. arg[0] .. " [config-2|nocloud]") + nuage.err("Usage " .. arg[0] .. " [config-2|nocloud]", false) end local path = arg[1] local citype = arg[2] @@ -32,7 +32,7 @@ local function open_config(name) nuage.mkdir_p(root .. "/etc/rc.conf.d") local f, err = io.open(root .. "/etc/rc.conf.d/" .. name, "w") if not f then - nuage.err("nuageinit: unable to open " .. name .. " config: " .. err) + nuage.err("unable to open " .. name .. " config: " .. err) end return f end @@ -69,14 +69,14 @@ local function config2_network(p) f:close() local res, err = parser:parse_file(p .. "/network_data.json") if not res then - nuage.warn("nuageinit: error parsing network_data.json: " .. err) + nuage.warn("error parsing network_data.json: " .. err) return end local obj = parser:get_object() local ifaces = get_ifaces() if not ifaces then - nuage.warn("nuageinit: no network interfaces found") + nuage.warn("no network interfaces found") return end local mylinks = {} @@ -167,7 +167,7 @@ if citype == "config-2" then local res, err = parser:parse_file(path .. "/meta_data.json") if not res then - nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) + nuage.err("error parsing config-2 meta_data.json: " .. err) end local obj = parser:get_object() if obj.public_keys then @@ -183,12 +183,12 @@ if citype == "config-2" then elseif citype == "nocloud" then local f, err = io.open(path .. "/meta-data") if err then - nuage.err("nuageinit: error parsing nocloud meta-data: " .. err) + nuage.err("error parsing nocloud meta-data: " .. err) end local obj = yaml.eval(f:read("*a")) f:close() if not obj then - nuage.err("nuageinit: error parsing nocloud meta-data") + nuage.err("error parsing nocloud meta-data") end local hostname = obj["local-hostname"] if not hostname then @@ -222,21 +222,21 @@ if line == "#cloud-config" then local obj = yaml.eval(f:read("*a")) f:close() if not obj then - nuage.err("nuageinit: error parsing cloud-config file: " .. ud) + nuage.err("error parsing cloud-config file: " .. ud) end if obj.groups then for n, g in pairs(obj.groups) do if (type(g) == "string") then local r = nuage.addgroup({name = g}) if not r then - nuage.warn("nuageinit: failed to add group: " .. g) + nuage.warn("failed to add group: " .. g) end elseif type(g) == "table" then for k, v in pairs(g) do nuage.addgroup({name = k, members = v}) end else - nuage.warn("nuageinit: invalid type: " .. type(g) .. " for users entry number " .. n) + nuage.warn("invalid type: " .. type(g) .. " for users entry number " .. n) end end end @@ -260,7 +260,7 @@ if line == "#cloud-config" then end end else - nuage.warn("nuageinit: invalid type : " .. type(u) .. " for users entry number " .. n) + nuage.warn("invalid type : " .. type(u) .. " for users entry number " .. n) end ::unext:: end @@ -288,7 +288,7 @@ if line == "#cloud-config" then goto next end if not ifaces[v.match.macaddress] then - nuage.warn("nuageinit: not interface matching: " .. v.match.macaddress) + nuage.warn("not interface matching: " .. v.match.macaddress) goto next end local interface = ifaces[v.match.macaddress] @@ -325,6 +325,6 @@ if line == "#cloud-config" then else local res, err = os.execute(path .. "/" .. ud) if not res then - nuage.err("nuageinit: error executing user-data script: " .. err) + nuage.err("error executing user-data script: " .. err) end end diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 4e2353176b16..6d8a2746de1f 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -42,7 +42,7 @@ adduser_body() printf "root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" > etc/master.passwd pwd_mkdb -d etc etc/master.passwd printf "wheel:*:0:root\n" > etc/group - atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua + atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua test -d home/impossible_username || atf_fail "home not created" atf_check -o inline:"impossible_username::1001:1001::0:0:impossible_username User:/home/impossible_username:/bin/sh\n" grep impossible_username etc/master.passwd } @@ -52,7 +52,7 @@ addgroup_body() export NUAGE_FAKE_ROOTDIR="$(pwd)" mkdir etc printf "wheel:*:0:root\n" > etc/group - atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua + atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group } diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 64ac066fefbf..f3fc55e87523 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -22,7 +22,7 @@ args_body() atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit bla atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit bla meh plop - atf_check -s exit:1 -e inline:"Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh + atf_check -s exit:1 -e inline:"nuageinit: Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh } nocloud_body() @@ -174,7 +174,7 @@ config2_body() { here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing config-2: meta_data.json.*" /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit ${here}/media/nuageinit config-2 printf "{}" > media/nuageinit/meta_data.json atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 cat > media/nuageinit/meta_data.json << EOF diff --git a/libexec/nuageinit/tests/utils.sh b/libexec/nuageinit/tests/utils.sh index c3b5b8212938..26f117d81d60 100644 --- a/libexec/nuageinit/tests/utils.sh +++ b/libexec/nuageinit/tests/utils.sh @@ -10,12 +10,12 @@ atf_test_case dirname warn_body() { - atf_check -e "inline:plop\n" -s exit:0 /usr/libexec/flua $(atf_get_srcdir)/warn.lua + atf_check -e "inline:nuageinit: plop\n" -s exit:0 /usr/libexec/flua $(atf_get_srcdir)/warn.lua } err_body() { - atf_check -e "inline:plop\n" -s exit:1 /usr/libexec/flua $(atf_get_srcdir)/err.lua + atf_check -e "inline:nuageinit: plop\n" -s exit:1 /usr/libexec/flua $(atf_get_srcdir)/err.lua } dirname_body() From nobody Thu Sep 26 11:06:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDrPl5ZrPz5X8Ft; Thu, 26 Sep 2024 11:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDrPl4lgyz4HNJ; Thu, 26 Sep 2024 11:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ne5ljSJFe6L1U5npSksW0EmgrzU2plGTaV0D8G9wgo0=; b=tcbd+akf/PxRHMq7KfVtiBWe40jJb32caL4ugj6QU8CdhHFguxGyKZmPIuW5QHJyUoHVq3 z4RHt4BeWoX3YVTwRYPJ5T9ssZT7t9TE+Bi0Inb9QRdAI9gujgZzn6z+8nr4D9JhhZtO5i mXYqVYNJxbdXNJciYjHlsBvK8PZblcM81lWw8sgHS8lop64QYmGBFS0+W+J696lrepV9Vn UU9wSI/uVrfTz+1IRfK/RT9Bi8fnpBaYG7iDVbD18bMfbBlUKXHenOBActhBVA4IReBe8i gmBd4Bh5VfesYQV7kZ2DvLP/Kj+hNhzN6AWt3p3KVvSbr+KlowGAbOo3Nl4y6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ne5ljSJFe6L1U5npSksW0EmgrzU2plGTaV0D8G9wgo0=; b=U1tSKfVlM/1SFHp5H2gTtwI3uYsOquFDfNR7PGgcRpKmoAG8H4fqIXqqJA4alRpCWHik6k qk26tiBlGR0ovU4gZfrH7TYBjDo8L99P+q6030IDCtcW4ZNjcf0ctILaDq6nn3C5KU5X3N 6agzvXG3Y7zoGzwhqWiQZH269btvDM8wy4duHRqEKbCw8ZqcoQDUeyd4OJ6zLIqabYK0q7 KLtYln1KFmgGmteGQS+pjuvIggFZ2UJmkLW826mjtZBXqAeMyzjmSmsOL63eL3YgV7SkUn u9wYM3KVUSmSMnAo1mXkiBC/CSYRBOnSiLiDjQCMgJgSSqMdR7I4jkxSivEaKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727348779; a=rsa-sha256; cv=none; b=SgZRRk09TrWMcebhJlh0wE+1p8iRLUQnd8gKq3Z3AqU4wljW6GrajJzewyifmH6hXO1pVb DhlWw/kO+jP3ucgyi/4iqFvRThgr9+4Il6s4jrOaIoQs/uSetqz7u5pXtZLVVloSGrDexp HwzhJFYASNZdCKeDRtk/9lnziyGmawlPkK0Xi83Pt4D+89+XKG5DMjewilktApSXgv5m7e ybuX9AcqgXsdbvDDJUB54+9t6GLobNDF2Ah8B2+O7zr4VlKhQv2A4r41pQOqrOJTb2VikS rl0e1nLleI9E/l8CdJGFymXBSpCdBdR5AgnpRdflfg3TD09cdjmx5NIYU1iL2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDrPl3Vk7zv7M; Thu, 26 Sep 2024 11:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QB6JYm063556; Thu, 26 Sep 2024 11:06:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QB6Jqv063553; Thu, 26 Sep 2024 11:06:19 GMT (envelope-from git) Date: Thu, 26 Sep 2024 11:06:19 GMT Message-Id: <202409261106.48QB6Jqv063553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 38bb6f79e39a - main - nuageinit: Standardize user-facing error messages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38bb6f79e39a14ea99f559f59129a4cadf92b569 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=38bb6f79e39a14ea99f559f59129a4cadf92b569 commit 38bb6f79e39a14ea99f559f59129a4cadf92b569 Author: Jose Luis Duran AuthorDate: 2024-07-30 01:59:16 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 10:59:24 +0000 nuageinit: Standardize user-facing error messages Signed-off-by: Jose Luis Duran --- libexec/nuageinit/nuageinit | 2 +- libexec/nuageinit/tests/nuageinit.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 8c289fea6b1d..c8f74d13b7fd 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -9,7 +9,7 @@ local ucl = require("ucl") local yaml = require("yaml") if #arg ~= 2 then - nuage.err("Usage " .. arg[0] .. " [config-2|nocloud]", false) + nuage.err("Usage: " .. arg[0] .. " ( | )", false) end local path = arg[1] local citype = arg[2] diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index f3fc55e87523..6b8ea7ff3328 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -19,9 +19,9 @@ atf_test_case config2_network_static_v4 args_body() { - atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit - atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit bla - atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit [config-2|nocloud]\n" /usr/libexec/nuageinit bla meh plop + atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit ( | )\n" /usr/libexec/nuageinit + atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit ( | )\n" /usr/libexec/nuageinit bla + atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit ( | )\n" /usr/libexec/nuageinit bla meh plop atf_check -s exit:1 -e inline:"nuageinit: Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh } From nobody Thu Sep 26 11:06:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDrPm6rmHz5X7ql; Thu, 26 Sep 2024 11:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDrPm5Vzdz4HNY; Thu, 26 Sep 2024 11:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vp3vMQSUvV9OhU59l5Nn5Yt45Hq1OXkxkXR0YpQlgsw=; b=D7ey+Do/gdvgSWPX9rfvkbuK/2Vln7zUucHn/EP1slXxgJq2nAaPZ+WO+QQ67n5MkdL6V2 USY/d6JEBEqQ5a6TDH3Hr2MS9GpWNveXE73c6FMj0HzwqP51C7aR9woYhJlPAOjlPpqSZg JTBbL4QrKoJmoQT6bsF/brIn4Ybx55h1bq01003yHSHTcoMLFo1/40+bJOeWQ975xDrBaJ je170siHDiCNRXozh9eCy9PhCii+LX/YVhi9HyrU7zQ0cE7CLBN3fz1lEuO/D7+rUt8K4T uFAqo+CqF33jPwY+5U61+WF7SqE0CAVjl3wcNEST4SQ8Nv7h6Cf8ZwL95c/lRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vp3vMQSUvV9OhU59l5Nn5Yt45Hq1OXkxkXR0YpQlgsw=; b=L8aqRiFfM0Xm24M3AWkp6OkltaexGnOzbl2i1/esbWBn2+5IijHw9be1FMN68kqGe4xy9I EGNa4i2lUVvTebBiWYMIyQ7p9LamNCU7kTJWx2Xwkcg33HOKEMGlHggQXQLbx22zp/zp0K KEex024B7IUPYOCn+yrt1+AZhYI+zBo9itWd1B2YFKl9/unXq/4NGH+Vz9HA+jmQ+qYdn9 zT0h4lKlgmDUTFVh6/DPVvjo2JtD9Cp8tUyXK1oy2fFA7UngEuH7NoFbZ0qqe+N703s0V/ 9JaNtm5jQHKu97VLbrQfc9n80hbH0fOeQPcGdkXtbLpMPS1q60J6RNIDy7otDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727348780; a=rsa-sha256; cv=none; b=qw4fsHXoRBje2nrd7PvvHxgRTg/mnRjoXtObzENgpqqKxgzZBCXhaoBI685vYNLHLH2pZh G029sl0LKra+s0udF7I7D6RgIBg40joB/Dq5qUbn3F9UkHazEG26GMH8CaMdJkdVbVdY4P PLQWphVPAqrTxYD1eOO5hUdIIjAPzd3GS4zFXjJbMU7Rp05r9GUlGxTUWL0jqOlG/dK9dh jVeosE6iyW0x0rlZIJ3iForzsv0K7zR6B6/Us2hYZqcoEl0OQBt32EXTXU305KbEocx900 TSr/XDIqI93YBZ3hCrqx2Fc4S/CrMELVAI9AtgHv7qk389HnWjGX/hNG429I5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDrPm4kZbzttG; Thu, 26 Sep 2024 11:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QB6KT4063592; Thu, 26 Sep 2024 11:06:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QB6KqW063589; Thu, 26 Sep 2024 11:06:20 GMT (envelope-from git) Date: Thu, 26 Sep 2024 11:06:20 GMT Message-Id: <202409261106.48QB6KqW063589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: b9ce743c5447 - main - nuageinit: Fix passwords List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9ce743c5447e90c2c97f4d49e048c301f708527 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b9ce743c5447e90c2c97f4d49e048c301f708527 commit b9ce743c5447e90c2c97f4d49e048c301f708527 Author: Jose Luis Duran AuthorDate: 2024-07-30 01:28:18 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 10:59:56 +0000 nuageinit: Fix passwords The hashed password usually contains a "$" sign, which, when used on a shell, must be escaped. Also, the plain text password may contain special characters that require escaping. Add a quick fix by enclosing it in single quotes. Note that if the plain text password contains a "'", it will still fail. This will be properly fixed in later commits. Some here documents require the document to be a string literal, especially when passing invalid characters. Enclose it in single quotes. Signed-off-by: Jose Luis Duran --- libexec/nuageinit/nuage.lua | 8 ++++---- libexec/nuageinit/tests/nuageinit.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index c27b66b23be2..4e21405a443b 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -120,11 +120,11 @@ local function adduser(pwd) local precmd = "" local postcmd = "" if pwd.passwd then - precmd = "echo " .. pwd.passwd .. "| " - postcmd = " -H 0 " + precmd = "echo '" .. pwd.passwd .. "' | " + postcmd = " -H 0" elseif pwd.plain_text_passwd then - precmd = "echo " .. pwd.plain_text_passwd .. "| " - postcmd = " -h 0 " + precmd = "echo '" .. pwd.plain_text_passwd .. "' | " + postcmd = " -h 0" end cmd = precmd .. "pw " if root then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 6b8ea7ff3328..434fb3095929 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -81,7 +81,7 @@ EOF wheel:*:0:root users:*:1: EOF - cat > media/nuageinit/user-data << EOF + cat > media/nuageinit/user-data << 'EOF' #cloud-config groups: - admingroup: [root,sys] @@ -103,11 +103,11 @@ cloud-users:*:1002: freebsd:*:1003: foobar:*:1004: EOF - cat > expectedpasswd << EOF + cat > expectedpasswd << 'EOF' root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh -foobar:H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh +foobar:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd From nobody Thu Sep 26 11:06:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDrPp3pT0z5X87r; Thu, 26 Sep 2024 11:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDrPp265hz4HWD; Thu, 26 Sep 2024 11:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EZ5Jg1IeL5spiSI5cjxZ+gB0MH/Z8pD0wulVGlshiCM=; b=llPEqPd43JJAIOYKv1YDIIcT7RIWSYK1lkD0y6OixU07eqVnzH2aAAKGa6hefvA1eX5+hO y9Qt0TxrL49c5JhhGYnRRHlLkacrI7fNBP9fxbO0+Uh72l3y6KRbou7opDq4BQvRKdgJpq xmhBZVIZ8XO53rkx/arrRSD9DRgULeoPo8cMaqfhIzv9uL0GqOiDno3F1zCRbK9pm2iRhq EjVf1Cy/JsBgrb7L88sd083veMHxjNu8lu+JmvhvMpJ62UMe0cfUL+6B38rD1CGaEL8Jgc wjbwzHD/bTH0iNpSBUQzBApISptpsnABUXFkA9a036JhxnwSd3nw7z1U0d38+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EZ5Jg1IeL5spiSI5cjxZ+gB0MH/Z8pD0wulVGlshiCM=; b=b8dRkBnBclK2kAnaSt5Z0dmeFCdkpp7baXZRo+JXe7CgbjZTqHsFWdsxJrhvrkBXy2D5ih WePsFsDxpLg1CiZ7xC9Ycn5LVrgP0PCo+nHonLBjhKf22xUY2/T46vFVBGXrrwgK41J8AJ Okohwz4Sdk0W9swMmIawEKCI+CKxHn2Yp/0tEPtHzlXYk5yvH/xYvUOhoGQFP3mY0WOtYS CRGKiyjFUysOia/LVMLwns9QVrlDcm0IK7a9PQZnXuTawqpJQXeE2DDXi/39TV4xK80NQ/ VFhclbtFfLEQdDRwiiZNFr5kDQnHbzXfejJsniljVmyTf9qYAO/Ky8DUPBobNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727348782; a=rsa-sha256; cv=none; b=TU51wOT9hgS0ns+qcqLYCjQOWjGgWvEyUWur3J94TZudobJqCo3Bh9RCNexjGLj7pOP3/g 4NUoiLBO0kI5vHILx5XYYx7CXH8GqqGE/HtgRNQzPla2kCIuHy5/4/XRKfUZcJ72rwQXkT juvzuLEQ30Uvinbv+U2bbBOwF+QegcQG+Kg7COdadZF6JQ4NShBDJdtQTcXyP+Kun+Dq6G H+6flS2ok7u1AinnrzesjC601Z1RStY0DKKnA3mboVktVfIzj4Q7fXUbhc3WPA8OeCeD1v v8PTmDkoPfl+9c3Wr/ZpnUHh2zrGFL7w2wJ5A923Jjxu7kKVGK4FEbwOCrNsnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDrPn5FjbztgB; Thu, 26 Sep 2024 11:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QB6L3x063628; Thu, 26 Sep 2024 11:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QB6L6p063625; Thu, 26 Sep 2024 11:06:21 GMT (envelope-from git) Date: Thu, 26 Sep 2024 11:06:21 GMT Message-Id: <202409261106.48QB6L6p063625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: e72457c4f516 - main - nuageinit: tests: Cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e72457c4f5166eef2a27249e02f3c1e9a1cf852d Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e72457c4f5166eef2a27249e02f3c1e9a1cf852d commit e72457c4f5166eef2a27249e02f3c1e9a1cf852d Author: Jose Luis Duran AuthorDate: 2024-07-30 03:26:21 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 11:00:16 +0000 nuageinit: tests: Cleanup - Export NUAGE_FAKE_ROOTDIR only once - Use the header section of the test to require the root user - Use the PWD environment variable - Set the root/sys shell as /bin/sh - Use RFC 5737 reserved IP addresses Signed-off-by: Jose Luis Duran --- libexec/nuageinit/tests/nuage.sh | 14 +-- libexec/nuageinit/tests/nuageinit.sh | 165 ++++++++++++++++------------------- 2 files changed, 83 insertions(+), 96 deletions(-) diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 6d8a2746de1f..293a0a4a9a83 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -4,6 +4,8 @@ # SPDX-License-Identifier: BSD-2-Clause # +export NUAGE_FAKE_ROOTDIR="$PWD" + atf_test_case sethostname atf_test_case addsshkey atf_test_case adduser @@ -11,7 +13,6 @@ atf_test_case addgroup sethostname_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" atf_check /usr/libexec/flua $(atf_get_srcdir)/sethostname.lua if [ ! -f etc/rc.conf.d/hostname ]; then atf_fail "hostname not written" @@ -32,14 +33,14 @@ addsshkey_body() atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys } +adduser_head() +{ + atf_set "require.user" root +} adduser_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir etc - printf "root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" > etc/master.passwd + printf "root:*:0:0::0:0:Charlie &:/root:/bin/sh\n" > etc/master.passwd pwd_mkdb -d etc etc/master.passwd printf "wheel:*:0:root\n" > etc/group atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua @@ -49,7 +50,6 @@ adduser_body() addgroup_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" mkdir etc printf "wheel:*:0:root\n" > etc/group atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 434fb3095929..f7f39ce32ad8 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -4,6 +4,8 @@ # SPDX-License-Identifier: BSD-2-Clause # +export NUAGE_FAKE_ROOTDIR="$PWD" + atf_test_case args atf_test_case nocloud atf_test_case nocloud_userdata_script @@ -27,56 +29,51 @@ args_body() nocloud_body() { - here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing nocloud.*" /usr/libexec/nuageinit ${here}/media/nuageinit/ nocloud - export NUAGE_FAKE_ROOTDIR=$(pwd) - printf "instance-id: iid-local01\nlocal-hostname: cloudimg\n" > ${here}/media/nuageinit/meta-data - atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -s exit:1 -e match:"nuageinit: error parsing nocloud.*" /usr/libexec/nuageinit "${PWD}"/media/nuageinit/ nocloud + printf "instance-id: iid-local01\nlocal-hostname: cloudimg\n" > "${PWD}"/media/nuageinit/meta-data + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname cat > media/nuageinit/meta-data << EOF instance-id: iid-local01 hostname: myhost EOF - atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check -o inline:"hostname=\"myhost\"\n" cat etc/rc.conf.d/hostname } nocloud_userdata_script_body() { - here=$(pwd) mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user-data - chmod 755 ${here}/media/nuageinit/user-data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data + printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user-data + chmod 755 "${PWD}"/media/nuageinit/user-data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud } nocloud_user_data_script_body() { - here=$(pwd) mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user_data - chmod 755 ${here}/media/nuageinit/user_data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data + printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user_data + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud } +nocloud_userdata_cloudconfig_users_head() +{ + atf_set "require.user" root +} nocloud_userdata_cloudconfig_users_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: @@ -94,7 +91,7 @@ users: groups: users passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud cat > expectedgroup << EOF wheel:*:0:root,freebsd users:*:1:foobar @@ -104,33 +101,33 @@ freebsd:*:1003: foobar:*:1004: EOF cat > expectedpasswd << 'EOF' -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF - sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd - atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd - atf_check -o file:expectedgroup cat ${here}/etc/group + sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" "${PWD}"/etc/master.passwd + atf_check -o file:expectedpasswd cat "${PWD}"/etc/master.passwd + atf_check -o file:expectedgroup cat "${PWD}"/etc/group } +nocloud_network_head() +{ + atf_set "require.user" root +} nocloud_network_body() { - here=$(pwd) mkdir -p media/nuageinit mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mynetworks=$(ifconfig -l ether) if [ -z "$mynetworks" ]; then atf_skip "a network interface is needed" @@ -138,7 +135,7 @@ EOF set -- $mynetworks myiface=$1 myaddr=$(ifconfig $myiface ether | awk '/ether/ { print $2 }') - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data cat > media/nuageinit/user-data << EOF #cloud-config network: @@ -149,51 +146,48 @@ network: match: macaddress: "$myaddr" addresses: - - 192.168.14.2/24 - - 2001:1::1/64 - gateway4: 192.168.14.1 - gateway6: 2001:1::2 + - 192.0.2.2/24 + - 2001:db8::2/64 + gateway4: 192.0.2.1 + gateway6: 2001:db8::1 EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud cat > network << EOF -ifconfig_${myiface}="inet 192.168.14.2/24" -ifconfig_${myiface}_ipv6="inet6 2001:1::1/64" +ifconfig_${myiface}="inet 192.0.2.2/24" +ifconfig_${myiface}_ipv6="inet6 2001:db8::2/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF cat > routing << EOF -defaultrouter="192.168.14.1" -ipv6_defaultrouter="2001:1::2" -ipv6_route_${myiface}="2001:1::2 -prefixlen 128 -interface ${myiface}" +defaultrouter="192.0.2.1" +ipv6_defaultrouter="2001:db8::1" +ipv6_route_${myiface}="2001:db8::1 -prefixlen 128 -interface ${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } + config2_body() { - here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 printf "{}" > media/nuageinit/meta_data.json - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > media/nuageinit/meta_data.json << EOF { "hostname": "cloudimg" } EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname } +config2_pubkeys_head() +{ + atf_set "require.user" root +} config2_pubkeys_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit touch media/nuageinit/meta_data.json cat > media/nuageinit/user-data << EOF @@ -203,26 +197,24 @@ ssh_authorized_keys: EOF mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } - +config2_pubkeys_user_data_head() +{ + atf_set "require.user" root +} config2_pubkeys_user_data_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit touch media/nuageinit/meta_data.json cat > media/nuageinit/user_data << EOF @@ -232,15 +224,15 @@ ssh_authorized_keys: EOF mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } @@ -292,7 +284,6 @@ EOF config2_network_body() { - here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json mynetworks=$(ifconfig -l ether) @@ -322,7 +313,7 @@ cat > media/nuageinit/network_data.json << EOF "type": "ipv6", "link": "iface0", // supports condensed IPv6 with CIDR netmask - "ip_address": "2001:cdba::3257:9652/24", + "ip_address": "2001:db8::3257:9652/64", "gateway": "fd00::1", "routes": [ { @@ -341,11 +332,10 @@ cat > media/nuageinit/network_data.json << EOF ] } EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > network << EOF ifconfig_${myiface}="DHCP" -ifconfig_${myiface}_ipv6="inet6 2001:cdba::3257:9652/24" +ifconfig_${myiface}_ipv6="inet6 2001:db8::3257:9652/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF @@ -354,13 +344,12 @@ ipv6_defaultrouter="fd00::1" ipv6_route_${myiface}="fd00::1 -prefixlen 128 -interface ${myiface}" ipv6_static_routes="${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } config2_network_static_v4_body() { - here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json mynetworks=$(ifconfig -l ether) @@ -402,9 +391,7 @@ cat > media/nuageinit/network_data.json << EOF ] } EOF - - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > network << EOF ifconfig_${myiface}="inet 10.184.0.244 netmask 255.255.240.0" EOF @@ -413,8 +400,8 @@ route_cloudinit1_${myiface}="-net 10.0.0.0 11.0.0.1 255.0.0.0" defaultrouter="23.253.157.1" static_routes="cloudinit1_${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } atf_init_test_cases() From nobody Thu Sep 26 11:06:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDrPq24LYz5X7qr; Thu, 26 Sep 2024 11:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDrPq0Jg9z4HLN; Thu, 26 Sep 2024 11:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4JAbgvYWgEGZ8MxgBMvaRx/0gMmVTrHKXf2D+pl5bsU=; b=Uz7uBLZbyrnDk8PUs2LywC2GZBA+VTJJcTPpqg/7/ejQzXJtjrDu4vXB745r1y1TL81jvV hE2kveXFRsXUVmHZF4ojZMWIzuexw3pJFheHrDiJ019KqnVbvgm+O6o7TQAbDWuu3ECvwC 5ZqOUhuj8EYV/U6b3f4/AxQQA3bVBIQx8hfpKp0ixq6JgX52xiOhSGjl+JQaCr7gkytkDu Hmh3ItvPlpHLhxtTHHGlpFlB/3gGkZ3dSWuPd2x8LupYXRPU9a6I3nhpYPwJJhqbIU7IoE SgBFzVdVqScan21rk6H9wwyaCUmJTbJjLRpMmXJEVz9P1SoM1i5hcRJvV6d6BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727348783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4JAbgvYWgEGZ8MxgBMvaRx/0gMmVTrHKXf2D+pl5bsU=; b=AIIavwOH52XHqOOVJ1T3KBCBFjKi1NZdIeMCmSXNMX4UveMILTjVdqepSBimuLAzpgeePp +kPp4iXUT66xqmKZyeBleV2rzX2gJAVHkx1Dyfhr5JKGOo5yZoB8cRubmkWCUTRnaXiq0X v8OHqQYv6oZy6iP52D4EG0Z7JydnqrDfZABq/vvA6FAMHUR60UU/Zqt4Db+af1VoN1d3+H AwYkYgHpFpld32mu2y7QHLORMXRhSNV0G6DavVYnXlEHQvfqGyBDTZXq6XLTRQypFSz+Mi TU1EX1tfPZ7ishjHyWZLnPF4stOQu1ljgcJOuXb4KYE6hQRG2mrzCFf9l6/L3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727348783; a=rsa-sha256; cv=none; b=EryYGgr1BVpTHpGnLzTWJN/o1tWjyyVZsUthdn5690pOylIN3ITWfr4LJmuoZzFQeBmvKi xY9fna+/L3Ztz4wiI2gjcVBPmztc/RxsMwFdYYA2HJ8ZsswZWDi8PXfqEcBUAWG86KWzNr YZWOb4CrdSzSROhFXv0kOzJqqMFoFUDa0Yke7H8coD8U1meREfXR71YMp7i7LWo9nXxUgm 3XRNtZ2TRXYhOjLh/gIz1VRa8ii7kevf4uHSywCygJcujk+7rvlnyQ63b8Li3CHyn+E/kh r/PtCHSHJMOG/OrqBfiXj8oUVk6Fc09WauxLXIm3pFt0vw3m02R4D8FtarG+OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDrPp6PwTzttJ; Thu, 26 Sep 2024 11:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QB6MK3063678; Thu, 26 Sep 2024 11:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QB6Mmn063675; Thu, 26 Sep 2024 11:06:22 GMT (envelope-from git) Date: Thu, 26 Sep 2024 11:06:22 GMT Message-Id: <202409261106.48QB6Mmn063675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 120740221fd4 - main - release: basic-cloudinit improve default image List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 120740221fd4a4577e63e6c279f9873cabe449d0 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=120740221fd4a4577e63e6c279f9873cabe449d0 commit 120740221fd4a4577e63e6c279f9873cabe449d0 Author: Jose Luis Duran AuthorDate: 2024-07-30 04:47:04 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-26 11:01:03 +0000 release: basic-cloudinit improve default image - Add the firstboot-freebsd-update package, as long as we do not have pkgbase, this is needed - Support SLAAC by default to complement DHCPv4 (use SYNCDHP instead) Signed-off-by: Jose Luis Duran --- release/tools/basic-cloudinit.conf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/release/tools/basic-cloudinit.conf b/release/tools/basic-cloudinit.conf index da4bed5ea5b5..a03c11603ed6 100644 --- a/release/tools/basic-cloudinit.conf +++ b/release/tools/basic-cloudinit.conf @@ -1,6 +1,4 @@ #!/bin/sh -# -# # Should be enough for base image, image can be resized in needed export VMSIZE=5g @@ -9,13 +7,17 @@ export VMSIZE=5g export CONFIG_DRIVE=YES export CONFIG_DRIVE_SIZE=1M +# Packages to install into the image we're creating. +# * firstboot-freebsd-update, to install security updates at first boot. +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} firstboot-freebsd-update" + # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="sshd growfs nuageinit" +export VM_RC_LIST="${VM_RC_LIST} firstboot_freebsd_update growfs sshd nuageinit" vm_extra_pre_umount() { cat << EOF >> ${DESTDIR}/etc/rc.conf dumpdev="AUTO" -ifconfig_DEFAULT="DHCP" +ifconfig_DEFAULT="SYNCDHCP accept_rtadv" sshd_enable="YES" EOF @@ -25,7 +27,8 @@ beastie_disable="YES" loader_logo="none" console="comconsole,vidconsole" EOF - cat <> ${DESTDIR}/etc/ssh/sshd_config + + cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config PasswordAuthentication yes UsePAM no EOF From nobody Thu Sep 26 14:06:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDwPC5Y8Sz5XLQ2; Thu, 26 Sep 2024 14:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDwPC50dlz4WwB; Thu, 26 Sep 2024 14:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727359567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wHP49xdt/yXE5Muip5GdaZknh2S+Wozvf7nhKBo1YcM=; b=Kg4A2kMLdp7K4ZSYd0WzPJSCEbwVs6RcujpF2OwPS7BPnWuNoy76czYmeM56yHEQQxSTBB 8JluaRsQNbaR7QM/fjbfB6CarDrGOZKftXFVTEWMoVzwypyBNw0tQXiO2z4viAPjlsSNY1 C4bAxbP7Bi2SsPnju7ZMUsbiP62cTpRm5a4D2bBUa9gnqzhYGsRRvGq/doX4VSVgX3+qdB wdH1cwoO73lrXR/tz85+7XayGtwn01ogekAajAbC4Og9jPfrHHCmFx0qvamROB3y7KQ2po YdwvL6ChULcXlRu4jbwBeTojgVrpTbWbNHovTcJr0WnfgL1nvz97DJmBP+JioA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727359567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wHP49xdt/yXE5Muip5GdaZknh2S+Wozvf7nhKBo1YcM=; b=f4WAgH34mMUy6iacXKsSZCWp6EQsF71l+lgaC+2s+nuJVZvW9M90PyzrgxZit4IyntALZF ufJ8/bThiWWsFM/sF4s6wwn/5HL0C5BQS6K9fdl200ju75Z87SuS1DvRv91YASZp2FoIP2 OOnoW/z9z3v6HzBVGcHh4p6M3UD6gACXwbtba8sBnOD3hbGayN/ta7RUXCRIi+gGYzzEBV AnTcFjdiW58oB4kdTjX9UudGYtt3qFWs4V+4Qyxk5ySKnhq/MuRF5j7JSJdqRwH9gQt2JK vanwfGvvcZXnWj6OlkSqew4S7+eGZPWsJSGacVvHInsScnnmvcF1KyZWjwLzsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727359567; a=rsa-sha256; cv=none; b=RKzEJieh1kPqVlPp462j5rxwVxRka7cVAPqSul3oGcbKxyt9GSrcC6vjtrP4aFhIuZUgug 2SBMouMmenUAEvnmvHEZyAOdmGqeJzkc24vYGQP2webQhghIEuEHFZv+7h3kGJDNR5Lzvv YEcP3e6t9yoq3EX9wznfutj3PAZ8ESMJbzJdWBZ50qIBPe3yLGtWW7DivbB8MeKtTsmYM+ 7ft63dnxiOehqU400DyAl7FiJO7u1uvJppFCUqQWT+LEa7Qj0+bbjAfqe9uDFvUY2dPgHx ebVSOzlxKQSxRcic8NsJyynOgoW2Jym/Xu2MENaK1YJ3cQ4pdLWjOeoqV+3ewg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDwPC4Sqyz108D; Thu, 26 Sep 2024 14:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QE67CR069162; Thu, 26 Sep 2024 14:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QE6723069159; Thu, 26 Sep 2024 14:06:07 GMT (envelope-from git) Date: Thu, 26 Sep 2024 14:06:07 GMT Message-Id: <202409261406.48QE6723069159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 21525fe03c05 - main - sdhci: Add sysctl to report quirks on the slot List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21525fe03c05cebb951214e78e411a3040e8a798 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=21525fe03c05cebb951214e78e411a3040e8a798 commit 21525fe03c05cebb951214e78e411a3040e8a798 Author: Justin Hibbits AuthorDate: 2024-09-25 21:35:50 +0000 Commit: Justin Hibbits CommitDate: 2024-09-26 13:58:54 +0000 sdhci: Add sysctl to report quirks on the slot Summary: It can be useful to see what quirks are applied on an SDHCI slot. Obtained from: Juniper Networks, Inc. Reviewed By: manu Differential Revision: https://reviews.freebsd.org/D46790 --- sys/dev/sdhci/sdhci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index c747f54cb32c..0be20e7aa523 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -1149,6 +1149,9 @@ no_tuning: SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, node_name, CTLFLAG_RW, 0, "slot specific node"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(node_oid), + OID_AUTO, "quirks", CTLFLAG_RD, &slot->quirks, 0, "Slot quirks"); + node_oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(node_oid), OID_AUTO, "debug", CTLFLAG_RW, 0, "Debugging node"); From nobody Thu Sep 26 15:18:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDy0x73JBz5XQG1; Thu, 26 Sep 2024 15:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDy0x6TwMz4jmd; Thu, 26 Sep 2024 15:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727363921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yY5swstHorbRrfwmRL2NHyQ4QFUHfQ5R738mDpXbAUk=; b=GAH5f3m2FZJeNsoZqU2Ebrr4bBrQoQEiShqt72hYwG9Chzd+Vw7y0AblRJOyEmTLP87HWT AQd4iaAVXjJljHSORNcJu2U05cc00xW69CjlbpabaC0pV4ys01DWVA/w7rYV0Vfn5k8wzg Nzb0r5KcI+MneIPjrx1/X3ZeZ1PmA1UiOnsaLuVwNA83+lP9HwdvuB1Vo9j6/k4dT81MIV PY1gj0GHWOErTKJo/rumoebL0UjynlFnBYLhHrZloxm+aOtcHot6PY2CsaKffVywxDuln2 XQpcKwFcGWywCs5QYQq8STiUOBwOMyU7uyOMD5ifxm0BEecPoL6OrjoSABvJog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727363921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yY5swstHorbRrfwmRL2NHyQ4QFUHfQ5R738mDpXbAUk=; b=l6Sj0ug15Duz/ulJJkQo4CF7NVHD7ErcsoEUshw+7ToWLpUQe7eiJAkOIerFjQec7wSNr0 pJmvem6N/f9VvvcW1lUYOmo8rwpBjGBoTJ1y1L4hUcEvT29hpybmICFuDfiyZ6THOLYITX Cu7Eqy0yuOdm5iGHmfDYzN1IT89d6sZ1L+fr4GkP6sFJrCC9ST1SXZmPGFxHiMmtCQ3rQn DwUL2ScoTde1wY5+Atop5WGC1hlxvUKCVO9BPVmOhVHqJsTdiazMa8WMHac8nuPoW9tQZG DW98Tut0iIVsF0yA2tsHYQseJg9JN8+RmfeI1z2NEBEWMzYLVmbgSZMjQDEmOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727363921; a=rsa-sha256; cv=none; b=OHah5TrK/ShiTrFr7sVLz4X5k0b+heOGAMHmirLXzk7Zv+hIlEb+HtoZbfrctE2vNUNFkj Ujj9z1dUcuM2SN6nadPH/4f3hg5zacDoHA7MYI1Khdrg/wuF4QsIUlFrDxjnOIR+rQT+Ky nfuMpXqkPXejp7CzpyVQP2sm2BIBNpgpHnzTKigSsvyU6MEWmOyTD9tRC975YB7RmmDAaB zXCyyUzf4BXXRNQSCY/iEJs45xbSfdDvxmL34OCRusclan4z20FGHQRq4CJy0qWFEqMrWY Su/+fk3TvR9mMtCuCsCOA50GLxTNqb3O3Hz4UOnNO0mULzdRY5pCRB8kj1YHPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDy0x5zZhz12HJ; Thu, 26 Sep 2024 15:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QFIfWA088340; Thu, 26 Sep 2024 15:18:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QFIfWb088337; Thu, 26 Sep 2024 15:18:41 GMT (envelope-from git) Date: Thu, 26 Sep 2024 15:18:41 GMT Message-Id: <202409261518.48QFIfWb088337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f28d5ac5c4a4 - main - pf tests: fix max_states test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f28d5ac5c4a498883b626db163c86b5112889078 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f28d5ac5c4a498883b626db163c86b5112889078 commit f28d5ac5c4a498883b626db163c86b5112889078 Author: Kajetan Staszkiewicz AuthorDate: 2024-09-26 14:48:57 +0000 Commit: Kristof Provost CommitDate: 2024-09-26 14:50:45 +0000 pf tests: fix max_states test Ensure our rule with '(max 3)' only matches the TCP states we're counting. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46795 --- tests/sys/netpfil/pf/max_states.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/netpfil/pf/max_states.sh b/tests/sys/netpfil/pf/max_states.sh index 677d6f473d97..03142eeaffa6 100755 --- a/tests/sys/netpfil/pf/max_states.sh +++ b/tests/sys/netpfil/pf/max_states.sh @@ -39,14 +39,14 @@ max_states_body() pft_set_rules router \ "block" \ - "pass quick inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ - "pass in on ${epair_tester}b keep state (max 3)" \ - "pass out on ${epair_server}a keep state" + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in on ${epair_tester}b inet6 proto tcp keep state (max 3)" \ + "pass out on ${epair_server}a inet6 proto tcp keep state" - # The exact limit is off by 1 ping_dummy_check_request exit:0 --ping-type=tcpsyn --send-sport=4201 ping_dummy_check_request exit:0 --ping-type=tcpsyn --send-sport=4202 - ping_dummy_check_request exit:1 --ping-type=tcpsyn --send-sport=4203 + ping_dummy_check_request exit:0 --ping-type=tcpsyn --send-sport=4203 + ping_dummy_check_request exit:1 --ping-type=tcpsyn --send-sport=4204 } max_states_cleanup() From nobody Thu Sep 26 15:23:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDy6Q5pSHz5XQtF; Thu, 26 Sep 2024 15:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDy6Q5Dtnz4kc4; Thu, 26 Sep 2024 15:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727364206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcvwuZ3hqj5S3Zwqyh93LFDpRq7cTd5UXi1Sz6GqE6Q=; b=k2NAB+qYkl5MlQkUTcZgKX5Ym4tn67L3qTstEwFUtIXIxksZXE6MZXbUl4RPZXHkSbEcw+ yf8uTibaFtyk34D2iZ2XnuYQGzm3x261Ls38oHB6QPWLqKQmfZMMkBi74EgIisjwtsqaf1 24C7soEMBOfkH58TjxP1/6WDexE4Yr59DhyLizQlD7bu/NXNHD2FcGt6VFAqTHENX3MFyv bFbGa2eouCM+jE+XoDQjk1SnySSEi+x3U/x8rpWTspJY2Mye1ifxkj4VuoE0ANj0bZMc46 K6N8QyT+GKDRuob9oHKB6Ll54F0WDT8vYygKj3OczwxPpIOKtVX3R0XDi0LVWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727364206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcvwuZ3hqj5S3Zwqyh93LFDpRq7cTd5UXi1Sz6GqE6Q=; b=FPwS9iiSo1avgga9xHOBE9Z0grsNt/ojaB3HiQnxTzgk2XBFhgus8F1DGDUlspM7Ma9YfE f1FFhX6FIHXWC6mUQj5jTReRIKaAoUWp0JnC9MSqadktXYmWSnaopV+U1ZRmt0KE4UF4VS TCVgOeeY9/ZPliQNDusYgSDHrAt1tYPKu2XU5uK1lM3pTlzpvt3xXBKQWv6oDCbJlx9ofI lTL3XUFhWn1fFy/QI8xLvN0p/sKSpYS2QQ/6Vf8N2av+Gs/aI2i5MyAQHqz/OnVCkus9vI 9NQZi8EJRqzp5TK/LQcfgk0vh3EnhGZw+5xbRHJybnNjhvvVexA41wsNg9jfVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727364206; a=rsa-sha256; cv=none; b=JKMuU6kpyXSDJm+NYmk2+7kFQYBX7xev9PGWDcAL/AdrfyISbERtBokvFMYbHRTh97Ok/Z DZghWYoHLlnznYdazdF4/nauLzU23oJ2fJdbJvoyvULdbFSxFMGFncB618sR7o86kgwC4A PZS9+/O458BNmmM1oFNUu/p1om3RCnp1Ws/P1S2vAUnXevQPrLDmOuzW87C1o2XJmZIeE7 AMLeQgSPJpvwbp6TCOvm4Pm0amgVMSgBgDxrqAGiECJubmpmqR+0lPljpvJE1amK1SUI1F 9Sogr/H721sYRDr8poC8TJDmdIBPOZU4u0vXk4UooM1Kxxi5poD+gFmdD0M0IA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDy6Q4lBPz12JC; Thu, 26 Sep 2024 15:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QFNQWB004463; Thu, 26 Sep 2024 15:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QFNQ0u004460; Thu, 26 Sep 2024 15:23:26 GMT (envelope-from git) Date: Thu, 26 Sep 2024 15:23:26 GMT Message-Id: <202409261523.48QFNQ0u004460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Rabson Subject: git: a3d5dec42007 - main - release(7): fix the spelling of git.FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3d5dec42007a74bfc38a0210a80a3f77efb8cb7 Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=a3d5dec42007a74bfc38a0210a80a3f77efb8cb7 commit a3d5dec42007a74bfc38a0210a80a3f77efb8cb7 Author: Doug Rabson AuthorDate: 2024-09-26 15:20:42 +0000 Commit: Doug Rabson CommitDate: 2024-09-26 15:20:42 +0000 release(7): fix the spelling of git.FreeBSD.org --- share/man/man7/release.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 0a56f0762591..c81f540d9463 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -150,7 +150,7 @@ The .Xr git 1 host used to check out the various trees. Defaults to -.Pa https://git.FreeeBSD.org . +.Pa https://git.FreeBSD.org . .It Va SRCBRANCH The .Li src/ From nobody Thu Sep 26 20:38:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XF55P57q4z5Xkw5; Thu, 26 Sep 2024 20:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XF55P4ddhz4G7L; Thu, 26 Sep 2024 20:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727383081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7et0GZSfrFZOaCgzCclb/BQ0by4QPdiE0W54n+yy4LM=; b=V5iitLLxpgrQmHAA2ILgjvczdHJO8wlDpf09I205CF9nvnwKU3aksXbX77EXGXQ6Gz62DR 2sOgpTtksTFgf0WnQ31G5xzSagvmcEj6PsCjDOwoWk1BlP1g971GsAsH8eMi60UharDa9s E1+IKNBixB4TjRSp+2MO1MHwdZHbAwBI7KDnGzUZHdQ39HZy9aYDf8ti+ekHzemkX0f7U5 jo8H3MCaLj1SCGKbOosZZEYZAJLmAEV0NWj1HGKdT4gFJ6R7Yt6ZQqJNIz4+6e9d+MWiI/ RBxzto/neNM5/Ka1sWhMNC7fkVxBLqIrndyFdN6w35m1+gSvaqh92cnrYuoCnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727383081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7et0GZSfrFZOaCgzCclb/BQ0by4QPdiE0W54n+yy4LM=; b=b1n1+imuIewFG11EFMSD7HNuTrQYfuFbF6aGhQW+d2mz3G3dDkVeQLPMHLs5w060D5t9JO qw7iDobIzEe7ZYlibN/fhx2D01bK3K9wavnvWz0CInwOEGCD1QhCjIPljNIEbx6+3bxH2L 6mzonexNwpG45bL3GEWdf47xlcKzyI+tYreZEhgmdIE5IHqTpLdqXO7amFpUG/PiVyiWtE PvHQk+wTOkq7EkjRWV6vHMbpyrEaCQx2fRtcoAM5D+2lwN9/kc+pLP5IVaZIaHpK/75XER 0HubjIygZP33M83neC/schG4wPD4UMyZWkmyftMcHz+OebhZ8zMVUG6WYGg+9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727383081; a=rsa-sha256; cv=none; b=Li6oMAWupgwl8as2S9JgKi5pzpja36N3oxLRRQrhq8U8FU/zxPFlY93qOH18Vnt0Wq10qc aq10AQlWG/XtHvhfNSnitZAZmaDCwTWgFmIGCveq0KXOyNk2ROod06yUZQLkudPgyYARYd Fkmnv6uHUowS4X+5NxiRY5RfL6Y56hVx8gpWnZwQux7F407Rj0nVlt0YMxVwYQbHYx/50y gi/rQtvDebNiimHR/yBg4e3t8HRkITFbF62C9tm/TrVtXhRmV20bnEc38rXjX7es/0EFs+ hYvgmJ6v+wPWEH7jfjFzwPVG7WBKr0pJA4cZvZNGhS3vT0YqGdAZdEU1/o4n2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XF55P448Cz19S1; Thu, 26 Sep 2024 20:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QKc1wq029148; Thu, 26 Sep 2024 20:38:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QKc17r029145; Thu, 26 Sep 2024 20:38:01 GMT (envelope-from git) Date: Thu, 26 Sep 2024 20:38:01 GMT Message-Id: <202409262038.48QKc17r029145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 71fa171c6480 - main - bhyve: Initialize stack buffer in pci_ahci List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71fa171c6480d60f4d9c01dea1c71a7249e7b8ab Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=71fa171c6480d60f4d9c01dea1c71a7249e7b8ab commit 71fa171c6480d60f4d9c01dea1c71a7249e7b8ab Author: Pierre Pronchery AuthorDate: 2024-07-23 14:34:03 +0000 Commit: Ed Maste CommitDate: 2024-09-26 18:06:10 +0000 bhyve: Initialize stack buffer in pci_ahci In the function ahci_handle_dsm_trim, if the call to read_prdt fails, the variable buf[512] is used while it contains uninitialized data. It is easy to make the call to read_prdt fail, for instance if hdr->prdtl == NULL, the function will return without writing anything in buf. In addition, this code could be hardened by checking the value of done before accessing &buf[done]. Reported by: Synacktiv Reviewed by: markj Security: HYP-15 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46090 --- usr.sbin/bhyve/pci_ahci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index 636df5c6e9b1..87a8212b9fb7 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -781,7 +781,7 @@ ahci_handle_flush(struct ahci_port *p, int slot, uint8_t *cfis) assert(err == 0); } -static inline void +static inline unsigned int read_prdt(struct ahci_port *p, int slot, uint8_t *cfis, void *buf, unsigned int size) { @@ -808,6 +808,7 @@ read_prdt(struct ahci_port *p, int slot, uint8_t *cfis, void *buf, to += sublen; prdt++; } + return (size - len); } static void @@ -820,6 +821,7 @@ ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done uint32_t len, elen; int err, first, ncq; uint8_t buf[512]; + unsigned int written; first = (done == 0); if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { @@ -831,9 +833,12 @@ ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done len *= 512; ncq = 1; } - read_prdt(p, slot, cfis, buf, sizeof(buf)); + written = read_prdt(p, slot, cfis, buf, sizeof(buf)); + memset(buf + written, 0, sizeof(buf) - written); next: + if (done >= sizeof(buf) - 8) + return; entry = &buf[done]; elba = ((uint64_t)entry[5] << 40) | ((uint64_t)entry[4] << 32) | From nobody Thu Sep 26 20:56:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XF5VF15dRz5Xltv; Thu, 26 Sep 2024 20:56:05 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XF5VD5bTVz4Jv4; Thu, 26 Sep 2024 20:56:04 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727384164; 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=I3WBCbvr48rbEtut0OH6zcjmuTM5z6WyyYJzi+nQtrA=; b=lKVQdtSq3+dAAuzfB0qhZgN2ytrWNcLUDYqWmLITLvYenBwiT7nYAvXQkqtRxxFg9+GUAi aEMH8JQy9op9JED4NC7f42hQyfSaBvF224QiiLW8YqL0PJqKfTb+OjiY5nzmoIex1zvz4y B3X8qgLE2VIIOIMN5t3zy15by6bEhzGOqfb8EkV0yVl/+I0Wm/8HwRZ1kgiQmTOQjPhT7o sgCZpAbUhsCT8zu6Aabyi+KowC2Y7TxYKPtAVMo5pzvH+PE6RqqYjmeWmGbSv9sea1LL78 AnwCtEqGWyeTtO6ugCu0vRJoQHujN8AgWeb6DMF5cbid14DciSnWYgc2mZsfGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727384164; 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=I3WBCbvr48rbEtut0OH6zcjmuTM5z6WyyYJzi+nQtrA=; b=LdER6LjdDnENrPe2wu2oMFSrbDDVspFx3kecllGDOqiDvb3BC7YdKlnuNTAoQrLhtuB/5J 8dZaVjUTHyNQQ0/+/n87TykiICIIwCrK4ByYwO3G0LzMZCwSYlUFIStvEyS+KNSXKYKJK6 S8+Mtqt5pSM8I+qtCjVvQlY0GWg6yzbwL+Sqiarom3RAxIL2yOWvh4ry6uedbUJTWLwdN7 sQVAiPwB2AHL75a3G3s1K2bI6kQ/SE1HqChyd9y6i1m59HNlKjj1kwStRmAPwlRlfuC/uy eYE1QQffFx0dNEiVuU6+K+mnSOGTjG8uDTlVxF14ZeUsS67KJ+CNFLzn199U4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727384164; a=rsa-sha256; cv=none; b=LJw8fU1g0A7Mn0Jzdtl27e+xfEwQNZKrDEuuOXWeSzCteE2A324OukldRlsNCstm48pbE3 gTxv+5exPp8QEzTchQVlZdjdZtnTEcpBj5okdOTMN70xeiqKfZxUhIegeZejzBsOSMkE/x FLIua2JbBgC0xJqeE/C8ODkpkYHVMxRIHWg8KVPRY+lTLvfWrUbXRYEYz3Gt4PUW38b69B OcDoZCqF/lbnCXlD3h//xuZ+L5ObnouHwmi8qjRZGoHZLuTg1X7nBHqDwglDKYadqtjTUi IZDv/3MqFxwqdXBNqOeM+eseP0maC4+yAP2VHcRXP1dzj/lUsrshfElN/F0iVA== Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XF5VD3ZynzSlL; Thu, 26 Sep 2024 20:56:04 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 8F152120BDC; Thu, 26 Sep 2024 22:56:01 +0200 (CEST) Date: Thu, 26 Sep 2024 22:56:01 +0200 From: Baptiste Daroussin To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: cf73401c4f7a - main - diff3: Fix merge mode. Message-ID: References: <202409251715.48PHFLuQ047265@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202409251715.48PHFLuQ047265@gitrepo.freebsd.org> On Wed 25 Sep 17:15, Dag-Erling Smørgrav wrote: > The branch main has been updated by des: > > URL: https://cgit.FreeBSD.org/src/commit/?id=cf73401c4f7af063c91a0c8e4d5b46e08f06db87 > > commit cf73401c4f7af063c91a0c8e4d5b46e08f06db87 > Author: Dag-Erling Smørgrav > AuthorDate: 2024-09-25 17:14:32 +0000 > Commit: Dag-Erling Smørgrav > CommitDate: 2024-09-25 17:14:55 +0000 > > diff3: Fix merge mode. > > This is mostly thj@'s work, with some tweaks and cleanup by me. There > are still some cases where our output differs from GNU diff3, but it's > much better than before and I'd rather commit what I have now than let > it continue to languish in a metaphorical drawer. > > MFC after 3 weeks > Sponsored by: Klara, Inc. > Reviewed by: thj > Differential Revision: https://reviews.freebsd.org/D46762 > --- > usr.bin/diff3/diff3.c | 255 +++++++++++++++++++++++++++++++++++--------------- > 1 file changed, 179 insertions(+), 76 deletions(-) > > diff --git a/usr.bin/diff3/diff3.c b/usr.bin/diff3/diff3.c > index c72ea0747589..f20b1d74678d 100644 > --- a/usr.bin/diff3/diff3.c > +++ b/usr.bin/diff3/diff3.c > @@ -79,7 +79,6 @@ > #include > #include > > - > /* > * "from" is first in range of changed lines; "to" is last+1 > * from=to=line after point of insertion for added lines. > @@ -90,6 +89,7 @@ struct range { > }; > > struct diff { > +#define DIFF_TYPE1 1 > #define DIFF_TYPE2 2 > #define DIFF_TYPE3 3 > int type; > @@ -147,6 +147,7 @@ static void keep(int, struct range *); > static void merge(int, int); > static void prange(struct range *, bool); > static void repos(int); > +static void separate(const char *); > static void edscript(int) __dead2; > static void Ascript(int) __dead2; > static void mergescript(int) __dead2; > @@ -154,7 +155,7 @@ static void increase(void); > static void usage(void); > static void printrange(FILE *, struct range *); > > -static const char diff3_version[] = "FreeBSD diff3 20220517"; > +static const char diff3_version[] = "FreeBSD diff3 20240925"; > > enum { > DIFFPROG_OPT, > @@ -189,49 +190,110 @@ usage(void) > "[-L label3] file1 file2 file3\n"); > } > > +static int > +strtoi(char *str, char **end) > +{ > + intmax_t num; > + > + errno = 0; > + num = strtoimax(str, end, 10); > + if ((end != NULL && *end == str) || > + num < 0 || num > INT_MAX || > + errno == EINVAL || errno == ERANGE) > + err(1, "error in diff output"); > + return (int)num; > +} > + > +/* > + * Read diff hunks into the array pointed to by *dd. > + * > + * The output from `diff foo bar` consists of a series of hunks describing > + * an addition (lines in bar not present in foo), change (lines in bar > + * different from lines in foo), or deletion (lines in foo not present in > + * bar). Each record starts with a line of the form: > + * > + * a[,b]xc[,d] > + * > + * where a, b, c, and d are nonnegative integers (b and d are printed only > + * if they differ from a and c, respectively), and x is either 'a' for an > + * addition, 'c' for a change, or 'd' for a deletion. This is then > + * followed by a series of lines (which we ignore) giving the added, > + * changed, or deleted text. > + * > + * For an addition, a == b is the last line in 'foo' before the addition, > + * while c through d is the range of lines in 'bar' to be added to 'foo'. > + * > + * For a change, a through b is the range of lines in 'foo' to be replaced > + * and c through d is the range of lines in 'bar' to replace them with. > + * > + * For a deletion, a through b is the range of lines in 'foo' to remove > + * and c == d is the line in 'bar' which corresponds to the last line > + * before the deletion. > + * > + * The observant reader will have noticed that x is not really needed and > + * that we can fully describe any hunk using only a, b, c, and d: > + * > + * - an addition replaces a zero-length range in one file with a > + * non-zero-length range from the other > + * > + * - a change replaces a non-zero-length range in one file with a > + * non-zero-length range from the other > + * > + * - a deletion replaces a non-zero-length range in one file with a > + * zero-length range from the other > + */ > static int > readin(int fd, struct diff **dd) > { > int a, b, c, d; > - size_t i; > + int i; > char kind, *p; > FILE *f; > > f = fdopen(fd, "r"); > if (f == NULL) > err(2, "fdopen"); > - for (i = 0; (p = getchange(f)); i++) { > + for (i = 0; (p = getchange(f)) != NULL; i++) { > + if ((size_t)i >= szchanges - 1) > + increase(); > #if DEBUG > (*dd)[i].line = strdup(p); > #endif /* DEBUG */ > > - if (i >= szchanges - 1) > - increase(); > - a = b = (int)strtoimax(p, &p, 10); > - if (*p == ',') { > - p++; > - b = (int)strtoimax(p, &p, 10); > - } > + a = b = strtoi(p, &p); > + if (*p == ',') > + b = strtoi(p + 1, &p); > kind = *p++; > - c = d = (int)strtoimax(p, &p, 10); > - if (*p == ',') { > - p++; > - d = (int)strtoimax(p, &p, 10); > - } > + c = d = strtoi(p, &p); > + if (*p == ',') > + d = strtoi(p + 1, &p); > + if (*p != '\n') > + errx(1, "error in diff output"); > if (kind == 'a') > a++; > - if (kind == 'd') > + else if (kind == 'c') > + /* nothing */ ; > + else if (kind == 'd') > c++; > + else > + errx(1, "error in diff output"); > b++; > d++; > + if (b < a || d < c) > + errx(1, "error in diff output"); > (*dd)[i].old.from = a; > (*dd)[i].old.to = b; > (*dd)[i].new.from = c; > (*dd)[i].new.to = d; > + if (i > 0) { > + if ((*dd)[i].old.from < (*dd)[i - 1].old.to || > + (*dd)[i].new.from < (*dd)[i - 1].new.to) > + errx(1, "diff output out of order"); > + } > } > - if (i) { > - (*dd)[i].old.from = (*dd)[i - 1].old.to; > - (*dd)[i].new.from = (*dd)[i - 1].new.to; > + if (i > 0) { > + (*dd)[i].old.from = (*dd)[i].old.to = (*dd)[i - 1].old.to; > + (*dd)[i].new.from = (*dd)[i].new.to = (*dd)[i - 1].new.to; > } > fclose(f); > return (i); > @@ -264,7 +326,7 @@ getchange(FILE *b) > { > char *line; > > - while ((line = get_line(b, NULL))) { > + while ((line = get_line(b, NULL)) != NULL) { > if (isdigit((unsigned char)line[0])) > return (line); > } > @@ -305,15 +367,23 @@ merge(int m1, int m2) > d2 = d23; > j = 0; > > - while (t1 = d1 < d13 + m1, t2 = d2 < d23 + m2, t1 || t2) { > + for (;;) { > + t1 = (d1 < d13 + m1); > + t2 = (d2 < d23 + m2); > + if (!t1 && !t2) > + break; > + > /* first file is different from the others */ > if (!t2 || (t1 && d1->new.to < d2->new.from)) { > /* stuff peculiar to 1st file */ > if (eflag == EFLAG_NONE) { > - printf("====1\n"); > + separate("1"); > change(1, &d1->old, false); > keep(2, &d1->new); > change(3, &d1->new, false); > + } else if (eflag == EFLAG_OVERLAP) { > + j = edit(d2, dup, j, DIFF_TYPE1); > + printdiff(d2); This is defined nowhere, so the code does not build. Best regards, Bapt From nobody Thu Sep 26 21:13:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XF5t32Ktnz5XmVV; Thu, 26 Sep 2024 21:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XF5t31pL6z4Kcl; Thu, 26 Sep 2024 21:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727385195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W1apw//GmYBfdtlk0qxrNF7YEYy1NB4/UOH12MzZIPE=; b=glCu2UDBq9bzPQlQEyN1Lft6RxI/MvLtyB6iD4DDvzBSW6hBONVW6rLbCjlYTgNY/4sZRc w51i9TVo9XebWOyTpUwB4tY5xHPMBu/E4v0djLadQWJZPrcQvmcNPcMAZR/bakLVEA5MSG rzeW6kulpwuiTIT908pxKTXAOt36Q8952I5x8IxrjlTly8+o40jVu1RcXALfocw7nsjkPP 9KbIl1I1YeLUQNvoBmmygGTPYGICYYO630i1RdBRffmKd0Jm/YHaR2L2YnSDA0rXcjy+zI waUbf1TEmMRR9Jv+vwG62U7f9SOfE1MpfX5gbCIuA0NVN9r5F0FuGqgmbOln/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727385195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W1apw//GmYBfdtlk0qxrNF7YEYy1NB4/UOH12MzZIPE=; b=mizS6OOCg40RKHFctsGVRkHF0c8Gnb4WSv+U/wACeMpa4yYhneYVubiTZJtI/ldNRB+xNQ jy34gaSDrP/VCm6TJpNVrrbFiWHhd+5D7Z5/ipdnbTu4VYZytOlpfiKvfyTLVCe6fgf3XD neyC14EuMJlQb59us2XFGLZQ9DurRHTJquY11hzNjdGOSSZcvSsp/sDoF+s0h+r44xIA5g 143NwoX7W/e3AJE1ruJ41YfcRngjyLeqNcDShUlglGdpUAdI39CdLP+qtP9KvbTjwpD2BK MTP8Dte9+byvwXNlkGO6meo/66dFfk4pz0joZFEaL28saKiGrFFbxZaVIUXqhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727385195; a=rsa-sha256; cv=none; b=cPQD+cKF3ymKFzRnr2rZik/J2jN+QsykIpN3B9nAU+mFvQPFNja/TpgnZQLGpjdvR4VkWf qn9K8XuWxtiZK4BTL19wXIssUBtzv7+96Vm09zRNKxHJ9ssXXXSKfLDOcH3oVeKj6X/+Um l2cOORB04lpqvpE3hAqDaACC0CDFePQraYniN8vK901+TCHVUki9vxp5vLWo85eRcewKJn hxGH776W195pfuDfNoeHlTZvbcfptplAP/jIVfC95FsDeXe6fKLBTsOZ+OHU1/6X/uT5t7 AVYvdQXRQnYGrKM9oBuMsfqhmaFedAjAaQ6iQUnh8q/QM6y0v/FFPKzsrsgmgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XF5t31Pdsz1CLd; Thu, 26 Sep 2024 21:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QLDFLT096498; Thu, 26 Sep 2024 21:13:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QLDFqi096495; Thu, 26 Sep 2024 21:13:15 GMT (envelope-from git) Date: Thu, 26 Sep 2024 21:13:15 GMT Message-Id: <202409262113.48QLDFqi096495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f10f288faf08 - main - diff3: Remove debugging remnant. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f10f288faf0808ca91aedab6fbb2c82d3a3b6532 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f10f288faf0808ca91aedab6fbb2c82d3a3b6532 commit f10f288faf0808ca91aedab6fbb2c82d3a3b6532 Author: Dag-Erling Smørgrav AuthorDate: 2024-09-26 21:11:02 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-26 21:12:39 +0000 diff3: Remove debugging remnant. Fixes: cf73401c4f7a MFC after: 3 weeks --- usr.bin/diff3/diff3.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/diff3/diff3.c b/usr.bin/diff3/diff3.c index f20b1d74678d..39523f6e6b38 100644 --- a/usr.bin/diff3/diff3.c +++ b/usr.bin/diff3/diff3.c @@ -383,7 +383,6 @@ merge(int m1, int m2) change(3, &d1->new, false); } else if (eflag == EFLAG_OVERLAP) { j = edit(d2, dup, j, DIFF_TYPE1); - printdiff(d2); } d1++; continue; From nobody Thu Sep 26 23:17:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XF8dk1v3Xz5X9Ct; Thu, 26 Sep 2024 23:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XF8dk1Jqkz4VnW; Thu, 26 Sep 2024 23:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727392666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dO7FcmIKjyul1h8O4/U1jdHemSS0B9Nf3HtBV6VGGpU=; b=x+fc3oPM0xF0Nwd8VsosuTchL9UL9p5eUhADihf6FqzMsKPlkfjAFC0vHTkRq6tdpoj21Q x2oqVCggw+DbYlnozqDUTDxVup7g7NF9Jy2LQefeAg3hkQ45e2usUjN7C0tkdBYfFEeM9E kEAipXv3TVvt2MSb/HTdUs0V8yYmalmpug8KiCBDvfYilJfYxMvpRE5YM0yDw3GrGla5wh /7kswSjneh06oQQMW1jd6UZsElniMUTv3vau2assmARY3Z8IGOX+COBquMP4Vh5z14q8Ga 6dR3LrG0ve34uT1GW8Ybq/rCqUyU/aF1VYMkd+X3iPGZtky1VWCOtoyMHg2lJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727392666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dO7FcmIKjyul1h8O4/U1jdHemSS0B9Nf3HtBV6VGGpU=; b=C3bfOCDdXqfS5mcwi8ZBUkRB3rQD+Z+G8w0Ny1UzpSC0ubLei47sC3X169H5Vg+SQIqsyL kenkR/1wPXgS87/S5Tg3nxnVc5qBJacs6ZW65f9qLwkRYq3XIdhNW2Lo1zKG39tzNCZ2tT csaJYE3CrbQusWy2pYOeH607P/EJ+8Ahz64vVoMXJC4dYYg5Ihz/jYIV9s4KqExPhvYhVt hM8bM9eC+go2vSiSq0rNUH9+nT7n6167Wfld9+no26PyFetOMWsKAXw/1JGSdqiB8ayWI3 0ygldjDegiBg+cSPlwPZKremJ/v39Jf/mk4RM6xVuTnglycFb5csBjP20p/GVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727392666; a=rsa-sha256; cv=none; b=hXlSqViwSDaqzVre7Nv9wrqgcTniyW0RI8+tIGqc8lY4Tq6QAZMLotKZ57btKXmltQqmeq +sniniPy1HEuBeWLc5Y0Ha6kB7WrLfjqr+UzDhQdrOw3RoxVM/TcEZSB5XkiLBldf5fNnc 2/gvu5N0PU96572+nYTF7ovJL0/kWO2sjDVdEILm38FAQ9x11yKK7w+LaJxqzCB4H/dweZ qfSsMikrKYyPbRW01yaS2pt1ePMkzuVe98jlb5DkrDlCVLrwdt8upM1Boc8QGWCvSXaAx5 kLV7kq7F+tT+rpG2AnXE6eqxWUM9n/bvRqraUKDYGidnyfzvGEW8bn4tFHY9Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XF8dk0Y2CzFx1; Thu, 26 Sep 2024 23:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QNHjAB099747; Thu, 26 Sep 2024 23:17:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QNHjUR099744; Thu, 26 Sep 2024 23:17:45 GMT (envelope-from git) Date: Thu, 26 Sep 2024 23:17:45 GMT Message-Id: <202409262317.48QNHjUR099744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: eade2001aa9d - main - jemalloc: set LG_VADDR to 64 on amd64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eade2001aa9d91440886de8359a4dec9edcde2a9 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eade2001aa9d91440886de8359a4dec9edcde2a9 commit eade2001aa9d91440886de8359a4dec9edcde2a9 Author: Konstantin Belousov AuthorDate: 2024-09-16 21:09:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-26 22:54:25 +0000 jemalloc: set LG_VADDR to 64 on amd64 and allow to revert it back to 48 with WITHOUT_JEMALLOC_LG_VADDR_WIDE build option. Reviewed by: andrew, emaste Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46686 --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h | 4 ++++ lib/libc/stdlib/malloc/jemalloc/Makefile.inc | 3 +++ share/mk/src.opts.mk | 1 + tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h index dee4679838d8..e733906bc146 100644 --- a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h +++ b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h @@ -39,7 +39,11 @@ # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __amd64__ +#ifdef _USE_LG_VADDR_WIDE +# define LG_VADDR 64 +#else # define LG_VADDR 48 +#endif # define LG_SIZEOF_PTR 3 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif diff --git a/lib/libc/stdlib/malloc/jemalloc/Makefile.inc b/lib/libc/stdlib/malloc/jemalloc/Makefile.inc index 1ba7725fe8a8..d916d69f471f 100644 --- a/lib/libc/stdlib/malloc/jemalloc/Makefile.inc +++ b/lib/libc/stdlib/malloc/jemalloc/Makefile.inc @@ -5,6 +5,9 @@ JEMALLOCSRCS:= jemalloc.c arena.c background_thread.c base.c bin.c bitmap.c \ test_hooks.c ticker.c tsd.c witness.c CFLAGS+=-I${SRCTOP}/contrib/jemalloc/include +.if ${MK_JEMALLOC_LG_VADDR_WIDE} != no +CFLAGS+=-D_USE_LG_VADDR_WIDE +.endif .for src in ${JEMALLOCSRCS} MISRCS+=jemalloc_${src} diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index f9d94ab663b0..95801cdeecc5 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -116,6 +116,7 @@ __DEFAULT_YES_OPTIONS = \ IPFW \ ISCSI \ JAIL \ + JEMALLOC_LG_VADDR_WIDE \ KDUMP \ KVM \ LDNS \ diff --git a/tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE b/tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE new file mode 100644 index 000000000000..9efc4022e9cf --- /dev/null +++ b/tools/build/options/WITHOUT_JEMALLOC_LG_VADDR_WIDE @@ -0,0 +1,5 @@ +Disallow programs to use more than 48 address bits on amd64. +Incompatible with LA57 mode. +Enabling this option might result in a slight reduction in memory +consumption for jemalloc metadata, but also requires disabling LA57 +(if hardware supports it). From nobody Thu Sep 26 23:17:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XF8dl2kkrz5X9Nc; Thu, 26 Sep 2024 23:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XF8dl1zDnz4VXC; Thu, 26 Sep 2024 23:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727392667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HOYhXEm77ki3/syf/WtO8HQrVdBYSQCbPuoUWhCqLEw=; b=R0rMRlrJ8ipScd2wChyDH86RnLCGKBNXqraR1kKVXwrqJzBwE0+qQ2aM0KWVYR57XM+AOK eDW/A++WwDDjnXdeTJ7F1WOQRU7T+HO7zU1+jlsf/efS6U/1Kw0rIHusZbTdYgWmO/sTzk 33tEJeA8N9IM5U1XOUhA4c3TkCj4DCpy/zBrEe0LEsyFK5JydJPKuzLveho5cJPa/FilkH QahA8Cu+oLOo+j61cl3PDuyBWNEC4+rAsjtigp3E0InZCGBYQvV9eJDE1xBqgF64fBXSPF C8HVPLx+QeKbXwykkXg0jl4d8qCDqAcPbZbKaoA13VTlLgptTipKOYMe5QtfWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727392667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HOYhXEm77ki3/syf/WtO8HQrVdBYSQCbPuoUWhCqLEw=; b=AMAyDibwFp6PtkpbS8jEbxjmEfVFGQjm/IMpEt1Tb3v+ZuOEN3OcGkaIujCWSITgxcBPOa eotys8jAbyJhtlHH009qnLneFQtSkO7YhR/j42em07KfQiNWjHt3ArwxAhCE6E9pNWnfAQ 8CWDaOYQuLJDwVHLGjEOnMnA82iGf7PW8GWpfF5KEfo01MVDIgsI2uOBRO+El52CEFy7tb tgcb/igT4oQq3pd/KPtgTV4h6ayfU8tzKMQK0IhL4T/qX2/IVpr/wX9FPJjdjnd0gJoxIE XMHRGDzDVzAGO+I4Mdg05iG0/vboSlcVHT2vzxZFvgo69HNjDnC7whYTc1MXKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727392667; a=rsa-sha256; cv=none; b=yknDhKlnfxdDzyNqkiKIy9ODBbSYjqIAs64HCGkp2YIQH1mWumNUo7zOe5YRY0B1Tg5Mw8 g1fT6Sg3GSAPRVospBQ15+XZ0XtnlmBNMXQAD+eE5q7WPZNuirV6f7+5Xqz39/TUaN6aaC SBpLmiCJ3hwFoHx7tAsQ3sv+eJBtZLElLErADbJnHZl/lIjOvDGkhEkZFB3isVySktLakd DQ1pM3eQaorSD+F4MZr1WLCLO/dTQLHodMN/3rQcyhdpNnUMmtgaFiLRxPiTZMbm26SL/f AtmhsI1s/EU0ZsoqM7/LSHrJh8UL8ZiiZAqsRK/OuHm6eMVnH0+oD3n3voQjjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XF8dl1J53zGmk; Thu, 26 Sep 2024 23:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48QNHlQL099777; Thu, 26 Sep 2024 23:17:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48QNHlo6099774; Thu, 26 Sep 2024 23:17:47 GMT (envelope-from git) Date: Thu, 26 Sep 2024 23:17:47 GMT Message-Id: <202409262317.48QNHlo6099774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b0f9f970ec10 - main - Regen List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0f9f970ec104e1df22ece7c7cdf12240e3c6713 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0f9f970ec104e1df22ece7c7cdf12240e3c6713 commit b0f9f970ec104e1df22ece7c7cdf12240e3c6713 Author: Konstantin Belousov AuthorDate: 2024-09-26 17:16:48 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-26 22:54:25 +0000 Regen --- share/man/man5/src.conf.5 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 303697c6efb5..c259e05af807 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd September 21, 2024 +.Dd September 26, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -819,6 +819,12 @@ and related utilities. .It Va WITHOUT_JAIL Do not build tools for the support of jails; e.g., .Xr jail 8 . +.It Va WITHOUT_JEMALLOC_LG_VADDR_WIDE +Disallow programs to use more than 48 address bits on amd64. +Incompatible with LA57 mode. +Enabling this option might result in a slight reduction in memory +consumption for jemalloc metadata, but also requires disabling LA57 +(if hardware supports it). .It Va WITHOUT_KDUMP Do not build .Xr kdump 1 From nobody Fri Sep 27 06:46:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFLbP5z52z5Xc0G; Fri, 27 Sep 2024 06:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFLbP53kgz4DHS; Fri, 27 Sep 2024 06:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727419585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HkggrcomcFA6Uby2zosz7+Hl2TAEAWV/gbsocP24l74=; b=TZOyzDTVN0MaCx2uxBwK2IQVdJHqs5ctbNieNoUgtKRK0sC+uUCVnwlhdbIH6crJ2po2Zg f4lqCiW25hY/dukAc1RA+iplBNxAECs21nFTVP1OsuMug5r5Agj9fUW2iaK4RbuLHg46rS CJ23nS9QA0opITDtd0JKWGr1ghJhHxg1t88idCuyaHQ3GxhJD6BdlCz4yyQ8g1LSlJ2V8d eypVDm91sEua/6arkMsdQpBRz7ZH6WYOW4b7Ilyz1M+TFWHik1RIcgqTVc8FEMJN8UiF/2 T4Z2IpipCiqcsCDvT2JA7Md+nGiN0eeMZ8shGBRFbvX1JpzpreLeUhc/qM0Xyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727419585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HkggrcomcFA6Uby2zosz7+Hl2TAEAWV/gbsocP24l74=; b=K41cAhONKDjCi9laHQWJXOZqvyODEHLXJpW1HxOQoyzi1Vf8Txii9hVpBK6p8UpUP+cuTF gL6i271TeJ9xuQdHCT4EXuNZDlAdPlRR5HTWI2Jy4ARdR/uLEL5hriQK8jX3pbzcAFIyXM cRDLQMCr2WeAcpRAF4pIpVjB7GArMXzZ1cfvcDurdNo9/tjjGrNS6WSUbFyvmZ9vx/ozIU tF7Jwb/T/RRLVst0eiRWulA2Pm0LELWYRCx3MOgb5ox5Rmk5gayZjqtPsMlCLQPOLI3lZ0 WHhDDYUhDUkJJTOK2VQ/7MsJQlteKFa278p0EYRivLOWhfr850zDmMFJkMxE2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727419585; a=rsa-sha256; cv=none; b=aScfqQw1MqDdkB40zXe8QMNi0gP6w18HI4uppOU/fwLCZSwBGlVRd3bkVcp95lkx0oIGEj JEIWRneSXCWxzEFLF+PjxqA6bYGP0rRO2UUt8iWj8SdPEaNO5yXeruDQ0DLaAB4XDx/j0W k+Q/0GvvH7aRy7eUVXS5LtU5Z+261z9Hn2N4BXSiE9ca8mOkaRNOC+d4biSVvi7GylpMGr KpBwi8zZ47n+j2fuqMbbl5rfTLoNiOQXK8W2vUvST+MmmkfRClV724DFu89pOyXvi3veul WkoOEpjjdnv8BspRfnItcAs/ZcD8+CGY1+1B9fq5o8ItrWryjSaQdQQPBDKSZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFLbP4fvGzW5w; Fri, 27 Sep 2024 06:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48R6kPi1061054; Fri, 27 Sep 2024 06:46:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48R6kPPx061051; Fri, 27 Sep 2024 06:46:25 GMT (envelope-from git) Date: Fri, 27 Sep 2024 06:46:25 GMT Message-Id: <202409270646.48R6kPPx061051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 1c578f1c9311 - main - e1000: Clean up legacy absolute and packet timers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c578f1c93112d3d53820f8b6b411488b83f0ab2 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=1c578f1c93112d3d53820f8b6b411488b83f0ab2 commit 1c578f1c93112d3d53820f8b6b411488b83f0ab2 Author: Kevin Bowling AuthorDate: 2024-09-27 06:08:01 +0000 Commit: Kevin Bowling CommitDate: 2024-09-27 06:45:04 +0000 e1000: Clean up legacy absolute and packet timers The absolute and packet timers only apply to lem and em with some only applying to the later. This cleans up the sysctl tree to only show these where applicable and stops writing to unexpected registers for igb. MFC after: 1 week Sponsored by: BBOX.io --- sys/dev/e1000/if_em.c | 116 +++++++++++++++++++++++++------------------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index ad12171487f6..cdadec17e355 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1033,27 +1033,25 @@ em_if_attach_pre(if_ctx_t ctx) e1000_get_bus_info(hw); /* Set up some sysctls for the tunable interrupt delays */ - em_add_int_delay_sysctl(sc, "rx_int_delay", - "receive interrupt delay in usecs", &sc->rx_int_delay, - E1000_REGISTER(hw, E1000_RDTR), em_rx_int_delay_dflt); - em_add_int_delay_sysctl(sc, "tx_int_delay", - "transmit interrupt delay in usecs", &sc->tx_int_delay, - E1000_REGISTER(hw, E1000_TIDV), em_tx_int_delay_dflt); - em_add_int_delay_sysctl(sc, "rx_abs_int_delay", - "receive interrupt delay limit in usecs", - &sc->rx_abs_int_delay, - E1000_REGISTER(hw, E1000_RADV), - em_rx_abs_int_delay_dflt); - em_add_int_delay_sysctl(sc, "tx_abs_int_delay", - "transmit interrupt delay limit in usecs", - &sc->tx_abs_int_delay, - E1000_REGISTER(hw, E1000_TADV), - em_tx_abs_int_delay_dflt); - em_add_int_delay_sysctl(sc, "itr", - "interrupt delay limit in usecs/4", - &sc->tx_itr, - E1000_REGISTER(hw, E1000_ITR), - DEFAULT_ITR); + if (hw->mac.type < igb_mac_min) { + em_add_int_delay_sysctl(sc, "rx_int_delay", + "receive interrupt delay in usecs", &sc->rx_int_delay, + E1000_REGISTER(hw, E1000_RDTR), em_rx_int_delay_dflt); + em_add_int_delay_sysctl(sc, "tx_int_delay", + "transmit interrupt delay in usecs", &sc->tx_int_delay, + E1000_REGISTER(hw, E1000_TIDV), em_tx_int_delay_dflt); + } + if (hw->mac.type >= e1000_82540 && hw->mac.type < igb_mac_min) { + em_add_int_delay_sysctl(sc, "rx_abs_int_delay", + "receive interrupt delay limit in usecs", &sc->rx_abs_int_delay, + E1000_REGISTER(hw, E1000_RADV), em_rx_abs_int_delay_dflt); + em_add_int_delay_sysctl(sc, "tx_abs_int_delay", + "transmit interrupt delay limit in usecs", &sc->tx_abs_int_delay, + E1000_REGISTER(hw, E1000_TADV), em_tx_abs_int_delay_dflt); + em_add_int_delay_sysctl(sc, "itr", + "interrupt delay limit in usecs/4", &sc->tx_itr, + E1000_REGISTER(hw, E1000_ITR), DEFAULT_ITR); + } hw->mac.autoneg = DO_AUTO_NEG; hw->phy.autoneg_wait_to_complete = false; @@ -2287,18 +2285,19 @@ igb_configure_queues(struct e1000_softc *sc) break; } - /* Set the starting interrupt rate */ - if (em_max_interrupt_rate > 0) + /* Set the igb starting interrupt rate */ + if (em_max_interrupt_rate > 0) { newitr = (4000000 / em_max_interrupt_rate) & 0x7FFC; - if (hw->mac.type == e1000_82575) - newitr |= newitr << 16; - else - newitr |= E1000_EITR_CNT_IGNR; + if (hw->mac.type == e1000_82575) + newitr |= newitr << 16; + else + newitr |= E1000_EITR_CNT_IGNR; - for (int i = 0; i < sc->rx_num_queues; i++) { - rx_que = &sc->rx_queues[i]; - E1000_WRITE_REG(hw, E1000_EITR(rx_que->msix), newitr); + for (int i = 0; i < sc->rx_num_queues; i++) { + rx_que = &sc->rx_queues[i]; + E1000_WRITE_REG(hw, E1000_EITR(rx_que->msix), newitr); + } } return; @@ -3274,12 +3273,16 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; } - E1000_WRITE_REG(hw, E1000_TIPG, tipg); - E1000_WRITE_REG(hw, E1000_TIDV, sc->tx_int_delay.value); + if (hw->mac.type < igb_mac_min) { + E1000_WRITE_REG(hw, E1000_TIPG, tipg); + E1000_WRITE_REG(hw, E1000_TIDV, sc->tx_int_delay.value); + + if (sc->tx_int_delay.value > 0) + sc->txd_cmd |= E1000_TXD_CMD_IDE; + } - if(hw->mac.type >= e1000_82540) - E1000_WRITE_REG(hw, E1000_TADV, - sc->tx_abs_int_delay.value); + if (hw->mac.type >= e1000_82540) + E1000_WRITE_REG(hw, E1000_TADV, sc->tx_abs_int_delay.value); if (hw->mac.type == e1000_82571 || hw->mac.type == e1000_82572) { tarc = E1000_READ_REG(hw, E1000_TARC(0)); @@ -3304,16 +3307,13 @@ em_initialize_transmit_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_TARC(0), tarc); } - if (sc->tx_int_delay.value > 0) - sc->txd_cmd |= E1000_TXD_CMD_IDE; - /* Program the Transmit Control Register */ tctl = E1000_READ_REG(hw, E1000_TCTL); tctl &= ~E1000_TCTL_CT; tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); - if (hw->mac.type >= e1000_82571) + if (hw->mac.type >= e1000_82571 && hw->mac.type < igb_mac_min) tctl |= E1000_TCTL_MULR; /* This write will effectively turn on the transmit unit. */ @@ -3381,17 +3381,29 @@ em_initialize_receive_unit(if_ctx_t ctx) if (!em_disable_crc_stripping) rctl |= E1000_RCTL_SECRC; - if (hw->mac.type >= e1000_82540) { - E1000_WRITE_REG(hw, E1000_RADV, - sc->rx_abs_int_delay.value); + /* lem/em default interrupt moderation */ + if (hw->mac.type < igb_mac_min) { + if (hw->mac.type >= e1000_82540) { + E1000_WRITE_REG(hw, E1000_RADV, sc->rx_abs_int_delay.value); - /* - * Set the interrupt throttling rate. Value is calculated - * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) + /* + * Set the interrupt throttling rate. Value is calculated + * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) + */ + E1000_WRITE_REG(hw, E1000_ITR, DEFAULT_ITR); + } + + /* XXX TEMPORARY WORKAROUND: on some systems with 82573 + * long latencies are observed, like Lenovo X60. This + * change eliminates the problem, but since having positive + * values in RDTR is a known source of problems on other + * platforms another solution is being sought. */ - E1000_WRITE_REG(hw, E1000_ITR, DEFAULT_ITR); + if (hw->mac.type == e1000_82573) + E1000_WRITE_REG(hw, E1000_RDTR, 0x20); + else + E1000_WRITE_REG(hw, E1000_RDTR, sc->rx_int_delay.value); } - E1000_WRITE_REG(hw, E1000_RDTR, sc->rx_int_delay.value); if (hw->mac.type >= em_mac_min) { uint32_t rfctl; @@ -3441,16 +3453,6 @@ em_initialize_receive_unit(if_ctx_t ctx) } E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); - /* - * XXX TEMPORARY WORKAROUND: on some systems with 82573 - * long latencies are observed, like Lenovo X60. This - * change eliminates the problem, but since having positive - * values in RDTR is a known source of problems on other - * platforms another solution is being sought. - */ - if (hw->mac.type == e1000_82573) - E1000_WRITE_REG(hw, E1000_RDTR, 0x20); - for (i = 0, que = sc->rx_queues; i < sc->rx_num_queues; i++, que++) { struct rx_ring *rxr = &que->rxr; /* Setup the Base and Length of the Rx Descriptor Ring */ From nobody Fri Sep 27 08:33:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFNyz4vVlz5XjWq; Fri, 27 Sep 2024 08:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFNyz3q6Vz4MdC; Fri, 27 Sep 2024 08:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727426011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cF5SqEsOM+jDQii+JzCTxm+gP1WLOlvJdDDhPX7mQWA=; b=bADVbdyXar4oh7q4m+DRzoXuNORh15FcEnfrEbVeykqM0i3AK/fKvWZtASf2bQJtEYutFM ed7Okw3fznf5eGMxs6ForusnxpSZfat1XGhWO7KyJzqHmFi48da/wgPFwr0lhrJk8s2fAg wV7zt5tQ39ySUXIk93+B9QTnF072vB3M9h88APwNwf/Zn0+ZXmfoEYY4460ZMmKXkl2MG5 HJT+c2+9qYKtfjs+Dg/pAA2iujXC+ffa0FNDDhH3ZUArcEO/h8Yd7DDrSw8tiicukZdzGU azuOmRkmtmn7MIzY7irmjbWHCjCHGR4LjVte3cW5WqcukYq4hXYzuzWZdVyEXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727426011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cF5SqEsOM+jDQii+JzCTxm+gP1WLOlvJdDDhPX7mQWA=; b=FnXI402qdWF9KGF7VxsUPtC/p7SlqNQLv4IFckdrbwjTfTHTfzThZHPwd8HvoQUtRjPj+k 9vldopy6fkkcIGZAU7XrvPwG6toTG1GVOPHsyQ3KhmlI5LkOBjCQIRB9g1jzUZgYZaWKhc cnSvQJ624+skh/wQhWvQopVQNbP4twmwLYgjo3weYV6fMrKzMsVuHbo++ZiyfLGoeLglH7 VM9y6GZNuB05Z75sriojEzRpCT2foCnCQhvCSbd2edwt/D4XhkbAMGXqkbqsfnv6iwIQcI T/NvcbF2Q9r9X58QkS98n31bq2QpFrQSNSU9MwIvbzCHjJ5aIql6QEDaZHbqYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727426011; a=rsa-sha256; cv=none; b=Tbwhyq+Ut0woZ2BSwF04Eka4vjOPNnYxhSArQSAfsTliv0XSu4eeznh6wxn0n/UWogfqjh HpOu87q2/fKZTlEnHRBrRm9fKqzbHs+6h92oHkMO1leYNDKXJ5SEHtbu+scMtYNVTpUWvX Gb68kHuRaihgdITF38iDa2wx2WFsUO/aE6WL+253VtOGyKo/93NjWlhQZOFmLyjYxH8TWq 0eY/3v070/66LCYVWen4E9uW0Fhve82ig95fMRgnd6j3fxRrMBsPW1u6ibfJYyw8/kxXf8 XW3IcgF5uyqrRbD4RPLlk89tsGW8bTn60Roxh9Mk72HYRsDV7jAdm9K6zEAOTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFNyz3MdQzZ6Z; Fri, 27 Sep 2024 08:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48R8XV5e047281; Fri, 27 Sep 2024 08:33:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48R8XVT1047279; Fri, 27 Sep 2024 08:33:31 GMT (envelope-from git) Date: Fri, 27 Sep 2024 08:33:31 GMT Message-Id: <202409270833.48R8XVT1047279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 9bf9164fc8aa - main - e1000: Clean up ITR/EITR in preparation for AIM List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bf9164fc8aad1ca828c725413e06462aef1e4dd Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=9bf9164fc8aad1ca828c725413e06462aef1e4dd commit 9bf9164fc8aad1ca828c725413e06462aef1e4dd Author: Kevin Bowling AuthorDate: 2024-09-27 08:03:31 +0000 Commit: Kevin Bowling CommitDate: 2024-09-27 08:30:05 +0000 e1000: Clean up ITR/EITR in preparation for AIM Provide macros to derive the various needed values and make it a bit more clear the differences between em and igb. The igb default EITR was not landing at the right offset. Respect the 'max_interrupt_rate' tunable. MFC after: 1 week Sponsored by: BBOX.io --- sys/dev/e1000/if_em.c | 20 ++++++++------------ sys/dev/e1000/if_em.h | 11 +++++++++-- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index cdadec17e355..b9c6131e6741 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -499,9 +499,6 @@ static driver_t igb_if_driver = { #define EM_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) #define EM_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) -#define MAX_INTS_PER_SEC 8000 -#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) - /* Allow common code without TSO */ #ifndef CSUM_TSO #define CSUM_TSO 0 @@ -551,7 +548,7 @@ SYSCTL_INT(_hw_em, OID_AUTO, eee_setting, CTLFLAG_RDTUN, &eee_setting, 0, /* ** Tuneable Interrupt rate */ -static int em_max_interrupt_rate = 8000; +static int em_max_interrupt_rate = EM_INTS_PER_SEC; SYSCTL_INT(_hw_em, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, &em_max_interrupt_rate, 0, "Maximum interrupts per second"); @@ -1050,7 +1047,8 @@ em_if_attach_pre(if_ctx_t ctx) E1000_REGISTER(hw, E1000_TADV), em_tx_abs_int_delay_dflt); em_add_int_delay_sysctl(sc, "itr", "interrupt delay limit in usecs/4", &sc->tx_itr, - E1000_REGISTER(hw, E1000_ITR), DEFAULT_ITR); + E1000_REGISTER(hw, E1000_ITR), + EM_INTS_TO_ITR(em_max_interrupt_rate)); } hw->mac.autoneg = DO_AUTO_NEG; @@ -2287,7 +2285,7 @@ igb_configure_queues(struct e1000_softc *sc) /* Set the igb starting interrupt rate */ if (em_max_interrupt_rate > 0) { - newitr = (4000000 / em_max_interrupt_rate) & 0x7FFC; + newitr = IGB_INTS_TO_EITR(em_max_interrupt_rate); if (hw->mac.type == e1000_82575) newitr |= newitr << 16; @@ -3386,11 +3384,9 @@ em_initialize_receive_unit(if_ctx_t ctx) if (hw->mac.type >= e1000_82540) { E1000_WRITE_REG(hw, E1000_RADV, sc->rx_abs_int_delay.value); - /* - * Set the interrupt throttling rate. Value is calculated - * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) - */ - E1000_WRITE_REG(hw, E1000_ITR, DEFAULT_ITR); + /* Set the default interrupt throttling rate */ + E1000_WRITE_REG(hw, E1000_ITR, + EM_INTS_TO_ITR(em_max_interrupt_rate)); } /* XXX TEMPORARY WORKAROUND: on some systems with 82573 @@ -3418,7 +3414,7 @@ em_initialize_receive_unit(if_ctx_t ctx) if (hw->mac.type == e1000_82574) { for (int i = 0; i < 4; i++) E1000_WRITE_REG(hw, E1000_EITR_82574(i), - DEFAULT_ITR); + EM_INTS_TO_ITR(em_max_interrupt_rate)); /* Disable accelerated acknowledge */ rfctl |= E1000_RFCTL_ACK_DIS; } diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 244762e8ed0d..7219dc57c333 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -244,8 +244,15 @@ #define IGB_MEDIA_RESET (1 << 0) /* Define the starting Interrupt rate per Queue */ -#define IGB_INTS_PER_SEC 8000 -#define IGB_DEFAULT_ITR ((1000000/IGB_INTS_PER_SEC) << 2) +#define EM_INTS_PER_SEC 8000 +#define EM_INTS_MULTIPLIER 256 +#define EM_ITR_DIVIDEND 1000000000 +#define EM_INTS_TO_ITR(i) (EM_ITR_DIVIDEND/(i * EM_INTS_MULTIPLIER)) +#define IGB_ITR_DIVIDEND 1000000 +#define IGB_ITR_SHIFT 2 +#define IGB_QVECTOR_MASK 0x7FFC +#define IGB_INTS_TO_EITR(i) (((IGB_ITR_DIVIDEND/i) & IGB_QVECTOR_MASK) << \ + IGB_ITR_SHIFT) #define IGB_LINK_ITR 2000 #define I210_LINK_DELAY 1000 From nobody Fri Sep 27 12:01:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFTZZ3FThz5XvRw; Fri, 27 Sep 2024 12:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFTZZ2j5Jz4kCX; Fri, 27 Sep 2024 12:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727438470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8FH9WtBMW61UlTUVHl0kKsOHZI5Q3WCsvrINPnS9Bcs=; b=xDDruZ7w5YO09t1Vk0JK3U44oJ9AkEmRh24zjaRNinDZYVRl369eaiZlUn8+9Kn/JEW7L7 qfo4NlGZ6HpWEMVSLuNa2Gc0wl1hdQ+hK3D4YRQ89A+9of10ogiCw9g1rMuU6+NJrn8RgC oVvxQv9BbMHgepA8P4/xwvoDhKEnPhU0TH1P1VjcuPzbFxeK+yWngesYRYjaXFfqzjo2P5 WoO5VUt4r0/MzNSboLg5atlKW6FW9hvZI/Qxyh7uXu0dRyQnG0JXTfjQYsrr6kmXEw8ABG mcb3kGvOZznitxbimD0MgPtrZSLl0if5KeZsz34csmxvW3qmemrl/GYOklRzgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727438470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8FH9WtBMW61UlTUVHl0kKsOHZI5Q3WCsvrINPnS9Bcs=; b=Cn2g4WmyCTbwwXfDwwY/9gVf64kasMcg4SGMD6p1GDY1EJvLMPXVWeBcHIA44QOGqlyxBM x0KlJEVRumSyJeBlDtEMy4+y6x2d0Ty04rMjLRAakMt2UMn6JkxT8+yzkbnFpIZpjM4q1r 2zUIzxAsX/rw+6UWi2/pltVNFAQ2C5ZWcx/Q9ZPYpEE1VUmOs5OBxImFQwMhXjf6C4IH+1 IwLE2Xhbb/CfKMGXAnpfSGtNLJHY9ludbtjEN28igStwsfwIDjoutwO8Ez4Bhk3bvYtlAJ DENungBDM/IcnVcQ9qVbKxXx1JNnfZ3FnA12REPwk55E/ZKbxP5zxaUPl+bsww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727438470; a=rsa-sha256; cv=none; b=OPRc48mWI+uJACmB0MJK4GBk+MyR3mVy+ctfu8/o73eRmjx8E78jdSjV6PAg1jC6aGiujx EW1m1d0X2EFp9hQclIqqxcf/x4OmZ1ozs7OIR4V5hp2Qy3Pu2D2daro49czqxGeUGUdoL2 0Di0y5U2r6+b540Q2bARoHX41x1KKO167vjR0EVxmMlJ9LKc8IC5qIfZ1tgUGD6vmiXcYx U9x4Lsj814zK76tq4OpsUKSXgIBLheWUq+bOHJuaQNunZAW0IzkA+xJCxEhLauOo93BdTk lA++rk5X3duyuFS6byeFVhUEXxkml2vPjfotg2RLd1u7LNim5xaD7+7RuXIY5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFTZZ2JhJzfwP; Fri, 27 Sep 2024 12:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RC1Aw4097822; Fri, 27 Sep 2024 12:01:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RC1Anr097819; Fri, 27 Sep 2024 12:01:10 GMT (envelope-from git) Date: Fri, 27 Sep 2024 12:01:10 GMT Message-Id: <202409271201.48RC1Anr097819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e8ff5e565c24 - main - pf: fix incorrect parsing of state export filter List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8ff5e565c24d7e3fdd607e76769b4c879668759 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e8ff5e565c24d7e3fdd607e76769b4c879668759 commit e8ff5e565c24d7e3fdd607e76769b4c879668759 Author: Kristof Provost AuthorDate: 2024-09-26 18:00:25 +0000 Commit: Kristof Provost CommitDate: 2024-09-27 09:50:00 +0000 pf: fix incorrect parsing of state export filter We saved the af parameter to the proto field. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 510aac2af48a..62d5972c4abb 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -68,7 +68,7 @@ static const struct nlattr_parser nla_p_state[] = { { .type = PF_ST_ID, .off = _OUT(id), .cb = nlattr_get_uint32 }, { .type = PF_ST_CREATORID, .off = _OUT(creatorid), .cb = nlattr_get_uint32 }, { .type = PF_ST_IFNAME, .arg = (const void *)IFNAMSIZ, .off = _OUT(ifname), .cb = nlattr_get_chara }, - { .type = PF_ST_AF, .off = _OUT(proto), .cb = nlattr_get_uint8 }, + { .type = PF_ST_AF, .off = _OUT(af), .cb = nlattr_get_uint8 }, { .type = PF_ST_PROTO, .off = _OUT(proto), .cb = nlattr_get_uint16 }, { .type = PF_ST_FILTER_ADDR, .off = _OUT(addr), .cb = nlattr_get_in6_addr }, { .type = PF_ST_FILTER_MASK, .off = _OUT(mask), .cb = nlattr_get_in6_addr }, From nobody Fri Sep 27 12:30:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFVCz6DHqz5XxHm; Fri, 27 Sep 2024 12:30:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFVCz5jkLz4pSP; Fri, 27 Sep 2024 12:30:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727440207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=76BLAtDFqq+/u8UqKoWUQ5cb5doLPow7qG05lB1Ir2Q=; b=kq+1LOH3RaAU8tdq2yaJpRTUAQSTcm6UnlmUV91YGUs4hZj16VlUenbYhk9RvgsD/y+71f D3n2Rhs54/j6oSl87oJKb1rRzkYXuXbheRtwojqrRKgmYpJ2zeZ29HMJDXWvSV6222VHLJ KjsooB2wpDslgk6CTjsPXMiSulw0IdAOzKOq7YiHQLb5mGMfmKLxlKjdqhCq7PMMZY62qX A0AZZRwxr0A/LGLOJrE2aua4UxrlF4UP1CZ66uAltVCwU7jXLlxtWjOvvX+pScOggJ0+hH oKWcRRczSL/dqkC/6Qy3pAtJzUkqB7pDObjkVeSWjZaQcc8qf867ktmeymjfAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727440207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=76BLAtDFqq+/u8UqKoWUQ5cb5doLPow7qG05lB1Ir2Q=; b=cel7met/NZVLQog20WRHUtjqsmQGPiq4y9F5KpZKXtXbs4QQYDN+ljRSbqhlyyqsPIR1QP R0+c8xzsTdgdP5pvPjAZfUzwzDFssk1SAqAKAWBoygTH8YqNsnUFp6sVOkeEv5nZ0xMXRR MxzLeLCjmvseAtK3zqv4M7BiuTfRsy5OT2wb/mXN/AD3rveaKFdnL/sl3YB6tlXwexTgez WsBTn2A6QI/+ew2jqzU3d5WYJblzuJEIGCW/KgWb5rMTI2IttdAUmNP1R24W7FxQuRstCg 1VQ7F6igDc4wZb5Caf6fuHZkcvwLeCqFP8oXAmajyjtTFdw9jVhnplH2IIpFVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727440207; a=rsa-sha256; cv=none; b=YHyKpVQyIqRYIfIpIoip9dHYZDNNCtxEHWWHyyEy8qgaWqvWZzVo4yj5GMr2arCHhhacB/ wS0ISu3y0YSheclFsA8btePRvLAAbof/uCcTbTZI101OSTKecpXzSM13loWFiQF2XyvBDR QSrZrXw2zd4sfcZ86bWFZtWOMslwAzlS4f8MQNVN9ycJPNzkNfxmc0e2lGmsK3EtzjSxIu DFJCm57WXzZ47d45/X1VceHQnEtaGXjbmp2wHYQgTb3k/j/GWJvy9NdWfYpDcMBRRpE0B9 fTdUSZcXF4ECvvFp+O6OtGMI12LPNsw8tAKOxW4VE4ZgUh9S/I9QFlKxbrCsYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFVCz5C7fzgPr; Fri, 27 Sep 2024 12:30:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RCU7t1040993; Fri, 27 Sep 2024 12:30:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RCU7CK040988; Fri, 27 Sep 2024 12:30:07 GMT (envelope-from git) Date: Fri, 27 Sep 2024 12:30:07 GMT Message-Id: <202409271230.48RCU7CK040988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7fe42038b269 - main - pf: fix max-src-conn when rules are added via netlink List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7fe42038b2691bddd58fdf8783c1b92c527c2352 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7fe42038b2691bddd58fdf8783c1b92c527c2352 commit 7fe42038b2691bddd58fdf8783c1b92c527c2352 Author: Kajetan Staszkiewicz AuthorDate: 2024-09-27 08:21:10 +0000 Commit: Kristof Provost CommitDate: 2024-09-27 12:29:20 +0000 pf: fix max-src-conn when rules are added via netlink Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46797 --- lib/libpfctl/libpfctl.c | 2 ++ sys/netpfil/pf/pf_nl.c | 2 ++ sys/netpfil/pf/pf_nl.h | 1 + 3 files changed, 5 insertions(+) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index c8eeb913e912..36b83c480aa7 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1233,6 +1233,7 @@ snl_add_msg_attr_pf_rule(struct snl_writer *nw, uint32_t type, const struct pfct snl_add_msg_attr_u32(nw, PF_RT_MAX_STATES, r->max_states); snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_NODES, r->max_src_nodes); snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_STATES, r->max_src_states); + snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_CONN, r->max_src_conn); snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_CONN_RATE_LIMIT, r->max_src_conn_rate.limit); snl_add_msg_attr_u32(nw, PF_RT_MAX_SRC_CONN_RATE_SECS, r->max_src_conn_rate.seconds); @@ -1658,6 +1659,7 @@ static struct snl_attr_parser ap_getrule[] = { { .type = PF_RT_SRC_NODES, .off = _OUT(r.src_nodes), .cb = snl_attr_get_uint64 }, { .type = PF_RT_ANCHOR_CALL, .off = _OUT(anchor_call), .arg = (void*)MAXPATHLEN, .cb = snl_attr_copy_string }, { .type = PF_RT_RCV_IFNAME, .off = _OUT(r.rcv_ifname), .arg = (void*)IFNAMSIZ, .cb = snl_attr_copy_string }, + { .type = PF_RT_MAX_SRC_CONN, .off = _OUT(r.max_src_conn), .cb = snl_attr_get_uint32 }, }; static struct snl_field_parser fp_getrule[] = {}; #undef _OUT diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 62d5972c4abb..ca90e0b5b140 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -731,6 +731,7 @@ static const struct nlattr_parser nla_p_rule[] = { { .type = PF_RT_DIVERT_ADDRESS, .off = _OUT(divert.addr), .cb = nlattr_get_in6_addr }, { .type = PF_RT_DIVERT_PORT, .off = _OUT(divert.port), .cb = nlattr_get_uint16 }, { .type = PF_RT_RCV_IFNAME, .off = _OUT(rcv_ifname), .arg = (void *)IFNAMSIZ, .cb = nlattr_get_chara }, + { .type = PF_RT_MAX_SRC_CONN, .off = _OUT(max_src_conn), .cb = nlattr_get_uint32 }, }; NL_DECLARE_ATTR_PARSER(rule_parser, nla_p_rule); #undef _OUT @@ -921,6 +922,7 @@ pf_handle_getrule(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_u32(nw, PF_RT_MAX_STATES, rule->max_states); nlattr_add_u32(nw, PF_RT_MAX_SRC_NODES, rule->max_src_nodes); nlattr_add_u32(nw, PF_RT_MAX_SRC_STATES, rule->max_src_states); + nlattr_add_u32(nw, PF_RT_MAX_SRC_CONN, rule->max_src_conn); nlattr_add_u32(nw, PF_RT_MAX_SRC_CONN_RATE_LIMIT, rule->max_src_conn_rate.limit); nlattr_add_u32(nw, PF_RT_MAX_SRC_CONN_RATE_SECS, rule->max_src_conn_rate.seconds); diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index bd173c0137ce..acb4b31320c0 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -258,6 +258,7 @@ enum pf_rule_type_t { PF_RT_SRC_NODES = 71, /* u64 */ PF_RT_ANCHOR_CALL = 72, /* string */ PF_RT_RCV_IFNAME = 73, /* string */ + PF_RT_MAX_SRC_CONN = 74, /* u32 */ }; enum pf_addrule_type_t { From nobody Fri Sep 27 13:00:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFVtk34m3z5XykP; Fri, 27 Sep 2024 13:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFVtk2b1zz4wKF; Fri, 27 Sep 2024 13:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727442014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nmR544VIpS2A6jsXZ8wgIEzK0Y22Udd5Vwcnm4BbJ/s=; b=cYK/4FKSp5oiiI17agidjE0PkH3ALDRXRjqyaLsFIWU+tiQhDwCKTkuwbvCO6AbE+4TEP7 lEZUVbyc2WJ+MbqeZqxcy28gQFMCauQcbbuz62+/upkzQZjoD3FImoX9fBuuOCbPflEwLu LuDZ/cdHgBLarSb38VFvsgpVZ2UKeuAXP0ZnZ1Wbhb4CXSPQTGxtB8nM+aSD8vg0P2o2CV in5rabe9LyGxMzxvyHAq4Whz7538zmpwyzDnNQK3AMs1cFFvVS5VJjg/A42fY8x6EYawIr bPjre6Ho/yb2jqW49hRAsecyNKhXb5qMVf2pONn1ZIRLH8+fdKmw0+Zi3himtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727442014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nmR544VIpS2A6jsXZ8wgIEzK0Y22Udd5Vwcnm4BbJ/s=; b=uyNYYFyO+S4dJkjHxXuwiFzIqUOCyeckpn2MG79ce8zo7Oo6IyxzHZTBcdZzTIbIf+7R5v vQL2V5/Tb3ekOF57ZWwinbztl/LGP/a2RB7knxXpA7hb4++6CwdEfdjJyRrb4KXrbGbQGK +6bkyu5hXZfpmWBwuvjbJTNUhZNgzp/YFWBzA/at3/Xtvor7gTmaILHFlABW9WfM0aL1zp 3ZrWVUEBo1k289sdqZAHj9Sf5ARNtXaXa0gI8UoqUOv9LgO2EJ2dIlDFw5JNAgo525x5TP S3cdLgzup2fjU8odhJXROAD7INTUy/TsZz0Btu9EmX4yRjV3z4Ku3wZky6J8qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727442014; a=rsa-sha256; cv=none; b=hM4/YyGgY9wiyv+tuK40PHuv2jzLcys7o8kMQZb72CRw7tvE5zjy2TZlKL+tNUjin8ANaz YvEmPUNgiVOSTUm3xm4cdiIHsKfBrILvlDGwnJgNoIGKyKfqx4BFp+kRVVgQYuuYLgB/zA fBH/6GQMFXHVVXEMnK5+F43u+rcQGFT01GNVyEYNAtfVLzvJoRi4oFRmLSGNKH+XlQkGvH XFfqmDUPs04VSzB80SkNdoOKPrxd+m6Sk49J8eYjWjBHsAjCg2qyyey6Sj/4cleRYRXdso nsfxo1E16mfGARKekhFN+q57EAr4ThhBuxBE89b8M9Z6RelJmXnS+2N7cCgP6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFVtk2BJvzhck; Fri, 27 Sep 2024 13:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RD0EtD095741; Fri, 27 Sep 2024 13:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RD0Em6095732; Fri, 27 Sep 2024 13:00:14 GMT (envelope-from git) Date: Fri, 27 Sep 2024 13:00:14 GMT Message-Id: <202409271300.48RD0Em6095732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 94693ec7c853 - main - bhyve: initialize register value List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94693ec7c85363f9b0098247489cea3efdb183f9 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=94693ec7c85363f9b0098247489cea3efdb183f9 commit 94693ec7c85363f9b0098247489cea3efdb183f9 Author: Pierre Pronchery AuthorDate: 2024-07-24 19:33:26 +0000 Commit: Ed Maste CommitDate: 2024-09-27 12:59:36 +0000 bhyve: initialize register value In case of an error in a code pattern like ``` uint64_t val; error = memread(vcpu, gpa, &val, 1, arg); error = vie_update_register(vcpu, reg, val, size); ``` uninitialized stack data would be used. Reported by: Synacktiv Reviewed by: markj Security: HYP-21 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46107 --- sys/amd64/vmm/vmm_ioport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/vmm/vmm_ioport.c b/sys/amd64/vmm/vmm_ioport.c index f036841f4e10..fc1ecab9f209 100644 --- a/sys/amd64/vmm/vmm_ioport.c +++ b/sys/amd64/vmm/vmm_ioport.c @@ -101,7 +101,7 @@ static int emulate_inout_port(struct vcpu *vcpu, struct vm_exit *vmexit, bool *retu) { ioport_handler_func_t handler; - uint32_t mask, val; + uint32_t mask, val = 0; int error; /* From nobody Fri Sep 27 13:57:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFX9c02wPz5Y2Tt; Fri, 27 Sep 2024 13:58:12 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFX9b0clLz52bj; Fri, 27 Sep 2024 13:58:11 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.54 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-82ceab75c05so95659739f.0; Fri, 27 Sep 2024 06:58:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727445490; x=1728050290; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=i32B/d9oWfKFKfFTJXEkvdxp2HdG07+JJcXjHn+5aaM=; b=Zo4nzxxLtwL8jEFxmOtfwKAAoTNuxk0766bYLvnBdbzd3SNNeZIZSo6wDZg90P8a+B CGSOM/0EsAB33+DiWrsil558lWwlRa6Qht7But5LRLqn7nVBB7vYwHxOAwAxJebCRJ3o ix0nBdvsJh64kQG35tezQD29A/f/dKVUqOGyVktLEoXDZr+n9UvuBKQ4swnZiQju2+1j TfemOzP4oLzCWgg/4Gkq/XNx/PeeDS3n0UXk4XzQn7Zoz3SfSXXuGZ27a3bkvAb03KHX ubmbMYCosyA8gR6LEz+HLpfNrbaxNvUgsljnwMRmfdTfL3gNI9LYm9pOneORMzuhK1E8 6jsg== X-Forwarded-Encrypted: i=1; AJvYcCUfKh88pAdhY+BkXeRWJta9qYZplrGuYNL2wP6N23yhClDjz4OPeSlfT0cni9hiyoAugU62+Ak6pbwf1Fg15kdXmV+RgLU=@freebsd.org, AJvYcCXhu83LEIcx78N8gQBjdIl+6XH+s5FkJzNTEBW5cqAm3XeTY2gBTdC9RpPFX/uoJdzIxKzOA5zyUQhoocOBbGCy2dhN@freebsd.org X-Gm-Message-State: AOJu0YxgdcZlbeaDGvFjRGrE/JZfsb85WP6X1Z5nb/cWMCSRamZmjEu1 Oo946xEniPWCO9wOOhluQrqC2chhsv8RhPkvjkciB+63MiFcO8yXp2po5F8tC7OiwBQRWNuquxv nctOF1EsceNVcj1mPC56mdxhq0JFBkA== X-Google-Smtp-Source: AGHT+IEskKtWI4t1/5pvp9FlRPf/DCODk/xrYslpsyHIxR2HxC7vR6RcmdwOKBvFBOmdAJSYI//ISPudkt4KGO33qw4= X-Received: by 2002:a05:6602:620c:b0:82d:581:8862 with SMTP id ca18e2360f4ac-834932600c7mr359448039f.10.1727445489710; Fri, 27 Sep 2024 06:58:09 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202409271300.48RD0Em6095732@gitrepo.freebsd.org> In-Reply-To: <202409271300.48RD0Em6095732@gitrepo.freebsd.org> From: Ed Maste Date: Fri, 27 Sep 2024 09:57:57 -0400 Message-ID: Subject: Re: git: 94693ec7c853 - main - bhyve: initialize register value To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-2.89 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.993]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[carpeddiem]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.54:from]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.54:from] X-Rspamd-Queue-Id: 4XFX9b0clLz52bj X-Spamd-Bar: -- On Fri, 27 Sept 2024 at 09:00, Ed Maste wrote: > > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=94693ec7c85363f9b0098247489cea3efdb183f9 > > commit 94693ec7c85363f9b0098247489cea3efdb183f9 > Author: Pierre Pronchery > AuthorDate: 2024-07-24 19:33:26 +0000 > Commit: Ed Maste > CommitDate: 2024-09-27 12:59:36 +0000 > > bhyve: initialize register value > > ... > Security: HYP-21 Oops, this is the wrong identifier. This one is HYP-22 in the Synacktiv report (to be shared in the near future). From nobody Fri Sep 27 14:21:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFXhB28tKz5Y3Wx; Fri, 27 Sep 2024 14:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFXhB1hpKz559V; Fri, 27 Sep 2024 14:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727446874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fekf4nC1CtF0eMimY0t06hPuUUknD+lJhY+ey08+Z2k=; b=EKqqiXNA/5DRtKvX6uvP4EtVQNOeXi8pfAhlitpbpv7RgnTeEEIx3715nGpvYVWOqtGgyk ftZc7T1SlRk8hDzO6wKevIOGOWdp6b2ueewpjik+DiwmkdKBA+X58rBnLJtUJ9OblePkHF VSEpzfzn/rSkXAHp6Vx6jH7u9T6AW6LLn/Saw/97MshNg4L8pauWRza5D2fg+oI1I8NSz2 5ZhOoXyknxN5mboZJKpYBfJUH3T8VuYm0YSmHUKc4FhU7l4GjU4L/6aLCAm3GV1o8xJmV3 Qm3RX+uPm6C8GVdobLPaol5Y8Kl2jyX6mCfoasUBcW9ajN1zNDqFeRtKZyvB0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727446874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fekf4nC1CtF0eMimY0t06hPuUUknD+lJhY+ey08+Z2k=; b=MZFJUnk+12tbVochtka/AWM3HmYKxgra4/YowY/rJkWwyIax9ZiPaeeyTT9Cs0Eog6SpwR u3OBb5qm29z8ME9K6Hfr0dmisnrWrOFVU9xYae7PvV2uDW1PMo+Fze4uHivXnDOxo9d96B srFT8rtDRc6C8dUCLuCVOltG7/qdwDJMde+JtCDK5z7sByGkIcnqI0HqCaMRTMyfqXKdDm EPpT3Dq9YtX8DsahAAICAOUaDhwpqdju42gOdxz5FugimeymVJJV5EmiQTBuH/YP743Ru8 EhKOWSU8RZfRWmNNs+SCCYdsHBOcirKGyS9k2GLm/UO4jpzFUGOpaTt1MMtGIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727446874; a=rsa-sha256; cv=none; b=ahjYC4j5BH4tH3Xn2R2kwhX8mz9huW23yZ7BiK/Cu/CyPl8ESL+UO1BBdNDYIxM9/bMYDT ps2WL7MUVO7FawMSaH9OIHEJqgQy5HAsoEw9Szk6QeVhLHq1ziIz1qADvrWJErhqC+aRLd I7dM9CEnvaSY3n+eOzcPSSAwc3y6jr/GmGEO/0EfGDMfodB+WBM0d5OALy3mIt4YwDupRp x/1SvPfeAwfB8SHCn/W9a+AP6EQ1Ri1mren1jidULlCJ8pbcjaRoCs+MNEWC1c3JRj7o6g tfyEOyM1Zl8pWu2jXV5j7sv+EuF3H5ZbnYFWWXQv79tTejPFETaqa/p7qrj23Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFXhB1Hm8zjvQ; Fri, 27 Sep 2024 14:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RELEDS033545; Fri, 27 Sep 2024 14:21:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RELEbQ033542; Fri, 27 Sep 2024 14:21:14 GMT (envelope-from git) Date: Fri, 27 Sep 2024 14:21:14 GMT Message-Id: <202409271421.48RELEbQ033542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 869d760cb9d7 - main - bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 869d760cb9d7a307faa2fbe8c1c2b238a81b74d4 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=869d760cb9d7a307faa2fbe8c1c2b238a81b74d4 commit 869d760cb9d7a307faa2fbe8c1c2b238a81b74d4 Author: Pierre Pronchery AuthorDate: 2024-08-27 13:57:32 +0000 Commit: Ed Maste CommitDate: 2024-09-27 14:20:53 +0000 bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon() Avoid a race condition when accessing guest memory, by reading memory contents only once. This has also been applied to _vq_record() in sys/dev/beri/virtio/virtio.c, as per markj@'s suggestion. Reported by: Synacktiv Reviewed by: markj Security: HYP-10 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45735 --- sys/dev/beri/virtio/virtio.c | 11 ++++++++--- usr.sbin/bhyve/virtio.c | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/sys/dev/beri/virtio/virtio.c b/sys/dev/beri/virtio/virtio.c index 60239b335020..533a6f1209e1 100644 --- a/sys/dev/beri/virtio/virtio.c +++ b/sys/dev/beri/virtio/virtio.c @@ -106,12 +106,17 @@ paddr_unmap(void *phys, uint32_t size) static inline void _vq_record(uint32_t offs, int i, volatile struct vring_desc *vd, struct iovec *iov, int n_iov, uint16_t *flags) { + uint32_t len; + uint64_t addr; + if (i >= n_iov) return; - iov[i].iov_base = paddr_map(offs, be64toh(vd->addr), - be32toh(vd->len)); - iov[i].iov_len = be32toh(vd->len); + len = atomic_load_32(&vd->len); + addr = atomic_load_64(&vd->addr); + iov[i].iov_base = paddr_map(offs, be64toh(addr), + be32toh(len)); + iov[i].iov_len = be32toh(len); if (flags != NULL) flags[i] = be16toh(vd->flags); } diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c index 26df39ceb5b3..304156bf7416 100644 --- a/usr.sbin/bhyve/virtio.c +++ b/usr.sbin/bhyve/virtio.c @@ -216,10 +216,15 @@ static inline void _vq_record(int i, struct vring_desc *vd, struct vmctx *ctx, struct iovec *iov, int n_iov, struct vi_req *reqp) { + uint32_t len; + uint64_t addr; + if (i >= n_iov) return; - iov[i].iov_base = paddr_guest2host(ctx, vd->addr, vd->len); - iov[i].iov_len = vd->len; + len = atomic_load_32(&vd->len); + addr = atomic_load_64(&vd->addr); + iov[i].iov_len = len; + iov[i].iov_base = paddr_guest2host(ctx, addr, len); if ((vd->flags & VRING_DESC_F_WRITE) == 0) reqp->readable++; else From nobody Fri Sep 27 15:03:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFYct1j9Xz5Y5r8; Fri, 27 Sep 2024 15:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFYct0qFLz58y0; Fri, 27 Sep 2024 15:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHgnYM/aiegeA+1leYF60pIWH9Ocl0fuW+VW8FYmUWY=; b=OrcjmObsV0JGizZAlyq8DlgroqtHGaNtr04XUDH90Sanz0o+MJAi+oCRwIYK0mCqfbNz13 65PVhO+YfhdtorPpeTcUznJ57gizaoBFx//sJmzJdrdHx328AHWWxKV6ePfsgEP0DLMz63 hYOxoO1DHqqU3fX7sljeruhdrTF5GRgbo6uGn3i8a3pnPV/i2N3Udm/mM1kaY6YQfmevEc DHitL0E+rq6qBAUuRxvwJdwgmayuYjfSxAElL4UeH+YveCL7wi5aTCoc1niOCjCHlvuJr7 be57Ycladm5QjAzhOXJc6uLSJ0IEDLsR2qnvFbYa1F9U2cVHmrNprSjHgAQoRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHgnYM/aiegeA+1leYF60pIWH9Ocl0fuW+VW8FYmUWY=; b=OBCb5VgzdD6zp8wIaTfptv+VtBnHnPe7M6aVBmU0UkJOdellKlW5R9gVo+V4AcEXMMspdL OI4KefvxNX4ksuTQRDnoMocBXhcrtlb4Ix4bsPhhn0JFVB34HozMefud2eQ7eI0rS+fS8B bfW+7Gv/NJPbWMxijlJ2QrWCWmc9PtP6GWbsBO9XOBL4QECFxaiEw8MJIXcj9LargnRvEC itDeJwlV52m0Mwwvp296iEsY/O1R5AJGn2z4WUiwGYFFBN7GOBv88R1tPSZkHI06iT907y Bgzn2MEHAvGI5elaUkIwXVt17u8DCXJceQQvhQjqZ3V792ToRYn1x8q6sAPTxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727449406; a=rsa-sha256; cv=none; b=gXR8gK9nDWMvCs9uxaqkw9ai0UsiLvY5csX5uP+hzml53H9iICa9CBtchYAYIF1fJdKvCf TO+a+QMrayoThvzP8zGiN1OCMDfQCX1iMRIemXkgpBajiPYpQ8TwfSkFUPRiHvNxU5P6H6 Q/1ji3J47A6O4GVnGd+Xy/aFqJWpq3/tCGB9Gu/paA9TbPN2GpHF2zgaLjd0WoLcgA10xO lnQSjeMeDKbOerdF/j6xgMKJSB/3Y77c54jUmKA/VuitBQ5aXTlhF4rIoYq6dCOhchqSdL yPjOefwtpnqhIEtvIzuZGaek44qrCm9JEEB5ueNFFKdf2J4OQfjxUwInY8G1EQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFYct0QjBzlWw; Fri, 27 Sep 2024 15:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RF3QeZ009095; Fri, 27 Sep 2024 15:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RF3PMu009092; Fri, 27 Sep 2024 15:03:25 GMT (envelope-from git) Date: Fri, 27 Sep 2024 15:03:25 GMT Message-Id: <202409271503.48RF3PMu009092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9c3e516ad081 - main - Add proc_nfiles(9) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c3e516ad08145ad47248633b54fd1b7fc0ef981 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9c3e516ad08145ad47248633b54fd1b7fc0ef981 commit 9c3e516ad08145ad47248633b54fd1b7fc0ef981 Author: Konstantin Belousov AuthorDate: 2024-09-20 16:28:23 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 15:01:56 +0000 Add proc_nfiles(9) which returns a snapshot of the count of the opened files in the process. Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46747 --- sys/kern/kern_descrip.c | 44 +++++++++++++++++++++++++++++++++----------- sys/sys/filedesc.h | 2 ++ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index ef7aea82a609..09eeb158f1f5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -4329,21 +4329,13 @@ filedesc_to_leader_share(struct filedesc_to_leader *fdtol, struct filedesc *fdp) } static int -sysctl_kern_proc_nfds(SYSCTL_HANDLER_ARGS) +filedesc_nfiles(struct filedesc *fdp) { NDSLOTTYPE *map; - struct filedesc *fdp; - u_int namelen; int count, off, minoff; - namelen = arg2; - if (namelen != 1) - return (EINVAL); - - if (*(int *)arg1 != 0) - return (EINVAL); - - fdp = curproc->p_fd; + if (fdp == NULL) + return (0); count = 0; FILEDESC_SLOCK(fdp); map = fdp->fd_map; @@ -4351,7 +4343,37 @@ sysctl_kern_proc_nfds(SYSCTL_HANDLER_ARGS) for (minoff = NDSLOT(0); off >= minoff; --off) count += bitcountl(map[off]); FILEDESC_SUNLOCK(fdp); + return (count); +} + +int +proc_nfiles(struct proc *p) +{ + struct filedesc *fdp; + int res; + + PROC_LOCK(p); + fdp = fdhold(p); + PROC_UNLOCK(p); + res = filedesc_nfiles(fdp); + fddrop(fdp); + return (res); +} + +static int +sysctl_kern_proc_nfds(SYSCTL_HANDLER_ARGS) +{ + u_int namelen; + int count; + + namelen = arg2; + if (namelen != 1) + return (EINVAL); + + if (*(int *)arg1 != 0) + return (EINVAL); + count = filedesc_nfiles(curproc->p_fd); return (SYSCTL_OUT(req, &count, sizeof(count))); } diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 53034acb1b54..242f5b8831fd 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -335,6 +335,8 @@ fd_modified(struct filedesc *fdp, int fd, seqc_t seqc) } #endif +int proc_nfiles(struct proc *p); + /* cdir/rdir/jdir manipulation functions. */ struct pwddesc *pdcopy(struct pwddesc *pdp); void pdescfree(struct thread *td); From nobody Fri Sep 27 15:03:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFYcv3v31z5Y5rD; Fri, 27 Sep 2024 15:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFYcv2PSVz58y2; Fri, 27 Sep 2024 15:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7TewG2kAFuzA6KZH+5oM2Q6EzSwr4NKlprxZDTQkfQQ=; b=XbzR6R5KaQ+gw68jjwZj/eAvNL/k0u8GnBvuhTYY6h7pLO8lfqaJuwEeCIQ4q07vzELouc r8a3fL50NlYlLQ4cU4VZkx8hscmkEwnNLzdnbp12LMJ7TTtagOH1lwjJsGX+GJuj6OinZy L3Ym+QHXoOpj8x5LuetqR9kvDVszdBCW02Y/McXy4poLg2aqcA8QWtzKapMbflDUmzaGGn ZB+Lx82qIkjg981H/Di/4UTU2J9Otrh991JYtZo9i6UdvY6Xbaz4cmW3NoXpP+elMmrZbf ft6kOvUed0PEq8VgxmZMtSTpVGCCrTtZ1kilALmel+NULnsFQbUyLtA7l9aCPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7TewG2kAFuzA6KZH+5oM2Q6EzSwr4NKlprxZDTQkfQQ=; b=v58AOv4x02gqRjg8MvT5qWhIfjU5SAuv1hKaYweqfIXt+FXb+vmko0WB7eKRzCQ2bc5oJj Ul5bDpPevVWsWe+w1Qx8wlyN9BEoPEPV1XcR47WRsFCbF26bDI21sZyqH4/JI50Mi20+mt P25ZO65LRXcq852lVh+ceSqG+IuIpafoioXnitdUfdVcR85bKNKo/Lx4430d0NlASwYLZj PfyiTqIIO6ZSxhPFSYj9VXRnHn9KKkTMveX5FhY8okQ+TiP5nvOzwXOYVhjaqGbg8GMgNx /E+iwyK1NxR6heKHLERwO7DVt3mOcScKoOy6SPGJvX/vzZqtSxXtTwuRQqYFtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727449407; a=rsa-sha256; cv=none; b=WYmeBgBYQx7RACVWerpS5sX8NI6EWkiV4tUo+xL6zU+91ST6pRhUrHcZQDVsUorM/yZXcB no1Cbp4kyWD/5bnKuzZaxtAQNKtyV4Xmc4/RhNTH3wBtQ2fKKkBRynRDBAjotdjjHNFZdA EDx26t2wdU5lU+oK57wKf/WnKSAVOblBfqnTmvETMB0TBEfS9jIKrJfdkae1eTm2V+WOKs gXpOFvRZMxtmwzr1mx78XKMxlbONPEx53lEQfKIJFfzkpmh6JL3SbTxZtf9FFq7aLqbeN4 b65qu5jCIxKMZg8qkKv4yYclmRZCoV8qmNAB8pme5CuC8VK25+rVkBxeW6+gJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFYcv1hXFzl68; Fri, 27 Sep 2024 15:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RF3Rh1009134; Fri, 27 Sep 2024 15:03:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RF3R1l009131; Fri, 27 Sep 2024 15:03:27 GMT (envelope-from git) Date: Fri, 27 Sep 2024 15:03:27 GMT Message-Id: <202409271503.48RF3R1l009131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f028f44ef3cb - main - Add getrlimitusage(2) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f028f44ef3cb10aafadf8b9f29954ed58bd88c70 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f028f44ef3cb10aafadf8b9f29954ed58bd88c70 commit f028f44ef3cb10aafadf8b9f29954ed58bd88c70 Author: Konstantin Belousov AuthorDate: 2024-09-20 15:18:38 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 15:02:04 +0000 Add getrlimitusage(2) Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46747 --- sys/kern/kern_resource.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/syscalls.master | 7 +++ sys/sys/resource.h | 3 ++ 3 files changed, 125 insertions(+) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 58723289af21..db5cce833012 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include #include #include +#include static MALLOC_DEFINE(M_PLIMIT, "plimit", "plimit structures"); static MALLOC_DEFINE(M_UIDINFO, "uidinfo", "uidinfo structures"); @@ -804,6 +806,119 @@ sys_getrlimit(struct thread *td, struct getrlimit_args *uap) return (error); } +static int +getrlimitusage_one(struct proc *p, u_int which, int flags, rlim_t *res) +{ + struct thread *td; + struct uidinfo *ui; + struct vmspace *vm; + uid_t uid; + int error; + + error = 0; + PROC_LOCK(p); + uid = (flags & GETRLIMITUSAGE_EUID) == 0 ? p->p_ucred->cr_ruid : + p->p_ucred->cr_uid; + PROC_UNLOCK(p); + + ui = uifind(uid); + vm = vmspace_acquire_ref(p); + + switch (which) { + case RLIMIT_CPU: + PROC_LOCK(p); + PROC_STATLOCK(p); + FOREACH_THREAD_IN_PROC(p, td) + ruxagg(p, td); + *res = p->p_rux.rux_runtime; + PROC_STATUNLOCK(p); + PROC_UNLOCK(p); + *res /= cpu_tickrate(); + break; + case RLIMIT_FSIZE: + error = ENXIO; + break; + case RLIMIT_DATA: + if (vm == NULL) + error = ENXIO; + else + *res = vm->vm_dsize * PAGE_SIZE; + break; + case RLIMIT_STACK: + if (vm == NULL) + error = ENXIO; + else + *res = vm->vm_ssize * PAGE_SIZE; + break; + case RLIMIT_CORE: + error = ENXIO; + break; + case RLIMIT_RSS: + if (vm == NULL) + error = ENXIO; + else + *res = vmspace_resident_count(vm) * PAGE_SIZE; + break; + case RLIMIT_MEMLOCK: + if (vm == NULL) + error = ENXIO; + else + *res = pmap_wired_count(vmspace_pmap(vm)) * PAGE_SIZE; + break; + case RLIMIT_NPROC: + *res = ui->ui_proccnt; + break; + case RLIMIT_NOFILE: + *res = proc_nfiles(p); + break; + case RLIMIT_SBSIZE: + *res = ui->ui_sbsize; + break; + case RLIMIT_VMEM: + if (vm == NULL) + error = ENXIO; + else + *res = vm->vm_map.size; + break; + case RLIMIT_NPTS: + *res = ui->ui_ptscnt; + break; + case RLIMIT_SWAP: + *res = ui->ui_vmsize; + break; + case RLIMIT_KQUEUES: + *res = ui->ui_kqcnt; + break; + case RLIMIT_UMTXP: + *res = ui->ui_umtxcnt; + break; + case RLIMIT_PIPEBUF: + *res = ui->ui_pipecnt; + break; + default: + error = EINVAL; + break; + } + + vmspace_free(vm); + uifree(ui); + return (error); +} + +int +sys_getrlimitusage(struct thread *td, struct getrlimitusage_args *uap) +{ + rlim_t res; + int error; + + if ((uap->flags & ~(GETRLIMITUSAGE_EUID)) != 0) + return (EINVAL); + error = getrlimitusage_one(curproc, uap->which, uap->flags, &res); + if (error == 0) + error = copyout(&res, uap->res, sizeof(res)); + return (error); +} + /* * Transform the running time and tick information for children of proc p * into user and system time usage. diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index fac1c2e1e96f..849e5ee2f13b 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -3333,5 +3333,12 @@ uintptr_t idx2 ); } +589 AUE_NULL STD|CAPENABLED { + int getrlimitusage( + u_int which, + int flags, + _Out_ rlim_t *res + ); + } ; vim: syntax=off diff --git a/sys/sys/resource.h b/sys/sys/resource.h index 81346028f1ed..d2803cccf380 100644 --- a/sys/sys/resource.h +++ b/sys/sys/resource.h @@ -171,6 +171,9 @@ struct loadavg { #define CP_IDLE 4 #define CPUSTATES 5 +/* getrlimitusage flags */ +#define GETRLIMITUSAGE_EUID 0x0001 + #endif /* __BSD_VISIBLE */ #ifdef _KERNEL From nobody Fri Sep 27 15:03:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFYcw5k4pz5Y62d; Fri, 27 Sep 2024 15:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFYcw35L5z58yD; Fri, 27 Sep 2024 15:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55+ohgQj7GIRiUJfht5TVhRaEx9zcGmcm5F1xxtp0II=; b=bWF9qS0i4sCxS615uFjVdYrjm0sUEQnkCeZxIiVbEBzKVcxHaUjz9ZFp6yIwzRvLqhsstj 4EJeY+jFc71PcMV6XFkmKL8JPLHG6WnL+ifpGqOJuZUZW/QXfGmlo+4qOelm3lVcO/Occ2 nesZK3yNJgyPlHqru5osWgdXdl+7EBM+Sq/W0RLHoeK1Iavz0mPyT+74QG1PbViKGYz247 6ibAMX3uJYLkvSwcfL+5CL+CZKZm+iz9otbndITcgyzcizNQlpZo83+vHVN8xLGYPq4mjf IXJA1gTFGZjPnxLDmsJl75sXM4lFzAoGEAqc16C7l6JqHCiIEodG3t+2yy4LaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55+ohgQj7GIRiUJfht5TVhRaEx9zcGmcm5F1xxtp0II=; b=ruhqZpybMrqzWhzx46oxKwzsu0T7dXOUTCI+p4Wh7tT2FL6nXlUeccblX0NegjnvHbyprx SceYvX896EeCd3kM2a2UvUvl8zDLB70Le1LSHiovxDpR01sg53sLjchZRlJdnQ5DR/9iY/ 0FN/Kc+3bf0Z+P5ion3NNCqD5bNROkDa+DAr0jWVr8/H7yB3G/ydVP9+80IF4fzGwL6RAh KwXwuN39QmY3Lz2Bp78gjDP6NS8sK87xz+0Fvw8nkgneFmemWJMVHRj32Oijqrkq2ygPIY rsh9KkUHeVVuNvAlXEmuJdX/zeENwdQz7p5HFom3SgZPFIsmB30aqXK0dAZLMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727449408; a=rsa-sha256; cv=none; b=BLG9/wKKRFWCpmJm8+63dvR7G4gNVeXD4ofHe7FvzjaRgM+WiKW2kvurmRxzf4LqozmzKy 0KACHg2G/DioPqxxXwndAwAPuAyex3PTM+WtG+Cc2ksJlzJ92+rLqJmi9btbjqdxTDmvIg asLahVaU880dDkquJ1SRTZ8z2zD8eSma0xLa5KOEZXEsWuACFwNb/CgbbPWEfQ1ByGCdGq JlQ/A0HdaFOFql4L0gNTopR7i7ny9X6XHp19A8VmH+2hxyN5kOoK3Uxy9C5x16TFggBKk8 8Z8TN2LddqTamqkbDAuiWJVwNXBWtCguTson9YZoWMSqykx7YfqzjRhVbQrgnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFYcw2gBfzlrM; Fri, 27 Sep 2024 15:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RF3SPe009176; Fri, 27 Sep 2024 15:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RF3Svj009173; Fri, 27 Sep 2024 15:03:28 GMT (envelope-from git) Date: Fri, 27 Sep 2024 15:03:28 GMT Message-Id: <202409271503.48RF3Svj009173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9b29fc89ae20 - main - Userspace enablement for getrlimitusage(2) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b29fc89ae20a22516f54e146bfdfa0cfcd60b8b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9b29fc89ae20a22516f54e146bfdfa0cfcd60b8b commit 9b29fc89ae20a22516f54e146bfdfa0cfcd60b8b Author: Konstantin Belousov AuthorDate: 2024-09-20 15:22:57 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 15:02:09 +0000 Userspace enablement for getrlimitusage(2) Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46747 --- lib/libsys/Symbol.sys.map | 1 + sys/sys/resource.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/libsys/Symbol.sys.map b/lib/libsys/Symbol.sys.map index 7f70e03a5c25..5a4e66baf3c4 100644 --- a/lib/libsys/Symbol.sys.map +++ b/lib/libsys/Symbol.sys.map @@ -379,6 +379,7 @@ FBSD_1.7 { }; FBSD_1.8 { + getrlimitusage; kcmp; }; diff --git a/sys/sys/resource.h b/sys/sys/resource.h index d2803cccf380..2725aa1ef646 100644 --- a/sys/sys/resource.h +++ b/sys/sys/resource.h @@ -190,6 +190,9 @@ int getrlimit(int, struct rlimit *); int getrusage(int, struct rusage *); int setpriority(int, int, int); int setrlimit(int, const struct rlimit *); +#if __BSD_VISIBLE +int getrlimitusage(unsigned which, int flags, rlim_t *res); +#endif __END_DECLS #endif /* _KERNEL */ From nobody Fri Sep 27 15:03:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFYcx70V3z5Y60q; Fri, 27 Sep 2024 15:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFYcx3qPxz58bs; Fri, 27 Sep 2024 15:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B4V/l2B0uWaryGF1h/xL3rx7IFExZcIMDCToPjqu2Zo=; b=yPTIRDRaJ5stRLMwrSFNhaBZb6s8j4bo9j4Hv1e+98Oya26K/FztS1F3auESx39vBr+/sC klUfZ3Z0zHJE/BQHckTxwxh9c5I5Q2ElHXB+a7GjmgdakGUUYNipFqU/3lNQlLhnfuYlt6 PjPL1SzaggFkQKKA80FcLdgLb5yS8PH6uD0ga5Z789q96lmRaowqzcpsNxWJRHy6CRB0Md UA/xZXVCkt9xYuDRVwEhXMSQcSKbR15zalOg2PVA5VcDiVqf0AT8hvcosRAlwZgE00Tslm xo9jrqB2BBYW3tjdAyFErKTkvIbBvtP1zWsR+GsXZzQuem4U8PCuObWez8ApSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B4V/l2B0uWaryGF1h/xL3rx7IFExZcIMDCToPjqu2Zo=; b=jfacjcS2I42ozPatQJbwLM4RcWZuaXxmuFLQt/3XUl+x58/il8pPXkja32Ekg0G+TgKFbO 7mVZLqQsS8cle+2VNj2SJTeX8wkz3plXsJDianJpXOif4nE99PSshVNElLOsZ3//u/rrnS YRJs6VMW9bs5qsB7vc0Ym2AEvk0l58wNyAAoqwoG3JNVhDDOLAwmW3YwkMqNUiqp85Eje6 PXscr+H2sU/7ud/8A8s9+aUflZEOO0SsiCu5JqvVuAH2oXQ6dlrfX7dmun8TgPo02hW0ts 0efxSM2c+8D7n4UKUh9z9Fe5yf/NGHUv5S/h1L4DP7vFjpfnPSg2CPVbXdnIRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727449409; a=rsa-sha256; cv=none; b=ly8sJ7YYpRRjIA/5I+0en2JvAQwLm+jApL9kDqG/C47hRlHlS0F8mNGrxGyblfaODExZ1Z jYknzn+afKklZ9e+U41hXNZuOvx8JxlLwoDb4vdfkelYARRALz83dVS+YtFPiJEiD4yDYH PDZEiPTbVCses2L1MuVKBQ9Dk4zvHjhs6y3E6Syv2TOnIEDQnNdsgFt1fJEbkjWk7TXZbi aVAB6o3gk3vjYk7Al09meoj80D1KOlk74CEUKbxkSOXnQ9L81YkWr2gwFZ0a36W+Sa6iLp WIV4LUjv4Ouq50NLhz5sl2eVKDtSBDRSUmOVypinh3LQMwQoUItYi2n4X2GhUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFYcx3RZwzlWx; Fri, 27 Sep 2024 15:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RF3T8I009206; Fri, 27 Sep 2024 15:03:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RF3T45009203; Fri, 27 Sep 2024 15:03:29 GMT (envelope-from git) Date: Fri, 27 Sep 2024 15:03:29 GMT Message-Id: <202409271503.48RF3T45009203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 927f379180cd - main - Regen List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 927f379180cd2f3d3460d2f3506d0059ea1c6cf8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=927f379180cd2f3d3460d2f3506d0059ea1c6cf8 commit 927f379180cd2f3d3460d2f3506d0059ea1c6cf8 Author: Konstantin Belousov AuthorDate: 2024-09-20 15:21:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 15:02:23 +0000 Regen --- lib/libsys/_libsys.h | 2 ++ lib/libsys/syscalls.map | 2 ++ sys/compat/freebsd32/freebsd32_syscall.h | 3 ++- sys/compat/freebsd32/freebsd32_syscalls.c | 1 + sys/compat/freebsd32/freebsd32_sysent.c | 1 + sys/compat/freebsd32/freebsd32_systrace_args.c | 30 ++++++++++++++++++++++++++ sys/kern/init_sysent.c | 1 + sys/kern/syscalls.c | 1 + sys/kern/systrace_args.c | 30 ++++++++++++++++++++++++++ sys/sys/syscall.h | 3 ++- sys/sys/syscall.mk | 3 ++- sys/sys/sysproto.h | 7 ++++++ 12 files changed, 81 insertions(+), 3 deletions(-) diff --git a/lib/libsys/_libsys.h b/lib/libsys/_libsys.h index d4cd14ceb75f..4565740a25bc 100644 --- a/lib/libsys/_libsys.h +++ b/lib/libsys/_libsys.h @@ -461,6 +461,7 @@ typedef int (__sys_timerfd_create_t)(int, int); typedef int (__sys_timerfd_gettime_t)(int, struct itimerspec *); typedef int (__sys_timerfd_settime_t)(int, int, const struct itimerspec *, struct itimerspec *); typedef int (__sys_kcmp_t)(pid_t, pid_t, int, uintptr_t, uintptr_t); +typedef int (__sys_getrlimitusage_t)(u_int, int, rlim_t *); void __sys_exit(int rval); int __sys_fork(void); @@ -860,6 +861,7 @@ int __sys_timerfd_create(int clockid, int flags); int __sys_timerfd_gettime(int fd, struct itimerspec * curr_value); int __sys_timerfd_settime(int fd, int flags, const struct itimerspec * new_value, struct itimerspec * old_value); int __sys_kcmp(pid_t pid1, pid_t pid2, int type, uintptr_t idx1, uintptr_t idx2); +int __sys_getrlimitusage(u_int which, int flags, rlim_t * res); __END_DECLS #endif /* __LIBSYS_H_ */ diff --git a/lib/libsys/syscalls.map b/lib/libsys/syscalls.map index eeb75dc28a2c..3d952c691afd 100644 --- a/lib/libsys/syscalls.map +++ b/lib/libsys/syscalls.map @@ -801,4 +801,6 @@ FBSDprivate_1.0 { __sys_timerfd_settime; _kcmp; __sys_kcmp; + _getrlimitusage; + __sys_getrlimitusage; }; diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index 662947c330d4..b3c5c46bd586 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -507,4 +507,5 @@ #define FREEBSD32_SYS_freebsd32_timerfd_gettime 586 #define FREEBSD32_SYS_freebsd32_timerfd_settime 587 #define FREEBSD32_SYS_kcmp 588 -#define FREEBSD32_SYS_MAXSYSCALL 589 +#define FREEBSD32_SYS_getrlimitusage 589 +#define FREEBSD32_SYS_MAXSYSCALL 590 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index b4c41fdbbc12..264a1f17db3b 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -594,4 +594,5 @@ const char *freebsd32_syscallnames[] = { "freebsd32_timerfd_gettime", /* 586 = freebsd32_timerfd_gettime */ "freebsd32_timerfd_settime", /* 587 = freebsd32_timerfd_settime */ "kcmp", /* 588 = kcmp */ + "getrlimitusage", /* 589 = getrlimitusage */ }; diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index b8df64206611..c8ddecc7f131 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -650,4 +650,5 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(freebsd32_timerfd_gettime_args), .sy_call = (sy_call_t *)freebsd32_timerfd_gettime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 586 = freebsd32_timerfd_gettime */ { .sy_narg = AS(freebsd32_timerfd_settime_args), .sy_call = (sy_call_t *)freebsd32_timerfd_settime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 587 = freebsd32_timerfd_settime */ { .sy_narg = AS(kcmp_args), .sy_call = (sy_call_t *)sys_kcmp, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 588 = kcmp */ + { .sy_narg = AS(getrlimitusage_args), .sy_call = (sy_call_t *)sys_getrlimitusage, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 589 = getrlimitusage */ }; diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index ff62adce85b9..9992242dba25 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -3368,6 +3368,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 5; break; } + /* getrlimitusage */ + case 589: { + struct getrlimitusage_args *p = params; + uarg[a++] = p->which; /* u_int */ + iarg[a++] = p->flags; /* int */ + uarg[a++] = (intptr_t)p->res; /* rlim_t * */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -9100,6 +9109,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* getrlimitusage */ + case 589: + switch (ndx) { + case 0: + p = "u_int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "userland rlim_t *"; + break; + default: + break; + }; + break; default: break; }; @@ -10983,6 +11008,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* getrlimitusage */ + case 589: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index e066b04b4f6e..147b26daa4e6 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -649,4 +649,5 @@ struct sysent sysent[] = { { .sy_narg = AS(timerfd_gettime_args), .sy_call = (sy_call_t *)sys_timerfd_gettime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 586 = timerfd_gettime */ { .sy_narg = AS(timerfd_settime_args), .sy_call = (sy_call_t *)sys_timerfd_settime, .sy_auevent = AUE_TIMERFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 587 = timerfd_settime */ { .sy_narg = AS(kcmp_args), .sy_call = (sy_call_t *)sys_kcmp, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 588 = kcmp */ + { .sy_narg = AS(getrlimitusage_args), .sy_call = (sy_call_t *)sys_getrlimitusage, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 589 = getrlimitusage */ }; diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 0e6e3a3dd1f1..a2af13617dee 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -594,4 +594,5 @@ const char *syscallnames[] = { "timerfd_gettime", /* 586 = timerfd_gettime */ "timerfd_settime", /* 587 = timerfd_settime */ "kcmp", /* 588 = kcmp */ + "getrlimitusage", /* 589 = getrlimitusage */ }; diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index e7231bf8570e..2454a8b5137b 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -3455,6 +3455,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 5; break; } + /* getrlimitusage */ + case 589: { + struct getrlimitusage_args *p = params; + uarg[a++] = p->which; /* u_int */ + iarg[a++] = p->flags; /* int */ + uarg[a++] = (intptr_t)p->res; /* rlim_t * */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -9245,6 +9254,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* getrlimitusage */ + case 589: + switch (ndx) { + case 0: + p = "u_int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "userland rlim_t *"; + break; + default: + break; + }; + break; default: break; }; @@ -11218,6 +11243,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* getrlimitusage */ + case 589: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index 1fa5878c6ff6..2a200f12f3c1 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -525,4 +525,5 @@ #define SYS_timerfd_gettime 586 #define SYS_timerfd_settime 587 #define SYS_kcmp 588 -#define SYS_MAXSYSCALL 589 +#define SYS_getrlimitusage 589 +#define SYS_MAXSYSCALL 590 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index 31e698ea2beb..6c8830042045 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -428,4 +428,5 @@ MIASM = \ timerfd_create.o \ timerfd_gettime.o \ timerfd_settime.o \ - kcmp.o + kcmp.o \ + getrlimitusage.o diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index c86c5d1eb212..26817db8d755 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -1877,6 +1877,11 @@ struct kcmp_args { char idx1_l_[PADL_(uintptr_t)]; uintptr_t idx1; char idx1_r_[PADR_(uintptr_t)]; char idx2_l_[PADL_(uintptr_t)]; uintptr_t idx2; char idx2_r_[PADR_(uintptr_t)]; }; +struct getrlimitusage_args { + char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char res_l_[PADL_(rlim_t *)]; rlim_t * res; char res_r_[PADR_(rlim_t *)]; +}; int sys_exit(struct thread *, struct exit_args *); int sys_fork(struct thread *, struct fork_args *); int sys_read(struct thread *, struct read_args *); @@ -2276,6 +2281,7 @@ int sys_timerfd_create(struct thread *, struct timerfd_create_args *); int sys_timerfd_gettime(struct thread *, struct timerfd_gettime_args *); int sys_timerfd_settime(struct thread *, struct timerfd_settime_args *); int sys_kcmp(struct thread *, struct kcmp_args *); +int sys_getrlimitusage(struct thread *, struct getrlimitusage_args *); #ifdef COMPAT_43 @@ -3255,6 +3261,7 @@ int freebsd13_swapoff(struct thread *, struct freebsd13_swapoff_args *); #define SYS_AUE_timerfd_gettime AUE_TIMERFD #define SYS_AUE_timerfd_settime AUE_TIMERFD #define SYS_AUE_kcmp AUE_NULL +#define SYS_AUE_getrlimitusage AUE_NULL #undef PAD_ #undef PADL_ From nobody Fri Sep 27 15:03:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFYcz0c29z5Y6DS; Fri, 27 Sep 2024 15:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFYcy52f3z58fK; Fri, 27 Sep 2024 15:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eRLqVwoP4dHTYrz5e/nK8ud3whTnrkSAiPomW6ZTTcs=; b=NxjZYtajUI1dNI3qoy7Tw+Mb0FPvMSJ6jusRTM/O73HU65B6a6GCn+W6GHb+6LEgg45VX2 xj4koY5TbGjdtqTH2JHXaVAAS0ldb+ppObaJRv84LMJFY0NgNc9mkOMdJaSQuJodInaM/5 xXDYzuhCslNRo9ksf9dXCWlsCaEytnIERAMQ1gCsj5q9FxbHaP8vYj8yZ8LQ0T9TW4tQNw J4EaK5Ttwjrt7P/uWIpDB2xS889dYHnaJyqYNFzrM0vhaGqRJV1y4Y1PLkiTf/wFOho09A MpyyLh2ix7uVuYhiyb7XEaZ8FBt/C3BnoIy0E8zUVmmto5btqoTZZHPl38Ryhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eRLqVwoP4dHTYrz5e/nK8ud3whTnrkSAiPomW6ZTTcs=; b=oabj8WViRJBjIbAOlJ8FoLKaXIexxlvevGNNSzk0DiYApFk2iRQiIAS5KJl9XYK5AbZU/W Q6xU4YaUIeYDp0pgjZKIi7kBK6xK2KUVaFIf78Nw8Oitq0JtSRv7UiI1tsK6hMNUUus73G MsxUz4izn/OT22Zuki13D59lTUbxBBDfZ0aPU1ayKf7SSDe62jzCYgKmcjwp+VCsDpCREs YiaBKSiQU6ku3G7i9ZyAAY+BTI7c6tPUAZraICz9VBYZrtIXNfsb7+qjPMJx1Ws0ejynYl yaKgKdrewEJep9OIMROInY100lmuexiFjDy4OQNuretudGNOUSCvYI6wJdjibQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727449410; a=rsa-sha256; cv=none; b=ExcWJxjCI2HaXOSlk3XBkvlzn8HTz2dxzW2th2ify4YQdvcSBGMgqvTlufSXxJxLzAaIp/ ne02xtb8nU3WAloJp1DhHvPcx8WOngJrcUyv9dZ21Cu/uggkmacI9Hwdh8mM/nAPAXBquD ZrEgjFSHxyU18PrX1hgaKZzsmuAE0qIeahQoXGmnwVJ2GYm4Pl9r9RYCcBmFZBVRnnlbxx NLKfq0TtSK2pnDfrxQ464NwxHO8EKsofhscj9shfRkV2r8eCh1H1lcdoB5cM1XLrKczdqI /6KznM4bZKlr9Of+2UF6lJSInugnvbReWPqX/LdIjtAKHnHlkj34OSMjHXZ2ZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFYcy4Tstzlqr; Fri, 27 Sep 2024 15:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RF3UO6009246; Fri, 27 Sep 2024 15:03:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RF3UjC009243; Fri, 27 Sep 2024 15:03:30 GMT (envelope-from git) Date: Fri, 27 Sep 2024 15:03:30 GMT Message-Id: <202409271503.48RF3UjC009243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c85d3064c454 - main - sysctl: add KERN_PROC_RLIMIT_USAGE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c85d3064c454bde9f1c0cfbb6f42c0ac9fa229e9 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c85d3064c454bde9f1c0cfbb6f42c0ac9fa229e9 commit c85d3064c454bde9f1c0cfbb6f42c0ac9fa229e9 Author: Konstantin Belousov AuthorDate: 2024-09-22 17:01:56 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 15:02:23 +0000 sysctl: add KERN_PROC_RLIMIT_USAGE Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46747 --- sys/kern/kern_resource.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/sysctl.h | 1 + 2 files changed, 51 insertions(+) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index db5cce833012..c8b01afeab4f 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1741,3 +1741,53 @@ chgpipecnt(struct uidinfo *uip, int diff, rlim_t max) return (chglimit(uip, &uip->ui_pipecnt, diff, max, "pipecnt")); } + +static int +sysctl_kern_proc_rlimit_usage(SYSCTL_HANDLER_ARGS) +{ + rlim_t resval[RLIM_NLIMITS]; + struct proc *p; + size_t len; + int error, *name, i; + + name = (int *)arg1; + if ((u_int)arg2 != 1 && (u_int)arg2 != 2) + return (EINVAL); + if (req->newptr != NULL) + return (EINVAL); + + error = pget((pid_t)name[0], PGET_WANTREAD, &p); + if (error != 0) + return (error); + + if ((u_int)arg2 == 1) { + len = sizeof(resval); + memset(resval, 0, sizeof(resval)); + for (i = 0; i < RLIM_NLIMITS; i++) { + error = getrlimitusage_one(p, (unsigned)i, 0, + &resval[i]); + if (error == ENXIO) { + resval[i] = -1; + error = 0; + } else if (error != 0) { + break; + } + } + } else { + len = sizeof(resval[0]); + error = getrlimitusage_one(p, (unsigned)name[1], 0, + &resval[0]); + if (error == ENXIO) { + resval[0] = -1; + error = 0; + } + } + if (error == 0) + error = SYSCTL_OUT(req, resval, len); + PRELE(p); + return (error); +} +static SYSCTL_NODE(_kern_proc, KERN_PROC_RLIMIT_USAGE, rlimit_usage, + CTLFLAG_RD | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, + sysctl_kern_proc_rlimit_usage, + "Process limited resources usage info"); diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 66c6ff1640b7..f7abc27083aa 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1040,6 +1040,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define KERN_PROC_NFDS 43 /* number of open file descriptors */ #define KERN_PROC_SIGFASTBLK 44 /* address of fastsigblk magic word */ #define KERN_PROC_VM_LAYOUT 45 /* virtual address space layout info */ +#define KERN_PROC_RLIMIT_USAGE 46 /* array of rlim_t */ /* * KERN_IPC identifiers From nobody Fri Sep 27 15:03:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFYcz6yJJz5Y5rK; Fri, 27 Sep 2024 15:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFYcz5W4Pz5966; Fri, 27 Sep 2024 15:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vbe4QCsYOcq8xMgWtiqtL45ny3ofo5b9Ta1i3Fdn6kc=; b=UtoQ26rMrR32xs7NWhcT+jOrAE8wxuLz9lwk23BXldOX+rA2lNWcEVdBh1Afr5+jwD99tH pXE27r7jQ332nzy+fp/93C5eOshcQwGkZBULHMpdQgw+YFMeCo0jrUYP1ZoQYEC5f4pD/a X//j682r/bBawOT/u6XOaaMGQSQe9acZogowCLFc7X6XznwztMDxZXio40L7eMnUyZTTca CSA1HrNdNnS+3wYVWruAWmhdArfKaxuVLS1o0a0RmScr5oPnhRJOcSuPvowqUkGsxIMHVJ r1xr+BIYOe0AS+ZPA0Jq3yChYyZdEWL+9D7Tw28qsYLuTDpaCXEln2+Ujy2d6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vbe4QCsYOcq8xMgWtiqtL45ny3ofo5b9Ta1i3Fdn6kc=; b=e5BnWIFfo3xRnT4s1a2u1AevbC2ZJRe+kimPlf3H9SWnuUkTrkUmrkPv/zeXQKXNjy8tmv SyXeYBa8T/P4PR2EasnEbWP6AhskPN6HUxhvawqABwVkQoFtb1FZXYA5zU26P6zjzWrNu2 2PRhI9dfEG09NgWTlQwtYc1tOUah0uW52xNiVOr/VB9psORz3oeOwAnObjIwbnng/rD63g Xd7Z3re4SNPCZmPOtiXwV64IIuqsd9Py+wU3+JurMXmGZDirxYmei6PDBT0Mg006ti1IkP +Ev6VSnyDa7xFSMu6V5rdnFLOejNYEpiEsGMbqj8/wMN25x/DOLtO9q5kgxi3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727449411; a=rsa-sha256; cv=none; b=T1j1THHOk1zonI8ras1vSM+dOJqurlmXWNPKFWLvvGPozexc9rpYMjqN7NmtBD0Kc+b7pE zSS/y3fd7Emnk1Ez2/oaKs+Md2yZRVxf3n3sBNj1N9u586P4RNpEGWKifDZW4nJD2soygU Lc6kbmFzafgHXeIlKN7GgwdO5UMNjkScW55U1qqd7qM3xAMKlGoV2gSe8WY1NFSXH1bHDb M22LSuQ464SAcc80tZOdVBktdz0RWaopPffUvgtSwQ/Bt+Aesq2phRINe8nZZFaBGCWFwI 5e3f2hmTJsTtm6382J4MNFPIxk3vVcj0x1O1pLfxgqzhcXutuyQ/R+e+eih9xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFYcz579SzlWy; Fri, 27 Sep 2024 15:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RF3VTV009287; Fri, 27 Sep 2024 15:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RF3VIY009284; Fri, 27 Sep 2024 15:03:31 GMT (envelope-from git) Date: Fri, 27 Sep 2024 15:03:31 GMT Message-Id: <202409271503.48RF3VIY009284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6126f4ea646a - main - libprocstat: add procstat_getrlimitusage() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6126f4ea646a3c19647c3efdcf672641cff6954b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6126f4ea646a3c19647c3efdcf672641cff6954b commit 6126f4ea646a3c19647c3efdcf672641cff6954b Author: Konstantin Belousov AuthorDate: 2024-09-22 17:19:00 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 15:02:29 +0000 libprocstat: add procstat_getrlimitusage() Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46747 --- lib/libprocstat/Symbol.map | 5 ++++ lib/libprocstat/libprocstat.c | 53 +++++++++++++++++++++++++++++++++++++++++++ lib/libprocstat/libprocstat.h | 3 +++ 3 files changed, 61 insertions(+) diff --git a/lib/libprocstat/Symbol.map b/lib/libprocstat/Symbol.map index 4c8a0c7edefb..c2ea7e95312c 100644 --- a/lib/libprocstat/Symbol.map +++ b/lib/libprocstat/Symbol.map @@ -47,4 +47,9 @@ FBSD_1.6 { FBSD_1.7 { procstat_getadvlock; procstat_freeadvlock; +}; + +FBSD_1.8 { + procstat_getrlimitusage; + procstat_freerlimitusage; }; \ No newline at end of file diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index 0c7d28540e43..b808085f5eed 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2763,3 +2763,56 @@ procstat_freeadvlock(struct procstat *procstat __unused, free(lst); } +static rlim_t * +procstat_getrlimitusage_sysctl(pid_t pid, unsigned *cntp) +{ + int error, name[4]; + rlim_t *val; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT_USAGE; + name[3] = pid; + + len = 0; + error = sysctl(name, nitems(name), NULL, &len, NULL, 0); + if (error == -1) + return (NULL); + val = malloc(len); + if (val == NULL) + return (NULL); + + error = sysctl(name, nitems(name), val, &len, NULL, 0); + if (error == -1) { + free(val); + return (NULL); + } + *cntp = len / sizeof(rlim_t); + return (val); +} + +rlim_t * +procstat_getrlimitusage(struct procstat *procstat, struct kinfo_proc *kp, + unsigned int *cntp) +{ + switch (procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (NULL); + case PROCSTAT_SYSCTL: + return (procstat_getrlimitusage_sysctl(kp->ki_pid, cntp)); + case PROCSTAT_CORE: + warnx("core method is not supported"); + return (NULL); + default: + warnx("unknown access method: %d", procstat->type); + return (NULL); + } +} + +void +procstat_freerlimitusage(struct procstat *procstat __unused, rlim_t *resusage) +{ + free(resusage); +} diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h index 4aba1610a05f..81a3ac05393d 100644 --- a/lib/libprocstat/libprocstat.h +++ b/lib/libprocstat/libprocstat.h @@ -211,6 +211,7 @@ void procstat_freefiles(struct procstat *procstat, struct filestat_list *head); void procstat_freeptlwpinfo(struct procstat *procstat, struct ptrace_lwpinfo *pl); +void procstat_freerlimitusage(struct procstat *procstat, rlim_t *resusage); void procstat_freevmmap(struct procstat *procstat, struct kinfo_vmentry *vmmap); struct advlock_list *procstat_getadvlock(struct procstat *procstat); @@ -250,6 +251,8 @@ int procstat_getpathname(struct procstat *procstat, struct kinfo_proc *kp, char *pathname, size_t maxlen); int procstat_getrlimit(struct procstat *procstat, struct kinfo_proc *kp, int which, struct rlimit* rlimit); +rlim_t *procstat_getrlimitusage(struct procstat *procstat, + struct kinfo_proc *kp, unsigned int *cntp); int procstat_getumask(struct procstat *procstat, struct kinfo_proc *kp, unsigned short* umask); struct kinfo_vmentry *procstat_getvmmap(struct procstat *procstat, From nobody Fri Sep 27 15:03:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFYd11pWFz5Y5wn; Fri, 27 Sep 2024 15:03:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFYd06cTVz594F; Fri, 27 Sep 2024 15:03:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vDuX/ZLYcEOoxiVvJUL5SwxJRlFU/i2EYFodMtbspUI=; b=xoEWDhVReQ+SYnQTcFBjxxtb9aMjTOWdGuZKD/aSr71ak+r4OADKSiOGm2LOY2fU3pB6Zr M24tatOMHqnMztOgM6VIZ+BPW1oIx9lZ96PXvs/B1sdrW4OUwnxdeZaGlU5MVaQDPk9x2c kQYTdSmWcUcjXMWaAAKBeKu8JtgyJs2f1q6vQfggteeuf8fw7pZjuBoEih+I7+9dZgaTaV +nyVr5C6HYE+/lj6QM6lkTGOYXXyKEazZ02j7yRWsoSK/vvPg7A50fdF0OMe1pC8CHs0Yw f3DMD8ynmruV3lE6qCmWatOOF4Dv6L6SR9Vn0yqKFjo7FVAClNgT1ckC5S8WIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727449412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vDuX/ZLYcEOoxiVvJUL5SwxJRlFU/i2EYFodMtbspUI=; b=XrUGxixBJtLaxBIg433i6TzN0M5xlvEjB9TzZQX1SKeZ9muWkC0C84EPEGHo9LlGIT2hYH ivLbGW//U3mw5dQVApa5hSpdwgmQOcJrvAknxpOUHEbqJJ5wt11aPDMOWvvI/Z1Hs15ejn aQtcU3b1V+eMqSB1C2r/ASBzax+VfnzpuKkpDpTKaYF8pd29nVtJV4uHMf8DW/L8+4REkr 2iZGltHe4fSTQPZ9K6as0J9d2SGroGAQZ8gbLLunNfi8do3lN3dUien1kqzc+1sK/g58XX QkYFceo7c49pSa+96YmNCKEpklnzOU2RIiFnww+Qbe7Dcm32znV3XOFXHo79LA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727449412; a=rsa-sha256; cv=none; b=m/d2WaSr4q03AfISrtO6fNpkvsVJpT00Zu9Pu3tkIKn0k9fxGNHJzG7aaVqsAei15umFpG GV9DsntZ0c1bgtFDe9hrRZ5o3AB2K9ZdzyUoLYwci+adyrcYl0MCJe/fzhxFRWa7N5W6Qe 2TnNhFPy2MIFfj15KI2dYNvTB3ty011OUv9JuV0yYT9Z0WvjUDm8nmKRBhimKAi/aR9HQB 6FR4IL9ggzyIL5yY0K+ZbE9tLdkVE2tpIKugktMtg5pa135kftgTZVCrt+KChvsNFeg0NJ Rnt49vzMpnJYMcUPSIyprC3uGzzqMGTCxnjiCShhbccNqOMGCPslmiDG0t8xSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFYd05kwtzl69; Fri, 27 Sep 2024 15:03:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RF3W1o009332; Fri, 27 Sep 2024 15:03:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RF3Wk3009329; Fri, 27 Sep 2024 15:03:32 GMT (envelope-from git) Date: Fri, 27 Sep 2024 15:03:32 GMT Message-Id: <202409271503.48RF3Wk3009329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5ac9320ddf50 - main - procstat(1): add rlimitusage subcommand List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ac9320ddf50702e4fe05c10adc46dcdbd8ed5ee Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5ac9320ddf50702e4fe05c10adc46dcdbd8ed5ee commit 5ac9320ddf50702e4fe05c10adc46dcdbd8ed5ee Author: Konstantin Belousov AuthorDate: 2024-09-22 17:55:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 15:02:34 +0000 procstat(1): add rlimitusage subcommand Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46747 --- usr.bin/procstat/Makefile | 1 + usr.bin/procstat/procstat.c | 2 + usr.bin/procstat/procstat.h | 2 + usr.bin/procstat/procstat_rlimitusage.c | 76 +++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) diff --git a/usr.bin/procstat/Makefile b/usr.bin/procstat/Makefile index 56847625521f..d0e5d89478e7 100644 --- a/usr.bin/procstat/Makefile +++ b/usr.bin/procstat/Makefile @@ -16,6 +16,7 @@ SRCS= procstat.c \ procstat_ptlwpinfo.c \ procstat_pwdx.c \ procstat_rlimit.c \ + procstat_rlimitusage.c \ procstat_rusage.c \ procstat_sigs.c \ procstat_threads.c \ diff --git a/usr.bin/procstat/procstat.c b/usr.bin/procstat/procstat.c index f5c9bb6e1967..49595537f273 100644 --- a/usr.bin/procstat/procstat.c +++ b/usr.bin/procstat/procstat.c @@ -115,6 +115,8 @@ static const struct procstat_cmd cmd_table[] = { PS_CMP_NORMAL }, { "rlimit", "rlimit", NULL, &procstat_rlimit, &cmdopt_none, PS_CMP_NORMAL }, + { "rlimitusage", "rlimitusage", NULL, &procstat_rlimitusage, + &cmdopt_none, PS_CMP_NORMAL }, { "rusage", "rusage", "[-Ht]", &procstat_rusage, &cmdopt_rusage, PS_CMP_NORMAL }, { "sigfastblock", "sigfastblock", NULL, &procstat_sigfastblock, diff --git a/usr.bin/procstat/procstat.h b/usr.bin/procstat/procstat.h index 0c138fa88d42..f106fac79127 100644 --- a/usr.bin/procstat/procstat.h +++ b/usr.bin/procstat/procstat.h @@ -65,6 +65,8 @@ void procstat_cs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_rlimitusage(struct procstat *procstat, + struct kinfo_proc *kipp); void procstat_pargs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_penv(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_ptlwpinfo(struct procstat *prstat, struct kinfo_proc *kipp); diff --git a/usr.bin/procstat/procstat_rlimitusage.c b/usr.bin/procstat/procstat_rlimitusage.c new file mode 100644 index 000000000000..f589edd23b02 --- /dev/null +++ b/usr.bin/procstat/procstat_rlimitusage.c @@ -0,0 +1,76 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#define _RLIMIT_IDENT +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "procstat.h" + +static const char ru[] = "resource_usage"; + +void +procstat_rlimitusage(struct procstat *procstat, struct kinfo_proc *kipp) +{ + rlim_t *resuse; + unsigned int cnt, i; + + if ((procstat_opts & PS_OPT_NOHEADER) == 0) + xo_emit("{T:/%7s %12s %4s %18s}\n", + "PID", "RESOURCE", "ID", "USAGE"); + + xo_emit("{ek:process_id/%d}", kipp->ki_pid); + + resuse = procstat_getrlimitusage(procstat, kipp, &cnt); + if (resuse == NULL) + return; + xo_open_list(ru); + for (i = 0; i < cnt; i++) { + xo_open_instance(ru); + xo_emit("{dk:process_id/%7d} ", kipp->ki_pid); + xo_emit("{:resource/%12s} ", i < nitems(rlimit_ident) ? + rlimit_ident[i] : "unknown"); + xo_emit("{:resid/%4d} ", i); + xo_emit("{:usage/%18jd}\n", (intmax_t)resuse[i]); + xo_close_instance(ru); + } + xo_close_list(ru); + procstat_freerlimitusage(procstat, resuse); +} From nobody Fri Sep 27 16:30:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFbYD2XG2z5YBDL; Fri, 27 Sep 2024 16:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFbYD1Krgz45Zh; Fri, 27 Sep 2024 16:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727454624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MTuZIqxtolMmlZgHn3f/1RKZanUMGQRZf+8ZBRj59nk=; b=r+aqkN1VozX6mGljdkBOuavS5ShScLzWzm4dSy+lV2DAmUTZpEEAnjbjA1vLS40PneKBtW 7+4KhVmJtV3ehJC5wO0y6ZZq4lP5H+Lkxwu+gSWNdY8YieYpxwQQxtCQAjxIXSyYOBokTS X3JIu14l4H31SOcqHqcPPAF4EwxCWTBFVAaPiVovIiCCJpOLNAFMZCBosQ2QiULoLTnFEJ iad+fzEJz45sU8BCKAIxndAoglgd7AvfY9fK7n/LhVBYd1ZTm5HlF9UzDzhSuGXdMEKYkg H9rEYhe5RxoicIXvAxHk6ZrkloZTfKfZIA30quF5DFkdJaGoSxJz37NBNUMuLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727454624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MTuZIqxtolMmlZgHn3f/1RKZanUMGQRZf+8ZBRj59nk=; b=CvJ+KhN6AX0JjRbQUygUMpD42on/4mYsM1fduVAjQjNYWLXbsybetvYZEBdqUjtiyz0bxI pG1+gyz6JD/8x6F6ENguumAvl0XmePReDbttKOHYVwPUHEAyyzhf6MH6s8yjn34Icj8/V4 oV3aNYYU2valMjxjwypdrLpX3MRco8bH+B4MckGXFsuZhRTeVW/4l1OfpAD6I9eAVwCVjA vlI15o48ATsfJs1uV7u5/qW+0nIYY50AYG94s92bTLkv/aze43kv+JE7JZkMDGAG53BjAk fXwrwK0syJNe3a8ifa0ZLYiZ13DfQvZbuiFCZwUCgQbkicwLh/4oO4EX1gm2HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727454624; a=rsa-sha256; cv=none; b=uHfofBaa+mopNXN1KvKNGzie+rztfhLzkXZI6bxlUGLJjPC0Bhn8y9ZsVDSCNReuaNDLA2 a4e7NljR04ekWhdHmtIJR3kmIqRcH1lMrhDOacHiEQ0EixA7C15Ap89detnDnDvqx5DKEW 1nu6AtS611rzNlUsyJkF+nK8KsjT60JkUcVONYXE8fsX9xEnQHhvOjY1fajTpjPl08QhuM EFJl5MeI65K0V1hS43ApZAGljEHQBMiSKvZzbZ8HxFE8WZnUhTzwQVleBv+SFi7h4xZRSQ MDSuZecdcudMDoQlwT36Svkr7L6+XWJw2ZlJsqjkjmonRrLWMkGbDN1esTGENQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFbYD0xHqznTm; Fri, 27 Sep 2024 16:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RGUOva053423; Fri, 27 Sep 2024 16:30:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RGUOCt053420; Fri, 27 Sep 2024 16:30:24 GMT (envelope-from git) Date: Fri, 27 Sep 2024 16:30:24 GMT Message-Id: <202409271630.48RGUOCt053420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: fc2efd283b4e - main - RELNOTES: RSA host keys for SSH are deprecated List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc2efd283b4e33bd6057aa0323a13ae1af4669fa Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=fc2efd283b4e33bd6057aa0323a13ae1af4669fa commit fc2efd283b4e33bd6057aa0323a13ae1af4669fa Author: Colin Percival AuthorDate: 2024-09-27 16:28:44 +0000 Commit: Colin Percival CommitDate: 2024-09-27 16:28:44 +0000 RELNOTES: RSA host keys for SSH are deprecated Ficticious hash since there's no actual code change; but the release notes for FreeBSD 15 should say that RSA host keys for SSH will no longer be generated by default in FreeBSD 16. Discussed on: freebsd-arch Sponsored by: Amazon --- RELNOTES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELNOTES b/RELNOTES index 0daff902d4fd..a1863a2521fd 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,10 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +000000000000: + RSA host keys for SSH are deprecated and will no longer be generated + by default in FreeBSD 16. + 0aabcd75dbc2: EC2 AMIs no longer generate RSA host keys by default for SSH. RSA host key generation can be re-enabled by setting sshd_rsa_enable="YES" From nobody Fri Sep 27 17:34:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFczS2tfWz5YFPh; Fri, 27 Sep 2024 17:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFczS28qsz4ChG; Fri, 27 Sep 2024 17:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k30lu+2Y0xm96nniGREgH2u16LhzPRNegpuh89Oo5FU=; b=w6g3rQgOQ7JWjHf8ORmu73JPAt51EgePOfNYzovoRGdoLlODdnYsUDi5njyCLMT2yQSE+f QQZ0YOVqwfDp9jj0iMhqX13CzVdquaMtywN0Y7DSBsLXBQtJsGwXwRFuSfwZTII6efAZ4R v2W8zMws3kEMjo1dobPZVQUDE/KJ2j1VDgs0u/KLDGFC0rtslO33+rPCaSSwb0rNRK5frW GzBzOBAgkA0DZTuYGtlBDWnFQvJjaci8M3Y2WKmb6TEvxgYCJVIeezjpMrQRwcVxh2rFpj VoLspUWEQT1h9M04JnRMnr+HbwS30h59uHE9SlzpsJ9yil4W1UWpk/NUt4DU3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k30lu+2Y0xm96nniGREgH2u16LhzPRNegpuh89Oo5FU=; b=EOAWxvEwl0NLVm744H+rqjDQU4iwALjxI2PcYYbLqJyzUvOY2zN9wcp07GVs4It7fXkYEY QcJKCahCTNr0IXu/v0tAw0ryOa/C82GH7Yc3vFZsrBZjJHLQgHJN3QXlz0pvjAl2oWJuPh k6uzadlwuKxyxLdG+egMRRPuu7hz+MbNkFiEmjw5Dhp6v52Rux5F2vSy1FhCozfmh5JFgi 6luld+dfgyzeudH3v6Zu60GAGkti3xzPQ4+0RHySsJONns9kn+hUyg25fo6YGYciSxWgDh BWIUECHLwuyuyNwAm2COvMNX906tzM9jorT80ucw5EdZLoGuS/W3HKefMw9yXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727458484; a=rsa-sha256; cv=none; b=HKT8Mc3B4WuEwcAUzzVap4rTAW+kas70ccE4zL4uIhcxEfmY91NaJRQIsCDCyUewL6JmYy qCHI/SQJAWxqLG6c51wyiGyw6RDrSpv9xIjMPEPNQEFqyhQPDtzAkeHC+woJlW9rTtjE1m a0JNg0UC7acEgAxP/+nqdqoFpXTZOeZQHTIgrs5BG2rH5fjFkS3P+Q44Ri5g0ftrF6QYas cLgvdQXjRZhUib/g7flxZvL2wy0x4pR6AdUl34BsOuXrc31mLoywDvt3Q6ZnIDnVpikAeP CSokQazs3B2yAO069uiQbDHkgwKa47uS5HHowM1npXI/7jRW+VqBlFpKU+ECqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFczS1d0MzpRw; Fri, 27 Sep 2024 17:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RHYiXY062615; Fri, 27 Sep 2024 17:34:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RHYimE062612; Fri, 27 Sep 2024 17:34:44 GMT (envelope-from git) Date: Fri, 27 Sep 2024 17:34:44 GMT Message-Id: <202409271734.48RHYimE062612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 10ebd230f4d9 - main - intel_idpgtbl.c: rename domain_* functions to dmar_* List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10ebd230f4d9ed5c6406037972776666a2241107 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=10ebd230f4d9ed5c6406037972776666a2241107 commit 10ebd230f4d9ed5c6406037972776666a2241107 Author: Konstantin Belousov AuthorDate: 2024-09-25 01:38:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 17:34:23 +0000 intel_idpgtbl.c: rename domain_* functions to dmar_* Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_ctx.c | 6 ++-- sys/x86/iommu/intel_dmar.h | 6 ++-- sys/x86/iommu/intel_idpgtbl.c | 66 +++++++++++++++++++++---------------------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 5047acd283e9..659d5c8a35e6 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -399,7 +399,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapped) if (id_mapped) { if ((dmar->hw_ecap & DMAR_ECAP_PT) == 0) { - domain->pgtbl_obj = domain_get_idmap_pgtbl(domain, + domain->pgtbl_obj = dmar_get_idmap_pgtbl(domain, domain->iodom.end); } domain->iodom.flags |= IOMMU_DOMAIN_IDMAP; @@ -864,7 +864,7 @@ dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, iommu_domain_free_entry(entry, false); } } else { - domain_flush_iotlb_sync(domain, entry->start, entry->end - + dmar_flush_iotlb_sync(domain, entry->start, entry->end - entry->start); iommu_domain_free_entry(entry, free); } @@ -899,7 +899,7 @@ dmar_domain_unload(struct iommu_domain *iodom, entry->start, cansleep ? IOMMU_PGF_WAITOK : 0); KASSERT(error == 0, ("unmap %p error %d", domain, error)); if (!unit->qi_enabled) { - domain_flush_iotlb_sync(domain, entry->start, + dmar_flush_iotlb_sync(domain, entry->start, entry->end - entry->start); TAILQ_REMOVE(entries, entry, dmamap_link); iommu_domain_free_entry(entry, true); diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 188e40dec36c..fcdc915abcfd 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -219,10 +219,10 @@ void dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit *unit); void dmar_qi_invalidate_iec_glob(struct dmar_unit *unit); void dmar_qi_invalidate_iec(struct dmar_unit *unit, u_int start, u_int cnt); -vm_object_t domain_get_idmap_pgtbl(struct dmar_domain *domain, +vm_object_t dmar_get_idmap_pgtbl(struct dmar_domain *domain, iommu_gaddr_t maxaddr); -void put_idmap_pgtbl(vm_object_t obj); -void domain_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, +void dmar_put_idmap_pgtbl(vm_object_t obj); +void dmar_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size); int dmar_domain_alloc_pgtbl(struct dmar_domain *domain); void dmar_domain_free_pgtbl(struct dmar_domain *domain); diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index fbc0e9e97b64..7def178146d1 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -67,7 +67,7 @@ #include #include -static int domain_unmap_buf_locked(struct dmar_domain *domain, +static int dmar_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size, int flags); /* @@ -106,7 +106,7 @@ static MALLOC_DEFINE(M_DMAR_IDPGTBL, "dmar_idpgtbl", * mapped by the page table page. */ static void -domain_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx, +dmar_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx, iommu_gaddr_t addr) { vm_page_t m1; @@ -125,7 +125,7 @@ domain_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx, pg_sz = pglvl_page_size(tbl->pglvl, lvl); if (lvl != tbl->leaf) { for (i = 0, f = addr; i < IOMMU_NPTEPG; i++, f += pg_sz) - domain_idmap_nextlvl(tbl, lvl + 1, base + i, f); + dmar_idmap_nextlvl(tbl, lvl + 1, base + i, f); } VM_OBJECT_WUNLOCK(tbl->pgtbl_obj); pte = iommu_map_pgtbl(tbl->pgtbl_obj, idx, IOMMU_PGF_WAITOK, &sf); @@ -147,7 +147,7 @@ domain_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx, VM_PAGE_TO_PHYS(m1)) | DMAR_PTE_R | DMAR_PTE_W; } } - /* domain_get_idmap_pgtbl flushes CPU cache if needed. */ + /* dmar_get_idmap_pgtbl flushes CPU cache if needed. */ iommu_unmap_pgtbl(sf); VM_OBJECT_WLOCK(tbl->pgtbl_obj); } @@ -161,7 +161,7 @@ domain_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx, * maxaddr is typically mapped. */ vm_object_t -domain_get_idmap_pgtbl(struct dmar_domain *domain, iommu_gaddr_t maxaddr) +dmar_get_idmap_pgtbl(struct dmar_domain *domain, iommu_gaddr_t maxaddr) { struct dmar_unit *unit; struct idpgtbl *tbl; @@ -231,7 +231,7 @@ domain_get_idmap_pgtbl(struct dmar_domain *domain, iommu_gaddr_t maxaddr) tbl->pgtbl_obj = vm_pager_allocate(OBJT_PHYS, NULL, IDX_TO_OFF(pglvl_max_pages(tbl->pglvl)), 0, 0, NULL); VM_OBJECT_WLOCK(tbl->pgtbl_obj); - domain_idmap_nextlvl(tbl, 0, 0, 0); + dmar_idmap_nextlvl(tbl, 0, 0, 0); VM_OBJECT_WUNLOCK(tbl->pgtbl_obj); LIST_INSERT_HEAD(&idpgtbls, tbl, link); res = tbl->pgtbl_obj; @@ -273,7 +273,7 @@ end: * Return a reference to the identity mapping page table to the cache. */ void -put_idmap_pgtbl(vm_object_t obj) +dmar_put_idmap_pgtbl(vm_object_t obj) { struct idpgtbl *tbl, *tbl1; vm_object_t rmobj; @@ -317,7 +317,7 @@ put_idmap_pgtbl(vm_object_t obj) */ static iommu_pte_t * -domain_pgtbl_map_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, +dmar_pgtbl_map_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, int flags, vm_pindex_t *idxp, struct sf_buf **sf) { vm_page_t m; @@ -360,7 +360,7 @@ retry: vm_page_wire(m); sfp = NULL; - ptep = domain_pgtbl_map_pte(domain, base, lvl - 1, + ptep = dmar_pgtbl_map_pte(domain, base, lvl - 1, flags, &idx1, &sfp); if (ptep == NULL) { KASSERT(m->pindex != 0, @@ -385,7 +385,7 @@ retry: } static int -domain_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, +dmar_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags) { iommu_pte_t *pte; @@ -439,13 +439,13 @@ domain_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, ("mapping loop overflow %p %jx %jx %jx", domain, (uintmax_t)base, (uintmax_t)size, (uintmax_t)pg_sz)); KASSERT(pg_sz > 0, ("pg_sz 0 lvl %d", lvl)); - pte = domain_pgtbl_map_pte(domain, base, lvl, flags, &idx, &sf); + pte = dmar_pgtbl_map_pte(domain, base, lvl, flags, &idx, &sf); if (pte == NULL) { KASSERT((flags & IOMMU_PGF_WAITOK) == 0, ("failed waitable pte alloc %p", domain)); if (sf != NULL) iommu_unmap_pgtbl(sf); - domain_unmap_buf_locked(domain, base1, base - base1, + dmar_unmap_buf_locked(domain, base1, base - base1, flags); TD_PINNED_ASSERT; return (ENOMEM); @@ -462,7 +462,7 @@ domain_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, } static int -domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, +dmar_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, iommu_gaddr_t size, vm_page_t *ma, uint64_t eflags, int flags) { struct dmar_domain *domain; @@ -513,13 +513,13 @@ domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, KASSERT((flags & ~IOMMU_PGF_WAITOK) == 0, ("invalid flags %x", flags)); DMAR_DOMAIN_PGLOCK(domain); - error = domain_map_buf_locked(domain, base, size, ma, pflags, flags); + error = dmar_map_buf_locked(domain, base, size, ma, pflags, flags); DMAR_DOMAIN_PGUNLOCK(domain); if (error != 0) return (error); if ((unit->hw_cap & DMAR_CAP_CM) != 0) - domain_flush_iotlb_sync(domain, base, size); + dmar_flush_iotlb_sync(domain, base, size); else if ((unit->hw_cap & DMAR_CAP_RWBF) != 0) { /* See 11.1 Write Buffer Flushing. */ DMAR_LOCK(unit); @@ -529,12 +529,12 @@ domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, return (0); } -static void domain_unmap_clear_pte(struct dmar_domain *domain, +static void dmar_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, int flags, iommu_pte_t *pte, struct sf_buf **sf, bool free_fs); static void -domain_free_pgtbl_pde(struct dmar_domain *domain, iommu_gaddr_t base, +dmar_free_pgtbl_pde(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, int flags) { struct sf_buf *sf; @@ -542,12 +542,12 @@ domain_free_pgtbl_pde(struct dmar_domain *domain, iommu_gaddr_t base, vm_pindex_t idx; sf = NULL; - pde = domain_pgtbl_map_pte(domain, base, lvl, flags, &idx, &sf); - domain_unmap_clear_pte(domain, base, lvl, flags, pde, &sf, true); + pde = dmar_pgtbl_map_pte(domain, base, lvl, flags, &idx, &sf); + dmar_unmap_clear_pte(domain, base, lvl, flags, pde, &sf, true); } static void -domain_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, +dmar_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, int flags, iommu_pte_t *pte, struct sf_buf **sf, bool free_sf) { vm_page_t m; @@ -568,14 +568,14 @@ domain_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, ("lost reference (idx) on root pg domain %p base %jx lvl %d", domain, (uintmax_t)base, lvl)); iommu_pgfree(domain->pgtbl_obj, m->pindex, flags); - domain_free_pgtbl_pde(domain, base, lvl - 1, flags); + dmar_free_pgtbl_pde(domain, base, lvl - 1, flags); } /* * Assumes that the unmap is never partial. */ static int -domain_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, +dmar_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size, int flags) { iommu_pte_t *pte; @@ -619,14 +619,14 @@ domain_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, pg_sz = domain_page_size(domain, lvl); if (pg_sz > size) continue; - pte = domain_pgtbl_map_pte(domain, base, lvl, flags, + pte = dmar_pgtbl_map_pte(domain, base, lvl, flags, &idx, &sf); KASSERT(pte != NULL, ("sleeping or page missed %p %jx %d 0x%x", domain, (uintmax_t)base, lvl, flags)); if ((pte->pte & DMAR_PTE_SP) != 0 || lvl == domain->pglvl - 1) { - domain_unmap_clear_pte(domain, base, lvl, + dmar_unmap_clear_pte(domain, base, lvl, flags, pte, &sf, false); break; } @@ -647,7 +647,7 @@ domain_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, } static int -domain_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, +dmar_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, iommu_gaddr_t size, int flags) { struct dmar_domain *domain; @@ -656,7 +656,7 @@ domain_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, domain = IODOM2DOM(iodom); DMAR_DOMAIN_PGLOCK(domain); - error = domain_unmap_buf_locked(domain, base, size, flags); + error = dmar_unmap_buf_locked(domain, base, size, flags); DMAR_DOMAIN_PGUNLOCK(domain); return (error); } @@ -700,7 +700,7 @@ dmar_domain_free_pgtbl(struct dmar_domain *domain) domain->pgtbl_obj = NULL; if ((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) != 0) { - put_idmap_pgtbl(obj); + dmar_put_idmap_pgtbl(obj); domain->iodom.flags &= ~IOMMU_DOMAIN_IDMAP; return; } @@ -716,7 +716,7 @@ dmar_domain_free_pgtbl(struct dmar_domain *domain) } static inline uint64_t -domain_wait_iotlb_flush(struct dmar_unit *unit, uint64_t wt, int iro) +dmar_wait_iotlb_flush(struct dmar_unit *unit, uint64_t wt, int iro) { uint64_t iotlbr; @@ -732,7 +732,7 @@ domain_wait_iotlb_flush(struct dmar_unit *unit, uint64_t wt, int iro) } void -domain_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, +dmar_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size) { struct dmar_unit *unit; @@ -746,7 +746,7 @@ domain_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, iro = DMAR_ECAP_IRO(unit->hw_ecap) * 16; DMAR_LOCK(unit); if ((unit->hw_cap & DMAR_CAP_PSI) == 0 || size > 2 * 1024 * 1024) { - iotlbr = domain_wait_iotlb_flush(unit, DMAR_IOTLB_IIRG_DOM | + iotlbr = dmar_wait_iotlb_flush(unit, DMAR_IOTLB_IIRG_DOM | DMAR_IOTLB_DID(domain->domain), iro); KASSERT((iotlbr & DMAR_IOTLB_IAIG_MASK) != DMAR_IOTLB_IAIG_INVLD, @@ -756,7 +756,7 @@ domain_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, for (; size > 0; base += isize, size -= isize) { am = calc_am(unit, base, size, &isize); dmar_write8(unit, iro, base | am); - iotlbr = domain_wait_iotlb_flush(unit, + iotlbr = dmar_wait_iotlb_flush(unit, DMAR_IOTLB_IIRG_PAGE | DMAR_IOTLB_DID(domain->domain), iro); KASSERT((iotlbr & DMAR_IOTLB_IAIG_MASK) != @@ -778,6 +778,6 @@ domain_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, } const struct iommu_domain_map_ops dmar_domain_map_ops = { - .map = domain_map_buf, - .unmap = domain_unmap_buf, + .map = dmar_map_buf, + .unmap = dmar_unmap_buf, }; From nobody Fri Sep 27 17:34:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFczT3ZM9z5YFcv; Fri, 27 Sep 2024 17:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFczT2n7wz4Cdx; Fri, 27 Sep 2024 17:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9DZr/eN/bvDK5hIshzm8NBsl2UBf7lMKtVr4tnimpqM=; b=NCXdxeyrF2VOyrcefMmd2Hbtv3nq9qHjAP+Nh7qdH9XqrUG0nMSnT95+c7iWpNAArMTwXJ 8KxMVJg28oCapDhFqXGF1WGBVOqJg8mwQFj0J3byX6YuiwJHOg/ptvUagQ7BBzWU5ulR3R CtNM3CSZ8guoBX9Uzm7iwGneotmMkowKWO3iV3mo5j3+yWx9eS+YpUUYjdLh7xrP6E9z2o BPd7e9L1qG1p3h6MYyEBtk8xQV4kK6JW9RZsX4y9pDuwhApokZlqXikUu1gwmHvLp4QOnC rcWVNMkUeDyDHKbeOTcEqGW+bQeX7WCL0gfXi6fmfMEcqIzNKw3sshdskhvcXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9DZr/eN/bvDK5hIshzm8NBsl2UBf7lMKtVr4tnimpqM=; b=uHAQOCJavusp1U/IawjaqXwjFp8Lf54TY1eu3CWSKhxY/im8AMFde8Zgc+/Q4kERcIS6B7 xBn5TWYtBKhF9VyhaIpBA3yvs5WZkFRymR7M0gq4wPW0iewggocPqgJG5fCRi9plYiddAN ZO+YuIITzyJv6ymMu0IhRKVbAAkTq5loH51j0O5zcsXxUOUCxsQ9lk6+tF+sTOIj6XvVej JjiZLkestOocWRSOxfltzungsM/w2TE5txn3Mmib0efZgT+DOGtXLk6d0XNfC88RsUEEQL dVV0d0mUaAzw8k0u+1e/Qgdj8wU9KbF3Q67edIuh+THijyvXd18Tcz4k1QV0rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727458485; a=rsa-sha256; cv=none; b=TsQ+yKQ6qLzVQIhC5iMgg0jd5DlINKIR0Vc5FZIO1sC4CRocD2+JgMppj6HG3DatbbaUKV 9RLERp1Lcxc3XYxMl14a3NnjOu+jr+t50Fp4e1XMkhhyQbtAQ5dJ21cMaHkOzNCKAILt6S s3ELnJzNpujnPV5NxChGs4XcysW+FxRPYKR1LjFgHPpzwx5uYRtTiS8FOhYaNjdcXPV/Jd DZhyZbA++nvNmS2AkKqwXiXcMN4IKvD0g7N6gZ7L4I4QIVs38qAMV56U9V7iz/YFMUiUjr 1TOKw1iUsHffNR9pOcNi7ta+yDVTywh27paMbtxwh1+RpcobmBtMJX0YL4D+kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFczT2PK5zqb4; Fri, 27 Sep 2024 17:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RHYjNt062678; Fri, 27 Sep 2024 17:34:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RHYjvi062675; Fri, 27 Sep 2024 17:34:45 GMT (envelope-from git) Date: Fri, 27 Sep 2024 17:34:45 GMT Message-Id: <202409271734.48RHYjvi062675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d50403a6919a - main - iommu: add per-unit sysctls reporting the state of DMA and interrupt remapping List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d50403a6919a641abfb0da4d60eb58ce42302de5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d50403a6919a641abfb0da4d60eb58ce42302de5 commit d50403a6919a641abfb0da4d60eb58ce42302de5 Author: Konstantin Belousov AuthorDate: 2024-09-27 01:17:57 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 17:34:23 +0000 iommu: add per-unit sysctls reporting the state of DMA and interrupt remapping Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/arm64/iommu/iommu.c | 2 ++ sys/dev/iommu/busdma_iommu.c | 4 ++++ sys/dev/iommu/iommu.h | 1 + sys/x86/iommu/intel_drv.c | 2 ++ sys/x86/iommu/intel_intrmap.c | 5 ++++- 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/arm64/iommu/iommu.c b/sys/arm64/iommu/iommu.c index af0edfee70d8..e7b5b2298e26 100644 --- a/sys/arm64/iommu/iommu.c +++ b/sys/arm64/iommu/iommu.c @@ -454,6 +454,7 @@ iommu_register(struct iommu_unit *iommu) LIST_INSERT_HEAD(&iommu_list, entry, next); IOMMU_LIST_UNLOCK(); + sysctl_ctx_init(&iommu->sysctl_ctx); iommu_init_busdma(iommu); return (0); @@ -474,6 +475,7 @@ iommu_unregister(struct iommu_unit *iommu) IOMMU_LIST_UNLOCK(); iommu_fini_busdma(iommu); + sysctl_ctx_free(&iommu->sysctl_ctx); mtx_destroy(&iommu->lock); diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index bddb466547d1..7a0ca39172f3 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -963,6 +963,10 @@ iommu_init_busdma(struct iommu_unit *unit) error = TUNABLE_INT_FETCH("hw.iommu.dma", &unit->dma_enabled); if (error == 0) /* compatibility */ TUNABLE_INT_FETCH("hw.dmar.dma", &unit->dma_enabled); + SYSCTL_ADD_INT(&unit->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(unit->dev)), + OID_AUTO, "dma", CTLFLAG_RD, &unit->dma_enabled, 0, + "DMA ops enabled"); TAILQ_INIT(&unit->delayed_maps); TASK_INIT(&unit->dmamap_load_task, 0, iommu_bus_task_dmamap, unit); unit->delayed_taskqueue = taskqueue_create("iommu", M_WAITOK, diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h index 9845b09e8732..957d4e14e8e2 100644 --- a/sys/dev/iommu/iommu.h +++ b/sys/dev/iommu/iommu.h @@ -67,6 +67,7 @@ struct iommu_unit { struct mtx lock; device_t dev; int unit; + struct sysctl_ctx_list sysctl_ctx; int dma_enabled; diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 05fb49538add..cc16759ebe34 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -256,6 +256,7 @@ dmar_release_resources(device_t dev, struct dmar_unit *unit) vm_object_deallocate(unit->ctx_obj); unit->ctx_obj = NULL; } + sysctl_ctx_free(&unit->iommu.sysctl_ctx); } #ifdef DEV_APIC @@ -337,6 +338,7 @@ dmar_attach(device_t dev) unit = device_get_softc(dev); unit->iommu.unit = device_get_unit(dev); unit->iommu.dev = dev; + sysctl_ctx_init(&unit->iommu.sysctl_ctx); dmaru = dmar_find_by_index(unit->iommu.unit); if (dmaru == NULL) return (EINVAL); diff --git a/sys/x86/iommu/intel_intrmap.c b/sys/x86/iommu/intel_intrmap.c index ec3cd35e4f4e..87bb7c791dd0 100644 --- a/sys/x86/iommu/intel_intrmap.c +++ b/sys/x86/iommu/intel_intrmap.c @@ -318,7 +318,10 @@ dmar_ir_free_irte(struct dmar_unit *unit, u_int cookie) int dmar_init_irt(struct dmar_unit *unit) { - + SYSCTL_ADD_INT(&unit->iommu.sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(unit->iommu.dev)), + OID_AUTO, "ir", CTLFLAG_RD, &unit->ir_enabled, 0, + "Interrupt remapping ops enabled"); if ((unit->hw_ecap & DMAR_ECAP_IR) == 0) return (0); unit->ir_enabled = 1; From nobody Fri Sep 27 17:34:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFczV67Fyz5YFPm; Fri, 27 Sep 2024 17:34:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFczV3qQfz4Ck3; Fri, 27 Sep 2024 17:34:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eg7O8rm7rp9wojm9QVeaLkJsiF73JGNnWnLtdlFEIOs=; b=QTwbUuerFzqisfdAV+k9zyzirN3/PHcvsiXn06N9Q0SjLOo6v3gSXBE0yk4d9c4iikngEb IPJwDUt9SHEPPbDFlTY/BQX+Gn4AUPJKnqYubDGXXTiH5IDC4kiOHnmkwSiWJAvMxry2QH Irt1yqfQo7vldwPDv2yGfhoG29hswpiiZFZ5CvomGS6nSbf/8BwhkebDe6HCWRsg7VoEGQ 5jkxqmk+bw8dTYCGY1Z7PzU81w9hMUgMQV/c/AuwXr2FWGkp8CrAyo/cww3Crhi1YG8N9I J40SX4fCb7qz+NqgZLs0EIemT6pzibcVPP+9u6CyG7eVd4qjctUW1XUDKCBVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eg7O8rm7rp9wojm9QVeaLkJsiF73JGNnWnLtdlFEIOs=; b=d6K8F3kv321RyzBjNdVWIpOiCjSszCruX2myhNPW2l/z6Gf7T6G9FTGq4xDfH2Oqo7nqJ9 R/BGSTWaEoKJsRck7ONsS9T6vIBR3kd6myBpcSYQttLPNsNC9hPfKkcH4t0o4lNqlfUZq5 qztCOQtpPDdK9b9nlc6Sxt928Lk8rNLkQG6Ft5fCXH1mS63OpdfspZkxv++0WiH5R/B31F Gji0w/Zoq/GGpqmic598QmgYByzG2b9TiwRqq5Jg30c+gzzhKP+gF3jWGSu3CQ8czF7gqX 3R+1eh+jYc6QPESoiLrwv7wCbfn9Hs5ZsBpq7c+3yuBc2I8zWSH5NpgcetDoAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727458486; a=rsa-sha256; cv=none; b=InUUzXyLNDAJaBDvO1xgZRf4fuRihx2IB+NZbwCLIiWgnkUt80mbNkcz1wSOt0EeqdGe9V YY0nHbereBEC89aKsi459Hr1/PKJTrIXQ9XfDn3zx2bKBkPBkeOwCQvbV5j76XuR3RCgN3 iUTyv+tU/fRgO7E3ztD3S58y8o56U32OtzEVtcOJt5huBrrMgAkeTLLE5obefCrZiLufVT KVB+EYAqxmKd8Kn9sF/sVUMmzkgrFXlzDvLbfPo+qOhnR6jpruEsQINLBjUWpFPtIWwO7C xyT3oqd44LAQ8x1gju1cvh4S2CiNpbT/ybwln7vvkK4l8Y+qwBN1Q7CJVSJECw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFczV3PsfzqDG; Fri, 27 Sep 2024 17:34:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RHYkeJ062723; Fri, 27 Sep 2024 17:34:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RHYk7h062720; Fri, 27 Sep 2024 17:34:46 GMT (envelope-from git) Date: Fri, 27 Sep 2024 17:34:46 GMT Message-Id: <202409271734.48RHYk7h062720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bdd5eb33cacd - main - iommu: change iommu_domain_map_ops to take iommu_map_entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bdd5eb33cacdbf174980b999c77847d0903fc12e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bdd5eb33cacdbf174980b999c77847d0903fc12e commit bdd5eb33cacdbf174980b999c77847d0903fc12e Author: Konstantin Belousov AuthorDate: 2024-09-25 01:47:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 17:34:23 +0000 iommu: change iommu_domain_map_ops to take iommu_map_entry instead of base/size. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/arm64/iommu/iommu.c | 25 +++++++++++-------------- sys/dev/iommu/iommu.h | 8 ++++---- sys/dev/iommu/iommu_gas.c | 12 +++++------- sys/x86/iommu/intel_ctx.c | 4 ++-- sys/x86/iommu/intel_idpgtbl.c | 15 ++++++++++----- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sys/arm64/iommu/iommu.c b/sys/arm64/iommu/iommu.c index e7b5b2298e26..0fe59c5d10b6 100644 --- a/sys/arm64/iommu/iommu.c +++ b/sys/arm64/iommu/iommu.c @@ -80,22 +80,21 @@ struct iommu_entry { static LIST_HEAD(, iommu_entry) iommu_list = LIST_HEAD_INITIALIZER(iommu_list); static int -iommu_domain_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, - iommu_gaddr_t size, int flags) +iommu_domain_unmap_buf(struct iommu_domain *iodom, + struct iommu_map_entry *entry, int flags) { struct iommu_unit *iommu; int error; iommu = iodom->iommu; - - error = IOMMU_UNMAP(iommu->dev, iodom, base, size); - + error = IOMMU_UNMAP(iommu->dev, iodom, entry->start, entry->end - + entry->start); return (error); } static int -iommu_domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, - iommu_gaddr_t size, vm_page_t *ma, uint64_t eflags, int flags) +iommu_domain_map_buf(struct iommu_domain *iodom, struct iommu_map_entry *entry, + vm_page_t *ma, uint64_t eflags, int flags) { struct iommu_unit *iommu; vm_prot_t prot; @@ -110,12 +109,10 @@ iommu_domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, if (eflags & IOMMU_MAP_ENTRY_WRITE) prot |= VM_PROT_WRITE; - va = base; - + va = entry->start; iommu = iodom->iommu; - - error = IOMMU_MAP(iommu->dev, iodom, va, ma, size, prot); - + error = IOMMU_MAP(iommu->dev, iodom, va, ma, entry->end - + entry->start, prot); return (error); } @@ -427,8 +424,8 @@ iommu_domain_unload(struct iommu_domain *iodom, TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { KASSERT((entry->flags & IOMMU_MAP_ENTRY_MAP) != 0, ("not mapped entry %p %p", iodom, entry)); - error = iodom->ops->unmap(iodom, entry->start, entry->end - - entry->start, cansleep ? IOMMU_PGF_WAITOK : 0); + error = iodom->ops->unmap(iodom, entry, + cansleep ? IOMMU_PGF_WAITOK : 0); KASSERT(error == 0, ("unmap %p error %d", iodom, error)); TAILQ_REMOVE(entries, entry, dmamap_link); iommu_domain_free_entry(entry, true); diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h index 957d4e14e8e2..84d8c3680b71 100644 --- a/sys/dev/iommu/iommu.h +++ b/sys/dev/iommu/iommu.h @@ -86,10 +86,10 @@ struct iommu_unit { }; struct iommu_domain_map_ops { - int (*map)(struct iommu_domain *domain, iommu_gaddr_t base, - iommu_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags); - int (*unmap)(struct iommu_domain *domain, iommu_gaddr_t base, - iommu_gaddr_t size, int flags); + int (*map)(struct iommu_domain *domain, struct iommu_map_entry *entry, + vm_page_t *ma, uint64_t pflags, int flags); + int (*unmap)(struct iommu_domain *domain, struct iommu_map_entry *entry, + int flags); }; /* diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index 4b6141b981da..26ac38da3c4f 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -826,8 +826,7 @@ iommu_gas_map(struct iommu_domain *domain, entry->flags |= eflags; IOMMU_DOMAIN_UNLOCK(domain); - error = domain->ops->map(domain, entry->start, - entry->end - entry->start, ma, eflags, + error = domain->ops->map(domain, entry, ma, eflags, ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); if (error == ENOMEM) { iommu_domain_unload_entry(entry, true, @@ -868,9 +867,9 @@ iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, if (entry->end == entry->start) return (0); - error = domain->ops->map(domain, entry->start, - entry->end - entry->start, ma + OFF_TO_IDX(start - entry->start), - eflags, ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); + error = domain->ops->map(domain, entry, + ma + OFF_TO_IDX(start - entry->start), eflags, + ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); if (error == ENOMEM) { iommu_domain_unload_entry(entry, false, (flags & IOMMU_MF_CANWAIT) != 0); @@ -979,8 +978,7 @@ iommu_unmap_msi(struct iommu_ctx *ctx) if (entry == NULL) return; - domain->ops->unmap(domain, entry->start, entry->end - - entry->start, IOMMU_PGF_WAITOK); + domain->ops->unmap(domain, entry, IOMMU_PGF_WAITOK); iommu_gas_free_space(entry); diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 659d5c8a35e6..5af5ac7335b8 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -895,8 +895,8 @@ dmar_domain_unload(struct iommu_domain *iodom, TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { KASSERT((entry->flags & IOMMU_MAP_ENTRY_MAP) != 0, ("not mapped entry %p %p", domain, entry)); - error = iodom->ops->unmap(iodom, entry->start, entry->end - - entry->start, cansleep ? IOMMU_PGF_WAITOK : 0); + error = iodom->ops->unmap(iodom, entry, + cansleep ? IOMMU_PGF_WAITOK : 0); KASSERT(error == 0, ("unmap %p error %d", domain, error)); if (!unit->qi_enabled) { dmar_flush_iotlb_sync(domain, entry->start, diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index 7def178146d1..ffb4c73a6c5a 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -462,14 +462,18 @@ dmar_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, } static int -dmar_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, - iommu_gaddr_t size, vm_page_t *ma, uint64_t eflags, int flags) +dmar_map_buf(struct iommu_domain *iodom, struct iommu_map_entry *entry, + vm_page_t *ma, uint64_t eflags, int flags) { struct dmar_domain *domain; struct dmar_unit *unit; + iommu_gaddr_t base, size; uint64_t pflags; int error; + base = entry->start; + size = entry->end - entry->start; + pflags = ((eflags & IOMMU_MAP_ENTRY_READ) != 0 ? DMAR_PTE_R : 0) | ((eflags & IOMMU_MAP_ENTRY_WRITE) != 0 ? DMAR_PTE_W : 0) | ((eflags & IOMMU_MAP_ENTRY_SNOOP) != 0 ? DMAR_PTE_SNP : 0) | @@ -647,8 +651,8 @@ dmar_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, } static int -dmar_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, - iommu_gaddr_t size, int flags) +dmar_unmap_buf(struct iommu_domain *iodom, struct iommu_map_entry *entry, + int flags) { struct dmar_domain *domain; int error; @@ -656,7 +660,8 @@ dmar_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, domain = IODOM2DOM(iodom); DMAR_DOMAIN_PGLOCK(domain); - error = dmar_unmap_buf_locked(domain, base, size, flags); + error = dmar_unmap_buf_locked(domain, entry->start, entry->end - + entry->start, flags); DMAR_DOMAIN_PGUNLOCK(domain); return (error); } From nobody Fri Sep 27 17:34:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFczW6PNCz5YFMY; Fri, 27 Sep 2024 17:34:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFczW4dfVz4CQ5; Fri, 27 Sep 2024 17:34:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WknBvgrPw7BjbR/AksYapUs5yZiEMbIR48XIHzF2VzA=; b=jGZAivPmo26HO+TnZitE5oTga4Alk6CvvpFr1atkZkf+Lt4BAEuorofEHM245X1jhW1knY 5bnFF48W9ECka+8LKb8ilRqCQ79dGK0L+LhcEk/9AxwGSxQjcM0StSQ6fw49BGE85ip+fK 1BqiYtwAnNWkALrN/Eqx4Fxz3OCriGHcEy6l8ycrcT0PrkheyUByaO01IUc/z3Lcy0QnNf CAght1KygRjN2J+8o13kOmgyV+q99Tl1VO/UzAMV6wVX1n814f4K+FdbG62u4V65AidLwD hEQDmNBTvb9cDjWw15moVkGDEgS3a2unF9HH/qDVIkhVDLnmu0azwku+LedsUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WknBvgrPw7BjbR/AksYapUs5yZiEMbIR48XIHzF2VzA=; b=ByUjbOBIfftcDs1b80Y+3hEAvNrLDa3285RyQaCHzgaRCmZVm/BbYIGesBsz1VKW9Igi7E 0/WFTap27owFNlmbF/kVcT7zryrgG5f3i37x192S/HdxVKkALTwifl1PMPcKP6Wo3BqTOM UARH6hHH8Vm080LJ6HUQ0T+8u4/7erbFzMi4x/oJfguMRcK/rp6kJBMuM6Tm2kyok+i6b7 oHHp3k00AJnvKPcl+l8EyVVVDlNGEQLWN7Pvq8uvjKd9JE9kvQgi7Rl0koSpErf1Bn7d/G b92SRO3m5wUGaxokdjTTL3G1TbKXsF59Fi5D1rtWA0WvBEfEQIrNuZ6/9C/+0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727458487; a=rsa-sha256; cv=none; b=w9cD2z4lsMd9HrcAEWh+TqGDL8MpgzjVJN8x28Cj6oQYpPgqCgdnpGrFvFJ2XA/eKb7Dtt tq84g0jVtpWUn8VL5m4IXjnfIzr0LdUfjCTwTePj0vlUfgLwNwyNaLGifg/imVvwwgJ0zP L51u5pdj/P0oQEDDVyyi+3iaQUQeddmsPar/cQuV7JezwhicfLJTyTonPPKR65ZCTj4FI+ ku/SImQw8ugd0qXTzhQyrTwTgHGzu5TqduJEj5mEqyHumi0k9AuBn8gR9SI3RYcW9Gw6HX Pw+v/thFXILzA7N5t7RKLq52VNYb287+cWf5nzE12vPGvUR8KchVR7rIf6whUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFczW4FyszqDH; Fri, 27 Sep 2024 17:34:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RHYlRj062776; Fri, 27 Sep 2024 17:34:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RHYlsR062772; Fri, 27 Sep 2024 17:34:47 GMT (envelope-from git) Date: Fri, 27 Sep 2024 17:34:47 GMT Message-Id: <202409271734.48RHYlsR062772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1784fb44498d - main - vm_page_free_pages_toq(): return the count of freed pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1784fb44498da8007fb8cd8ee5060894eb5fe1e6 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1784fb44498da8007fb8cd8ee5060894eb5fe1e6 commit 1784fb44498da8007fb8cd8ee5060894eb5fe1e6 Author: Konstantin Belousov AuthorDate: 2024-09-27 16:20:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 17:34:23 +0000 vm_page_free_pages_toq(): return the count of freed pages Reviewed by: bnovkov Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46820 --- sys/vm/vm_page.c | 5 +++-- sys/vm/vm_page.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 40108e8a9b0a..6256472e0336 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -4177,14 +4177,14 @@ vm_page_free_toq(vm_page_t m) * from any VM object. In other words, this is equivalent to * calling vm_page_free_toq() for each page of a list of VM objects. */ -void +int vm_page_free_pages_toq(struct spglist *free, bool update_wire_count) { vm_page_t m; int count; if (SLIST_EMPTY(free)) - return; + return (0); count = 0; while ((m = SLIST_FIRST(free)) != NULL) { @@ -4195,6 +4195,7 @@ vm_page_free_pages_toq(struct spglist *free, bool update_wire_count) if (update_wire_count) vm_wire_sub(count); + return (count); } /* diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index a69155e50723..c7c1ec3872a8 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -710,7 +710,7 @@ int vm_page_is_valid(vm_page_t, int, int); void vm_page_test_dirty(vm_page_t); vm_page_bits_t vm_page_bits(int base, int size); void vm_page_zero_invalid(vm_page_t m, boolean_t setvalid); -void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count); +int vm_page_free_pages_toq(struct spglist *free, bool update_wire_count); void vm_page_dirty_KBI(vm_page_t m); void vm_page_lock_KBI(vm_page_t m, const char *file, int line); From nobody Fri Sep 27 17:34:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFczX6dgjz5YFHZ; Fri, 27 Sep 2024 17:34:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFczX5Jf2z4Cq5; Fri, 27 Sep 2024 17:34:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CWwyXxH9I9UVndw8UebqVDmEvyKhyDs4JXGg1jaA8XA=; b=kPWO/LXsq1Wfx+J7CoXpCyzcvQvSmeN6FyNDVhMIqjwU0Ym53x0emiLjjDLHCnNGtVSGUI MClvgBwUSVq23xO1IX5BsCd1c3aiUfL1qbVcVDl7W5clCyzTqkt4iJJaCe65SQ/mDl09db eM23tm3Lfwz38JXAiy35y2JZJJpDVNB9zIYhY8TG46wEEWo3OWZrmC5mFVMyVwRMdlSxYL /UrDijEjSYAevnLcWFQQOy0GFmk2mTZztM830HZyySBy5daTGVE0MwSYgdGCYNR8qrYp2e FNnA5lK004JxPE+LLODKnmeK5giIzaR0wVzRUzq45s2xaFkgjls+8oc8Z37xug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CWwyXxH9I9UVndw8UebqVDmEvyKhyDs4JXGg1jaA8XA=; b=XUQ6KhLfw0cwDZxAaneFInxXl1Vp0XKBIZ3D9ZcHPfpBqFjPiE7cr9s/hSxseiPWc8kSps mihubu5mz2W9tLLy7iSeYG3F/WQWpuYWZgHWGBlBs+z2NDAcrd6RY0wRUBXPGzRQHKDLrH AnvadWmxAu9LYqEYUavdlEJqVEpP5L9KxHb6WaTVqbmTLLfPcAuHOaYQ4LPlJwdNIqhSfC V0BSDPCFmXbh+N2DZo7KKqpMP65gOxRz0nke5bS2kgnZQpvOadHsRuLuSySpLeK2C362DR f4DTUzuC0XlQQZBufiSe+1lBeiqXLcI/Tq7QULbqrPBUEyT7aKKkpOLcRoSBpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727458488; a=rsa-sha256; cv=none; b=lO7YJBm6weUrm1dj1aEUZcaux06hyu03ZP0bYrsWPYxxOU2Tu8CMQaacpE/z9Muqf8Y3qK nHbc7UwQbpbEUAiQdAgNeAL/pdCQ7DuYBSfOL8kwNoHxyS+PdZAwuHO2pXIBlwb1wdKpBK J4q314E2usQUOCFoeOgvCaWGC+7Fw8SD9Ih5ix+XWKsw/f9M9pPnSL7hHIj9IB7ZTUhfR8 8hBNv8hNVN/9ztN9GKdQwE8eLasAsoEBcSfM6XdUneHNEyEO24xXWa1b0XFZz2HNHCInEh vyBXAhICS5UQ5/Y3pX9+L8IwIivaaU8VS2PuA4HNKEbH/DKu2ZMIOV7jOaUrhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFczX4th4zqgh; Fri, 27 Sep 2024 17:34:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RHYmXr062844; Fri, 27 Sep 2024 17:34:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RHYmhl062841; Fri, 27 Sep 2024 17:34:48 GMT (envelope-from git) Date: Fri, 27 Sep 2024 17:34:48 GMT Message-Id: <202409271734.48RHYmhl062841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f713ed6694d9 - main - iommu: extend iommu_map_entry to store the list of associated freed page table pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f713ed6694d949ec37365533afbb47c04f919572 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f713ed6694d949ec37365533afbb47c04f919572 commit f713ed6694d949ec37365533afbb47c04f919572 Author: Konstantin Belousov AuthorDate: 2024-09-25 01:50:34 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 17:34:23 +0000 iommu: extend iommu_map_entry to store the list of associated freed page table pages The pages are inserted into the added slist if the entry parameter is passed to iommu_pgfree(). For now it is nop. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/iommu/iommu.h | 3 +++ sys/dev/iommu/iommu_gas.c | 14 +++++++++++--- sys/x86/iommu/intel_idpgtbl.c | 4 ++-- sys/x86/iommu/iommu_utils.c | 15 +++++++++++---- sys/x86/iommu/x86_iommu.h | 3 ++- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h index 84d8c3680b71..73d0a6f1279b 100644 --- a/sys/dev/iommu/iommu.h +++ b/sys/dev/iommu/iommu.h @@ -31,6 +31,8 @@ #ifndef _DEV_IOMMU_IOMMU_H_ #define _DEV_IOMMU_IOMMU_H_ +#include +#include #include struct bus_dma_tag_common; @@ -61,6 +63,7 @@ struct iommu_map_entry { RB_ENTRY(iommu_map_entry) rb_entry; /* Links for domain entries */ struct iommu_domain *domain; struct iommu_qi_genseq gseq; + struct spglist pgtbl_free; }; struct iommu_unit { diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index 26ac38da3c4f..d97bdee47b28 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -96,9 +96,12 @@ iommu_gas_alloc_entry(struct iommu_domain *domain, u_int flags) res = uma_zalloc(iommu_map_entry_zone, ((flags & IOMMU_PGF_WAITOK) != 0 ? M_WAITOK : M_NOWAIT) | M_ZERO); - if (res != NULL && domain != NULL) { - res->domain = domain; - atomic_add_int(&domain->entries_cnt, 1); + if (res != NULL) { + SLIST_INIT(&res->pgtbl_free); + if (domain != NULL) { + res->domain = domain; + atomic_add_int(&domain->entries_cnt, 1); + } } return (res); } @@ -107,7 +110,12 @@ void iommu_gas_free_entry(struct iommu_map_entry *entry) { struct iommu_domain *domain; + int n __unused; + n = vm_page_free_pages_toq(&entry->pgtbl_free, false); +#if defined(__i386__) || defined(__amd64__) + atomic_subtract_int(&iommu_tbl_pagecnt, n); +#endif domain = entry->domain; if (domain != NULL) atomic_subtract_int(&domain->entries_cnt, 1); diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index ffb4c73a6c5a..da2750df5567 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -367,7 +367,7 @@ retry: ("loosing root page %p", domain)); vm_page_unwire_noq(m); iommu_pgfree(domain->pgtbl_obj, m->pindex, - flags); + flags, NULL); return (NULL); } dmar_pte_store(&ptep->pte, DMAR_PTE_R | DMAR_PTE_W | @@ -571,7 +571,7 @@ dmar_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, KASSERT(m->pindex != 0, ("lost reference (idx) on root pg domain %p base %jx lvl %d", domain, (uintmax_t)base, lvl)); - iommu_pgfree(domain->pgtbl_obj, m->pindex, flags); + iommu_pgfree(domain->pgtbl_obj, m->pindex, flags, NULL); dmar_free_pgtbl_pde(domain, base, lvl - 1, flags); } diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 2011c632f770..8ff15cc86cb8 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -109,7 +109,8 @@ iommu_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags) } void -iommu_pgfree(vm_object_t obj, vm_pindex_t idx, int flags) +iommu_pgfree(vm_object_t obj, vm_pindex_t idx, int flags, + struct iommu_map_entry *entry) { vm_page_t m; @@ -117,8 +118,13 @@ iommu_pgfree(vm_object_t obj, vm_pindex_t idx, int flags) VM_OBJECT_WLOCK(obj); m = vm_page_grab(obj, idx, VM_ALLOC_NOCREAT); if (m != NULL) { - vm_page_free(m); - atomic_subtract_int(&iommu_tbl_pagecnt, 1); + if (entry == NULL) { + vm_page_free(m); + atomic_subtract_int(&iommu_tbl_pagecnt, 1); + } else { + vm_page_remove_xbusy(m); /* keep page busy */ + SLIST_INSERT_HEAD(&entry->pgtbl_free, m, plinks.s.ss); + } } if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); @@ -154,7 +160,8 @@ iommu_map_pgtbl(vm_object_t obj, vm_pindex_t idx, int flags, sched_unpin(); if (allocated) { VM_OBJECT_ASSERT_WLOCKED(obj); - iommu_pgfree(obj, m->pindex, flags | IOMMU_PGF_OBJL); + iommu_pgfree(obj, m->pindex, flags | IOMMU_PGF_OBJL, + NULL); } if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index a1ed5c71c513..4d0ac8351e2e 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -48,7 +48,8 @@ struct vm_object; struct vm_page *iommu_pgalloc(struct vm_object *obj, vm_pindex_t idx, int flags); -void iommu_pgfree(struct vm_object *obj, vm_pindex_t idx, int flags); +void iommu_pgfree(struct vm_object *obj, vm_pindex_t idx, int flags, + struct iommu_map_entry *entry); void *iommu_map_pgtbl(struct vm_object *obj, vm_pindex_t idx, int flags, struct sf_buf **sf); void iommu_unmap_pgtbl(struct sf_buf *sf); From nobody Fri Sep 27 17:34:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFczZ2MSxz5YFHg; Fri, 27 Sep 2024 17:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFczY6YDyz4Cc0; Fri, 27 Sep 2024 17:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dySJndQuvKVDaTGC3vCChlFFggDzgvO8Ed+HxIfzKaQ=; b=rjMJnxJ+/YpbgSbbgWzYEK47xlZ1Qcia5V22uQc2wSagkLLNzrhbwleuGNTJWJTZBjpcw3 AsgQdpxBO6ZwstZX2kjRvEGYpt0MLnLbr30R0ihmlUOZQtEYGd60vnwwK7OFygoTfwmO9Z 7eRfJb6iv8D10Vp/nLHwuEPG6ga1CuT/F47Tta17fvDSmJzwY1HIJkpPe0NQHk62HL3FDB 1iA4faSaD19U2GLKN9axPT/niEjbC+1IrfehLyWIJIer35CItr9vGbPu823og4mXKaOpM6 iL6fLpOhev9/xbzl+Vx9OTRjzEokjbj3ImMeFRxFHzNADCgIGRyFtHV6VsLYag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727458489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dySJndQuvKVDaTGC3vCChlFFggDzgvO8Ed+HxIfzKaQ=; b=uC/k4biTHDFxhj1zLC2Ta0+kJTXdN4hL9I7+8ODDgQWun/KLFBuC12/4BhSb9Q5RpPINca HY7saMnzdybw4PmgK4Vk8wYj/EKCfyYB1qdtpS2f/oFdjrF8owgflF9ziNORRn3JaG/9oj 36qkzOODGqSh4qIQwayy4BuiHkDwCLGEt7nogq/hdGsj04z9+jBBGSeCuwuXg+4b0KOfiv tMgia9CFpZZd4vNt0XfYXKlrUgm2VzSN4dhXo/7SbXPsHvXDXpucacM7vP7tIkvUQUAUVt HeDqgyVY+hA2gKfbg9S1sheW7pUhlg5bsdL6fUUtmZ6e9InciYesUbybWFCpDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727458489; a=rsa-sha256; cv=none; b=je4fW3xBLRqg4VTccHMG0ARDnucgKpWMy14zkBMtFG6awHhzkYxZi7h0BK+VraA11rBNmQ ewnzTjXZtJJofXq5J1HHAV6oGysTK3F1VeFLIvLalYopmYxrjUKhnp2SpvF7/MdvSRTLJe ab8DhygVSIyBMtcVKJYJypg5rFIv0I88oK5Yji0DSwvb/9PBtdczA6YL9CUy8x9DHpSXNb tk7VS/HHoAXH/mC3W0ex6XTpLTYkxY5JDaisyVSk7HPxHurQytR9oPZg5ynzsbCJbvN956 yT2nL/+lbqs5AfydgAfARiOm97t8X09ZdQQ0PWVk1rcR8kMsmPJCsedIhDJCtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFczY5yDJzqdH; Fri, 27 Sep 2024 17:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RHYnth062913; Fri, 27 Sep 2024 17:34:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RHYnCg062910; Fri, 27 Sep 2024 17:34:49 GMT (envelope-from git) Date: Fri, 27 Sep 2024 17:34:49 GMT Message-Id: <202409271734.48RHYnCg062910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3848dc4fe6f3 - main - dmar: on unmap, postpone freeing page table pages after the invalidation is done List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3848dc4fe6f37cbcfaea29eb94fa560a503f60ab Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3848dc4fe6f37cbcfaea29eb94fa560a503f60ab commit 3848dc4fe6f37cbcfaea29eb94fa560a503f60ab Author: Konstantin Belousov AuthorDate: 2024-09-25 03:54:44 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-27 17:34:23 +0000 dmar: on unmap, postpone freeing page table pages after the invalidation is done IOMMU is free to access page tables until we invalidate them Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_idpgtbl.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index da2750df5567..6f66106822fe 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -68,7 +68,8 @@ #include static int dmar_unmap_buf_locked(struct dmar_domain *domain, - iommu_gaddr_t base, iommu_gaddr_t size, int flags); + iommu_gaddr_t base, iommu_gaddr_t size, int flags, + struct iommu_map_entry *entry); /* * The cache of the identity mapping page tables for the DMARs. Using @@ -386,7 +387,8 @@ retry: static int dmar_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, - iommu_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags) + iommu_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags, + struct iommu_map_entry *entry) { iommu_pte_t *pte; struct sf_buf *sf; @@ -446,7 +448,7 @@ dmar_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, if (sf != NULL) iommu_unmap_pgtbl(sf); dmar_unmap_buf_locked(domain, base1, base - base1, - flags); + flags, entry); TD_PINNED_ASSERT; return (ENOMEM); } @@ -517,7 +519,8 @@ dmar_map_buf(struct iommu_domain *iodom, struct iommu_map_entry *entry, KASSERT((flags & ~IOMMU_PGF_WAITOK) == 0, ("invalid flags %x", flags)); DMAR_DOMAIN_PGLOCK(domain); - error = dmar_map_buf_locked(domain, base, size, ma, pflags, flags); + error = dmar_map_buf_locked(domain, base, size, ma, pflags, flags, + entry); DMAR_DOMAIN_PGUNLOCK(domain); if (error != 0) return (error); @@ -535,11 +538,11 @@ dmar_map_buf(struct iommu_domain *iodom, struct iommu_map_entry *entry, static void dmar_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, int flags, iommu_pte_t *pte, - struct sf_buf **sf, bool free_fs); + struct sf_buf **sf, struct iommu_map_entry *entry, bool free_fs); static void dmar_free_pgtbl_pde(struct dmar_domain *domain, iommu_gaddr_t base, - int lvl, int flags) + int lvl, int flags, struct iommu_map_entry *entry) { struct sf_buf *sf; iommu_pte_t *pde; @@ -547,12 +550,14 @@ dmar_free_pgtbl_pde(struct dmar_domain *domain, iommu_gaddr_t base, sf = NULL; pde = dmar_pgtbl_map_pte(domain, base, lvl, flags, &idx, &sf); - dmar_unmap_clear_pte(domain, base, lvl, flags, pde, &sf, true); + dmar_unmap_clear_pte(domain, base, lvl, flags, pde, &sf, + entry, true); } static void dmar_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, - int flags, iommu_pte_t *pte, struct sf_buf **sf, bool free_sf) + int flags, iommu_pte_t *pte, struct sf_buf **sf, + struct iommu_map_entry *entry, bool free_sf) { vm_page_t m; @@ -571,8 +576,8 @@ dmar_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, KASSERT(m->pindex != 0, ("lost reference (idx) on root pg domain %p base %jx lvl %d", domain, (uintmax_t)base, lvl)); - iommu_pgfree(domain->pgtbl_obj, m->pindex, flags, NULL); - dmar_free_pgtbl_pde(domain, base, lvl - 1, flags); + iommu_pgfree(domain->pgtbl_obj, m->pindex, flags, entry); + dmar_free_pgtbl_pde(domain, base, lvl - 1, flags, entry); } /* @@ -580,7 +585,7 @@ dmar_unmap_clear_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, */ static int dmar_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, - iommu_gaddr_t size, int flags) + iommu_gaddr_t size, int flags, struct iommu_map_entry *entry) { iommu_pte_t *pte; struct sf_buf *sf; @@ -631,7 +636,7 @@ dmar_unmap_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, if ((pte->pte & DMAR_PTE_SP) != 0 || lvl == domain->pglvl - 1) { dmar_unmap_clear_pte(domain, base, lvl, - flags, pte, &sf, false); + flags, pte, &sf, entry, false); break; } } @@ -661,7 +666,7 @@ dmar_unmap_buf(struct iommu_domain *iodom, struct iommu_map_entry *entry, DMAR_DOMAIN_PGLOCK(domain); error = dmar_unmap_buf_locked(domain, entry->start, entry->end - - entry->start, flags); + entry->start, flags, entry); DMAR_DOMAIN_PGUNLOCK(domain); return (error); } From nobody Fri Sep 27 17:54:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFdQK386Rz5YFqN; Fri, 27 Sep 2024 17:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFdQK2lWXz4Gpv; Fri, 27 Sep 2024 17:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727459673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E3px+aIZPq5jAMRxv5JvdRCMlEGaaOldqTZeHAbARDA=; b=qjAUDGksvr/FD+Fby8lfOBe5c3HVOK/Tr9qxb44IyUxgfTE+t+RDF/6dIdrOi3BbIhEFra KypxjFYtuh/j+jkvGlvf6TsMjJFz4ya6OAkZLnajZNhJhdtF3sLeKFlUyx1eskIajRkMVv 69PwECPgnSTiAbvQ3KGmc090yXeTHKpyQY7W93n5Ipl/qRf9qTZ2p+oOmE98TDyp0OFWpJ aVafbLHIC16KHHjsjA98xit8TyxYxXWz4mUnJWxOoYeIL/gpWwaKAWJMH1klvEnuTpkgoW 6JjJKlGS/FQBnz9Mwp1qiIINdRuwjzE1MdqKrmZYybG1+Ab8agicPwvDiw7odw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727459673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E3px+aIZPq5jAMRxv5JvdRCMlEGaaOldqTZeHAbARDA=; b=AVGHipW+9BQbneGKixA/xXfHrrWHIGorsCSRUN7Qlk1fJpm60BeSBDv4tAHQIyLoaiPaar FR/oD7ZlntuN9r13qnZV7PwlvAXK8WA/Mx30zSPeCMU57iFALF/DV1mvlwM7iY2WNAQ4KK w7zLeu0tWZ+6BAxWKqad4RLQDvjvw2Gcw9T6R7hnjIbHSu6+/JoASZ85id9Uayx3efjQ+e Up4Si40hvV6HtKDuCeMEu7kGs59nMsn5Cq7CeLAeMXGkqB1VWA/5MoxCVb5yZmZYhygQqN qSer0hKmpdO7ciH1bSr+aYW4stWiuF/jOUNS70DvAi9yYrlpGOWraUhSoiPD8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727459673; a=rsa-sha256; cv=none; b=w0qaCrWQBZts1XziiG7aD6nTugJRH+F13yJJXXtkxsH1UZZIRqU7k9HIvm27ZxsZ0ZQeil bBnk1mPImCax24qRCf5KPXZVHoMOKtmxrGenyl4XvlqYda3GCLBozkNsABsE96NLoL4lmu MR8JjtjyMU8KLsuGMPyVSoMVKCPNGZQ60ouQW+87j1td17xnqNDIEsxoqZsU34BHpK6sDO P11itsYiOSDi2fIzsyyUNpSyW9dQpNM+Tzm+bEirA/1FNGMpvlf3UKoinBHSzyhDuNisT8 GAXYiP+col1IWU30jAcMiUurMMQ3aaV2eSzBoNkdYaDj0Ue1+V5yYv1rJ6M0Qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFdQK2LyVzqlY; Fri, 27 Sep 2024 17:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RHsX0f096261; Fri, 27 Sep 2024 17:54:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RHsXsE096258; Fri, 27 Sep 2024 17:54:33 GMT (envelope-from git) Date: Fri, 27 Sep 2024 17:54:33 GMT Message-Id: <202409271754.48RHsXsE096258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0b325167f60d - main - LinuxKPI: 802.11: move functions between header files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b325167f60def621536632460caf68e2fab4fb8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0b325167f60def621536632460caf68e2fab4fb8 commit 0b325167f60def621536632460caf68e2fab4fb8 Author: Bjoern A. Zeeb AuthorDate: 2024-09-27 17:47:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-27 17:54:16 +0000 LinuxKPI: 802.11: move functions between header files Move some ieee8022_{is,has,get}_... functions working on header fields from mac80211.h to ieee80211.h to avoid problems with #includes. No functional changes. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- .../linuxkpi/common/include/linux/ieee80211.h | 351 +++++++++++++++++++++ sys/compat/linuxkpi/common/include/net/mac80211.h | 341 -------------------- 2 files changed, 351 insertions(+), 341 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 9a43a571d390..ce6a18f798d1 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -37,6 +37,14 @@ #include #include +/* linux_80211.c */ +extern int linuxkpi_debug_80211; +#ifndef D80211_TODO +#define D80211_TODO 0x1 +#endif +#define TODO(...) if (linuxkpi_debug_80211 & D80211_TODO) \ + printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) + /* 9.4.2.55 Management MIC element (CMAC-256, GMAC-128, and GMAC-256). */ struct ieee80211_mmie_16 { @@ -853,4 +861,347 @@ ieee80211_is_trigger(__le16 fc) return (fc == v); } +static __inline bool +ieee80211_is_action(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_ACTION | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_probe_resp(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_RESP | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_auth(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_AUTH | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_assoc_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_REQ | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_assoc_resp(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_RESP | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_reassoc_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_REQ | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_reassoc_resp(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_RESP | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_disassoc(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_DISASSOC | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_data_present(__le16 fc) +{ + __le16 v; + + /* If it is a data frame and NODATA is not present. */ + fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA); + v = htole16(IEEE80211_FC0_TYPE_DATA); + + return (fc == v); +} + +static __inline bool +ieee80211_is_deauth(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_DEAUTH | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_beacon(__le16 fc) +{ + __le16 v; + + /* + * For as much as I get it this comes in LE and unlike FreeBSD + * where we get the entire frame header and u8[], here we get the + * 9.2.4.1 Frame Control field only. Mask and compare. + */ + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + + +static __inline bool +ieee80211_is_probe_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_REQ | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_has_protected(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_PROTECTED << 8)); +} + +static __inline bool +ieee80211_is_back_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_BAR | IEEE80211_FC0_TYPE_CTL); + + return (fc == v); +} + +static __inline bool +ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) +{ + struct ieee80211_mgmt *mgmt; + __le16 fc; + + mgmt = (struct ieee80211_mgmt *)skb->data; + fc = mgmt->frame_control; + + /* 11.2.2 Bufferable MMPDUs, 80211-2020. */ + /* XXX we do not care about IBSS yet. */ + + if (!ieee80211_is_mgmt(fc)) + return (false); + if (ieee80211_is_action(fc)) /* XXX FTM? */ + return (true); /* XXX false? */ + if (ieee80211_is_disassoc(fc)) + return (true); + if (ieee80211_is_deauth(fc)) + return (true); + + TODO(); + + return (false); +} + +static __inline bool +ieee80211_is_nullfunc(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA); + + return (fc == v); +} + +static __inline bool +ieee80211_is_qos_nullfunc(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_QOS_NULL | IEEE80211_FC0_TYPE_DATA); + + return (fc == v); +} + +static __inline bool +ieee80211_is_any_nullfunc(__le16 fc) +{ + + return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); +} + +static inline bool +ieee80211_is_pspoll(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_PS_POLL | IEEE80211_FC0_TYPE_CTL); + + return (fc == v); +} + +static __inline bool +ieee80211_has_a4(__le16 fc) +{ + __le16 v; + + fc &= htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); + v = htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); + + return (fc == v); +} + +static __inline bool +ieee80211_has_order(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_ORDER << 8)); +} + +static __inline bool +ieee80211_has_retry(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_RETRY << 8)); +} + + +static __inline bool +ieee80211_has_fromds(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_DIR_FROMDS << 8)); +} + +static __inline bool +ieee80211_has_tods(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_DIR_TODS << 8)); +} + +static __inline uint8_t * +ieee80211_get_SA(struct ieee80211_hdr *hdr) +{ + + if (ieee80211_has_a4(hdr->frame_control)) + return (hdr->addr4); + if (ieee80211_has_fromds(hdr->frame_control)) + return (hdr->addr3); + return (hdr->addr2); +} + +static __inline uint8_t * +ieee80211_get_DA(struct ieee80211_hdr *hdr) +{ + + if (ieee80211_has_tods(hdr->frame_control)) + return (hdr->addr3); + return (hdr->addr1); +} + +static __inline bool +ieee80211_is_frag(struct ieee80211_hdr *hdr) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_first_frag(__le16 fc) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_ftm(struct sk_buff *skb) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_timing_measurement(struct sk_buff *skb) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_has_pm(__le16 fc) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_has_morefrags(__le16 fc) +{ + + fc &= htole16(IEEE80211_FC1_MORE_FRAG << 8); + return (fc != 0); +} + +static __inline u8 * +ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) +{ + if (ieee80211_has_a4(hdr->frame_control)) + return (u8 *)hdr + 30; + else + return (u8 *)hdr + 24; +} + + #endif /* _LINUXKPI_LINUX_IEEE80211_H */ diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 29fb335a8db9..c3b07b68090a 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1260,229 +1260,6 @@ ieee80211_hw_restart_disconnect(struct ieee80211_vif *vif) /* -------------------------------------------------------------------------- */ -static __inline bool -ieee80211_is_action(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_ACTION | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_probe_resp(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_RESP | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_auth(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_AUTH | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_assoc_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_REQ | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_assoc_resp(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_RESP | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_reassoc_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_REQ | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_reassoc_resp(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_RESP | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_disassoc(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_DISASSOC | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_data_present(__le16 fc) -{ - __le16 v; - - /* If it is a data frame and NODATA is not present. */ - fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA); - v = htole16(IEEE80211_FC0_TYPE_DATA); - - return (fc == v); -} - -static __inline bool -ieee80211_is_deauth(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_DEAUTH | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_beacon(__le16 fc) -{ - __le16 v; - - /* - * For as much as I get it this comes in LE and unlike FreeBSD - * where we get the entire frame header and u8[], here we get the - * 9.2.4.1 Frame Control field only. Mask and compare. - */ - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - - -static __inline bool -ieee80211_is_probe_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_REQ | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_has_protected(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_PROTECTED << 8)); -} - -static __inline bool -ieee80211_is_back_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_BAR | IEEE80211_FC0_TYPE_CTL); - - return (fc == v); -} - -static __inline bool -ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) -{ - struct ieee80211_mgmt *mgmt; - __le16 fc; - - mgmt = (struct ieee80211_mgmt *)skb->data; - fc = mgmt->frame_control; - - /* 11.2.2 Bufferable MMPDUs, 80211-2020. */ - /* XXX we do not care about IBSS yet. */ - - if (!ieee80211_is_mgmt(fc)) - return (false); - if (ieee80211_is_action(fc)) /* XXX FTM? */ - return (true); /* XXX false? */ - if (ieee80211_is_disassoc(fc)) - return (true); - if (ieee80211_is_deauth(fc)) - return (true); - - TODO(); - - return (false); -} - -static __inline bool -ieee80211_is_nullfunc(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA); - - return (fc == v); -} - -static __inline bool -ieee80211_is_qos_nullfunc(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_QOS_NULL | IEEE80211_FC0_TYPE_DATA); - - return (fc == v); -} - -static __inline bool -ieee80211_is_any_nullfunc(__le16 fc) -{ - - return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); -} - -static inline bool -ieee80211_is_pspoll(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_PS_POLL | IEEE80211_FC0_TYPE_CTL); - - return (fc == v); -} - static __inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) { @@ -1490,124 +1267,6 @@ ieee80211_vif_is_mesh(struct ieee80211_vif *vif) return (false); } -static __inline bool -ieee80211_is_frag(struct ieee80211_hdr *hdr) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_first_frag(__le16 fc) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_ftm(struct sk_buff *skb) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_timing_measurement(struct sk_buff *skb) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_has_pm(__le16 fc) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_has_a4(__le16 fc) -{ - __le16 v; - - fc &= htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); - v = htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); - - return (fc == v); -} - -static __inline bool -ieee80211_has_order(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_ORDER << 8)); -} - -static __inline bool -ieee80211_has_retry(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_RETRY << 8)); -} - - -static __inline bool -ieee80211_has_fromds(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_DIR_FROMDS << 8)); -} - -static __inline bool -ieee80211_has_tods(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_DIR_TODS << 8)); -} - -static __inline uint8_t * -ieee80211_get_SA(struct ieee80211_hdr *hdr) -{ - - if (ieee80211_has_a4(hdr->frame_control)) - return (hdr->addr4); - if (ieee80211_has_fromds(hdr->frame_control)) - return (hdr->addr3); - return (hdr->addr2); -} - -static __inline uint8_t * -ieee80211_get_DA(struct ieee80211_hdr *hdr) -{ - - if (ieee80211_has_tods(hdr->frame_control)) - return (hdr->addr3); - return (hdr->addr1); -} - -static __inline bool -ieee80211_has_morefrags(__le16 fc) -{ - - fc &= htole16(IEEE80211_FC1_MORE_FRAG << 8); - return (fc != 0); -} - -static __inline u8 * -ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) -{ - if (ieee80211_has_a4(hdr->frame_control)) - return (u8 *)hdr + 30; - else - return (u8 *)hdr + 24; -} /* -------------------------------------------------------------------------- */ /* Receive functions (air/driver to mac80211/net80211). */ From nobody Fri Sep 27 19:33:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFgbx1j4kz5X7Xb; Fri, 27 Sep 2024 19:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFgbx0vx6z4T3W; Fri, 27 Sep 2024 19:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727465581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=USMn2k7+KZLJiJmBYSM9e2afK0Rfvr8nslxm6u2XwW8=; b=dhi01/gYnXhmgm9N/9WEc83t9/SQ7z7uYxRyMR5cSGPQJy1/Q05OGjN67qiWqIcVfOnt3W gAQwe8EZJSLBz/A3bbkopMgrP6ppeSApZRkmrK7igStQ/HqIXGS7BDtKX/BJLGVlBgy4Di 7lh2P5ivCLHzKp+gjvhVPJl6z3LHM2op8/ZYGyPkZIQStpJa5ARItvYajJiLjLFyIS9Vzk kg6Q+O+fTiC888KSyLNYaE2kebPOD+sp0V1fCg3wu0zoWahJuV+7/j8B3E95OzHXSLqq82 hIeT4O+uEAon8MTdF+0BIOVejUJq9b1MWccUzE1r/DpfzuUvLChS6Ylr7EWEMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727465581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=USMn2k7+KZLJiJmBYSM9e2afK0Rfvr8nslxm6u2XwW8=; b=VBzspu4Y6VBsc+pqkPmAsuy9HdKWzF9qWPlihR6ozzvJlRfpmcjVmcVSAtEGXcuN5/tiSw RYW1AVxM8IWKJ2mkNB0c/qwIpCm516dAwNboVcanzM24uw4FiLrNfc7r4n2ta2ylDrCQ46 AWSX/XWYMMozuBL08Y9qixgc0qaNYcJCL1vvy2Wn5RY4CHOqPtf84lBPMddie/DB5ZBzxe +UvePhZuzkML4xGNCVFTwGYPPJ1GUEpclb8cfoPhWeIIDn7ltcTDP8c987lMv/aucntHnz Nxtc31ZOBWMKebfCJ9WnNLUwJQmwoOLA1SNu0KnFrM4Dr0u3fKEKENLxldDldg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727465581; a=rsa-sha256; cv=none; b=L4kPBWmuXsEXE1o1GDuywxGUoOUZs9fNo0sFLgBy0brUXLb47GzEEK4PEXlVVCR+hPVSVF k7hruxKIQYcjOshnnZ/ud9uHbqF+B3ochl0qtIIstiDAMAFTZqZ62AvZMliCObJ0i5Xcu4 390broy11BdDIBaNHIRBatbjRbhl7RBsdGcy31wt8vZpGUW5BmYT4gvftVJ+YCmFwmJNvq 7oKpNByP7TfFY3PSNJtMh2b+YbBiaxaJI7hau2JOOquwjpCc9Ssp5FKoSzojnUkZ56FeX0 5cqZhsD4qsM3f6ytvEkDuOopSA7arBD3loxwnCu113fDINZn/HL/8ks83vzU8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFgbx0CPyztTS; Fri, 27 Sep 2024 19:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RJX09W066671; Fri, 27 Sep 2024 19:33:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RJX0dH066668; Fri, 27 Sep 2024 19:33:00 GMT (envelope-from git) Date: Fri, 27 Sep 2024 19:33:00 GMT Message-Id: <202409271933.48RJX0dH066668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 1235d276b78a - main - lib{c,sys}: stop exposing errno symbol List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1235d276b78a769bded01d51c9bf3cdc480db9fb Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=1235d276b78a769bded01d51c9bf3cdc480db9fb commit 1235d276b78a769bded01d51c9bf3cdc480db9fb Author: Brooks Davis AuthorDate: 2024-09-27 19:27:46 +0000 Commit: Brooks Davis CommitDate: 2024-09-27 19:27:46 +0000 lib{c,sys}: stop exposing errno symbol Officially since C11 (and in reality FreeBSD since 3.0 with commit 1b46cb523df3) errno has been defined to be a macro. Rename the symbol to __libsys_errno and move it to FBSDprivate_1.0 and confine it entierly to libsys for use by libthr. Add a FBSD_1.0 compat symbol for existing binaries that were incorrectly linked to the errno symbol during libc.so.7's lifetime. This deliberately breaks linking software that directly links to errno. Such software is broken and will fail in surprising ways if it becomes threaded (e.g., if it triggers loading of a pam or nss module that uses threads.) Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46780 --- lib/libsys/Makefile | 2 ++ lib/libsys/Symbol.map | 1 + lib/libsys/Symbol.sys.map | 1 - lib/libsys/__error.c | 10 +++++----- lib/libthr/sys/thr_error.c | 5 ++--- lib/libthr/thread/thr_rtld.c | 7 +++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/libsys/Makefile b/lib/libsys/Makefile index b4c0e91e860c..b4b4662ae47f 100644 --- a/lib/libsys/Makefile +++ b/lib/libsys/Makefile @@ -25,6 +25,8 @@ MK_SSP= no INCS= libsys.h _libsys.h +CFLAGS+=-DLIBSYS + CFLAGS+=-I${LIBSYS_SRCTOP}/include -I${LIBC_SRCTOP}/include CFLAGS+=-I${LIBSYS_SRCTOP}/${LIBC_ARCH} CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH} diff --git a/lib/libsys/Symbol.map b/lib/libsys/Symbol.map index b2bc69108bbb..51ea1b5da231 100644 --- a/lib/libsys/Symbol.map +++ b/lib/libsys/Symbol.map @@ -1,5 +1,6 @@ FBSDprivate_1.0 { __elf_aux_vector; + __libsys_errno; __getosreldate; __libsys_interposing_slot; __realpathat; diff --git a/lib/libsys/Symbol.sys.map b/lib/libsys/Symbol.sys.map index 5a4e66baf3c4..85373b1f9cda 100644 --- a/lib/libsys/Symbol.sys.map +++ b/lib/libsys/Symbol.sys.map @@ -72,7 +72,6 @@ FBSD_1.0 { extattr_set_file; extattr_set_link; extattrctl; - errno; fchdir; fchflags; fchmod; diff --git a/lib/libsys/__error.c b/lib/libsys/__error.c index 1132bdba9c65..41016e9a1ed2 100644 --- a/lib/libsys/__error.c +++ b/lib/libsys/__error.c @@ -31,13 +31,15 @@ #include "libc_private.h" -int errno; +int __libsys_errno; +#ifdef LIBSYS +__sym_compat(errno, __libsys_errno, FBSD_1.0); +#endif static int * __error_unthreaded(void) { - - return (&errno); + return (&__libsys_errno); } static int *(*__error_selector)(void) = __error_unthreaded; @@ -45,13 +47,11 @@ static int *(*__error_selector)(void) = __error_unthreaded; void __set_error_selector(int *(*arg)(void)) { - __error_selector = arg; } int * __error(void) { - return (__error_selector()); } diff --git a/lib/libthr/sys/thr_error.c b/lib/libthr/sys/thr_error.c index 7ce3a84fab6b..ec7a57bf6610 100644 --- a/lib/libthr/sys/thr_error.c +++ b/lib/libthr/sys/thr_error.c @@ -39,8 +39,7 @@ #include "libc_private.h" #include "thr_private.h" -#undef errno -extern int errno; +extern int __libsys_errno; __weak_reference(__error_threaded, __error); int * @@ -53,5 +52,5 @@ __error_threaded(void) if (curthread != NULL && curthread != _thr_initial) return (&curthread->error); } - return (&errno); + return (&__libsys_errno); } diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 68a02e9aca1b..e5a7f86de288 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -39,8 +39,7 @@ #include "rtld_lock.h" #include "thr_private.h" -#undef errno -extern int errno; +extern int __libsys_errno; static int _thr_rtld_clr_flag(int); static void *_thr_rtld_lock_create(void); @@ -96,14 +95,14 @@ _thr_rtld_lock_destroy(void *lock) if (curthread != _thr_initial) \ errsave = curthread->error; \ else \ - errsave = errno; \ + errsave = __libsys_errno; \ } #define RESTORE_ERRNO() { \ if (curthread != _thr_initial) \ curthread->error = errsave; \ else \ - errno = errsave; \ + __libsys_errno = errsave; \ } static void From nobody Fri Sep 27 22:17:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFlFP33rRz5XK7n; Fri, 27 Sep 2024 22:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFlFP2V0hz4kVC; Fri, 27 Sep 2024 22:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5L1bd92SSFyYkUroazni3AxCWT8BipTB078uJLNjHFg=; b=F2vLEbmZ/HzqpeeWJJTBGWHltZKwNSeeQC7K8XJ1+6ctsoPuGrnhtPk49+j+1P42a3nJb0 LmLsZD/zPepNmqCYNp8eX2WYnc6CsnWHVh/BjpG2LsV26bcVjG6ph7xZWNGsdl7dBDAro0 zzbwgk1fz3u63L7vJxHyOpwcyoDR6AE9OABaCwAF51e2RiAmnALZMc9G8wIjtENdW+9ZyI UiZh/36A1+nL5ELF8bTqT3k43rL9Jym/9J0/OvsThiHc2LgkGzZxIABQQIzUmbGa3rJuE/ 6TNR2htLlT73aoFFSojwmTWgOp8mZC1oROacxCEX1o4TVsikKoswN+kXYZx3mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5L1bd92SSFyYkUroazni3AxCWT8BipTB078uJLNjHFg=; b=o6iZpE1Ubbh2sKhtrnB6LSOYloLYtOJO6NfhtyNnEwZ6MH54hNJKDuHySigiZgucV6dwx3 m/lCKz89c9irvSD+DV9F2K4dRexH0pPypHFUYzZPZy8ziI+IpbiQS4EuBqyEolwt1HdtUr qjtaeTglt0AOrBkzKXb/MZys7QVZg462WDsRcGq3ISBZC2gx61WZThoM+48zoYnP699Mf+ mge8W4V2wE/rsCyUW8JKDkDL1PxI7IP2dZ8rOIWGJnZv3nbv2fR091tzyghv+DM7kUbddT DQ8ngxzZiql/n/F94xey+WjLXXxEdSgdA7F4WFV7syO2gEoqjDldOLbw3wgmyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727475433; a=rsa-sha256; cv=none; b=RONBWv/lo1IrkWerS5x9Dte5cyHCvLAlpbs7zyJXoMabrl5dZ7kY+qMd7ISgb1s9QRJQ4t ohRV6BDHMH6HNDrwe3g8mX0M+GAyXoI+IjHs7nDcU8+Nth3zhN/4Vl1pAQjvk4uvf/CNfn /dpAzXhxKU5hmdZuVgoswtp+Ud/r6vp6Ydc5lSbLSfZ5HVEWCYIwjJFgTD0WvhUte2BPI+ l0EMK1AxSfYXKx1xhZfbAkkpvWrQknMweSm2EQmaeTPk5ldQEyXaDLeU6MGq4ZwUtwxn/F /2eHG0etcAtV7UvPqADgQz8YfM3wlSQDHA0N8U+P6lcJPb2ODjmQ2ZCh1PxUHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFlFP2070zy6D; Fri, 27 Sep 2024 22:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RMHD5T039224; Fri, 27 Sep 2024 22:17:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RMHDOh039221; Fri, 27 Sep 2024 22:17:13 GMT (envelope-from git) Date: Fri, 27 Sep 2024 22:17:13 GMT Message-Id: <202409272217.48RMHDOh039221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 27f54be50bba - main - pf: merge pf_test() and pf_test6() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27f54be50bbadae936f2ad0f1457fbdbd9634ae5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27f54be50bbadae936f2ad0f1457fbdbd9634ae5 commit 27f54be50bbadae936f2ad0f1457fbdbd9634ae5 Author: Kristof Provost AuthorDate: 2024-09-11 11:24:47 +0000 Commit: Kristof Provost CommitDate: 2024-09-27 20:13:22 +0000 pf: merge pf_test() and pf_test6() Bye bye pf_test6(). Only one pf_test function for both IPv4 and v6. The functions were 95% identical anyway. OK bluhm@ mcbride@ and most probably henning@ as well Obtained from: OpenBSD, claudio , c8bc4f6e29 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46649 --- sys/net/pfvar.h | 8 +- sys/netpfil/pf/pf.c | 614 +++++++++++++--------------------------------- sys/netpfil/pf/pf_ioctl.c | 8 +- 3 files changed, 173 insertions(+), 457 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9ad079f9f95b..c4553e6f380f 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2361,16 +2361,16 @@ int pf_setup_pdesc(sa_family_t, int, int pf_test_eth(int, int, struct ifnet *, struct mbuf **, struct inpcb *); int pf_scan_sctp(struct mbuf *, int, struct pf_pdesc *, struct pfi_kkif *); -#ifdef INET -int pf_test(int, int, struct ifnet *, struct mbuf **, struct inpcb *, +#if defined(INET) || defined(INET6) +int pf_test(sa_family_t, int, int, struct ifnet *, struct mbuf **, struct inpcb *, struct pf_rule_actions *); +#endif +#ifdef INET int pf_normalize_ip(struct mbuf **, struct pfi_kkif *, u_short *, struct pf_pdesc *); #endif /* INET */ #ifdef INET6 -int pf_test6(int, int, struct ifnet *, struct mbuf **, struct inpcb *, - struct pf_rule_actions *); int pf_normalize_ip6(struct mbuf **, struct pfi_kkif *, u_short *, struct pf_pdesc *); void pf_poolmask(struct pf_addr *, struct pf_addr*, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 215f2655d9d4..8072207ef5dd 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -121,8 +121,6 @@ SDT_PROVIDER_DEFINE(pf); SDT_PROBE_DEFINE4(pf, ip, test, done, "int", "int", "struct pf_krule *", "struct pf_kstate *"); -SDT_PROBE_DEFINE4(pf, ip, test6, done, "int", "int", "struct pf_krule *", - "struct pf_kstate *"); SDT_PROBE_DEFINE5(pf, ip, state, lookup, "struct pfi_kkif *", "struct pf_state_key_cmp *", "int", "struct pf_pdesc *", "struct pf_kstate *"); @@ -585,6 +583,19 @@ pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af) return (0); } +static bool +pf_is_loopback(sa_family_t af, struct pf_addr *addr) +{ + switch (af) { + case AF_INET: + return IN_LOOPBACK(ntohl(addr->v4.s_addr)); + case AF_INET6: + return IN6_IS_ADDR_LOOPBACK(&addr->v6); + default: + panic("Unknown af %d", af); + } +} + static void pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, struct pf_state_key *nk) @@ -7906,7 +7917,8 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, goto bad; if (pd->dir == PF_IN) { - if (pf_test(PF_OUT, PFIL_FWD, ifp, &m0, inp, &pd->act) != PF_PASS) + if (pf_test(AF_INET, PF_OUT, PFIL_FWD, ifp, &m0, inp, + &pd->act) != PF_PASS) goto bad; else if (m0 == NULL) goto done; @@ -8156,7 +8168,8 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, goto bad; if (pd->dir == PF_IN) { - if (pf_test6(PF_OUT, PFIL_FWD, ifp, &m0, inp, &pd->act) != PF_PASS) + if (pf_test(AF_INET6, PF_OUT, PFIL_FWD, ifp, &m0, inp, + &pd->act) != PF_PASS) goto bad; else if (m0 == NULL) goto done; @@ -8586,6 +8599,9 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, pd->tot_len = ntohs(h->ip_len); pd->act.rtableid = -1; + if (h->ip_hl > 5) /* has options */ + pd->rh_cnt++; + /* fragments not reassembled handled later */ if (h->ip_off & htons(IP_MF | IP_OFFMASK)) return (0); @@ -8756,6 +8772,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, *hdrlen = ICMP_MINLEN; break; } +#ifdef INET6 case IPPROTO_ICMPV6: { size_t icmp_hlen = sizeof(struct icmp6_hdr); @@ -8786,6 +8803,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, *hdrlen = icmp_hlen; break; } +#endif } return (0); } @@ -8869,15 +8887,16 @@ pf_counters_inc(int action, struct pf_pdesc *pd, pf_counter_u64_critical_exit(); } -#ifdef INET +#if defined(INET) || defined(INET6) int -pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, +pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp, struct pf_rule_actions *default_actions) { struct pfi_kkif *kif; u_short action, reason = 0; struct mbuf *m = *m0; struct ip *h = NULL; + struct ip6_hdr *h6 = NULL; struct m_tag *mtag; struct pf_krule *a = NULL, *r = &V_pf_default_rule; struct pf_kstate *s = NULL; @@ -8886,6 +8905,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, int off, hdrlen, use_2nd_queue = 0; uint16_t tag; uint8_t rt; + uint8_t ttl; PF_RULES_RLOCK_TRACKER; KASSERT(dir == PF_IN || dir == PF_OUT, ("%s: bad direction %d\n", __func__, dir)); @@ -8920,26 +8940,68 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, return (PF_DROP); } - if (__predict_false(m->m_len < sizeof(struct ip)) && - (m = *m0 = m_pullup(*m0, sizeof(struct ip))) == NULL) { - DPFPRINTF(PF_DEBUG_URGENT, - ("pf_test: m_len < sizeof(struct ip), pullup failed\n")); - PF_RULES_RUNLOCK(); - return (PF_DROP); - } - memset(&pd, 0, sizeof(pd)); pd.dir = dir; - if (pf_normalize_ip(m0, kif, &reason, &pd) != PF_PASS) { + switch (af) { +#ifdef INET + case AF_INET: + if (__predict_false(m->m_len < sizeof(struct ip)) && + (m = *m0 = m_pullup(*m0, sizeof(struct ip))) == NULL) { + DPFPRINTF(PF_DEBUG_URGENT, + ("pf_test: m_len < sizeof(struct ip), pullup failed\n")); + PF_RULES_RUNLOCK(); + return (PF_DROP); + } + + if (pf_normalize_ip(m0, kif, &reason, &pd) != PF_PASS) { + /* We do IP header normalization and packet reassembly here */ + action = PF_DROP; + goto done; + } + m = *m0; /* pf_normalize messes with m0 */ + h = mtod(m, struct ip *); + ttl = h->ip_ttl; + break; +#endif +#ifdef INET6 + case AF_INET6: + /* + * If we end up changing IP addresses (e.g. binat) the stack may get + * confused and fail to send the icmp6 packet too big error. Just send + * it here, before we do any NAT. + */ + if (dir == PF_OUT && pflags & PFIL_FWD && IN6_LINKMTU(ifp) < pf_max_frag_size(m)) { + PF_RULES_RUNLOCK(); + *m0 = NULL; + icmp6_error(m, ICMP6_PACKET_TOO_BIG, 0, IN6_LINKMTU(ifp)); + return (PF_DROP); + } + + if (__predict_false(m->m_len < sizeof(struct ip6_hdr)) && + (m = *m0 = m_pullup(*m0, sizeof(struct ip6_hdr))) == NULL) { + DPFPRINTF(PF_DEBUG_URGENT, + ("pf_test6: m_len < sizeof(struct ip6_hdr)" + ", pullup failed\n")); + PF_RULES_RUNLOCK(); + return (PF_DROP); + } + /* We do IP header normalization and packet reassembly here */ - action = PF_DROP; - goto done; + if (pf_normalize_ip6(m0, kif, &reason, &pd) != PF_PASS) { + action = PF_DROP; + goto done; + } + m = *m0; /* pf_normalize messes with m0 */ + h6 = mtod(m, struct ip6_hdr *); + ttl = h6->ip6_hlim; + break; +#endif + default: + panic("Unknown af %d", af); } - m = *m0; /* pf_normalize messes with m0 */ - h = mtod(m, struct ip *); - if (pf_setup_pdesc(AF_INET, dir, &pd, m, &action, &reason, kif, &a, &r, + if (pf_setup_pdesc(af, dir, &pd, m, &action, &reason, kif, &a, &r, &ruleset, &off, &hdrlen, default_actions) == -1) { if (action != PF_PASS) pd.act.log |= PF_LOG_FORCE; @@ -9000,15 +9062,35 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, m_tag_delete(m, mtag); } - /* handle fragments that didn't get reassembled by normalization */ - if (h->ip_off & htons(IP_MF | IP_OFFMASK)) { - action = pf_test_fragment(&r, kif, m, &pd, &a, &ruleset); - goto done; + switch (af) { +#ifdef INET + case AF_INET: + /* handle fragments that didn't get reassembled by normalization */ + if (h->ip_off & htons(IP_MF | IP_OFFMASK)) { + action = pf_test_fragment(&r, kif, m, &pd, &a, &ruleset); + goto done; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + /* + * we do not support jumbogram. if we keep going, zero ip6_plen + * will do something bad, so drop the packet for now. + */ + if (htons(h6->ip6_plen) == 0) { + action = PF_DROP; + REASON_SET(&reason, PFRES_NORM); /*XXX*/ + goto done; + } + break; +#endif + default: + panic("Unknown af %d", af); } - switch (h->ip_p) { + switch (pd.proto) { case IPPROTO_TCP: { - /* Respond to SYN with a syncookie. */ if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == TH_SYN && pd.dir == PF_IN && pf_synflood_check(&pd)) { @@ -9036,14 +9118,14 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, pd.dir == PF_IN) { struct mbuf *msyn; - msyn = pf_syncookie_recreate_syn(h->ip_ttl, off, + msyn = pf_syncookie_recreate_syn(ttl, off, &pd); if (msyn == NULL) { action = PF_DROP; break; } - action = pf_test(dir, pflags, ifp, &msyn, inp, + action = pf_test(af, dir, pflags, ifp, &msyn, inp, &pd.act); m_freem(msyn); if (action != PF_PASS) @@ -9101,6 +9183,12 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, } case IPPROTO_ICMP: { + if (af != AF_INET) { + action = PF_DROP; + DPFPRINTF(PF_DEBUG_MISC, + ("dropping IPv6 packet with ICMPv4 payload")); + goto done; + } action = pf_test_state_icmp(&s, kif, m, off, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) @@ -9114,10 +9202,22 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, } case IPPROTO_ICMPV6: { - action = PF_DROP; - DPFPRINTF(PF_DEBUG_MISC, - ("pf: dropping IPv4 packet with ICMPv6 payload\n")); - goto done; + if (af != AF_INET6) { + action = PF_DROP; + DPFPRINTF(PF_DEBUG_MISC, + ("pf: dropping IPv4 packet with ICMPv6 payload\n")); + goto done; + } + action = pf_test_state_icmp(&s, kif, m, off, &pd, &reason); + if (action == PF_PASS) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + } else if (s == NULL) + action = pf_test_rule(&r, &s, kif, m, off, &pd, + &a, &ruleset, inp, hdrlen); + break; } default: @@ -9135,13 +9235,14 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, done: PF_RULES_RUNLOCK(); - if (action == PF_PASS && h->ip_hl > 5 && + + if (action == PF_PASS && pd.rh_cnt && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; REASON_SET(&reason, PFRES_IPOPTIONS); pd.act.log = PF_LOG_FORCE; DPFPRINTF(PF_DEBUG_MISC, - ("pf: dropping packet with ip options\n")); + ("pf: dropping packet with dangerous headers\n")); } if (s) { @@ -9193,7 +9294,10 @@ done: else pd.pf_mtag->qid = pd.act.qid; /* Add hints for ecn. */ - pd.pf_mtag->hdr = h; + if (af == AF_INET) + pd.pf_mtag->hdr = h; + else + pd.pf_mtag->hdr = h6; } } #endif /* ALTQ */ @@ -9207,11 +9311,11 @@ done: pd.proto == IPPROTO_UDP) && s != NULL && s->nat_rule.ptr != NULL && (s->nat_rule.ptr->action == PF_RDR || s->nat_rule.ptr->action == PF_BINAT) && - IN_LOOPBACK(ntohl(pd.dst->v4.s_addr))) + pf_is_loopback(af, pd.dst)) m->m_flags |= M_SKIP_FIREWALL; - if (__predict_false(ip_divert_ptr != NULL) && action == PF_PASS && - r->divert.port && !PACKET_LOOPED(&pd)) { + if (af == AF_INET && __predict_false(ip_divert_ptr != NULL) && + action == PF_PASS && r->divert.port && !PACKET_LOOPED(&pd)) { mtag = m_tag_alloc(MTAG_PF_DIVERT, 0, sizeof(struct pf_divert_mtag), M_NOWAIT | M_ZERO); if (mtag != NULL) { @@ -9252,6 +9356,10 @@ done: ("pf: failed to allocate divert tag\n")); } } + /* XXX: Anybody working on it?! */ + if (af == AF_INET6 && r->divert.port) + printf("pf: divert(9) is not supported for IPv6\n"); + /* this flag will need revising if the pkt is forwarded */ if (pd.pf_mtag) pd.pf_mtag->flags &= ~PF_MTAG_FLAG_PACKET_LOOPED; @@ -9291,417 +9399,23 @@ done: *m0 = NULL; break; default: - /* pf_route() returns unlocked. */ if (rt) { - pf_route(m0, r, kif->pfik_ifp, s, &pd, inp); - goto out; - } - if (pf_dummynet(&pd, s, r, m0) != 0) { - action = PF_DROP; - REASON_SET(&reason, PFRES_MEMORY); - } - break; - } - - SDT_PROBE4(pf, ip, test, done, action, reason, r, s); - - if (s && action != PF_DROP) { - if (!s->if_index_in && dir == PF_IN) - s->if_index_in = ifp->if_index; - else if (!s->if_index_out && dir == PF_OUT) - s->if_index_out = ifp->if_index; - } - - if (s) - PF_STATE_UNLOCK(s); - -out: - pf_sctp_multihome_delayed(&pd, off, kif, s, action); - - return (action); -} -#endif /* INET */ - + switch (af) { +#ifdef INET + case AF_INET: + /* pf_route() returns unlocked. */ + pf_route(m0, r, kif->pfik_ifp, s, &pd, inp); + break; +#endif #ifdef INET6 -int -pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp, - struct pf_rule_actions *default_actions) -{ - struct pfi_kkif *kif; - u_short action, reason = 0; - struct mbuf *m = *m0, *n = NULL; - struct m_tag *mtag; - struct ip6_hdr *h = NULL; - struct pf_krule *a = NULL, *r = &V_pf_default_rule; - struct pf_kstate *s = NULL; - struct pf_kruleset *ruleset = NULL; - struct pf_pdesc pd; - int off, hdrlen, use_2nd_queue = 0; - uint16_t tag; - uint8_t rt; - - PF_RULES_RLOCK_TRACKER; - KASSERT(dir == PF_IN || dir == PF_OUT, ("%s: bad direction %d\n", __func__, dir)); - M_ASSERTPKTHDR(m); - - if (!V_pf_status.running) - return (PF_PASS); - - PF_RULES_RLOCK(); - - kif = (struct pfi_kkif *)ifp->if_pf_kif; - if (__predict_false(kif == NULL)) { - DPFPRINTF(PF_DEBUG_URGENT, - ("pf_test6: kif == NULL, if_xname %s\n", ifp->if_xname)); - PF_RULES_RUNLOCK(); - return (PF_DROP); - } - if (kif->pfik_flags & PFI_IFLAG_SKIP) { - PF_RULES_RUNLOCK(); - return (PF_PASS); - } - - if (m->m_flags & M_SKIP_FIREWALL) { - PF_RULES_RUNLOCK(); - return (PF_PASS); - } - - /* - * If we end up changing IP addresses (e.g. binat) the stack may get - * confused and fail to send the icmp6 packet too big error. Just send - * it here, before we do any NAT. - */ - if (dir == PF_OUT && pflags & PFIL_FWD && IN6_LINKMTU(ifp) < pf_max_frag_size(m)) { - PF_RULES_RUNLOCK(); - *m0 = NULL; - icmp6_error(m, ICMP6_PACKET_TOO_BIG, 0, IN6_LINKMTU(ifp)); - return (PF_DROP); - } - - if (__predict_false(! M_WRITABLE(*m0))) { - m = *m0 = m_unshare(*m0, M_NOWAIT); - if (*m0 == NULL) - return (PF_DROP); - } - - if (__predict_false(m->m_len < sizeof(struct ip6_hdr)) && - (m = *m0 = m_pullup(*m0, sizeof(struct ip6_hdr))) == NULL) { - DPFPRINTF(PF_DEBUG_URGENT, - ("pf_test6: m_len < sizeof(struct ip6_hdr)" - ", pullup failed\n")); - PF_RULES_RUNLOCK(); - return (PF_DROP); - } - - memset(&pd, 0, sizeof(pd)); - pd.dir = dir; - - /* We do IP header normalization and packet reassembly here */ - if (pf_normalize_ip6(m0, kif, &reason, &pd) != PF_PASS) { - action = PF_DROP; - goto done; - } - m = *m0; /* pf_normalize messes with m0 */ - h = mtod(m, struct ip6_hdr *); - off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr); - - if (pf_setup_pdesc(AF_INET6, dir, &pd, m, &action, &reason, kif, &a, &r, - &ruleset, &off, &hdrlen, default_actions) == -1) { - if (action != PF_PASS) - pd.act.log |= PF_LOG_FORCE; - goto done; - } - - if (pd.pf_mtag != NULL && (pd.pf_mtag->flags & PF_MTAG_FLAG_ROUTE_TO)) { - pd.pf_mtag->flags &= ~PF_MTAG_FLAG_ROUTE_TO; - - ifp = ifnet_byindexgen(pd.pf_mtag->if_index, - pd.pf_mtag->if_idxgen); - if (ifp == NULL || ifp->if_flags & IFF_DYING) { - PF_RULES_RUNLOCK(); - m_freem(*m0); - *m0 = NULL; - return (PF_PASS); - } - PF_RULES_RUNLOCK(); - nd6_output_ifp(ifp, ifp, m, - (struct sockaddr_in6 *)&pd.pf_mtag->dst, NULL); - *m0 = NULL; - return (PF_PASS); - } - - if (ip_dn_io_ptr != NULL && pd.pf_mtag != NULL && - pd.pf_mtag->flags & PF_MTAG_FLAG_DUMMYNET) { - pf_dummynet_flag_remove(m, pd.pf_mtag); - /* Dummynet re-injects packets after they've - * completed their delay. We've already - * processed them, so pass unconditionally. */ - PF_RULES_RUNLOCK(); - return (PF_PASS); - } - - /* - * we do not support jumbogram. if we keep going, zero ip6_plen - * will do something bad, so drop the packet for now. - */ - if (htons(h->ip6_plen) == 0) { - action = PF_DROP; - REASON_SET(&reason, PFRES_NORM); /*XXX*/ - goto done; - } - - /* if there's no routing header, use unmodified mbuf for checksumming */ - if (!n) - n = m; - - switch (pd.proto) { - case IPPROTO_TCP: { - /* Respond to SYN with a syncookie. */ - if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == TH_SYN && - pd.dir == PF_IN && pf_synflood_check(&pd)) { - pf_syncookie_send(m, off, &pd); - action = PF_DROP; - break; - } - - if ((pd.hdr.tcp.th_flags & TH_ACK) && pd.p_len == 0) - use_2nd_queue = 1; - - action = pf_normalize_tcp(kif, m, 0, off, &pd); - if (action == PF_DROP) - goto done; - action = pf_test_state_tcp(&s, kif, m, off, &pd, &reason); - if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; - } else if (s == NULL) { - /* Validate remote SYN|ACK, re-create original SYN if - * valid. */ - if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == - TH_ACK && pf_syncookie_validate(&pd) && - pd.dir == PF_IN) { - struct mbuf *msyn; - - msyn = pf_syncookie_recreate_syn(h->ip6_hlim, - off, &pd); - if (msyn == NULL) { - action = PF_DROP; - break; - } - - action = pf_test6(dir, pflags, ifp, &msyn, inp, - &pd.act); - m_freem(msyn); - if (action != PF_PASS) - break; - - action = pf_test_state_tcp(&s, kif, m, off, - &pd, &reason); - if (action != PF_PASS || s == NULL) { - action = PF_DROP; - break; - } - - s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) - 1; - s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) - 1; - pf_set_protostate(s, PF_PEER_SRC, PF_TCPS_PROXY_DST); - - action = pf_synproxy(&pd, &s, &reason); + case AF_INET6: + /* pf_route6() returns unlocked. */ + pf_route6(m0, r, kif->pfik_ifp, s, &pd, inp); break; - } else { - action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp, hdrlen); +#endif + default: + panic("Unknown af %d", af); } - } - break; - } - - case IPPROTO_UDP: { - action = pf_test_state_udp(&s, kif, m, off, &pd); - if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; - } else if (s == NULL) - action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp, hdrlen); - break; - } - - case IPPROTO_SCTP: { - action = pf_normalize_sctp(dir, kif, m, 0, off, &pd); - if (action == PF_DROP) - goto done; - action = pf_test_state_sctp(&s, kif, m, off, &pd, - &reason); - if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; - } else if (s == NULL) { - action = pf_test_rule(&r, &s, kif, m, off, - &pd, &a, &ruleset, inp, hdrlen); - } - break; - } - - case IPPROTO_ICMP: { - action = PF_DROP; - DPFPRINTF(PF_DEBUG_MISC, - ("pf: dropping IPv6 packet with ICMPv4 payload\n")); - goto done; - } - - case IPPROTO_ICMPV6: { - action = pf_test_state_icmp(&s, kif, m, off, &pd, &reason); - if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; - } else if (s == NULL) - action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp, hdrlen); - break; - } - - default: - action = pf_test_state_other(&s, kif, m, &pd); - if (action == PF_PASS) { - if (V_pfsync_update_state_ptr != NULL) - V_pfsync_update_state_ptr(s); - r = s->rule.ptr; - a = s->anchor.ptr; - } else if (s == NULL) - action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp, hdrlen); - break; - } - -done: - PF_RULES_RUNLOCK(); - if (n != m) { - m_freem(n); - n = NULL; - } - - /* handle dangerous IPv6 extension headers. */ - if (action == PF_PASS && pd.rh_cnt && - !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_IPOPTIONS); - pd.act.log = r->log; - DPFPRINTF(PF_DEBUG_MISC, - ("pf: dropping packet with dangerous v6 headers\n")); - } - - if (s) { - uint8_t log = pd.act.log; - memcpy(&pd.act, &s->act, sizeof(struct pf_rule_actions)); - pd.act.log |= log; - tag = s->tag; - rt = s->rt; - } else { - tag = r->tag; - rt = r->rt; - } - - if (tag > 0 && pf_tag_packet(m, &pd, tag)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_MEMORY); - } - - pf_scrub(m, &pd); - if (pd.proto == IPPROTO_TCP && pd.act.max_mss) - pf_normalize_mss(m, off, &pd); - - if (pd.act.rtableid >= 0) - M_SETFIB(m, pd.act.rtableid); - - if (pd.act.flags & PFSTATE_SETPRIO) { - if (pd.tos & IPTOS_LOWDELAY) - use_2nd_queue = 1; - if (vlan_set_pcp(m, pd.act.set_prio[use_2nd_queue])) { - action = PF_DROP; - REASON_SET(&reason, PFRES_MEMORY); - pd.act.log = PF_LOG_FORCE; - DPFPRINTF(PF_DEBUG_MISC, - ("pf: failed to allocate 802.1q mtag\n")); - } - } - -#ifdef ALTQ - if (action == PF_PASS && pd.act.qid) { - if (pd.pf_mtag == NULL && - ((pd.pf_mtag = pf_get_mtag(m)) == NULL)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_MEMORY); - } else { - if (s != NULL) - pd.pf_mtag->qid_hash = pf_state_hash(s); - if (use_2nd_queue || (pd.tos & IPTOS_LOWDELAY)) - pd.pf_mtag->qid = pd.act.pqid; - else - pd.pf_mtag->qid = pd.act.qid; - /* Add hints for ecn. */ - pd.pf_mtag->hdr = h; - } - } -#endif /* ALTQ */ - - if (dir == PF_IN && action == PF_PASS && (pd.proto == IPPROTO_TCP || - pd.proto == IPPROTO_UDP) && s != NULL && s->nat_rule.ptr != NULL && - (s->nat_rule.ptr->action == PF_RDR || - s->nat_rule.ptr->action == PF_BINAT) && - IN6_IS_ADDR_LOOPBACK(&pd.dst->v6)) - m->m_flags |= M_SKIP_FIREWALL; - - /* XXX: Anybody working on it?! */ - if (r->divert.port) - printf("pf: divert(9) is not supported for IPv6\n"); - - if (pd.act.log) { - struct pf_krule *lr; - struct pf_krule_item *ri; - - if (s != NULL && s->nat_rule.ptr != NULL && - s->nat_rule.ptr->log & PF_LOG_ALL) - lr = s->nat_rule.ptr; - else - lr = r; - - if (pd.act.log & PF_LOG_FORCE || lr->log & PF_LOG_ALL) - PFLOG_PACKET(kif, m, action, reason, lr, a, ruleset, - &pd, (s == NULL)); - if (s) { - SLIST_FOREACH(ri, &s->match_rules, entry) - if (ri->r->log & PF_LOG_ALL) - PFLOG_PACKET(kif, m, action, reason, - ri->r, a, ruleset, &pd, 0); - } - } - - pf_counters_inc(action, &pd, kif, s, r, a); - - switch (action) { - case PF_SYNPROXY_DROP: - m_freem(*m0); - case PF_DEFER: - *m0 = NULL; - action = PF_PASS; - break; - case PF_DROP: - m_freem(*m0); - *m0 = NULL; - break; - default: - /* pf_route6() returns unlocked. */ - if (rt) { - pf_route6(m0, r, kif->pfik_ifp, s, &pd, inp); goto out; } if (pf_dummynet(&pd, s, r, m0) != 0) { @@ -9711,6 +9425,8 @@ done: break; } + SDT_PROBE4(pf, ip, test, done, action, reason, r, s); + if (s && action != PF_DROP) { if (!s->if_index_in && dir == PF_IN) s->if_index_in = ifp->if_index; @@ -9721,16 +9437,16 @@ done: if (s) PF_STATE_UNLOCK(s); +#ifdef INET6 /* If reassembled packet passed, create new fragments. */ - if (action == PF_PASS && *m0 && dir == PF_OUT && + if (af == AF_INET6 && action == PF_PASS && *m0 && dir == PF_OUT && (mtag = m_tag_find(m, PACKET_TAG_PF_REASSEMBLED, NULL)) != NULL) action = pf_refragment6(ifp, m0, mtag, pflags & PFIL_FWD); +#endif out: - SDT_PROBE4(pf, ip, test6, done, action, reason, r, s); - pf_sctp_multihome_delayed(&pd, off, kif, s, action); return (action); } -#endif /* INET6 */ +#endif /* INET || INET6 */ diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index dcdab6029558..0a573a017ef3 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -6471,7 +6471,7 @@ pf_check_in(struct mbuf **m, struct ifnet *ifp, int flags, CURVNET_ASSERT_SET(); - chk = pf_test(PF_IN, flags, ifp, m, inp, NULL); + chk = pf_test(AF_INET, PF_IN, flags, ifp, m, inp, NULL); return (pf_check_return(chk, m)); } @@ -6484,7 +6484,7 @@ pf_check_out(struct mbuf **m, struct ifnet *ifp, int flags, CURVNET_ASSERT_SET(); - chk = pf_test(PF_OUT, flags, ifp, m, inp, NULL); + chk = pf_test(AF_INET, PF_OUT, flags, ifp, m, inp, NULL); return (pf_check_return(chk, m)); } @@ -6504,7 +6504,7 @@ pf_check6_in(struct mbuf **m, struct ifnet *ifp, int flags, * order to support scoped addresses. In order to support stateful * filtering we have change this to lo0 as it is the case in IPv4. */ - chk = pf_test6(PF_IN, flags, (*m)->m_flags & M_LOOP ? V_loif : ifp, + chk = pf_test(AF_INET6, PF_IN, flags, (*m)->m_flags & M_LOOP ? V_loif : ifp, m, inp, NULL); return (pf_check_return(chk, m)); @@ -6518,7 +6518,7 @@ pf_check6_out(struct mbuf **m, struct ifnet *ifp, int flags, CURVNET_ASSERT_SET(); - chk = pf_test6(PF_OUT, flags, ifp, m, inp, NULL); + chk = pf_test(AF_INET6, PF_OUT, flags, ifp, m, inp, NULL); return (pf_check_return(chk, m)); } From nobody Fri Sep 27 22:17:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFlFQ5Gklz5XK7p; Fri, 27 Sep 2024 22:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFlFQ3zQwz4kVD; Fri, 27 Sep 2024 22:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fyn+0E5Fq4wk7bzYuTooBrAzsFDR1zEloYqq4OlUMow=; b=tlwhuf6NRck4dNCFZ2keX4hlH0jUDzBwKs+jnbUsWatyGe5/hnjYQeN1TizRG3f3+XbdUe cZO6GKacNIKcxSOfTQIllzNrYRIgj+lEWqQjfz0j/6o56Jn2RJlSDEdZP6jXn096OjlqxS Ch5MEjQM9+gkefH6pY9JBkeSwYHZ7Y2ul7ngSzCSWulhwUhJBL7B2riyCl3XN9ZEgMra5z ZmzKOLfHtJL8o7C8ANdIbSN3Y+g9H49roI/syWg+iomBjbwOBkYTcFWG05jsvvyDAYHsJH HaGMJl5mOKjnDI5qLonmrQHVf2SjdlbTfByg3qX7aswd+VqJSpRBjGTEpDzGdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fyn+0E5Fq4wk7bzYuTooBrAzsFDR1zEloYqq4OlUMow=; b=rmw0nRGB/5Tn2IAqeTspYc/mZG+G/0/sKRz1lqO7USg7RSbse7165+MBzRgr+6y/Ob5SMp OQz8Vdewbda2A9tPMQMMEOj5c/0XT1rlqLiU3Adcimu7NurgWg3GM62xhMB3Bsrr6dq+Ud Zwpmq4c2YuEceczOiYa2NH1t0CRoUycF91Qn5wfsBLRDnTH1bTAcheMhJBQtdhdKXoipbz 1c49ulhyMmtLHLgWMBII0IK3fTWciBAmDnHJhhrQEao1yfYyRwdfHpwuGRmYxaOQveGaTJ uYaVrrSqXyk5vQ4vOokmn3GQ9xc0f6frjzgQlgaSi0qqYNdZSXHPPMHBAwzrXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727475434; a=rsa-sha256; cv=none; b=NDCqgn1FInUFRcnmPnHOxIraAeDvlKfgsPLj8E68oNQx94XG+QzzUnEs9NiUY1qaf7bJIv UoTUIdCdWyPnO6V0rugbJTavHnvGx4OnC6FbXC1e4JHCoFxfuCD1dIDgb3grX4zaInuD1u kmv4gmj1zE/HM2Kw2EQrh7DQFQryeXKD6kG2hgk/Y0NrqgEurfZkTKLIaCHliEgHxrR5r7 Z89SnRy8hqWM5mwbpltRy5Iiwl1AJQQj7Vju2cZM2K+raT5RvRWlv253yThQpn3e7Rj36p Z/BAA9GAs+iCKLqgFiUTGnnnmLlUOycT0zrXXkDhpUFjEfSSR341FVxZn6Zq+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFlFQ3Mp4zyMd; Fri, 27 Sep 2024 22:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RMHENn039275; Fri, 27 Sep 2024 22:17:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RMHEcj039272; Fri, 27 Sep 2024 22:17:14 GMT (envelope-from git) Date: Fri, 27 Sep 2024 22:17:14 GMT Message-Id: <202409272217.48RMHEcj039272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 39f615e90ca3 - main - pf: rename the pf_pdesc field rh_cnt to badopts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39f615e90ca3fc6207dd0419a69a859e563e1de0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=39f615e90ca3fc6207dd0419a69a859e563e1de0 commit 39f615e90ca3fc6207dd0419a69a859e563e1de0 Author: Kristof Provost AuthorDate: 2024-09-11 12:46:51 +0000 Commit: Kristof Provost CommitDate: 2024-09-27 20:13:23 +0000 pf: rename the pf_pdesc field rh_cnt to badopts It is also used for IPv4 options now. ok mcbride@ henning@ Reviewed by: zlei Obtained from: OpenBSD, bluhm , 4fe6abd45f Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46650 --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index c4553e6f380f..f5551447f7aa 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1611,7 +1611,7 @@ struct pf_pdesc { struct pf_rule_actions act; u_int32_t p_len; /* total length of payload */ - u_int32_t rh_cnt; /* Route header count */ + u_int32_t badopts; /* v4 options or v6 routing headers */ u_int16_t *ip_sum; u_int16_t *proto_sum; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 8072207ef5dd..823e90384747 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8600,7 +8600,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, pd->act.rtableid = -1; if (h->ip_hl > 5) /* has options */ - pd->rh_cnt++; + pd->badopts++; /* fragments not reassembled handled later */ if (h->ip_off & htons(IP_MF | IP_OFFMASK)) @@ -8643,7 +8643,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, case IPPROTO_ROUTING: { struct ip6_rthdr rthdr; - if (pd->rh_cnt++) { + if (pd->badopts++) { DPFPRINTF(PF_DEBUG_MISC, ("pf: IPv6 more than one rthdr")); *action = PF_DROP; @@ -9236,7 +9236,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 done: PF_RULES_RUNLOCK(); - if (action == PF_PASS && pd.rh_cnt && + if (action == PF_PASS && pd.badopts && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; REASON_SET(&reason, PFRES_IPOPTIONS); From nobody Fri Sep 27 22:17:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFlFS1hQgz5XKLq; Fri, 27 Sep 2024 22:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFlFR5bz2z4kqw; Fri, 27 Sep 2024 22:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3v14jfXR3yo7vxEq7PLJ1WjDKLE0S9w/FfPnTxnzd7Y=; b=WmG6iSlf1g+/VZQBG9sFwtumUaaVbJmo3gG0z64jT++bQpwvsKNaS1JKW5bYhD7gOlivme syHfjM0HHHbLRng6OPOVM55vpZno9gN/AQ9+kzfxyStVTjpgHpt2o55oj8iV6w32bMPDwD 5IvIoAqYqIrf7NcWHFL0s2hXa9kfp3qf4/gjzI+SrP12T7ZVS5w1vVOgF2PTtZ9/C3kCFh KjaT+X1ygRFmAkwviIVOa2Hv4b2e2pjb7TiiAyvxd7HDIpQ8EiwxGci8O4jVZCAtpfV1cs PdS/+fvgpIA+88ATEAGKhcE/Vrqi+jSaDojvx75cKOoBXuet6phzJvhdNhyDaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3v14jfXR3yo7vxEq7PLJ1WjDKLE0S9w/FfPnTxnzd7Y=; b=L45fh1d7RAB4aHk3hTKig6al0nyqQpPLFv2mP1cm2C6jjoybd79aXYX6ZcuP34v6z4lSbG 47IEa5DJ4yGoRwR46NB0hcqNWmGiosRB4DppMUSyPwOc0jGBCfC25MhNxBxZTl5XBGgYQ7 DQuq0O/k8QScQqfZt07kWIsBLs7gmg9pmSKAYO0zO65upqo1AjeZmk8whYTms7jPbkR/m7 C7OWVhBFehGPaPevvgoNzwo5njpY0eq3hpTA/WEsFH0567aPoMSUpTcEpvtcgRu1Ez9pIm APPkfYZj52W+P+Tga6nbEU1bmFO/IIT2VqJdvgvdpjbVsjjAO50AoZOWS4nzhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727475435; a=rsa-sha256; cv=none; b=LwYXWe0V0xrDSkQMIpCuh4lBPHo02m0nho4pn/vufSZ8m2lrsctR0uOXrgTNa23pl+RBbh tC0T9KZADox+NV9ifNAkHQdD/YvaqQiKHR9/gZRajZLFMmK6ILr8VtJvfm3KYVULeSqyJ8 Ob4XHckw8NHFv71GsIzKKpBG9Cp4H38/fT1UJ5qSces6zHRD67npcfYp0gv3SGvnVts2We g4Emg8B5SGmLsXxTmiTOcyyYdvmqIo5zYfCUaJQL+kWSGifHfuWY48VYhwuwc7b+ZcPfFv AmyqvjY4OUMgyyG1CEC5T/fy1LxVz4lYWLno+PhWpSfZ3XnEh28xZNpYK56p2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFlFR4J6dzy48; Fri, 27 Sep 2024 22:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RMHFxv039323; Fri, 27 Sep 2024 22:17:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RMHFag039320; Fri, 27 Sep 2024 22:17:15 GMT (envelope-from git) Date: Fri, 27 Sep 2024 22:17:15 GMT Message-Id: <202409272217.48RMHFag039320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f8e994296328 - main - pf: remove ip(6) header argument from pf_reassemble(6)() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8e99429632822cf22a7a0999c00a4a9db1f3702 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8e99429632822cf22a7a0999c00a4a9db1f3702 commit f8e99429632822cf22a7a0999c00a4a9db1f3702 Author: Kristof Provost AuthorDate: 2024-09-11 15:21:09 +0000 Commit: Kristof Provost CommitDate: 2024-09-27 20:13:23 +0000 pf: remove ip(6) header argument from pf_reassemble(6)() Instead of passing the ip header and mbuf to pf_reassemble(), lookup the header address in the mbuf. ok henning@ Reviewed by: zlei Obtained from: OpenBSD, bluhm , 074ee1f915 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46652 --- sys/netpfil/pf/pf_norm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index c4cc482c62f0..d1a1e84db9dc 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -151,10 +151,10 @@ static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); static struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET -static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); +static int pf_reassemble(struct mbuf **, int, u_short *); #endif /* INET */ #ifdef INET6 -static int pf_reassemble6(struct mbuf **, struct ip6_hdr *, +static int pf_reassemble6(struct mbuf **, struct ip6_frag *, uint16_t, uint16_t, u_short *); #endif /* INET6 */ @@ -741,9 +741,10 @@ pf_join_fragment(struct pf_fragment *frag) #ifdef INET static int -pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) +pf_reassemble(struct mbuf **m0, int dir, u_short *reason) { struct mbuf *m = *m0; + struct ip *ip = mtod(m, struct ip *); struct pf_frent *frent; struct pf_fragment *frag; struct pf_fragment_cmp key; @@ -814,10 +815,11 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) #ifdef INET6 static int -pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr, +pf_reassemble6(struct mbuf **m0, struct ip6_frag *fraghdr, uint16_t hdrlen, uint16_t extoff, u_short *reason) { struct mbuf *m = *m0; + struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct pf_frent *frent; struct pf_fragment *frag; struct pf_fragment_cmp key; @@ -1170,7 +1172,7 @@ pf_normalize_ip(struct mbuf **m0, struct pfi_kkif *kif, u_short *reason, * Might return a completely reassembled mbuf, or NULL */ PF_FRAG_LOCK(); DPFPRINTF(("reass frag %d @ %d-%d\n", h->ip_id, fragoff, max)); - verdict = pf_reassemble(m0, h, pd->dir, reason); + verdict = pf_reassemble(m0, pd->dir, reason); PF_FRAG_UNLOCK(); if (verdict != PF_PASS) @@ -1360,7 +1362,7 @@ again: off += sizeof(frag); /* Returns PF_DROP or *m0 is NULL or completely reassembled mbuf. */ - if (pf_reassemble6(m0, h, &frag, off, extoff, reason) != PF_PASS) + if (pf_reassemble6(m0, &frag, off, extoff, reason) != PF_PASS) return (PF_DROP); m = *m0; if (m == NULL) From nobody Fri Sep 27 22:17:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFlFT1ftCz5XK3b; Fri, 27 Sep 2024 22:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFlFS66dkz4kr3; Fri, 27 Sep 2024 22:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9n7JgUGvHyPOalHGG2LkHDBEHjnXsOrUqsXzJGQ7WN8=; b=imAedC2U/Pr7ya/vtzkqytko2+tfySBOs0PucjCWvXZZTeu4NClr4SnzrtNP4nT7+Ta3pY lkOYurg8X30S0cEIVOFCqira+sL9MhTjMBqKulGGQC4b2qfBAPZ1Qq7uRq5cG/4gwlY0JZ zIPqHiq8oeZC+idlxRkLW0JRo9yv4SgrcQaIDrt8pHLBvsYd46dasbHgmQv1hWMDOTUhwC z+y4lTO586d/iKV97C6xjHqpN/N6JCoH0k+V1N0Vb8MKjr26R6Jw5qM32shZqwYGMEc5h6 nwBepwjQFWjYt3s5z92rbBV8Tj+crelFQj1tbKbwpjiEARgRoJZyDE5YYGxcQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9n7JgUGvHyPOalHGG2LkHDBEHjnXsOrUqsXzJGQ7WN8=; b=EGiU87UVPT/Hu8QCfs7BhGZZ11Sb+4mgZbAAaWqOBztY+KGOR0jkIOGkYgh1bW9v5q5dPM a10QuL40EC8HsEy4GOXOd00DRnIS5DgZNm8R2ABWtE4gdwLghvJgk6h9Y+ZbYDbze25jKb LwC2Mb9zBONW0YdsQ8QhZ0KfB6jdRo0070XmKeF21DHAkxvdQ0eiRCPGCPwHsqW3HyIfiL Wx2nsJ34EfZ1JJcS/QQvlYb2vOEsUaG2hr3MG70rEnchSSRX5qlphwntr8xUJUI39xJIyG R0ST7YsoQkeOvxLP2JfvSKJarqcOlYDEoB9tV9j+rXEcL6+a/hpEIKeamYSCgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727475436; a=rsa-sha256; cv=none; b=h56qZiIakYGnhTdSjhu2GcNFSyEgSfR84Kt4pL5SLBlsydb7j3G2mrHYaA5KKtg3GMCp+w Lx9EK5B5QdUFXhdpjnF11DG7X9CoDzp+ZbsBgpWnHBDzCa2hWHLZqYqRHU0fhxovJgVoWQ zWkuqMgo+MBiFjP/aJUSbeuAd3sAqCVum7vjz+cnjgID8+pAfzVQsk24S+SRoU7uMJLZ8h qgtwR2gCdagb95Ebzko/QT35iGPIyDaXslrwoGgnrXqDapjakyb+zQUoj5QCughinJ+j/W na/VAdVI6/dZWojdsXCGtMYgZrgF7xWRxTlGQThF2D83hFO2j46Jm9Qsr4C78w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFlFS4cZvzy8J; Fri, 27 Sep 2024 22:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RMHGix039368; Fri, 27 Sep 2024 22:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RMHGmm039365; Fri, 27 Sep 2024 22:17:16 GMT (envelope-from git) Date: Fri, 27 Sep 2024 22:17:16 GMT Message-Id: <202409272217.48RMHGmm039365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 86fc6f838ed2 - main - pf: make pf_setup_pdesc() a static function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86fc6f838ed2a01f8bffa2cd6437052f450f3370 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=86fc6f838ed2a01f8bffa2cd6437052f450f3370 commit 86fc6f838ed2a01f8bffa2cd6437052f450f3370 Author: Kristof Provost AuthorDate: 2024-09-16 13:24:15 +0000 Commit: Kristof Provost CommitDate: 2024-09-27 20:13:23 +0000 pf: make pf_setup_pdesc() a static function We only ever call it from pf_test(), and implement it in the same source file. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46706 --- sys/net/pfvar.h | 6 ------ sys/netpfil/pf/pf.c | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index f5551447f7aa..3afbabf30d4d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2352,12 +2352,6 @@ VNET_DECLARE(struct pf_krule, pf_default_rule); extern void pf_addrcpy(struct pf_addr *, struct pf_addr *, sa_family_t); void pf_free_rule(struct pf_krule *); -int pf_setup_pdesc(sa_family_t, int, - struct pf_pdesc *, struct mbuf *, - u_short *, u_short *, struct pfi_kkif *, - struct pf_krule **, struct pf_krule **, - struct pf_kruleset **, int *, int *, - struct pf_rule_actions *); int pf_test_eth(int, int, struct ifnet *, struct mbuf **, struct inpcb *); int pf_scan_sctp(struct mbuf *, int, struct pf_pdesc *, struct pfi_kkif *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 823e90384747..1634c856f51f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8555,7 +8555,7 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, return (0); } -int +static int pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, u_short *action, u_short *reason, struct pfi_kkif *kif, struct pf_krule **a, struct pf_krule **r, struct pf_kruleset **ruleset, int *off, int *hdrlen, From nobody Fri Sep 27 23:45:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFnCR5tQFz5XPwP; Fri, 27 Sep 2024 23:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFnCR5LVbz4rKw; Fri, 27 Sep 2024 23:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727480739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dkrrJUJMabSqqSMyRHHcHHSjignACw8ExdNF3PcAiVA=; b=SX9ETz9doOGsGkAbOKke3eX5UDWKXzJ7QtfR086ESvLVoDgAPpwDTvbxVJqG3niJeBlEc3 m8fyZlzZHPpSy5imgGs8Mg6bGOWkXQGFOfVlsGse7Nut+1v0ZEo5qUVxfRHD7hImoQxaUj IpZY+AkiDJwmUqPxDYin/LaCC9tN3WWciGewCZGItgwIqvExDxD+4WObSZheEfygPNhWgr ZEuP51quf9YZJkQ/KUgLHIRnuaWJZpycrbpddQPIhpzJU9ZtcR9laFR4qdUuGWAC0LXEbv mXeWej8ykyatnXryTydEl3oADOgUse7fK5lU+nUZMlb6R6T0jFhshs7AD55HKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727480739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dkrrJUJMabSqqSMyRHHcHHSjignACw8ExdNF3PcAiVA=; b=tIsTtystwJaMMHBC8Tx6IU17pYc/yBv2JDk1U8r5BWx1i9Cq5+YLh9sbOxs/T8Y5EH2DWZ p1QNHkpJsOWrkkKPpq48n/GPZdSb9I6b5fJ9cIkHIKMs0XtNqPHICXl+3e0H8EitBa1rQM wGLMZx38+FDFkcI3H56geOBqUWRWdAq+azMlHJ1GZZtsY6vJ2yjlq0Kfl9cb52tsxK/E0G fJUH1BDbY1XK01gM0/BEihe6EebZdAKHqSBbc/H+ppDE9aLcPSPX+xY/EFoucvV8d83V38 7M2uzVRRCKttlve8yEgKP2JVQj2LBRLAHENj+WSlXWYE7KNQUZVVrg7lLDizCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727480739; a=rsa-sha256; cv=none; b=W2dZ1i8g6tHq7HfHwBiHzFt61a2NoyIOvshVhtV7qWoA08LPYJd8v9jRhTVjyEA28WO2Q3 uOMT0JENYttWLPIDvokNs5pCq+YG9AHo27sCwNIwpNCIAASJMfkv1PwTuqcQZEkGXr1e4D BxPBKNwGwX/XBPgcfHyiJYuc3EEjqUJ3cI4dDgaKNZ1vS+ODLY3FCpdP3z2LivaxrODo+B urkKlR8c/ovWw56MgTOCvpqhbZmnrAmu7+R+iLnMTiUwd1oSyrbBXOA+VJ2zaKBlkkzs46 7YDhluPsd5eirUUDjA/RYS5TCFLCnCWV80XI3SAFwjMILHYhZijv/n/7AHedew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFnCR4qYRz117Y; Fri, 27 Sep 2024 23:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RNjdSf090764; Fri, 27 Sep 2024 23:45:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RNjdmF090761; Fri, 27 Sep 2024 23:45:39 GMT (envelope-from git) Date: Fri, 27 Sep 2024 23:45:39 GMT Message-Id: <202409272345.48RNjdmF090761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b7cbf741d554 - main - libkern: avoid local var in order_base_2() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7cbf741d55468ba34305a14ac3acc1c286af034 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b7cbf741d55468ba34305a14ac3acc1c286af034 commit b7cbf741d55468ba34305a14ac3acc1c286af034 Author: Doug Moore AuthorDate: 2024-09-27 23:43:07 +0000 Commit: Doug Moore CommitDate: 2024-09-27 23:43:07 +0000 libkern: avoid local var in order_base_2() order_base_2(n) is implemented with a variable, which keeps it from being used at file scope. Implement it instead as ilog2(2*n-1), which produces a different result when 2*n overflows, which appears unlikely in practice. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D46826 --- sys/sys/libkern.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 64744f57b5c3..ad64d0fb0a57 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -227,10 +227,7 @@ ilog2_long_long(long long n) #define ilog2(n) (__builtin_constant_p(n) ? ilog2_const(n) : ilog2_var(n)) #define rounddown_pow_of_two(n) ((__typeof(n))1 << ilog2(n)) -#define order_base_2(n) ({ \ - __typeof(n) _n = (n); \ - _n == 1 ? 0 : 1 + ilog2(_n - 1); \ -}) +#define order_base_2(n) ilog2(2*(n)-1) #define roundup_pow_of_two(n) ((__typeof(n))1 << order_base_2(n)) #define bitcount64(x) __bitcount64((uint64_t)(x)) From nobody Sat Sep 28 03:36:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFtKR3fXnz5Xg3y; Sat, 28 Sep 2024 03:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFtKR2vQzz4Pv5; Sat, 28 Sep 2024 03:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727494571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgHjJFVjbtK0SKakzFQXk4g+3ZRP9FoN5/X0wmGaZ0U=; b=UOkA+RbY+SghqCXoTvApWIK1LEyGqPVwOMVuDH5Kt49jQJyuVxG/qRBs1ucAPct1ZsdrJu QK00Id2PiZNMrxD0zvYNhXT45qy0N2VtMDAAPJAbvWe1Yb8tZsA8abv1yA5+Ey9NzKH0A+ tdB2aNyJo/lzgQ/XTVAC1wjIXhP6jbySzWHMm9jwQkVTlT5DTXkdrQsl+T/BEgEVm7uf2Q dddcfGMyTNsLMT2pEDIDcl9fVD/46Ac62lfylX74EUalh+oGQK0AJuWBbc7hJiofRxbCf8 9G0sg2Knff+vW5sz8W0BG4QHdmTjs5ecQ/V2FHDH+N514MkCbD1GJfjle4lvTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727494571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgHjJFVjbtK0SKakzFQXk4g+3ZRP9FoN5/X0wmGaZ0U=; b=aOv857czi8g5kIwcdLcK5OCKjpLvQ5rH1XR9VKPDVmrban6ZpRXwb1DfxuDPS3QUzeYPSB U/qLVFoA/jiKH/tAawdoAzRvyN9G2vVy2Zvc1e8gonI95vmIYBdTC4JVf6HT3HnZjCGiPI A4mUXOUp4xnQB1i9eoGWD1jiFLDU2WSqpidm8oQziskk02nqZZV6omVmT45B4uZocO/jsq fEvIh7GpQPNnOGrdqwxZClRCBsUAI8THOui2cGJz9NEQZkyTC1FOmwg8RnJi9BeaMweByY vnjaBBKygDf/GkXCytTxG9XLmTcfeUuXWj4kT+DxLarIfAgicMQk4XYafdbC+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727494571; a=rsa-sha256; cv=none; b=GxGdQKj3aIpJzxuqnhWUrro70hXBTqA3aQ2lJURwi8i9VPJjBee9J6uL3reEhcq9jcMp77 bzljFFp1SR68A6/X6gUBXolYIgeEITtfVBJaK1O092gPNLT6aMVITA9ygJO9z0dZNmOOZo r1ESiCcPIU6rJGvI5q/JPnZb4FVi5rugg5n8WOzLalBqO7ENR7csSGwYp2keRoLf2qSWrd iM10he7zbAiqgA2frS+tVHqM0n85Ty8d4rXYuxxbeIVpoycUG8MN6WaMwQV3Zz1UZvfI1Q 8RamE04BCAqvioTHv28PR7gwGxe5+jb2hZPSX7ar4hf+Um2IEoZMZztZhVECWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFtKR2WWFz17F6; Sat, 28 Sep 2024 03:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48S3aBq3082238; Sat, 28 Sep 2024 03:36:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48S3aBJM082235; Sat, 28 Sep 2024 03:36:11 GMT (envelope-from git) Date: Sat, 28 Sep 2024 03:36:11 GMT Message-Id: <202409280336.48S3aBJM082235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 26439b57877c - main - e1000: Remove redundant EITR shift from igb List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26439b57877ccae7a2404f7d179afaa5ddb2f64d Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=26439b57877ccae7a2404f7d179afaa5ddb2f64d commit 26439b57877ccae7a2404f7d179afaa5ddb2f64d Author: Kevin Bowling AuthorDate: 2024-09-28 03:34:18 +0000 Commit: Kevin Bowling CommitDate: 2024-09-28 03:36:00 +0000 e1000: Remove redundant EITR shift from igb The E1000_EITR() macro is already multiplying by 0x4 which is the same as this shift, so we were shifting more than expected. MFC after: 6 days Sponsored by: BBOX.io --- sys/dev/e1000/if_em.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 7219dc57c333..83a0d4e96fc6 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -251,8 +251,7 @@ #define IGB_ITR_DIVIDEND 1000000 #define IGB_ITR_SHIFT 2 #define IGB_QVECTOR_MASK 0x7FFC -#define IGB_INTS_TO_EITR(i) (((IGB_ITR_DIVIDEND/i) & IGB_QVECTOR_MASK) << \ - IGB_ITR_SHIFT) +#define IGB_INTS_TO_EITR(i) ((IGB_ITR_DIVIDEND/i) & IGB_QVECTOR_MASK) #define IGB_LINK_ITR 2000 #define I210_LINK_DELAY 1000 From nobody Sat Sep 28 08:49:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XG1Gj4gZPz5Y13r; Sat, 28 Sep 2024 08:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XG1Gj3JNjz4m7t; Sat, 28 Sep 2024 08:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727513357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umV9laZPhDpD2h8Aauu/lwqWLds7hpH2T+vVXx595Bc=; b=PD3nyO/7QukxH1/Kd5fCE43A/fidTyqWRNpGkF/ctkH+BbWm+04P7OelToW3ljozQq3biL DoDKlt+7+2w0M/CqRDoegFu+w5sq6AxQWut0yzsxbSfrfDTmgZfMYYg3GXZWVB2YbXPZtH m972vB/dMF0J9n9vZcmuCqoq4Tu6AjYMQxeXp3Rv7ML2ybR7/oh44hXN8R43U3deKLO3Dc zrcIL9/AdEFShwwpTqVOiF92opBbXIp//GCUrv+gTYdzvr92fvpOAEQauSb6exo+rf4jBi lWR0Mq0VrJS/8aN1qXuvK4gC0lKzm2lr8eJUEl8vSz0yuD86NK642dldbV4TbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727513357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umV9laZPhDpD2h8Aauu/lwqWLds7hpH2T+vVXx595Bc=; b=oIwnPRJNQBws4ain3Rr1Ga/PDLJF5e5fuZwO4a5fNfCjktyAHGvrDjEXFIPWL3z9ocRSng ZDooshi0T7A6o8huJGMX8SR+IpnDXnjipTLLBU+hAx3pGi77MBo84odSbT8Hh/5eURUkMm GVPX8WRJEhbZcZg/hiIEc68amNF7Ib7RO5Vtou3ZZd8pc3h9udJUJHr06n+1A8C+8z25BX WLqwAewwyPuto0WO9rkNuUUktZfD8o2wKnKMm+dKuLLAY9x91cMk8NAlErRMoAFsva+CwA N5+DyBV+bbpTv5Zzsrl3Ce0FrwY9YhWM1CPr3aJ9ZSzlrZKfzQdk4CWAjSST/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727513357; a=rsa-sha256; cv=none; b=M07Liln2YH/mHWeuQs9tAaiaQdMEX4DNgHHGh3LLtrt48BibO4XpCUt7QkWz0G6Q+byQGt AwneE65go8udLkVqzhUYGR6MjYXtANwYVEI7ppscvPMC3DF/rtcSQPcrM8C9C8Q2soK/7x e9xU/S/kLh6wfUyuF4SY1rvCX74MtGrvteJGTJFo7nRfqrpzi27jNp+KeKOD5MXTqgWl+a kAbFWIygzYJAOxt7/WxbW8LXWFsOo8p5XsVulAnNhbtVlsIyMyUSfB1TMAHBD+m7pIZzPO NfhHbLbdyYmYHlht4F9xRk1XYNCw+Sm1lE1u8pjRgIJm+psXGBglRE76UQfFBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XG1Gj2Z0FzJ0l; Sat, 28 Sep 2024 08:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48S8nHWs009015; Sat, 28 Sep 2024 08:49:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48S8nHTo009012; Sat, 28 Sep 2024 08:49:17 GMT (envelope-from git) Date: Sat, 28 Sep 2024 08:49:17 GMT Message-Id: <202409280849.48S8nHTo009012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Osipov Subject: git: 38c63b52830c - main - dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38c63b52830c85013f30bc62b2b32f3936d84e65 Auto-Submitted: auto-generated The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=38c63b52830c85013f30bc62b2b32f3936d84e65 commit 38c63b52830c85013f30bc62b2b32f3936d84e65 Author: Michael Osipov AuthorDate: 2024-09-23 12:37:34 +0000 Commit: Michael Osipov CommitDate: 2024-09-28 08:49:02 +0000 dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925 Ignore DHCP options 124 and 125 to shut up the warning messages. These options are defined in the RFC 3925. PR: 281361 Reviewed by: jrm (mentor), otis (mentor), thj Tested by: jlduran@gmail.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46760 --- sbin/dhclient/dhclient.c | 2 ++ sbin/dhclient/dhcp.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 4a674cec5888..93988d5ce7a4 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -2641,6 +2641,8 @@ check_option(struct client_lease *l, int option) case DHO_DHCP_USER_CLASS_ID: case DHO_URL: case DHO_SIP_SERVERS: + case DHO_V_I_VENDOR_CLASS: + case DHO_V_I_VENDOR_OPTS: case DHO_END: return (1); case DHO_CLASSLESS_ROUTES: diff --git a/sbin/dhclient/dhcp.h b/sbin/dhclient/dhcp.h index 99b69613934f..02ea42a66079 100644 --- a/sbin/dhclient/dhcp.h +++ b/sbin/dhclient/dhcp.h @@ -174,6 +174,8 @@ struct dhcp_packet { #define DHO_DOMAIN_SEARCH 119 #define DHO_SIP_SERVERS 120 #define DHO_CLASSLESS_ROUTES 121 +#define DHO_V_I_VENDOR_CLASS 124 +#define DHO_V_I_VENDOR_OPTS 125 #define DHO_END 255 /* DHCP message types. */ From nobody Sat Sep 28 09:12:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XG1n44Yb6z5Y2RK; Sat, 28 Sep 2024 09:12:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XG1n444Jhz4pH1; Sat, 28 Sep 2024 09:12:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727514728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uBOaRnHOqR1MBLzy9n4x+x2icRUIXsHvgR49Ic2V91I=; b=y4qB4LaIRWh89gfW6N0UW3SDPRGHxVCiICOEUexUk+5IEN0URWrPx1fLVKWSq0az4SrFSB eE0BiJMb8HiIJG6ACiWJ8mCb9Y8Hi29AnocwMDS/5jHu1rOn8pJlE+b58ME7rrD6xMkywJ sAD55/c5j1RAInx52e4E+pONLPXFIH1TJujSpuu1R1yR16fwW4CNJDwc9M7QnI4lnf6bDH raU3Yb5gfYszSTAA9oR1l4/MvDvjMfbMXaVpXqJtO10u2tDK7wCUFV8sCUW4GGdAHo/CnN r/8ZTU57+tXUM0ghh/ZjRcg399Dgks5FfkxWJyvDLIf57Hi4OUqF1cS4pE4dbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727514728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uBOaRnHOqR1MBLzy9n4x+x2icRUIXsHvgR49Ic2V91I=; b=sjxLin2pzxMYyWkGBPVqattIgbOJ17Hwjr5459oAnyo1N0GSK1ZU4A+q4isJyHP5U5/LmO Od2iUSqS46dFEJvMic3CdXYBBl9xlx0StGfhmWtAoOA6qaZjKWZw84LMiO4rx5z/Eq9crO nqRY9Nl4xtsQ6nWlRwsVOT5H8VeHaai4bX62PCL5gQvJq6HwQ4JL12Ze010IHGCIi5hhca yyyNeubKRICNiPqLJqVbhR5Vs2nZm0UDxhf4oTwz3QctrOmFdsIxY+APYCrb9QRQdK/oiL VJlp6UFvmoa/PxlwmlP3L7fsfdgD1JXN21ap77CzCuGyewUCx0w1FAqlKvZDYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727514728; a=rsa-sha256; cv=none; b=J8+chTtE0gMGOBPmeQb5d4GwF2l+4INgtizP91BdeDiBos18JYnnjH6wc5WjKChWmOkpnp I4ETz7wVArFdjyk6JIB4TP3gQYSKHHkpD/2WmL5vMCBz/tGQBmwYuSWCTMErx7tX67kh5T NW9dp5vFOyIoH9lLWxHNpmETRG96bGmNu8p07PVdFMTmnqA7q2JYnJj5FF2LbMNV5HGeYi jTF4LA4NW7y9yG0OKkdUEItp37aadV/vZyFKq26UMkcm9q0p6xHwT/KQcbdeI4CC2Na1Lu kDuTq6QjGD78351AqeMT3YYeT6VsYA2qMRRbSH9/YSvlA/rc2wQpHSm3jjkJLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XG1n43Zy3zJGH; Sat, 28 Sep 2024 09:12:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48S9C8SM057605; Sat, 28 Sep 2024 09:12:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48S9C8Tx057602; Sat, 28 Sep 2024 09:12:08 GMT (envelope-from git) Date: Sat, 28 Sep 2024 09:12:08 GMT Message-Id: <202409280912.48S9C8Tx057602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 911b3c3aa648 - main - Revert "e1000: Remove redundant EITR shift from igb" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 911b3c3aa6484709f7a6020f1f25ab24737296ce Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=911b3c3aa6484709f7a6020f1f25ab24737296ce commit 911b3c3aa6484709f7a6020f1f25ab24737296ce Author: Kevin Bowling AuthorDate: 2024-09-28 08:47:00 +0000 Commit: Kevin Bowling CommitDate: 2024-09-28 09:11:55 +0000 Revert "e1000: Remove redundant EITR shift from igb" Turns out this is necessary This reverts commit 26439b57877ccae7a2404f7d179afaa5ddb2f64d. --- sys/dev/e1000/if_em.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 83a0d4e96fc6..7219dc57c333 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -251,7 +251,8 @@ #define IGB_ITR_DIVIDEND 1000000 #define IGB_ITR_SHIFT 2 #define IGB_QVECTOR_MASK 0x7FFC -#define IGB_INTS_TO_EITR(i) ((IGB_ITR_DIVIDEND/i) & IGB_QVECTOR_MASK) +#define IGB_INTS_TO_EITR(i) (((IGB_ITR_DIVIDEND/i) & IGB_QVECTOR_MASK) << \ + IGB_ITR_SHIFT) #define IGB_LINK_ITR 2000 #define I210_LINK_DELAY 1000 From nobody Sat Sep 28 14:24:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XG8jP5wFjz5XQN1; Sat, 28 Sep 2024 14:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XG8jP5Q1mz4Yy7; Sat, 28 Sep 2024 14:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727533465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bgxC9JdmKdpLf3C4gr40a2k0DegxmsNqFwHXlB/rqFk=; b=TFpnygnZc+cWdLsOOYOZO+n+XyrpbLg3HILP0gDszxEKGcdIyCZ+8d0GrTXNFenNApDMjH U4pllb56/Z/M0r9sRhrC0huRh0zTFa4lgeIgpwTqxKpMo/ojlIssTzOvoD8kOngq41G1hp kK3JR+Ma70O5s82xl3OUjlfZ1vsyVd4URkFg+pNNuw1jBriYyHEzfNHcakQU80dG884R/b 1bqzqwIK6tDBMHqAqRXlfXfXyjw+jbFzUXQUuck5O9bEff5Lw0u73silN5NcoV64LGYL+Q JFPTlokCAj1H/NdAV/duIh2eTsVavyDkCEaWCOZ6gViiUxpGTN9KYPBed0aJow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727533465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bgxC9JdmKdpLf3C4gr40a2k0DegxmsNqFwHXlB/rqFk=; b=cH6sBjK/HgQPqo8KtP8G6R6z9O05/waKr+MjKi9JuorXcOe0SAC3oiOQz01ldVupITrAJs njzF20MwQ5AXyn4uW1QKfmsvdJ2JQbjRuIoK4shj47hgQuk9MzEMquNB6yEXPzJkA7nRvj DJ58/Jz+ghLG/ywX52b3jZghHJTadASqbbsbhMWDnARmXmuWmswKaI1z1y4FwUBzBnxoFD D8CjtfHrTjUzjKsWtvhGJaxkRxFafc7QgfSOjYxpGJEPFcA1h7XH7WnBlLKrozNsGW2Yr8 78XUce1cM8Pl18I48GgNyzIyehx8XTMznjcPFHahNTln2Pra1tJXQPWcuzfkmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727533465; a=rsa-sha256; cv=none; b=wpJn3ng4VdS0e3P5RwgfsbXkZZyFjUjaALQLEu+gLFQTUkwl4DPn7BdZJD7hQEReoNkjcq HAj2fDPKQQEVApKsTxfpJ9p+fVI8JFBOaSm7VvHvphBx8QEXx7jRvPUZiipKnB0JrhQCOI fVOXIcpxv6e2Noe9Y8m8W5vavpl3iYrZ4xx/F6edzK5j3Vi186wxDwWSce5fFffyHt8LEY aiy9IUNnoPKMEOJHzZo/Hmf+/T62MwIM70HkiisK00RDQADVV9Q2oo6xpm5D2xeLipWf0k rEvOxK2/W6ZM8BlZvrPxCWOlWJcNYnIwGtceFJXYMz17PN1wucUofY4TU5Djmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XG8jP4vWJzShV; Sat, 28 Sep 2024 14:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SEOPMt088440; Sat, 28 Sep 2024 14:24:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SEOPHu088437; Sat, 28 Sep 2024 14:24:25 GMT (envelope-from git) Date: Sat, 28 Sep 2024 14:24:25 GMT Message-Id: <202409281424.48SEOPHu088437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: ffd294a1f4c2 - main - MFV: expat 2.6.3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffd294a1f4c23863c3e515d16dce31d5509bcb01 Auto-Submitted: auto-generated The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=ffd294a1f4c23863c3e515d16dce31d5509bcb01 commit ffd294a1f4c23863c3e515d16dce31d5509bcb01 Merge: 911b3c3aa648 8e1eae2319cd Author: Enji Cooper AuthorDate: 2024-09-28 14:19:59 +0000 Commit: Enji Cooper CommitDate: 2024-09-28 14:19:59 +0000 MFV: expat 2.6.3 The 2.6.1 - 2.6.3 releases address several security issues with the library. The release notes for the 2.6.1-2.6.3 releases can be found at https://github.com/libexpat/libexpat/blob/R_2_6_3/expat/Changes . MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46829 Merge commit '8e1eae2319cd3a651941c88b46d95e8ee8507c6c' contrib/expat/Changes | 136 ++++++++++++++++++- contrib/expat/Makefile.am | 6 +- contrib/expat/Makefile.in | 8 +- contrib/expat/README.md | 14 +- contrib/expat/buildconf.sh | 24 +--- contrib/expat/configure.ac | 39 ++++-- contrib/expat/doc/Makefile.am | 21 ++- contrib/expat/doc/Makefile.in | 58 ++++----- contrib/expat/doc/reference.html | 19 ++- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/examples/Makefile.in | 2 +- contrib/expat/expat_config.h.in | 3 - contrib/expat/fix-xmltest-log.sh | 12 +- contrib/expat/lib/Makefile.am | 19 +-- contrib/expat/lib/Makefile.in | 79 ++++++++---- contrib/expat/lib/expat.h | 5 +- contrib/expat/lib/internal.h | 17 ++- contrib/expat/lib/siphash.h | 3 +- contrib/expat/lib/xmlparse.c | 73 ++++++++--- contrib/expat/tests/Makefile.am | 11 +- contrib/expat/tests/Makefile.in | 19 +-- contrib/expat/tests/README.md | 11 ++ contrib/expat/tests/README.txt | 13 -- contrib/expat/tests/acc_tests.c | 59 +++++++++ contrib/expat/tests/basic_tests.c | 208 ++++++++++++++++++++---------- contrib/expat/tests/benchmark/Makefile.in | 2 +- contrib/expat/tests/misc_tests.c | 2 +- contrib/expat/xmlwf/Makefile.in | 2 +- 29 files changed, 605 insertions(+), 264 deletions(-) diff --cc contrib/expat/README.md index 43c4f4f3dbb3,000000000000..180a68e4abbe mode 100644,000000..100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@@ -1,270 -1,0 +1,276 @@@ +[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) +[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) +[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) +[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) + ++> [!CAUTION] ++> ++> Expat is **understaffed** and without funding. ++> There is a [call for help with details](https://github.com/libexpat/libexpat/blob/master/expat/Changes) ++> at the top of the `Changes` file. + - # Expat, Release 2.6.0 ++ ++# Expat, Release 2.6.3 + +This is Expat, a C99 library for parsing +[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by +[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997. +Expat is a stream-oriented XML parser. This means that you register +handlers with the parser before starting the parse. These handlers +are called when the parser discovers the associated structures in the +document being parsed. A start tag is an example of the kind of +structures for which you may register handlers. + +Expat supports the following compilers: + +- GNU GCC >=4.5 +- LLVM Clang >=3.5 - - Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`) ++- Microsoft Visual Studio >=16.0/2019 (rolling `${today} minus 5 years`) + +Windows users can use the +[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases), +which includes both pre-compiled libraries and executables, and source code for +developers. + +Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html). +You may copy, distribute, and modify it under the terms of the License +contained in the file +[`COPYING`](https://github.com/libexpat/libexpat/blob/master/expat/COPYING) +distributed with this package. +This license is the same as the MIT/X Consortium license. + + +## Using libexpat in your CMake-Based Project + +There are two ways of using libexpat with CMake: + +### a) Module Mode + +This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html). + +Notice the *uppercase* `EXPAT` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) # or 3.10, see below + +project(hello VERSION 1.0.0) + +find_package(EXPAT 2.2.8 MODULE REQUIRED) + +add_executable(hello + hello.c +) + +# a) for CMake >=3.10 (see CMake's FindEXPAT docs) +target_link_libraries(hello PUBLIC EXPAT::EXPAT) + +# b) for CMake >=3.0 +target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS}) +target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES}) +``` + +### b) Config Mode + +This approach requires files from… + +- libexpat >=2.2.8 where packaging uses the CMake build system +or +- libexpat >=2.3.0 where packaging uses the GNU Autotools build system + on Linux +or +- libexpat >=2.4.0 where packaging uses the GNU Autotools build system + on macOS or MinGW. + +Notice the *lowercase* `expat` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) + +project(hello VERSION 1.0.0) + +find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat::expat) +``` + + +## Building from a Git Clone + +If you are building Expat from a check-out from the +[Git repository](https://github.com/libexpat/libexpat/), +you need to run a script that generates the configure script using the +GNU autoconf and libtool tools. To do this, you need to have +autoconf 2.58 or newer. Run the script like this: + +```console +./buildconf.sh +``` + +Once this has been done, follow the same instructions as for building +from a source distribution. + + +## Building from a Source Distribution + +### a) Building with the configure script (i.e. GNU Autotools) + +To build Expat from a source distribution, you first run the +configuration shell script in the top level distribution directory: + +```console +./configure +``` + +There are many options which you may provide to configure (which you +can discover by running configure with the `--help` option). But the +one of most interest is the one that sets the installation directory. +By default, the configure script will set things up to install +libexpat into `/usr/local/lib`, `expat.h` into `/usr/local/include`, and +`xmlwf` into `/usr/local/bin`. If, for example, you'd prefer to install +into `/home/me/mystuff/lib`, `/home/me/mystuff/include`, and +`/home/me/mystuff/bin`, you can tell `configure` about that with: + +```console +./configure --prefix=/home/me/mystuff +``` + +Another interesting option is to enable 64-bit integer support for +line and column numbers and the over-all byte index: + +```console +./configure CPPFLAGS=-DXML_LARGE_SIZE +``` + +However, such a modification would be a breaking change to the ABI +and is therefore not recommended for general use — e.g. as part of +a Linux distribution — but rather for builds with special requirements. + +After running the configure script, the `make` command will build +things and `make install` will install things into their proper +location. Have a look at the `Makefile` to learn about additional +`make` options. Note that you need to have write permission into +the directories into which things will be installed. + +If you are interested in building Expat to provide document +information in UTF-16 encoding rather than the default UTF-8, follow +these instructions (after having run `make distclean`). +Please note that we configure with `--without-xmlwf` as xmlwf does not +support this mode of compilation (yet): + +1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name: +
- `find -name Makefile.am -exec sed ++ `find . -name Makefile.am -exec sed + -e 's,libexpat\.la,libexpatw.la,' + -e 's,libexpat_la,libexpatw_la,' - -i {} +` ++ -i.bak {} +` + +1. Run `automake` to re-write `Makefile.in` files:
+ `automake` + +1. For UTF-16 output as unsigned short (and version/error strings as char), + run:
+ `./configure CPPFLAGS=-DXML_UNICODE --without-xmlwf`
+ For UTF-16 output as `wchar_t` (incl. version/error strings), run:
+ `./configure CFLAGS="-g -O2 -fshort-wchar" CPPFLAGS=-DXML_UNICODE_WCHAR_T + --without-xmlwf` +
Note: The latter requires libc compiled with `-fshort-wchar`, as well. + +1. Run `make` (which excludes xmlwf). + +1. Run `make install` (again, excludes xmlwf). + +Using `DESTDIR` is supported. It works as follows: + +```console +make install DESTDIR=/path/to/image +``` + +overrides the in-makefile set `DESTDIR`, because variable-setting priority is + +1. commandline +1. in-makefile +1. environment + +Note: This only applies to the Expat library itself, building UTF-16 versions +of xmlwf and the tests is currently not supported. + +When using Expat with a project using autoconf for configuration, you +can use the probing macro in `conftools/expat.m4` to determine how to +include Expat. See the comments at the top of that file for more +information. + +A reference manual is available in the file `doc/reference.html` in this +distribution. + + +### b) Building with CMake + +The CMake build system is still *experimental* and may replace the primary +build system based on GNU Autotools at some point when it is ready. + + +#### Available Options + +For an idea of the available (non-advanced) options for building with CMake: + +```console +# rm -f CMakeCache.txt ; cmake -D_EXPAT_HELP=ON -LH . | grep -B1 ':.*=' | sed 's,^--$,,' +// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ... +CMAKE_BUILD_TYPE:STRING= + +// Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +// Path to a program. +DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man + +// Build man page for xmlwf +EXPAT_BUILD_DOCS:BOOL=ON + +// Build the examples for expat library +EXPAT_BUILD_EXAMPLES:BOOL=ON + +// Build fuzzers for the expat library +EXPAT_BUILD_FUZZERS:BOOL=OFF + +// Build pkg-config file +EXPAT_BUILD_PKGCONFIG:BOOL=ON + +// Build the tests for expat library +EXPAT_BUILD_TESTS:BOOL=ON + +// Build the xmlwf tool for expat library +EXPAT_BUILD_TOOLS:BOOL=ON + +// Character type to use (char|ushort|wchar_t) [default=char] +EXPAT_CHAR_TYPE:STRING=char + +// Install expat files in cmake install target +EXPAT_ENABLE_INSTALL:BOOL=ON + +// Use /MT flag (static CRT) when compiling in MSVC +EXPAT_MSVC_STATIC_CRT:BOOL=OFF + +// Build fuzzers via ossfuzz for the expat library +EXPAT_OSSFUZZ_BUILD:BOOL=OFF + +// Build a shared expat library +EXPAT_SHARED_LIBS:BOOL=ON + +// Treat all compiler warnings as errors +EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF + +// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO] +EXPAT_WITH_GETRANDOM:STRING=AUTO + +// Utilize libbsd (for arc4random_buf) +EXPAT_WITH_LIBBSD:BOOL=OFF + +// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO] +EXPAT_WITH_SYS_GETRANDOM:STRING=AUTO +``` diff --cc contrib/expat/tests/README.md index 000000000000,010ca95e9e21..010ca95e9e21 mode 000000,100644..100644 --- a/contrib/expat/tests/README.md +++ b/contrib/expat/tests/README.md From nobody Sat Sep 28 14:24:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XG8jQ73LVz5XQ4P; Sat, 28 Sep 2024 14:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XG8jQ64f5z4YyD; Sat, 28 Sep 2024 14:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727533466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Gd2QsfGavkF+lBpDXAIAjDqby1xgbU6NBY4Fw3Ob1E=; b=Gohw9yTAJBz9159gHqapjWIC+wdjbuuJljcO9Gd8zQ6d28AVm9EKbG9ajTAXcFB5vqK45C B7/BdSYuEpdkxf+xikHAOM/Gy+8Wuz+wZt58DbJ9+mXTVeeL1xX7RmFc8plQUf/tjH69gL dJbbnqt08gI1gTEZ+19BTG7wfXaDxXPMyUGFpu8ZMyhenqvGV4HDWWE2688V82mFLC6b/c 8n5/1g3GYB2cTOB7k+DfR1wV64c/HOXh1P6H7cjAeAcn5ZhIb36MzZSTV5YtiZTGo67SG+ crzULFfdhttJEYgJ+QDAQk+E944BAD+oacd9t9j+znN+jwWpPZB1tA1e0z4jfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727533466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Gd2QsfGavkF+lBpDXAIAjDqby1xgbU6NBY4Fw3Ob1E=; b=jbI1+6IjOvWCfKVcrN3WDEPzyZfyJUpUAprfjFZOEn04h3e8YKDCh9Dk0DIvP5qSrvEUd6 MYLG3tzt6yxRwYBmHXToxdAPLPyjBJ9+vx1nIQr+52P2HA9kLT4nNPBxuKzEd7sN18nRIY +vNJT55OyIC5dl/AEJBrY5h/GOy27RzFEZ3C+8RwCcGluJ3Av0kVbSpS3srxOMBUXg872t m5O590w/YA/59swee7bkkLkh42sH4nk//hUKhzhIJmuZBMUcbWiLk1dFeR3+H9Db1QxGDd UCGRL01UVONYQuaNKmcK+tfsB9UJzQ+rdZcoa+oWQDJpRIxK6xL0uNYgIr8Fnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727533466; a=rsa-sha256; cv=none; b=AMSPUio9Qfc3v2WlRPrx3E2BacanLziacpAIvTB49QpuSDcUkhnAnENF5pkgnV7J4n/OEV rG4qBi2lBaj2R4TXt9a19bbCKCgCtfJlke6SbjOWIK88WzmYEOTqLwXElsqfeazsfGtc5G jT+izctk5Q7EMzgpB09Q6I4fHfoaq2lfWBlPT9YREEMRM7+TimsfHebzKv18RLKeOwow5y mJGpQK72zGCCBSpeXl3bH8alNbdAvmIHTS+WBzDHln/qxEJ/NEEt/3pWVEuPaA/OCMUiJ6 +JELKSSb5AWUwETmldvfTZxAS0eGJGwKkrTKgu7FXRKbJOegmy/Uk2ZDN4mKWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XG8jQ5bqnzScN; Sat, 28 Sep 2024 14:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SEOQJw088492; Sat, 28 Sep 2024 14:24:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SEOQep088489; Sat, 28 Sep 2024 14:24:26 GMT (envelope-from git) Date: Sat, 28 Sep 2024 14:24:26 GMT Message-Id: <202409281424.48SEOQep088489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: c284f45dc796 - main - lib/libexpat: update build config for 2.6.3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c284f45dc796693ef63ccb38df361968b733e294 Auto-Submitted: auto-generated The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=c284f45dc796693ef63ccb38df361968b733e294 commit c284f45dc796693ef63ccb38df361968b733e294 Author: Enji Cooper AuthorDate: 2024-09-28 14:22:11 +0000 Commit: Enji Cooper CommitDate: 2024-09-28 14:23:32 +0000 lib/libexpat: update build config for 2.6.3 MFC after: 1 week MFC with: ffd294a1f4c23863c3e515d16dce31d5509bcb01 Differential Revision: https://reviews.freebsd.org/D46830 --- lib/libexpat/expat_config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h index 0d581a431a53..5d39aeb2e870 100644 --- a/lib/libexpat/expat_config.h +++ b/lib/libexpat/expat_config.h @@ -89,7 +89,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.6.0" +#define PACKAGE_STRING "expat 2.6.3" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -98,7 +98,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.6.0" +#define PACKAGE_VERSION "2.6.3" /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -106,7 +106,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.6.0" +#define VERSION "2.6.3" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ From nobody Sat Sep 28 16:55:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGD3Y1g87z5XZtt; Sat, 28 Sep 2024 16:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGD3Y1P3rz4qfw; Sat, 28 Sep 2024 16:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727542521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sFS6kiZ8Hh8VBLJIBlyJtF+l1AnY32HRgEMdIj85tf0=; b=msN/fn6E9gkyrtGK0xZEzd7/YJnoP79KNMU5JkJCqnY7PaKeKn8DlUftJMdN/aBuGQ5F6A YY3oDnIaKlmsvOk0wdIl4m8XCLOjJHp3PQEwmTJCk9Jar2e8DtT6zSGKLuBnSygreZZ4vg TtqvGQ5NwsrPKNGdyGZjOpbKTYzI6RV6WKGLVefM48dFj0mQOpEiXp8wyTlWNCscvvikBS PIzB6C7jP2Jd37sqz9VBQTKk06SoP8wFDn3ubrw6BZvUbh771kj/mJlz7X5z3jXAp5hfrs Yz4CnfnkZEr75bvYzqxCMVjLMJlCUpzBONSyZmuFTAurtqXcO0/oqW2MyVv3dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727542521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sFS6kiZ8Hh8VBLJIBlyJtF+l1AnY32HRgEMdIj85tf0=; b=VT5iQXTKTknUwC0gS8rwX+1Tylfsz5BksFOr204LachDHY+8UWCYHkNriIO2bRCxvML624 K3dzFkBPnciR3CGGhqWGGDLU1rlhc1ofMLWHIM+RgGput6sDl7D98zBIiTQQS6mdbyKpde f0jq3AEh+I7LKCQUHCeN8NLIRc7HvZvHNIk29KSaZE7ZIInkOVXrjmC0h7E+ZBHNYJbhr4 KaVPjg2UfFtafA0Wcfr65G04wwykgnQLbIwgJA5LQAvp/5Q4213dj1cj5ve4WH33tbAP3D n5v0RHQFfUHN4I7z9aj8Y3+wl6ohpiBRTeg3NxzHLVHu60SVRDlKU6EWW4c+/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727542521; a=rsa-sha256; cv=none; b=B2DV+RJIZ+8aw2KEsqvLD3kdHEfQzlgKLhfnzhGQkvVQcf9eaNU7k8BUsBRmx7qkf/FnHV iZXcHJmnZUvAb3ZKyKaVx2lMq+/UVOyj1+e8Qgi/NaMsRy2EH3RGTEltjhiH5jpoKjMWQT g5JLbhit5WT3ag1ltgw0AWV+o0Pyqrl2ydRr+ukNNpaG6XMYkF7qAqk84j9E8H1OJtCbTa NQFrENVU3SNvoyqrwGBjaEFxGpwTOknZWHyVald5aLNigvhEH2egA5Bx9ZCsS8fbi0QjnU UaT4+B2cdVX4PqoQh/uRs8Je9BxUM/Qr0xL5Yx+2vUH411VwZbF0wZyOTjOD6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGD3Y0smwzYlb; Sat, 28 Sep 2024 16:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SGtL0r042281; Sat, 28 Sep 2024 16:55:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SGtLkk042278; Sat, 28 Sep 2024 16:55:21 GMT (envelope-from git) Date: Sat, 28 Sep 2024 16:55:21 GMT Message-Id: <202409281655.48SGtLkk042278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6ffd4aeba5b9 - main - pf tests: add a test for max-src-conn List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ffd4aeba5b997c4c538711d259200da193d949d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6ffd4aeba5b997c4c538711d259200da193d949d commit 6ffd4aeba5b997c4c538711d259200da193d949d Author: Kajetan Staszkiewicz AuthorDate: 2024-09-28 13:37:45 +0000 Commit: Kristof Provost CommitDate: 2024-09-28 16:54:50 +0000 pf tests: add a test for max-src-conn Switch tests using pft_ping.py to inetd. Netcat can only accept a single connection, we need multiple parallel connections to test max-src-conn. Use the discard service and modify pft_ping.py to use proper port number. Implement functionality of 3-way handshake test in pft_ping.py. Make send_params accessible to sniffer, because answers to SYN+ACK packets should be send with the same parameters as the original SYN packet. Finally add a test for max-src-conn and overload. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46798 --- tests/sys/netpfil/common/pft_ping.py | 185 +++++++++++++++++++++++++++-------- tests/sys/netpfil/pf/src_track.sh | 62 ++++++++++++ tests/sys/netpfil/pf/utils.subr | 10 +- 3 files changed, 210 insertions(+), 47 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index befe757406be..d8aafc884265 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -49,8 +49,17 @@ def build_payload(l): return ret -def prepare_ipv6(dst_address, send_params): +def clean_params(params): + # Prepare a copy of safe copy of params + ret = copy(params) + ret.pop('src_address') + ret.pop('dst_address') + ret.pop('flags') + return ret + +def prepare_ipv6(send_params): src_address = send_params.get('src_address') + dst_address = send_params.get('dst_address') hlim = send_params.get('hlim') tc = send_params.get('tc') ip6 = sp.IPv6(dst=dst_address) @@ -63,8 +72,9 @@ def prepare_ipv6(dst_address, send_params): return ip6 -def prepare_ipv4(dst_address, send_params): +def prepare_ipv4(send_params): src_address = send_params.get('src_address') + dst_address = send_params.get('dst_address') flags = send_params.get('flags') tos = send_params.get('tc') ttl = send_params.get('hlim') @@ -84,13 +94,13 @@ def prepare_ipv4(dst_address, send_params): return ip -def send_icmp_ping(dst_address, sendif, send_params): +def send_icmp_ping(send_params): send_length = send_params['length'] send_frag_length = send_params['frag_length'] packets = [] ether = sp.Ether() - if ':' in dst_address: - ip6 = prepare_ipv6(dst_address, send_params) + if ':' in send_params['dst_address']: + ip6 = prepare_ipv6(send_params) icmp = sp.ICMPv6EchoRequest(data=sp.raw(build_payload(send_length))) if send_frag_length: for packet in sp.fragment(ip6 / icmp, fragsize=send_frag_length): @@ -99,7 +109,7 @@ def send_icmp_ping(dst_address, sendif, send_params): packets.append(ether / ip6 / icmp) else: - ip = prepare_ipv4(dst_address, send_params) + ip = prepare_ipv4(send_params) icmp = sp.ICMP(type='echo-request') raw = sp.raw(build_payload(send_length)) if send_frag_length: @@ -108,10 +118,10 @@ def send_icmp_ping(dst_address, sendif, send_params): else: packets.append(ether / ip / icmp / raw) for packet in packets: - sp.sendp(packet, sendif, verbose=False) + sp.sendp(packet, iface=send_params['sendif'], verbose=False) -def send_tcp_syn(dst_address, sendif, send_params): +def send_tcp_syn(send_params): tcpopt_unaligned = send_params.get('tcpopt_unaligned') seq = send_params.get('seq') mss = send_params.get('mss') @@ -119,23 +129,26 @@ def send_tcp_syn(dst_address, sendif, send_params): opts=[('Timestamp', (1, 1)), ('MSS', mss if mss else 1280)] if tcpopt_unaligned: opts = [('NOP', 0 )] + opts - if ':' in dst_address: - ip = prepare_ipv6(dst_address, send_params) + if ':' in send_params['dst_address']: + ip = prepare_ipv6(send_params) else: - ip = prepare_ipv4(dst_address, send_params) + ip = prepare_ipv4(send_params) tcp = sp.TCP( sport=send_params.get('sport'), dport=send_params.get('dport'), flags='S', options=opts, seq=seq, ) req = ether / ip / tcp - sp.sendp(req, iface=sendif, verbose=False) + sp.sendp(req, iface=send_params['sendif'], verbose=False) -def send_ping(dst_address, sendif, ping_type, send_params): +def send_ping(ping_type, send_params): if ping_type == 'icmp': - send_icmp_ping(dst_address, sendif, send_params) - elif ping_type == 'tcpsyn': - send_tcp_syn(dst_address, sendif, send_params) + send_icmp_ping(send_params) + elif ( + ping_type == 'tcpsyn' or + ping_type == 'tcp3way' + ): + send_tcp_syn(send_params) else: raise Exception('Unspported ping type') @@ -147,20 +160,21 @@ def check_ipv4(expect_params, packet): tos = expect_params.get('tc') ttl = expect_params.get('hlim') ip = packet.getlayer(sp.IP) + LOGGER.debug(f'Packet: {ip}') if not ip: LOGGER.debug('Packet is not IPv4!') return False if src_address and ip.src != src_address: - LOGGER.debug('Source IPv4 address does not match!') + LOGGER.debug(f'Wrong IPv4 source {ip.src}, expected {src_address}') return False if dst_address and ip.dst != dst_address: - LOGGER.debug('Destination IPv4 address does not match!') + LOGGER.debug(f'Wrong IPv4 destination {ip.dst}, expected {dst_address}') return False chksum = ip.chksum ip.chksum = None new_chksum = sp.IP(sp.raw(ip)).chksum if chksum != new_chksum: - LOGGER.debug(f'Expected IP checksum {new_chksum} but found {chksum}') + LOGGER.debug(f'Wrong IPv4 checksum {chksum}, expected {new_chksum}') return False if flags and ip.flags != flags: LOGGER.debug(f'Wrong IP flags value {ip.flags}, expected {flags}') @@ -185,10 +199,10 @@ def check_ipv6(expect_params, packet): LOGGER.debug('Packet is not IPv6!') return False if src_address and ip6.src != src_address: - LOGGER.debug('Source IPv6 address does not match!') + LOGGER.debug(f'Wrong IPv6 source {ip6.src}, expected {src_address}') return False if dst_address and ip6.dst != dst_address: - LOGGER.debug('Destination IPv6 address does not match!') + LOGGER.debug(f'Wrong IPv6 destination {ip6.dst}, expected {dst_address}') return False # IPv6 has no IP-level checksum. if flags: @@ -268,32 +282,32 @@ def check_ping_reply_6(expect_params, packet): return True -def check_ping_request(expect_params, packet): - src_address = expect_params.get('src_address') - dst_address = expect_params.get('dst_address') +def check_ping_request(args, packet): + src_address = args['expect_params'].get('src_address') + dst_address = args['expect_params'].get('dst_address') if not (src_address or dst_address): raise Exception('Source or destination address must be given to match the ping request!') if ( (src_address and ':' in src_address) or (dst_address and ':' in dst_address) ): - return check_ping_request_6(expect_params, packet) + return check_ping_request_6(args['expect_params'], packet) else: - return check_ping_request_4(expect_params, packet) + return check_ping_request_4(args['expect_params'], packet) -def check_ping_reply(expect_params, packet): - src_address = expect_params.get('src_address') - dst_address = expect_params.get('dst_address') +def check_ping_reply(args, packet): + src_address = args['expect_params'].get('src_address') + dst_address = args['expect_params'].get('dst_address') if not (src_address or dst_address): raise Exception('Source or destination address must be given to match the ping reply!') if ( (src_address and ':' in src_address) or (dst_address and ':' in dst_address) ): - return check_ping_reply_6(expect_params, packet) + return check_ping_reply_6(args['expect_params'], packet) else: - return check_ping_reply_4(expect_params, packet) + return check_ping_reply_4(args['expect_params'], packet) def check_tcp(expect_params, packet): @@ -308,7 +322,7 @@ def check_tcp(expect_params, packet): tcp.chksum = None newpacket = sp.Ether(sp.raw(packet[sp.Ether])) new_chksum = newpacket[sp.TCP].chksum - if chksum != new_chksum: + if new_chksum and chksum != new_chksum: LOGGER.debug(f'Wrong TCP checksum {chksum}, expected {new_chksum}!') return False if tcp_flags and tcp.flags != tcp_flags: @@ -339,7 +353,7 @@ def check_tcp_syn_request_4(expect_params, packet): return True -def check_tcp_syn_reply_4(expect_params, packet): +def check_tcp_syn_reply_4(send_params, expect_params, packet): if not check_ipv4(expect_params, packet): return False if not check_tcp(expect_params | {'tcp_flags': 'SA'}, packet): @@ -347,6 +361,36 @@ def check_tcp_syn_reply_4(expect_params, packet): return True +def check_tcp_3way_4(args, packet): + send_params = args['send_params'] + + expect_params_sa = clean_params(args['expect_params']) + expect_params_sa['src_address'] = send_params['dst_address'] + expect_params_sa['dst_address'] = send_params['src_address'] + + # Sniff incoming SYN+ACK packet + if ( + check_ipv4(expect_params_sa, packet) and + check_tcp(expect_params_sa | {'tcp_flags': 'SA'}, packet) + ): + ether = sp.Ether() + ip_sa = packet.getlayer(sp.IP) + tcp_sa = packet.getlayer(sp.TCP) + reply_params = clean_params(send_params) + reply_params['src_address'] = ip_sa.dst + reply_params['dst_address'] = ip_sa.src + ip_a = prepare_ipv4(reply_params) + tcp_a = sp.TCP( + sport=tcp_sa.dport, dport=tcp_sa.sport, flags='A', + seq=tcp_sa.ack, ack=tcp_sa.seq + 1, + ) + req = ether / ip_a / tcp_a + sp.sendp(req, iface=send_params['sendif'], verbose=False) + return True + + return False + + def check_tcp_syn_request_6(expect_params, packet): if not check_ipv6(expect_params, packet): return False @@ -363,7 +407,38 @@ def check_tcp_syn_reply_6(expect_params, packet): return True -def check_tcp_syn_request(expect_params, packet): +def check_tcp_3way_6(args, packet): + send_params = args['send_params'] + + expect_params_sa = clean_params(args['expect_params']) + expect_params_sa['src_address'] = send_params['dst_address'] + expect_params_sa['dst_address'] = send_params['src_address'] + + # Sniff incoming SYN+ACK packet + if ( + check_ipv6(expect_params_sa, packet) and + check_tcp(expect_params_sa | {'tcp_flags': 'SA'}, packet) + ): + ether = sp.Ether() + ip6_sa = packet.getlayer(sp.IPv6) + tcp_sa = packet.getlayer(sp.TCP) + reply_params = clean_params(send_params) + reply_params['src_address'] = ip6_sa.dst + reply_params['dst_address'] = ip6_sa.src + ip_a = prepare_ipv6(reply_params) + tcp_a = sp.TCP( + sport=tcp_sa.dport, dport=tcp_sa.sport, flags='A', + seq=tcp_sa.ack, ack=tcp_sa.seq + 1, + ) + req = ether / ip_a / tcp_a + sp.sendp(req, iface=send_params['sendif'], verbose=False) + return True + + return False + + +def check_tcp_syn_request(args, packet): + expect_params = args['expect_params'] src_address = expect_params.get('src_address') dst_address = expect_params.get('dst_address') if not (src_address or dst_address): @@ -377,7 +452,8 @@ def check_tcp_syn_request(expect_params, packet): return check_tcp_syn_request_4(expect_params, packet) -def check_tcp_syn_reply(expect_params, packet): +def check_tcp_syn_reply(args, packet): + expect_params = args['expect_params'] src_address = expect_params.get('src_address') dst_address = expect_params.get('dst_address') if not (src_address or dst_address): @@ -390,8 +466,24 @@ def check_tcp_syn_reply(expect_params, packet): else: return check_tcp_syn_reply_4(expect_params, packet) +def check_tcp_3way(args, packet): + expect_params = args['expect_params'] + src_address = expect_params.get('src_address') + dst_address = expect_params.get('dst_address') + if not (src_address or dst_address): + raise Exception('Source or destination address must be given to match the tcp syn reply!') + if ( + (src_address and ':' in src_address) or + (dst_address and ':' in dst_address) + ): + return check_tcp_3way_6(args, packet) + else: + return check_tcp_3way_4(args, packet) + -def setup_sniffer(recvif, ping_type, sniff_type, expect_params, defrag): +def setup_sniffer( + recvif, ping_type, sniff_type, expect_params, defrag, send_params, +): if ping_type == 'icmp' and sniff_type == 'request': checkfn = check_ping_request elif ping_type == 'icmp' and sniff_type == 'reply': @@ -400,10 +492,15 @@ def setup_sniffer(recvif, ping_type, sniff_type, expect_params, defrag): checkfn = check_tcp_syn_request elif ping_type == 'tcpsyn' and sniff_type == 'reply': checkfn = check_tcp_syn_reply + elif ping_type == 'tcp3way' and sniff_type == 'reply': + checkfn = check_tcp_3way else: raise Exception('Unspported ping or sniff type') - return Sniffer(expect_params, checkfn, recvif, defrag=defrag) + return Sniffer( + {'send_params': send_params, 'expect_params': expect_params}, + checkfn, recvif, defrag=defrag, + ) def parse_args(): @@ -416,8 +513,8 @@ def parse_args(): parser.add_argument('--to', required=True, help='The destination IP address for the ping request') parser.add_argument('--ping-type', - choices=('icmp', 'tcpsyn'), - help='Type of ping: ICMP (default) or TCP SYN', + choices=('icmp', 'tcpsyn', 'tcp3way'), + help='Type of ping: ICMP (default) or TCP SYN or 3-way TCP handshake', default='icmp') parser.add_argument('--fromaddr', help='The source IP address for the ping request') @@ -444,7 +541,7 @@ def parse_args(): help='TCP sequence number') parser_send.add_argument('--send-sport', type=int, help='TCP source port') - parser_send.add_argument('--send-dport', type=int, default=666, + parser_send.add_argument('--send-dport', type=int, default=9, help='TCP destination port') parser_send.add_argument('--send-length', type=int, default=len(PAYLOAD_MAGIC), help='ICMP Echo Request payload size') @@ -500,6 +597,8 @@ def main(): send_params['tcpopt_unaligned'] = args.send_tcpopt_unaligned send_params['nop'] = args.send_nop send_params['src_address'] = args.fromaddr if args.fromaddr else None + send_params['dst_address'] = args.to + send_params['sendif'] = args.sendif # We may not have a default route. Tell scapy where to start looking for routes sp.conf.iface6 = args.sendif @@ -525,7 +624,7 @@ def main(): LOGGER.debug(f'Installing receive sniffer on {iface}') sniffers.append( setup_sniffer(iface, args.ping_type, 'request', - sniffer_params, defrag, + sniffer_params, defrag, send_params, )) if args.replyif: @@ -536,12 +635,12 @@ def main(): LOGGER.debug(f'Installing reply sniffer on {iface}') sniffers.append( setup_sniffer(iface, args.ping_type, 'reply', - sniffer_params, defrag, + sniffer_params, defrag, send_params, )) LOGGER.debug(f'Installed {len(sniffers)} sniffers') - send_ping(args.to, args.sendif, args.ping_type, send_params) + send_ping(args.ping_type, send_params) err = 0 sniffer_num = 0 diff --git a/tests/sys/netpfil/pf/src_track.sh b/tests/sys/netpfil/pf/src_track.sh index 27eb62abcf41..eb053dd84a90 100755 --- a/tests/sys/netpfil/pf/src_track.sh +++ b/tests/sys/netpfil/pf/src_track.sh @@ -2,6 +2,7 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2020 Kristof Provost +# Copyright (c) 2024 Kajetan Staszkiewicz # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -59,7 +60,68 @@ source_track_cleanup() pft_cleanup } + +max_src_conn_rule_head() +{ + atf_set descr 'Max connections per source per rule' + atf_set require.user root +} + +max_src_conn_rule_body() +{ + setup_router_server_ipv6 + + # Clients will connect from another network behind the router. + # This allows for using multiple source addresses and for tester jail + # to not respond with RST packets for SYN+ACKs. + jexec router route add -6 2001:db8:44::0/64 2001:db8:42::2 + jexec server route add -6 2001:db8:44::0/64 2001:db8:43::1 + + pft_set_rules router \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in on ${epair_tester}b inet6 proto tcp keep state (max-src-conn 3 source-track rule overload )" \ + "pass out on ${epair_server}a inet6 proto tcp keep state" + + # Limiting of connections is done for connections which have successfully + # finished the 3-way handshake. Once the handshake is done, the state + # is moved to CLOSED state. We use pft_ping.py to check that the handshake + # was really successful and after that we check what is in pf state table. + + # 3 connections from host ::1 will be allowed. + ping_server_check_reply exit:0 --ping-type=tcp3way --send-sport=4201 --fromaddr 2001:db8:44::1 + ping_server_check_reply exit:0 --ping-type=tcp3way --send-sport=4202 --fromaddr 2001:db8:44::1 + ping_server_check_reply exit:0 --ping-type=tcp3way --send-sport=4203 --fromaddr 2001:db8:44::1 + # The 4th connection from host ::1 will have its state killed. + ping_server_check_reply exit:0 --ping-type=tcp3way --send-sport=4204 --fromaddr 2001:db8:44::1 + # A connection from host :2 is will be allowed. + ping_server_check_reply exit:0 --ping-type=tcp3way --send-sport=4205 --fromaddr 2001:db8:44::2 + + states=$(mktemp) || exit 1 + jexec router pfctl -qss | grep 'tcp 2001:db8:43::2\[9\] <-' > $states + + grep -qE '2001:db8:44::1\[4201\]\s+ESTABLISHED:ESTABLISHED' $states || atf_fail "State for port 4201 not found or not established" + grep -qE '2001:db8:44::1\[4202\]\s+ESTABLISHED:ESTABLISHED' $states || atf_fail "State for port 4202 not found or not established" + grep -qE '2001:db8:44::1\[4203\]\s+ESTABLISHED:ESTABLISHED' $states || atf_fail "State for port 4203 not found or not established" + grep -qE '2001:db8:44::2\[4205\]\s+ESTABLISHED:ESTABLISHED' $states || atf_fail "State for port 4205 not found or not established" + + if ( + grep -qE '2001:db8:44::1\[4204\]\s+' $states && + ! grep -qE '2001:db8:44::1\[4204\]\s+CLOSED:CLOSED' $states + ); then + atf_fail "State for port 4204 found but not closed" + fi + + jexec router pfctl -T test -t bad_hosts 2001:db8:44::1 || atf_fail "Host not found in overload table" +} + +max_src_conn_rule_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "source_track" + atf_add_test_case "max_src_conn_rule" } diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index f02dfc22049f..0b7ee621e6fa 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -215,8 +215,9 @@ setup_router_server_ipv4() vnet_mkjail server ${epair_server}b jexec server ifconfig ${epair_server}b ${net_server_host_server}/${net_server_mask} up jexec server route add -net ${net_tester} ${net_server_host_router} - jexec server nc -4l 666 & - sleep 1 # Give nc time to start and listen + inetd_conf=$(mktemp) + echo "discard stream tcp nowait root internal" > $inetd_conf + jexec server inetd $inetd_conf } # Create a bare router jail. @@ -268,8 +269,9 @@ setup_router_server_ipv6() vnet_mkjail server ${epair_server}b jexec server ifconfig ${epair_server}b inet6 ${net_server_host_server}/${net_server_mask} up no_dad jexec server route add -6 ${net_tester} ${net_server_host_router} - jexec server nc -6l 666 & - sleep 1 # Give nc time to start and listen + inetd_conf=$(mktemp) + echo "discard stream tcp6 nowait root internal" > $inetd_conf + jexec server inetd $inetd_conf } # Ping the dummy static NDP target. From nobody Sat Sep 28 17:01:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGDBl5vXtz5XbKM; Sat, 28 Sep 2024 17:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGDBl5N5Yz4rMW; Sat, 28 Sep 2024 17:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727542895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCbmwcwPXuiwXGlD1/n+qTMQ4bYNMm1tzu1mNH8g2vM=; b=vHQfa1NjVjosmBm2tpeLJVOqC1TncXXs0X8JumyuEu8+sHdRnD2Kl+SXQY8FfLBGk9YSIa uhL/o3ie7GTAjL+ABr+QQKApR66vuxjF3K5r/642g45c6pd6Kf12nxa+zRjZxrd6eQFpwZ 8sD14d4lg2Zlc+tbikXpFX0fbClF0exreWZZmisFMMxZdU5a5qXC82MpIdJye2AG1dfg4J fooUwrThEwyNSKDMIoKQ2uuQFRfaceewQz/GsrUiJRoN09jXNrVBO9kUilmjqL5eGZ2r4q lECnsAD35AK6SH6IgC20600gmq59oVN/skz5GKwh3YI/xpfWfuKMRcHTEBuuVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727542895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCbmwcwPXuiwXGlD1/n+qTMQ4bYNMm1tzu1mNH8g2vM=; b=Y5Oq48iRgxjykFf4kJJZvrwMdO15Il2FOmUNyHVfLv4fTXBB4S+ICQlYfxABYD+7gzWVKr UnZRmI0HR0O6s5dlJ6mcIrIc6bGJ1A+C/mIC//6GsxpmwxUdJWL1OsZ6yVIS+7usQQNipK ifawHkuRbT/E3aWaJMVViL3BsSd5bj15+qwsik5skv71+VA70qsbm0vVzB+6MnJU5gOFI8 KGaldHEr/Yh6lgEv44mdjuitSTkR5TTDCg3INmtsLOdGIvTne+8+1yl43NRFEjK8xN4Q8P 87hVwXvNPDl/UycHjrs7XcvfnZg01wK+3Zmuw3b09xy8QQXAwt1tjLBAMuckzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727542895; a=rsa-sha256; cv=none; b=Erb10kCi2UvliiKOI2ClRJ6hPQY77aDmoYtlNh1HHARJPCwTwqlkD0jYUx7Rhw+mPP7UAx SZQj9RD/K17CzAApyxNzjOUfDwjo49JjfIj8GOeZNsd95AiubvCqg/kesBA30hjcoF56dV q1dwP195Xd8n6e+ecRcGUSfFxwKmy66kK2gIin+JWhl11bJvtHh3Q9fpdbHoL+WEZFsg3j 4NlT3wuX6R8wJMGmYEWXHmmRxo7sYuhjSuhugg8uOVB8sChhWmQYZ1bgUlIC/0ubRYTy9n Pru5dYf8Uo1CUyH7jh0NFGj4bq+fqMG/cZ5hK89lFt+nss56MwVrzGGFTHdDEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGDBl4zPjzYp8; Sat, 28 Sep 2024 17:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SH1ZjR058454; Sat, 28 Sep 2024 17:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SH1ZWm058451; Sat, 28 Sep 2024 17:01:35 GMT (envelope-from git) Date: Sat, 28 Sep 2024 17:01:35 GMT Message-Id: <202409281701.48SH1ZWm058451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: c44fbfdb5686 - main - roundup_pow_of_two: don't take the log of it List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c44fbfdb56862c4c8d2563483b4fff8f9a5a1d43 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=c44fbfdb56862c4c8d2563483b4fff8f9a5a1d43 commit c44fbfdb56862c4c8d2563483b4fff8f9a5a1d43 Author: Doug Moore AuthorDate: 2024-09-28 17:00:06 +0000 Commit: Doug Moore CommitDate: 2024-09-28 17:00:06 +0000 roundup_pow_of_two: don't take the log of it Based on the definitions, ilog2(roundup_pow_of_two(x)) == order_base_2(x). Replace the former with the latter in a few places to save a few calculations. Reviewed by: bz, kib Differential Revision: https://reviews.freebsd.org/D46827 --- sys/dev/mlx4/mlx4_en/en.h | 2 +- sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx4/mlx4_en/en.h b/sys/dev/mlx4/mlx4_en/en.h index a29b40ddaf10..838894f7b02f 100644 --- a/sys/dev/mlx4/mlx4_en/en.h +++ b/sys/dev/mlx4/mlx4_en/en.h @@ -232,7 +232,7 @@ enum cq_type { /* * Useful macros */ -#define ROUNDUP_LOG2(x) ilog2(roundup_pow_of_two(x)) +#define ROUNDUP_LOG2(x) order_base_2(x) #define XNOR(x, y) (!(x) == !(y)) #define ILLEGAL_MAC(addr) (addr == 0xffffffffffffULL || addr == 0x0) diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c index 3cda28752592..b391946440b9 100644 --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c @@ -488,7 +488,7 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap, MLX4_IB_QPT_PROXY_GSI | MLX4_IB_QPT_TUN_SMI_OWNER))) qp->sq.wqe_shift = ilog2(64); else - qp->sq.wqe_shift = ilog2(roundup_pow_of_two(s)); + qp->sq.wqe_shift = order_base_2(s); for (;;) { qp->sq_max_wqes_per_wr = DIV_ROUND_UP(s, 1U << qp->sq.wqe_shift); @@ -544,7 +544,7 @@ static int set_user_sq_size(struct mlx4_ib_dev *dev, /* Sanity check SQ size before proceeding */ if ((1 << ucmd->log_sq_bb_count) > dev->dev->caps.max_wqes || ucmd->log_sq_stride > - ilog2(roundup_pow_of_two(dev->dev->caps.max_sq_desc_sz)) || + order_base_2(dev->dev->caps.max_sq_desc_sz) || ucmd->log_sq_stride < MLX4_IB_MIN_SQ_STRIDE) return -EINVAL; From nobody Sat Sep 28 19:23:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGHLb3Mrtz5Xkvn; Sat, 28 Sep 2024 19:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGHLb2WcMz53WC; Sat, 28 Sep 2024 19:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727551415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZSgmzBjFUX1WMcLt8twPvyzABopP5t/I0cPzb3G5kUg=; b=nmRjo0RAFqPiSWsVxSyHqrzLZ1v3cyk60xcawSU6HVupyISeEat/CgL76HQ/IEldm4Hsho 8Ku0/NTzbokqFjMKrdwH9nS2BlPvW9VaV/Uif1UwKEnjSkbTFpz7ZjQqUt/Dsr+yVH+IsB cUefHY3ctb4Ttwf/X6V+zfU65YraayGLuVSrm9d4TxItKQwH+yb0uVFwrW+3tG6xMOqKB3 d72KFPuVEWf+h9MQZltXgsYnv/rmW8pOLfY8xBU0/G5gBPOn2tzu+yWsnwbk0iBWxtj2UF U7b6Ew5c4xg87m6bBN1J/WO/oZq7fWdJw1TyCf+EN4j6D31OaIWIlUO+QYmfxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727551415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZSgmzBjFUX1WMcLt8twPvyzABopP5t/I0cPzb3G5kUg=; b=Yln/HrkSPYq9pNqraJ+V54KmNOOjM9cmFKfd05tJjJvKrPVpg/dwiLUqspdedZAVx0DhM3 z0Eqq0IcINknlh8g9AVqJdJf5gChnw+hEwjdKPAws1gvsvs5/eFh9cCdI/Za8HqGVfg567 lfKrA8Uu/QMc01Ay9evs9bNzYbgsMO6lPTtx/BAYQGG+pg1NlKRiCYytmbOcAqID5v352X w2MHjEvdZyykG2Kv+GSeDVduyZTQBoU41BXXGeoaL6TivrZOXuKU+Wyv9vewVWA6ZvZnNp /qCTzQGnuWt58zuRJ7Aw9mAnYggXb6xoDF9YgXNPk9OJ3H356tfcuvBdM/B01Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727551415; a=rsa-sha256; cv=none; b=kGv3DeVJGvcklW3jpItsUvdE93ACwYwx+u18Q0nxTKLFZHOC22jHXbpA6aK1tJ600eSWw7 uX6fxnDiSI1Q043nBpitk63Wz/DYnlvuvXK0nqaiXGKmTpW71HLBqgZzy2TCeOcMkkgv0J Px84GoVdgMSnPSTAWFBGK7Hwjn1MvQb/7Qdm29zb5hvsuq+JrWO3GtctmPxRNn7koczHJn /oSYtTc0UsFBHj+OaNP3/kz+qloE/BYEINQ7kQeByBjUD+8ovcBIcSxTz2Db5lzGpgyej3 K8ueo8IgJDIjjRNHkV86WTyuRitxJyJYu/0XH/slrtKvqrfXAbRkL8kQfXz2qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGHLb1pmLzdNZ; Sat, 28 Sep 2024 19:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SJNZsq096622; Sat, 28 Sep 2024 19:23:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SJNZ4Z096619; Sat, 28 Sep 2024 19:23:35 GMT (envelope-from git) Date: Sat, 28 Sep 2024 19:23:35 GMT Message-Id: <202409281923.48SJNZ4Z096619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 37881f65eacd - main - pf: pf_clear_srcnodes() is always called with NULL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37881f65eacd200b6aa31bcf75bdda089b83fbd5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=37881f65eacd200b6aa31bcf75bdda089b83fbd5 commit 37881f65eacd200b6aa31bcf75bdda089b83fbd5 Author: Kajetan Staszkiewicz AuthorDate: 2024-09-28 16:59:13 +0000 Commit: Kristof Provost CommitDate: 2024-09-28 19:23:14 +0000 pf: pf_clear_srcnodes() is always called with NULL The functions pf_clear_srcnodes() is only used to perform a removal of all source nodes, never of a given one. Remove the code allowing for removal of a given source node. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46819 --- sys/netpfil/pf/pf_ioctl.c | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 0a573a017ef3..6e2fcd358b68 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -233,7 +233,7 @@ static int pf_clearstates_nv(struct pfioc_nv *); static int pf_getstate(struct pfioc_nv *); static int pf_getstatus(struct pfioc_nv *); static int pf_clear_tables(void); -static void pf_clear_srcnodes(struct pf_ksrc_node *); +static void pf_clear_srcnodes(void); static void pf_kill_srcnodes(struct pfioc_src_node_kill *); static int pf_keepcounters(struct pfioc_nv *); static void pf_tbladdr_copyout(struct pf_addr_wrap *); @@ -5427,7 +5427,7 @@ DIOCCHANGEADDR_error: } case DIOCCLRSRCNODES: { - pf_clear_srcnodes(NULL); + pf_clear_srcnodes(); pf_purge_expired_src_nodes(); break; } @@ -5904,40 +5904,32 @@ pf_clear_tables(void) } static void -pf_clear_srcnodes(struct pf_ksrc_node *n) +pf_clear_srcnodes(void) { - struct pf_kstate *s; - int i; + struct pf_kstate *s; + struct pf_srchash *sh; + struct pf_ksrc_node *sn; + int i; for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) { - if (n == NULL || n == s->src_node) - s->src_node = NULL; - if (n == NULL || n == s->nat_src_node) - s->nat_src_node = NULL; + s->src_node = NULL; + s->nat_src_node = NULL; } PF_HASHROW_UNLOCK(ih); } - if (n == NULL) { - struct pf_srchash *sh; - - for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; - i++, sh++) { - PF_HASHROW_LOCK(sh); - LIST_FOREACH(n, &sh->nodes, entry) { - n->expire = 1; - n->states = 0; - } - PF_HASHROW_UNLOCK(sh); + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; + i++, sh++) { + PF_HASHROW_LOCK(sh); + LIST_FOREACH(sn, &sh->nodes, entry) { + sn->expire = 1; + sn->states = 0; } - } else { - /* XXX: hash slot should already be locked here. */ - n->expire = 1; - n->states = 0; + PF_HASHROW_UNLOCK(sh); } } @@ -6406,7 +6398,7 @@ shutdown_pf(void) pf_clear_all_states(); - pf_clear_srcnodes(NULL); + pf_clear_srcnodes(); /* status does not use malloced mem so no need to cleanup */ /* fingerprints and interfaces have their own cleanup code */ From nobody Sat Sep 28 20:09:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGJN42vDKz5XnL6; Sat, 28 Sep 2024 20:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGJN42Qsnz57Xr; Sat, 28 Sep 2024 20:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727554196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6W8lKXBAwmrYahOlErRbnvnbgzjA1TpTNPkjp+gaCgs=; b=wbV95VUmpc+YXIpqTHpus+IxnB/Np5LY5oraAj2TqFS7eV+XTkxcsk7ca9PV4JwPNTb4Xr SCVd5u90jSpFeBCSKW6zTH+KeHYg2yTSW8sR6nEhZh1JlcCZxVVJy9IViELWXAplO6IDRw Tjo0m8DvaxuvlTUIjJ8TQ5ORFZ5tPXw22NJivbLgEXIH2uUOn7NlypFVB+vnDTc8NtgyHh mw+V4zlLQL83d5yJLtNCUAD6Sa9vYp3zxLA/GwhrrmngfWj8zfn9L6wNJobR3muh8e0QQi lZ98JN+Bju/Q67ZEkruXkTPrCxbqphLdF9CcvjxJ5UZsENVT5JJ9mu+rso1e5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727554196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6W8lKXBAwmrYahOlErRbnvnbgzjA1TpTNPkjp+gaCgs=; b=BjoxZVK0Z/moYTJqkvTJTGCi9OKSkOVK7gDdgX3hUQxZIr3qt4198DVGwbstGpu36AG3Mo Mfh/awMVaMHQbki4InQFBJYdxp/iAbL5jx/DvAfbenmdLtuQYgfOSCj985gnEUZKnVw+dI tpEOK90oz/HdgeuBcQYYqaQC5ZoyklOdpcwFHTVUhmXXG3fUgCSdVFvE6B3DKv6uC8hCXZ shKvC9lCbr6xUiWCa2nhJ3XkqwHWuKc9VPOm5QORypCYSSSh+16C8DhL2m7lQsNoCpjJdX x8RaJy5dsrtyFSfQziNtwjKe2jh4Imwuw0fqqiIJv6XczITITF5s2oFOLdEKNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727554196; a=rsa-sha256; cv=none; b=bKTvev0S/joxh+CPI23RDScAAw7nEe8FSxwOZox3rinjMQPREoe0Hmqg1z/LVdWn+/Cl02 SJPHiGZLn2Dqf8AqvJ1AGycIfzqbg8N8e3Z5eUkZhb9TcVAlNU74rpBu8+dazgLFsdaAZK 2ivGvcYmrvBv2hlzm9ZynfAWON6lL9kcuFKkavA/o2DMogAGWTlECpaXCM0kAXicvPydLT NkQpafth+ILzTH+nlRmqm//IDT7ERvpEir0PZExyn8conEFETVhmSw1n6qdwn1w9+ibYOh vWhfC82+sUoUuMDuvwDui6rtMdECH88jqsDWrtUJoe61VIN6+24y3bXYG+CgOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGJN41k8Pzfd2; Sat, 28 Sep 2024 20:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SK9ueI065751; Sat, 28 Sep 2024 20:09:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SK9uZc065748; Sat, 28 Sep 2024 20:09:56 GMT (envelope-from git) Date: Sat, 28 Sep 2024 20:09:56 GMT Message-Id: <202409282009.48SK9uZc065748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: cbc9438f0505 - main - tcp: improve ref count handling when processing SYN List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbc9438f0505bd971e9eba635afdae38a267d76e Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=cbc9438f0505bd971e9eba635afdae38a267d76e commit cbc9438f0505bd971e9eba635afdae38a267d76e Author: Michael Tuexen AuthorDate: 2024-09-28 20:06:41 +0000 Commit: Michael Tuexen CommitDate: 2024-09-28 20:06:41 +0000 tcp: improve ref count handling when processing SYN Don't leak a reference count for so->so_cred when processing an incoming SYN segment with an on-stack syncache entry and the sysctl variable net.inet.tcp.syncache.see_other is false. Reviewed by: cc, markj, rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Pull Request: https://reviews.freebsd.org/D46793 --- sys/netinet/tcp_syncache.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index ed131421207d..19145446988e 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1375,7 +1375,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, struct label *maclabel = NULL; #endif struct syncache scs; - struct ucred *cred; uint64_t tfo_response_cookie; unsigned int *tfo_pending = NULL; int tfo_cookie_valid = 0; @@ -1392,7 +1391,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ KASSERT(SOLISTENING(so), ("%s: %p not listening", __func__, so)); tp = sototcpcb(so); - cred = V_tcp_syncache.see_other ? NULL : crhold(so->so_cred); #ifdef INET6 if (inc->inc_flags & INC_ISIPV6) { @@ -1623,9 +1621,21 @@ skip_alloc: #ifdef MAC sc->sc_label = maclabel; #endif - sc->sc_cred = cred; + /* + * sc_cred is only used in syncache_pcblist() to list TCP endpoints in + * TCPS_SYN_RECEIVED state when V_tcp_syncache.see_other is false. + * Therefore, store the credentials and take a reference count only + * when needed: + * - sc is allocated from the zone and not using the on stack instance. + * - the sysctl variable net.inet.tcp.syncache.see_other is false. + * The reference count is decremented when a zone allocated sc is + * freed in syncache_free(). + */ + if (sc != &scs && !V_tcp_syncache.see_other) + sc->sc_cred = crhold(so->so_cred); + else + sc->sc_cred = NULL; sc->sc_port = port; - cred = NULL; sc->sc_ipopts = ipopts; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); sc->sc_ip_tos = ip_tos; @@ -1761,8 +1771,6 @@ donenoprobe: tcp_fastopen_decrement_counter(tfo_pending); tfo_expanded: - if (cred != NULL) - crfree(cred); if (sc == NULL || sc == &scs) { #ifdef MAC mac_syncache_destroy(&maclabel); From nobody Sat Sep 28 21:26:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGL4n3l6wz5XsRt; Sat, 28 Sep 2024 21:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGL4n3993z40bK; Sat, 28 Sep 2024 21:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7aPhN2x5cwgfXf797J514xGU0OI/YazIvx2gBmohqzI=; b=p+30yEY+J6uQZBu6CmjqlYOlKlQenu1ggrMSa0uVkiamqWZEQodk2WCyWvKHZItcPso91X w2ktn7+TprGbsWj54Sj0aLXdz/PsEUriBWZ+zliFNtlH8lsIx0xNLufP88wIVgVtaLc0ZE XgbGwyA9wdZ3JfF0o+tfyEUaYhXwuLdbz/AK7HtnjIdF+jYCI5F4WIaPEuB2z6KAlmx+hp 0854K7qcLPVFTHfsiUmcNIThsii1UfV5kFHAoc0cyjGdl5/ond7ulxnCUsru2rCVqXshi0 XOVsQecRHcYvH9PrzmUoOKCNvnrFGfWMRkI//L7hxucC5m2UAX6Nogo11CD9Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7aPhN2x5cwgfXf797J514xGU0OI/YazIvx2gBmohqzI=; b=SSmRd6FsY0XzXtGm7OCf+my6gLRbuSvxBVPnzxalng8Dxrm+47tT79MUYmJ3BkEIaCRlD1 2eIr5aeD2Np61RYr2gqAQW8H588GZ9MGM3qQoPNaU1yZ4Zad7zAWmoR77v0D4aLe8BZKm5 sx2hwcqep0o1RMiLEmmKpnHcMy6ZDfseER+x/z9RBRVQ5qWa6tYiYOqWrHi0jS/Q2R+NIp iE75vRJVjVSrCrxa9ut/e1AZRW2AftBqjlio+Caof9aqm8hBobb7mwJtGDpg0nWHVQey4v ETJYUjsUtWA71rNLM2ABA/NOInUgj9oy7gjd9jeIPTA7fRikmTqJpboyXOpxXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727558809; a=rsa-sha256; cv=none; b=wnrIhhJf4XLu97dYc/1Hw/eSTVeSHE9D++F64n6F454Ix5p9TGiNf5h6xLu+T/qhHA4Mw1 gbhyT5JxpgyuC0obXtqAkC+bXrkae9Bna5X90oZzeVCnNa2sqY7nozFDgCM3hOEYvs4wKF QAcEFtG1Kq1dXe6wi3Km1Idebg/GCxtW93FFUvAG6RzvvhYXj2SgLyA3f7a//wb0k2bleq MgoloW11eTR0TTt/8SHEMSYJlpvpMACb/3p2vIVze4Oj+RgD2I6GsQeecUDkWWSFp9IqvH qlWBkfQhiVMJJFRsadYf5rmNHsC6Ia5YQV18ChG+pfwdbQ5lH64CJikUuJPq8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGL4n2mZ6zhMN; Sat, 28 Sep 2024 21:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SLQnHa000561; Sat, 28 Sep 2024 21:26:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SLQn8h000558; Sat, 28 Sep 2024 21:26:49 GMT (envelope-from git) Date: Sat, 28 Sep 2024 21:26:49 GMT Message-Id: <202409282126.48SLQn8h000558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 65c4ec887eec - main - gdma: use ispower2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65c4ec887eec1f1967557cc3f2656df76b5898bb Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=65c4ec887eec1f1967557cc3f2656df76b5898bb commit 65c4ec887eec1f1967557cc3f2656df76b5898bb Author: Doug Moore AuthorDate: 2024-09-28 21:17:03 +0000 Commit: Doug Moore CommitDate: 2024-09-28 21:17:03 +0000 gdma: use ispower2 It's faster to use ispower2(n) than it is to compute roundup_pow_of_two and do a comparison. So do the former. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46838 --- sys/dev/mana/gdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 13f2617ad7d4..59ac6911c784 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -221,7 +221,7 @@ mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length, if (!gc || !gmi) return EINVAL; - if (length < PAGE_SIZE || (length != roundup_pow_of_two(length))) + if (length < PAGE_SIZE || !powerof2(length)) return EINVAL; err = bus_dma_tag_create(bus_get_dma_tag(gc->dev), /* parent */ From nobody Sat Sep 28 21:26:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGL4p4VPTz5Xs3Q; Sat, 28 Sep 2024 21:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGL4p3c2cz40rf; Sat, 28 Sep 2024 21:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UmeHROIHgSeoOvs2/YGNtUxHxttrDD9iVtu6JDTClRo=; b=WzfspCeYOMQZQHaW17gFtT4HhBIufNbRd3xtEV60W9u89CtApxa5+1IRRaOTH/5a4M/78z BXyjT82FrUfJ74xYLXdWQx4kktbCbPXAaj+nX0P6xfAOgBI1CeLSYOH3woMhuJ3rTCHCR4 RDb+6BRIlmCK6hBrkE/pQ52kkijao27NuLQgKLcNHrBxv4JE9ntbt27svRgC+LWpvnpbUx 7OcC2HLoY8Wv9PBdx2L8TzKrI4glCE4jKblVYYCwnmq2Mnkc2D6jCzwDo/nOAtDLExFUFG XlGqAM+nnq2dnZfryjNbEKIcOLVkHirEz2LjhTaQ5rnPZS/zNqv1YN+Z4RvdGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UmeHROIHgSeoOvs2/YGNtUxHxttrDD9iVtu6JDTClRo=; b=b25lmp2T4FgzyLHz09lii+d9LbSWgfEzEwDfQCVG9RaqTk+UXUn5qAouWqHikSEM/Xfdgb mrNDDmwXJA2M2nmyKqTId7rjrmK65etkV66RE+1JjIQGZHMJJVGX2xTv+1DJhs6hWTR43V 4FQIQ4Eb00Kmo/mmMPqpru9LNq//ZBYDZNZpeSBaTdL9FDLz2rMIlsLeyZ/6jvw0SODe4O R99GueFJP0JKhTzKclvAn4ZxCqs9OeNiFRvK6DMRvCuoFgeSnV+0d/WVbS1nR0hf/Z0Uxl QbQzGZ3qRyTAEf8CD4kYQe2AlIIPlUnceAjKNJNk12mEhiVnSpHxG0hLkYgB9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727558810; a=rsa-sha256; cv=none; b=ypALjhnz9vZP9TJ+RekiQgu1iGidgBEUEhm305tDIuMLNB1ke0hCCRD/5xhXu5J0i59Oqe 48684vejkL5k9BrqpUmhxM7KqQNLPKQZNKeajkg+UdRVAS6HnXcF+CkecHMmsNboLEMQgB 37mlfUrCHonnQ+78xy8lhZe6yoHZ4g5JHUCWGnWcwm6JjMQqY0unK5RYKHVEW8UJWX+L1D D88ax3vcEZvVIZG2O3Fb9z+YdIKUqyyQ/4iDA2SYLIDeNmpIIWf7207I+JzS551RXpXpuo mc1DScJXBBVWe+NotytCMB0Zvbg7oOFy2sEEk8YuTI3gjLfUZNe1I3wEkS6big== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGL4p3DQzzhWf; Sat, 28 Sep 2024 21:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SLQo4c000597; Sat, 28 Sep 2024 21:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SLQoDD000594; Sat, 28 Sep 2024 21:26:50 GMT (envelope-from git) Date: Sat, 28 Sep 2024 21:26:50 GMT Message-Id: <202409282126.48SLQoDD000594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 3873b9a8b3a5 - main - mlx4: use is_power_of_2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3873b9a8b3a51731e5db92ab0c5c59797e416015 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=3873b9a8b3a51731e5db92ab0c5c59797e416015 commit 3873b9a8b3a51731e5db92ab0c5c59797e416015 Author: Doug Moore AuthorDate: 2024-09-28 21:23:17 +0000 Commit: Doug Moore CommitDate: 2024-09-28 21:23:17 +0000 mlx4: use is_power_of_2 It's faster to use is_power_of_2 than it is to compute roundup_power_of_two and then compare. So do that. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46838 --- sys/dev/mlx4/mlx4_core/mlx4_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mlx4/mlx4_core/mlx4_alloc.c b/sys/dev/mlx4/mlx4_core/mlx4_alloc.c index dcf6204dfc1a..fa68625f5ab9 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_alloc.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_alloc.c @@ -173,7 +173,7 @@ int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask, u32 reserved_bot, u32 reserved_top) { /* num must be a power of 2 */ - if (num != roundup_pow_of_two(num)) + if (!is_power_of_2(num)) return -EINVAL; bitmap->last = 0; From nobody Sat Sep 28 21:26:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGL4r12X0z5XsMZ; Sat, 28 Sep 2024 21:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGL4q5Jvtz40xZ; Sat, 28 Sep 2024 21:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh7fs6tXbiuJ1dDAJifB+h/jye2B2fQaF43ZasL6/co=; b=m1q0iI2NS1ad67OlTuiYqzZ0qp1OAx1T0hbVB8OsQVigm8MFFAKLZZ4vsnRsL2xl0kdrun 1Frzkb7vYflWmOdUghyA6BdCwC/rRSVhqD638E/P2B7QNncj3sNTp7Cchv/Ogj7ElM2fhU InecwugG/pRxD+YFrjcbQe/1FM+JtbLp08GqiBYLCYyCCibqSqlfFV0ZruOmq5t7d9nOr1 VUFd4B9LqMEJT9HKx+UAgLc0JOaqM0XQRACAiNA+WjATcSrmyfX3Socs+v0K4o2TNcfwax QKEv8ihvkXNOqGSuSPq8MjBTJGN3OIhWiSKjDHSUog55sdQmATdX37/WqicApw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh7fs6tXbiuJ1dDAJifB+h/jye2B2fQaF43ZasL6/co=; b=gdzJz4R7avZUOLF16gPawWangkSLowcOiwSlLGjQEG97nhKSkRe9FLOBvktO8o11WThkRH bpap/Z8vsllU0EgEhDFRI2mKpxpWpn0nQPg7IrjFeE1dP3+i5zSX9JtvZ/8IUQ++IId/Pc T5mM+QtRY6/VwtujemdUIdpYWdlxK8wQbDzR/ukFt2Wqzm7SMjO1jTkXgfS5ixYD6EphbJ btM0FzMtCevQwlZ7War8FIU8qMLieRFSKts7w4u+YDYB1N7eIUjz9j2UjHfK6BMz3Yj/oD 9l2/F2kGkMwB0a0zT+2sO18S6Vl2CfwzGwWKgjpRPrxoVe5rRxEocYfXoMapZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727558811; a=rsa-sha256; cv=none; b=GN5lmu0z6OLW2wk8vPPj3AqXwrIN6MYHH8pUlnGhHyQfgb8IFw7P3yWqYwehuNqc1ExKaj yqEHRAnkR+nzXQ7AVC0g90AbTmmuvbiBBmUS348vYjIQm0nMsXcvLD4hEgdhX2Yiexz/Bk WeEYCLHXNchzkry58SsNJrtN1XzUf3fOKzhHXkJJ5a3e1CR0cO7yMfsTo+rcCni/dkZSgs 02FdgSPlZQNOfiKBdP4yDyGpNRdkuIvFY0gYT17Z7j/v7kU30HelrdNkfbJfsSb2RsADjg 9e8NfR9wDi1qfg4fQ1VXqyeKuCiF0qi8vhTRB+OJhlBrYlpjNxG3WGFiYKeRKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGL4q4g9Hzh7b; Sat, 28 Sep 2024 21:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SLQpkQ000636; Sat, 28 Sep 2024 21:26:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SLQpMd000633; Sat, 28 Sep 2024 21:26:51 GMT (envelope-from git) Date: Sat, 28 Sep 2024 21:26:51 GMT Message-Id: <202409282126.48SLQpMd000633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 5a5da24fc85a - main - mlx5: optimize ilog2 calculation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a5da24fc85aa7711eed8f3e303c0cf6f5ebcca4 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=5a5da24fc85aa7711eed8f3e303c0cf6f5ebcca4 commit 5a5da24fc85aa7711eed8f3e303c0cf6f5ebcca4 Author: Doug Moore AuthorDate: 2024-09-28 21:24:44 +0000 Commit: Doug Moore CommitDate: 2024-09-28 21:24:44 +0000 mlx5: optimize ilog2 calculation Rather than compute ilog2(roundup_pow_of_two(x)), which invokes ilog2 twice, just use order_base_2 once. And employ that optimization twice. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46838 --- sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c index bd06e531531b..9428e6ece3a4 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c @@ -78,10 +78,10 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, } if (i) { - m = min_t(unsigned long, ilog2(roundup_pow_of_two(i)), m); + m = min_t(unsigned long, order_base_2(i), m); if (order) - *order = ilog2(roundup_pow_of_two(i) >> m); + *order = order_base_2(i) - m; *ncont = DIV_ROUND_UP(i, (1 << m)); } else { From nobody Sat Sep 28 21:47:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGLXy1jCtz5XtR2; Sat, 28 Sep 2024 21:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGLXy1BjHz43y8; Sat, 28 Sep 2024 21:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727560066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=soClXItNKGZ0U+ST0i+lvDk93HyX4vfu8E4Jl+VhmrY=; b=msnMutnaBz9y/rjJh34DkjgNEYoo7DNlQ7npA0jEtKVbrQz2DndBwXxOpUOLdVwL9ySuqB JK49/AzRHFaV+2ov85yYmzK1i+t3rAc47/2dF+jBlq27elx8FNUCCCD7o9Lfn867gtFzPu suyG9OKc4I8SAROm4FDHMum3Gzo86WyvI+CFv4bdHTJ8eV9kkZ67H2Yp0KU4jeWUqINCEF l/oDtdH+53OAOIHezVpCBnbNzeF07fmblxoIOU99VJZyrb+QFXzgZNonJwfggcNc4UjBSm Dyzk8MdZHEMilUWjw3xvjlg7nJeKZPCqkPqRPBW382KUy2nJHCnIpORxC05FyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727560066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=soClXItNKGZ0U+ST0i+lvDk93HyX4vfu8E4Jl+VhmrY=; b=Foo1XnYUGeo5ozFIX49nnjHGEkXt56bJOE1GtjNfgDgramTUAGMF56yIYm1sKjyXBACgAX GvYNX16AWaWrxnJyN/YnzD6cu2++ehfPbGFb4Tu4m18X4L3EubkmjhlNAMyQCqcwvTb88c U+TUcI53kKLIEPApv14jLxduIFWFFCDfL04w07h+9PRf96u3S0Kv6yxP+aLzMsS0KrXk2A XSfLLBasimnTPom0Ewa7ISS5JwFN9X3qDEkBQl4QJCFZRcEg7Fy9D2sAD0AeANyobJIiuO 8TRX9aHatlDwvBDIDaUYgD0ee2u+mpeKXf29gcwKHKNN25pir+jdTkRsZVhJOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727560066; a=rsa-sha256; cv=none; b=Hy8GY+YLuMaITPPOHnfSl6cjE1FgnzOSIaERfFIwexpbRvjo3C9hwt4OsY5gf/euoOKOGw u2v8kfwFNw9qZyoGZ5igjqfUEOkIiUMhtWJDCYYkT51DO2k+sjHI4igd8yRfme8gSlm0p/ iBgOkwedCkuuOWLgAM2GRZIti4BiCt+GZRw7r1Eap5iwDSJVTM4Sf60WXKppDE9wvCPQn0 wNLIrUrFrDf6PjwqMj2rwmnIjXfQtiHg33y4KRq8WvGGwr7PAEhm1pg8xFqhI+ZYLtji2D EonUTzU99t5nzuaaWKOPlVYXpA+tVnTuQOp+b8GMOHhGV1upPTMUI5WLQLtt7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGLXy0ngxzj3K; Sat, 28 Sep 2024 21:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SLlkEe035765; Sat, 28 Sep 2024 21:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SLlkXm035762; Sat, 28 Sep 2024 21:47:46 GMT (envelope-from git) Date: Sat, 28 Sep 2024 21:47:46 GMT Message-Id: <202409282147.48SLlkXm035762@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 76c60597fa2a - main - swap_pager: use vm_page_iterators for lookup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76c60597fa2af9ec5b5a24305794b70ad1530755 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=76c60597fa2af9ec5b5a24305794b70ad1530755 commit 76c60597fa2af9ec5b5a24305794b70ad1530755 Author: Doug Moore AuthorDate: 2024-09-28 21:46:40 +0000 Commit: Doug Moore CommitDate: 2024-09-28 21:46:40 +0000 swap_pager: use vm_page_iterators for lookup Replace the use of page lookups and page next pointers in swap_pager.c with vm_page iterators. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46704 --- sys/vm/swap_pager.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index aa0297daefe9..fbf2967aaf17 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1856,6 +1856,7 @@ swap_pager_swapped_pages(vm_object_t object) static void swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) { + struct pctrie_iter pages; struct page_range range; struct swblk *sb; vm_page_t m; @@ -1870,6 +1871,7 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) pi = 0; i = 0; + vm_page_iter_init(&pages, object); swp_pager_init_freerange(&range); for (;;) { if (i == 0 && (object->flags & OBJ_DEAD) != 0) { @@ -1896,7 +1898,6 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) if (sb == NULL) break; sb_empty = true; - m = NULL; } /* Skip an invalid block. */ @@ -1904,7 +1905,6 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) if (blk == SWAPBLK_NONE || !swp_pager_isondev(blk, sp)) { if (blk != SWAPBLK_NONE) sb_empty = false; - m = NULL; i++; continue; } @@ -1913,8 +1913,7 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) * Look for a page corresponding to this block, If the found * page has pending operations, sleep and restart the scan. */ - m = m != NULL ? vm_page_next(m) : - vm_page_lookup(object, sb->p + i); + m = vm_page_iter_lookup(&pages, sb->p + i); if (m != NULL && (m->oflags & VPO_SWAPINPROG) != 0) { m->oflags |= VPO_SWAPSLEEP; VM_OBJECT_SLEEP(object, &object->handle, PSWP, "swpoff", @@ -2272,6 +2271,7 @@ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, vm_size_t *freed) { + struct pctrie_iter pages; struct page_range range; struct swblk *sb; vm_page_t m; @@ -2282,11 +2282,11 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, VM_OBJECT_ASSERT_WLOCKED(object); fc = 0; - m = NULL; if (count == 0 || swblk_is_empty(object)) goto out; swp_pager_init_freerange(&range); + vm_page_iter_init(&pages, object); last = pindex + count; sb = swblk_start_limit(object, pindex, last); start = (sb != NULL && sb->p < pindex) ? pindex - sb->p : 0; @@ -2298,9 +2298,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, continue; swp_pager_update_freerange(&range, sb->d[i]); if (freed != NULL) { - m = (m != NULL && m->pindex == sb->p + i - 1) ? - vm_page_next(m) : - vm_page_lookup(object, sb->p + i); + m = vm_page_iter_lookup(&pages, sb->p + i); if (m == NULL || vm_page_none_valid(m)) fc++; } From nobody Sat Sep 28 22:03:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGLvF1WHYz5Xv9S; Sat, 28 Sep 2024 22:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGLvF13KKz46fS; Sat, 28 Sep 2024 22:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727561017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=enjilpyxdGSourLVnziQEVTNIGUXReJ7WWD2hRO+qa0=; b=m3VZIrXIFB0OwcSPMfvPcEG+lxWTQLAg8d8kbCm4Jcc6Fn/0S4G1wG/ML7iUewxsoCDPIA 7zmCOR5/2CreWpZPo5KiJzXJrU5cLFZ/3NTmGRSno1LaG0eIrEICEqcc868BYGUFO1idR5 L+LixYnzrjiB2EU2M+Zo0bqysag+oL2A7MPifb1pXVGUyydxuLhQ6O3ISVv62yr/FhL26W /+fMMhTGg64WTX6Y5EPcYgTmlRLGob47fVEBh94an4UW/tlCuBQce9AKa1WAvnykwdV4U9 SwKpcHZJ0MHN6M6foDn4l8BasvmwifQ0BG53PfLQSYhlfKboLkZbKJGaBSPntQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727561017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=enjilpyxdGSourLVnziQEVTNIGUXReJ7WWD2hRO+qa0=; b=YomPX4gc5tf4KGs8qA15lE6bsbcbzg+FF1bjgS4hWOAd0LY0u/lxnFzqJZs/vGEN5Vi033 aKymiw/OyMH5Te3PTEv8cS2lWo3FUosQ0IPcoEiHEzpw7DHKlo60K9i8EzstNLbyGuQFfy 1So3KLC52quiLGBD3yJarcK9cVVJZTgjIfhYUAsCt/gG6NTSsSp4Ib3k8LKEj2KhArE567 1IHsMqqCo9kkSrSRN+wDj8vgmix5EWQamqWC9+zhj5MRr1Xt+4JYJkdGMUeC8/cH7fpS/6 ngp90EcuF/O1dZCRL+fQQP/M0tO68vg7xIxs8uEBU2FeoggIDJd3om4vtxzTfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727561017; a=rsa-sha256; cv=none; b=PilgNr3+xOCvgZ2CS/oxlx3FHMdPWLLYmb8hIQPI7o+2SjdzisJ+sdjeYrLmaxOLIHHIBz /ElvhgYR1qJ8mm7xbUPhKpf6E4JrzqJqFUltd9S3vPWBdGah3wH7koCeHBlHt8PzOzyGT5 s9DJYPqqm6B56l5vzHuuHc6rJ/icht+Qk0J8vuAcPShuGfcjfdMRNDFD9RljXkXNGyLF1/ kM1gZpEQglsmZSyQhnatHoeC1PNWV+rD0uofosHbwwBQUlAG02nmH/dJaOi+3oBAM96KHz 3oC6ibhrvGdhAJcYbS5BzRw2609feNoCuOLmPB6DbYELFvBXd36J6fGV85ck+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGLvF0gDVzj7J; Sat, 28 Sep 2024 22:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SM3aUJ069785; Sat, 28 Sep 2024 22:03:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SM3aOF069782; Sat, 28 Sep 2024 22:03:36 GMT (envelope-from git) Date: Sat, 28 Sep 2024 22:03:36 GMT Message-Id: <202409282203.48SM3aOF069782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 6df05714da16 - main - Revert "nfscl: Enable support for the Lookup+Open RPC" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6df05714da160a8ac3e27ee34ff903bd0e760002 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6df05714da160a8ac3e27ee34ff903bd0e760002 commit 6df05714da160a8ac3e27ee34ff903bd0e760002 Author: Rick Macklem AuthorDate: 2024-09-28 22:01:36 +0000 Commit: Rick Macklem CommitDate: 2024-09-28 22:01:36 +0000 Revert "nfscl: Enable support for the Lookup+Open RPC" This reverts commit 9792c7d3eb41dc1e3709e00a98734c3312d1b4fe. The email thread "panic: nfsv4root ref cnt cpuid=1" on freebsd-fs@freebsd.org descibes crashes that occurred for a NFSv4.1 client mount using "oneopenown" where the same file is re-opened many times by different processes. The crashes appear to have been caused by the use of the Lookup+Open RPC (which only happens for mounts using the "oneopenown" option). There appears to be a race between closure of the open and the open acquired by the Lookup+Open RPC. Since Lookup+Open RPCs are only an optimization and can only be done for "oneopenown" at this time, this patch reverts enabling of them. It may be possible to fix the code so that Lookup+Open works reliably, so the code is left in place (although it will never be executed) for now. Reported by: J David MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clvnops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 13341dfc26e0..bf24a161b94b 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1309,6 +1309,11 @@ nfs_lookup(struct vop_lookup_args *ap) } openmode = 0; +#if 0 + /* + * The use of LookupOpen breaks some builds. It is disabled + * until that is fixed. + */ /* * If this an NFSv4.1/4.2 mount using the "oneopenown" mount * option, it is possible to do the Open operation in the same @@ -1328,6 +1333,7 @@ nfs_lookup(struct vop_lookup_args *ap) openmode |= NFSV4OPEN_ACCESSWRITE; } NFSUNLOCKMNT(nmp); +#endif newvp = NULLVP; NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses); From nobody Sun Sep 29 04:18:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGWDB0162z5YHhL; Sun, 29 Sep 2024 04:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGWD96Gszz4fV0; Sun, 29 Sep 2024 04:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727583529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ezzd0BwcdiI3an3lX4izR9jV2lSef9JH0YKLlWCAFSs=; b=FRStN65o1FcqkhEiTWzuI+CE9x0Wvk5sAySULQjo2zhSlhbDdHWNCJb+z0Gb1PivrtTtJb YBi4VTtTRCxESUI+iYGsNysO9wlgkaFrJfoi+0Ku26DhHROb9zr42DH2B61I0e8hJiqea2 YYG+W9CnAZiZzny+yVEI9At5ImGWpjO2g9+5SvQ0UmMBEPYoOKiWCYZ3oQfILPYDpqwlWj Eksk+lyrqgKg+xiy3989J0Gjauuiegng/TOr3dfpGXc4qlDd7hyIK0NzoWoQQ+RhVwsllu Ng/JhW8kRFtMYOcNfDn+ZWGrnhnP+sO3J1xyZHDRgAx1a7OJvQM9syHt2y7w2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727583529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ezzd0BwcdiI3an3lX4izR9jV2lSef9JH0YKLlWCAFSs=; b=uKaWXb9ZaXoLl+Upj3WV8NI7IFP9wHRV2C0TO0OBo7RLQd5UDHxENAPr7m+f6gPNr9UfNI R9ri+U2Jd6pyFmrsXvtD1wSlEDZ2H3+5kdjQ9Y0/ztWJVysC+HwS/eLkn+M4Tt8MJ5wWpt 5xXaMDP9DTvqna1/AyHnYKyMUBx/7Qe5Zr4dQPBmJO5Lig8oInkePObvOxGWeYgtPr9AVv D5Yndh4mZcTazXLHEac8Mic+M/OtrgemEqAcikzBRnygr74c2S5aPHbW94+qFxpJyxMC5O sf0SZYmJyIvpXreEHeVvebMezoZf1RL6tFnvplH4dHAzoCuXBra25nebuoNZZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727583529; a=rsa-sha256; cv=none; b=NMrAcQIicQcQLVCsyYmFEzqEGL37avSUBaI6M31zkcpeCR6VcOKJE77cVXkzWDE3F51ztA 5lHL4uppWy1IZMU6cwnBpUevn1cMn0eubvy+0QiDEey42ir/rpMnUEgxgiArC1Ble2gTtk gscf4LqnmMqHMzbXuwKSq4gZb4AkoESHbZveHnbb+RhoBs63GiM+nxQZPTkoEMA69hJBML RinGCphpAx1IGASd2gUyI2BqN4kjz+D0A1ON6147W+kKljCyKmY7htii0Y9HvkBaBJmt1o UN9a8HvKiJxUhQ3JSmrmuD6l2KyH1H+MobJ4O/b+FQZSe4cDuyzMbuwaEkMQIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGWD95t9JztNB; Sun, 29 Sep 2024 04:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48T4InLA097752; Sun, 29 Sep 2024 04:18:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48T4InjK097749; Sun, 29 Sep 2024 04:18:49 GMT (envelope-from git) Date: Sun, 29 Sep 2024 04:18:49 GMT Message-Id: <202409290418.48T4InjK097749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 1e3b1870ad2a - main - ixgbe: Switch if_sriov read/write back to ixgbe_mbx APIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e3b1870ad2a426de6e3f5445211b698f20f7f1f Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=1e3b1870ad2a426de6e3f5445211b698f20f7f1f commit 1e3b1870ad2a426de6e3f5445211b698f20f7f1f Author: Kevin Bowling AuthorDate: 2024-09-29 04:15:53 +0000 Commit: Kevin Bowling CommitDate: 2024-09-29 04:17:21 +0000 ixgbe: Switch if_sriov read/write back to ixgbe_mbx APIs These are more succinct than jumping through the function pointers directly and add some additional error handling. MFC after: 1 week --- sys/dev/ixgbe/if_sriov.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 6a2dad4bca42..0916ae1ac7cc 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -100,7 +100,7 @@ ixgbe_send_vf_msg(struct ixgbe_hw *hw, struct ixgbe_vf *vf, u32 msg) if (vf->flags & IXGBE_VF_CTS) msg |= IXGBE_VT_MSGTYPE_CTS; - hw->mbx.ops[vf->pool].write(hw, &msg, 1, vf->pool); + ixgbe_write_mbx(hw, &msg, 1, vf->pool); } static inline void @@ -595,8 +595,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) hw = &sc->hw; - error = hw->mbx.ops[vf->pool].read(hw, msg, IXGBE_VFMAILBOX_SIZE, - vf->pool); + error = ixgbe_read_mbx(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); if (error != 0) return; From nobody Sun Sep 29 04:58:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGX5h57h0z5X65R; Sun, 29 Sep 2024 04:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGX5h4bTkz4hjM; Sun, 29 Sep 2024 04:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727585896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BfjuxQwnWfVnSAz9G3veODR0Y0f6sYo8LJhYqefaKwA=; b=kYdRck4cNhC/tdnDNSLhWcGZRO4ulzw8vseQMgXYkAZ7riV/nRk3bA+KsMx33JB9qNS/yz pSUhgq6cPvCYRnsiU2bApu74i0GQk07av1NClRAXb5mtKG401J6VaJLZauet3rE62EVjCz K1Oj/N0FBq7betmRVkz/SkM3MrrAI62j5/jAn+jtZsMiESEc12XMxovjxDv3CJSYXXAKi/ LxszY9P6HlfMSKlA2DRttvtyvGgjrBJsiIVixPJmIKCyNfe4Lex6B8DRbZefXpiEZayTgK iO4z8ryVeCFBj7pU0eENrUl22+1ipd266stKNpx2DxsAoyqL0CvSqOfouRN07Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727585896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BfjuxQwnWfVnSAz9G3veODR0Y0f6sYo8LJhYqefaKwA=; b=RcEriVMefaT/sEwK/63TOAvZTjqrbQc3Bkx0qoEpVgJGawGaQAfnSMm98H8UMHdi5D0Ko4 Brv7OkouqB6A9E/mk0BMAV4r55oX/7I8P65wX9kSzv9V928wXwadLG7oYtCncfccAs6Uo6 BZaHydeLoyEpdDrchJ7mcslaKiN9AbisUKRunxoCLoLbtvVFVuc/XrLlkuFC0FtsLK1zGh oV0xWMkXNNiFTXqLg41S8dw0uNWY74cVZqRs2WSBEGunyOH4VEPxHM6q0tV9rsai0PVhyj B6qkPDi9tQhLLP4Fz2OAOD33mFRVf5TB3JM+3V5UjOXYvmlUAzDBLY0CMkMnfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727585896; a=rsa-sha256; cv=none; b=qCxp76hDC1x9gcKvCvpV8eVFFV5RrOLnVvb0suE4XAd/u44/itDjstBGYsfa2LXpS5QaPi O27OnhC+asjw/cqhPl2mXMuTv0rcp4tcD+J+BGDSO+t0TNeKW2YDlADpIvV//OIqKCawfU /lqL1yvsjQI2x4LxuGPVDm9CclsU42T58+m+73coCrwUxZk27ijCfYqHlD3wCEIC0BEIfc NK4PzSvAul5fMu3KjePdqpBwTQZA4qFpL1af34X9Yn9SWnAv6vLpOjxSPSAOoj8zl+R0eH FME1BdpuTgtTD1DhhK1cY2TzMc21RUYkLd7GcJvOKscX3a3iqM3AiUPJj84hzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGX5h4BqZzvXf; Sun, 29 Sep 2024 04:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48T4wGjx064637; Sun, 29 Sep 2024 04:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48T4wG7F064634; Sun, 29 Sep 2024 04:58:16 GMT (envelope-from git) Date: Sun, 29 Sep 2024 04:58:16 GMT Message-Id: <202409290458.48T4wG7F064634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a40ecb6f7405 - main - igc: Remove non-existent legacy absolute and packet timers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a40ecb6f740530fb7e6a95e702113aa3fe24d975 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a40ecb6f740530fb7e6a95e702113aa3fe24d975 commit a40ecb6f740530fb7e6a95e702113aa3fe24d975 Author: Kevin Bowling AuthorDate: 2024-09-29 04:32:49 +0000 Commit: Kevin Bowling CommitDate: 2024-09-29 04:57:37 +0000 igc: Remove non-existent legacy absolute and packet timers igc, derived from igb, does not use these registers. All interrupt timing is governed by EITR or LLI and driven by write-back. MFC after: 1 week Sponsored by: BBOX.io --- sys/dev/igc/if_igc.c | 109 ------------------------------------------------- sys/dev/igc/if_igc.h | 59 -------------------------- sys/dev/igc/igc_regs.h | 5 --- 3 files changed, 173 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index bfa33c82f7ba..c78edab5e38a 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -121,9 +121,6 @@ static int igc_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static int igc_get_rs(SYSCTL_HANDLER_ARGS); static void igc_print_debug_info(struct igc_adapter *); static int igc_is_valid_ether_addr(u8 *); -static int igc_sysctl_int_delay(SYSCTL_HANDLER_ARGS); -static void igc_add_int_delay_sysctl(struct igc_adapter *, const char *, - const char *, struct igc_int_delay_info *, int, int); /* Management and WOL Support */ static void igc_get_hw_control(struct igc_adapter *); static void igc_release_hw_control(struct igc_adapter *); @@ -211,12 +208,6 @@ static driver_t igc_if_driver = { * Tunable default values. *********************************************************************/ -#define IGC_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) -#define IGC_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) - -#define MAX_INTS_PER_SEC 8000 -#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) - /* Allow common code without TSO */ #ifndef CSUM_TSO #define CSUM_TSO 0 @@ -229,22 +220,6 @@ static int igc_disable_crc_stripping = 0; SYSCTL_INT(_hw_igc, OID_AUTO, disable_crc_stripping, CTLFLAG_RDTUN, &igc_disable_crc_stripping, 0, "Disable CRC Stripping"); -static int igc_tx_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_TIDV_VAL); -static int igc_rx_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_RDTR_VAL); -SYSCTL_INT(_hw_igc, OID_AUTO, tx_int_delay, CTLFLAG_RDTUN, &igc_tx_int_delay_dflt, - 0, "Default transmit interrupt delay in usecs"); -SYSCTL_INT(_hw_igc, OID_AUTO, rx_int_delay, CTLFLAG_RDTUN, &igc_rx_int_delay_dflt, - 0, "Default receive interrupt delay in usecs"); - -static int igc_tx_abs_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_TADV_VAL); -static int igc_rx_abs_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_RADV_VAL); -SYSCTL_INT(_hw_igc, OID_AUTO, tx_abs_int_delay, CTLFLAG_RDTUN, - &igc_tx_abs_int_delay_dflt, 0, - "Default transmit interrupt delay limit in usecs"); -SYSCTL_INT(_hw_igc, OID_AUTO, rx_abs_int_delay, CTLFLAG_RDTUN, - &igc_rx_abs_int_delay_dflt, 0, - "Default receive interrupt delay limit in usecs"); - static int igc_smart_pwr_down = false; SYSCTL_INT(_hw_igc, OID_AUTO, smart_pwr_down, CTLFLAG_RDTUN, &igc_smart_pwr_down, 0, "Set to true to leave smart power down enabled on newer adapters"); @@ -536,29 +511,6 @@ igc_if_attach_pre(if_ctx_t ctx) igc_setup_msix(ctx); igc_get_bus_info(hw); - /* Set up some sysctls for the tunable interrupt delays */ - igc_add_int_delay_sysctl(adapter, "rx_int_delay", - "receive interrupt delay in usecs", &adapter->rx_int_delay, - IGC_REGISTER(hw, IGC_RDTR), igc_rx_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "tx_int_delay", - "transmit interrupt delay in usecs", &adapter->tx_int_delay, - IGC_REGISTER(hw, IGC_TIDV), igc_tx_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "rx_abs_int_delay", - "receive interrupt delay limit in usecs", - &adapter->rx_abs_int_delay, - IGC_REGISTER(hw, IGC_RADV), - igc_rx_abs_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "tx_abs_int_delay", - "transmit interrupt delay limit in usecs", - &adapter->tx_abs_int_delay, - IGC_REGISTER(hw, IGC_TADV), - igc_tx_abs_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "itr", - "interrupt delay limit in usecs/4", - &adapter->tx_itr, - IGC_REGISTER(hw, IGC_ITR), - DEFAULT_ITR); - hw->mac.autoneg = DO_AUTO_NEG; hw->phy.autoneg_wait_to_complete = false; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; @@ -2015,12 +1967,6 @@ igc_initialize_receive_unit(if_ctx_t ctx) if (!igc_disable_crc_stripping) rctl |= IGC_RCTL_SECRC; - /* - * Set the interrupt throttling rate. Value is calculated - * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) - */ - IGC_WRITE_REG(hw, IGC_ITR, DEFAULT_ITR); - rxcsum = IGC_READ_REG(hw, IGC_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM) { rxcsum |= IGC_RXCSUM_CRCOFL; @@ -2717,61 +2663,6 @@ igc_print_nvm_info(struct igc_adapter *adapter) printf("\n"); } -static int -igc_sysctl_int_delay(SYSCTL_HANDLER_ARGS) -{ - struct igc_int_delay_info *info; - struct igc_adapter *adapter; - u32 regval; - int error, usecs, ticks; - - info = (struct igc_int_delay_info *) arg1; - usecs = info->value; - error = sysctl_handle_int(oidp, &usecs, 0, req); - if (error != 0 || req->newptr == NULL) - return (error); - if (usecs < 0 || usecs > IGC_TICKS_TO_USECS(65535)) - return (EINVAL); - info->value = usecs; - ticks = IGC_USECS_TO_TICKS(usecs); - if (info->offset == IGC_ITR) /* units are 256ns here */ - ticks *= 4; - - adapter = info->adapter; - - regval = IGC_READ_OFFSET(&adapter->hw, info->offset); - regval = (regval & ~0xffff) | (ticks & 0xffff); - /* Handle a few special cases. */ - switch (info->offset) { - case IGC_RDTR: - break; - case IGC_TIDV: - if (ticks == 0) { - adapter->txd_cmd &= ~IGC_TXD_CMD_IDE; - /* Don't write 0 into the TIDV register. */ - regval++; - } else - adapter->txd_cmd |= IGC_TXD_CMD_IDE; - break; - } - IGC_WRITE_OFFSET(&adapter->hw, info->offset, regval); - return (0); -} - -static void -igc_add_int_delay_sysctl(struct igc_adapter *adapter, const char *name, - const char *description, struct igc_int_delay_info *info, - int offset, int value) -{ - info->adapter = adapter; - info->offset = offset; - info->value = value; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(adapter->dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, - info, 0, igc_sysctl_int_delay, "I", description); -} - /* * Set flow control using sysctl: * Flow control values: diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h index 0c22ce9f76f4..92865b5b9eb1 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -131,65 +131,6 @@ #define IGC_DEFAULT_MULTI_RXD 4096 #define IGC_MAX_RXD 4096 -/* - * IGC_TIDV_VAL - Transmit Interrupt Delay Value - * Valid Range: 0-65535 (0=off) - * Default Value: 64 - * This value delays the generation of transmit interrupts in units of - * 1.024 microseconds. Transmit interrupt reduction can improve CPU - * efficiency if properly tuned for specific network traffic. If the - * system is reporting dropped transmits, this value may be set too high - * causing the driver to run out of available transmit descriptors. - */ -#define IGC_TIDV_VAL 64 - -/* - * IGC_TADV_VAL - Transmit Absolute Interrupt Delay Value - * Valid Range: 0-65535 (0=off) - * Default Value: 64 - * This value, in units of 1.024 microseconds, limits the delay in which a - * transmit interrupt is generated. Useful only if IGC_TIDV is non-zero, - * this value ensures that an interrupt is generated after the initial - * packet is sent on the wire within the set amount of time. Proper tuning, - * along with IGC_TIDV_VAL, may improve traffic throughput in specific - * network conditions. - */ -#define IGC_TADV_VAL 64 - -/* - * IGC_RDTR_VAL - Receive Interrupt Delay Timer (Packet Timer) - * Valid Range: 0-65535 (0=off) - * Default Value: 0 - * This value delays the generation of receive interrupts in units of 1.024 - * microseconds. Receive interrupt reduction can improve CPU efficiency if - * properly tuned for specific network traffic. Increasing this value adds - * extra latency to frame reception and can end up decreasing the throughput - * of TCP traffic. If the system is reporting dropped receives, this value - * may be set too high, causing the driver to run out of available receive - * descriptors. - * - * CAUTION: When setting IGC_RDTR to a value other than 0, adapters - * may hang (stop transmitting) under certain network conditions. - * If this occurs a WATCHDOG message is logged in the system - * event log. In addition, the controller is automatically reset, - * restoring the network connection. To eliminate the potential - * for the hang ensure that IGC_RDTR is set to 0. - */ -#define IGC_RDTR_VAL 0 - -/* - * Receive Interrupt Absolute Delay Timer - * Valid Range: 0-65535 (0=off) - * Default Value: 64 - * This value, in units of 1.024 microseconds, limits the delay in which a - * receive interrupt is generated. Useful only if IGC_RDTR is non-zero, - * this value ensures that an interrupt is generated after the initial - * packet is received within the set amount of time. Proper tuning, - * along with IGC_RDTR, may improve traffic throughput in specific network - * conditions. - */ -#define IGC_RADV_VAL 64 - /* * This parameter controls whether or not autonegotation is enabled. * 0 - Disable autonegotiation diff --git a/sys/dev/igc/igc_regs.h b/sys/dev/igc/igc_regs.h index f4ded07ce6ab..26614dc33df6 100644 --- a/sys/dev/igc/igc_regs.h +++ b/sys/dev/igc/igc_regs.h @@ -27,7 +27,6 @@ #define IGC_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ #define IGC_VET 0x00038 /* VLAN Ether Type - RW */ #define IGC_ICR 0x01500 /* Intr Cause Read - RC/W1C */ -#define IGC_ITR 0x000C4 /* Interrupt Throttling Rate - RW */ #define IGC_ICS 0x01504 /* Intr Cause Set - WO */ #define IGC_IMS 0x01508 /* Intr Mask Set/Read - RW */ #define IGC_IMC 0x0150C /* Intr Mask Clear - WO */ @@ -78,8 +77,6 @@ #define IGC_FCRTV 0x02460 /* Flow Control Refresh Timer Value - RW */ /* Split and Replication Rx Control - RW */ #define IGC_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */ -#define IGC_RDTR 0x02820 /* Rx Delay Timer - RW */ -#define IGC_RADV 0x0282C /* Rx Interrupt Absolute Delay Timer - RW */ /* Shadow Ram Write Register - RW */ #define IGC_SRWR 0x12018 #define IGC_EEC_REG 0x12010 @@ -148,8 +145,6 @@ #define IGC_FFVT_REG(_i) (0x09800 + ((_i) * 8)) #define IGC_FFLT_REG(_i) (0x05F00 + ((_i) * 8)) #define IGC_TXPBS 0x03404 /* Tx Packet Buffer Size - RW */ -#define IGC_TIDV 0x03820 /* Tx Interrupt Delay Value - RW */ -#define IGC_TADV 0x0382C /* Tx Interrupt Absolute Delay Val - RW */ /* Statistics Register Descriptions */ #define IGC_CRCERRS 0x04000 /* CRC Error Count - R/clr */ #define IGC_ALGNERRC 0x04004 /* Alignment Error Count - R/clr */ From nobody Sun Sep 29 08:33:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGcsq4GTqz5XL5M; Sun, 29 Sep 2024 08:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGcsq2ffmz41JK; Sun, 29 Sep 2024 08:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727598799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ITNTCGG+NrOEpa3eunZueiwHgps8Se7FNeTNI++JPE=; b=m3x8vddVIpcjAVsJ5Keb3EATii6yggBt6dxAy18oK9m1ZK86zVgBQV71q+Zqr9CQnpIBfT x2CX/vtkJmbDHh8LGsTjY8UqWtRYPS4Bk1CfSTkqfhxfMfggFf3kNBtF8h0x7ODWxCUqup PtfRNVOwJ7VU6X5a4Ir/euixK9P29EnbHW25k4EAiXej9TfDhLqJ6Vm9W3y5rrBIKJgMnR IULJcMCcSnouTbVzcc54HgPYRKtmR8pS5NLcR/beFHYOiVVaI0mcA1T7TG1CauEeNDqxF+ WO2aqco1/f29TrLk2VaplfV16YXq1UKo/ObkpQg1Lcygdmn6B0cKUwVbKYUkGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727598799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ITNTCGG+NrOEpa3eunZueiwHgps8Se7FNeTNI++JPE=; b=cY2ENgZzAK0hentC98CeyHkOaxCA8gS5/IEWXBenKVp0okuCrEGLTvXsTGiadW3njBFFix QR45Xp3yZuDREmaGOZpd992+i5zs1r6S5sFAH6k4XDgRR2PZUIH+gUoayGv7n0hUDypr7i T/PZTtxj+0RRKD3F/vPxJhF8LIfkit/sdUyblKb1zxACb75Ca4cU4nf3lAbUVHlIQvXQ43 iknAmlzlfnpNLRLVa6P7rNcfHkI4ScbEMrLkLLm1EPWADd9izn4roo8GxGiHgkPgyJP3n6 rlmr75B+c830zmUH/tkoC+rzGF7Ix59u71ihi5gmggEWnnpkkTBIeIk3jdzecg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727598799; a=rsa-sha256; cv=none; b=HaLp6MKgTQVFWnhd2N4xr8jLLgtKxHy/Zp1UnUdmEgrf81zCLo7eAAOVKpMAxM3+q3rW/8 3cuDXx2rB+Rty0lUZfkZaVIrr1koiz02Cq8LWyInUXpglsY/vMVvQd212pXFcLquCYfEkb sW+B4Y1ZBxJb9R4YvqZtWrc70QyBC/+oBob7VaRweMRYrtb8qgvC6m3VNeMBiRFUV9CKKi mNwi6V2lQTnjv9iE9ESGL4ShpwkMVjBHktKzfNh7Pq1J89rT1r1nP806yau4ZBkSkH3r+U 4lk2YlieqKKVVHpz6VVHmiiKddxKgvdhFRJ0lcZOHW1Gw0zQ5WD85gcERWm75Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGcsq2GmPz12Pr; Sun, 29 Sep 2024 08:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48T8XJbX036476; Sun, 29 Sep 2024 08:33:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48T8XJpU036473; Sun, 29 Sep 2024 08:33:19 GMT (envelope-from git) Date: Sun, 29 Sep 2024 08:33:19 GMT Message-Id: <202409290833.48T8XJpU036473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Popov Subject: git: 1df198cf9302 - main - usr.sbin/jail/jail.8: Make a reference more accurate List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1df198cf93024e75abd7e4723171c4c54abb6973 Auto-Submitted: auto-generated The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=1df198cf93024e75abd7e4723171c4c54abb6973 commit 1df198cf93024e75abd7e4723171c4c54abb6973 Author: Gleb Popov AuthorDate: 2024-09-28 12:53:17 +0000 Commit: Gleb Popov CommitDate: 2024-09-29 08:33:14 +0000 usr.sbin/jail/jail.8: Make a reference more accurate The zfs-jail(8) link is also used in the other place within this man Approved By: imp Differential Revision: https://reviews.freebsd.org/D46832 --- usr.sbin/jail/jail.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 881d07b1b626..89e669adc47f 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -750,7 +750,7 @@ and only when .Va enforce_statfs is set to a value lower than 2. See -.Xr zfs 8 +.Xr zfs-jail 8 for information on how to configure the ZFS filesystem to operate from within a jail. .It Va allow.vmm From nobody Sun Sep 29 10:06:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGfwy1cWVz5XRml; Sun, 29 Sep 2024 10:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGfwy13vRz4G2H; Sun, 29 Sep 2024 10:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727604370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlauLow5WNM/Ha5TW6U33eG6crw7owsmnyNLN87Oo0M=; b=XzdPPYIPqw30Iz6cgTEWyXHoH59dENxJ354s41+sogBR2b2JTak6BhsciKsYxa/0YLTlBg K0G/999ZBsfzxK8wggFTKAa6f6FnLiGpatM1kq8SIdcux3aTYnjmbBgIHmIVABFpbIL3l7 jtoFRj0FtCu/grvRpCFSmCObjzQeagPx6sG4hdriYw1AQnLQjC0Dha9RxprMwRqligGPFa wqd7Jt6qTegkHoQSTBr6Ku/vMp5XMWLZLk0YsyolZnSlHlYxJAsEyuajFv/ouNk0E3abVm KFkLCj9b1NzYbIoeOxhPxc5EyuMpDeWHGpktQZ/+YxhyxO7aacRa3JLsHrqo1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727604370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlauLow5WNM/Ha5TW6U33eG6crw7owsmnyNLN87Oo0M=; b=dice+Pj89MQ8bpqvmZCLagFC+8byd+rN2r7SOF5mIBVfgIQ7Q7I2Ba3yyBvptW10T0usQw bxLSG2Ux5h3U6S65oiopI1HToc+q3bEcvN3SWN3L1yJThK6A3diVKkIoi5i/nyS/LeWbPz FC7VI7SGDlS3pImB/qisC15oGb17k3ZMznTNlGYFDzye8VuswTU9gOSSBBNPR7woiIqSs0 Le8kQW2eYt0N4BjxJjUdkzcZ9dq/isYN6wl8x1ui8753wLOn3Cyv/YJCHNqGJcUBpZ8o44 FAll3a7TIhYhxZVvGEA1j83mil5sd71TNcmXgSr7J5QXocBVddIBCLnQLnOjyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727604370; a=rsa-sha256; cv=none; b=NieytRODDKMNCQygE3GOAtIYAOEqSTZ0xeLVl7R7lL8PsEPDGnhckbiNxLCWKP5ulFY/xF +PvyaJUxCOSkhhhH9+TZZtB+L5mzj5UwZVqPA+2NROX4+HI14WEMktbYvbX7vNxwLLJA5Y HsCjxpj9xkvavOEDZ1S9KtAjgsF01lQEKWhTYV0GENKYT0/qyO1qyTWI+VK1B5O7Oez3iG Wn+53JtspJChmfZAssjpw4i9hipS1cHCNXUBQVNFQZXWd4/FSiYQf3ewaO6hIPRISX35YD vYrXEBqdfaCoX4iGQEAofUQR5c7Ad80H2kJ55fMNR7Ktry4e5H2fb6AnFVd/dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGfwy0g2Tz14NH; Sun, 29 Sep 2024 10:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48TA69Yw090981; Sun, 29 Sep 2024 10:06:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48TA69VZ090978; Sun, 29 Sep 2024 10:06:09 GMT (envelope-from git) Date: Sun, 29 Sep 2024 10:06:09 GMT Message-Id: <202409291006.48TA69VZ090978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 33ed9bdca307 - main - igc: Add NVM/firmware prints and sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33ed9bdca307bedb3d66a50ed7d4d7b4bf4acf39 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=33ed9bdca307bedb3d66a50ed7d4d7b4bf4acf39 commit 33ed9bdca307bedb3d66a50ed7d4d7b4bf4acf39 Author: Kevin Bowling AuthorDate: 2024-09-29 09:23:38 +0000 Commit: Kevin Bowling CommitDate: 2024-09-29 10:06:03 +0000 igc: Add NVM/firmware prints and sysctl This chipset suffered an (un)usual number of bugs and iterations. Let's add our NVM/firmware code from e1000 and the similar igc_nvm function from DPDK to keep track of issues. MFC after: 1 week Sponsored by: BBOX.io --- sys/dev/igc/if_igc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/igc/if_igc.h | 2 + sys/dev/igc/igc_defines.h | 28 +++++++++++-- sys/dev/igc/igc_nvm.c | 81 ++++++++++++++++++++++++++++++++++++ sys/dev/igc/igc_nvm.h | 18 ++++++++ 5 files changed, 229 insertions(+), 4 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index c78edab5e38a..006fecdab7b0 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -115,6 +115,10 @@ static void igc_update_stats_counters(struct igc_adapter *); static void igc_add_hw_stats(struct igc_adapter *adapter); static int igc_if_set_promisc(if_ctx_t ctx, int flags); static void igc_setup_vlan_hw_support(if_ctx_t ctx); +static void igc_fw_version(struct igc_adapter *); +static void igc_sbuf_fw_version(struct igc_fw_version *, struct sbuf *); +static void igc_print_fw_version(struct igc_adapter *); +static int igc_sysctl_print_fw_version(SYSCTL_HANDLER_ARGS); static int igc_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); static void igc_print_nvm_info(struct igc_adapter *); static int igc_sysctl_debug_info(SYSCTL_HANDLER_ARGS); @@ -440,6 +444,12 @@ igc_if_attach_pre(if_ctx_t ctx) OID_AUTO, "nvm", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, adapter, 0, igc_sysctl_nvm_info, "I", "NVM Information"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, + adapter, 0, igc_sysctl_print_fw_version, "A", + "Prints FW/NVM Versions"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "debug", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, @@ -586,6 +596,11 @@ igc_if_attach_pre(if_ctx_t ctx) goto err_late; } + /* Save the EEPROM/NVM versions */ + igc_fw_version(adapter); + + igc_print_fw_version(adapter); + /* * Get Wake-on-Lan and Management info for later use */ @@ -2612,6 +2627,95 @@ igc_add_hw_stats(struct igc_adapter *adapter) "Rx Desc Min Thresh Count"); } +static void +igc_fw_version(struct igc_adapter *sc) +{ + struct igc_hw *hw = &sc->hw; + struct igc_fw_version *fw_ver = &sc->fw_ver; + + *fw_ver = (struct igc_fw_version){0}; + + igc_get_fw_version(hw, fw_ver); +} + +static void +igc_sbuf_fw_version(struct igc_fw_version *fw_ver, struct sbuf *buf) +{ + const char *space = ""; + + if (fw_ver->eep_major || fw_ver->eep_minor || fw_ver->eep_build) { + sbuf_printf(buf, "EEPROM V%d.%d-%d", fw_ver->eep_major, + fw_ver->eep_minor, fw_ver->eep_build); + space = " "; + } + + if (fw_ver->invm_major || fw_ver->invm_minor || fw_ver->invm_img_type) { + sbuf_printf(buf, "%sNVM V%d.%d imgtype%d", + space, fw_ver->invm_major, fw_ver->invm_minor, + fw_ver->invm_img_type); + space = " "; + } + + if (fw_ver->or_valid) { + sbuf_printf(buf, "%sOption ROM V%d-b%d-p%d", + space, fw_ver->or_major, fw_ver->or_build, + fw_ver->or_patch); + space = " "; + } + + if (fw_ver->etrack_id) + sbuf_printf(buf, "%seTrack 0x%08x", space, fw_ver->etrack_id); +} + +static void +igc_print_fw_version(struct igc_adapter *sc ) +{ + device_t dev = sc->dev; + struct sbuf *buf; + int error = 0; + + buf = sbuf_new_auto(); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for output.\n"); + return; + } + + igc_sbuf_fw_version(&sc->fw_ver, buf); + + error = sbuf_finish(buf); + if (error) + device_printf(dev, "Error finishing sbuf: %d\n", error); + else if (sbuf_len(buf)) + device_printf(dev, "%s\n", sbuf_data(buf)); + + sbuf_delete(buf); +} + +static int +igc_sysctl_print_fw_version(SYSCTL_HANDLER_ARGS) +{ + struct igc_adapter *sc = (struct igc_adapter *)arg1; + device_t dev = sc->dev; + struct sbuf *buf; + int error = 0; + + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for output.\n"); + return (ENOMEM); + } + + igc_sbuf_fw_version(&sc->fw_ver, buf); + + error = sbuf_finish(buf); + if (error) + device_printf(dev, "Error finishing sbuf: %d\n", error); + + sbuf_delete(buf); + + return (0); +} + /********************************************************************** * * This routine provides a way to dump out the adapter eeprom, diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h index 92865b5b9eb1..727699baee5f 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -332,6 +332,8 @@ struct igc_adapter { u64 que_mask; + struct igc_fw_version fw_ver; + struct igc_int_delay_info tx_int_delay; struct igc_int_delay_info tx_abs_int_delay; struct igc_int_delay_info rx_int_delay; diff --git a/sys/dev/igc/igc_defines.h b/sys/dev/igc/igc_defines.h index 1701918c3a9c..e9ebd23c41c3 100644 --- a/sys/dev/igc/igc_defines.h +++ b/sys/dev/igc/igc_defines.h @@ -967,11 +967,31 @@ #define IGC_FLASH_UPDATES 2000 /* NVM Word Offsets */ -#define NVM_COMPAT 0x0003 -#define NVM_ID_LED_SETTINGS 0x0004 -#define NVM_FUTURE_INIT_WORD1 0x0019 -#define NVM_COMPAT_VALID_CSUM 0x0001 +#define NVM_COMPAT 0x0003 +#define NVM_ID_LED_SETTINGS 0x0004 +#define NVM_VERSION 0x0005 +#define NVM_FUTURE_INIT_WORD1 0x0019 +#define NVM_COMPAT_VALID_CSUM 0x0001 #define NVM_FUTURE_INIT_WORD1_VALID_CSUM 0x0040 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_ETRACK_HIWORD 0x0043 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003d + +/* NVM version defines */ +#define NVM_MAJOR_MASK 0xF000 +#define NVM_MINOR_MASK 0x0FF0 +#define NVM_IMAGE_ID_MASK 0x000F +#define NVM_COMB_VER_MASK 0x00FF +#define NVM_MAJOR_SHIFT 12 +#define NVM_MINOR_SHIFT 4 +#define NVM_COMB_VER_SHFT 8 +#define NVM_VER_INVALID 0xFFFF +#define NVM_ETRACK_SHIFT 16 +#define NVM_ETRACK_VALID 0x8000 +#define NVM_NEW_DEC_MASK 0x0F00 +#define NVM_HEX_CONV 16 +#define NVM_HEX_TENS 10 #define NVM_INIT_CONTROL2_REG 0x000F #define NVM_INIT_CONTROL3_PORT_B 0x0014 diff --git a/sys/dev/igc/igc_nvm.c b/sys/dev/igc/igc_nvm.c index d86e04ffa0dc..b476a5fdbeac 100644 --- a/sys/dev/igc/igc_nvm.c +++ b/sys/dev/igc/igc_nvm.c @@ -716,4 +716,85 @@ static void igc_reload_nvm_generic(struct igc_hw *hw) IGC_WRITE_FLUSH(hw); } +/** + * igc_get_fw_version - Get firmware version information + * @hw: pointer to the HW structure + * @fw_vers: pointer to output version structure + * + * unsupported/not present features return 0 in version structure + **/ +void igc_get_fw_version(struct igc_hw *hw, struct igc_fw_version *fw_vers) +{ + u16 eeprom_verh, eeprom_verl, etrack_test, fw_version; + u8 q, hval, rem, result; + u16 comb_verh, comb_verl, comb_offset; + + memset(fw_vers, 0, sizeof(struct igc_fw_version)); + /* + * basic eeprom version numbers, bits used vary by part and by tool + * used to create the nvm images. Check which data format we have. + */ + switch (hw->mac.type) { + case igc_i225: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + /* find combo image version */ + hw->nvm.ops.read(hw, NVM_COMB_VER_PTR, 1, &comb_offset); + if (comb_offset && comb_offset != NVM_VER_INVALID) { + hw->nvm.ops.read(hw, NVM_COMB_VER_OFF + comb_offset + 1, + 1, &comb_verh); + hw->nvm.ops.read(hw, NVM_COMB_VER_OFF + comb_offset, + 1, &comb_verl); + + /* get Option Rom version if it exists and is valid */ + if (comb_verh && comb_verl && + comb_verh != NVM_VER_INVALID && + comb_verl != NVM_VER_INVALID) { + fw_vers->or_valid = true; + fw_vers->or_major = comb_verl >> + NVM_COMB_VER_SHFT; + fw_vers->or_build = (comb_verl << + NVM_COMB_VER_SHFT) | + (comb_verh >> + NVM_COMB_VER_SHFT); + fw_vers->or_patch = comb_verh & + NVM_COMB_VER_MASK; + } + } + break; + default: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + return; + } + hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); + fw_vers->eep_major = (fw_version & NVM_MAJOR_MASK) + >> NVM_MAJOR_SHIFT; + + /* check for old style version format in newer images*/ + if ((fw_version & NVM_NEW_DEC_MASK) == 0x0) { + eeprom_verl = (fw_version & NVM_COMB_VER_MASK); + } else { + eeprom_verl = (fw_version & NVM_MINOR_MASK) + >> NVM_MINOR_SHIFT; + } + /* Convert minor value to hex before assigning to output struct + * Val to be converted will not be higher than 99, per tool output + */ + q = eeprom_verl / NVM_HEX_CONV; + hval = q * NVM_HEX_TENS; + rem = eeprom_verl % NVM_HEX_CONV; + result = hval + rem; + fw_vers->eep_minor = result; + + if ((etrack_test & NVM_MAJOR_MASK) == NVM_ETRACK_VALID) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verl); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verh); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) + | eeprom_verl; + } else if ((etrack_test & NVM_ETRACK_VALID) == 0) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verh); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verl); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) | + eeprom_verl; + } +} diff --git a/sys/dev/igc/igc_nvm.h b/sys/dev/igc/igc_nvm.h index eae0db4b484b..b4b602af6595 100644 --- a/sys/dev/igc/igc_nvm.h +++ b/sys/dev/igc/igc_nvm.h @@ -7,6 +7,22 @@ #ifndef _IGC_NVM_H_ #define _IGC_NVM_H_ +struct igc_fw_version { + u32 etrack_id; + u16 eep_major; + u16 eep_minor; + u16 eep_build; + + u8 invm_major; + u8 invm_minor; + u8 invm_img_type; + + bool or_valid; + u16 or_major; + u16 or_build; + u16 or_patch; +}; + void igc_init_nvm_ops_generic(struct igc_hw *hw); s32 igc_null_read_nvm(struct igc_hw *hw, u16 a, u16 b, u16 *c); void igc_null_nvm_generic(struct igc_hw *hw); @@ -26,5 +42,7 @@ s32 igc_write_nvm_spi(struct igc_hw *hw, u16 offset, u16 words, u16 *data); s32 igc_update_nvm_checksum_generic(struct igc_hw *hw); void igc_release_nvm_generic(struct igc_hw *hw); +void igc_get_fw_version(struct igc_hw *hw, + struct igc_fw_version *fw_vers); #endif From nobody Sun Sep 29 16:47:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGqqz3GT6z5Xthp; Sun, 29 Sep 2024 16:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGqqz2hysz45CC; Sun, 29 Sep 2024 16:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727628447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AEohoBIw6PTjzZTa78k7uhSciB4JlHWrYOheSWociUY=; b=sjjQZ2imJB4ukFd5qeMC3NNHggR0RJZ9JgkjheoDVwuGqMmknJ5yQzCBVWy0Xm4FiNG8Pd BiILo9niKwUBYUKBW16GpLOmxUaRtO8s9N9q5CxaFoOZwXVNTKvaDd2PnZ44yEXT3JHgjp u3qoS3OiUIUT45E7XI3nKh6DdE7NBIvodzJ5Xr+AHcTeoYnqSPQvomOPWEjgH4AZxbBN2k bvZwExvNX0CMD8WEGHuCoGNAA/cJfxOntZY9CqcXy1uvFQuWv4WxvGAPW3HEnmF848pQvB aEDLl+CWqoZG4NEjrlD8PsFcUWm2Moc3Bq4ZRlmTrxcoaRnOdt5JW5LKoDeKgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727628447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AEohoBIw6PTjzZTa78k7uhSciB4JlHWrYOheSWociUY=; b=SKcw1soWmKd2NeoEngKGMnx+UjbjZ+ux7nGSq3+Jhj2deeP9u43+m92zGt2mbcI/d1Ce5b 52xROTIGK3BQqVxpnRc0ecdhTeq9ODFO10Zklai51s+Jp+9nFcD3o9eeQ6tnMA50/BqQiK TIl4DPrD332YKXqeCktqp4Sd6NkjOZyV3eTX4/ycfRleTiSqYNndbhO4wfmU34ZMG+OrCB YDR/ShobArowKteiRqegg4cBUldCm882bmTyTifMh1MHTtt80HqBQNEqfmHW+c7HK/k3Qw LTvw2YMMJuyMLFPFZ2XN7qpXLw/V2qGZSM/JXb3CLKWZWIqklOazoEeJPBglDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727628447; a=rsa-sha256; cv=none; b=NpP+Z5zhLAORPkkl7wwfRACYiMVyvXkjeNHurZE6dXus1TM3DP0rl8J8bLrdXQRl2MIPHW QfK8rbWgRGOFpn617CqnN6v0M/0F2M+2adUnU5AIzNI2QRR9qbb6K52aLc1Q5KQX3vTOMj EZ9jh1XqGJWL0CK20wRsSzB1AbdkvuqmE9iFyfAXCXsCLkaBtl9Tf0+Jdpl04WKcNQh3in EqTHJ4gPIvnwa53BP2dhSpnIHem+NBMRhUbuH3/nMCsTdG+QgPq2AtvjoW8vWq9UuQmlDu oLHhDUrr8xIhsjJkT0cqlu82JAzar03Nkugn4m8v/qs2NF3gJVZJMI7L2OoiRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGqqz20WCzHHg; Sun, 29 Sep 2024 16:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48TGlRGI065754; Sun, 29 Sep 2024 16:47:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48TGlR4Z065751; Sun, 29 Sep 2024 16:47:27 GMT (envelope-from git) Date: Sun, 29 Sep 2024 16:47:27 GMT Message-Id: <202409291647.48TGlR4Z065751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 52b35140528c - main - swap_pager: examine swblks with pctrie iterators List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52b35140528c3ada05cccbd9246d80d9148b9f38 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=52b35140528c3ada05cccbd9246d80d9148b9f38 commit 52b35140528c3ada05cccbd9246d80d9148b9f38 Author: Doug Moore AuthorDate: 2024-09-29 16:38:53 +0000 Commit: Doug Moore CommitDate: 2024-09-29 16:38:53 +0000 swap_pager: examine swblks with pctrie iterators Replace calls to pctrie lookup and remove functions, which always begin with a search from the pctrie root, with the use of pctrie iterators to traverse and remove items from the pctrie of swapblks without duplicating searches. Take care to reset iterators after reacquiring an object lock, since with the lock released they could be invalidated. Reviewed by: alc, markj, kib Tested by: pho (previous versions) Differential Revision: https://reviews.freebsd.org/D46620 --- sys/vm/swap_pager.c | 275 ++++++++++++++++++++++++++++------------------------ 1 file changed, 148 insertions(+), 127 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index fbf2967aaf17..3a8c7e0f5777 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -529,6 +529,13 @@ swblk_trie_free(struct pctrie *ptree, void *node) uma_zfree(swpctrie_zone, node); } +static int +swblk_start(struct swblk *sb, vm_pindex_t pindex) +{ + return (sb == NULL || sb->p >= pindex ? + 0 : pindex % SWAP_META_PAGES); +} + PCTRIE_DEFINE(SWAP, swblk, p, swblk_trie_alloc, swblk_trie_free); static struct swblk * @@ -538,50 +545,56 @@ swblk_lookup(vm_object_t object, vm_pindex_t pindex) rounddown(pindex, SWAP_META_PAGES))); } -static struct swblk * -swblk_start(vm_object_t object, vm_pindex_t pindex) +static void +swblk_lookup_remove(vm_object_t object, struct swblk *sb) { - return (SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks, - rounddown(pindex, SWAP_META_PAGES))); + SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, sb->p); } -static struct swblk * -swblk_next(vm_object_t object, struct swblk *sb) +static int +swblk_lookup_insert(vm_object_t object, struct swblk *sb) { - return (swblk_start(object, sb->p + SWAP_META_PAGES)); + return (SWAP_PCTRIE_INSERT(&object->un_pager.swp.swp_blks, sb)); } -static struct swblk * -swblk_start_limit(vm_object_t object, vm_pindex_t pindex, vm_pindex_t limit) +static bool +swblk_is_empty(vm_object_t object) { - struct swblk *sb = swblk_start(object, pindex); - if (sb != NULL && sb->p < limit) - return (sb); - return (NULL); + return (pctrie_is_empty(&object->un_pager.swp.swp_blks)); } static struct swblk * -swblk_next_limit(vm_object_t object, struct swblk *sb, vm_pindex_t limit) +swblk_iter(struct pctrie_iter *blks, vm_object_t object, + vm_pindex_t pindex) { - return (swblk_start_limit(object, sb->p + SWAP_META_PAGES, limit)); + VM_OBJECT_ASSERT_LOCKED(object); + MPASS((object->flags & OBJ_SWAP) != 0); + pctrie_iter_init(blks, &object->un_pager.swp.swp_blks); + return (SWAP_PCTRIE_ITER_LOOKUP_GE(blks, + rounddown(pindex, SWAP_META_PAGES))); } -static void -swblk_lookup_remove(vm_object_t object, struct swblk *sb) +static struct swblk * +swblk_iter_limit(struct pctrie_iter *blks, vm_object_t object, + vm_pindex_t pindex, vm_pindex_t limit) { - SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, sb->p); + VM_OBJECT_ASSERT_LOCKED(object); + MPASS((object->flags & OBJ_SWAP) != 0); + pctrie_iter_limit_init(blks, &object->un_pager.swp.swp_blks, limit); + return (SWAP_PCTRIE_ITER_LOOKUP_GE(blks, + rounddown(pindex, SWAP_META_PAGES))); } -static int -swblk_lookup_insert(vm_object_t object, struct swblk *sb) +static struct swblk * +swblk_iter_next(struct pctrie_iter *blks) { - return (SWAP_PCTRIE_INSERT(&object->un_pager.swp.swp_blks, sb)); + return (SWAP_PCTRIE_ITER_JUMP_GE(blks, SWAP_META_PAGES)); } -static bool -swblk_is_empty(vm_object_t object) +static void +swblk_iter_remove(struct pctrie_iter *blks) { - return (pctrie_is_empty(&object->un_pager.swp.swp_blks)); + SWAP_PCTRIE_ITER_REMOVE(blks); } /* @@ -1827,6 +1840,7 @@ swp_pager_force_dirty(struct page_range *range, vm_page_t m, daddr_t *blk) u_long swap_pager_swapped_pages(vm_object_t object) { + struct pctrie_iter blks; struct swblk *sb; u_long res; int i; @@ -1837,8 +1851,8 @@ swap_pager_swapped_pages(vm_object_t object) return (0); res = 0; - for (sb = swblk_start(object, 0); sb != NULL; - sb = swblk_next(object, sb)) { + for (sb = swblk_iter(&blks, object, 0); sb != NULL; + sb = swblk_iter_next(&blks)) { for (i = 0; i < SWAP_META_PAGES; i++) { if (sb->d[i] != SWAPBLK_NONE) res++; @@ -1856,25 +1870,24 @@ swap_pager_swapped_pages(vm_object_t object) static void swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) { - struct pctrie_iter pages; + struct pctrie_iter blks, pages; struct page_range range; struct swblk *sb; vm_page_t m; - vm_pindex_t pi; - daddr_t blk; int i, rahead, rv; bool sb_empty; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_SWAP) != 0, ("%s: Object not swappable", __func__)); + KASSERT((sp->sw_flags & SW_CLOSING) != 0, + ("%s: Device not blocking further allocations", __func__)); - pi = 0; - i = 0; vm_page_iter_init(&pages, object); swp_pager_init_freerange(&range); - for (;;) { - if (i == 0 && (object->flags & OBJ_DEAD) != 0) { + sb = swblk_iter(&blks, object, 0); + while (sb != NULL) { + if ((object->flags & OBJ_DEAD) != 0) { /* * Make sure that pending writes finish before * returning. @@ -1883,78 +1896,83 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) swp_pager_meta_free_all(object); break; } + sb_empty = true; + for (i = 0; i < SWAP_META_PAGES; i++) { + /* Skip an invalid block. */ + if (sb->d[i] == SWAPBLK_NONE) + continue; + /* Skip a block not of this device. */ + if (!swp_pager_isondev(sb->d[i], sp)) { + sb_empty = false; + continue; + } - if (i == SWAP_META_PAGES) { - pi = sb->p + SWAP_META_PAGES; - if (sb_empty) { - swblk_lookup_remove(object, sb); - uma_zfree(swblk_zone, sb); + /* + * Look for a page corresponding to this block. If the + * found page has pending operations, sleep and restart + * the scan. + */ + m = vm_page_iter_lookup(&pages, blks.index + i); + if (m != NULL && (m->oflags & VPO_SWAPINPROG) != 0) { + m->oflags |= VPO_SWAPSLEEP; + VM_OBJECT_SLEEP(object, &object->handle, PSWP, + "swpoff", 0); + break; } - i = 0; - } - if (i == 0) { - sb = swblk_start(object, pi); - if (sb == NULL) + /* + * If the found page is valid, mark it dirty and free + * the swap block. + */ + if (m != NULL && vm_page_all_valid(m)) { + swp_pager_force_dirty(&range, m, &sb->d[i]); + continue; + } + /* Is there a page we can acquire or allocate? */ + if (m != NULL) { + if (!vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL)) + break; + } else if ((m = vm_page_alloc(object, blks.index + i, + VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL)) == NULL) break; - sb_empty = true; - } - /* Skip an invalid block. */ - blk = sb->d[i]; - if (blk == SWAPBLK_NONE || !swp_pager_isondev(blk, sp)) { - if (blk != SWAPBLK_NONE) - sb_empty = false; - i++; - continue; + /* Get the page from swap, and restart the scan. */ + vm_object_pip_add(object, 1); + rahead = SWAP_META_PAGES; + rv = swap_pager_getpages_locked(object, &m, 1, + NULL, &rahead); + if (rv != VM_PAGER_OK) + panic("%s: read from swap failed: %d", + __func__, rv); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeupn(object, 1); + KASSERT(vm_page_all_valid(m), + ("%s: Page %p not all valid", __func__, m)); + vm_page_xunbusy(m); + break; } - - /* - * Look for a page corresponding to this block, If the found - * page has pending operations, sleep and restart the scan. - */ - m = vm_page_iter_lookup(&pages, sb->p + i); - if (m != NULL && (m->oflags & VPO_SWAPINPROG) != 0) { - m->oflags |= VPO_SWAPSLEEP; - VM_OBJECT_SLEEP(object, &object->handle, PSWP, "swpoff", - 0); - i = 0; /* Restart scan after object lock dropped. */ + if (i < SWAP_META_PAGES) { + /* + * With the object lock released and regained, the + * swapblk could have been freed, so reset the pages + * iterator and search again for the first swblk at or + * after blks.index. + */ + pctrie_iter_reset(&pages); + sb = swblk_iter(&blks, object, blks.index); continue; } + if (sb_empty) { + swblk_iter_remove(&blks); + uma_zfree(swblk_zone, sb); + } /* - * If the found page is valid, mark it dirty and free the swap - * block. + * It is safe to advance to the next block. No allocations + * before blk.index have happened, even with the lock released, + * because allocations on this device are blocked. */ - if (m != NULL && vm_page_all_valid(m)) { - swp_pager_force_dirty(&range, m, &sb->d[i]); - i++; - continue; - } - - /* Is there a page we can acquire or allocate? */ - if (m == NULL) { - m = vm_page_alloc(object, sb->p + i, - VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); - } else if (!vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL)) - m = NULL; - - /* If no page available, repeat this iteration. */ - if (m == NULL) - continue; - - /* Get the page from swap, mark it dirty, restart the scan. */ - vm_object_pip_add(object, 1); - rahead = SWAP_META_PAGES; - rv = swap_pager_getpages_locked(object, &m, 1, NULL, &rahead); - if (rv != VM_PAGER_OK) - panic("%s: read from swap failed: %d", __func__, rv); - VM_OBJECT_WLOCK(object); - vm_object_pip_wakeupn(object, 1); - KASSERT(vm_page_all_valid(m), - ("%s: Page %p not all valid", __func__, m)); - vm_page_xunbusy(m); - i = 0; /* Restart scan after object lock dropped. */ + sb = swblk_iter_next(&blks); } swp_pager_freeswapspace(&range); } @@ -2195,10 +2213,11 @@ static void swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, vm_pindex_t pindex, vm_pindex_t count) { + struct pctrie_iter blks; struct page_range range; struct swblk *sb; daddr_t blk, d[SWAP_META_PAGES]; - vm_pindex_t offset, last; + vm_pindex_t last; int d_mask, i, limit, start; _Static_assert(8 * sizeof(d_mask) >= SWAP_META_PAGES, "d_mask not big enough"); @@ -2211,20 +2230,16 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, swp_pager_init_freerange(&range); d_mask = 0; - offset = pindex; last = pindex + count; - sb = swblk_start_limit(srcobject, pindex, last); - start = (sb != NULL && sb->p < pindex) ? pindex - sb->p : 0; - for (; sb != NULL; - sb = swblk_start_limit(srcobject, pindex, last), start = 0) { - pindex = sb->p; - MPASS(d_mask == 0); - limit = MIN(last - pindex, SWAP_META_PAGES); + for (sb = swblk_iter_limit(&blks, srcobject, pindex, last), + start = swblk_start(sb, pindex); + sb != NULL; sb = swblk_iter_next(&blks), start = 0) { + limit = MIN(last - blks.index, SWAP_META_PAGES); for (i = start; i < limit; i++) { if (sb->d[i] == SWAPBLK_NONE) continue; blk = swp_pager_meta_build(dstobject, - pindex + i - offset, sb->d[i], true); + blks.index + i - pindex, sb->d[i], true); if (blk == sb->d[i]) { /* * Failed memory allocation stopped transfer; @@ -2241,7 +2256,7 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, } if (swp_pager_swblk_empty(sb, 0, start) && swp_pager_swblk_empty(sb, limit, SWAP_META_PAGES)) { - swblk_lookup_remove(srcobject, sb); + swblk_iter_remove(&blks); uma_zfree(swblk_zone, sb); } if (d_mask != 0) { @@ -2250,12 +2265,17 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, do { i = ffs(d_mask) - 1; swp_pager_meta_build(dstobject, - pindex + i - offset, d[i], false); + blks.index + i - pindex, d[i], false); d_mask &= ~(1 << i); } while (d_mask != 0); VM_OBJECT_WLOCK(srcobject); + + /* + * While the lock was not held, the iterator path could + * have become stale, so discard it. + */ + pctrie_iter_reset(&blks); } - pindex += SWAP_META_PAGES; } swp_pager_freeswapspace(&range); } @@ -2271,7 +2291,7 @@ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, vm_size_t *freed) { - struct pctrie_iter pages; + struct pctrie_iter blks, pages; struct page_range range; struct swblk *sb; vm_page_t m; @@ -2288,26 +2308,24 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, swp_pager_init_freerange(&range); vm_page_iter_init(&pages, object); last = pindex + count; - sb = swblk_start_limit(object, pindex, last); - start = (sb != NULL && sb->p < pindex) ? pindex - sb->p : 0; - for (; sb != NULL; - sb = swblk_start_limit(object, pindex, last), start = 0) { - limit = MIN(last - sb->p, SWAP_META_PAGES); + for (sb = swblk_iter_limit(&blks, object, pindex, last), + start = swblk_start(sb, pindex); + sb != NULL; sb = swblk_iter_next(&blks), start = 0) { + limit = MIN(last - blks.index, SWAP_META_PAGES); for (i = start; i < limit; i++) { if (sb->d[i] == SWAPBLK_NONE) continue; swp_pager_update_freerange(&range, sb->d[i]); if (freed != NULL) { - m = vm_page_iter_lookup(&pages, sb->p + i); + m = vm_page_iter_lookup(&pages, blks.index + i); if (m == NULL || vm_page_none_valid(m)) fc++; } sb->d[i] = SWAPBLK_NONE; } - pindex = sb->p + SWAP_META_PAGES; if (swp_pager_swblk_empty(sb, 0, start) && swp_pager_swblk_empty(sb, limit, SWAP_META_PAGES)) { - swblk_lookup_remove(object, sb); + swblk_iter_remove(&blks); uma_zfree(swblk_zone, sb); } } @@ -2387,22 +2405,23 @@ swp_pager_meta_lookup(vm_object_t object, vm_pindex_t pindex) vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex) { + struct pctrie_iter blks; struct swblk *sb; int i; - if ((sb = swblk_start(object, pindex)) == NULL) + if ((sb = swblk_iter(&blks, object, pindex)) == NULL) return (OBJ_MAX_SIZE); - if (sb->p < pindex) { + if (blks.index < pindex) { for (i = pindex % SWAP_META_PAGES; i < SWAP_META_PAGES; i++) { if (sb->d[i] != SWAPBLK_NONE) - return (sb->p + i); + return (blks.index + i); } - if ((sb = swblk_next(object, sb)) == NULL) + if ((sb = swblk_iter_next(&blks)) == NULL) return (OBJ_MAX_SIZE); } for (i = 0; i < SWAP_META_PAGES; i++) { if (sb->d[i] != SWAPBLK_NONE) - return (sb->p + i); + return (blks.index + i); } /* @@ -2840,13 +2859,14 @@ SYSCTL_NODE(_vm, OID_AUTO, swap_info, CTLFLAG_RD | CTLFLAG_MPSAFE, long vmspace_swap_count(struct vmspace *vmspace) { + struct pctrie_iter blks; vm_map_t map; vm_map_entry_t cur; vm_object_t object; struct swblk *sb; vm_pindex_t e, pi; long count; - int i; + int i, limit, start; map = &vmspace->vm_map; count = 0; @@ -2862,11 +2882,12 @@ vmspace_swap_count(struct vmspace *vmspace) goto unlock; pi = OFF_TO_IDX(cur->offset); e = pi + OFF_TO_IDX(cur->end - cur->start); - for (sb = swblk_start_limit(object, pi, e); - sb != NULL; sb = swblk_next_limit(object, sb, e)) { - for (i = 0; i < SWAP_META_PAGES; i++) { - if (sb->p + i < e && - sb->d[i] != SWAPBLK_NONE) + for (sb = swblk_iter_limit(&blks, object, pi, e), + start = swblk_start(sb, pi); + sb != NULL; sb = swblk_iter_next(&blks), start = 0) { + limit = MIN(e - blks.index, SWAP_META_PAGES); + for (i = start; i < limit; i++) { + if (sb->d[i] != SWAPBLK_NONE) count++; } } From nobody Sun Sep 29 20:14:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XGwQS72JKz5X8hB; Sun, 29 Sep 2024 20:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XGwQS6TX0z4Pvg; Sun, 29 Sep 2024 20:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727640848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5UWlxzDQwK/91B4wbSvDKH1V9NmCUiL5YOEmDnVQdBA=; b=eaW/ZBV5LbYPgAIJUjT2xxWpgGMbUKN5R49idoz5FrBVq/Ru1BnhDbg1rNJAhehkv26BBF dpNFrzT7SK9NQ32NS6XygQtqgU0subTczA2rfDWJ+kUvYcUXDgxhPvgKaCOQdc/N5KGmJD VLiuNmvJ4Y8IAWBfaQi2gnfIIUXpCBviNVcFynNJQ0MhbA+zfDi/SiW3up0CviRJsG5CHE uY/oaRnhm6F3b0KCkXV6JG7LGHPIQTorfixR+1kTy8A1oDYUwJCq7rp8mMSuGU5L+lRZRC jXxjLkqrYj4FmTMQgG2VvqyP98vLT8x5p/9m+UCsVq9DkCTnPlQJdn5tfyZUbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727640848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5UWlxzDQwK/91B4wbSvDKH1V9NmCUiL5YOEmDnVQdBA=; b=Df1MHUZS/sBZB5qoi2UaPhP7u7lZdo6NfZ06LGo3cPFBXc6a4oZRusLW4Y7n2CH1axS6D5 XxPyGDIiPd85pLNNuz2IRGlgUBx+ceyTwZAx6WDBAiOyl9g38iy9p3DWKNhIbc2uwqfyba jrV/8um0rq8KTEzdPnVjT+0gNZ7oPwIPP+xbmNLjr37JDQbKudCJ94WYFqUy/Cd7npD3bV QNOcVKDrJvL6CcZ246334r9buGySPpwxwhzUB8n49yBNHP4ZgE2TJHpCvoI29lSZ5MaD0S 4pCoQm72tlCnI3umL+G7AHTwdhka/seyFJkqVfWMiro9iLixxcsXcVAyKoHM5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727640848; a=rsa-sha256; cv=none; b=Z0zaCA0tOVNDqMqg/1q14V09LMb1MrnpD6/nBRdt0Pw7XwFomOZnsf5JmYGQtKHr0swU1c QjaPN4cxeMX0uy3Km/eG+N1i4iRd1VqVK664izgdctYtRnIlmWb+CsXFNn3/4aMHnu+KJJ q7rTLT3TBwx4209Moo4aUTt11q+qkT8xRds/cl5jac7f5wsGjl/sB50Yf3lBxKawGfRFRx 4wyb8LYnXpjJGelVueVEu5fggSpV7cptbuviPH2Im7NH8tYhL65dCE7H+2pOKnURWHgK4b FPEi1XMQCXwBhlSQm/NXSHDcPPr23xLlvj+9AdUv8pzrivgPtAVU+TBvgbNtdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XGwQS64hMzNVw; Sun, 29 Sep 2024 20:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48TKE8ve021783; Sun, 29 Sep 2024 20:14:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48TKE8Pf021780; Sun, 29 Sep 2024 20:14:08 GMT (envelope-from git) Date: Sun, 29 Sep 2024 20:14:08 GMT Message-Id: <202409292014.48TKE8Pf021780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: f321956d9806 - main - nfsd.c: Synchronize error handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f321956d9806bf0c171b9097a25b294c1498c9de Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f321956d9806bf0c171b9097a25b294c1498c9de commit f321956d9806bf0c171b9097a25b294c1498c9de Author: Joyu Liao AuthorDate: 2024-09-29 20:11:54 +0000 Commit: Rick Macklem CommitDate: 2024-09-29 20:11:54 +0000 nfsd.c: Synchronize error handling Synchronize the error handling in nfsd. If you check other error handlings in those same condition blocks, it uses nfsd_exit instead, which will call killchildren() and call the rpcbind service to do the service un-mapping. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46442 --- usr.sbin/nfsd/nfsd.c | 72 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index b6c60ce72834..f1f04af192da 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -550,18 +550,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_udp = getnetconfigent("udp"); - if (nconf_udp == NULL) - err(1, "getnetconfigent udp failed"); + if (nconf_udp == NULL) { + syslog(LOG_ERR, "getnetconfigent udp failed"); + nfsd_exit(1); + } nb_udp.buf = ai_udp->ai_addr; nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp, - &nb_udp)) - err(1, "rpcb_set udp failed"); + &nb_udp)) { + syslog(LOG_ERR, "rpcb_set udp failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp, - &nb_udp)) - err(1, "rpcb_set udp failed"); + &nb_udp)) { + syslog(LOG_ERR, "rpcb_set udp failed"); + nfsd_exit(1); + } freeaddrinfo(ai_udp); } } @@ -624,20 +630,26 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_udp6 = getnetconfigent("udp6"); - if (nconf_udp6 == NULL) - err(1, "getnetconfigent udp6 failed"); + if (nconf_udp6 == NULL) { + syslog(LOG_ERR, "getnetconfigent udp6 failed"); + nfsd_exit(1); + } nb_udp6.buf = ai_udp6->ai_addr; nb_udp6.len = nb_udp6.maxlen = ai_udp6->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp6, - &nb_udp6)) - err(1, + &nb_udp6)) { + syslog(LOG_ERR, "rpcb_set udp6 failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp6, - &nb_udp6)) - err(1, + &nb_udp6)) { + syslog(LOG_ERR, "rpcb_set udp6 failed"); + nfsd_exit(1); + } freeaddrinfo(ai_udp6); } } @@ -696,18 +708,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_tcp = getnetconfigent("tcp"); - if (nconf_tcp == NULL) - err(1, "getnetconfigent tcp failed"); + if (nconf_tcp == NULL) { + syslog(LOG_ERR, "getnetconfigent tcp failed"); + nfsd_exit(1); + } nb_tcp.buf = ai_tcp->ai_addr; nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp, - &nb_tcp)) - err(1, "rpcb_set tcp failed"); + &nb_tcp)) { + syslog(LOG_ERR, "rpcb_set tcp failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp, - &nb_tcp)) - err(1, "rpcb_set tcp failed"); + &nb_tcp)) { + syslog(LOG_ERR, "rpcb_set tcp failed"); + nfsd_exit(1); + } freeaddrinfo(ai_tcp); } } @@ -774,18 +792,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_tcp6 = getnetconfigent("tcp6"); - if (nconf_tcp6 == NULL) - err(1, "getnetconfigent tcp6 failed"); + if (nconf_tcp6 == NULL) { + syslog(LOG_ERR, "getnetconfigent tcp6 failed"); + nfsd_exit(1); + } nb_tcp6.buf = ai_tcp6->ai_addr; nb_tcp6.len = nb_tcp6.maxlen = ai_tcp6->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp6, - &nb_tcp6)) - err(1, "rpcb_set tcp6 failed"); + &nb_tcp6)) { + syslog(LOG_ERR, "rpcb_set tcp6 failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp6, - &nb_tcp6)) - err(1, "rpcb_set tcp6 failed"); + &nb_tcp6)) { + syslog(LOG_ERR, "rpcb_set tcp6 failed"); + nfsd_exit(1); + } freeaddrinfo(ai_tcp6); } }