From nobody Sun Jul 28 21:04:03 2024 X-Original-To: freebsd-hackers@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 4WXDWQ5rzlz5Rg91 for ; Sun, 28 Jul 2024 21:04:18 +0000 (UTC) (envelope-from obiwac@gmail.com) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 4WXDWQ0sWqz4NTB; Sun, 28 Jul 2024 21:04:18 +0000 (UTC) (envelope-from obiwac@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of obiwac@gmail.com designates 209.85.208.178 as permitted sender) smtp.mailfrom=obiwac@gmail.com Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2eeb1ba040aso49385561fa.1; Sun, 28 Jul 2024 14:04:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722200655; x=1722805455; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7ri29mH4vMe/q+tnSR3HBQp5xvI+J71o8t9aMCqtgdU=; b=X3kyJYa9T9SaNUrGIDahg5QZyzfP5BSmWkajf9VAlTlZWv9mzqM2gTH3eXkSly0JO0 t1r79bTLpBsjsFBedbA64BcSKcwr9wfcMzMGdENiVt8qIgpMOSfl5p7S/bHt42jwF9aM w3wn23bGfhaJjE66b10lvO23bfk3fiXnLekes5aerNMRDpUS/mYBO7m09/aciZS2R84E aAJiEMI/1x1vo43eqI5kyAw4+6SKsrJtejEikB/aFy5P0IXaeRleul8TWXYBQ9QGdAZW AjrPOtOWlLWtNEAeu2GJYueldo+mQiuQP2We4XwiG92y89nUzQ7uEmOAS15cyRd1tZaS SvYw== X-Forwarded-Encrypted: i=1; AJvYcCWIM0y0MebYULir4pykeJhr3t7d4dTx4kmwO5VGQLMZflBtZZr4K/HBlrLahnPiVaF5iVnf3GGVbtMCDCqJYPWykiTaYrRs7asiYmpMNnDGng== X-Gm-Message-State: AOJu0YypcQ1pwD/tzFgXzVMZjCj4ElTE+51Qa/6P69FlGehTjZyJm9U1 4ULN5hJavlnM1HheBzk/MIGTWx9eGrIIRPYd1Q/vy9uNKFijAmCJFVIXQ7jyX7U= X-Google-Smtp-Source: AGHT+IHqfQDXF1d5N7mOEihfULO4bCt3Ul9pM8z8GD3Z1LKB4xqfcv7kT5wbXI1lf5mtKGy1YJPEAg== X-Received: by 2002:a2e:3507:0:b0:2ef:2c0f:284a with SMTP id 38308e7fff4ca-2f12ee69e6fmr36174451fa.44.1722200655018; Sun, 28 Jul 2024 14:04:15 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f03cf0dc4bsm10968581fa.18.2024.07.28.14.04.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Jul 2024 14:04:14 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-52f00ad303aso4468148e87.2; Sun, 28 Jul 2024 14:04:14 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCW8wyYNvsOXsA396AtYtOlSW0dECBSSZ4B4OujhiDOijJ8PGHphDGxmjXOn32KUqrYWy+s5MU/82a659W4QkaZ1V4+QuexsHxx+1D7AtOdZCw== X-Received: by 2002:ac2:434d:0:b0:52c:df5f:7b4e with SMTP id 2adb3069b0e04-5309b2b6e49mr3241667e87.38.1722200654550; Sun, 28 Jul 2024 14:04:14 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 From: obiwac Date: Sun, 28 Jul 2024 23:04:03 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Questions about best practices w.r.t. writing a kernel module port which modified LinuxKPI (BATMAN) To: freebsd-hackers , imp@freebsd.org, John Baldwin , "shawn.webb@hardenedbsd.org" Content-Type: text/plain; charset="UTF-8" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.07 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.62)[-0.621]; NEURAL_HAM_MEDIUM(-0.55)[-0.552]; FORGED_SENDER(0.30)[obiwac@freebsd.org,obiwac@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_THREE(0.00)[4]; FREEFALL_USER(0.00)[obiwac]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.178:from,209.85.167.53:received]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[obiwac@freebsd.org,obiwac@gmail.com]; MISSING_XM_UA(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.178:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4WXDWQ0sWqz4NTB Hi! I worked on porting the batman_adv Linux kernel module to FreeBSD using the LinuxKPI last year as part of a GSoC project and I now have time to work on WiFi support for it (which is necessary for it to actually be useful in practice). Before I do so though, I'd like to create a port for it. I have a few questions about best practices w.r.t. going about this which I was unable to answer by myself by looking around at other ports (specifically drm-kmod, it's the only other port that I know of that distributes a kernel module that depends on the LinuxKPI). Here are the two main questions I have: 1. I have made changes to the LinuxKPI headers and other parts of the kernel in order to accommodate batman_adv. Is it okay for me to upstream those changes, or should I expect users to apply a patchset on their kernel source and to recompile it? If I can upstream them, what should I do about older versions than -CURRENT? Will I just have to wait for those changes to go into the next -STABLE release? And if so, will that mean that any updates that I make to the LinuxKPI headers necessary for newer versions of batman_adv will either have to wait until the next release or be distributed alongside the port? 2. I have made changes to ifconfig to support the creation of BATMAN soft interfaces. Should I upstream those changes and somehow disable them when the kernel module is not loaded, or should I distribute a patched version of ifconfig with my port? Or should I go with a different solution entirely, and write and distribute a tool similar to batctl (which from what I understand was the route taken when distributing BATMAN on most Linux distros before iproute2 added support for managing BATMAN interfaces)? Thank you so much in advance for your answers & help! (Warner, John, I've CC'd you two as you were in the thread on the possibility of upstreaming this to the source tree.)