Impressum be_main.c
Sprache: C
|
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2005 - 2016 Broadcom
* All rights reserved.
*
* Contact Information:
* linux-drivers@emulex.com
*
* Emulex
* 3333 Susan Street
* Costa Mesa, CA 92626
*/
#include <linux/prefetch.h>
#include <linux/module.h>
#include "be.h"
#include "be_cmds.h"
#include <asm/div64.h>
#include <linux/if_bridge.h>
#include <net/busy_poll.h>
#include <net/vxlan.h>
MODULE_DESCRIPTION(DRV_DESC);
MODULE_AUTHOR("Emulex Corporation");
MODULE_LICENSE("GPL");
/* num_vfs module param is obsolete.
* Use sysfs method to enable/disable VFs.
*/
static unsigned int num_vfs;
module_param(num_vfs, uint, 0444);
MODULE_PARM_DESC(num_vfs, "Number of PCI VFs to initialize");
static ushort rx_frag_size = 2048;
module_param(rx_frag_size, ushort, 0444);
MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data.");
/* Per-module error detection/recovery workq shared across all functions.
* Each function schedules its own work request on this shared workq.
*/
static struct workqueue_struct *be_err_recovery_workq;
static const struct pci_device_id be_dev_ids[] = {
#ifdef CONFIG_BE2NET_BE2
{ PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) },
{ PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) },
#endif /* CONFIG_BE2NET_BE2 */
#ifdef CONFIG_BE2NET_BE3
{ PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) },
{ PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) },
#endif /* CONFIG_BE2NET_BE3 */
#ifdef CONFIG_BE2NET_LANCER
{ PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID3)},
{ PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID4)},
#endif /* CONFIG_BE2NET_LANCER */
#ifdef CONFIG_BE2NET_SKYHAWK
{ PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID5)},
{ PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID6)},
#endif /* CONFIG_BE2NET_SKYHAWK */
{ 0 }
};
MODULE_DEVICE_TABLE(pci, be_dev_ids);
/* Workqueue used by all functions for defering cmd calls to the adapter */
static struct workqueue_struct *be_wq;
/* UE Status Low CSR */
static const char * const ue_status_low_desc[] = {
"CEV",
"CTX",
"DBUF",
"ERX",
"Host",
"MPU",
"NDMA",
"PTC ",
"RDMA ",
"RXF ",
"RXIPS ",
"RXULP0 ",
"RXULP1 ",
"RXULP2 ",
"TIM ",
"TPOST ",
"TPRE ",
"TXIPS ",
"TXULP0 ",
"TXULP1 ",
"UC ",
"WDMA ",
"TXULP2 ",
"HOST1 ",
"P0_OB_LINK ",
"P1_OB_LINK ",
"HOST_GPIO ",
"MBOX ",
"ERX2 ",
"SPARE ",
"JTAG ",
"MPU_INTPEND "
};
/* UE Status High CSR */
static const char * const ue_status_hi_desc[] = {
"LPCMEMHOST",
"MGMT_MAC",
"PCS0ONLINE",
"MPU_IRAM",
"PCS1ONLINE",
"PCTL0",
"PCTL1",
"PMEM",
"RR",
"TXPB",
"RXPP",
"XAUI",
"TXP",
"ARM",
"IPC",
"HOST2",
"HOST3",
"HOST4",
"HOST5",
"HOST6",
"HOST7",
"ECRC",
"Poison TLP",
"NETC",
"PERIPH",
"LLTXULP",
"D2P",
"RCON",
"LDMA",
"LLTXP",
"LLTXPB",
"Unknown"
};
#define BE_VF_IF_EN_FLAGS (BE_IF_FLAGS_UNTAGGED | \
BE_IF_FLAGS_BROADCAST | \
BE_IF_FLAGS_MULTICAST | \
BE_IF_FLAGS_PASS_L3L4_ERRORS)
static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q)
{
struct be_dma_mem *mem = &q->dma_mem;
if (mem->va) {
dma_free_coherent(&adapter->pdev->dev, mem->size, mem->va,
mem->dma);
mem->va = NULL;
}
}
static int be_queue_alloc(struct be_adapter *adapter, struct be_queue_info *q,
u16 len, u16 entry_size)
{
struct be_dma_mem *mem = &q->dma_mem;
memset(q, 0, sizeof(*q));
q->len = len;
q->entry_size = entry_size;
mem->size = len * entry_size;
mem->va = dma_alloc_coherent(&adapter->pdev->dev, mem->size,
&mem->dma, GFP_KERNEL);
if (!mem->va)
return -ENOMEM;
return 0;
}
static void be_reg_intr_set(struct be_adapter *adapter, bool enable)
{
u32 reg, enabled;
pci_read_config_dword(adapter->pdev, PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET,
®);
enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
if (!enabled && enable)
reg |= MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
else if (enabled && !enable)
reg &= ~MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
else
return;
pci_write_config_dword(adapter->pdev,
PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET, reg);
}
static void be_intr_set(struct be_adapter *adapter, bool enable)
{
int status = 0;
/* On lancer interrupts can't be controlled via this register */
if (lancer_chip(adapter))
return;
if (be_check_error(adapter, BE_ERROR_EEH))
return;
status = be_cmd_intr_set(adapter, enable);
if (status)
be_reg_intr_set(adapter, enable);
}
static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted)
{
u32 val = 0;
if (be_check_error(adapter, BE_ERROR_HW))
return;
val |= qid & DB_RQ_RING_ID_MASK;
val |= posted << DB_RQ_NUM_POSTED_SHIFT;
wmb();
iowrite32(val, adapter->db + DB_RQ_OFFSET);
}
static void be_txq_notify(struct be_adapter *adapter, struct be_tx_obj *txo,
u16 posted)
{
u32 val = 0;
if (be_check_error(adapter, BE_ERROR_HW))
return;
val |= txo->q.id & DB_TXULP_RING_ID_MASK;
val |= (posted & DB_TXULP_NUM_POSTED_MASK) << DB_TXULP_NUM_POSTED_SHIFT;
wmb();
iowrite32(val, adapter->db + txo->db_offset);
}
static void be_eq_notify(struct be_adapter *adapter, u16 qid,
bool arm, bool clear_int, u16 num_popped,
u32 eq_delay_mult_enc)
{
u32 val = 0;
val |= qid & DB_EQ_RING_ID_MASK;
val |= ((qid & DB_EQ_RING_ID_EXT_MASK) << DB_EQ_RING_ID_EXT_MASK_SHIFT);
if (be_check_error(adapter, BE_ERROR_HW))
return;
if (arm)
val |= 1 << DB_EQ_REARM_SHIFT;
if (clear_int)
val |= 1 << DB_EQ_CLR_SHIFT;
val |= 1 << DB_EQ_EVNT_SHIFT;
val |= num_popped << DB_EQ_NUM_POPPED_SHIFT;
val |= eq_delay_mult_enc << DB_EQ_R2I_DLY_SHIFT;
iowrite32(val, adapter->db + DB_EQ_OFFSET);
}
void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped)
{
u32 val = 0;
val |= qid & DB_CQ_RING_ID_MASK;
val |= ((qid & DB_CQ_RING_ID_EXT_MASK) <<
DB_CQ_RING_ID_EXT_MASK_SHIFT);
if (be_check_error(adapter, BE_ERROR_HW))
return;
if (arm)
val |= 1 << DB_CQ_REARM_SHIFT;
val |= num_popped << DB_CQ_NUM_POPPED_SHIFT;
iowrite32(val, adapter->db + DB_CQ_OFFSET);
}
static int be_dev_mac_add(struct be_adapter *adapter, const u8 *mac)
{
int i;
/* Check if mac has already been added as part of uc-list */
for (i = 0; i < adapter->uc_macs; i++) {
if (ether_addr_equal(adapter->uc_list[i].mac, mac)) {
/* mac already added, skip addition */
adapter->pmac_id[0] = adapter->pmac_id[i + 1];
return 0;
}
}
return be_cmd_pmac_add(adapter, mac, adapter->if_handle,
&adapter->pmac_id[0], 0);
}
static void be_dev_mac_del(struct be_adapter *adapter, int pmac_id)
{
int i;
/* Skip deletion if the programmed mac is
* being used in uc-list
*/
for (i = 0; i < adapter->uc_macs; i++) {
if (adapter->pmac_id[i + 1] == pmac_id)
return;
}
be_cmd_pmac_del(adapter, adapter->if_handle, pmac_id, 0);
}
static int be_mac_addr_set(struct net_device *netdev, void *p)
{
struct be_adapter *adapter = netdev_priv(netdev);
struct device *dev = &adapter->pdev->dev;
struct sockaddr *addr = p;
int status;
u8 mac[ETH_ALEN];
u32 old_pmac_id = adapter->pmac_id[0];
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
/* Proceed further only if, User provided MAC is different
* from active MAC
*/
if (ether_addr_equal(addr->sa_data, adapter->dev_mac))
return 0;
/* BE3 VFs without FILTMGMT privilege are not allowed to set its MAC
* address
*/
if (BEx_chip(adapter) && be_virtfn(adapter) &&
!check_privilege(adapter, BE_PRIV_FILTMGMT))
return -EPERM;
/* if device is not running, copy MAC to netdev->dev_addr */
if (!netif_running(netdev))
goto done;
/* The PMAC_ADD cmd may fail if the VF doesn't have FILTMGMT
* privilege or if PF did not provision the new MAC address.
* On BE3, this cmd will always fail if the VF doesn't have the
* FILTMGMT privilege. This failure is OK, only if the PF programmed
* the MAC for the VF.
*/
mutex_lock(&adapter->rx_filter_lock);
status = be_dev_mac_add(adapter, (u8 *)addr->sa_data);
if (!status) {
/* Delete the old programmed MAC. This call may fail if the
* old MAC was already deleted by the PF driver.
*/
if (adapter->pmac_id[0] != old_pmac_id)
be_dev_mac_del(adapter, old_pmac_id);
}
mutex_unlock(&adapter->rx_filter_lock);
/* Decide if the new MAC is successfully activated only after
* querying the FW
*/
status = be_cmd_get_active_mac(adapter, adapter->pmac_id[0], mac,
adapter->if_handle, true, 0);
if (status)
goto err;
/* The MAC change did not happen, either due to lack of privilege
* or PF didn't pre-provision.
*/
if (!ether_addr_equal(addr->sa_data, mac)) {
status = -EPERM;
goto err;
}
/* Remember currently programmed MAC */
ether_addr_copy(adapter->dev_mac, addr->sa_data);
done:
eth_hw_addr_set(netdev, addr->sa_data);
dev_info(dev, "MAC address changed to %pM\n", addr->sa_data);
return 0;
err:
dev_warn(dev, "MAC address change to %pM failed\n", addr->sa_data);
return status;
}
/* BE2 supports only v0 cmd */
static void *hw_stats_from_cmd(struct be_adapter *adapter)
{
if (BE2_chip(adapter)) {
struct be_cmd_resp_get_stats_v0 *cmd = adapter->stats_cmd.va;
return &cmd->hw_stats;
} else if (BE3_chip(adapter)) {
struct be_cmd_resp_get_stats_v1 *cmd = adapter->stats_cmd.va;
return &cmd->hw_stats;
} else {
struct be_cmd_resp_get_stats_v2 *cmd = adapter->stats_cmd.va;
return &cmd->hw_stats;
}
}
/* BE2 supports only v0 cmd */
static void *be_erx_stats_from_cmd(struct be_adapter *adapter)
{
if (BE2_chip(adapter)) {
struct be_hw_stats_v0 *hw_stats = hw_stats_from_cmd(adapter);
return &hw_stats->erx;
} else if (BE3_chip(adapter)) {
struct be_hw_stats_v1 *hw_stats = hw_stats_from_cmd(adapter);
return &hw_stats->erx;
} else {
struct be_hw_stats_v2 *hw_stats = hw_stats_from_cmd(adapter);
return &hw_stats->erx;
}
}
static void populate_be_v0_stats(struct be_adapter *adapter)
{
struct be_hw_stats_v0 *hw_stats = hw_stats_from_cmd(adapter);
struct be_pmem_stats *pmem_sts = &hw_stats->pmem;
struct be_rxf_stats_v0 *rxf_stats = &hw_stats->rxf;
struct be_port_rxf_stats_v0 *port_stats =
&rxf_stats->port[adapter->port_num];
struct be_drv_stats *drvs = &adapter->drv_stats;
be_dws_le_to_cpu(hw_stats, sizeof(*hw_stats));
drvs->rx_pause_frames = port_stats->rx_pause_frames;
drvs->rx_crc_errors = port_stats->rx_crc_errors;
drvs->rx_control_frames = port_stats->rx_control_frames;
drvs->rx_in_range_errors = port_stats->rx_in_range_errors;
drvs->rx_frame_too_long = port_stats->rx_frame_too_long;
drvs->rx_dropped_runt = port_stats->rx_dropped_runt;
drvs->rx_ip_checksum_errs = port_stats->rx_ip_checksum_errs;
drvs->rx_tcp_checksum_errs = port_stats->rx_tcp_checksum_errs;
drvs->rx_udp_checksum_errs = port_stats->rx_udp_checksum_errs;
drvs->rxpp_fifo_overflow_drop = port_stats->rx_fifo_overflow;
drvs->rx_dropped_tcp_length = port_stats->rx_dropped_tcp_length;
drvs->rx_dropped_too_small = port_stats->rx_dropped_too_small;
drvs->rx_dropped_too_short = port_stats->rx_dropped_too_short;
drvs->rx_out_range_errors = port_stats->rx_out_range_errors;
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_filtered =
port_stats->rx_address_filtered +
port_stats->rx_vlan_filtered;
drvs->rx_alignment_symbol_errors =
port_stats->rx_alignment_symbol_errors;
drvs->tx_pauseframes = port_stats->tx_pauseframes;
drvs->tx_controlframes = port_stats->tx_controlframes;
if (adapter->port_num)
drvs->jabber_events = rxf_stats->port1_jabber_events;
else
drvs->jabber_events = rxf_stats->port0_jabber_events;
drvs->rx_drops_no_pbuf = rxf_stats->rx_drops_no_pbuf;
drvs->rx_drops_no_erx_descr = rxf_stats->rx_drops_no_erx_descr;
drvs->forwarded_packets = rxf_stats->forwarded_packets;
drvs->rx_drops_mtu = rxf_stats->rx_drops_mtu;
drvs->rx_drops_no_tpre_descr = rxf_stats->rx_drops_no_tpre_descr;
drvs->rx_drops_too_many_frags = rxf_stats->rx_drops_too_many_frags;
adapter->drv_stats.eth_red_drops = pmem_sts->eth_red_drops;
}
static void populate_be_v1_stats(struct be_adapter *adapter)
{
struct be_hw_stats_v1 *hw_stats = hw_stats_from_cmd(adapter);
struct be_pmem_stats *pmem_sts = &hw_stats->pmem;
struct be_rxf_stats_v1 *rxf_stats = &hw_stats->rxf;
struct be_port_rxf_stats_v1 *port_stats =
&rxf_stats->port[adapter->port_num];
struct be_drv_stats *drvs = &adapter->drv_stats;
be_dws_le_to_cpu(hw_stats, sizeof(*hw_stats));
drvs->pmem_fifo_overflow_drop = port_stats->pmem_fifo_overflow_drop;
drvs->rx_priority_pause_frames = port_stats->rx_priority_pause_frames;
drvs->rx_pause_frames = port_stats->rx_pause_frames;
drvs->rx_crc_errors = port_stats->rx_crc_errors;
drvs->rx_control_frames = port_stats->rx_control_frames;
drvs->rx_in_range_errors = port_stats->rx_in_range_errors;
drvs->rx_frame_too_long = port_stats->rx_frame_too_long;
drvs->rx_dropped_runt = port_stats->rx_dropped_runt;
drvs->rx_ip_checksum_errs = port_stats->rx_ip_checksum_errs;
drvs->rx_tcp_checksum_errs = port_stats->rx_tcp_checksum_errs;
drvs->rx_udp_checksum_errs = port_stats->rx_udp_checksum_errs;
drvs->rx_dropped_tcp_length = port_stats->rx_dropped_tcp_length;
drvs->rx_dropped_too_small = port_stats->rx_dropped_too_small;
drvs->rx_dropped_too_short = port_stats->rx_dropped_too_short;
drvs->rx_out_range_errors = port_stats->rx_out_range_errors;
drvs->rx_dropped_header_too_small =
port_stats->rx_dropped_header_too_small;
drvs->rx_input_fifo_overflow_drop =
port_stats->rx_input_fifo_overflow_drop;
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;
drvs->tx_pauseframes = port_stats->tx_pauseframes;
drvs->tx_controlframes = port_stats->tx_controlframes;
drvs->tx_priority_pauseframes = port_stats->tx_priority_pauseframes;
drvs->jabber_events = port_stats->jabber_events;
drvs->rx_drops_no_pbuf = rxf_stats->rx_drops_no_pbuf;
drvs->rx_drops_no_erx_descr = rxf_stats->rx_drops_no_erx_descr;
drvs->forwarded_packets = rxf_stats->forwarded_packets;
drvs->rx_drops_mtu = rxf_stats->rx_drops_mtu;
drvs->rx_drops_no_tpre_descr = rxf_stats->rx_drops_no_tpre_descr;
drvs->rx_drops_too_many_frags = rxf_stats->rx_drops_too_many_frags;
adapter->drv_stats.eth_red_drops = pmem_sts->eth_red_drops;
}
static void populate_be_v2_stats(struct be_adapter *adapter)
{
struct be_hw_stats_v2 *hw_stats = hw_stats_from_cmd(adapter);
struct be_pmem_stats *pmem_sts = &hw_stats->pmem;
struct be_rxf_stats_v2 *rxf_stats = &hw_stats->rxf;
struct be_port_rxf_stats_v2 *port_stats =
&rxf_stats->port[adapter->port_num];
struct be_drv_stats *drvs = &adapter->drv_stats;
be_dws_le_to_cpu(hw_stats, sizeof(*hw_stats));
drvs->pmem_fifo_overflow_drop = port_stats->pmem_fifo_overflow_drop;
drvs->rx_priority_pause_frames = port_stats->rx_priority_pause_frames;
drvs->rx_pause_frames = port_stats->rx_pause_frames;
drvs->rx_crc_errors = port_stats->rx_crc_errors;
drvs->rx_control_frames = port_stats->rx_control_frames;
drvs->rx_in_range_errors = port_stats->rx_in_range_errors;
drvs->rx_frame_too_long = port_stats->rx_frame_too_long;
drvs->rx_dropped_runt = port_stats->rx_dropped_runt;
drvs->rx_ip_checksum_errs = port_stats->rx_ip_checksum_errs;
drvs->rx_tcp_checksum_errs = port_stats->rx_tcp_checksum_errs;
drvs->rx_udp_checksum_errs = port_stats->rx_udp_checksum_errs;
drvs->rx_dropped_tcp_length = port_stats->rx_dropped_tcp_length;
drvs->rx_dropped_too_small = port_stats->rx_dropped_too_small;
drvs->rx_dropped_too_short = port_stats->rx_dropped_too_short;
drvs->rx_out_range_errors = port_stats->rx_out_range_errors;
drvs->rx_dropped_header_too_small =
port_stats->rx_dropped_header_too_small;
drvs->rx_input_fifo_overflow_drop =
port_stats->rx_input_fifo_overflow_drop;
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;
drvs->tx_pauseframes = port_stats->tx_pauseframes;
drvs->tx_controlframes = port_stats->tx_controlframes;
drvs->tx_priority_pauseframes = port_stats->tx_priority_pauseframes;
drvs->jabber_events = port_stats->jabber_events;
drvs->rx_drops_no_pbuf = rxf_stats->rx_drops_no_pbuf;
drvs->rx_drops_no_erx_descr = rxf_stats->rx_drops_no_erx_descr;
drvs->forwarded_packets = rxf_stats->forwarded_packets;
drvs->rx_drops_mtu = rxf_stats->rx_drops_mtu;
drvs->rx_drops_no_tpre_descr = rxf_stats->rx_drops_no_tpre_descr;
drvs->rx_drops_too_many_frags = rxf_stats->rx_drops_too_many_frags;
adapter->drv_stats.eth_red_drops = pmem_sts->eth_red_drops;
if (be_roce_supported(adapter)) {
drvs->rx_roce_bytes_lsd = port_stats->roce_bytes_received_lsd;
drvs->rx_roce_bytes_msd = port_stats->roce_bytes_received_msd;
drvs->rx_roce_frames = port_stats->roce_frames_received;
drvs->roce_drops_crc = port_stats->roce_drops_crc;
drvs->roce_drops_payload_len =
port_stats->roce_drops_payload_len;
}
}
static void populate_lancer_stats(struct be_adapter *adapter)
{
struct be_drv_stats *drvs = &adapter->drv_stats;
struct lancer_pport_stats *pport_stats = pport_stats_from_cmd(adapter);
be_dws_le_to_cpu(pport_stats, sizeof(*pport_stats));
drvs->rx_pause_frames = pport_stats->rx_pause_frames_lo;
drvs->rx_crc_errors = pport_stats->rx_crc_errors_lo;
drvs->rx_control_frames = pport_stats->rx_control_frames_lo;
drvs->rx_in_range_errors = pport_stats->rx_in_range_errors;
drvs->rx_frame_too_long = pport_stats->rx_frames_too_long_lo;
drvs->rx_dropped_runt = pport_stats->rx_dropped_runt;
drvs->rx_ip_checksum_errs = pport_stats->rx_ip_checksum_errors;
drvs->rx_tcp_checksum_errs = pport_stats->rx_tcp_checksum_errors;
drvs->rx_udp_checksum_errs = pport_stats->rx_udp_checksum_errors// SPDX-License-Identifier: GPL-2.0-only
drvs->rx_dropped_tcp_length =
pport_stats->rx_dropped_invalid_tcp_length;
drvs->rx_dropped_too_small = pport_stats->rx_dropped_too_small;
drvs->rx_dropped_too_short = pport_stats->rx_dropped_too_short;
drvs->rx_out_range_errors = pport_stats->rx_out_of_range_errors;
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-> *Copyright (C) 2005 - 2016 Broadcom
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 = *
drvs->tx_pauseframes = pport_stats->tx_pause_frames_lo;
drvs-tx_controlframes = pport_stats->tx_control_frames_lo;
drvs->jabber_events = pport_stats->rx_jabbers;
drvs->forwarded_packets = linux-@.java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
_ = pport_stats->rx_drops_mtu_lo;
drvs->rx_drops_too_many_frags =
MODULE_AUTHOR(E )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}
num_vfs
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
# (x x& x)java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Range [1, 7) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [29, 5) out of bounds for length 31
u32 newacc = hi(*acc) + val;
if
newacc += 65536;
WRITE_ONCE(*acc, newacc);
}
static void populate_erx_statsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
iCONFIG_BE2NET_BE2
{
if (BEx_chip()
rx_stats(rxo)->rx_drops_no_frags = erx_stat;
else
/* below erx HW counter can actually wrap around after
* 65535 Driver 32bit value
*/
tsr)>java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
(;
}
oid struct be_adapteradapter)
{
struct be_erx_stats_v2;
struct be_rx_obj *rxo;
int i;
u32 erx_stat;
if (lancer_chip(dapter))
populate_lancer_stats(adapter);
}static struct workqueue_struct *be_wq;
if (BE2_chip(
static const char const ] = {
"PU"java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
/* for BE3 */
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 11
TXUL
populate_be_v2_stats(;
/* erx_v2 is longer than v0, v1. use v2 for v0, v1 access */
rx_queuesa, rxo,i) java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
}
/* UE Status High CSR */
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
",
static void be_get_stats64PCTL1,
"MEM,
{
structbe_adapter * =netdev_privn;
struct be_drv_stats *drvs = &adapterTXPB",
structbe_rx_obj *xojava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
be_tx_obj
java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 11
unsignedint start;
int i;
for_all_rx_queues(adapter, rxo, i) {
const struct be_rx_stats *rx_stats = rx_stats(rxo);
do java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 38
start =u64_stats_fetch_begin&x_stats-s);
-v N;
bytes = rx_stats}
} while (java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
stats->rx_packets += pkts;
stats->rx_bytes + entry_size)
stats->java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 0
q->len=len
rx_stats(rxo)->rx_drops_no_frags;
}
for_all_tx_queues( mem->size = len* entry_size;
const struct be_tx_stats *tx_stats = mem>a=dma_alloc_coherent&>dev--size
do {
static void s *dapter,bool java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
pkts = tx_stats(txo)->tx_pkts;
bytes = tx_stats(txo)->tx_bytes;
⪚
stats->x_packets + ktsjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
statstx_bytes bytes;
}
/* bad pkts received */
stats->rx_errors =drvs- +
drvs> +
drvs-pci_write_config_dword-,
-> java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
drvs-rx_frame_too_long +
drvs->rx_dropped_too_small +
drvs-rx_dropped_header_too_small +
drvs->rx_dropped_tcp_length +
drvs->java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
/* detailed rx errors */ return
> -java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 53
drvs java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 42
drvs>x_frame_too_longjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
statsvoid be_txq_notify( be_adapter *adapter, tructbe_tx_obj *,
/* frame alignment errors */
stats->rx_frame_errors = drvs- u16 posted)
/* receiver fifo overrun */
/* drops_no_pbuf is no per i/f, it's per BE card */
stats->rx_fifo_errors
drvs->
drvs;
}
void be_link_status_update
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
struct net_device *netdev = adapter- u32 eq_delay_mult_encjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
if (!(adapter->flags & java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
-flags |=BE_FLAGS_LINK_STATUS_INIT
}
if (ink_status)
netif_carrier_on(netdev);
else
netif_carrier_off(netdev);
netdev_info(netdev, "val |= eq_delay_mult_enc< java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}
static int java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
if (kb-encapsulation)
return skb_inner_tcp_all_headers(skb);
skb_tcp_all_headers(kb)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
}
static void be_tx_stats_update(struct | <DB_CQ_REARM_SHIFT
{
struct be_tx_stats *stats
static intbe_dev_mac_adds *dapter, constu8 *)
/* Account for headers which get duplicated in TSO pkt */
i=; -java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 41
&tats-sync);
stats-
stats->tx_bytes += skb->len + dup_hdr_len;
stats->tx_pkts += tx_pkts;
be_cmd_pmac_addadapter,mac, adapter-i,
java.lang.StringIndexOutOfBoundsException: Range [30, 7) out of bounds for length 42
u64_stats_update_end(s-sync)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* Returns number of WRBs needed for the skb */
u32java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 43
{ intbe_mac_addr_set(tructnet_device* *)
/* +1 for the header wrb */
) + skb_shinfo((kb)->nr_fragsjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
}
static inline void wrb_fill(struct be_eth_wrb *wrb, u64 addr, int len)
{
wrb-frag_pa_hi= cpu_to_le32(upper_32_bits(ddr));
wrb-> (();
->rag_len (len & ETH_WRB_FRAG_LEN_MASK)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
wrb->rsvd0 = 0;
}
/* A dummy wrb is just all zeros. Using a separate routine for dummy-wrb
*and shiftmask operations in (.
*/
static void wrb_fill_dummy(java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 57
{
wrb->frag_pa_hi = 0;
wrb->frag_pa_lo = 0;
wrbwrb>rag_len= ;
wrb>svd0
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [29, 15) out of bounds for length 29
{
u8 vlan_prio;
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
vlan_tag = skb_vlan_tag_get(skb);
vlan_prio = skb_vlan_tag_get_prio(skb);
/* If vlan priority provided by OS is NOT in available bmap */
if (!(adapter->vlan_prio_bmapthe java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 23
= a,(u8)ddr>)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
adapter->recommended_prio_bits;
return vlan_tag;
}
/* Used only for IP tunnel packets */
java.lang.StringIndexOutOfBoundsException: Range [40, 6) out of bounds for length 50
{
return (inner_ip_hdr(skb)->version == 4) ?
inner_ip_hdr(skb)->MAC only after
}
static u16 skb_ip_proto(struct sk_buff *skb)
{
return (ip_hdr(skb adapter->f_handle0;
f(tatus)
}
static be_is_txq_full(truct *java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
{
return atomic_read(&txo->q.used) + or t pre-java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
static inline bool be_can_txq_wake(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 18
{
return atomic_read(&txo->q ajava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticinline be_is_tx_compl_pending(truct *xo)
{
return atomic_read(&txo->q.used) > txo->pend_wrb_cnt dev MACaddress to% n, -s;
}
static void be_get_wrb_params_from_skb
struct voidvoid *s *dapter)
java.lang.StringIndexOutOfBoundsException: Range [38, 33) out of bounds for length 63
{
java.lang.StringIndexOutOfBoundsException: Range [38, 11) out of bounds for length 11
if (skb_is_gso(skb){
BE_WRB_F_SET(wrb_params-> struct be_cmd_resp_get_stats_v2 java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 63
wrb_params->lso_mss = java.lang.StringIndexOutOfBoundsException: Range [24, 34) out of bounds for length 1
if((skb & !a)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
BE_WRB_F_SET(> , java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}else (kb>= java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 49
if ( struct java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 63
BE_WRB_F_SET }else {
proto= s)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} else {
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 1
}
if (proto == IPPROTO_TCP)
BE_WRB_F_SET(wrb_params->features, TCPCS, 1);
elseif (= IPPROTO_UDPjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
(rb_params>eatures UDPCS,)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}
if (skb_vlan_tag_present(skb)) {
BE_WRB_F_SET(wrb_params- java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 49
wrb_params->vlan_tag = drvs-r=java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 53
}
BE_WRB_F_SET>x_frame_too_long =port_stats->rx_frame_too_long;
}
static void wrb_fill_hdr(struct be_adapter *adapter,
struct *,
struct be_wrb_params*java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
structsk_buff*java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
{
memset( 0 sizeof*);
SET_TX_WRB_HDR_BITS(crc, hdr,
BE_WRB_F_GET(wrb_params->features, -java.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 61
(,java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
wrb_paramsf,);
SET_TX_WRB_HDR_BITS(tcpcs, hdr,
wrb_params-f TCPCS);
->tx_pauseframes port_stats>x_pauseframes;
BE_WRB_F_GET(wrb_params->features, UDPCS));
SET_TX_WRB_HDR_BITSlso java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
SET_TX_WRB_HDR_BITS(lso6, hdr,
_params-features, LSO6));
SET_TX_WRB_HDR_BITS(lso_mss, hdr, wrb_params->lso_mss);
/* Hack to skip HW VLAN tagging needs evt = 1, compl = 0. When this
* hack is not needed, the evt bit is set while ringing DB.
*/
SET_TX_WRB_HDR_BITS(event, hdr,
BE_WRB_F_GET(wrb_params->features, VLAN_SKIP_HW));
SET_TX_WRB_HDR_BITS(vlan, hdr,
BE_WRB_F_GET(wrb_params->features, VLAN));
SET_TX_WRB_HDR_BITS(vlan_tag, hdr, wrb_params->vlan_tag);
SET_TX_WRB_HDR_BITS(num_wrb, hdr, skb_wrb_cnt(skb));
SET_TX_WRB_HDR_BITS(len, hdr, skb->len);
SET_TX_WRB_HDR_BITS(mgmt, hdr,
BE_WRB_F_GET(wrb_params->features, OS2BMC));
}
static void unmap_tx_frag(struct drvs->rx_drops_no_erx_descr = rxf_stats
)
{
dma_addr_t ;
= le32_to_cpuwrb-rag_len;
dma= u64)e32_to_cpu(wrb->frag_pa_hi) << 32 |
(u64)le32_to_cpu(wrb->frag_pa_lo);
if (frag_len) {
if (unmap_single)
dma_unmap_single(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
else
(dev ,DMA_TO_DEVICE);
}
}
/* Grab a WRB header for xmit */
java.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 51
{
java.lang.StringIndexOutOfBoundsException: Range [23, 4) out of bounds for length 24
queue_head_inc(&txo->q);
return head;
}
/* Set up the WRB header for xmit */
static-r java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 53
rx_udp_checksum_errjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
drvs> >x_dropped_too_short;
structsk_buff *,u16 head
{
u32 num_frags =skb_wrb_cnt(kb;
struct be_queue_info *txq = &txo->q;
struct be_eth_hdr_wrb *hdr = queue_index_node(txq, head);
wrb_fill_hdr(adapter, hdr, wrb_params, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 36
be_dws_cpu_to_le(hdr, sizeof(*hdr));
BUG_ON(txo->sent_skb_list-rx_alignment_symbol_errors java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
txo->sent_skb_list[head] = skb;
txo->last_req_hdr = head drvs-tx_pauseframes port_stats->tx_pauseframes;
java.lang.StringIndexOutOfBoundsException: Range [34, 11) out of bounds for length 35
txo->last_req_wrb_cnt = num_frags;
txo->pend_wrb_cnt += num_frags;>abber_events =port_stats-jabber_events;
}
/* Setup a WRB fragment (buffer descriptor) for xmit */
static void be_tx_setup_wrb_frag->forwarded_packets rjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 56
len)
{
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 24
txq= &xo>;
wrb = java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1
wrb_fill(wrb, ,len);
queue_head_inc(txqjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 50
/* Bring the queue back to the state it was in before be_xmit_enqueue() routinejava.lang.StringIndexOutOfBoundsException: Range [40, 28) out of bounds for length 42
* was invoked. -java.lang.StringIndexOutOfBoundsException: Range [33, 30) out of bounds for length 69
*WRBs currentpacket unmapped.Invoked tx java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
*/
static(be_adapter *java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
struct be_tx_obj->java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 63
u32-rx_out_range_errors java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 61
{
struct device *dev;
struct *rbjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
struct be_queue_info *txqerrors=
&java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 27
txq->head = head;
/* skip the first wrb (hdr); it's not mapped */jjava.lang.StringIndexOutOfBoundsException: Range [23, 20) out of bounds for length 49
queue_head_inc(txq);
while (copied) {
wrb = queue_head_node(txq);
unmap_tx_frag(dev, wrb, map_single);
map_single = false;
copied -= le32_to_cpu>java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 56
queue_head_inc>java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 68
}
txq-head head;
}
* given transmit routine allocates WRBsfor
struct *port_stats = pport_stats_from_cmd(adapter);
* of WRBsused bythe .
*/
static s be_adapter *adapter, struct be_tx_obj *txo,
struct drvs->rx_pause_framespport_stats->x_pause_frames_lo;
struct be_wrb_params *drvs->rx_crc_errors = pport_stats->rx_;
{
copied= , java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 47
struct device *dev = &adapter->pdev->dev;
bool map_single = java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 30
u32 head;
dma_addr_t >rx_out_range_errors >java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
int;
head = drvs->rx_input_fifo_overflow_d = pport_stats->x_fifo_overflow;
if (skb-drvs-rx_address_filtered =
len = skb_headlen(skb);
busaddr = dma_map_single(dev, skb->data, len, DMA_TO_DEVICE);
drvs>java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 69
goto dma_err;
map_single = true;
be_tx_setup_wrb_frag(txo, drvs>tx_pauseframes = pport_stats->tx_pause_frames_lo;
copied += len;
}
for( 0; i<(kb-nr_frags +) {
const skb_frag_t * drvs->=pport_stats-n
len=f)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
busaddr = skb_frag_dma_mapjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if (dma_mapping_error(dev, busaddr))
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
( len
wrapped val<lo(acc)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
pter java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 58
be_tx_stats_update(txo, skb);
return wrb_cnt;
dma_err:
adapter>dma_map_errors+java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
be_xmit_restore(adapter, txo, *65535 a32bitvalue
return 0;
}
accumulate_16bit_val(&rx_stats(rxo)-rx_drops_no_frags,
{
return adapter->flags &java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
staticu32java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
struct}else{
struct be_wrb_params
*rb_params)
{
insert_vlan java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
u16 vlan_tag = 0;
skb = skb_share_check(skb, GFP_ATOMIC);
if (unlikely(!skb))
return te_be_v2_stats(dapter;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
vlan_tag = for_all_rx_queuesfor_all_rx_queues(adapter, ,i){
insert_vlan = true;
}
qjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 52
if (}
vlan_tag = adapter-(structnet_device*java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 22
}
/* f/w workaround to set skip_hw_vlan = 1, informs the F/W to
* skip VLAN insertion
*/
BE_WRB_F_SET(int;
}
if int ;
skb
vlan_tag);
if (unlikely(!skb))
const struct be_rx_stats *java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
__vlan_hwaccel_clear_tag(skb);
}
/* Insert the outer VLAN, if any */
(-qnq_vid java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
vlan_tag = adapter->qnq_vid;
skb = vlan_insert_tag_set_proto(skb, htons(ETH_P_8021Q),
vlan_tag);
nlikely(!skb))
return skb;
BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1);
}
return skb;
}
static bool be_ipv6_exthdr_check(struct sk_buff *skb)
{
struct ethhdr *eh = (struct ethhdr *)skb->data;
u16 offset = ETH_HLEN;
if (eh->h_proto == htons(ETH_P_IPV6)) {
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
offset += sizeof(struct ipv6hdr);
if (ip6h->nexthdr != NEXTHDR_TCP &&
ip6h->nexthdr != NEXTHDR_UDP) {
struct ipv6_opt_hdr *ehdr =
(struct ipv6_opt_hdr *)(skb->data + offset);
/* offending pkt: 2nd byte following IPv6 hdr is 0xff */
if (ehdr->hdrlen == 0xff)
return true;
}
}
pkts=tx_stats(txo)->tx_pkts;
}
static int be_vlan_tag_tx_chk(struct be_adapter *adapter, struct sk_buff *skb)
{
return()| -vid || dapter>nq_vidjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
}
static int be_ipv6_tx_stall_chk(struct be_adapter *adapter, struct sk_buff *skb)
{
return BE3_chip(adapter) && be_ipv6_exthdr_check(skb);
}
static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
struct sk_buff *skb,
struct be_wrb_params
*wrb_params)
{
struct vlan_ethhdr *veh = skb_vlan_eth_hdr(skb);
unsigned int eth_hdr_len;
struct iphdr *ip;
/* For padded packets, BE HW modifies tot_len field in IP header
* incorrecly when VLAN tag is inserted by HW.
* For padded packets, Lancer computes incorrect checksum.
*/
eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ?
VLAN_ETH_HLEN : ETH_HLEN;
if (skb->len <= 60 &&
(lancer_chip(adapter) || BE3_chip(adapter) ||
skb_vlan_tag_present(skb)) && is_ipv4_pkt(skb)) {
ip = (struct iphdr *)ip_hdr(skb);
if (unlikely(pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len))))
goto tx_drop;
}
/* If vlan tag is already inlined in the packet, skip HW VLAN
* tagging in pvid-tagging mode
*/
if (be_pvid_tagging_enabled(adapter) &&
veh->h_vlan_proto == htons(ETH_P_8021Q))
BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1);
/* HW has a bug wherein it will calculate CSUM for VLAN
* pkts even though it is disabled.
* Manually insert VLAN in pkt.
*/
if (skb->ip_summed != CHECKSUM_PARTIAL &&
skb_vlan_tag_present(skb)) {
skb = be_insert_vlan_in_pkt(adapter, skb, wrb_params);
if (unlikely(!skb))
goto err;
}
/* HW may lockup when VLAN HW tagging is requested on
* certain ipv6 packets. Drop such pkts if the HW workaround to
* skip HW tagging is not enabled by FW.
*/
if (unlikely(be_ipv6_tx_stall_chk(adapter, skb) &&
(adapter->pvid || adapter->qnq_vid) &&
!qnq_async_evt_rcvd(adapter)))
goto tx_drop;
/* Manual VLAN tag insertion to prevent:
* ASIC lockup when the ASIC inserts VLAN tag into
* certain ipv6 packets. Insert VLAN tags in driver,
* and set event, completion, vlan bits accordingly
* in the Tx WRB.
*/
if (be_ipv6_tx_stall_chk(adapter, skb) &&
be_vlan_tag_tx_chk(adapter, skb)) {
skb = be_insert_vlan_in_pkt(adapter, skb, wrb_params);
if (unlikely(!skb))
goto err;
}
return skb;
tx_drop:
dev_kfree_skb_any(skb);
err:
return NULL;
}
static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
struct sk_buff *skb,
struct be_wrb_params *wrb_params)
{
int err;
/* Lancer, SH and BE3 in SRIOV mode have a bug wherein
* packets that are 32b or less may cause a transmit stall
* on that port. The workaround is to pad such packets
* (len <= 32 bytes) to a minimum length of 36b.
*/
if (skb->len <= 32) {
if (skb_put_padto(skb, 36))
return NULL;
}
if (BEx_chip(adapter) || lancer_chip(adapter)) {
skb = be_lancer_xmit_workarounds(adapter, skb, wrb_params);
if (!skb)
return NULL;
}
/* The stack can send us skbs with length greater than
* what the HW can handle. Trim the extra bytes.
*/
WARN_ON_ONCE(skb->len > BE_MAX_GSO_SIZE);
err = pskb_trim(skb, BE_MAX_GSO_SIZE);
WARN_ON(err);
return skb;
}
static void be_xmit_flush(struct be_adapter *adapter, struct be_tx_obj *txo)
{
struct be_queue_info *txq = &txo->q;
struct be_eth_hdr_wrb *hdr = queue_index_node(txq, txo->last_req_hdr);
/* Mark the last request eventable if it hasn't been marked already */
if (!(hdr->dw[2] & cpu_to_le32(TX_HDR_WRB_EVT)))
hdr->dw[2] |= cpu_to_le32(TX_HDR_WRB_EVT | TX_HDR_WRB_COMPL);
/* compose a dummy wrb if there are odd set of wrbs to notify */
if (!lancer_chip(adapter) && (txo->pend_wrb_cnt & 1)) {
wrb_fill_dummy(queue_head_node(txq));
queue_head_inc(txq);
atomic_inc(&txq->used);
txo->pend_wrb_cnt++;
hdr->dw[2] &= ~cpu_to_le32(TX_HDR_WRB_NUM_MASK <<
TX_HDR_WRB_NUM_SHIFT);
hdr->dw[2] |= cpu_to_le32((txo->last_req_wrb_cnt + 1) <<
TX_HDR_WRB_NUM_SHIFT);
}
be_txq_notify(adapter, txo, txo->pend_wrb_cnt);
txo->pend_wrb_cnt = 0;
}
/* OS2BMC related */
#define DHCP_CLIENT_PORT 68
#define DHCP_SERVER_PORT 67
#define NET_BIOS_PORT1 137
#define NET_BIOS_PORT2 138
#define DHCPV6_RAS_PORT 547
#define is_mc_allowed_on_bmc(adapter, eh) \
(!is_multicast_filt_enabled(adapter) && \
is_multicast_ether_addr(eh->h_dest) && \
!is_broadcast_ether_addr(eh->h_dest))
#define is_bc_allowed_on_bmc(adapter, eh) \
(!is_broadcast_filt_enabled(adapter) && \
is_broadcast_ether_addr(eh->h_dest))
#define is_arp_allowed_on_bmc(adapter, skb) \
(is_arp(skb) && is_arp_filt_enabled(adapter))
#define is_arp(skb) (skb->protocol == htons(ETH_P_ARP))
#define is_arp_filt_enabled(adapter) \
(adapter->bmc_filt_mask & (BMC_FILT_BROADCAST_ARP))
#define is_dhcp_client_filt_enabled(adapter) \
(adapter->bmc_filt_mask & BMC_FILT_BROADCAST_DHCP_CLIENT)
#define is_dhcp_srvr_filt_enabled(adapter) \
(adapter->bmc_filt_mask & BMC_FILT_BROADCAST_DHCP_SERVER)
#define is_nbios_filt_enabled(adapter) \
(adapter->bmc_filt_mask & BMC_FILT_BROADCAST_NET_BIOS)
#define is_ipv6_na_filt_enabled(adapter) \
(adapter->bmc_filt_mask & \
BMC_FILT_MULTICAST_IPV6_NEIGH_ADVER)
#define is_ipv6_ra_filt_enabled(adapter) \
(adapter->bmc_filt_mask & BMC_FILT_MULTICAST_IPV6_RA)
#define is_ipv6_ras_filt_enabled(adapter) \
(adapter->bmc_filt_mask & BMC_FILT_MULTICAST_IPV6_RAS)
#define is_broadcast_filt_enabled(adapter) \
(adapter->bmc_filt_mask & BMC_FILT_BROADCAST)
#define is_multicast_filt_enabled(adapter) \
(adapter->bmc_filt_mask & BMC_FILT_MULTICAST)
static bool be_send_pkt_to_bmc(struct be_adapter *adapter,
struct sk_buff **skb)
{
struct ethhdr *eh = (struct ethhdr *)(*skb)->data;
bool os2bmc = false;
if (!be_is_os2bmc_enabled(adapter))
goto done;
if (!is_multicast_ether_addr(eh->h_dest))
goto done;
if (is_mc_allowed_on_bmc(adapter, eh) ||
is_bc_allowed_on_bmc(adapter, eh) ||
is_arp_allowed_on_bmc(adapter, (*skb))) {
os2bmc = true;
goto done;
}
if ((*skb)->protocol == htons(ETH_P_IPV6)) {
struct ipv6hdr *hdr = ipv6_hdr((*skb));
u8 nexthdr = hdr->nexthdr;
if (nexthdr == IPPROTO_ICMPV6) {
struct icmp6hdr *icmp6 = icmp6_hdr((*skb));
switch (icmp6->icmp6_type) {
case NDISC_ROUTER_ADVERTISEMENT:
os2bmc = is_ipv6_ra_filt_enabled(adapter);
goto done;
case NDISC_NEIGHBOUR_ADVERTISEMENT:
os2bmc = is_ipv6_na_filt_enabled(adapter);
goto done;
default:
break;
}
}
}
if (is_udp_pkt((*skb))) {
struct udphdr *udp = udp_hdr((*skb));
switch (ntohs(udp->dest)) {
case DHCP_CLIENT_PORT:
os2bmc = is_dhcp_client_filt_enabled(adapter);
goto done;
case DHCP_SERVER_PORT:
os2bmc = is_dhcp_srvr_filt_enabled(adapter);
goto done;
case NET_BIOS_PORT1:
case NET_BIOS_PORT2:
os2bmc = is_nbios_filt_enabled(adapter);
goto done;
case DHCPV6_RAS_PORT:
os2bmc = is_ipv6_ras_filt_enabled(adapter);
goto done;
default:
break;
}
}
done:
/* For packets over a vlan, which are destined
* to BMC, asic expects the vlan to be inline in the packet.
*/
if (os2bmc)
*skb = be_insert_vlan_in_pkt(adapter, *skb, NULL);
return os2bmc;
}
static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
u16 q_idx = skb_get_queue_mapping(skb);
struct be_tx_obj *txo = &adapter->tx_obj[q_idx];
struct be_wrb_params wrb_params = { 0 };
bool flush = !netdev_xmit_more();
u16 wrb_cnt;
skb = be_xmit_workarounds(adapter, skb, &wrb_params);
if (unlikely(!skb))
goto drop;
be_get_wrb_params_from_skb(adapter, skb, &wrb_params);
wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
if (unlikely(!wrb_cnt))
goto drop_skb;
/* if os2bmc is enabled and if the pkt is destined to bmc,
* enqueue the pkt a 2nd time with mgmt bit set.
*/
if ( -java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
BE_WRB_F_SET(wrb_params.features, OS2BMC, 1);
wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
if (unlikely(!wrb_cnt))
goto drop_skb;
else
skb_get(skb);
}
if (be_is_txq_full(txo)) {
netif_stop_subqueue(netdev, q_idx);
tx_stats()-tx_stops+;
}
if (flush || __netif_subqueue_stopped(netdev, q_idx))
be_xmit_flush(adapter, txo);
return NETDEV_TX_OK;
drop_skb:
dev_kfree_skb_any(skb);
drop:
tx_stats(txo)->tx_drv_drops++;
/* Flush the already enqueued tx requests */
if (flush && txo->pend_wrb_cnt)
be_xmit_flush(adapter, txo);
return NETDEV_TX_OK;
}
static void be_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{
struct be_adapter *adapter = netdev_priv(netdev);
struct device *dev = &adapter->pdev->dev;
struct be_tx_obj *txo;
struct sk_buff *skb;
struct tcphdr *tcphdr;
struct udphdr *udphdr;
u32 *entry;
int status;
int i, j;
for_all_tx_queues(adapter, txo, i) {
dev_info(dev, "TXQ Dump: %d H: %d T: %d used: %d, qid: 0x%x\n",
i, txo->q.head, txo->q.tail,
atomic_read(&txo->q.used), txo->q.id);
entry = txo->q.dma_mem.va;
for (j = 0; j < TX_Q_LEN * 4; j += 4) {
if (entry[j] != 0 || entry[j + 1] != 0 ||
entry[j + 2] != 0 || entry[j + 3] != 0) {
dev_info(dev, "Entry %d 0x%x 0x%x 0x%x 0x%x\n",
j, entry[j], entry[j + 1],
entry[j + 2], entry[j + 3]);
}
}
entry = txo->cq.dma_mem.va;
dev_info(dev, "TXCQ Dump: %d H: %d T: %d used: %d\n",
i, txo->cq.head, txo->cq.tail,
atomic_read(&txo->cq.used));
for (j = 0; j < TX_CQ_LEN * 4; j += 4) {
if (entry[j] != 0 || entry[j + 1] != 0 ||
entry[j + 2] != 0 || entry[j + 3] != 0) {
dev_info(dev, "Entry %d 0x%x 0x%x 0x%x 0x%x\n",
j, entry[j], entry[j + 1],
entry[j + 2], entry[j + 3]);
}
}
for (j = 0; j < TX_Q_LEN; j++) {
if (txo->sent_skb_list[j]) {
skb = struct net_device*etdev >netdev
ip_hdr(kb-p == IPPROTO_TCP) {
tcphdr = tcp_hdr(skb);
dev_info(dev, "TCP source port %d\n",
ntohs(tcphdr->source));
dev_info(dev, "TCP dest port %d\n",
ntohs(tcphdr->dest));
dev_info(dev, netdev);
ntohl(tcphdr->seq));
dev_info(dev, "TCP ack_seq %u\n",
ntohl(tcphdr->ack_seq));
} else if (ip_hdr(skb)->protocol ==
IPPROTO_UDP) {
udphdr = udp_hdr(skb);
dev_info(dev, "UDP source port %d\n",
ntohs(udphdr->source));
dev_info(dev, "UDP dest port %d\n",
ntohs(udphdr->dest));
}
dev_info(dev, "skb[%d] %p len %d proto 0x%x\n",
j, skb, skb->len, skb->protocol);
}
}
}
if (lancer_chip(adapter)) {
dev_info(dev, "Initiating reset due to tx timeout\n");
dev_info(dev, "Resetting adapter\n");
status = lancer_physdev_ctrl(adapter,
PHYSDEV_CONTROL_FW_RESET_MASK);
if (status)
dev_err(dev, "Reset failed .. Reboot server\n");
}
}
static inline bool be_in_all_promisc(struct be_adapter *adapter)
{
return (adapter->if_flags & BE_IF_FLAGS_ALL_PROMISCUOUS) ==
BE_IF_FLAGS_ALL_PROMISCUOUS;
}
static int be_set_vlan_promisc(struct be_adapter *adapter)
{
struct device *dev = &adapter->pdev->dev;
int status;
if (adapter->if_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS)
return 0;
status = be_cmd_rx_filter(adapter, BE_IF_FLAGS_VLAN_PROMISCUOUS, ON);
if (!status) {
dev_info(dev, "Enabled VLAN promiscuous mode\n");
adapter->if_flags |= BE_IF_FLAGS_VLAN_PROMISCUOUS;
} else {
dev_err(dev, "Failed to enable VLAN promiscuous mode\n");
}
return status;
}
static int be_clear_vlan_promisc(struct be_adapter *adapter)
{
struct device *dev = &adapter->pdev->dev;
int status;
status = be_cmd_rx_filter(adapter, BE_IF_FLAGS_VLAN_PROMISCUOUS, OFF);
if (!status) {
dev_info(dev, "Disabling VLAN promiscuous mode\n");
adapter->if_flags &= ~BE_IF_FLAGS_VLAN_PROMISCUOUS;
}
return status;
}
/*
* A max of 64 (BE_NUM_VLANS_SUPPORTED) vlans can be configured in BE.
* If the user configures more, place BE in vlan promiscuous mode.
*/
static int be_vid_config(struct be_adapter *adapter)
{
struct device *dev = &adapter->pdev->dev;
u16 vids[BE_NUM_VLANS_SUPPORTED];
u16 num = 0, i = 0;
int status = 0;
/* No need to change the VLAN state if the I/F is in promiscuous */
if (adapter->netdev->flags & IFF_PROMISC)
return 0;
if (adapter->vlans_added > be_max_vlans(adapter))
return be_set_vlan_promisc(adapter);
if (adapter->if_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {
status = be_clear_vlan_promisc(adapter);
if (status)
return status;
}
/* Construct VLAN Table to give to HW */
for_each_set_bit(i, adapter->vids, VLAN_N_VID)
vids[num++] = cpu_to_le16(i);
status = be_cmd_vlan_config(adapter, adapter->if_handle, vids, num, 0);
if (status) {
dev_err(dev, "Setting HW VLAN filtering failed\n");
/* Set to VLAN promisc mode as setting VLAN filter failed */
if (addl_status(status) == MCC_ADDL_STATUS_INSUFFICIENT_VLANS ||
addl_status(status) ==
MCC_ADDL_STATUS_INSUFFICIENT_RESOURCES)
return be_set_vlan_promisc(adapter);
}
return status;
}
static int be_vlan_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
{
struct be_adapter *adapter = netdev_priv(netdev);
int status = 0;
mutex_lock(&adapter->rx_filter_lock);
/* Packets with VID 0 are always received by Lancer by default */
if (lancer_chip(adapter) && vid == 0)
goto done;
if (test_bit(vid, adapter->vids))
goto done;
set_bit(vid, adapter->vids);
adapter->vlans_added++;
status = be_vid_config(adapter);
done:
mutex_unlock(&adapter->rx_filter_lock);
return status;
}
static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid)
{
struct be_adapter *adapter = netdev_priv(netdev);
int status = 0;
mutex_lock(&adapter->rx_filter_lock);
/* Packets with VID 0 are always received by Lancer by default */
if (lancer_chip(adapter) && vid == 0)
goto done;
if (!test_bit(vid, adapter->vids))
goto done;
clear_bit(vid, adapter->vids);
adapter->vlans_added--;
status = be_vid_config(adapter);
done:
mutex_unlock(&adapter->rx_filter_lock);
return status;
}
static void be_set_all_promisc(struct be_adapter *adapter)
{
be_cmd_rx_filter(adapter, BE_IF_FLAGS_ALL_PROMISCUOUS, ON);
adapter->if_flags |= BE_IF_FLAGS_ALL_PROMISCUOUS;
}
static void be_set_mc_promisc(struct be_adapter *adapter)
{
int status;
if (adapter->if_flags & BE_IF_FLAGS_MCAST_PROMISCUOUS)
return;
status = be_cmd_rx_filter(adapter, BE_IF_FLAGS_MCAST_PROMISCUOUS, ON);
if (!status)
adapter->if_flags |= BE_IF_FLAGS_MCAST_PROMISCUOUS;
}
static void be_set_uc_promisc(struct be_adapter *adapter)
{
int status;
f(dapter->if_flags & BE_IF_FLAGS_PROMISCUOUS)
return;
status = be_cmd_rx_filter(adapter, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [34, 13) out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
void s java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 59
{
int statusjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
if (!(adapter->if_flags & BE_IF_FLAGS_PROMISCUOUS))
return;
status = be_cmd_rx_filter(adapter, BE_IF_FLAGS_PROMISCUOUSstats->x_reqs+;
if (status)
adapter->if_flags &= ~BE_IF_FLAGS_PROMISCUOUS;
}
/* The below 2 functions are the callback args for __dev_mc_sync/dev_uc_sync().
* We use&stats-s;
* add/remove addresses through static skb_wrb_cnt(struct sk_buff skb
* to the uc/mc lists. The entire uc/mc list is programmed in be_set_rx_mode().
*/
static int be_uc_list_update(struct net_device *netdev,
const unsigned char *addr)
{
structwrb>rag_pa_hi=0
adapter->update_uc_list = true;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
}
static vlan_tag;
const unsigned char *addr)
{
struct be_adapter *adapter vlan_prio = skb_vlan_tag_get_prio(skb);
adapter->update_mc_list = true;
return 0;
}
static void be_set_mc_list(struct be_adapter *java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
struct net_device *netdev = adapter->netdev;
struct netdev_hw_addr *ha;
bool mc_promisc = false;
int status;
netif_addr_lock_bh(netdev);
_dev_mc_sync(netdev, be_mc_list_update, be_mc_list_update;
if (netdev->flags & IFF_PROMISC) {
adapter->update_mc_list = false;
} else if ( return (inner_ip_hdr(skb)->version == 4) ?
netdev_mc_count(netdev) > be_max_mc(adapter)) {
/* Enable multicast promisc if num configured exceeds
* hat we support
*/
mc_promisc = true;
adapter->update_mc_list = false;return i-v = ) ?
} else if ( ip_hdr(skb)-protocoliskb)-njava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
/* Update mc-list unconditionally if the iface was previously&xo>q.used)< txo-q.en java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* mc-now out that mode.
*/
adapter->update_mc_list = true ifskb> {
if (adapter->update_mc_list) {
if )
/* cache the mc-list in adapter */
netdev_for_each_mc_addr(ha
ether_addr_copy sjava.lang.StringIndexOutOfBoundsException: Range [30, 25) out of bounds for length 33
i++;
}
-=java.lang.StringIndexOutOfBoundsException: Range [44, 37) out of bounds for length 46
}
netif_addr_unlock_bh(netdev);
if (mc_promisc) {
be_set_mc_promisc(adapter);
} else if (adapter->update_mc_list) {
status = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
if (!status)
adapter->if_flags &tif java.lang.StringIndexOutOfBoundsException: Range [24, 20) out of bounds for length 30
else
for java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 49
- java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
}
}
static void be_clear_mc_list(struct be_adapter *adapter)
{
struct net_device (rb_params>features LSO);
__dev_mc_unsync(netdev, NULL); BE_WRB_F_GET(rb_params-features,LSO6);
be_cmd_rx_filter(adapter, SET_TX_WRB_HDR_BITS(lso_mss, hdr)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
adapter->mc_count = 0;
}
static int be_uc_mac_add(struct be_adapter *adapter, int uc_idx)
{
if (ether_addr_equaljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
adapter->pmac_id[uc_idx + 1] = java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 31
return SET_TX_WRB_HDR_BITSvlan_tag, hdr, java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 3
}
return be_cmd_pmac_add(adapter, adapter->uc_list[uc_idx].mac,
-f_handle,
&adapter->pmac_id[uc_idx + 1], BE_WRB_F_GET(rb_params->features OS2BMC);
}
if (()
{
-= |
return
;
}
staticvoid s be_adapter*
{
struct net_device *netdev = adapter->netdev;
struct netdev_hw_addr *ha;
bool java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
int curr_uc_macs = 0, i;
netif_addr_lock_bh(netdev);
__dev_uc_sync(netdev, be_uc_list_update, be_uc_list_update
if (netdev->flags & IFF_PROMISC) {
adapter->update_uc_list = false;return ;
} else if
uc_promisc svoid (struct be_adapter *,
adapter-update_uc_list struct be_wrb_params *wrb_params,
} else if struct sk_buffhead)
/* Update uc-list unconditionally if the iface was previously
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 45
*/
adapter txo
}
if (adapter->update_uc_list) {
/
i= 0java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
netdev_for_each_uc_addr(ha, netdev) be_tx_setup_wrb_frag(be_tx_obj*xo,dma_addr_t ,
ether_addr_copy(adapter->uc_list
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 37
}
curr_uc_macs = java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 21
}
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 30
if of java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 78
be_set_uc_promisc(adapter);
} else if (adapter->update_uc_list) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
for (i = 0; i < adapter->uc_macs; i++)
be_uc_mac_del(adapter, adapter->pmac_id[java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 20
for (i = 0; i < curr_uc_macs; i++)
be_uc_mac_add(adapter /* Post 1 less than RXQ-len to avoid head being equal to tail,
adapter->()java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
adapter->update_uc_list = false;
}
}
static void be_clear_uc_list(struct be_adapter *java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 22
{
struct net_device*netdev adapter>etdev;
int i;
__dev_uc_unsync(netdev, NULL);
for (i = 0; i < adapter->java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 50
int status
}
static void __be_set_rx_mode(struct be_adapter *adapter =dev - (, ;
{
netdev java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
be_set_all_promisc(java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 8
} else if (be_in_all_promisc java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 57
/* We need to re-program the vlan-list or clear
mode
of java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 25
}
be_set_uc_list(adapter);
(;
vlan_tag java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
static void java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
{
struct
vlan_insert_tag_set_proto(kb, ETH_P_8021Q)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
__be_set_rx_mode(cmd_work->adapter);
kfree(cmd_work) f aapternq_vid) {
}
static int be_set_vf_mac(struct net_deviceif u!kb)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
{
struct be_adapter *adapter = netdev_priv(netdev);
struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf];
int status;
if (!sriov_enabled(adapter))
return -EPERM;
java.lang.StringIndexOutOfBoundsException: Range [45, 3) out of bounds for length 57
return -EINVAL;
*qo
* from active int
*/
return;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if (BEx_chip(adapter) java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 28
be_cmd_pmac_del(adapter, vf_cfg->if_handle, vf_cfg->pmac_id,
vf + 1);
status = java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 11
&vf_cfg->pmac_id, vf + 1);
} else {
status = be_cmd_set_mac(adaptereth_hdr_len= s-p =e_enable_if_filters()
vf + 1);
}
if (status) {
dev_err(&adapter->pdev-> skb_vlan_tag_presents) & is_ipv4_pktskb) {
mac, vf,ely(pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len))))
returnjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 16
/* If vlan tag is already inlined in the packet, skip HW VLAN
ether_addr_copy(vf_cfg->mac_addr, mac);
return 0;
}
static int be_get_vf_config(struct net_device java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 45
struct *)
{
struct be_adapter *adapter = netdev_priv( unlikelyjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf];
!java.lang.StringIndexOutOfBoundsException: Range [27, 19) out of bounds for length 29
return*ASIC ASIC java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 51
if (vf >= java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 46
return -EINVAL;
vi->f= vf
vi->max_tx_rate=vf_cfg>;
vi-> ;
vi->vlan = vf_cfg-java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
struct sk_buff be_xmit_workarounds(struct be_adapter *adapter,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
vi->java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
n ;
}
static int be_set_vf_tvt(struct be_adapter *adapter, int vf, u16 vlan)
{
struct return NULL NULL
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
intif(!kb
int status;
/* Enable Transparent VLAN Tagging */
status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, vf_if_id, 0, 0);
if (status)
return status;
/* Clear pre-programmed VLAN filters on VF if any, if TVT is enabled */
vids[0] = 0;
status = be_cmd_vlan_config(adapter, vf_if_id{
if (!status)
dev_info(&adapter->pdev->dev,
"Cleared guest
if (vf_cfgjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 65
LTMGMT, f+ 1;
!tatusdw[~java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 51
vf_cfg->privileges &= ~BE_PRIV_FILTMGMT;
}
return 0;
}
static int be_clear_vf_tvt(struct java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 27
{
struct be_vf_cfg !java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 42
struct device *dev = &adapterjava.lang.StringIndexOutOfBoundsException: Range [36, 28) out of bounds for length 42
int java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
/* Reset Transparent VLAN Tagging. */
vf_cfg->if_handle, 0, 0 ->bmc_filt_mask&)
if)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Allow VFs to program VLAN filtering */
if (!( (adapter-bmc_filt_mask BMC_FILT_BROADCAST_NET_BIOS
statusdefine ( java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
,java.lang.StringIndexOutOfBoundsException: Range [31, 28) out of bounds for length 34
!) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 43
dev_info(dev, "VF%d: FILTMGMT priv enabled"
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
dev_info(dev
"Disable/re-enable i/f in VM to clear Transparent VLAN tag bool =;
;
}
s
_b java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
{
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 50
* =&java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 49
int
if java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 31
returnEPERM
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
if (vlan_proto
return -EPROTONOSUPPORT if i(){
if (vlan ||
vlan |= qos << VLAN_PRIO_SHIFT}
status = java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 49
} else {
(java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 40
}
if (status)
dev_err(&adapter->pdev->dev,
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
status);
return be_cmd_status(status);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
vf_cfg->vlan_tag = vlan;
0;
}
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 1
, intmax_tx_rate)
{
* netdev_privn)
struct device *devu16q_idx =skb_get_queue_mapping(kb;
int percent_rate, status = 0;
u16 link_speed = 0;
u8 link_status;
if (!sriov_enabled(adapter
return -java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
if
return -EINVAL;
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 59
returnjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
return -EINVAL;
if (!max_tx_rate)
goto config_qos;
status = be_cmd_link_status_query( gotodrop_skb
&link_status,)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
if (status)
goto err u32 vf;
if (!link_status) {
dev_err(ev,"-ratesetting not when is n");
status = -ENETDOWN;
goto err;
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 59
link_speed flush -p
status = -EINVALjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 30
goto errjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* On Skyhawk the QOS setting must be done only as a % value */
percent_rate = link_speed / 100;
if (skyhawk_chip(adapter) && (max_tx_rate % java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 12
"-mustjava.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 6
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 17
status = -EINVAL;
goto err;
}
config_qos:
" %xx x% 0x0%0xx"
if (status)
goto err;
adapter->vf_cfg[vf].tx_rate = max_tx_rate;
return =txo>.ma_memjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
err:
dev_err(dev, "TX-rate j=0; 4 j = 4)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
,)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
return be_cmd_status(status);
}
static intdone
int link_state)
{
struct for (j = 0; j java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 34
int status;
!(adapter))
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 16
(> adapter-njava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
return -EINVAL;
be_cmd_set_logical_link_config(, link_state, )java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 14
dev_err(&adapter->pdev-> (cphdr->ck_seq);
"Link state change on VF java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
dev UDPjava.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 32
}
adapter->java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 5
return 0;
}
static int be_set_vf_spoofchk java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 28
{
struct be_adapter *adapter = netdev_priv(netdev);
struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf];
u8 java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 2
tatus;
if (!sriov_enabled(adapter))
return -EPERM;
if (vf >= adapter->num_vfs)
return -EINVAL;
if (BEx_chip(java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1
return -EOPNOTSUPPi{
if (enable == vf_cfg ;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
be_cmd_set_hsw_configa 0, vf 1 vf_cfg-,
0, spoofchk);
if (status) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
"Spoofchk return status;
return be_cmd_status(status);
}
structjava.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 42
return 0;
}
static void be_aic_update(struct be_aic_obj *aic, u64 rx_pkts, u64 tx_pkts,
now)
{
aic-> ( " * distinguish various types ofV,, )So
aic->tx_reqs_prev = tx_pkts * java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
Amax 64Bjava.lang.StringIndexOutOfBoundsException: Range [45, 38) out of bounds for length 70
}
static int be_get_new_eqd(tructbe_eq_obj * java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 79
{
struct */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
teqd start
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 24
struct be_rx_obj *java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
struct be_tx_obj *txo;
u64
ulong now;
u32 pps, delta;
int i;
c= &dapter-aic_obj[struct dev=&-java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 42
if (!adapter->aic_enabled) (adapter-> > be_max_vlans(adapter)
if ( returnjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 38
aic->jiffies = 0;
eqd = aic->et_eqd;
return return st ;
}
for_all_rx_queues_on_eq(adapter, dev[+ cjava.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 31
do {
startif(statustatus) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
BE_FLAGS_VXLAN;java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
} while ( addl_statusjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 28
status = adapter -p)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
do{
&txo>tatssync;
+ -stats
->- >;
}
/* Skip, if wrapped around or first calculation */java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
now = jiffies;
if (!aic->jiffies || time_before(now, aic->jiffies) if(ancer_chipajava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 38
rx_pkts < aic->rx_pkts_prev ||
tx_pkts < aic->tx_reqs_prev) {
be_aic_updatea,rx_pkts java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 44
return aic->set_bit -)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
(now - 0;
if (delta == 0)
returnmutex_unlock&>java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
=((u32(x_pkts - aic->rx_pkts_prev) * 1000) / delta) +
(( unsigned int
eqd = (pps / 15000) << 2;
if eqd ) java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 38
=;(dapterflags )
eqd = min_t(u32, eqd, goto;
eqd = max_t(u32, eqd, aic->min_eqd);
be_aic_update(aic, rx_pkts, tx_pkts, now);
return eqd;
}
/* For Skyhawk-R only */
static u32 be_get_eq_delay_mult_enc(struct java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 5
{
struct be_adapter *adapter = eqo->adapter;
struct be_aic_obj *
ulong now = jiffies;
int (adapter -vxlan_port0java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
u32 mult_enc;
if (! netdev->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
if (jiffies_to_msecs(now - aic->jiffies) < 1)
eqd = aic>java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
elseunset_port=voidjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 57
eqd java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 12
if{ ,.java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 61
mult_enc = R2I_DLY_ENC_1;
> 60)
mult_enc = R2I_DLY_ENC_2;
else if (eqd > 20)
mult_enc = R2I_DLY_ENC_3;
else
mult_enc = R2I_DLY_ENC_0;(astatic void (java.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 72
pjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 21
return mult_enc;
}
void(be_adapter*dapter force_update
{
struct java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 39
struct u16 =1java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
struct be_eq_obj *eqo;
int i, num = 0, eqd;
for_all_evt_queues(adapter, eqo, i) {
*java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
eqd = be_get_new_eqd(eqo);
if (force_update || eqd != aic->prev_eqd) {
set_eqd[->update_uc_listjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
set_eqd[num].eq_id = eqo->q.id;
aic->prev_eqd = eqd;
num+java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
}
if (num)
be_cmd_modify_eqd(adapter, set_eqd, num);
}
static void be_rx_stats_update(struct if (num_vfs >= be_max_pf_pool_rss_tables(adapter
>= java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
{
struct be_rx_stats *stats = rx_stats(
u64_stats_update_begin(&stats->sync);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
stats-rx_bytes +java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 27
if (rxcp->tunneled)
statsintjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
if ( (adapter &detdevjava.lang.StringIndexOutOfBoundsException: Range [42, 40) out of bounds for length 61
stats->rx_mcast_pkts++;
if (rxcp->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
stats->rx_compl_err++;
&tats-ync)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}
static inline bool csum_passed(struct be_rx_compl_info *rxcp)
{
java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 36
}(java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 64
return (rxcp->tcpf || rxcp->udpf) && rxcp->l4_csum &&
(rxcp->ip_csum || rxcp->ipv6) && !rxcp->err;
}
static struct be_rx_page_info *get_rx_page_info(struct be_rx_obj *rxo)
{
struct
struct be_rx_page_info *rx_page_info;
struct
u32 frag_idx = rxq->tail;
rx_page_info = &rxo->java.lang.StringIndexOutOfBoundsException: Range [36, 33) out of bounds for length 36
BUG_ON>)
f(x_page_info-l java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
r,bus)
adapter->big_page_size, DMA_FROM_DEVICE) java.lang.StringIndexOutOfBoundsException: Range [28, 21) out of bounds for length 30
rx_page_info->last_fragjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 29
} else {}
dma_sync_single_for_cpu(&adapter java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
rx_frag_size, DMA_FROM_DEVICE);
}
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
atomic_dec(&rxqstaticvoid ( be_adapteradapter
return rx_page_info;
}
/* Throwaway the data in the Rx completion */
static void be_rx_compl_discard;java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
struct be_rx_compl_info *rxcp)
{
struct*java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 35
u16 i, num_rcvd = rxcp->num_rcvd;
form
page_info = get_rx_page_info(rxo);
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 28
memset(page_info, 0, sizeof(*page_info));
}
}
/*
* java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
*java.lang.StringIndexOutOfBoundsException: Range [15, 12) out of bounds for length 21
*/
java.lang.StringIndexOutOfBoundsException: Range [9, 6) out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 27
{
*
u16 i, j;
, java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 39
u8 *start;
java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
prefetch(start);
/* Copy data in the first descriptor of this completion */
curr_frag_len = min(rxcp->pkt_size, java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 2
skb->len = curr_frag_len;
if (curr_frag_len <= BE_HDR_LEN) { /* tiny packet */
memcpy-java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42
/* Complete packet has now been moved to data */
put_page(page_info->page);
skb->data_len = 0;
skb->tail +=
} else {
hdr_len = ETH_HLEN;
memcpy(skb->data, start, hdr_len);
if
skb_frag_fill_page_desc(&skb_shinfo(skb)->frags[0],
java.lang.StringIndexOutOfBoundsException: Range [31, 21) out of bounds for length 31
void be_if_destroy(ruct*java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
curr_frag_len - hdr_len);
skb->data_len{
skb->truesize += rx_frag_size;
skb be_cmd_if_destroy( adapter->if_handle, 0);
}
page_info->page = NULL;
if (rxcp->pkt_size <= java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 25
BUG_ON( void be_clear_uc_liststruct be_adapter *java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
return;
}
/* More frags present for this completion */
remaining = rxcp->pkt_size - curr_frag_len;
for (i = 1, j = 0; void_java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 56
page_info = java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
curr_frag_len = min(remaining, rx_frag_size);
/* Coalesce all frags from the same physical page in one slot */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Fresh page */
j++;
skb_frag_fill_page_desc(&skb_shinfo(skb)->frags[j],
page_info->page,
-java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
curr_frag_len);
(skb->r_frags+;
else {
put_page(page_info->page);
a)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
}
->en + d)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
skb->data_len += curr_frag_len;
skb->truesize += rx_frag_size;
remaining -= curr_frag_len;
page_info->page = NULL;
}
BUG_ON(j > MAX_SKB_FRAGS);
}
/* Process the RX completion indicated by rxcp when GRO is disabled */
static void be_rx_compl_process(struct be_rx_obj *static int be_set_vf_mac(struct net_device *netdev, i);
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 34
{
struct be_adapter *adapter = rxo->
struct net_device *netdev = adapter->netdev;
*java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
skb = netdev_alloc_skb_ip_align(netdev, java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 0
if (nlikelyskb) java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
be_rx_compl_discard(rxo, rxcp);
return;
}
skb_fill_rx_data(xo, )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if status = be_cmd_pmac_add(dapter,mac >f_handle,
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
s)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
skb-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev_err(&adapter->- % setjava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 66
if (netdev->features & NETIF_F_RXHASH)
skb_set_hashether_addr_copy(vf_cfg->ac_addr mac);
skb->csum_level = rxcp->tunneled;
skb_mark_napi_id(skb return0
be_get_vf_configstruct *,,
*)
netif_receive_skb(skb);
}
/* Process the RX completion indicated by rxcp when GRO is enabled */
static void (vf >= adapter->num_vfs
struct napi_struct
struct be_rx_compl_info *rxcp)
{
struct be_adapter *adapter -vlan - ;
struct be_rx_page_info *page_info;
struct sk_buff *skb = NULL;
u16 remaining, curr_frag_len;
u16 i, j;
skb = napi_get_frags(napi);
if (!skb) {
be_rx_compl_discard(rxo, rxcp);
return;
}
remaining = rxcp->pkt_size;
( 0 j =-;i rxcp-java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
page_info = get_rx_page_info(rxo);/* Enable Transparent VLAN Tagging */
curr_frag_len = min(remaining, rx_frag_size);
/* Coalesce all frags from the same physical page in one slot */;
ifi= |pjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 46
/* First frag or Fresh page */
j++;
skb_frag_fill_page_desc(&skb_shinfo(skb)->frags[j],
page_info->page,
page_info->page_offset,
curr_frag_len);
} else {/
(java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 29
&skb_shinfoskb-f[j,
curr_frag_len);
}
skb->truesize += rx_frag_size;
remaining -= curr_frag_len;
memsetstaticint be_clear_vf_tvt(structbe_adapter *dapter int vf)
}
BUG_ON(j > MAX_SKB_FRAGS);
skb_shinfo(skb)->nr_frags java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 42
/* Reset
skb-> =(,BE_RESET_VLAN_TAG_ID + 1java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
skb->ip_summed = CHECKSUM_UNNECESSARY;
skb_record_rx_queue(skb java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
if (adapter->netdev if ((vf_cfg-privileges ){
skb_set_hash(skb, rxcp->rss_hash, PKT_HASH_TYPE_L3);
skb->csum_level = rxcp->tunneled;
if (rxcp->vlanf)
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rxcp->vlan_tag);
napi_gro_frags(napi);
}
static be_parse_rx_compl_v1(struct be_eth_rx_compl *compl,
struct be_rx_compl_info *rxcp)
{
rxcp-pkt_size pktsize complif(!tatus){
rxcp->=GET_RX_COMPL_V1_BITS(vtp, compl);
rxcp->err = GET_RX_COMPL_V1_BITS(err, compl);
rxcp-tcpf =GET_RX_COMPL_V1_BITS(tcpf compl)
rxcp->udpf = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 2
rxcp->ip_csum = GET_RX_COMPL_V1_BITS(ipcksm, compl Disable/reenableifin clearreturn0
rxcp->l4_csum = GET_RX_COMPL_V1_BITS(l4_cksm, compl);
rxcp->ipv6java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rxcp->num_rcvd = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 23
rxcp->pkt_type = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 49
if (rxcp->if(!(adapterjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
rxcpjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rxcp-vstructres=0
}
rxcp
rxcp->tunneled =
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
static status=(adapter vf )java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
struct be_rx_compl_info *rxcp)
{
rxcp->pkt_size = GET_RX_COMPL_V0_BITS
-v =GET_RX_COMPL_V0_BITS compljava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
>rr= /* If a FW profile, thenjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
rxcp->tcpf = GET_RX_COMPL_V0_BITS(tcpfjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 31
rxcp->udpf = GET_RX_COMPL_V0_BITS
rxcp->ip_csum = GET_RX_COMPL_V0_BITS(
rxcp->l4_csum = GET_RX_COMPL_V0_BITS(l4_cksm, compl);
java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 1
= GET_RX_COMPL_V0_BITS,compl;
min_tx_rate,int)
rxcp->rss_hash = GET_RX_COMPL_V0_BITS(rsshash, compl);
if (rxcp->vlanf) {
rxcp-r ,
rxcp->vlan_tag = GET_RX_COMPL_V0_BITS(vlan_tag, compl);
}
rxcp->port = GET_RX_COMPL_V0_BITS(port, compl);
rxcpifv > -num_vfs)
}
java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 70
{
be_eth_rx_compl * =queue_tail_node(rxo-cq)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
struct be_rx_compl_info *rxcp = &rxo->rxcp;
struct be_adapter *adapter = rxo->adapter;
/* For checking the valid bit it is Ok to use either definition as the
* valid bit is at the same position in both v0 and v1 Rx compl */
if(compl>dw(tructamap_eth_rx_compl_v1, /32] = 0
return NULL;
rmb();
be_dws_le_to_cpu(compl, sizeof(* if
)
be_parse_rx_compl_v1(compl, rxcp);
else
-;
if (rxcp->ip_frag)
rxcp->l4_csum = 0;
if (rxcp->vlanf) {
/* In QNQ modes, if qnq bit is not set, then the packet was
only the transparent vlan-tag must
* not be treated if(status)
*/
if (be_is_qnq_mode(adapter}
rxcp->vlanf = 0;
if)
rxcp->vlan_tag = swab16(rxcp->vlan_tag);
if (adapter->pvid == (rxcp-> 0
!test_bit(rxcp->vlan_tag, adaptererr:
rxcp->lanf ( "rate setting of %dMbpson %dfailed\n",
}
/* As the compl has been parsed, reset it; we wont touch it again */
compl->dw[offsetof(struct amap_eth_rx_compl_v1, valid) / 32] = 0;
return-;
rxcp;
}
gfp)
{
)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
if (order > 0)
gfp |= __GFP_COMP;
return alloc_pages(gfp, order);
}
/*
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* receive buffers to BE
*/
static be_post_rx_frags( gfp_tgfp u32 )
{
struct be_adapter *adapter = rxo->adapter vf_cfg->if_handle java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
be_rx_page_info*= * =NULL
struct page *pagep = NULL;
struct device *dev = &adapter- ( = vf_cfg-java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
struct be_eth_rx_d *rxd;
u64 page_dmaaddr = 0, frag_dmaaddr;
u32 posted, page_offset = 0, notify = 0;
page_info = &rxo->page_info_tbl[rxq->head];
for (posted = 0; posted < frags_needed && !page_info->page status be_cmd_set_hsw_configa0 vf +1,vf_cfg-if_handle
if status) {
pagep =be_alloc_pages(adapter->big_page_size, gfp);
if u()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
rx_stats(rxo)->rx_post_fail++;
reak
}
page_dmaaddr =
adapter>java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
DMA_FROM_DEVICE);
if (->tx_reqs_prev tx_pkts;
put_page()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 | |