Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369775
b: refs/heads/master
c: 73e3dd6
h: refs/heads/master
i:
  369773: 5bbfc00
  369771: c830b7c
  369767: efa13fb
  369759: 548745c
v: v3
  • Loading branch information
Richard Cochran authored and Jeff Kirsher committed Apr 26, 2013
1 parent bc5f194 commit 7773de0
Show file tree
Hide file tree
Showing 34 changed files with 163 additions and 889 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: b38a54eaa0acc5991cbad93bf44b355aa43f6d6f
refs/heads/master: 73e3dd6b45c4c870fc2641eb04c24e3f12dab1e0
4 changes: 0 additions & 4 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,4 @@

#define UNDEF_IRO 0x80000000

/* used for defining the amount of FCoE tasks supported for PF */
#define MAX_FCOE_FUNCS_PER_ENGINE 2
#define MAX_NUM_FCOE_TASKS_PER_ENGINE 4096

#endif /* BNX2X_FW_DEFS_H */
6 changes: 0 additions & 6 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10791,12 +10791,6 @@ static void bnx2x_get_fcoe_info(struct bnx2x *bp)
(max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >>
BNX2X_MAX_FCOE_INIT_CONN_SHIFT;

/* Calculate the number of maximum allowed FCoE tasks */
bp->cnic_eth_dev.max_fcoe_exchanges = MAX_NUM_FCOE_TASKS_PER_ENGINE;
if (IS_MF(bp) || CHIP_MODE_IS_4_PORT(bp))
bp->cnic_eth_dev.max_fcoe_exchanges /=
MAX_FCOE_FUNCS_PER_ENGINE;

/* Read the WWN: */
if (!IS_MF(bp)) {
/* Port info */
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/ethernet/broadcom/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -5544,10 +5544,8 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)

if (!(ethdev->drv_state & CNIC_DRV_STATE_NO_ISCSI))
cdev->max_iscsi_conn = ethdev->max_iscsi_conn;
if (CNIC_SUPPORTS_FCOE(cp)) {
if (CNIC_SUPPORTS_FCOE(cp))
cdev->max_fcoe_conn = ethdev->max_fcoe_conn;
cdev->max_fcoe_exchanges = ethdev->max_fcoe_exchanges;
}

if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS)
cdev->max_fcoe_conn = BNX2X_FCOE_NUM_CONNECTIONS;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/net/ethernet/broadcom/cnic_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ struct cnic_eth_dev {
u32 max_fcoe_conn;
u32 max_rdma_conn;
u32 fcoe_init_cid;
u32 max_fcoe_exchanges;
u32 fcoe_wwn_port_name_hi;
u32 fcoe_wwn_port_name_lo;
u32 fcoe_wwn_node_name_hi;
Expand Down Expand Up @@ -314,8 +313,6 @@ struct cnic_dev {
int max_fcoe_conn;
int max_rdma_conn;

int max_fcoe_exchanges;

union drv_info_to_mcp *stats_addr;
struct fcoe_capabilities *fcoe_cap;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ethernet/calxeda/xgmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ static int xgmac_set_features(struct net_device *dev, netdev_features_t features
u32 ctrl;
struct xgmac_priv *priv = netdev_priv(dev);
void __iomem *ioaddr = priv->base;
netdev_features_t changed = dev->features ^ features;
u32 changed = dev->features ^ features;

if (!(changed & NETIF_F_RXCSUM))
return 0;
Expand Down
3 changes: 1 addition & 2 deletions 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_filtered;
u32 rx_address_mismatch_drops;
u32 rx_dropped_too_small;
u32 rx_dropped_too_short;
u32 rx_dropped_header_too_small;
Expand Down Expand Up @@ -447,7 +447,6 @@ 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: 8 additions & 5 deletions trunk/drivers/net/ethernet/emulex/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,8 +1898,7 @@ int be_cmd_reset_function(struct be_adapter *adapter)
return status;
}

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

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

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: 6 additions & 9 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_filtered; /* dword 13*/
u32 rx_vlan_filtered; /* dword 14*/
u32 rx_address_mismatch_drops; /* dword 13*/
u32 rx_vlan_mismatch_drops; /* 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_filtered;
u32 rx_vlan_filtered;
u32 rx_address_mismatch_drops;
u32 rx_vlan_mismatch_drops;
u32 rx_dropped_too_small;
u32 rx_dropped_too_short;
u32 rx_dropped_header_too_small;
Expand Down Expand Up @@ -1090,9 +1090,6 @@ 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 @@ -1576,7 +1573,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_filtered;
u32 rx_address_mismatch_drops;
u32 rx_dropped_too_small;
u32 rx_dropped_too_short;
u32 rx_dropped_header_too_small;
Expand Down Expand Up @@ -1863,7 +1860,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,
u32 rss_hash_opts, u16 table_size);
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: 1 addition & 162 deletions 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_filtered)},
{DRVSTAT_INFO(rx_address_mismatch_drops)},
/* Received packets dropped when IP packet length field is less than
* the IP header length field.
*/
Expand Down Expand Up @@ -755,12 +755,6 @@ 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 @@ -940,159 +934,6 @@ 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 @@ -1116,6 +957,4 @@ 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,
};
Loading

0 comments on commit 7773de0

Please sign in to comment.