V_01-00-48

1. Dynamic MTU change supported. Max MTU supported is 2000 bytes.
This commit is contained in:
TC956X 2022-04-05 18:56:09 +09:00 committed by jianzhou
parent d052efb32a
commit 93dc855f8d
5 changed files with 35 additions and 14 deletions

View File

@ -1,7 +1,7 @@
# Toshiba Electronic Devices & Storage Corporation TC956X PCIe Ethernet Host Driver
Release Date: 05 Apr 2022
Release Date: 06 Apr 2022
Release Version: V_01-00-47 : Limited-tested version
Release Version: V_01-00-48 : Limited-tested version
TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19".
@ -482,3 +482,6 @@ TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19".
## TC956X_Host_Driver_20220405_V_01-00-47:
1. Disable MSI and flush phy work queue during driver release.
## TC956X_Host_Driver_20220406_V_01-00-48:
1. Dynamic MTU change supported. Max MTU supported is 2000 bytes.

View File

@ -79,7 +79,9 @@
* VERSION : 01-00-41
* 14 Feb 2021 : 1. Reset assert and clock disable support during Link Down.
* VERSION : 01-00-42
*/
* 06 Apr 2022 : 1.Max MTU supported is 2000 bytes.
* VERSION : 01-00-48
*/
#ifndef __COMMON_H__
#define __COMMON_H__
@ -1191,7 +1193,8 @@ entry delay = n * 256 ns */
#define TC956X_HOST_PHYSICAL_ADRS_MASK (0x10) /* bit no 37: (1<<36) */
#define ETHNORMAL_LEN 1500
#define MAX_SUPPORTED_MTU (ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN)
/*Max supported MTU limited to 2000, not 'ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN' */
#define MAX_SUPPORTED_MTU 2000 /*(ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN)*/
#define MIN_SUPPORTED_MTU (ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN)
#define HOST_MAC_ADDR_OFFSET 2

View File

@ -153,7 +153,10 @@
* VERSION : 01-00-46
* 05 Apr 2022 : 1. Version update
* VERSION : 01-00-47
*/
* 06 Apr 2022 : 1. Version update
* 2. Max MTU supported is 2000 bytes.
* VERSION : 01-00-48
*/
#include <linux/clk-provider.h>
#include <linux/pci.h>
@ -217,7 +220,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, 4, 7};
static const struct tc956x_version tc956x_drv_version = {0, 1, 0, 0, 4, 8};
static int tc956xmac_pm_usage_counter; /* Device Usage Counter */
struct mutex tc956x_pm_suspend_lock; /* This mutex is shared between all available EMAC ports. */
@ -1063,7 +1066,7 @@ static int tc956xmac_xgmac3_default_data(struct pci_dev *pdev,
#endif
plat->maxmtu = XGMAC_JUMBO_LEN;
plat->maxmtu = MAX_SUPPORTED_MTU/*XGMAC_JUMBO_LEN*/;
/* Set default number of RX and TX queues to use */
#ifdef TC956X

View File

@ -143,6 +143,8 @@
* VERSION : 01-00-46
* 05 Apr 2022 : 1. Version update
* VERSION : 01-00-47
* 06 Apr 2022 : 1. Version update
* VERSION : 01-00-48
*/
#ifndef __TC956XMAC_H__
@ -198,7 +200,7 @@
#define IRQ_DEV_NAME(x) (((x) == RM_PF0_ID) ? ("eth0") : ("eth1"))
#define WOL_IRQ_DEV_NAME(x) (((x) == RM_PF0_ID) ? ("eth0_wol") : ("eth1_wol"))
#define DRV_MODULE_VERSION "V_01-00-47"
#define DRV_MODULE_VERSION "V_01-00-48"
#define TC956X_FW_MAX_SIZE (64*1024)
#define ATR_AXI4_SLV_BASE 0x0800

View File

@ -117,6 +117,9 @@
* VERSION : 01-00-45
* 05 Apr 2022 : 1. Disable MSI and flush phy work queue during driver release.
* VERSION : 01-00-47
* 06 Apr 2022 : 1. Dynamic MTU change supported. Max MTU supported is 2000 bytes.
* 2. Constant buffer size of 2K used, so that during MTU change there is no buffer reconfiguration.
* VERSION : 01-00-48
*/
#include <linux/clk.h>
@ -4994,6 +4997,11 @@ static int tc956xmac_open(struct net_device *dev)
if (bfsize < BUF_SIZE_16KiB)
bfsize = tc956xmac_set_bfsize(dev->mtu, priv->dma_buf_sz);
/* Overwrite buff size allocated to 2K, to accomodate max mtu supported of 2000 bytes,
* so that no buffer reconfiguration required during MTU change
*/
bfsize = BUF_SIZE_2KiB;
priv->dma_buf_sz = bfsize;
buf_sz = bfsize;
@ -6507,18 +6515,20 @@ static int tc956xmac_change_mtu(struct net_device *dev, int new_mtu)
txfifosz /= priv->plat->tx_queues_to_use;
if (netif_running(dev)) {
/* Dynamic MTU change is supported, so below condition is commented */
/*if (netif_running(dev)) {
netdev_err(priv->dev, "must be stopped to change its MTU\n");
return -EBUSY;
}
}*/
new_mtu = TC956XMAC_ALIGN(new_mtu);
/* Alignment of MTU reported to upper layers is not required */
/*new_mtu = TC956XMAC_ALIGN(new_mtu);*/
#ifdef TC956X
/* Supported frame sizes */
if ((new_mtu < MIN_SUPPORTED_MTU) || (new_mtu > JUMBO_LEN)) {
if ((new_mtu < MIN_SUPPORTED_MTU) || (new_mtu > MAX_SUPPORTED_MTU)) {
NMSGPR_ALERT(priv->device,
"%s: invalid MTU, min %d and max %d MTU are supported\n",
dev->name, MIN_SUPPORTED_MTU, JUMBO_LEN);
dev->name, MIN_SUPPORTED_MTU, MAX_SUPPORTED_MTU);
return -EINVAL;
}
@ -11360,7 +11370,7 @@ int tc956xmac_dvr_probe(struct device *device,
/* MTU range: 46 - hw-specific max */
ndev->min_mtu = ETH_ZLEN - ETH_HLEN;
if (priv->plat->has_xgmac)
ndev->max_mtu = XGMAC_JUMBO_LEN;
ndev->max_mtu = MAX_SUPPORTED_MTU/*XGMAC_JUMBO_LEN*/;
else if ((priv->plat->enh_desc) || (priv->synopsys_id >= DWMAC_CORE_4_00))
ndev->max_mtu = JUMBO_LEN;
else