Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1099310ybg; Thu, 4 Jun 2020 00:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhRB3zn8U8D0CCIpH/WfxzL8+2TIPj97Tbb5fCCcWDaA63od/guYIFkEkiKsnoTYYji8ZV X-Received: by 2002:a17:906:4ecf:: with SMTP id i15mr2826754ejv.515.1591256189085; Thu, 04 Jun 2020 00:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591256189; cv=none; d=google.com; s=arc-20160816; b=qWnshdVFUF1Kq9iJodB/bNYGeKqZHauU7Hi//P1vYC2N7WgrlnuS/v9dbTtbgQIlPD 9Qb3hGUyWUuTlVfuD834ALEHW7QsSeH1NrwV5arT8afnt77PM8LIxdTaXPGFj3UoWuwr tt0Uhte8NL/DToLHGSZjlpy+Q1tlxfMeBEBcPlPxLLJi077sQEPYfITTU95+jKfp/q3s X/o/Vx/hwEm0luY6iC1AgWHYzXzU2SnKirWyxxMM/SSQ4b9Sq+ddje85HOJWRXUEYqBf fJtvkx6KLcrO38PFMu4+JNvzoIIJq8sVLyXipsmZnApeKgQpdTUDmQ7yajm85jtkKBXf bZ5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=2lim7crzKdAGiVV3VYPYjZlnyAS4/+uuLREv3WPauYU=; b=fvSFDGp7AiJr/l8mRBmFHh1aCGvJ6kPT0dyF1EqVRGGNw1Muqdv1GyezRhVBOU3qIo MVIfcbExs4d5ApU0+p0RZpmDXYh87fHDGOWfArFN/+rltDSfb1+/nJUXvLIOQnqHyb7u PUEXS+ywIOi6HZMXUJaULNvqLWNCezFF7vMldr3fWfNSnB7eRCA7YuFsJ2M144PqFfu1 LEMtcCHsUtqMxChfMRkwGyegHVP73Jy6Q3we053Ag5gcuXu99h8eQAew6lFoT4G2IjoL jpTcgdNL4+pGNF5WCpNCq2gQx3zl/Pqow3sfWPTDCbq+q8qRIEc0BRiGRz78cnfdmnEh 5rtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zo8si1163604ejb.156.2020.06.04.00.36.07; Thu, 04 Jun 2020 00:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbgFDHe1 (ORCPT + 99 others); Thu, 4 Jun 2020 03:34:27 -0400 Received: from mga06.intel.com ([134.134.136.31]:31576 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbgFDHe1 (ORCPT ); Thu, 4 Jun 2020 03:34:27 -0400 IronPort-SDR: waWFv/0ckFmxFHYKYn6YbR4k/dKKAyRni69NLdmBgCYQmDCr1jN8oU8yuG2BGZJjHJ+q9UN0PQ 8d4U8noIgD1A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 00:34:26 -0700 IronPort-SDR: fsVuR090uk8ysQYBdRKxnsIdfGHB/7r6f6R1TV7D6noOLvvkN57zEonofvVy2gPQ4dn+4B8IyG ftSQIgC9dIMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,471,1583222400"; d="scan'208";a="348021438" Received: from pg-nxl3.altera.com ([10.142.129.93]) by orsmga001.jf.intel.com with ESMTP; 04 Jun 2020 00:34:22 -0700 From: "Ooi, Joyce" To: Thor Thayer , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Dalon Westergreen , Joyce Ooi , Tan Ley Foon , See Chin Liang , Dinh Nguyen , Dalon Westergreen Subject: [PATCH v3 02/10] net: eth: altera: set rx and tx ring size before init_dma call Date: Thu, 4 Jun 2020 15:32:48 +0800 Message-Id: <20200604073256.25702-3-joyce.ooi@intel.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20200604073256.25702-1-joyce.ooi@intel.com> References: <20200604073256.25702-1-joyce.ooi@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dalon Westergreen It is more appropriate to set the rx and tx ring size before calling the init function for the dma. Signed-off-by: Dalon Westergreen Signed-off-by: Joyce Ooi --- v2: no change v3: no change --- drivers/net/ethernet/altera/altera_tse_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 2a9e6157a8a1..539e744e23f7 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1154,6 +1154,10 @@ static int tse_open(struct net_device *dev) int i; unsigned long int flags; + /* set tx and rx ring size */ + priv->rx_ring_size = dma_rx_num; + priv->tx_ring_size = dma_tx_num; + /* Reset and configure TSE MAC and probe associated PHY */ ret = priv->dmaops->init_dma(priv); if (ret != 0) { @@ -1196,8 +1200,6 @@ static int tse_open(struct net_device *dev) priv->dmaops->reset_dma(priv); /* Create and initialize the TX/RX descriptors chains. */ - priv->rx_ring_size = dma_rx_num; - priv->tx_ring_size = dma_tx_num; ret = alloc_init_skbufs(priv); if (ret) { netdev_err(dev, "DMA descriptors initialization failed\n"); -- 2.13.0