lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-id: <008a01cf69cc$4cd758e0$e6860aa0$%an@samsung.com>
Date:	Wed, 07 May 2014 17:13:59 +0900
From:	Byungho An <bh74.an@...sung.com>
To:	netdev@...r.kernel.org, linux-samsung-soc@...r.kernel.org
Cc:	davem@...emloft.net, ks.giri@...sung.com, vipul.pandya@...sung.com
Subject: [PATCH] net: sxgbe: fixed mtl and dma channel feature


This patch fixes mtl queue and dma channel value
and adds mtl qsize for FIFO setting.

Signed-off-by: Byungho An <bh74.an@...sung.com>
---
 drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
index 7dc3449..bf4447a 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
@@ -889,14 +889,19 @@ static int sxgbe_get_hw_features(struct sxgbe_priv_data * const priv)
 	/* Read First Capability Register CAP[2] */
 	rval = priv->hw->mac->get_hw_feature(priv->ioaddr, 2);
 	if (rval) {
-		features->rx_mtl_queues = SXGBE_HW_FEAT_RX_MTL_QUEUES(rval);
-		features->tx_mtl_queues = SXGBE_HW_FEAT_TX_MTL_QUEUES(rval);
-		features->rx_dma_channels = SXGBE_HW_FEAT_RX_DMA_CHANNELS(rval);
-		features->tx_dma_channels = SXGBE_HW_FEAT_TX_DMA_CHANNELS(rval);
+		features->rx_mtl_queues = SXGBE_HW_FEAT_RX_MTL_QUEUES(rval) + 1;
+		features->tx_mtl_queues = SXGBE_HW_FEAT_TX_MTL_QUEUES(rval) + 1;
+		features->rx_dma_channels = SXGBE_HW_FEAT_RX_DMA_CHANNELS(rval) + 1;
+		features->tx_dma_channels = SXGBE_HW_FEAT_TX_DMA_CHANNELS(rval) + 1;
 		features->pps_output_count = SXGBE_HW_FEAT_PPS_OUTPUTS(rval);
 		features->aux_input_count = SXGBE_HW_FEAT_AUX_SNAPSHOTS(rval);
 	}
 
+	features->rx_mtl_qsize = (1 << (features->rxfifo_size + 7)) /
+				  features->rx_mtl_queues;
+	features->tx_mtl_qsize = (1 << (features->txfifo_size + 7)) /
+				  features->tx_mtl_queues;
+
 	return rval;
 }
 
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