Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369823
b: refs/heads/master
c: 14d3692
h: refs/heads/master
i:
  369821: c121772
  369819: cd066a2
  369815: bffd045
  369807: 46bf4f7
  369791: cfd3648
v: v3
  • Loading branch information
David S. Miller committed Apr 29, 2013
1 parent 43789b6 commit a4cc079
Show file tree
Hide file tree
Showing 41 changed files with 996 additions and 477 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: eee1d5a14780b9391ec51f3feaf4cffb521ddbb1
refs/heads/master: 14d3692f04a050a0d1e4637b56f997a168c591f6
2 changes: 1 addition & 1 deletion trunk/drivers/atm/he.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ static int he_start(struct atm_dev *dev)
he_writel(he_dev, 0x0, RESET_CNTL);
he_writel(he_dev, 0xff, RESET_CNTL);

udelay(16*1000); /* 16 ms */
msleep(16); /* 16 ms */
status = he_readl(he_dev, RESET_CNTL);
if ((status & BOARD_RST_STATUS) == 0) {
hprintk("reset failed\n");
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/ethernet/emulex/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ struct be_drv_stats {
u32 rx_in_range_errors;
u32 rx_out_range_errors;
u32 rx_frame_too_long;
u32 rx_address_mismatch_drops;
u32 rx_address_filtered;
u32 rx_dropped_too_small;
u32 rx_dropped_too_short;
u32 rx_dropped_header_too_small;
Expand Down Expand Up @@ -447,6 +447,7 @@ struct be_adapter {
u16 max_event_queues;
u32 if_cap_flags;
u8 pf_number;
u64 rss_flags;
};

#define be_physfn(adapter) (!adapter->virtfn)
Expand Down
13 changes: 5 additions & 8 deletions trunk/drivers/net/ethernet/emulex/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,8 @@ int be_cmd_reset_function(struct be_adapter *adapter)
return status;
}

int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size)
int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
u32 rss_hash_opts, u16 table_size)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_rss_config *req;
Expand All @@ -1917,16 +1918,12 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size)
OPCODE_ETH_RSS_CONFIG, sizeof(*req), wrb, NULL);

req->if_id = cpu_to_le32(adapter->if_handle);
req->enable_rss = cpu_to_le16(RSS_ENABLE_TCP_IPV4 | RSS_ENABLE_IPV4 |
RSS_ENABLE_TCP_IPV6 | RSS_ENABLE_IPV6);
req->enable_rss = cpu_to_le16(rss_hash_opts);
req->cpu_table_size_log2 = cpu_to_le16(fls(table_size) - 1);

if (lancer_chip(adapter) || skyhawk_chip(adapter)) {
if (lancer_chip(adapter) || skyhawk_chip(adapter))
req->hdr.version = 1;
req->enable_rss |= cpu_to_le16(RSS_ENABLE_UDP_IPV4 |
RSS_ENABLE_UDP_IPV6);
}

