Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2428459pxb; Sat, 30 Jan 2021 02:16:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4Ll6+gFh1QEWW0t6QYIBxNTI1yaonmoJbh+y9oKhYze9v6E880EMxcyndjtNzaQy1n/mB X-Received: by 2002:a17:906:7c4b:: with SMTP id g11mr8414039ejp.475.1612001781325; Sat, 30 Jan 2021 02:16:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612001781; cv=none; d=google.com; s=arc-20160816; b=kGHSfM8NgHko5cJgwVgRLguANXYyZQCwof+aZkkaNiXKJOWEx0jv36Q20YdTglCd8l 2NAdaMglVl9B/YY+dPV6VpnFYmxy0F+/uFjHPtYIOFZro5DkzJXqgvFPQAk7O9Y94s70 oyCUxn5TMQ3XcHMYCN8PHdQOLJt5hAgwVD/dAEERzzDOb9tHBDINJqyKida+Fdz1fC6t NhiwzfWSum8vP5DMMvQ+Irf9nSQKuKP/0nrVxyAL5TuSzIAhLaulvhDzjRnf7wHGtqfy HNA/VNXMiCT7pFyAUDw7RfBREoQPM7VBDdtIsBWv6GMJAv47Qptj0EzPuXTLwOUcsJUb 5mtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=N7g4rKfKFlHliUUE1EzL5L6CggA7qzDfNc80BUXtFNQ=; b=C5sEi9Qnv+6a0fSrDa6Hf9p+/+1fW3zNl5qP0mwXZPhgpkELxt6kl/gvUPJzFnhQha XXVVTtdZ03fFjCMXpVp8Qrwbdy6aweyK6RzIUbg3w7BJ7OGZiVGQ82Zum4/iHN5+bLvy Xv5/Y4QkQfi0eEhuwtrarWJKu8QmEid6f/5jxvVCknLEhLnKtzOdpcm7CiX6FJWm7hTM mNBFHLn7jbez3/1VfsNLu5Qm2bAFxNQ+7sa42S7BRBsZwrbupqQKiGmU5DPSApz8lAc8 FF0uX1koOXofVrGLQFzltpvZL0bOGZJNAVnF5YhAEQtxZh5aDDG1Tm8xVfI9s9FoM0ee QT/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lEWGaplw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si7066596edq.48.2021.01.30.02.15.57; Sat, 30 Jan 2021 02:16:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lEWGaplw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231894AbhA3KNN (ORCPT + 99 others); Sat, 30 Jan 2021 05:13:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:52956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbhA3BiM (ORCPT ); Fri, 29 Jan 2021 20:38:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1FD3064E00; Sat, 30 Jan 2021 01:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611970611; bh=kJ14/IhYXRvZTWrg7H8aHCDirFH2aGuRYF/UVQtqtJU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lEWGaplwXv2Hvceix/Ei/PwlKAZd1hHbQZLkTQ5RnPq8+8qhfogrLOfHb1BG4PKSn G9oUIbnDGYIT9OIE2YLkngQ6GXeltsGDNZt6DzC2G9ylVFczpmgPhsWMK4R34OXbkI mhMlD6FIEw/wRDrMSDcVclesqOSRTAte5n2l/SaIqe7NdT6xtR4qelLYI3eSdYXLTT uLzKXc7cYtOGtwCAUkv9nrYbLiPY53laSp7Ih7LzEHW3j4nWxagHVG6GGofWpw8mIx 6kSKy+PCKZtAcoCyUmCQQlURWyATER0SdxuOanNP+e85BimKCN7nSvFIBpmvtJ8ReF LoWst6uEmS1cA== Date: Fri, 29 Jan 2021 17:36:50 -0800 From: Jakub Kicinski To: Martin Schiller Cc: Xie He , "David S. Miller" , Linux X25 , Linux Kernel Network Developers , LKML , Krzysztof Halasa Subject: Re: [PATCH net] net: hdlc_x25: Use qdisc to queue outgoing LAPB frames Message-ID: <20210129173650.7c0b7cda@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <3f67b285671aaa4b7903733455a730e1@dev.tdt.de> References: <20210127090747.364951-1-xie.he.0141@gmail.com> <20210128114659.2d81a85f@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <3f67b285671aaa4b7903733455a730e1@dev.tdt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Jan 2021 06:56:10 +0100 Martin Schiller wrote: > On 2021-01-28 23:06, Xie He wrote: > > On Thu, Jan 28, 2021 at 11:47 AM Jakub Kicinski > > wrote: > >> > >> Noob question - could you point at or provide a quick guide to > >> layering > >> here? I take there is only one netdev, and something maintains an > >> internal queue which is not stopped when HW driver stops the qdisc? > > > > Yes, there is only one netdev. The LAPB module (net/lapb/) (which is > > used as a library by the netdev driver - hdlc_x25.c) is maintaining an > > internal queue which is not stopped when the HW driver stops the > > qdisc. > > > > The queue is "write_queue" in "struct lapb_cb" in > > "include/net/lapb.h". The code that takes skbs out of the queue and > > feeds them to lower layers for transmission is at the "lapb_kick" > > function in "net/lapb/lapb_out.c". > > > > The layering is like this: > > > > Upper layer (Layer 3) (net/x25/ or net/packet/) > > > > ^ > > | L3 packets (with control info) > > v > > > > The netdev driver (hdlc_x25.c) > > > > ^ > > | L3 packets > > v > > > > The LAPB Module (net/lapb/) > > > > ^ > > | LAPB (L2) frames > > v > > > > The netdev driver (hdlc_x25.c) > > > > ^ > > | LAPB (L2) frames > > | (also called HDLC frames in the context of the HDLC subsystem) > > v > > > > HDLC core (hdlc.c) > > > > ^ > > | HDLC frames > > v > > > > HDLC Hardware Driver > > @Xie: Thank you for the detailed presentation. Indeed, thanks for the diagram. I'm still struggling to wrap my head around this. Did you test your code with lockdep enabled? Which Qdisc are you using? You're queuing the frames back to the interface they came from - won't that cause locking issues?