Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp163349iob; Mon, 2 May 2022 16:01:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeOTcWCYlhoBSFm35hPQ4FRWx50M+7W/xGwXqpP8XQfWHRFlTEghJkOtPmMm0nFqzrRvfv X-Received: by 2002:a17:902:d3cb:b0:15b:a002:d80c with SMTP id w11-20020a170902d3cb00b0015ba002d80cmr13675434plb.108.1651532498518; Mon, 02 May 2022 16:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651532498; cv=none; d=google.com; s=arc-20160816; b=DTZqx/r+SCqVCUVXtexnNh4RLaUYPn3l5wJipjWXyP8hsZhuLK3E56EbcKFktsu7rK ULxapIIowAh4zftqniAg/QmOlwNRnzCijR65qQ+W2Vlm8cC3Y1/4kTQmkpnzJZlS90hq vIIoPpEhUAAerrMLgn7/Dful8vMSRCIetw5EI2P12j4LCRvCofhm0pwWg/HyXt1tTrjf MnPDFy2DGPzQbXDJ58ADCySMBa7ZYzb6dL9cZObK1lQzG19yfUPMM5xWK0onthWcoyde H7d5Pv/+QtEOWPphM8V7pbkiJ4UNFlRf2WjeER70y8EV26+e8nbyRDg2JunArDfTEc05 HcGA== 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=camkMsHADeMrXa4AMLDSfBWqeAJxrU8KTK9CoSo2Ws4=; b=dvWpWuo3y1Ym+7dzc+eeHQbRRowm+aG56nOShb6m9g6WlGUY7KtM0JtmZtPQ24pQMh XZT/NkKpj3MYYoIrfCMo4rqPXleX7T/ZyaPc76nWZQUdKm92rN88TP27p12YktAPdod3 zNfi1vzu37v76zrRATmtGBEyLX2jQzp09BoENmVrt7lMKN2VZsIaampIN3BL4VaEwogT S40ncjLsD7ca/Ow9M9NLnor84cG4pAMjanqTBxN/Vaz1LAG3lJe4v8ghsgrINIwwxCUG PtUVTIhSF1NsXJAxXkl8AQ7CW6fZX5pfOyOU4LS6qgBg22JVxqEWJcgyjB2JAwDFQnf7 4Neg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oKm8PfXQ; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id u11-20020a170903124b00b0015d1f275e43si11074500plh.368.2022.05.02.16.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:01:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oKm8PfXQ; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B058F2BB0F; Mon, 2 May 2022 16:01:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244041AbiEBRnf (ORCPT + 68 others); Mon, 2 May 2022 13:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235860AbiEBRnd (ORCPT ); Mon, 2 May 2022 13:43:33 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 976C7BE36; Mon, 2 May 2022 10:40:03 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id m62so13633802vsc.2; Mon, 02 May 2022 10:40:03 -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=camkMsHADeMrXa4AMLDSfBWqeAJxrU8KTK9CoSo2Ws4=; b=oKm8PfXQo/fs5n3fryHbbVG03dr2wEg/Mfn1trRKBXNKCX8UpxY3tBM8Zty9t3zzOF ibuOgsRnS9JF3DDzjq+AkPHmhyrUN8B+CgB/Ndd0Yh5Fq2tPPlf7PZRlPLDXxb8VG4SS vqsduZN41nphB+bsy7CwqSjL/vXFKzMgN9eEpQQONkJB5wZDxrJKCKWpZOqvewYzpkK7 vuhmMBpf72Z5WWUO+v2S81fiMAIZoiJBZ8RI7HHs5uIaHIVCgOr27PU5yTQh3KixA3nG PImG0nJr/hFtXYaD+UlwORZ9db4pggHiDF1OSEZq7oeK5SQ6HGia0f2EtUK+2utta617 0EAg== 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=camkMsHADeMrXa4AMLDSfBWqeAJxrU8KTK9CoSo2Ws4=; b=5/NCsgJUkEx2Op6F7ZpNbprxaHQDPk3ZJGn5X5ESwDTPKn5TU2C2F0p+B5yFHqN4m8 Ew8mXWtRZZmwaLhxhzvOFbz6tqqsM3NG/vURk7ripu2TYLri+JuiemBftEEvCAQ6PfyJ OWAkiyMhCEj6BxMDE07hCUQVds6vWow2yUUW3FwotUxQxykdWOvUfelOWhAU/NiuCmSQ lh54/R0f/IOElvNTo5MmzpQjhO3l4PTIZwtSyCqPnyCbNzbEP6aFSjsjkb7MaGHDfX1r R+hTjwOhkc5FwKAmjGVIekouGZYK7Lv/hMVS0xKUjQaDIixm1kRnxhkVM2ZF+6RFVxpD D7Qg== X-Gm-Message-State: AOAM532SXBwKQ8pZcV3tiaG4b8y4t1/ka1pneUWXIZCyhsBs/El5BUdj CLoIkgpvObA+b+p0QphVum5dKIMllWoIvRNMdKc= X-Received: by 2002:a67:2ec4:0:b0:32c:c442:a309 with SMTP id u187-20020a672ec4000000b0032cc442a309mr3559511vsu.32.1651513202727; Mon, 02 May 2022 10:40:02 -0700 (PDT) MIME-Version: 1.0 References: <20220407223629.21487-1-ricardo.martinez@linux.intel.com> <20220407223629.21487-9-ricardo.martinez@linux.intel.com> <20a16430-f68c-3df4-1592-e7dad5ec9d53@linux.intel.com> In-Reply-To: <20a16430-f68c-3df4-1592-e7dad5ec9d53@linux.intel.com> From: Sergey Ryazanov Date: Mon, 2 May 2022 20:40:01 +0300 Message-ID: Subject: Re: [PATCH net-next v6 08/13] net: wwan: t7xx: Add data path interface To: "Martinez, Ricardo" Cc: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Netdev , linux-wireless@vger.kernel.org, Jakub Kicinski , David Miller , Johannes Berg , Loic Poulain , M Chetan Kumar , "Devegowda, Chandrashekar" , Intel Corporation , chiranjeevi.rapolu@linux.intel.com, =?UTF-8?B?SGFpanVuIExpdSAo5YiY5rW35YabKQ==?= , "Hanania, Amir" , Andy Shevchenko , "Sharma, Dinesh" , "Lee, Eliot" , "Veleta, Moises" , "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,T_SCC_BODY_TEXT_LINE 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 Hello Ricardo, On Mon, May 2, 2022 at 7:51 PM Martinez, Ricardo wrote: > On 4/26/2022 1:00 AM, Sergey Ryazanov wrote: >> On Tue, Apr 26, 2022 at 10:30 AM Ilpo J=C3=A4rvinen >> wrote: >>> On Tue, 26 Apr 2022, Sergey Ryazanov wrote: >>>> On Fri, Apr 8, 2022 at 1:37 AM Ricardo Martinez >>>> wrote: >>>>> Data Path Modem AP Interface (DPMAIF) HIF layer provides methods >>>>> for initialization, ISR, control and event handling of TX/RX flows. >>>>> >>>>> DPMAIF TX >>>>> Exposes the 'dmpaif_tx_send_skb' function which can be used by the >>>>> network device to transmit packets. >>>>> The uplink data management uses a Descriptor Ring Buffer (DRB). >>>>> First DRB entry is a message type that will be followed by 1 or more >>>>> normal DRB entries. Message type DRB will hold the skb information >>>>> and each normal DRB entry holds a pointer to the skb payload. >>>>> >>>>> DPMAIF RX >>>>> The downlink buffer management uses Buffer Address Table (BAT) and >>>>> Packet Information Table (PIT) rings. >>>>> The BAT ring holds the address of skb data buffer for the HW to use, >>>>> while the PIT contains metadata about a whole network packet includin= g >>>>> a reference to the BAT entry holding the data buffer address. >>>>> The driver reads the PIT and BAT entries written by the modem, when >>>>> reaching a threshold, the driver will reload the PIT and BAT rings. >>>>> >>>>> Signed-off-by: Haijun Liu >>>>> Signed-off-by: Chandrashekar Devegowda >>>>> Co-developed-by: Ricardo Martinez >>>>> Signed-off-by: Ricardo Martinez >>>>> >>>>> From a WWAN framework perspective: >>>>> Reviewed-by: Loic Poulain >>>> Reviewed-by: Sergey Ryazanov >>>> >>>> and a small question below. >>>> >>>>> diff --git a/drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c b/drivers/net= /wwan/t7xx/t7xx_hif_dpmaif_rx.c >>>>> ... >>>>> +static bool t7xx_alloc_and_map_skb_info(const struct dpmaif_ctrl *dp= maif_ctrl, >>>>> + const unsigned int size, stru= ct dpmaif_bat_skb *cur_skb) >>>>> +{ >>>>> + dma_addr_t data_bus_addr; >>>>> + struct sk_buff *skb; >>>>> + size_t data_len; >>>>> + >>>>> + skb =3D __dev_alloc_skb(size, GFP_KERNEL); >>>>> + if (!skb) >>>>> + return false; >>>>> + >>>>> + data_len =3D skb_end_pointer(skb) - skb->data; >>>> >>>> Earlier you use a nice t7xx_skb_data_area_size() function here, but >>>> now you opencode it. Is it a consequence of t7xx_common.h removing? >>>> >>>> I would even encourage you to make this function common and place it >>>> into include/linux/skbuff.h with a dedicated patch and call it >>>> something like skb_data_size(). Surprisingly, there is no such helper >>>> function in the kernel, and several other drivers will benefit from >>>> it: >>> >>> I agree other than the name. IMHO, skb_data_size sounds too much "data >>> size" which it exactly isn't but just how large the memory area is (we >>> already have "datalen" anyway and on language level, those two don't so= und >>> different at all). The memory area allocated may or may not have actual >>> data in it, I suggested adding "area" into it. >> >> I agree, using the "area" word in the helper name gives more clue >> about its purpose, thanks. >> > > Sounds good. I'll add a patch to introduce skb_data_area_size(), > I'm not planning to update other drivers to use it, at least in this seri= es. Sure. Introduction of the helper function will be enough in the context of this series. This will make life easier for future contributors. And perhaps over time the earlier opencoded places will be updated to the new API. --=20 Sergey