From: Jose Abreu <Jose.Abreu@synopsys.com> To: netdev@vger.kernel.org Cc: Joao Pinto <Joao.Pinto@synopsys.com>, Jose Abreu <Jose.Abreu@synopsys.com>, Giuseppe Cavallaro <peppe.cavallaro@st.com>, Alexandre Torgue <alexandre.torgue@st.com>, "David S. Miller" <davem@davemloft.net>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 net-next 09/13] net: stmmac: ethtool: Let user configure TX coalesce without RIWT Date: Wed, 4 Sep 2019 15:17:01 +0200 [thread overview] Message-ID: <7f11754637d5c757ca43b5a832f6707d692e1099.1567602868.git.joabreu@synopsys.com> (raw) In-Reply-To: <cover.1567602867.git.joabreu@synopsys.com> In-Reply-To: <cover.1567602867.git.joabreu@synopsys.com> When RX Watchdog is disabled its currently not possible to configure TX coalesce settings. Let user configure it anyway. Signed-off-by: Jose Abreu <joabreu@synopsys.com> --- Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Jose Abreu <joabreu@synopsys.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 1c450105e5a6..1a768837ca72 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -746,8 +746,15 @@ static int stmmac_set_coalesce(struct net_device *dev, (ec->tx_max_coalesced_frames_high) || (ec->rate_sample_interval)) return -EOPNOTSUPP; - if (ec->rx_coalesce_usecs == 0) - return -EINVAL; + if (priv->use_riwt && (ec->rx_coalesce_usecs > 0)) { + rx_riwt = stmmac_usec2riwt(ec->rx_coalesce_usecs, priv); + + if ((rx_riwt > MAX_DMA_RIWT) || (rx_riwt < MIN_DMA_RIWT)) + return -EINVAL; + + priv->rx_riwt = rx_riwt; + stmmac_rx_watchdog(priv, priv->ioaddr, priv->rx_riwt, rx_cnt); + } if ((ec->tx_coalesce_usecs == 0) && (ec->tx_max_coalesced_frames == 0)) @@ -757,20 +764,10 @@ static int stmmac_set_coalesce(struct net_device *dev, (ec->tx_max_coalesced_frames > STMMAC_TX_MAX_FRAMES)) return -EINVAL; - rx_riwt = stmmac_usec2riwt(ec->rx_coalesce_usecs, priv); - - if ((rx_riwt > MAX_DMA_RIWT) || (rx_riwt < MIN_DMA_RIWT)) - return -EINVAL; - else if (!priv->use_riwt) - return -EOPNOTSUPP; - /* Only copy relevant parameters, ignore all others. */ priv->tx_coal_frames = ec->tx_max_coalesced_frames; priv->tx_coal_timer = ec->tx_coalesce_usecs; priv->rx_coal_frames = ec->rx_max_coalesced_frames; - priv->rx_riwt = rx_riwt; - stmmac_rx_watchdog(priv, priv->ioaddr, priv->rx_riwt, rx_cnt); - return 0; } -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Jose Abreu <Jose.Abreu@synopsys.com> To: netdev@vger.kernel.org Cc: Jose Abreu <Jose.Abreu@synopsys.com>, Joao Pinto <Joao.Pinto@synopsys.com>, Alexandre Torgue <alexandre.torgue@st.com>, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Giuseppe Cavallaro <peppe.cavallaro@st.com>, "David S. Miller" <davem@davemloft.net>, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 net-next 09/13] net: stmmac: ethtool: Let user configure TX coalesce without RIWT Date: Wed, 4 Sep 2019 15:17:01 +0200 [thread overview] Message-ID: <7f11754637d5c757ca43b5a832f6707d692e1099.1567602868.git.joabreu@synopsys.com> (raw) In-Reply-To: <cover.1567602867.git.joabreu@synopsys.com> In-Reply-To: <cover.1567602867.git.joabreu@synopsys.com> When RX Watchdog is disabled its currently not possible to configure TX coalesce settings. Let user configure it anyway. Signed-off-by: Jose Abreu <joabreu@synopsys.com> --- Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Jose Abreu <joabreu@synopsys.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 1c450105e5a6..1a768837ca72 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -746,8 +746,15 @@ static int stmmac_set_coalesce(struct net_device *dev, (ec->tx_max_coalesced_frames_high) || (ec->rate_sample_interval)) return -EOPNOTSUPP; - if (ec->rx_coalesce_usecs == 0) - return -EINVAL; + if (priv->use_riwt && (ec->rx_coalesce_usecs > 0)) { + rx_riwt = stmmac_usec2riwt(ec->rx_coalesce_usecs, priv); + + if ((rx_riwt > MAX_DMA_RIWT) || (rx_riwt < MIN_DMA_RIWT)) + return -EINVAL; + + priv->rx_riwt = rx_riwt; + stmmac_rx_watchdog(priv, priv->ioaddr, priv->rx_riwt, rx_cnt); + } if ((ec->tx_coalesce_usecs == 0) && (ec->tx_max_coalesced_frames == 0)) @@ -757,20 +764,10 @@ static int stmmac_set_coalesce(struct net_device *dev, (ec->tx_max_coalesced_frames > STMMAC_TX_MAX_FRAMES)) return -EINVAL; - rx_riwt = stmmac_usec2riwt(ec->rx_coalesce_usecs, priv); - - if ((rx_riwt > MAX_DMA_RIWT) || (rx_riwt < MIN_DMA_RIWT)) - return -EINVAL; - else if (!priv->use_riwt) - return -EOPNOTSUPP; - /* Only copy relevant parameters, ignore all others. */ priv->tx_coal_frames = ec->tx_max_coalesced_frames; priv->tx_coal_timer = ec->tx_coalesce_usecs; priv->rx_coal_frames = ec->rx_max_coalesced_frames; - priv->rx_riwt = rx_riwt; - stmmac_rx_watchdog(priv, priv->ioaddr, priv->rx_riwt, rx_cnt); - return 0; } -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-09-04 13:18 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-04 13:16 [PATCH v2 net-next 00/13] net: stmmac: Improvements for -next Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:16 ` [PATCH v2 net-next 01/13] net: stmmac: selftests: Return proper error code to userspace Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:16 ` [PATCH v2 net-next 02/13] net: stmmac: xgmac: Add RBU handling in DMA interrupt Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:16 ` [PATCH v2 net-next 03/13] net: stmmac: Do not return error code in TC Initialization Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:16 ` [PATCH v2 net-next 04/13] net: stmmac: Implement L3/L4 Filters using TC Flower Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:16 ` [PATCH v2 net-next 05/13] net: stmmac: selftests: Add selftest for L3/L4 Filters Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:16 ` [PATCH v2 net-next 06/13] net: stmmac: xgmac: Implement ARP Offload Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:16 ` [PATCH v2 net-next 07/13] net: stmmac: selftests: Implement the ARP Offload test Jose Abreu 2019-09-04 13:16 ` Jose Abreu 2019-09-04 13:17 ` [PATCH v2 net-next 08/13] net: stmmac: Only consider RX error when HW Timestamping is not enabled Jose Abreu 2019-09-04 13:17 ` Jose Abreu 2019-09-04 13:17 ` Jose Abreu [this message] 2019-09-04 13:17 ` [PATCH v2 net-next 09/13] net: stmmac: ethtool: Let user configure TX coalesce without RIWT Jose Abreu 2019-09-04 13:17 ` [PATCH v2 net-next 10/13] net: stmmac: xgmac: Correct RAVSEL field interpretation Jose Abreu 2019-09-04 13:17 ` Jose Abreu 2019-09-04 13:17 ` [PATCH v2 net-next 11/13] net: stmmac: Correctly assing MAX MTU in XGMAC cores case Jose Abreu 2019-09-04 13:17 ` Jose Abreu 2019-09-04 13:17 ` [PATCH v2 net-next 12/13] net: stmmac: xgmac: Enable RX Jumbo frame support Jose Abreu 2019-09-04 13:17 ` Jose Abreu 2019-09-04 13:17 ` [PATCH v2 net-next 13/13] net: stmmac: selftests: Add Jumbo Frame tests Jose Abreu 2019-09-04 13:17 ` Jose Abreu 2019-09-05 10:20 ` [PATCH v2 net-next 00/13] net: stmmac: Improvements for -next David Miller 2019-09-05 10:20 ` David Miller
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=7f11754637d5c757ca43b5a832f6707d692e1099.1567602868.git.joabreu@synopsys.com \ --to=jose.abreu@synopsys.com \ --cc=Joao.Pinto@synopsys.com \ --cc=alexandre.torgue@st.com \ --cc=davem@davemloft.net \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-stm32@st-md-mailman.stormreply.com \ --cc=mcoquelin.stm32@gmail.com \ --cc=netdev@vger.kernel.org \ --cc=peppe.cavallaro@st.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.