Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3333138ioa; Tue, 26 Apr 2022 01:16:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlStkzIa3YkCpHay5Pua+Z8pxVgEjHnIQWFdJPxje+FiEKWPsM9GMOtbp3xAX1FRrs/KNO X-Received: by 2002:a17:906:1706:b0:6e8:9335:d554 with SMTP id c6-20020a170906170600b006e89335d554mr19811224eje.111.1650961016826; Tue, 26 Apr 2022 01:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650961016; cv=none; d=google.com; s=arc-20160816; b=i4ED7rIH5CWEanSu5JvVo5t0rcFKgrnHSJxTx4whmLKbXUROT5Fnj6REumyfz0E2+r B1ca84ccbt1SyuaC9A9W1T/OJvoKrj859UFCWkky+8gIa6Nkt6JazJHF/sXAiBMx06U9 ilIeJnz1kAGVVlf6gvRahUpL4OIAHJ7rJXokhsn4wjEA9V0uIVJo3qbXTkGHYFmLU2wp 3E6ehQ3lyvycOnlwWdOS7p6dRAi2s+DPXiwHs1iWjhuQnl6G7KgHz2yZPGdyjJDXAdjO 8+A84Wb/+dF2FLw+qw0yjQ1079EQBQlcKnkpRLeiAOGq7r/R2dbrGBYp7Gk336tU2Z+j 8Uug== 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=JpdFifKs7CxW50jPfs3i6TqXo2OQsTxzT2rNlZQve7o=; b=PNlmpO+e/vdg8B7WyhjILIjy5ngjmvo4AGq1KF+e0bmoKLEjCGtLuPQbE2Y7A2Cl9I 6jo8a8pxVj5xoBL49pjEythadv4Z2nnkbz4gzqXdN/LjLltGgItxcWJ1ICzva6gXfVzE i66QITXo6b9fm4YoUaOsK1mMI0DKQJAqardXyPiwHJMNyJ+FHJRlZuVHsn48TdQ9u3l7 eNadYVwUfl5jjnr6WXJ961jEQkzuclAFGxhljT70h+gIj7vyiSB3KFfPIn6Q+z4lfp/T 9BGp1oMdwQHzNW9h70yjHuUpOCJvc4FTr4LIwFxvEwIPFoVzLJfw2+08YZaW4IJWfTf1 9Ejw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XLLmcZJO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a0564020f0500b00425fbb00aebsi1123712eda.326.2022.04.26.01.16.34; Tue, 26 Apr 2022 01:16:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XLLmcZJO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S1344412AbiDZIER (ORCPT + 67 others); Tue, 26 Apr 2022 04:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344496AbiDZIEN (ORCPT ); Tue, 26 Apr 2022 04:04:13 -0400 Received: from mail-vk1-xa2f.google.com (mail-vk1-xa2f.google.com [IPv6:2607:f8b0:4864:20::a2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28E3327B20; Tue, 26 Apr 2022 01:01:06 -0700 (PDT) Received: by mail-vk1-xa2f.google.com with SMTP id e7so8349456vkh.2; Tue, 26 Apr 2022 01:01:06 -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=JpdFifKs7CxW50jPfs3i6TqXo2OQsTxzT2rNlZQve7o=; b=XLLmcZJORWm2MA9YZBulpcc0AbfDmwCq/jjtCH3RF+8AjkBmwRvUhpoUrr/D7XObul TlPlIY023CjDfxJye/vZfj7ERoTu/9Hgl6hkKNyJRqFGeAPLT+AvRw3CRd0ZMedhsxG6 i6LaNLIwFYzCUSw0UDM1m1sNQHWcCLCYdwsrHCUuYO7uHCOkNHbLF7X8iOLSEIcS4IIX +2uauYW9vIVINCjvlSiDrt16tiFpiT73IKWYNjPl2J4tgrGuUtY82W1hAcUjJDfexDwC KYrO5QRSNUoG1OszGnr+DxTfGPRlg70Ig6uRVTAamYhYFdp8H2Zhw0RN+Ha1Leg8enqQ yKkA== 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=JpdFifKs7CxW50jPfs3i6TqXo2OQsTxzT2rNlZQve7o=; b=X0bdGQypU+3i32w1HiOA7oSC/EjjU/3J3gKXR0ZK5OT75D7BWium9g4PYQbqh0cXe2 p5F/uI4SajtDXuzbhdntjM1OKuJxi69GK88kYJ1YZ6jMwbOVWsENNJVTMGH9Rsdw5laL i8xQ4vpL51ILs7stB6ydgbgSmR6FMZX99oDTfyrJK3B5H6+YTKNm7IzdEPtukzWu1b/i I/wu/xfyFu/l28uRA1RNPBJKnwZPC6l5OLYPN/tKW8dEP57bbg8bDdpzDesGTinkDLFI LchPU4U8syIwyBou5r31HMoavsDpgcJ6pehY5ilJ3Fh3k1bWVjsIz0i6xiew3l2MmyK0 i8/g== X-Gm-Message-State: AOAM5300ZlmHvfR04CgOlpeoJ1KCif0Qx/Xb9TNvwDpnQ17UWnIFPxk7 o2Xw7lxCcE5EKs7WxIwo3190+gcvKx9+T5aakdo= X-Received: by 2002:a1f:e2c7:0:b0:34d:310f:6b0 with SMTP id z190-20020a1fe2c7000000b0034d310f06b0mr4052769vkg.19.1650960065178; Tue, 26 Apr 2022 01:01:05 -0700 (PDT) MIME-Version: 1.0 References: <20220407223629.21487-1-ricardo.martinez@linux.intel.com> <20220407223629.21487-9-ricardo.martinez@linux.intel.com> In-Reply-To: From: Sergey Ryazanov Date: Tue, 26 Apr 2022 11:00:54 +0300 Message-ID: Subject: Re: [PATCH net-next v6 08/13] net: wwan: t7xx: Add data path interface To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: Ricardo Martinez , Netdev , linux-wireless@vger.kernel.org, Jakub Kicinski , David Miller , Johannes Berg , Loic Poulain , M Chetan Kumar , chandrashekar.devegowda@intel.com, Intel Corporation , chiranjeevi.rapolu@linux.intel.com, =?UTF-8?B?SGFpanVuIExpdSAo5YiY5rW35YabKQ==?= , amir.hanania@intel.com, Andy Shevchenko , dinesh.sharma@intel.com, eliot.lee@intel.com, moises.veleta@intel.com, pierre-louis.bossart@intel.com, muralidharan.sethuraman@intel.com, Soumya.Prakash.Mishra@intel.com, sreehari.kancharla@intel.com, madhusmita.sahu@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 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 including >>> 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/w= wan/t7xx/t7xx_hif_dpmaif_rx.c >>> ... >>> +static bool t7xx_alloc_and_map_skb_info(const struct dpmaif_ctrl *dpma= if_ctrl, >>> + const unsigned int size, struct= 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 soun= d > 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. -- Sergey