staticconststruct be_ethtool_stat et_stats[] = {
{DRVSTAT_INFO(rx_crc_errors)},
{DRVSTAT_INFO(rx_alignment_symbol_errors)},
{DRVSTAT_INFO(rx_pause_frames)},
{DRVSTAT_INFO(rx_control_frames)}, /* Received packets dropped when the Ethernet length field * is not equal to the actual Ethernet data length.
*/
{DRVSTAT_INFO(rx_in_range_errors)}, /* Received packets dropped when their length field is >= 1501 bytes * and <= 1535 bytes.
*/
{DRVSTAT_INFO(rx_out_range_errors)}, /* Received packets dropped when they are longer than 9216 bytes */
{DRVSTAT_INFO(rx_frame_too_long)}, /* Received packets dropped when they don't pass the unicast or * multicast address filtering.
*/
{DRVSTAT_INFO(rx_address_filtered)}, /* Received packets dropped when IP packet length field is less than * the IP header length field.
*/
{DRVSTAT_INFO(rx_dropped_too_small)}, /* Received packets dropped when IP length field is greater than * the actual packet length.
*/
{DRVSTAT_INFO(rx_dropped_too_short)}, /* Received packets dropped when the IP header length field is less * than 5.
*/
{DRVSTAT_INFO(rx_dropped_header_too_small)}, /* Received packets dropped when the TCP header length field is less * than 5 or the TCP header length + IP header length is more * than IP packet length.
*/
{DRVSTAT_INFO(rx_dropped_tcp_length)},
{DRVSTAT_INFO(rx_dropped_runt)}, /* Number of received packets dropped when a fifo for descriptors going * into the packet demux block overflows. In normal operation, this * fifo must never overflow.
*/
{DRVSTAT_INFO(rxpp_fifo_overflow_drop)}, /* Received packets dropped when the RX block runs out of space in * one of its input FIFOs. This could happen due a long burst of * minimum-sized (64b) frames in the receive path. * This counter may also be erroneously incremented rarely.
*/
{DRVSTAT_INFO(rx_input_fifo_overflow_drop)},
{DRVSTAT_INFO(rx_ip_checksum_errs)},
{DRVSTAT_INFO(rx_tcp_checksum_errs)},
{DRVSTAT_INFO(rx_udp_checksum_errs)},
{DRVSTAT_INFO(tx_pauseframes)},
{DRVSTAT_INFO(tx_controlframes)},
{DRVSTAT_INFO(rx_priority_pause_frames)},
{DRVSTAT_INFO(tx_priority_pauseframes)}, /* Received packets dropped when an internal fifo going into * main packet buffer tank (PMEM) overflows.
*/
{DRVSTAT_INFO(pmem_fifo_overflow_drop)},
{DRVSTAT_INFO(jabber_events)}, /* Received packets dropped due to lack of available HW packet buffers * used to temporarily hold the received packets.
*/
{DRVSTAT_INFO(rx_drops_no_pbuf)}, /* Received packets dropped due to input receive buffer * descriptor fifo overflowing.
*/
{DRVSTAT_INFO(rx_drops_no_erx_descr)}, /* Packets dropped because the internal FIFO to the offloaded TCP * receive processing block is full. This could happen only for * offloaded iSCSI or FCoE trarffic.
*/
{DRVSTAT_INFO(rx_drops_no_tpre_descr)}, /* Received packets dropped when they need more than 8 * receive buffers. This cannot happen as the driver configures * 2048 byte receive buffers.
*/
{DRVSTAT_INFO(rx_drops_too_many_frags)},
{DRVSTAT_INFO(forwarded_packets)}, /* Received packets dropped when the frame length * is more than 9018 bytes
*/
{DRVSTAT_INFO(rx_drops_mtu)}, /* Number of dma mapping errors */
{DRVSTAT_INFO(dma_map_errors)}, /* Number of packets dropped due to random early drop function */
{DRVSTAT_INFO(eth_red_drops)},
{DRVSTAT_INFO(rx_roce_bytes_lsd)},
{DRVSTAT_INFO(rx_roce_bytes_msd)},
{DRVSTAT_INFO(rx_roce_frames)},
{DRVSTAT_INFO(roce_drops_payload_len)},
{DRVSTAT_INFO(roce_drops_crc)}
};
#define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats)
/* Stats related to multi RX queues: get_stats routine assumes bytes, pkts * are first and second members respectively.
*/ staticconststruct be_ethtool_stat et_rx_stats[] = {
{DRVSTAT_RX_INFO(rx_bytes)},/* If moving this member see above note */
{DRVSTAT_RX_INFO(rx_pkts)}, /* If moving this member see above note */
{DRVSTAT_RX_INFO(rx_vxlan_offload_pkts)},
{DRVSTAT_RX_INFO(rx_compl)},
{DRVSTAT_RX_INFO(rx_compl_err)},
{DRVSTAT_RX_INFO(rx_mcast_pkts)}, /* Number of page allocation failures while posting receive buffers * to HW.
*/
{DRVSTAT_RX_INFO(rx_post_fail)}, /* Recevied packets dropped due to skb allocation failure */
{DRVSTAT_RX_INFO(rx_drops_no_skbs)}, /* Received packets dropped due to lack of available fetched buffers * posted by the driver.
*/
{DRVSTAT_RX_INFO(rx_drops_no_frags)}
};
/* Stats related to multi TX queues: get_stats routine assumes compl is the * first member
*/ staticconststruct be_ethtool_stat et_tx_stats[] = {
{DRVSTAT_TX_INFO(tx_compl)}, /* If moving this member see above note */ /* This counter is incremented when the HW encounters an error while * parsing the packet header of an outgoing TX request. This counter is * applicable only for BE2, BE3 and Skyhawk based adapters.
*/
{DRVSTAT_TX_INFO(tx_hdr_parse_err)}, /* This counter is incremented when an error occurs in the DMA * operation associated with the TX request from the host to the device.
*/
{DRVSTAT_TX_INFO(tx_dma_err)}, /* This counter is incremented when MAC or VLAN spoof checking is * enabled on the interface and the TX request fails the spoof check * in HW.
*/
{DRVSTAT_TX_INFO(tx_spoof_check_err)}, /* This counter is incremented when the HW encounters an error while * performing TSO offload. This counter is applicable only for Lancer * adapters.
*/
{DRVSTAT_TX_INFO(tx_tso_err)}, /* This counter is incremented when the HW detects Q-in-Q style VLAN * tagging in a packet and such tagging is not expected on the outgoing * interface. This counter is applicable only for Lancer adapters.
*/
{DRVSTAT_TX_INFO(tx_qinq_err)}, /* This counter is incremented when the HW detects parity errors in the * packet data. This counter is applicable only for Lancer adapters.
*/
{DRVSTAT_TX_INFO(tx_internal_parity_err)},
{DRVSTAT_TX_INFO(tx_sge_err)},
{DRVSTAT_TX_INFO(tx_bytes)},
{DRVSTAT_TX_INFO(tx_pkts)},
{DRVSTAT_TX_INFO(tx_vxlan_offload_pkts)}, /* Number of skbs queued for trasmission by the driver */
{DRVSTAT_TX_INFO(tx_reqs)}, /* Number of times the TX queue was stopped due to lack * of spaces in the TXQ.
*/
{DRVSTAT_TX_INFO(tx_stops)}, /* Pkts dropped in the driver's transmit path */
{DRVSTAT_TX_INFO(tx_drv_drops)}
};
memset(&data_len_cmd, 0, sizeof(data_len_cmd)); /* data_offset and data_size should be 0 to get reg len */
lancer_cmd_read_object(adapter, &data_len_cmd, 0, 0, file_name,
&data_read, &eof, &addn_status);
staticint be_read_dump_data(struct be_adapter *adapter, u32 dump_len, void *buf)
{ int status = 0;
if (lancer_chip(adapter))
status = lancer_cmd_read_file(adapter, LANCER_FW_DUMP_FILE,
dump_len, buf); else
status = be_cmd_get_fat_dump(adapter, dump_len, buf);
/* For Skyhawk, the EQD setting happens via EQ_DB when AIC is enabled. * When AIC is disabled, persistently force set EQD value via the * FW cmd, so that we don't have to calculate the delay multiplier * encode value each time EQ_DB is rung
*/ if (!et->use_adaptive_rx_coalesce && skyhawk_chip(adapter))
be_eqd_update(adapter, true);
staticvoid be_get_stat_strings(struct net_device *netdev, uint32_t stringset,
uint8_t *data)
{ struct be_adapter *adapter = netdev_priv(netdev); int i, j;
switch (stringset) { case ETH_SS_STATS: for (i = 0; i < ETHTOOL_STATS_NUM; i++) {
memcpy(data, et_stats[i].desc, ETH_GSTRING_LEN);
data += ETH_GSTRING_LEN;
} for (i = 0; i < adapter->num_rx_qs; i++) { for (j = 0; j < ETHTOOL_RXSTATS_NUM; j++) {
sprintf(data, "rxq%d: %s", i,
et_rx_stats[j].desc);
data += ETH_GSTRING_LEN;
}
} for (i = 0; i < adapter->num_tx_qs; i++) { for (j = 0; j < ETHTOOL_TXSTATS_NUM; j++) {
sprintf(data, "txq%d: %s", i,
et_tx_stats[j].desc);
data += ETH_GSTRING_LEN;
}
} break; case ETH_SS_TEST: for (i = 0; i < ETHTOOL_TESTS_NUM; i++) {
memcpy(data, et_self_tests[i], ETH_GSTRING_LEN);
data += ETH_GSTRING_LEN;
} break; case ETH_SS_PRIV_FLAGS: for (i = 0; i < ARRAY_SIZE(be_priv_flags); i++)
strcpy(data + i * ETH_GSTRING_LEN, be_priv_flags[i]); break;
}
}
switch (adapter->phy.interface_type) { case PHY_TYPE_BASET_1GB: case PHY_TYPE_BASEX_1GB: case PHY_TYPE_SGMII:
port = PORT_TP; break; case PHY_TYPE_SFP_PLUS_10GB: if (adapter->phy.cable_type & SFP_PLUS_COPPER_CABLE)
port = PORT_DA; else
port = PORT_FIBRE; break; case PHY_TYPE_QSFP: if (adapter->phy.cable_type & QSFP_PLUS_CR4_CABLE)
port = PORT_DA; else
port = PORT_FIBRE; break; case PHY_TYPE_XFP_10GB: case PHY_TYPE_SFP_1GB:
port = PORT_FIBRE; break; case PHY_TYPE_BASET_10GB:
port = PORT_TP; break; default:
port = PORT_OTHER;
}
switch (adapter->phy.interface_type) { case PHY_TYPE_BASET_1GB: case PHY_TYPE_BASEX_1GB: case PHY_TYPE_SGMII:
val |= SUPPORTED_TP; if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
val |= SUPPORTED_1000baseT_Full; if (if_speeds & BE_SUPPORTED_SPEED_100MBPS)
val |= SUPPORTED_100baseT_Full; if (if_speeds & BE_SUPPORTED_SPEED_10MBPS)
val |= SUPPORTED_10baseT_Full; break; case PHY_TYPE_KX4_10GB:
val |= SUPPORTED_Backplane; if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
val |= SUPPORTED_1000baseKX_Full; if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseKX4_Full; break; case PHY_TYPE_KR2_20GB:
val |= SUPPORTED_Backplane; if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseKR_Full; if (if_speeds & BE_SUPPORTED_SPEED_20GBPS)
val |= SUPPORTED_20000baseKR2_Full; break; case PHY_TYPE_KR_10GB:
val |= SUPPORTED_Backplane |
SUPPORTED_10000baseKR_Full; break; case PHY_TYPE_KR4_40GB:
val |= SUPPORTED_Backplane; if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseKR_Full; if (if_speeds & BE_SUPPORTED_SPEED_40GBPS)
val |= SUPPORTED_40000baseKR4_Full; break; case PHY_TYPE_QSFP: if (if_speeds & BE_SUPPORTED_SPEED_40GBPS) { switch (adapter->phy.cable_type) { case QSFP_PLUS_CR4_CABLE:
val |= SUPPORTED_40000baseCR4_Full; break; case QSFP_PLUS_LR4_CABLE:
val |= SUPPORTED_40000baseLR4_Full; break; default:
val |= SUPPORTED_40000baseSR4_Full; break;
}
}
fallthrough; case PHY_TYPE_SFP_PLUS_10GB: case PHY_TYPE_XFP_10GB: case PHY_TYPE_SFP_1GB:
val |= SUPPORTED_FIBRE; if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseT_Full; if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
val |= SUPPORTED_1000baseT_Full; break; case PHY_TYPE_BASET_10GB:
val |= SUPPORTED_TP; if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseT_Full; if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
val |= SUPPORTED_1000baseT_Full; if (if_speeds & BE_SUPPORTED_SPEED_100MBPS)
val |= SUPPORTED_100baseT_Full; break; default:
val |= SUPPORTED_TP;
}
staticint be_set_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state)
{ struct be_adapter *adapter = netdev_priv(netdev); int status = 0;
switch (state) { case ETHTOOL_ID_ACTIVE:
status = be_cmd_get_beacon_state(adapter, adapter->hba_port_num,
&adapter->beacon_state); if (status) return be_cmd_status(status); return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON:
status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num,
0, 0, BEACON_STATE_ENABLED); break;
case ETHTOOL_ID_OFF:
status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num,
0, 0, BEACON_STATE_DISABLED); break;
case ETHTOOL_ID_INACTIVE:
status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num,
0, 0, adapter->beacon_state);
}
enable = wol->wolopts & WAKE_MAGIC; if (enable)
ether_addr_copy(mac, adapter->netdev->dev_addr);
status = be_cmd_enable_magic_wol(adapter, mac, &cmd); if (status) {
dev_err(dev, "Could not set Wake-on-lan mac address\n");
status = be_cmd_status(status); goto err;
}
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);
/* check link status before offline tests */
link_status = netif_carrier_ok(netdev);
if (test->flags & ETH_TEST_FL_OFFLINE) { if (be_loopback_test(adapter, BE_MAC_LOOPBACK, &data[0]) != 0)
test->flags |= ETH_TEST_FL_FAILED;
if (be_loopback_test(adapter, BE_PHY_LOOPBACK, &data[1]) != 0)
test->flags |= ETH_TEST_FL_FAILED;
if (test->flags & ETH_TEST_FL_EXTERNAL_LB) { if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
&data[2]) != 0)
test->flags |= ETH_TEST_FL_FAILED;
test->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE;
}
}
if (!be_multi_rxq(adapter)) {
dev_info(&adapter->pdev->dev, "ethtool::get_rxfh: RX flow hashing is disabled\n"); return -EINVAL;
}
switch (flow_type) { case TCP_V4_FLOW: if (adapter->rss_info.rss_flags & RSS_ENABLE_IPV4)
data |= RXH_IP_DST | RXH_IP_SRC; if (adapter->rss_info.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_info.rss_flags & RSS_ENABLE_IPV4)
data |= RXH_IP_DST | RXH_IP_SRC; if (adapter->rss_info.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_info.rss_flags & RSS_ENABLE_IPV6)
data |= RXH_IP_DST | RXH_IP_SRC; if (adapter->rss_info.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_info.rss_flags & RSS_ENABLE_IPV6)
data |= RXH_IP_DST | RXH_IP_SRC; if (adapter->rss_info.rss_flags & RSS_ENABLE_UDP_IPV6)
data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; break;
}
/* num_tx_qs is always same as the number of irqs used for TX */
ch->combined_count = min(adapter->num_tx_qs, num_rx_irqs);
ch->rx_count = num_rx_irqs - ch->combined_count;
ch->tx_count = adapter->num_tx_qs - ch->combined_count;
ch->max_combined = be_max_qp_irqs(adapter); /* The user must create atleast one combined channel */
ch->max_rx = be_max_rx_irqs(adapter) - 1;
ch->max_tx = be_max_tx_irqs(adapter) - 1;
}
/* we support either only combined channels or a combination of * combined and either RX-only or TX-only channels.
*/ if (ch->other_count || !ch->combined_count ||
(ch->rx_count && ch->tx_count)) return -EINVAL;
/* We do not allow change in unsupported parameters */ if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
rxfh->hfunc != ETH_RSS_HASH_TOP) return -EOPNOTSUPP;
if (rxfh->indir) { struct be_rx_obj *rxo;
for (i = 0; i < RSS_INDIR_TABLE_LEN; i++) {
j = rxfh->indir[i];
rxo = &adapter->rx_obj[j];
rsstable[i] = rxo->rss_id;
adapter->rss_info.rss_queue[i] = j;
}
} else {
memcpy(rsstable, adapter->rss_info.rsstable,
RSS_INDIR_TABLE_LEN);
}
if (!check_privilege(adapter, MAX_PRIVILEGES)) return -EOPNOTSUPP;
begin = eeprom->offset;
end = eeprom->offset + eeprom->len;
if (begin < PAGE_DATA_LEN) {
status = be_cmd_read_port_transceiver_data(adapter, TR_PAGE_A0, begin,
min_t(u32, end, PAGE_DATA_LEN) - begin,
data); if (status) goto err;
data += PAGE_DATA_LEN - begin;
begin = PAGE_DATA_LEN;
}
if (end > PAGE_DATA_LEN) {
status = be_cmd_read_port_transceiver_data(adapter, TR_PAGE_A2,
begin - PAGE_DATA_LEN,
end - begin, data); if (status) goto err;
}
err: return be_cmd_status(status);
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.20Bemerkung:
Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.