req->cpu_table_size_log2 = cpu_to_le16(fls(table_size) - 1);
memcpy(req->cpu_table, rsstable, table_size);
memcpy(req->hash, myhash, sizeof(myhash));
be_dws_cpu_to_le(req->hash, sizeof(req->hash));
Expand Down
15 changes: 9 additions & 6 deletions trunk/drivers/net/ethernet/emulex/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@ struct be_port_rxf_stats_v0 {
u32 rx_in_range_errors; /* dword 10*/
u32 rx_out_range_errors; /* dword 11*/
u32 rx_frame_too_long; /* dword 12*/
u32 rx_address_mismatch_drops; /* dword 13*/
u32 rx_vlan_mismatch_drops; /* dword 14*/
u32 rx_address_filtered; /* dword 13*/
u32 rx_vlan_filtered; /* dword 14*/
u32 rx_dropped_too_small; /* dword 15*/
u32 rx_dropped_too_short; /* dword 16*/
u32 rx_dropped_header_too_small; /* dword 17*/
Expand Down Expand Up @@ -797,8 +797,8 @@ struct lancer_pport_stats {
u32 rx_control_frames_unknown_opcode_hi;
u32 rx_in_range_errors;
u32 rx_out_of_range_errors;
u32 rx_address_mismatch_drops;
u32 rx_vlan_mismatch_drops;
u32 rx_address_filtered;
u32 rx_vlan_filtered;
u32 rx_dropped_too_small;
u32 rx_dropped_too_short;
u32 rx_dropped_header_too_small;
Expand Down Expand Up @@ -1090,6 +1090,9 @@ struct be_cmd_resp_query_fw_cfg {
#define RSS_ENABLE_UDP_IPV4 0x10
#define RSS_ENABLE_UDP_IPV6 0x20

#define L3_RSS_FLAGS (RXH_IP_DST | RXH_IP_SRC)
#define L4_RSS_FLAGS (RXH_L4_B_0_1 | RXH_L4_B_2_3)

struct be_cmd_req_rss_config {
struct be_cmd_req_hdr hdr;
u32 if_id;
Expand Down Expand Up @@ -1573,7 +1576,7 @@ struct be_port_rxf_stats_v1 {
u32 rx_in_range_errors;
u32 rx_out_range_errors;
u32 rx_frame_too_long;
u32 rx_address_mismatch_drops;
u32 rx_address_filtered;
u32 rx_dropped_too_small;
u32 rx_dropped_too_short;
u32 rx_dropped_header_too_small;
Expand Down Expand Up @@ -1860,7 +1863,7 @@ extern int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num,
u32 *function_mode, u32 *function_caps, u16 *asic_rev);
extern int be_cmd_reset_function(struct be_adapter *adapter);
extern int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
u16 table_size);
u32 rss_hash_opts, u16 table_size);
extern int be_process_mcc(struct be_adapter *adapter);
extern int be_cmd_set_beacon_state(struct be_adapter *adapter,
u8 port_num, u8 beacon, u8 status, u8 state);
Expand Down
163 changes: 162 additions & 1 deletion trunk/drivers/net/ethernet/emulex/benet/be_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static const struct be_ethtool_stat et_stats[] = {
/* Received packets dropped when they don't pass the unicast or
* multicast address filtering.
*/
{DRVSTAT_INFO(rx_address_mismatch_drops)},
{DRVSTAT_INFO(rx_address_filtered)},
/* Received packets dropped when IP packet length field is less than
* the IP header length field.
*/
Expand Down Expand Up @@ -755,6 +755,12 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
int status;
u8 link_status = 0;

if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
dev_err(&adapter->pdev->dev, "Self test not supported\n");
test->flags |= ETH_TEST_FL_FAILED;
return;
}

memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);

if (test->flags & ETH_TEST_FL_OFFLINE) {
Expand Down Expand Up @@ -934,6 +940,159 @@ static void be_set_msg_level(struct net_device *netdev, u32 level)
return;
}

static u64 be_get_rss_hash_opts(struct be_adapter *adapter, u64 flow_type)
{
u64 data = 0;

switch (flow_type) {
case TCP_V4_FLOW:
if (adapter->rss_flags & RSS_ENABLE_IPV4)
data |= RXH_IP_DST | RXH_IP_SRC;
if (adapter->rss_flags & RSS_ENABLE_TCP_IPV4)
data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
break;
case UDP_V4_FLOW:
if (adapter->rss_flags & RSS_ENABLE_IPV4)
data |= RXH_IP_DST | RXH_IP_SRC;
if (adapter->rss_flags & RSS_ENABLE_UDP_IPV4)
data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
break;
case TCP_V6_FLOW:
if (adapter->rss_flags & RSS_ENABLE_IPV6)
data |= RXH_IP_DST | RXH_IP_SRC;
if (adapter->rss_flags & RSS_ENABLE_TCP_IPV6)
data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
break;
case UDP_V6_FLOW:
if (adapter->rss_flags & RSS_ENABLE_IPV6)
data |= RXH_IP_DST | RXH_IP_SRC;
if (adapter->rss_flags & RSS_ENABLE_UDP_IPV6)
data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
break;
}

return data;
}

static int be_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
u32 *rule_locs)
{
struct be_adapter *adapter = netdev_priv(netdev);

if (!be_multi_rxq(adapter)) {
dev_info(&adapter->pdev->dev,
"ethtool::get_rxnfc: RX flow hashing is disabled\n");
return -EINVAL;
}

switch (cmd->cmd) {
case ETHTOOL_GRXFH:
cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type);
break;
case ETHTOOL_GRXRINGS:
cmd->data = adapter->num_rx_qs - 1;
break;
default:
return -EINVAL;
}

