From patchwork Thu Apr 18 18:27:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 162515 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp1029776oca; Thu, 18 Apr 2019 11:27:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMOtzXQ7VWobrrulvmZWSYRS0+3hgwyoRl2x80Ay+7PLwhZZYieBb6c/Gx9rNmHFhp22qV X-Received: by 2002:a63:1702:: with SMTP id x2mr6933770pgl.448.1555612054502; Thu, 18 Apr 2019 11:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555612054; cv=none; d=google.com; s=arc-20160816; b=SQG5nS6tvPWpQPS/N9bL3ieVb2qjwVfq4dfV4b1XdrD8C5njq8wPny7KZ3Cn2Zup3y DRLVKUOyKaS6ibe9JGD0qhDTAPBxhGbuEGXqRXYCfvIAmucPFy+w7yPFnKFV0eeU6aT+ 99X2iiXNy8FDr+LwzKasVuUiJWGPFmO373Y50f5pirHWKwZox0lFN851J8K2gm5dBD4U SkFj88020Idl7YSSdo2/0PEsankbWtRuaJ0dN8Ao4wthZx4ASEFnxYcQH+G5DcmBN7+f Jc5g9WSjR6v8czZFGnWXwruwCsjZQM0AE+DHJC8eKUkjZh/sSA0ylML8d3KpiHUci+fi m52A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=SDTcCYmGz5gWk8yDDDThVGCrVCvyk5zAyEx33v/ekcs=; b=DjPSr7rlNy+JA5KjJru49Wf4GERr6tnJv5CxSR0Zv00ktzKPAFxaECSQy8p9Rs1Rtc 81NOv1MYhAdjtNSfGAnD8xxnPrF/ILC90EnMD9k/2wPH47uG+XDIXv9+RxQ9X97ihQij QejLAUTtMePcZwIXdnx/1mHAaGT0PUZRVi6lzdIJpddsAgSqBGywkzEoIHU26BYQYFmb 5a1mXKq58E7hw6W/E01YmFMyO6oXkU/uC+u2B4FjflL5undl13AmluWXiorzgB2FwjoT sO7TE9vkBdwj9Cd6CgYoKUXq7O7ndNTe7xQG1NUPcq4pV3til7g7IMM2QickI93faSc/ Am8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gg4gnZHa; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si2906013pli.8.2019.04.18.11.27.34; Thu, 18 Apr 2019 11:27:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gg4gnZHa; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390988AbfDRS1c (ORCPT + 9 others); Thu, 18 Apr 2019 14:27:32 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38598 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390662AbfDRS1c (ORCPT ); Thu, 18 Apr 2019 14:27:32 -0400 Received: by mail-wm1-f67.google.com with SMTP id w15so3933126wmc.3 for ; Thu, 18 Apr 2019 11:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=SDTcCYmGz5gWk8yDDDThVGCrVCvyk5zAyEx33v/ekcs=; b=Gg4gnZHa31gcIWKyCgijG9aG0sNcxK+hIJYs/8hZ3wJ6c5wE+nWUl8Tu6ErUMLPlmx aIpnJZJJqwxiVP1Zr3WrkgpQDJbwZXEABCug0mpS6NhKtORKAwEne7JUMRSVMAhrinHo A6yviAvrymAGdwIlMXvrm6VqLs+pXdoZtUliZA076h0VrDWcjBE5eoB9qrTJ/J/ap8gT UzgxPg0BDrZQHc5L9xwCbfTEI5Zt0DlDPkT1PFQijXK3Kx7729t7krtyrNv97U+R3k0j SaFttxkoFgyD+0N+4HRN/6/ka7Ybk+w9DGLkNnPkaoidxkmgWgT65jSq++41PImk7yaq GzzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SDTcCYmGz5gWk8yDDDThVGCrVCvyk5zAyEx33v/ekcs=; b=UcTdRygQjDVdHc0ugyXV9c1FwBARMVBRKzKelWn7Tq+pqRZ4XX/CigLGsCh1DnaUk6 ML9Pptz6RW24I4ZTdgEtdc0u12gJOp6xNMQ2VieIHKTgTo7FjDwHmacRe13mnyeZD4Ge TkCkh6DxTMYrGHzZsSbf7xg7wPt538tIRYUPEW5BNnytgIFbarKo7FxWNHl2LQJYT+/d zfXeTTMiY5NO+b0AIjUzeuWDS4dKYtQp6Lok4O3l+9C1V7lhevYX0p/x70fB4mM10tSm SMKMbB7zzcG+pSpMCJ+xmdunsfmWijkU5BwImpsLxqWctHS0bNl8jAEoupDNVq9Gd+/7 4YuQ== X-Gm-Message-State: APjAAAVZnk5V6zIrzbEy6Hmnoto+PD1xglgAo/9iZNDQQ8Y4/35bzvA2 pwpqM6oVmbGdXw5Z0jXg7omIdlniJ0w= X-Received: by 2002:a1c:cf0b:: with SMTP id f11mr4224572wmg.26.1555612050068; Thu, 18 Apr 2019 11:27:30 -0700 (PDT) Received: from apalos.lan (athedsl-4485328.home.otenet.gr. [94.71.60.216]) by smtp.gmail.com with ESMTPSA id t9sm4183627wra.71.2019.04.18.11.27.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Apr 2019 11:27:29 -0700 (PDT) From: Ilias Apalodimas To: netdev@vger.kernel.org, jaswinder.singh@linaro.org, davem@davemloft.net Cc: ard.biesheuvel@linaro.org, masahisa.kojima@linaro.org, Ilias Apalodimas Subject: [PATCH] net: socionext: replace napi_alloc_frag with the netdev variant on init Date: Thu, 18 Apr 2019 21:27:17 +0300 Message-Id: <1555612037-29217-1-git-send-email-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use netdev_alloc_frag during the Rx ring setup instead napi_alloc_frag Fixes: 4acb20b46214 ("net: socionext: different approach on DMA") Signed-off-by: Ilias Apalodimas --- drivers/net/ethernet/socionext/netsec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.7.4 Acked-by: Ard Biesheuvel Acked-by: Jassi Brar 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;