Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369721
b: refs/heads/master
c: bdbeefe
h: refs/heads/master
i:
  369719: 68bce2e
v: v3
  • Loading branch information
Don Skidmore authored and Jeff Kirsher committed Apr 25, 2013
1 parent 4568649 commit f0cc30c
Show file tree
Hide file tree
Showing 19 changed files with 120 additions and 342 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3734b0496f5a310a85bb53310c047b8e42bc440
refs/heads/master: bdbeefe8ea8c7aa1e00397641e1f3dfa41a20968
3 changes: 3 additions & 0 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,9 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
*/
/* what was last interrupt timeslice? */
timepassed_us = q_vector->itr >> 2;
if (timepassed_us == 0)
return;

bytes_perint = bytes / timepassed_us; /* bytes/usec */

switch (itr_setting) {
Expand Down
22 changes: 7 additions & 15 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 2
#define _QLCNIC_LINUX_SUBVERSION 42
#define QLCNIC_LINUX_VERSIONID "5.2.42"
#define _QLCNIC_LINUX_SUBVERSION 41
#define QLCNIC_LINUX_VERSIONID "5.2.41"
#define QLCNIC_DRV_IDC_VER 0x01
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
Expand Down Expand Up @@ -347,14 +347,8 @@ struct qlcnic_rx_buffer {
* Interrupt coalescing defaults. The defaults are for 1500 MTU. It is
* adjusted based on configured MTU.
*/
#define QLCNIC_INTR_COAL_TYPE_RX 1
#define QLCNIC_INTR_COAL_TYPE_TX 2

#define QLCNIC_DEF_INTR_COALESCE_RX_TIME_US 3
#define QLCNIC_DEF_INTR_COALESCE_RX_PACKETS 256

#define QLCNIC_DEF_INTR_COALESCE_TX_TIME_US 64
#define QLCNIC_DEF_INTR_COALESCE_TX_PACKETS 64
#define QLCNIC_DEFAULT_INTR_COALESCE_RX_TIME_US 3
#define QLCNIC_DEFAULT_INTR_COALESCE_RX_PACKETS 256

#define QLCNIC_INTR_DEFAULT 0x04
#define QLCNIC_CONFIG_INTR_COALESCE 3
Expand All @@ -365,8 +359,6 @@ struct qlcnic_nic_intr_coalesce {
u8 sts_ring_mask;
u16 rx_packets;
u16 rx_time_us;
u16 tx_packets;
u16 tx_time_us;
u16 flag;
u32 timer_out;
};
Expand Down Expand Up @@ -519,13 +511,13 @@ struct qlcnic_host_sds_ring {
int irq;

dma_addr_t phys_addr;
char name[IFNAMSIZ + 12];
char name[IFNAMSIZ+4];
} ____cacheline_internodealigned_in_smp;

struct qlcnic_host_tx_ring {
int irq;
void __iomem *crb_intr_mask;
char name[IFNAMSIZ + 12];
char name[IFNAMSIZ+4];
u16 ctx_id;
u32 producer;
u32 sw_consumer;
Expand Down Expand Up @@ -1482,7 +1474,7 @@ void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings);
int qlcnic_diag_alloc_res(struct net_device *netdev, int test);
netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
int qlcnic_set_max_rss(struct qlcnic_adapter *, u8, size_t);
int qlcnic_validate_max_rss(struct qlcnic_adapter *, __u32);
int qlcnic_validate_max_rss(u8, u8);
void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter);
int qlcnic_enable_msix(struct qlcnic_adapter *, u32);

Expand Down
19 changes: 4 additions & 15 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,26 +1937,18 @@ int qlcnic_83xx_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac)
void qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *adapter)
{
int err;
u16 temp;
u32 temp;
struct qlcnic_cmd_args cmd;
struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal;

if (adapter->recv_ctx->state == QLCNIC_HOST_CTX_STATE_FREED)
return;

qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_CONFIG_INTR_COAL);
if (coal->type == QLCNIC_INTR_COAL_TYPE_RX) {
temp = adapter->recv_ctx->context_id;
cmd.req.arg[1] = QLCNIC_INTR_COAL_TYPE_RX | temp << 16;
temp = coal->rx_time_us;
cmd.req.arg[2] = coal->rx_packets | temp << 16;
} else if (coal->type == QLCNIC_INTR_COAL_TYPE_TX) {
temp = adapter->tx_ring->ctx_id;
cmd.req.arg[1] = QLCNIC_INTR_COAL_TYPE_TX | temp << 16;
temp = coal->tx_time_us;
cmd.req.arg[2] = coal->tx_packets | temp << 16;
}
cmd.req.arg[1] = 1 | (adapter->recv_ctx->context_id << 16);
cmd.req.arg[3] = coal->flag;
temp = coal->rx_time_us << 16;
cmd.req.arg[2] = coal->rx_packets | temp;
err = qlcnic_issue_cmd(adapter, &cmd);
if (err != QLCNIC_RCODE_SUCCESS)
dev_info(&adapter->pdev->dev,
Expand Down Expand Up @@ -2930,9 +2922,6 @@ static u64 *qlcnic_83xx_fill_stats(struct qlcnic_adapter *adapter,
/* fill in MAC rx frame stats */
for (k += 6; k < 80; k += 2)
data = qlcnic_83xx_copy_stats(cmd, data, k);
/* fill in eSwitch stats */
for (; k < total_regs; k += 2)
data = qlcnic_83xx_copy_stats(cmd, data, k);
break;
case QLC_83XX_STAT_RX:
for (k = 2; k < 8; k += 2)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ enum qlcnic_83xx_states {
#define QLC_83XX_STAT_MAC 1
#define QLC_83XX_TX_STAT_REGS 14
#define QLC_83XX_RX_STAT_REGS 40
#define QLC_83XX_MAC_STAT_REGS 94
#define QLC_83XX_MAC_STAT_REGS 80

#define QLC_83XX_GET_FUNC_PRIVILEGE(VAL, FN) (0x3 & ((VAL) >> (FN * 2)))
#define QLC_83XX_SET_FUNC_OPMODE(VAL, FN) ((VAL) << (FN * 2))
Expand Down
25 changes: 0 additions & 25 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@
#define QLC_83XX_OPCODE_TMPL_END 0x0080
#define QLC_83XX_OPCODE_POLL_READ_LIST 0x0100

/* EPORT control registers */
#define QLC_83XX_RESET_CONTROL 0x28084E50
#define QLC_83XX_RESET_REG 0x28084E60
#define QLC_83XX_RESET_PORT0 0x28084E70
#define QLC_83XX_RESET_PORT1 0x28084E80
#define QLC_83XX_RESET_PORT2 0x28084E90
#define QLC_83XX_RESET_PORT3 0x28084EA0
#define QLC_83XX_RESET_SRESHIM 0x28084EB0
#define QLC_83XX_RESET_EPGSHIM 0x28084EC0
#define QLC_83XX_RESET_ETHERPCS 0x28084ED0

static int qlcnic_83xx_init_default_driver(struct qlcnic_adapter *adapter);
static int qlcnic_83xx_check_heartbeat(struct qlcnic_adapter *p_dev);
static int qlcnic_83xx_restart_hw(struct qlcnic_adapter *adapter);
Expand Down Expand Up @@ -1385,19 +1374,6 @@ static void qlcnic_83xx_disable_pause_frames(struct qlcnic_adapter *adapter)
qlcnic_83xx_unlock_driver(adapter);
}

static void qlcnic_83xx_take_eport_out_of_reset(struct qlcnic_adapter *adapter)
{
QLCWR32(adapter, QLC_83XX_RESET_REG, 0);
QLCWR32(adapter, QLC_83XX_RESET_PORT0, 0);
QLCWR32(adapter, QLC_83XX_RESET_PORT1, 0);
QLCWR32(adapter, QLC_83XX_RESET_PORT2, 0);
QLCWR32(adapter, QLC_83XX_RESET_PORT3, 0);
QLCWR32(adapter, QLC_83XX_RESET_SRESHIM, 0);
QLCWR32(adapter, QLC_83XX_RESET_EPGSHIM, 0);
QLCWR32(adapter, QLC_83XX_RESET_ETHERPCS, 0);
QLCWR32(adapter, QLC_83XX_RESET_CONTROL, 1);
}

static int qlcnic_83xx_check_heartbeat(struct qlcnic_adapter *p_dev)
{
u32 heartbeat, peg_status;
Expand All @@ -1419,7 +1395,6 @@ static int qlcnic_83xx_check_heartbeat(struct qlcnic_adapter *p_dev)

if (ret) {
dev_err(&p_dev->pdev->dev, "firmware hang detected\n");
qlcnic_83xx_take_eport_out_of_reset(p_dev);
qlcnic_83xx_disable_pause_frames(p_dev);
peg_status = QLC_SHARED_REG_RD32(p_dev,
QLCNIC_PEG_HALT_STATUS1);
Expand Down
77 changes: 14 additions & 63 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ static const char qlcnic_83xx_mac_stats_strings[][ETH_GSTRING_LEN] = {
"mac_rx_dropped",
"mac_crc_error",
"mac_align_error",
"eswitch_frames",
"eswitch_bytes",
"eswitch_multicast_frames",
"eswitch_broadcast_frames",
"eswitch_unicast_frames",
"eswitch_error_free_frames",
"eswitch_error_free_bytes",
};

#define QLCNIC_STATS_LEN ARRAY_SIZE(qlcnic_gstrings_stats)
Expand Down Expand Up @@ -642,7 +635,7 @@ static int qlcnic_set_channels(struct net_device *dev,
channel->tx_count != channel->max_tx)
return -EINVAL;

err = qlcnic_validate_max_rss(adapter, channel->rx_count);
err = qlcnic_validate_max_rss(channel->max_rx, channel->rx_count);
if (err)
return err;

Expand Down Expand Up @@ -1303,9 +1296,6 @@ static int qlcnic_set_intr_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ethcoal)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct qlcnic_nic_intr_coalesce *coal;
u32 rx_coalesce_usecs, rx_max_frames;
u32 tx_coalesce_usecs, tx_max_frames;

if (!test_bit(__QLCNIC_DEV_UP, &adapter->state))
return -EINVAL;
Expand All @@ -1316,8 +1306,8 @@ static int qlcnic_set_intr_coalesce(struct net_device *netdev,
*/
if (ethcoal->rx_coalesce_usecs > 0xffff ||
ethcoal->rx_max_coalesced_frames > 0xffff ||
ethcoal->tx_coalesce_usecs > 0xffff ||
ethcoal->tx_max_coalesced_frames > 0xffff ||
ethcoal->tx_coalesce_usecs ||
ethcoal->tx_max_coalesced_frames ||
ethcoal->rx_coalesce_usecs_irq ||
ethcoal->rx_max_coalesced_frames_irq ||
ethcoal->tx_coalesce_usecs_irq ||
Expand All @@ -1337,55 +1327,18 @@ static int qlcnic_set_intr_coalesce(struct net_device *netdev,
ethcoal->tx_max_coalesced_frames_high)
return -EINVAL;

coal = &adapter->ahw->coal;

if (qlcnic_83xx_check(adapter)) {
if (!ethcoal->tx_coalesce_usecs ||
!ethcoal->tx_max_coalesced_frames ||
!ethcoal->rx_coalesce_usecs ||
!ethcoal->rx_max_coalesced_frames) {
coal->flag = QLCNIC_INTR_DEFAULT;
coal->type = QLCNIC_INTR_COAL_TYPE_RX;
coal->rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US;
coal->rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS;
coal->tx_time_us = QLCNIC_DEF_INTR_COALESCE_TX_TIME_US;
coal->tx_packets = QLCNIC_DEF_INTR_COALESCE_TX_PACKETS;
} else {
tx_coalesce_usecs = ethcoal->tx_coalesce_usecs;
tx_max_frames = ethcoal->tx_max_coalesced_frames;
rx_coalesce_usecs = ethcoal->rx_coalesce_usecs;
rx_max_frames = ethcoal->rx_max_coalesced_frames;
coal->flag = 0;

if ((coal->rx_time_us == rx_coalesce_usecs) &&
(coal->rx_packets == rx_max_frames)) {
coal->type = QLCNIC_INTR_COAL_TYPE_TX;
coal->tx_time_us = tx_coalesce_usecs;
coal->tx_packets = tx_max_frames;
} else if ((coal->tx_time_us == tx_coalesce_usecs) &&
(coal->tx_packets == tx_max_frames)) {
coal->type = QLCNIC_INTR_COAL_TYPE_RX;
coal->rx_time_us = rx_coalesce_usecs;
coal->rx_packets = rx_max_frames;
} else {
coal->type = QLCNIC_INTR_COAL_TYPE_RX;
coal->rx_time_us = rx_coalesce_usecs;
coal->rx_packets = rx_max_frames;
coal->tx_time_us = tx_coalesce_usecs;
coal->tx_packets = tx_max_frames;
}
}
if (!ethcoal->rx_coalesce_usecs ||
!ethcoal->rx_max_coalesced_frames) {
adapter->ahw->coal.flag = QLCNIC_INTR_DEFAULT;
adapter->ahw->coal.rx_time_us =
QLCNIC_DEFAULT_INTR_COALESCE_RX_TIME_US;
adapter->ahw->coal.rx_packets =
QLCNIC_DEFAULT_INTR_COALESCE_RX_PACKETS;
} else {
if (!ethcoal->rx_coalesce_usecs ||
!ethcoal->rx_max_coalesced_frames) {
coal->flag = QLCNIC_INTR_DEFAULT;
coal->rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US;
coal->rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS;
} else {
coal->flag = 0;
coal->rx_time_us = ethcoal->rx_coalesce_usecs;
coal->rx_packets = ethcoal->rx_max_coalesced_frames;
}
adapter->ahw->coal.flag = 0;
adapter->ahw->coal.rx_time_us = ethcoal->rx_coalesce_usecs;
adapter->ahw->coal.rx_packets =
ethcoal->rx_max_coalesced_frames;
}

qlcnic_config_intr_coalesce(adapter);
Expand All @@ -1403,8 +1356,6 @@ static int qlcnic_get_intr_coalesce(struct net_device *netdev,

ethcoal->rx_coalesce_usecs = adapter->ahw->coal.rx_time_us;
ethcoal->rx_max_coalesced_frames = adapter->ahw->coal.rx_packets;
ethcoal->tx_coalesce_usecs = adapter->ahw->coal.tx_time_us;
ethcoal->tx_max_coalesced_frames = adapter->ahw->coal.tx_packets;

return 0;
}
Expand Down
Loading

0 comments on commit f0cc30c

Please sign in to comment.