From 6c1f58d7d5dfdcf6d06bbe9f5cd4adfd22a7268a Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Mon, 28 Sep 2026 12:07:59 -0700 Subject: llc: strip the leftovers of the llc2 removal Nothing in tree registers the type 1 / type 2 packet handlers or the station handler any more, and nothing looks at the socket hashes hanging off struct llc_sap. The two SAPs opened in tree - SNAP, and STP for the bridge's BPDUs and GARP's PDUs - receive through the per-SAP rcv_func(), so llc_rcv() boils down to a SAP lookup and a call. llc_sap_list becomes static and five exports go away with all this; the llc2 module out of tree has been reworked to open its own SAPs. Frames with a NULL DSAP used to be handed to the station handler before the SAP lookup. They take the normal path now, meaning they get dropped unless something registers SAP 0. struct llc_sap is down to 48 bytes on 64-bit from over a kilobyte, which also moves its GFP_ATOMIC allocation from kmalloc-2k to kmalloc-64. The two 64-entry socket hashes are the bulk of it, and the address it carried is now just the SAP number - nothing has read the MAC half since the socket layer left. llc_pdu.h keeps only what its remaining users need, plus LLC_PDU_RSP to document the one argument which can take it. That takes out the type 2 (I and S format, FRMR) definitions, the XID and TEST builders with their constants - the kernel neither sends nor answers either any more - the SAP address defines, the field accessors, and the prototypes of the llc_pdu.c helpers which went out of tree with the rest of LLC2. With the I and S formats gone llc_pdu_header_init() has one PDU type left, so drop the argument. Signed-off-by: Jakub Kicinski Link: https://patch.msgid.link/20260928190800.2521749-3-kuba@kernel.org Reviewed-by: Nikolay Aleksandrov Signed-off-by: Paolo Abeni --- net/802/garp.c | 4 ++-- net/802/psnap.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'net/802') diff --git a/net/802/garp.c b/net/802/garp.c index 56b934ec1aae..de6b96bd425a 100644 --- a/net/802/garp.c +++ b/net/802/garp.c @@ -255,8 +255,8 @@ static void garp_pdu_queue(struct garp_applicant *app) garp_pdu_append_end_mark(app); garp_pdu_append_end_mark(app); - llc_pdu_header_init(app->pdu, LLC_PDU_TYPE_U, LLC_SAP_BSPAN, - LLC_SAP_BSPAN, LLC_PDU_CMD); + llc_pdu_header_init(app->pdu, LLC_SAP_BSPAN, LLC_SAP_BSPAN, + LLC_PDU_CMD); llc_pdu_init_as_ui_cmd(app->pdu); llc_mac_hdr_init(app->pdu, app->dev->dev_addr, app->app->proto.group_address); diff --git a/net/802/psnap.c b/net/802/psnap.c index 8ae835e1cbae..c776c5f0041f 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -82,7 +82,7 @@ static int snap_request(struct datalink_proto *dl, struct sk_buff *skb, const u8 *dest) { memcpy(skb_push(skb, 5), dl->type, 5); - llc_build_and_send_ui_pkt(snap_sap, skb, dest, snap_sap->laddr.lsap); + llc_build_and_send_ui_pkt(snap_sap, skb, dest, snap_sap->lsap); return 0; } -- cgit v1.2.3