Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4462462ioa; Wed, 27 Apr 2022 04:32:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRoGGkx7BywGJZMhOgzR7MGv6GJB6BkuYl6cgOGLHQKHzR5uM4IsJZ9Fcu7YJry4bh3qk9 X-Received: by 2002:a63:91c4:0:b0:3ab:1a43:cd1e with SMTP id l187-20020a6391c4000000b003ab1a43cd1emr15853109pge.540.1651059140961; Wed, 27 Apr 2022 04:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651059140; cv=none; d=google.com; s=arc-20160816; b=YDs5vkd+9Fs+T4xuGrM/WmjwiDv3T3V91qpv/A6THyhJzs4HwjvACyeQpzp6U+IBFC FgqdPELGTuShuMURoxUOAhuj6LmgD6OK0Nvt990H2r6QXkr+gP7oY3zf+QWmi/c4bvYn 6hbvHdtU+ZY4J5/9QGxY9JezcLECttRqlXSt3XOKmn7N7CCZK/3srIDgBBR0Cns3TnIn wB+hEqiyAq9hJ9hyATdevzf65qdL5IJ99MkvwNykzKpXhpCPuvz8QaMseek5gydIsSgw 44aT6K+m7tM4KmcgXM8R/QJqJmJ55dCl8xJhfLzLyTBGsrtrfdtVTtJ2ogXyHja59+Ir W7jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/GTP1Ij9ZJMMooI6eS22+QuUn9jrqBvk1je1hsyKuPo=; b=cM6B3UQT7AlTFC43Ue8oNT1qgX/760yjzNggwfUjmJxI0SdHF8ro/oz/sSMlF4aaqK c/t1VWSuG8JAzTp8dptFtz9K+TcYxTLTdnTWSChwRvcrnru45ns3DrIwicfAPNsglmV4 GDpkS27ye9Uv7vupz9sI6qM0VxPUZlhz+qUMosdFEH5YCGVzpNviywTiyUjz9kf7Buah lciMbFm91CPTiT4jpooiKx6KfmxK/i3IjeO4+LDPVE/CuHB/G13rjK6hhoZgdPZdYwSx NOqADFyZjEILAVdoNo49Wh7RsAs2lUZ7bMJru1j1bYCtvn0ABJ8eLJdvSns5KHxah9Bp trSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lCMCto1Z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 20-20020a630114000000b003ab03edaf2dsi1221754pgb.439.2022.04.27.04.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:32:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lCMCto1Z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 108A4484D09; Wed, 27 Apr 2022 03:19:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356774AbiD0BjJ (ORCPT + 67 others); Tue, 26 Apr 2022 21:39:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351147AbiD0BjI (ORCPT ); Tue, 26 Apr 2022 21:39:08 -0400 Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D54DFDE; Tue, 26 Apr 2022 18:35:59 -0700 (PDT) Received: by mail-ua1-x933.google.com with SMTP id az13so88895uab.13; Tue, 26 Apr 2022 18:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=/GTP1Ij9ZJMMooI6eS22+QuUn9jrqBvk1je1hsyKuPo=; b=lCMCto1ZG06tjcFOHLHoplrUCEZhV4S3INk9fjek5AXQclh3ptUFAV2jDqi74ykNxm J6b1RMMQQ5mOjQfnYeaWMcgAYrLmB7AmvHKLD2aivY2z3rTPtnIGpUj9FX3rCehoQV/i bZgY6U25ibxcUHE+oQ7NmavUe7BM9vMka9KFUMTZNAFw8YOS5KfWd5gtmi2DJ6H89Lut DPwshVPC86NWyTRKP2ljZk+Kqx8sARjFaV3nMTthgbhalxvCM6U3/4Bq7Xf3QFUxjQOY NCWqSmpjjIItxku8IKI53c0mM36g1C+DWvAeu1g2ZFHlCuSJHnnDkiVx82o9sRHRc4/A orQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/GTP1Ij9ZJMMooI6eS22+QuUn9jrqBvk1je1hsyKuPo=; b=jsfYIXC8+vnknugQr15JtTaVBTbo+f4uDK7j5lZgVQAhYxdwPlrn+udkCHE9O96Rv/ QzMDDMZoMIXmUVs9EvHZDhICoeNXqwQYiLHdTuz5zeTL+l5sGrXmr0L2YZ39D55grJAI IbtkLDNbXI26Fg6e08fwhrKH0cINEYj8HCMAUI2ASYHqMnawQP8wQ7bQPSXIXuqfcHPt nV84Brz+nTFb5lZiPgQSqMCtS93LU7Cee7D7RD9gFN0sqJW7YnvERhlzMLvKO0U3PPjw iTESeKgY0KcM4HJD2XSwTLLbgBU6LVxyItSwja71ugTJ3lOO4Lu1RbNBt9z0MuDfNKLX jHXA== X-Gm-Message-State: AOAM530CoB2sx98C4affjGsS1PwxxBdRJQPfgW/lTaiBI3iqLazI780l gQMFA2v2bv7bYb1eyWwD5nJ1WQT15gUg7oDSW6k= X-Received: by 2002:ab0:2002:0:b0:35f:fd13:960 with SMTP id v2-20020ab02002000000b0035ffd130960mr7833994uak.50.1651023358245; Tue, 26 Apr 2022 18:35:58 -0700 (PDT) MIME-Version: 1.0 References: <20220407223629.21487-1-ricardo.martinez@linux.intel.com> <20220407223629.21487-5-ricardo.martinez@linux.intel.com> In-Reply-To: From: Sergey Ryazanov Date: Wed, 27 Apr 2022 04:35:58 +0300 Message-ID: Subject: Re: [PATCH net-next v6 04/13] net: wwan: t7xx: Add port proxy infrastructure To: "Veleta, Moises" Cc: Ricardo Martinez , "netdev@vger.kernel.org" , "linux-wireless@vger.kernel.org" , Jakub Kicinski , David Miller , Johannes Berg , Loic Poulain , "Kumar, M Chetan" , "Devegowda, Chandrashekar" , linuxwwan , "chiranjeevi.rapolu@linux.intel.com" , "Liu, Haijun" , "Hanania, Amir" , Andy Shevchenko , "Sharma, Dinesh" , "Lee, Eliot" , "Jarvinen, Ilpo Johannes" , "Bossart, Pierre-louis" , "Sethuraman, Muralidharan" , "Mishra, Soumya Prakash" , "Kancharla, Sreehari" , "Sahu, Madhusmita" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Apr 27, 2022 at 4:14 AM Veleta, Moises wr= ote: > From: Sergey Ryazanov > Sent: Tuesday, April 26, 2022 4:06 PM > To: Veleta, Moises > Cc: Ricardo Martinez ; netdev@vger.kern= el.org ; linux-wireless@vger.kernel.org ; Jakub Kicinski ; David Miller ; Johannes Berg ; Loic Poulain <= loic.poulain@linaro.org>; Kumar, M Chetan ; Deveg= owda, Chandrashekar ; linuxwwan ; chiranjeevi.rapolu@linux.intel.com ; Liu, Haijun ; Hanania, Amir ; Andy Shevchenko ; Sharm= a, Dinesh ; Lee, Eliot ; Jarv= inen, Ilpo Johannes ; Bossart, Pierre-lou= is ; Sethuraman, Muralidharan ; Mishra, Soumya Prakash ; Kancharla, Sreehari ; Sahu, Madhusmita= > Subject: Re: [PATCH net-next v6 04/13] net: wwan: t7xx: Add port proxy in= frastructure > > Hello Moises, > > On Tue, Apr 26, 2022 at 10:46 PM Veleta, Moises = wrote: >> From: Sergey Ryazanov >> Sent: Monday, April 25, 2022 4:53 PM >> To: Ricardo Martinez >> Cc: netdev@vger.kernel.org ; linux-wireless@vger= .kernel.org ; Jakub Kicinski ; David Miller ; Johannes Berg ; Loic Poulain ; Kumar, M Chetan ; Devegowda, Chandrashekar ; linuxwwan ; chiranjeevi.rapolu@linux.intel.com ; Liu, Haijun ; = Hanania, Amir ; Andy Shevchenko ; Sharma, Dinesh ; Lee, Eliot ; Jarvinen, Ilpo Johannes ; Veleta, Moises ; Bossart, Pierre-louis ; Sethuraman, Muralidharan ; Mishra, Soumya Prakash ; Kan= charla, Sreehari ; Sahu, Madhusmita >> Subject: Re: [PATCH net-next v6 04/13] net: wwan: t7xx: Add port proxy i= nfrastructure >> >> On Fri, Apr 8, 2022 at 1:37 AM Ricardo Martinez >> wrote: >>> Port-proxy provides a common interface to interact with different types >>> of ports. Ports export their configuration via `struct t7xx_port` and >>> operate as defined by `struct port_ops`. >>> >>> Signed-off-by: Haijun Liu >>> Co-developed-by: Chandrashekar Devegowda >>> Signed-off-by: Chandrashekar Devegowda >>> Co-developed-by: Ricardo Martinez >>> Signed-off-by: Ricardo Martinez >>> >>> From a WWAN framework perspective: >>> Reviewed-by: Loic Poulain >> >> [skipped] >> >>> +int t7xx_port_enqueue_skb(struct t7xx_port *port, struct sk_buff *skb) >>> +{ >>> + unsigned long flags; >>> + >>> + spin_lock_irqsave(&port->rx_wq.lock, flags); >>> + if (port->rx_skb_list.qlen >=3D port->rx_length_th) { >>> + spin_unlock_irqrestore(&port->rx_wq.lock, flags); >> >> Probably skb should be freed here before returning. The caller assumes >> that skb will be consumed even in case of error. >> >> [MV] We do not drop port ctrl messages. We keep them and try again later= . >> Whereas WWAN skbs are dropped if conditions are met. > > I missed that the WWAN port returns no error when it drops the skb. > And then I concluded that any failure to process the CCCI message > should be accomplished with the skb freeing. Now the handling of CCCI > messages is more clear to me. Thank you for the clarifications! > > To avoid similar misinterpretation in the future, I thought that the > skb freeing in the WWAN port worth a comment. Something to describe > that despite dropping the message, the return code is zero, indicating > skb consumption. Similarly in this (t7xx_port_enqueue_skb) function. > Something like: "return an error here, the caller will try again > later". And maybe in t7xx_cldma_gpd_rx_from_q() near the loop break > after the .skb_recv() failure test. Something like: "break message > processing for now will try this message later". > > What do you think? > > Yes, that would remove the unintended obfuscation . Unless, you think thi= s approach is inappropriate > and should be refactored. Otherwise, I will proceed with adding those cl= arifying comments. > Thank you. I am Ok with the current approach. It does not contain obvious errors. It might look puzzled, but proper comments should solve this. --=20 Sergey