Commit e9e6d79c authored by David S. Miller's avatar David S. Miller

Merge branch 'cxgb4-trivial-fixes'

Hariprasad Shenai says:

====================
Trivial fixes for cxgb4 driver

This patch series updates driver description for next gen. adapters, updates
firmware info., returns error for setup_rss error case, restores L1
configuration in case of FW rejects new config, updates and aligns ethtool
get stats settings, etc

 This patch series has been created against net-next tree and includes
patches on cxgb4 and cxgb4vf driver.

We have included all the maintainers of respective drivers. Kindly review
the change and let us know in case of any review comments.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents aec15924 b08f2b35
...@@ -35,79 +35,79 @@ static void set_msglevel(struct net_device *dev, u32 val) ...@@ -35,79 +35,79 @@ static void set_msglevel(struct net_device *dev, u32 val)
} }
static const char stats_strings[][ETH_GSTRING_LEN] = { static const char stats_strings[][ETH_GSTRING_LEN] = {
"TxOctetsOK ", "tx_octets_ok ",
"TxFramesOK ", "tx_frames_ok ",
"TxBroadcastFrames ", "tx_broadcast_frames ",
"TxMulticastFrames ", "tx_multicast_frames ",
"TxUnicastFrames ", "tx_unicast_frames ",
"TxErrorFrames ", "tx_error_frames ",
"TxFrames64 ", "tx_frames_64 ",
"TxFrames65To127 ", "tx_frames_65_to_127 ",
"TxFrames128To255 ", "tx_frames_128_to_255 ",
"TxFrames256To511 ", "tx_frames_256_to_511 ",
"TxFrames512To1023 ", "tx_frames_512_to_1023 ",
"TxFrames1024To1518 ", "tx_frames_1024_to_1518 ",
"TxFrames1519ToMax ", "tx_frames_1519_to_max ",
"TxFramesDropped ", "tx_frames_dropped ",
"TxPauseFrames ", "tx_pause_frames ",
"TxPPP0Frames ", "tx_ppp0_frames ",
"TxPPP1Frames ", "tx_ppp1_frames ",
"TxPPP2Frames ", "tx_ppp2_frames ",
"TxPPP3Frames ", "tx_ppp3_frames ",
"TxPPP4Frames ", "tx_ppp4_frames ",
"TxPPP5Frames ", "tx_ppp5_frames ",
"TxPPP6Frames ", "tx_ppp6_frames ",
"TxPPP7Frames ", "tx_ppp7_frames ",
"RxOctetsOK ", "rx_octets_ok ",
"RxFramesOK ", "rx_frames_ok ",
"RxBroadcastFrames ", "rx_broadcast_frames ",
"RxMulticastFrames ", "rx_multicast_frames ",
"RxUnicastFrames ", "rx_unicast_frames ",
"RxFramesTooLong ", "rx_frames_too_long ",
"RxJabberErrors ", "rx_jabber_errors ",
"RxFCSErrors ", "rx_fcs_errors ",
"RxLengthErrors ", "rx_length_errors ",
"RxSymbolErrors ", "rx_symbol_errors ",
"RxRuntFrames ", "rx_runt_frames ",
"RxFrames64 ", "rx_frames_64 ",
"RxFrames65To127 ", "rx_frames_65_to_127 ",
"RxFrames128To255 ", "rx_frames_128_to_255 ",
"RxFrames256To511 ", "rx_frames_256_to_511 ",
"RxFrames512To1023 ", "rx_frames_512_to_1023 ",
"RxFrames1024To1518 ", "rx_frames_1024_to_1518 ",
"RxFrames1519ToMax ", "rx_frames_1519_to_max ",
"RxPauseFrames ", "rx_pause_frames ",
"RxPPP0Frames ", "rx_ppp0_frames ",
"RxPPP1Frames ", "rx_ppp1_frames ",
"RxPPP2Frames ", "rx_ppp2_frames ",
"RxPPP3Frames ", "rx_ppp3_frames ",
"RxPPP4Frames ", "rx_ppp4_frames ",
"RxPPP5Frames ", "rx_ppp5_frames ",
"RxPPP6Frames ", "rx_ppp6_frames ",
"RxPPP7Frames ", "rx_ppp7_frames ",
"RxBG0FramesDropped ", "rx_bg0_frames_dropped ",
"RxBG1FramesDropped ", "rx_bg1_frames_dropped ",
"RxBG2FramesDropped ", "rx_bg2_frames_dropped ",
"RxBG3FramesDropped ", "rx_bg3_frames_dropped ",
"RxBG0FramesTrunc ", "rx_bg0_frames_trunc ",
"RxBG1FramesTrunc ", "rx_bg1_frames_trunc ",
"RxBG2FramesTrunc ", "rx_bg2_frames_trunc ",
"RxBG3FramesTrunc ", "rx_bg3_frames_trunc ",
"TSO ", "tso ",
"TxCsumOffload ", "tx_csum_offload ",
"RxCsumGood ", "rx_csum_good ",
"VLANextractions ", "vlan_extractions ",
"VLANinsertions ", "vlan_insertions ",
"GROpackets ", "gro_packets ",
"GROmerged ", "gro_merged ",
}; };
static char adapter_stats_strings[][ETH_GSTRING_LEN] = { static char adapter_stats_strings[][ETH_GSTRING_LEN] = {
...@@ -211,8 +211,11 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) ...@@ -211,8 +211,11 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
sizeof(info->version)); sizeof(info->version));
strlcpy(info->bus_info, pci_name(adapter->pdev), strlcpy(info->bus_info, pci_name(adapter->pdev),
sizeof(info->bus_info)); sizeof(info->bus_info));
info->regdump_len = get_regs_len(dev);
if (adapter->params.fw_vers) if (!adapter->params.fw_vers)
strcpy(info->fw_version, "N/A");
else
snprintf(info->fw_version, sizeof(info->fw_version), snprintf(info->fw_version, sizeof(info->fw_version),
"%u.%u.%u.%u, TP %u.%u.%u.%u", "%u.%u.%u.%u, TP %u.%u.%u.%u",
FW_HDR_FW_VER_MAJOR_G(adapter->params.fw_vers), FW_HDR_FW_VER_MAJOR_G(adapter->params.fw_vers),
...@@ -612,6 +615,8 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -612,6 +615,8 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
struct port_info *p = netdev_priv(dev); struct port_info *p = netdev_priv(dev);
struct link_config *lc = &p->link_cfg; struct link_config *lc = &p->link_cfg;
u32 speed = ethtool_cmd_speed(cmd); u32 speed = ethtool_cmd_speed(cmd);
struct link_config old_lc;
int ret;
if (cmd->duplex != DUPLEX_FULL) /* only full-duplex supported */ if (cmd->duplex != DUPLEX_FULL) /* only full-duplex supported */
return -EINVAL; return -EINVAL;
...@@ -626,13 +631,11 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -626,13 +631,11 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
return -EINVAL; return -EINVAL;
} }
old_lc = *lc;
if (cmd->autoneg == AUTONEG_DISABLE) { if (cmd->autoneg == AUTONEG_DISABLE) {
cap = speed_to_caps(speed); cap = speed_to_caps(speed);
if (!(lc->supported & cap) || if (!(lc->supported & cap))
(speed == 1000) ||
(speed == 10000) ||
(speed == 40000))
return -EINVAL; return -EINVAL;
lc->requested_speed = cap; lc->requested_speed = cap;
lc->advertising = 0; lc->advertising = 0;
...@@ -645,10 +648,14 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -645,10 +648,14 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
} }
lc->autoneg = cmd->autoneg; lc->autoneg = cmd->autoneg;
if (netif_running(dev)) /* If the firmware rejects the Link Configuration request, back out
return t4_link_l1cfg(p->adapter, p->adapter->pf, p->tx_chan, * the changes and report the error.
lc); */
return 0; ret = t4_link_l1cfg(p->adapter, p->adapter->mbox, p->tx_chan, lc);
if (ret)
*lc = old_lc;
return ret;
} }
static void get_pauseparam(struct net_device *dev, static void get_pauseparam(struct net_device *dev,
...@@ -847,7 +854,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e, ...@@ -847,7 +854,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
{ {
int i, err = 0; int i, err = 0;
struct adapter *adapter = netdev2adap(dev); struct adapter *adapter = netdev2adap(dev);
u8 *buf = kmalloc(EEPROMSIZE, GFP_KERNEL); u8 *buf = t4_alloc_mem(EEPROMSIZE);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
...@@ -858,7 +865,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e, ...@@ -858,7 +865,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
if (!err) if (!err)
memcpy(data, buf + e->offset, e->len); memcpy(data, buf + e->offset, e->len);
kfree(buf); t4_free_mem(buf);
return err; return err;
} }
...@@ -887,7 +894,7 @@ static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -887,7 +894,7 @@ static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
if (aligned_offset != eeprom->offset || aligned_len != eeprom->len) { if (aligned_offset != eeprom->offset || aligned_len != eeprom->len) {
/* RMW possibly needed for first or last words. /* RMW possibly needed for first or last words.
*/ */
buf = kmalloc(aligned_len, GFP_KERNEL); buf = t4_alloc_mem(aligned_len);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
err = eeprom_rd_phys(adapter, aligned_offset, (u32 *)buf); err = eeprom_rd_phys(adapter, aligned_offset, (u32 *)buf);
...@@ -915,7 +922,7 @@ static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -915,7 +922,7 @@ static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
err = t4_seeprom_wp(adapter, true); err = t4_seeprom_wp(adapter, true);
out: out:
if (buf != data) if (buf != data)
kfree(buf); t4_free_mem(buf);
return err; return err;
} }
...@@ -1011,11 +1018,15 @@ static int set_rss_table(struct net_device *dev, const u32 *p, const u8 *key, ...@@ -1011,11 +1018,15 @@ static int set_rss_table(struct net_device *dev, const u32 *p, const u8 *key,
if (!p) if (!p)
return 0; return 0;
/* Interface must be brought up atleast once */
if (pi->adapter->flags & FULL_INIT_DONE) {
for (i = 0; i < pi->rss_size; i++) for (i = 0; i < pi->rss_size; i++)
pi->rss[i] = p[i]; pi->rss[i] = p[i];
if (pi->adapter->flags & FULL_INIT_DONE)
return cxgb4_write_rss(pi, pi->rss); return cxgb4_write_rss(pi, pi->rss);
return 0; }
return -EPERM;
} }
static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
......
...@@ -83,7 +83,7 @@ char cxgb4_driver_name[] = KBUILD_MODNAME; ...@@ -83,7 +83,7 @@ char cxgb4_driver_name[] = KBUILD_MODNAME;
#endif #endif
#define DRV_VERSION "2.0.0-ko" #define DRV_VERSION "2.0.0-ko"
const char cxgb4_driver_version[] = DRV_VERSION; const char cxgb4_driver_version[] = DRV_VERSION;
#define DRV_DESC "Chelsio T4/T5 Network Driver" #define DRV_DESC "Chelsio T4/T5/T6 Network Driver"
/* Host shadow copy of ingress filter entry. This is in host native format /* Host shadow copy of ingress filter entry. This is in host native format
* and doesn't match the ordering or bit order, etc. of the hardware of the * and doesn't match the ordering or bit order, etc. of the hardware of the
...@@ -151,6 +151,7 @@ MODULE_VERSION(DRV_VERSION); ...@@ -151,6 +151,7 @@ MODULE_VERSION(DRV_VERSION);
MODULE_DEVICE_TABLE(pci, cxgb4_pci_tbl); MODULE_DEVICE_TABLE(pci, cxgb4_pci_tbl);
MODULE_FIRMWARE(FW4_FNAME); MODULE_FIRMWARE(FW4_FNAME);
MODULE_FIRMWARE(FW5_FNAME); MODULE_FIRMWARE(FW5_FNAME);
MODULE_FIRMWARE(FW6_FNAME);
/* /*
* Normally we're willing to become the firmware's Master PF but will be happy * Normally we're willing to become the firmware's Master PF but will be happy
...@@ -4485,6 +4486,10 @@ static int enable_msix(struct adapter *adap) ...@@ -4485,6 +4486,10 @@ static int enable_msix(struct adapter *adap)
} }
for (i = 0; i < allocated; ++i) for (i = 0; i < allocated; ++i)
adap->msix_info[i].vec = entries[i].vector; adap->msix_info[i].vec = entries[i].vector;
dev_info(adap->pdev_dev, "%d MSI-X vectors allocated, "
"nic %d iscsi %d rdma cpl %d rdma ciq %d\n",
allocated, s->max_ethqsets, s->ofldqsets, s->rdmaqs,
s->rdmaciqs);
kfree(entries); kfree(entries);
return 0; return 0;
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
* Generic information about the driver. * Generic information about the driver.
*/ */
#define DRV_VERSION "2.0.0-ko" #define DRV_VERSION "2.0.0-ko"
#define DRV_DESC "Chelsio T4/T5 Virtual Function (VF) Network Driver" #define DRV_DESC "Chelsio T4/T5/T6 Virtual Function (VF) Network Driver"
/* /*
* Module Parameters. * Module Parameters.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment