From owner-freebsd-arch@freebsd.org Mon Mar 22 00:23:38 2021 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1F475735A7 for ; Mon, 22 Mar 2021 00:23:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3Zwp0Rszz4f4p for ; Mon, 22 Mar 2021 00:23:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qk1-f180.google.com with SMTP id q3so8968460qkq.12 for ; Sun, 21 Mar 2021 17:23:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5Q0bzSeBlrknzq4DBX45CM9Pv1DUX7swb22rmuWJuCI=; b=TjqiA7zk7yP+b87DbRvf6CDD+NSzPNygYQnYU6IWAkXKvxZk8u9rQeKZCzsC51FJOk KNxbFfJ0FMkLWk1qZUT/DVm+JnrV0NZZXdAIln01+2NNDVIQc/mTGITeWLPfDBAh8quU 73/UC8QfnYhCFnn/tuV1VwKAIGDRtpIAnoIupgBNTWuWmoS6URKfXS6Bjj2BpuLWXTf2 aaBHa1cMmD6zcPDIWK+EqusF930W7E14bHsjmksdxg0wUnIYdbx8+O6I9zmrtdqCDNsc SqYwoq6EOrpvgKI9/JZ/q0BF9eGTLsvY3FCjyR9LVO+SJqNWGedJnwdV7A4/+eUvIPII Iitg== X-Gm-Message-State: AOAM532BB4TGugFARVFDIsrHuPyahoA8pGPQKxo9yC+dysp2nm7gmGkP 7Rl2QGJGIJKZrjQaE6H3GvlIl8wrdv/VchvFFLYhCnLbc9Y= X-Google-Smtp-Source: ABdhPJzkk6MbQTnPv9aASiNqELICGV27IzJiEYBLmZVcEYROCqSLGcqLaxPkuaBbFDSFQJWW4KHp8ttRjpWC9wsyn7o= X-Received: by 2002:a37:2cc3:: with SMTP id s186mr8451208qkh.270.1616372615995; Sun, 21 Mar 2021 17:23:35 -0700 (PDT) MIME-Version: 1.0 From: Adrian Chadd Date: Sun, 21 Mar 2021 17:23:24 -0700 Message-ID: Subject: added if_log() and device_log() To: freebsd-arch@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4F3Zwp0Rszz4f4p X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_DN_NONE(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[adrian@freebsd.org,adrianchadd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.222.180:from]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; TO_DOM_EQ_FROM_DOM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[adrian@freebsd.org,adrianchadd@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[209.85.222.180:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[209.85.222.180:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.180:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 00:23:38 -0000 hi! I just added if_log() and device_log(). They're log() variants of if_printf() / device_printf() which will log to the kernel/syslog buffer rather than do console output. That way syslog can decide whether it needs to be printed or not. I'm going to submit some patches soon to convert ath(4) and net80211(4) to use if_log / device_log where appropriate so debugging doesn't spam the console. If you're writing device or interface logging/debugging and you want to avoid the console, if_log() / device_log() is now your friend on -HEAD. -adrian From owner-freebsd-arch@freebsd.org Sat Mar 27 11:54:31 2021 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84D2B5C182E; Sat, 27 Mar 2021 11:54:31 +0000 (UTC) (envelope-from kp@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6y1g3Rznz3N3P; Sat, 27 Mar 2021 11:54:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4F6691EB4; Sat, 27 Mar 2021 11:54:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 7726A9C52; Sat, 27 Mar 2021 12:54:29 +0100 (CET) From: "Kristof Provost" To: "FreeBSD pf" Cc: freebsd-arch@freebsd.org Subject: [RFC] pf ioctl changes Date: Sat, 27 Mar 2021 12:54:28 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: <24E09373-EBCD-4ED1-8B59-A44E687F287E@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 11:54:31 -0000 Hi, There are several patches in the pipeline that require changes in pf’s interface between kernel and userspace. In the past these have been handled in multiple ways. Either by simply making the change, breaking binary compatibility, or by introducing a v2 ioctl (e.g. DIOCADDALTQV1). While one is better than the other neither is wholly satisfying. New versions of calls constitute a maintenance burden after all. I’d like to change the ioctl interface to use nvlists, which would make such extensions much easier, because fields can be optional. That is, if userspace doesn’t supply the ‘shinynewfeature’ field the kernel can assume the default value and things just work. Similarly, if the kernel supplies a ’shinynewfeature’ which userspace doesn’t know about it’s simply ignored. The rough plan is to introduce nvlist versions of the get/add rules calls for now. Others will follow as the need presents itself. As these are new ioctls it is safe to MFC them to stable/12 and stable/13. The old interface will remain supported in those branches, but I’d like to remove it from main (and thus FreeBSD 14). As part of this effort I may end up splitting off the ioctl interface code from pfctl into libpfctl, which should make reuse of that code easier. I hope to post preliminary patches in the coming week. Thoughts? Objections? Best regards, Kristof