V_01-00-33

1. Null check added while freeing skb buff data
2. Code comments corrected for flow control configuration
This commit is contained in:
TC956X 2022-01-06 21:25:27 +09:00 committed by jianzhou
parent 1ef7c2a727
commit e6417b1a08
4 changed files with 45 additions and 25 deletions

View File

@ -1,7 +1,7 @@
# Toshiba Electronic Devices & Storage Corporation TC956X PCIe Ethernet Host Driver
Release Date: 27 Dec 2021
Release Date: 06 Jan 2022
Release Version: V_01-00-32 : Limited-tested version
Release Version: V_01-00-33 : Limited-tested version
TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19".
@ -418,3 +418,8 @@ TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19".
1. Support for eMAC Reset and unused clock disable during Suspend and restoring it back during resume.
2. Resetting and disabling of unused clocks for eMAC Port, when no-found PHY for that particular port.
3. Valid phy-address and mii-pointer NULL check in tc956xmac_suspend().
## TC956X_Host_Driver_20220106_V_01-00-33:
1. Null check added while freeing skb buff data
2. Code comments corrected for flow control configuration

View File

@ -116,6 +116,9 @@
* 27 Dec 2021 : 1. Support for eMAC Reset and unused clock disable during Suspend and restoring it back during resume.
2. Version update.
* VERSION : 01-00-32
* 06 Jan 2022 : 1. Code comments corrected for flow control configuration
2. Version update.
* VERSION : 01-00-33
*/
#include <linux/clk-provider.h>
@ -174,7 +177,7 @@ static unsigned int mac1_txq1_size = TX_QUEUE1_SIZE;
unsigned int mac0_en_lp_pause_frame_cnt = DISABLE;
unsigned int mac1_en_lp_pause_frame_cnt = DISABLE;
static const struct tc956x_version tc956x_drv_version = {0, 1, 0, 0, 3, 2};
static const struct tc956x_version tc956x_drv_version = {0, 1, 0, 0, 3, 3};
static int tc956xmac_pm_usage_counter; /* Device Usage Counter */
struct mutex tc956x_pm_suspend_lock; /* This mutex is shared between all available EMAC ports. */
@ -1281,7 +1284,7 @@ static int tc956xmac_xgmac3_default_data(struct pci_dev *pdev,
plat->rx_queues_cfg[0].rfd = queue0_rfd;
plat->rx_queues_cfg[0].rfa = queue0_rfa;
} else {
temp_var = ((plat->rx_queues_cfg[0].size - (((plat->rx_queues_cfg[0].size)*8)/10))/SIZE_512B); /* configuration to 80% of FIFO Size */
temp_var = ((plat->rx_queues_cfg[0].size - (((plat->rx_queues_cfg[0].size)*8)/10))/SIZE_512B); /* configuration to 20% of FIFO Size */
if(temp_var >= 2) {
temp_var = (temp_var - 2);
} else {
@ -1289,7 +1292,7 @@ static int tc956xmac_xgmac3_default_data(struct pci_dev *pdev,
}
plat->rx_queues_cfg[0].rfd = temp_var;
plat->rx_queues_cfg[0].rfa = temp_var;
NMSGPR_INFO(&(pdev->dev), "%s: ERROR Invalid Flow control threshold for Rx Queue-0 passed rxq0_rfd=%d, rxq0_rfa=%d,configuring to 80%% of Queue size, rxq0_rfd=%d, rxq0_rfa=%d of port=%d\n",
NMSGPR_INFO(&(pdev->dev), "%s: ERROR Invalid Flow control threshold for Rx Queue-0 passed rxq0_rfd=%d, rxq0_rfa=%d,configuring to 20%% of Queue size, rxq0_rfd=%d, rxq0_rfa=%d of port=%d\n",
__func__, queue0_rfd, queue0_rfa, plat->rx_queues_cfg[0].rfd, plat->rx_queues_cfg[0].rfa, plat->port_num);
}
@ -1298,7 +1301,7 @@ static int tc956xmac_xgmac3_default_data(struct pci_dev *pdev,
plat->rx_queues_cfg[1].rfd = queue1_rfd;
plat->rx_queues_cfg[1].rfa = queue1_rfa;
} else {
temp_var = ((plat->rx_queues_cfg[1].size - (((plat->rx_queues_cfg[1].size)*8)/10))/SIZE_512B); /* configuration to 80% of FIFO Size */
temp_var = ((plat->rx_queues_cfg[1].size - (((plat->rx_queues_cfg[1].size)*8)/10))/SIZE_512B); /* configuration to 20% of FIFO Size */
if(temp_var >= 2){
temp_var = (temp_var - 2);
} else {
@ -1306,7 +1309,7 @@ static int tc956xmac_xgmac3_default_data(struct pci_dev *pdev,
}
plat->rx_queues_cfg[1].rfd = temp_var;
plat->rx_queues_cfg[1].rfa = temp_var;
NMSGPR_INFO(&(pdev->dev), "%s: ERROR Invalid Flow control threshold for Rx Queue-1 passed rxq1_rfd=%d, rxq1_rfa=%d,configuring to 80%% of Queue size, rxq1_rfd=%d, rxq1_rfa=%d of port=%d\n",
NMSGPR_INFO(&(pdev->dev), "%s: ERROR Invalid Flow control threshold for Rx Queue-1 passed rxq1_rfd=%d, rxq1_rfa=%d,configuring to 20%% of Queue size, rxq1_rfd=%d, rxq1_rfa=%d of port=%d\n",
__func__, queue1_rfd, queue1_rfa, plat->rx_queues_cfg[1].rfd, plat->rx_queues_cfg[1].rfa, plat->port_num);
}

View File

@ -109,6 +109,8 @@
* 27 Dec 2021 : 1. Support for eMAC Reset and unused clock disable during Suspend and restoring it back during resume.
2. Version update.
* VERSION : 01-00-32
* 06 Jan 2022 : 1. Version update
* VERSION : 01-00-33
*/
#ifndef __TC956XMAC_H__
@ -161,7 +163,7 @@
#ifdef TC956X
#define TC956X_RESOURCE_NAME "tc956x_pci-eth"
#define DRV_MODULE_VERSION "V_01-00-32"
#define DRV_MODULE_VERSION "V_01-00-33"
#define TC956X_FW_MAX_SIZE (64*1024)
#define ATR_AXI4_SLV_BASE 0x0800

View File

@ -90,7 +90,9 @@
3. Valid phy-address and mii-pointer NULL check in tc956xmac_suspend().
4. Version update.
* VERSION : 01-00-32
*/
* 06 Jan 2022 : 1. Null check added while freeing skb buff data
* VERSION : 01-00-33
*/
#include <linux/clk.h>
#include <linux/kernel.h>
@ -2492,24 +2494,28 @@ static void tc956xmac_free_tx_buffer(struct tc956xmac_priv *priv, u32 queue, int
{
struct tc956xmac_tx_queue *tx_q = &priv->tx_queue[queue];
if (tx_q->tx_skbuff_dma[i].buf) {
if (tx_q->tx_skbuff_dma[i].map_as_page)
dma_unmap_page(priv->device,
tx_q->tx_skbuff_dma[i].buf,
tx_q->tx_skbuff_dma[i].len,
DMA_TO_DEVICE);
else
dma_unmap_single(priv->device,
tx_q->tx_skbuff_dma[i].buf,
tx_q->tx_skbuff_dma[i].len,
DMA_TO_DEVICE);
if (tx_q->tx_skbuff_dma) {
if (tx_q->tx_skbuff_dma[i].buf) {
if (tx_q->tx_skbuff_dma[i].map_as_page)
dma_unmap_page(priv->device,
tx_q->tx_skbuff_dma[i].buf,
tx_q->tx_skbuff_dma[i].len,
DMA_TO_DEVICE);
else
dma_unmap_single(priv->device,
tx_q->tx_skbuff_dma[i].buf,
tx_q->tx_skbuff_dma[i].len,
DMA_TO_DEVICE);
}
}
if (tx_q->tx_skbuff[i]) {
dev_kfree_skb_any(tx_q->tx_skbuff[i]);
tx_q->tx_skbuff[i] = NULL;
tx_q->tx_skbuff_dma[i].buf = 0;
tx_q->tx_skbuff_dma[i].map_as_page = false;
if (tx_q->tx_skbuff) {
if (tx_q->tx_skbuff[i]) {
dev_kfree_skb_any(tx_q->tx_skbuff[i]);
tx_q->tx_skbuff[i] = NULL;
tx_q->tx_skbuff_dma[i].buf = 0;
tx_q->tx_skbuff_dma[i].map_as_page = false;
}
}
}
@ -2784,7 +2790,11 @@ static void free_dma_tx_desc_resources(struct tc956xmac_priv *priv)
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
kfree(tx_q->tx_skbuff_dma);
tx_q->tx_skbuff_dma = NULL;
kfree(tx_q->tx_skbuff);
tx_q->tx_skbuff = NULL;
}
}