From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 501D0C10F0E for ; Thu, 18 Apr 2019 20:24:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C3A320869 for ; Thu, 18 Apr 2019 20:24:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SSW7FSrb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389886AbfDRUY5 (ORCPT ); Thu, 18 Apr 2019 16:24:57 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36804 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389442AbfDRUY4 (ORCPT ); Thu, 18 Apr 2019 16:24:56 -0400 Received: by mail-wm1-f68.google.com with SMTP id h18so4274250wml.1 for ; Thu, 18 Apr 2019 13:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5phAP4XDH8JHRRoEcwBAkg3HrBEifurF3fl2RNnAZ3A=; b=SSW7FSrbOtY5EQ2O57qYIllm25tMWvicrggd8sPg6KNwjvJxiXz5OWqL1sANFMl0sx 4NT/hFed3m/MXEtGDbdEpd7895fBYcUapmFqpOv+EZfzldcDK5eS09OgefC/Z4ZCPOMD S5/cgQIhoEkjnw2eOI4sDI3oO8OBwvEXwqAnmtGAWJMkobj8ca9NQtKEiqrzRBIbEGkT vnWIpDJh/I0T5VWvFdpoqJ96HJ4EsaDAba9LSf3nXvtTvgBQK/49NQRz4iWlUJj/LRoT 43kXG9sXLkAju0PBMmXZCO87ZEVJgeyvZAIxI7IbY8UIe3wVKav0JSAzgARb5ykJsaEt Fi1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5phAP4XDH8JHRRoEcwBAkg3HrBEifurF3fl2RNnAZ3A=; b=GbwxMQELKcmQAEQXHZBjOoPw29FhRiHY0eIDBubE4X/Xh0EqZg5s45IGFEcqXK6e7R 6TWxR0qz1/odkRbsn3hCaj1fjGEisPAQDIRDdeQLALWvXz1RKfDPyyNcE7jC4E51ARoB wHyA9ky6gFvBxzpOf8k5PATpXbT0sThxYCklbUmcYRuprM7MpNkKvTMfSRtQennEuEPJ RA2NbmhswfTLOMJiG/ukaqjBcOz/fTc7MclKpGEANVWQBf/nRDiTFGLIY998NIDEECVQ yykkBcazkZlSA14yM2AdR2QPSeqzc8SKMZ99vp8GdGG0rcwMQW3ecOfx4FKNbJA8AwdW F6Pw== X-Gm-Message-State: APjAAAX/WBLstz7yeE5YPtA9Uhh+p5hvkMYv8yqgFOY5iVIhv6hCSVln o2ayw3o6/zV7dB1eZABIKSrV0g== X-Google-Smtp-Source: APXvYqwmvy6yNMjJwdaC9PFrNnZX0qAx7ocpR6joq8KYKgDT6SOYl1BwZS7wzVymBzz2FnG42VVWCg== X-Received: by 2002:a1c:3944:: with SMTP id g65mr118045wma.34.1555619094936; Thu, 18 Apr 2019 13:24:54 -0700 (PDT) Received: from apalos (athedsl-4485328.home.otenet.gr. [94.71.60.216]) by smtp.gmail.com with ESMTPSA id i18sm2225349wrm.7.2019.04.18.13.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 13:24:54 -0700 (PDT) Date: Thu, 18 Apr 2019 23:24:51 +0300 From: Ilias Apalodimas To: Ard Biesheuvel Cc: "" , Jaswinder Singh , "David S. Miller" , Masahisa Kojima Subject: Re: [PATCH] net: socionext: replace napi_alloc_frag with the netdev variant on init Message-ID: <20190418202451.GA31868@apalos> References: <1555612037-29217-1-git-send-email-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Ard, > > Use netdev_alloc_frag during the Rx ring setup instead napi_alloc_frag > > > > Why? > The netdev variant is usable on any context since it disables interrupts. The napi variant of the call is supposed to be used under softirq context only > > Signed-off-by: Ilias Apalodimas > > --- > > drivers/net/ethernet/socionext/netsec.c | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c > > index a18149720aa2..cba5881b2746 100644 > > --- a/drivers/net/ethernet/socionext/netsec.c > > +++ b/drivers/net/ethernet/socionext/netsec.c > > @@ -673,7 +673,8 @@ static void netsec_process_tx(struct netsec_priv *priv) > > } > > > > static void *netsec_alloc_rx_data(struct netsec_priv *priv, > > - dma_addr_t *dma_handle, u16 *desc_len) > > + dma_addr_t *dma_handle, u16 *desc_len, > > + bool napi) > > { > > size_t total_len = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); > > size_t payload_len = NETSEC_RX_BUF_SZ; > > @@ -682,7 +683,7 @@ static void *netsec_alloc_rx_data(struct netsec_priv *priv, > > > > total_len += SKB_DATA_ALIGN(payload_len + NETSEC_SKB_PAD); > > > > - buf = napi_alloc_frag(total_len); > > + buf = napi ? napi_alloc_frag(total_len) : netdev_alloc_frag(total_len); > > if (!buf) > > return NULL; > > > > @@ -765,7 +766,8 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) > > /* allocate a fresh buffer and map it to the hardware. > > * This will eventually replace the old buffer in the hardware > > */ > > - buf_addr = netsec_alloc_rx_data(priv, &dma_handle, &desc_len); > > + buf_addr = netsec_alloc_rx_data(priv, &dma_handle, &desc_len, > > + true); > > if (unlikely(!buf_addr)) > > break; > > > > @@ -1069,7 +1071,8 @@ static int netsec_setup_rx_dring(struct netsec_priv *priv) > > void *buf; > > u16 len; > > > > - buf = netsec_alloc_rx_data(priv, &dma_handle, &len); > > + buf = netsec_alloc_rx_data(priv, &dma_handle, &len, > > + false); > > if (!buf) { > > netsec_uninit_pkt_dring(priv, NETSEC_RING_RX); > > goto err_out; > > -- > > 2.7.4 > >