aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0007-amd-xgbe-Prepare-for-ethtool-set-channel-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0007-amd-xgbe-Prepare-for-ethtool-set-channel-support.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0007-amd-xgbe-Prepare-for-ethtool-set-channel-support.patch241
1 files changed, 0 insertions, 241 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0007-amd-xgbe-Prepare-for-ethtool-set-channel-support.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0007-amd-xgbe-Prepare-for-ethtool-set-channel-support.patch
deleted file mode 100644
index 6a46eb47..00000000
--- a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0007-amd-xgbe-Prepare-for-ethtool-set-channel-support.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-From 020af1166b9d83857753bd92b3e6c9162c46ff86 Mon Sep 17 00:00:00 2001
-From: Tom Lendacky <thomas.lendacky@amd.com>
-Date: Wed, 23 May 2018 11:39:04 -0500
-Subject: [PATCH 07/95] amd-xgbe: Prepare for ethtool set-channel support
-
-In order to support being able to dynamically set/change the number of
-Rx and Tx channels, update the code to:
- - Move alloc and free of device memory into callable functions
- - Move setting of the real number of Rx and Tx channels to device startup
- - Move mapping of the RSS channels to device startup
-
-Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
----
- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 108 ++++++++++++++++++------------
- drivers/net/ethernet/amd/xgbe/xgbe-main.c | 20 +-----
- 2 files changed, 68 insertions(+), 60 deletions(-)
-
-diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
-index 0360633..3c9681a 100644
---- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
-+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
-@@ -1314,14 +1314,72 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
- return 0;
- }
-
-+static void xgbe_free_memory(struct xgbe_prv_data *pdata)
-+{
-+ struct xgbe_desc_if *desc_if = &pdata->desc_if;
-+
-+ /* Free the ring descriptors and buffers */
-+ desc_if->free_ring_resources(pdata);
-+
-+ /* Free the channel and ring structures */
-+ xgbe_free_channels(pdata);
-+}
-+
-+static int xgbe_alloc_memory(struct xgbe_prv_data *pdata)
-+{
-+ struct xgbe_desc_if *desc_if = &pdata->desc_if;
-+ struct net_device *netdev = pdata->netdev;
-+ int ret;
-+
-+ /* Calculate the Rx buffer size before allocating rings */
-+ pdata->rx_buf_size = xgbe_calc_rx_buf_size(netdev, netdev->mtu);
-+
-+ /* Allocate the channel and ring structures */
-+ ret = xgbe_alloc_channels(pdata);
-+ if (ret)
-+ return ret;
-+
-+ /* Allocate the ring descriptors and buffers */
-+ ret = desc_if->alloc_ring_resources(pdata);
-+ if (ret)
-+ goto err_channels;
-+
-+ /* Initialize the service and Tx timers */
-+ xgbe_init_timers(pdata);
-+
-+ return 0;
-+
-+err_channels:
-+ xgbe_free_memory(pdata);
-+
-+ return ret;
-+}
-+
- static int xgbe_start(struct xgbe_prv_data *pdata)
- {
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
- struct xgbe_phy_if *phy_if = &pdata->phy_if;
- struct net_device *netdev = pdata->netdev;
-+ unsigned int i;
- int ret;
-
-- DBGPR("-->xgbe_start\n");
-+ /* Set the number of queues */
-+ ret = netif_set_real_num_tx_queues(netdev, pdata->tx_ring_count);
-+ if (ret) {
-+ netdev_err(netdev, "error setting real tx queue count\n");
-+ return ret;
-+ }
-+
-+ ret = netif_set_real_num_rx_queues(netdev, pdata->rx_ring_count);
-+ if (ret) {
-+ netdev_err(netdev, "error setting real rx queue count\n");
-+ return ret;
-+ }
-+
-+ /* Set RSS lookup table data for programming */
-+ for (i = 0; i < XGBE_RSS_MAX_TABLE_SIZE; i++)
-+ XGMAC_SET_BITS(pdata->rss_table[i], MAC_RSSDR, DMCH,
-+ i % pdata->rx_ring_count);
-
- ret = hw_if->init(pdata);
- if (ret)
-@@ -1349,8 +1407,6 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
-
- clear_bit(XGBE_STOPPED, &pdata->dev_state);
-
-- DBGPR("<--xgbe_start\n");
--
- return 0;
-
- err_irqs:
-@@ -1825,11 +1881,8 @@ static void xgbe_packet_info(struct xgbe_prv_data *pdata,
- static int xgbe_open(struct net_device *netdev)
- {
- struct xgbe_prv_data *pdata = netdev_priv(netdev);
-- struct xgbe_desc_if *desc_if = &pdata->desc_if;
- int ret;
-
-- DBGPR("-->xgbe_open\n");
--
- /* Create the various names based on netdev name */
- snprintf(pdata->an_name, sizeof(pdata->an_name) - 1, "%s-pcs",
- netdev_name(netdev));
-@@ -1874,43 +1927,25 @@ static int xgbe_open(struct net_device *netdev)
- goto err_sysclk;
- }
-
-- /* Calculate the Rx buffer size before allocating rings */
-- ret = xgbe_calc_rx_buf_size(netdev, netdev->mtu);
-- if (ret < 0)
-- goto err_ptpclk;
-- pdata->rx_buf_size = ret;
--
-- /* Allocate the channel and ring structures */
-- ret = xgbe_alloc_channels(pdata);
-- if (ret)
-- goto err_ptpclk;
--
-- /* Allocate the ring descriptors and buffers */
-- ret = desc_if->alloc_ring_resources(pdata);
-- if (ret)
-- goto err_channels;
--
- INIT_WORK(&pdata->service_work, xgbe_service);
- INIT_WORK(&pdata->restart_work, xgbe_restart);
- INIT_WORK(&pdata->stopdev_work, xgbe_stopdev);
- INIT_WORK(&pdata->tx_tstamp_work, xgbe_tx_tstamp);
-- xgbe_init_timers(pdata);
-+
-+ ret = xgbe_alloc_memory(pdata);
-+ if (ret)
-+ goto err_ptpclk;
-
- ret = xgbe_start(pdata);
- if (ret)
-- goto err_rings;
-+ goto err_mem;
-
- clear_bit(XGBE_DOWN, &pdata->dev_state);
-
-- DBGPR("<--xgbe_open\n");
--
- return 0;
-
--err_rings:
-- desc_if->free_ring_resources(pdata);
--
--err_channels:
-- xgbe_free_channels(pdata);
-+err_mem:
-+ xgbe_free_memory(pdata);
-
- err_ptpclk:
- clk_disable_unprepare(pdata->ptpclk);
-@@ -1930,18 +1965,11 @@ static int xgbe_open(struct net_device *netdev)
- static int xgbe_close(struct net_device *netdev)
- {
- struct xgbe_prv_data *pdata = netdev_priv(netdev);
-- struct xgbe_desc_if *desc_if = &pdata->desc_if;
--
-- DBGPR("-->xgbe_close\n");
-
- /* Stop the device */
- xgbe_stop(pdata);
-
-- /* Free the ring descriptors and buffers */
-- desc_if->free_ring_resources(pdata);
--
-- /* Free the channel and ring structures */
-- xgbe_free_channels(pdata);
-+ xgbe_free_memory(pdata);
-
- /* Disable the clocks */
- clk_disable_unprepare(pdata->ptpclk);
-@@ -1955,8 +1983,6 @@ static int xgbe_close(struct net_device *netdev)
-
- set_bit(XGBE_DOWN, &pdata->dev_state);
-
-- DBGPR("<--xgbe_close\n");
--
- return 0;
- }
-
-diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
-index e31d9d1..d1eb855 100644
---- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
-+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
-@@ -265,7 +265,6 @@ int xgbe_config_netdev(struct xgbe_prv_data *pdata)
- {
- struct net_device *netdev = pdata->netdev;
- struct device *dev = pdata->dev;
-- unsigned int i;
- int ret;
-
- netdev->irq = pdata->dev_irq;
-@@ -324,26 +323,9 @@ int xgbe_config_netdev(struct xgbe_prv_data *pdata)
- pdata->tx_ring_count, pdata->rx_ring_count);
- }
-
-- /* Set the number of queues */
-- ret = netif_set_real_num_tx_queues(netdev, pdata->tx_ring_count);
-- if (ret) {
-- dev_err(dev, "error setting real tx queue count\n");
-- return ret;
-- }
--
-- ret = netif_set_real_num_rx_queues(netdev, pdata->rx_ring_count);
-- if (ret) {
-- dev_err(dev, "error setting real rx queue count\n");
-- return ret;
-- }
--
-- /* Initialize RSS hash key and lookup table */
-+ /* Initialize RSS hash key */
- netdev_rss_key_fill(pdata->rss_key, sizeof(pdata->rss_key));
-
-- for (i = 0; i < XGBE_RSS_MAX_TABLE_SIZE; i++)
-- XGMAC_SET_BITS(pdata->rss_table[i], MAC_RSSDR, DMCH,
-- i % pdata->rx_ring_count);
--
- XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, IP2TE, 1);
- XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, TCP4TE, 1);
- XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, UDP4TE, 1);
---
-2.7.4
-