return 0;
}

static int be_set_rss_hash_opts(struct be_adapter *adapter,
struct ethtool_rxnfc *cmd)
{
struct be_rx_obj *rxo;
int status = 0, i, j;
u8 rsstable[128];
u32 rss_flags = adapter->rss_flags;

if (cmd->data != L3_RSS_FLAGS &&
cmd->data != (L3_RSS_FLAGS | L4_RSS_FLAGS))
return -EINVAL;

switch (cmd->flow_type) {
case TCP_V4_FLOW:
if (cmd->data == L3_RSS_FLAGS)
rss_flags &= ~RSS_ENABLE_TCP_IPV4;
else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
rss_flags |= RSS_ENABLE_IPV4 |
RSS_ENABLE_TCP_IPV4;
break;
case TCP_V6_FLOW:
if (cmd->data == L3_RSS_FLAGS)
rss_flags &= ~RSS_ENABLE_TCP_IPV6;
else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
rss_flags |= RSS_ENABLE_IPV6 |
RSS_ENABLE_TCP_IPV6;
break;
case UDP_V4_FLOW:
if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
BEx_chip(adapter))
return -EINVAL;

if (cmd->data == L3_RSS_FLAGS)
rss_flags &= ~RSS_ENABLE_UDP_IPV4;
else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
rss_flags |= RSS_ENABLE_IPV4 |
RSS_ENABLE_UDP_IPV4;
break;
case UDP_V6_FLOW:
if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
BEx_chip(adapter))
return -EINVAL;

if (cmd->data == L3_RSS_FLAGS)
rss_flags &= ~RSS_ENABLE_UDP_IPV6;
else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
rss_flags |= RSS_ENABLE_IPV6 |
RSS_ENABLE_UDP_IPV6;
break;
default:
return -EINVAL;
}

if (rss_flags == adapter->rss_flags)
return status;

if (be_multi_rxq(adapter)) {
for (j = 0; j < 128; j += adapter->num_rx_qs - 1) {
for_all_rss_queues(adapter, rxo, i) {
if ((j + i) >= 128)
break;
rsstable[j + i] = rxo->rss_id;
}
}
}
status = be_cmd_rss_config(adapter, rsstable, rss_flags, 128);
if (!status)
adapter->rss_flags = rss_flags;

return status;
}

static int be_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
{
struct be_adapter *adapter = netdev_priv(netdev);
int status = 0;

if (!be_multi_rxq(adapter)) {
dev_err(&adapter->pdev->dev,
"ethtool::set_rxnfc: RX flow hashing is disabled\n");
return -EINVAL;
}

switch (cmd->cmd) {
case ETHTOOL_SRXFH:
status = be_set_rss_hash_opts(adapter, cmd);
break;
default:
return -EINVAL;
}

return status;
}

const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
.get_drvinfo = be_get_drvinfo,
Expand All @@ -957,4 +1116,6 @@ const struct ethtool_ops be_ethtool_ops = {
.get_regs = be_get_regs,
.flash_device = be_do_flash,
.self_test = be_self_test,
.get_rxnfc = be_get_rxnfc,
.set_rxnfc = be_set_rxnfc,
};
28 changes: 19 additions & 9 deletions trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ static void populate_be_v0_stats(struct be_adapter *adapter)
drvs->rx_input_fifo_overflow_drop = port_stats->rx_input_fifo_overflow;
drvs->rx_dropped_header_too_small =
port_stats->rx_dropped_header_too_small;
drvs->rx_address_mismatch_drops =
port_stats->rx_address_mismatch_drops +
port_stats->rx_vlan_mismatch_drops;
drvs->rx_address_filtered =
port_stats->rx_address_filtered +
port_stats->rx_vlan_filtered;
drvs->rx_alignment_symbol_errors =
port_stats->rx_alignment_symbol_errors;

