Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3786698pxb; Tue, 17 Nov 2020 03:37:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSwgbYUwQZLFIaiGMlwybDgu1shxCvDqYQEq4nCcKyBvhq8C/SIOatRn6hNGiMUIwAR5Bg X-Received: by 2002:a50:ab07:: with SMTP id s7mr20923519edc.287.1605613022908; Tue, 17 Nov 2020 03:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605613022; cv=none; d=google.com; s=arc-20160816; b=G5ad1p0NDN6gtaPJDqJ6YhE+uu6iVASnmIJK6cueutcJiXTbgTf8GImD69DAoQA385 JtDCFFLxwNxm++clqivXAucIkLFS26RKmwXBJ8A2Xgh6SLo6hnnk6nzYTunlek3oirQs 4AtY2G9mcmMrICHkBhmAqsbu+6WKqFv/pD7fHUlYf6dM5t+hTkJCCSNU4n5hhVdO0SfU KHCMx0DdnWKf/BMjwpO7ErLVnvp+wwHJsVXawkb3HpkgBypNQFEIxT+UNvs8kmVukt/Q jLe9yltVi3DvmdzgleazvUDHs1FJZruY/e6maxZ/5bEOEQzbLgxGn1/zsuaI0iPcAYNW 8cKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=72x/SS97yDfmKLyCblUhiX5oYip81rPZoaO4o1zpdcE=; b=SjHT7OEnrflwXPtgFhW4NCaWdUARTmAFURd+iRuQOrBmAV32vVi1OUwqgH61gHDOG0 DgXRUiwYKrwXsNkb84o7XFn9nW9xWixVOLs/Hr9qcFhJy3b47AOLyd8fs2rC/mJOlOTN 33xuRHybcg4sWQuj+W+ebBE0NkbupMn2CNs7b2rBw+9VMcSka4db4xBXNG6IiMMiJJs9 3nTGY8yvYvsmVC+yEknFyMCiXvbyoGbPc5P8qtH1Q5SilHcF7R5bye5c0MugWQO7Te6y EAK6pZRrMczgJAdsIMFtbXi6ChLIX04uYoQKGmH0Lhe7d1SNAzfOcEYSfZts1wtM84tc butA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QYCtPyfG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si13452439edw.337.2020.11.17.03.36.39; Tue, 17 Nov 2020 03:37:02 -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=@gmail.com header.s=20161025 header.b=QYCtPyfG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727965AbgKQLcy (ORCPT + 99 others); Tue, 17 Nov 2020 06:32:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727815AbgKQLcy (ORCPT ); Tue, 17 Nov 2020 06:32:54 -0500 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47CD8C0613CF; Tue, 17 Nov 2020 03:32:54 -0800 (PST) Received: by mail-pj1-x1042.google.com with SMTP id gi3so317426pjb.3; Tue, 17 Nov 2020 03:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=72x/SS97yDfmKLyCblUhiX5oYip81rPZoaO4o1zpdcE=; b=QYCtPyfG2qFh0OJrrWVRwzza/HzYapdghDvIWgBjSs0tzC2P/Tjvz6lhf/Z5H8UVSK TAZgqLInQcOla/xUWe6c8BCbJ5jBp2Nna9sG9Z9Oz5yHFe2yBhsJPUXqF284+pAr6ZBb zEp1HcXR5ioGnQmHofxF9N00KelVB/bHkqYlZ8vMSQqKj0IwF75tUU1EK0Kb7bBKrTh0 KtXIkhi3h0j97ExIE2xTdjeOMbsha/AdmzMsCOVhY1dmourL2tMX/1mtqyOuarCCZdTQ SEgTW0lEhMipPMZIHcWLmlWj8rW7bGvuLDqF2Nq0XRFXiOmPxto83LzA15a94H5Rr/Ov r10A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=72x/SS97yDfmKLyCblUhiX5oYip81rPZoaO4o1zpdcE=; b=ome3cI8xsidUsx5gdeynFApQw5xohjgHjkICre+pII22fpJKdU7xsKVT+HRX/2KR70 uHDcoBsrJOIAyPEOZNzy2yEh5ns2f/OaAHFC93b6IzS84aR03enAcQu/5krVIyTz8+mC kBE7AcTFll+z1DmRMTpo62XAHbhuTW7Z2g7EVgLLYTutrI5J12X5xt1L8CNlhaJOw6VV vhoGUW7tvsOCNLYJ3v4nxKUtD3x9obfYl0Wzmjn8gWSfVYnEOQr6+AgByNc1tJWnBHYG dYlBYvxJYrfqgrYEweRY/N2vmt4HZBg2BDuMndSZW+3BoUjQ2+Ns0IbjkMwdBTJr4aGO wmlQ== X-Gm-Message-State: AOAM531JnT8jp/I/b0N5IvTb8yZz9AjBFVwH/RKqTj72LKlkQI1cLu75 KJZiddSraw20suwOxyW7RF/5n3a5q/37CeDlJKE= X-Received: by 2002:a17:902:aa4b:b029:d8:f87e:1f3c with SMTP id c11-20020a170902aa4bb02900d8f87e1f3cmr3339205plr.23.1605612773875; Tue, 17 Nov 2020 03:32:53 -0800 (PST) MIME-Version: 1.0 References: <20201116135522.21791-1-ms@dev.tdt.de> <20201116135522.21791-6-ms@dev.tdt.de> In-Reply-To: From: Xie He Date: Tue, 17 Nov 2020 03:32:42 -0800 Message-ID: Subject: Re: [PATCH net-next v2 5/6] net/lapb: support netdev events To: Martin Schiller Cc: Andrew Hendry , "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 1:53 AM Martin Schiller wrote: > > On 2020-11-16 21:16, Xie He wrote: > > Do you mean we will now automatically establish LAPB connections > > without upper layers instructing us to do so? > > Yes, as soon as the physical link is established, the L2 and also the > L3 layer (restart handshake) is established. I see. Looking at your code in Patch 1 and this patch, I see after the device goes up, L3 code will instruct L2 to establish the connection, and before the device goes down, L3 will instruct L2 to terminate the connection. But if there is a carrier up/down event, L2 will automatically handle this without being instructed by L3, and it will establish the connection automatically when the carrier goes up. L2 will notify L3 on any L2 link status change. Is this right? I think for a DCE, it doesn't need to initiate the L2 connection on device-up. It just needs to wait for a connection to come. But L3 seems to be still instructing it to initiate the L2 connection. This seems to be a problem. It feels unclean to me that the L2 connection will sometimes be initiated by L3 and sometimes by L2 itself. Can we make L2 connections always be initiated by L2 itself? If L3 needs to do something after L2 links up, L2 will notify it anyway. > In this context I also noticed that I should add another patch to this > patch-set to correct the restart handling. Do you mean you will add code to let L3 restart any L3 connections previously abnormally terminated after L2 link up? > As already mentioned I have a stack of fixes and extensions lying around > that I would like to get upstream. Please do so! Thanks! I previously found a locking problem in X.25 code and tried to address it in: https://patchwork.kernel.org/project/netdevbpf/patch/20201114103625.323919-1-xie.he.0141@gmail.com/ But later I found I needed to fix more code than I previously thought. Do you already have a fix for this problem? > > If that is the case, is the one-byte header for instructing the LAPB > > layer to connect / disconnect no longer needed? > > The one-byte header is still needed to signal the status of the LAPB > connection to the upper layer.