Expand Down Expand Up @@ -404,7 +404,7 @@ static void populate_be_v1_stats(struct be_adapter *adapter)
port_stats->rx_dropped_header_too_small;
drvs->rx_input_fifo_overflow_drop =
port_stats->rx_input_fifo_overflow_drop;
drvs->rx_address_mismatch_drops = port_stats->rx_address_mismatch_drops;
drvs->rx_address_filtered = port_stats->rx_address_filtered;
drvs->rx_alignment_symbol_errors =
port_stats->rx_alignment_symbol_errors;
drvs->rxpp_fifo_overflow_drop = port_stats->rxpp_fifo_overflow_drop;
Expand Down Expand Up @@ -445,9 +445,9 @@ static void populate_lancer_stats(struct be_adapter *adapter)
drvs->rx_dropped_header_too_small =
pport_stats->rx_dropped_header_too_small;
drvs->rx_input_fifo_overflow_drop = pport_stats->rx_fifo_overflow;
drvs->rx_address_mismatch_drops =
pport_stats->rx_address_mismatch_drops +
pport_stats->rx_vlan_mismatch_drops;
drvs->rx_address_filtered =
pport_stats->rx_address_filtered +
pport_stats->rx_vlan_filtered;
drvs->rx_alignment_symbol_errors = pport_stats->rx_symbol_errors_lo;
drvs->rxpp_fifo_overflow_drop = pport_stats->rx_fifo_overflow;
drvs->tx_pauseframes = pport_stats->tx_pause_frames_lo;
Expand Down Expand Up @@ -2510,9 +2510,19 @@ static int be_rx_qs_create(struct be_adapter *adapter)
rsstable[j + i] = rxo->rss_id;
}
}
rc = be_cmd_rss_config(adapter, rsstable, 128);
if (rc)
adapter->rss_flags = RSS_ENABLE_TCP_IPV4 | RSS_ENABLE_IPV4 |
RSS_ENABLE_TCP_IPV6 | RSS_ENABLE_IPV6;

if (!BEx_chip(adapter))
adapter->rss_flags |= RSS_ENABLE_UDP_IPV4 |
RSS_ENABLE_UDP_IPV6;

rc = be_cmd_rss_config(adapter, rsstable, adapter->rss_flags,
128);
if (rc) {
adapter->rss_flags = 0;
return rc;
}
}

/* First time posting */
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4016,6 +4016,8 @@ void e1000e_down(struct e1000_adapter *adapter)

e1000_irq_disable(adapter);

napi_synchronize(&adapter->napi);

del_timer_sync(&adapter->watchdog_timer);
del_timer_sync(&adapter->phy_info_timer);

Expand Down Expand Up @@ -4372,12 +4374,13 @@ static int e1000_close(struct net_device *netdev)

pm_runtime_get_sync(&pdev->dev);

napi_disable(&adapter->napi);

if (!test_bit(__E1000_DOWN, &adapter->state)) {
e1000e_down(adapter);
e1000_free_irq(adapter);
}

napi_disable(&adapter->napi);

e1000_power_down_phy(adapter);

e1000e_free_tx_resources(adapter->tx_ring);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/ethernet/intel/e1000e/ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ static int e1000e_phc_settime(struct ptp_clock_info *ptp,
unsigned long flags;
u64 ns;

ns = ts->tv_sec * NSEC_PER_SEC;
ns += ts->tv_nsec;
ns = timespec_to_ns(ts);

/* reset the timecounter */
spin_lock_irqsave(&adapter->systim_lock, flags);
Expand Down
Loading

0 comments on commit a4cc079

Please sign in to comment.