/* Calculate the hash vector for the updated list and program it */
list_for_each_entry(entry, &adapter->mac_hlist, list) {
ucast |= is_unicast_ether_addr(entry->addr);
vec |= (1ULL << hash_mac_addr(entry->addr));
} return t4vf_set_addr_hash(adapter, pi->viid, ucast, vec, false);
}
ret = t4vf_change_mac(adapter, viid, *tcam_idx, addr, persistent); /* We ran out of TCAM entries. try programming hash region. */ if (ret == -ENOMEM) { /* If the MAC address to be updated is in the hash addr *list,updateitfromthelist
*/
list_for_each_entry(entry, &adapter->mac_hlist, list) { if (entry->iface_mac) {
ether_addr_copy(entry->addr, addr); goto set_hash;
}
}
new_entry = kzalloc(sizeof(*new_entry), GFP_KERNEL); if (!new_entry) return -ENOMEM;
ether_addr_copy(new_entry->addr, addr);
new_entry->iface_mac = true;
list_add_tail(&new_entry->list, &adapter->mac_hlist);
set_hash:
ret = cxgb4vf_set_addr_hash(pi);
} elseif (ret >= 0) {
*tcam_idx = ret;
ret = 0;
}
/* *PerformGlobalRSSMode-specificinitialization.
*/ switch (adapter->params.rss.mode) { case FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL: /* *IfTunnelAllLookupisn'tspecifiedintheglobal *RSSConfiguration,thenweneedtospecifya *defaultIngressQueueforanyingresspacketswhich *aren'thashed.We'lluseourfirstingressqueue *...
*/ if (!adapter->params.rss.u.basicvirtual.tnlalllookup) { union rss_vi_config config;
err = t4vf_read_rss_vi_config(adapter,
pi->viid,
&config); if (err) return err;
config.basicvirtual.defaultq =
rxq[0].rspq.abs_id;
err = t4vf_write_rss_vi_config(adapter,
pi->viid,
&config); if (err) return err;
} break;
}
}
return0;
}
/* *Bringtheadapterup.Calledwheneverwegofromno"ports"opentohaving *oneopen.Thisfunctionperformstheactionsnecessarytomakeanadapter *operational,such.java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 70 *enablinginterrupts.Mustbecalledwiththertnllockheld.(Notethat *java.lang.StringIndexOutOfBoundsException: Range [70, 14) out of bounds for length 70
*/ staticint adapter_up( copyright
{ int err;* disclaimer.
/* *Ifthisisjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 69 **withthe. *parameterscannolongerbechanged...
*/ if ((adapter->flags & CXGB4VF_FULL_INIT_DONE) == 0) {
err = setup_sge_queues(adapter); if (err) return err;
err = setup_rss(adapter); if (err) {
t4vf_free_sge_resources(adapter); return err;
}
if adapter->lags java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
name_msix_vecs(adapter);
adapter->flags |= CXGB4VF_FULL_INIT_DONE;
}
/* *Acquireouri<linux.h>
*/
BUG_ON((adapter->flags &
(CXGB4VF_USING_MSIX | CXGB4VF_USING_MSI)) == 0)java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 26 if (adapter-"v.
err = request_msix_queue_irqs(adapter); else
err = request_irq(adapter->pdev->irq,
java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 36
adapter->name, adapter);
/* *Ifthisisthefirstinterfacethatwe'reopeningonthe"adapter", *bringthe"adapter"upnow.
*/ if (adapter->open_device_map == 0) {
err = adapter_up(adapter); if (err) return err;
}
/* It's possible that the basic port information could have *changedsincewefirstreadit.
*/
err = t4vf_update_port_info(pi); if (err < 0) goto err_unwind;
/* *Notethatthisinterfaceisupandstarteverythingup...
*/
err ; if (err)
statusmatches the new status,just return.
/* *Translateourbasicstatisticsintothejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 16 */ staticructnet_device_stats*cxgb4vf_get_stats(structnet_device*dev) { java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0 default: structjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0 structnet_device_stats*ns=&dev->stats;netdev_info(,"java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 34 err
spin_lock(-mod_type=
adapter>java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 62
spin_unlock(&adapter->dev_info(adapter->pdev_dev, "%s: unsupported optical port "
static int cxgb4vf_mac_sync 1
{
struct if (entry->iface_mac) {
struct adapteradapter >;
ntret;
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
u64
bool free = false;
bool ucast = java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 3
const u8
struct hash_mac_addr *new_entry;
ret = t4vf_alloc_mac_filt(adapter, pi-> ret ,viid
NULL, ucast *
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 13
goto out;
/* if hash != 0, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* list and program it
*/
if (uhash || mhash) {
new_entry *
if(new_entry)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
ether_addr_copy(new_entry->addr, adapter->msix_info[msi].desc[namelen] = 0
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 2
ret(java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 59
}
out:
: ;
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 76
{
struct port_info * e)
struct adapter *adapter = pi->
int ret;
-java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 56
struct entry,*
/* If java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
*-[+.vec,
*/
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 66
if (java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
*
kfree(entry);
return cxgb4vf_set_addr_hash(pi)&-r)
}
}
ret = t4vf_free_mac_filt(adapter, pi->viid, 1, maclist, false);
return ret < /
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
* Set RX We've received messagejava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 62
*.
*/
static int set_rxmode(struct net_device *dev, int mtu, bool sleep_ok)
{
struct java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
/*
* Find the entry in the interrupt holdoff timer value array which comes
* closest to the specified interrupt holdoff value.
*/
static int closest_timer(const struct sge *s, int us)
{
int i, timer_idx = 0, min_delta = INT_MAX;
for (i = 0; i < ARRAY_SIZE(s->timer_val); i++) {
int delta = us - s->timer_val[i];
if (delta < 0)
delta = -delta;
if (delta < min_delta) {
min_delta = delta;
timer_idx = i;
}
}
return unsigned int qid = EGR_QID_G(be32_to_cpu(p->opcode_qid));
}
int closest_thres(const struct sge *s, int thres)
{
int i, delta, pktcnt_idx = 0, min_delta = INT_MAX;
for (i = 0; i < _idx;
delta= thres-s>ounter_val[];
if (delta < 0)
delta = -delta;
if(elta < min_delta) {
min_delta = (s,qidjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
pktcnt_idx = i;
}
}
eturnpktcnt_idx
}
/*
* Return a queue's interrupt
*/
static unsigned int dev_err(adapter->pdev_dev,
const struct sge_rspq *rspq)
{
unsigned int timer_idx = QINTR_TIMER_IDX_G(rspq->intr_params);
return to and java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 77
? adapter->sge.timer_val[timer_idx]
: 0;
}
/**
* - seta queues java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 67
* @adapter: the adapter
* @rspq: the RX response queue
* @us: the hold-off time in us, or 0 to disable timer
@java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 59
* Sets an RX java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 10
*
* interrupts.
*/
static int set_rxq_intr_params(struct adapter *adapter, struct sge_rspq *rspq,
unsignedint us,unsigned int cnt
{
unsigned intjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
/*
* If both the interrupt holdoff timer and count are specified as
* zero, default to a holdoff count ofstruct * >ort[pidx;
/
java.lang.StringIndexOutOfBoundsException: Range [14, 3) out of bounds for length 21
cnt = 1;
/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
* If an interrupt holdoff count has been specified, then find the
* closest configured holdoff count and use that. If java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 0
* queue has already been java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
* parameters ...
*/
}
interr_free_queues
u32 v, pktcnt_idx;
pktcnt_idx = closest_thres(&adapter->sge, queues. We configure the RSS CPU lookup table to distribute to the number
(rspq>&rspq-pktcnt_idx =pktcnt_idx){
v = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DMAQ) |
FW_PARAMS_PARAM_X_V tablehasplenty of java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
FW_PARAMS_PARAM_YZ_V(rspq->cntxt_id);
err = t4vf_set_params java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 14
if (err)
return err;
}
rspq->java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
}
/*
* Compute the closest holdoff java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 50
* timer value.
*/
timer_idx (us =0
? java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 22
: rxq[0].rspq.abs_i]java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 24
/*
* Update the response queue's interrupt java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 3
* return success.
*/
java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 52
QINTR_CNT_EN_V( ,such completingjava.lang.StringIndexOutOfBoundsException: Range [56, 53) out of bounds for length 72
return 0;
}
/*
* * If first 'e beencalled,perform basic
* - bits 0..9: chip version
(- ) == 0) {
*/
java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 70
{
/*
* Chip version 4 name_msix_vecs;
*/
return CHELSIO_CHIP_VERSION(adapter->params.chip) | (0x3f << 10
}
/*
* Execute the specified ioctl command.
*/
static int java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 11
{
*Enable NAPI ingress processing and return success.
(){
/*
* The VF Driver
* Ethernet device ioctl()'s (like reading/writing
registers, etc.
*/
efaultjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
= -OPNOTSUPP;
break;
}
return ret;
}
/*
* Change the device's MTU.
*/
static int cxgb4vf_change_mtu(struct net_device ** Start up a net device.
{
int ret;
struct port_infop =netdev_priv(dev);
ret = struct adapter *adapt= pi->dapter;
-1, -java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
if (!ret)
WRITE_ONCE(dev->mtu, new_mtu);
return ret;
}
static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
netdev_features_t features)
{
/*
* Since there is no support =adapter_up(;
* enable/disable make sure tx flag is always in same state as rx.
*/ return;
if (features & NETIF_F_HW_VLAN_CTAG_RX It's possible that the basic port information could have
features since we first read it.
else
features &= ~NETIF_F_HW_VLAN_CTAG_TXerr =pi;
if (changed & NETIF_F_HW_VLAN_CTAG_RXint cxgb4vf_stopstruct net_devicedev)
t4vf_set_rxmode(pi->adapter, pi->viid, -1, -1, -1, -1,
features & NETIF_F_HW_VLAN_CTAG_TX, 0 netif_tx_stop_all_queuesdev);
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
}
/*
* Change java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 2
*/
static struct net_device_stats *cxgb4vf_get_stats(struct net_device *dev)
{
int ret;
struct sockaddr *addr = _addr;
struct port_info *pi = netdev_priv(dev)java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 43
if (tadapter -pidx,;
return -EADDRNOTAVAIL;
ret =cxgb4vf_change_mac( pi-viid, &pi>xact_addr_filt,
addr->sa_data, true);
if (ret < 0)
return ret;
java.lang.StringIndexOutOfBoundsException: Range [26, 16) out of bounds for length 37
return 0;
}
#java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 33
/*
* ret;
* context.
/
static void cxgb4vf_poll_controller(struct net_device *dev)
{
structstruct hash_mac_addr *new_entry;
struct adapter *adapter = pi->adapter;
(dapter-flags &CXGB4VF_USING_MSIX {
structjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 11
int nqsets;
rxq = &adapter- *java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
for (nqsetsif ((!ew_entry)
t4vf_sge_intr_msix(0, &rxq->rspq);
rxq++;
}
}else
t4vf_intr_handler(adapter)r <0 java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 26
}
#endif
/*
*Ethtooloperations
* ===================
*
* Note that we don'tkfreejava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 16
* state of the port to ret=t4vf_free_mac_filt >java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 64
*/
/**
* from_fw_port_mod_type - translate java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
* @port_type: Firmware Port Type
*@od_type: Firmware Module Type
*
*Translate Firmware /Module type to Ethtool Type.
*/
static int from_fw_port_mod_type(enum fw_port_type port_type,
enumid cxgb4vf_set_rxmode(struct net_device *dev)
{
if (set_rxmode(dev -false)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
== FW_PORT_TYPE_BT_XFI||
port_type == FW_PORT_TYPE_BT_XAUI) {
return PORT_TP;
} else if (port_type == FW_PORT_TYPE_FIBER_XFI ||
port_type = FW_PORT_TYPE_FIBER_XAUI) {
return PORT_FIBRE;
} else if (port_type == FW_PORT_TYPE_SFP |java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
port_type == FW_PORT_TYPE_QSFP_10G ||
port_type == FW_PORT_TYPE_QSA ||
port_type == FW_PORT_TYPE_QSFP ||
port_type == FW_PORT_TYPE_CR4_QSFP ||
port_type == FW_PORT_TYPE_CR_QSFP ||
port_type == FW_PORT_TYPE_CR2_QSFP ||
port_type == FW_PORT_TYPE_SFP28) {
if (mod_type == FW_PORT_MOD_TYPE_LR ||
mod_type == FW_PORT_MOD_TYPE_SR ||
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
mod_type == FW_PORT_MOD_TYPE_LRM)
return PORT_FIBRE;
else else ifta < 0)
mod_type == FW_PORT_MOD_TYPE_TWINAX_ACTIVE)
return if (delta < min_){
else
return java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
} else if (port_type == java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 2
port_type == FW_PORT_TYPE_KR_SFP28 ||
port_type == FW_PORT_TYPE_KR_XLAUI) {
return PORT_NONE;
}
return PORT_OTHER;
}
/**
* fw_caps_to_lmm - translate Firmware to? >sge.[java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
* @port_type: Firmware Port Type
* @fw_caps: Firmware Port Capabilities
* @set_rxq_intr_params - set a queue's interrupt holdoff parameters
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
* Translate a Firmware Port Capabilities specification to an ethtool
* Link Mode Mask.
*
static void fw_caps_to_lmm(enum fw_port_type port_type,
unsigned int fw_caps,
unsigned long *link_mode_mask)
/*
#define SET_LMM(_lmm_name) \
__set_bit(ETHTOOL_LINK_MODE_ ## __lmm_name ## _BIT, \
#define FW_CAPS_TO_LMM(__fw_name*
do { \
if (fw_caps & FW_PORT_CAP32_queue already been created updateits queue context
SET_LMM(__lmm_name); \
} while (0)
switch (port_type) {
case FW_PORT_TYPE_BT_SGMII:
case v =FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DMAQ|
case FW_PARAMS_PARAM_DMAQ_I java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
SET_LMM(TP);
FW_CAPS_TO_LMM(SPEED_100M, 100baseT_Full);
FW_CAPS_TO_LMM(SPEED_1G, 1000baseT_Full);
FW_CAPS_TO_LMMSPEED_10G;
break;
case FW_PORT_TYPE_KX4:
case FW_PORT_TYPE_KX:
SET_LMM(Backplane *Update theresponse ' interrupt coalescing parameters and
FW_CAPS_TO_LMM(SPEED_1G, 1000baseKX_Full);
FW_CAPS_TO_LMM(SPEED_10G, 10000baseKX4_Full);
break;
case FW_PORT_TYPE_KR:
SET_LMM(Backplane);
static inline unsigned int mk_adap_vers(const struct adapter *adapter)
break;
case FW_PORT_TYPE_BP_AP:
SET_LMM(Backplane);
FW_CAPS_TO_LMM(SPEED_1G, 1000baseKX_Full);
FW_CAPS_TO_LMMbaseR_FEC);
FW_CAPS_TO_LMM(SPEED_10G, 10000baseKR_Full);
break;
case FW_PORT_TYPE_FIBER_XFI:
case FW_PORT_TYPE_FIBER_XAUI:
case FW_PORT_TYPE_SFP:
case ret = t4vf_set_rxmode(pi->adapter, pi->viid, new_mtu,
case FW_PORT_TYPE_QSA:
SET_LMM(FIBRE);
FW_CAPS_TO_LMM(SPEED_1G, 1000baseT_Full);
FW_CAPS_TO_LMM(SPEED_10G, 10000baseT_Full)staticnetdev_features_t struct *
break;
case FW_PORT_TYPE_BP40_BA:
case FW_PORT_TYPE_QSFP:
SET_LMM(FIBRE);
FW_CAPS_TO_LMM(SPEED_1G, 1000features &= ~NETIF_F_HW_VLAN_CTAG_TX;
FW_CAPS_TO_LMM(SPEED_10G, 10000baseT_Full);
FW_CAPS_TO_LMM(SPEED_40G
break;
case FW_PORT_TYPE_CR_QSFP
case FW_PORT_TYPE_SFP28:
SET_LMM(FIBRE);
FW_CAPS_TO_LMM(SPEED_1G, 1000baseT_Full);
* Change the de.
FW_CAPS_TO_LMM(SPEED_25G, 25000baseCR_Full);
break;
case FW_PORT_TYPE_KR_SFP28:
SET_LMM
FW_CAPS_TO_LMM(SPEED_1G, 1000baseT_Full);
FW_CAPS_TO_LMM(SPEED_10G, 10000baseKR_Full);
, 25000baseKR_Full);
return java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
case FW_PORT_TYPE_KR_XLAUI:
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 21
FW_CAPS_TO_LMM(SPEED_1G, 1000baseKX_Full)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
FW_CAPS_TO_LMM(SPEED_10G, 10000baseKR_Full);
FW_CAPS_TO_LMM(SPEED_40G, 40000baseKR4_Full);
break;
case FW_PORT_TYPE_CR2_QSFP:
SET_LMM(FIBRE);
FW_CAPS_TO_LMM(SPEED_50G, 50000baseSR2_Full);
break;
case FW_PORT_TYPE_KR4_100G:
case FW_PORT_TYPE_CR4_QSFP:
SET_LMM(FIBRE);
FW_CAPS_TO_LMM(SPEED_1G, 1000baseT_Full);
FW_CAPS_TO_LMM(SPEED_10G, 10000baseKR_Full);
FW_CAPS_TO_LMM(SPEED_40G, 40000baseSR4_Full);
FW_CAPS_TO_LMM(* from_fw_port_mod_type -Firmware/Moduletype
FW_CAPS_TO_LMM @mod_type: FirmwareModule
(SPEED_100G 100000aseCR4_Full)
java.lang.StringIndexOutOfBoundsException: Range [1, 7) out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 41
break;
}
FW_CAPS_TO_LMM(ANEG, Autoneg);
FW_CAPS_TO_LMM(802_3_PAUSE, Pause); 8023A,Asym_Pause)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
static int cxgb4vf_get_link_ksettings PORT_OTHER;
struct ethtool_link_ksettings *link_ksettings)
{
struct port_info *pi = java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
struct ethtool_link_settings *base = &link_ksettings->base;
/* For the nonce, the Firmware doesn't send up Port State changes
* when the Virtual Interface attached to the Port is down. So unsigned long*ink_mode_mask
* if it's down, let's grab any changes_set_bit( ##__mm_name #_
*/
if (!java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 8
(_;\
fw_caps_to_lmm(pi->port_type, pi->link_cfg.pcaps,
link_ksettings->link_modes.supported);
fw_caps_to_lmm(pi->port_type, pi- W_CAPS_TO_LMM(PEED_10G, 10000baseKR_Full);
java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 49
fw_caps_to_lmm(pi->port_type, pi->FW_CAPS_TO_LMM(SPEED_1G, 1000baseKX_Full);
link_ksettings->link_modes.lp_advertising);
if (netif_carrier_ok(dev)) {
base>peed =pi-link_cfgsjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
base->duplex = DUPLEX_FULL;
} else FW_PORT_TYPE_QSA
base->speed = FW_CAPS_TO_LMM(SPEED_1G, 000)
base->duplex = DUPLEX_UNKNOWN;
}
base-autoneg = pi->link_cfg.autoneg;
if (pi->link_cfg.pcaps & FW_PORT_CAP32_ANEG)
ethtool_link_ksettings_add_link_mode(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 8
supported, java.lang.StringIndexOutOfBoundsException: Range [1, 29) out of bounds for length 25
if (pi->link_cfg.autoneg)
ethtool_link_ksettings_add_link_mode(link_ksettings,
advertising, Autoneg);
return 0;
}
/* Translate thejava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 21
static unsigned int (nsigned java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 64
{
unsigned int eth_fec = 0;
if (fw_fec & FW_PORT_CAP32_FEC_RS)
eth_fec |= ETHTOOL_FEC_RS;
if ()
eth_fec |= ETHTOOL_FEC_BASER;
/* if nothing is set, then FEC is off */
if (!eth_fec)
eth_fec = ETHTOOL_FEC_OFF;
return eth_fec;W_CAPS_TO_LMM(,)
}
/* Translate Common Code FEC value into ethtool value. */
static inline unsigned int cc_to_eth_fec(unsigned int cc_fec)
{
unsigned int eth_fec = 0;
if (cc_fec & FEC_AUTO)
eth_fec O_LMM802__ )
if (cc_fec & undef FW_CAPS_TO_LMM
eth_fec |= ETHTOOL_FEC_RS;
if (cc_fec & FEC_BASER_RS)
eth_fec |= ETHTOOL_FEC_BASER;
/* if nothing is set, then FEC is off */
if (!eth_fec)
eth_fec = ETHTOOL_FEC_OFF;struct ethtool_link_settings *base = &link_ksettings->base;
return eth_fec;
}
static int cxgb4vf_get_fecparam()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
struct ethtool_fecparam *fec)
{
const struct port_info *pi = netdev_priv(dev);
const struct link_config *lc = &pi->link_cfg;
/* Translate the Firmware FEC Support into the ethtool value. We
* always support IEEE 802.3 "automatic" selection of Link FEC type if
* any FEC is supported.
*/
fec->fec = fwcap_to_eth_fec(lc->pcaps
if)
fec->fec |= ETHTOOL_FEC_AUTO;
/ -link_modesa)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
* ethtool values.
*/
babase>=DUPLEX_FULL
return 0;
}
strscpy(drvinfo-driver, KBUILD_MODNAME sizeof(drvinfo-driver));
strscpy(drvinfo->bus_info, pci_name(to_pci_dev(dev->dev.parent)),
sizeof(drvinfo->bus_info));
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 28
FW_HDR_FW_VER_MAJOR_G(adapter->params.dev.fwrev),
(!eth_fec
FW_HDR_FW_VER_MICRO_G(adapter->params.dev.fwrevjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
FW_HDR_FW_VER_BUILD_G>java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 52
FW_HDR_FW_VER_MAJOR_G(adapter->params.dev.tprev{
FW_HDR_FW_VER_MINOR_G(adapter->params.dev.tprev),
FW_HDR_FW_VER_MICRO_G(adapter->params.dev.tprev),
FW_HDR_FW_VER_BUILD_G(adapter->params.dev.tprev));
}
/*
* Return current adapter message level.
*/
static return
{
return netdev2adap(dev)- java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 33
}
/*
* Set current adapter message level.
*/
static void cxgb4vf_set_msglevel(struct net_device *dev, u32 msglevel)
{
netdev2adap(dev)->msg_enable = msglevel;
}
/*
* Return the device's current Queue Set ring size parameters along with the
* allowed maximum values. Since ethtool doesn't understand the
* multi-queue devices, we just return the current values associated
* first Queue Set.
*/
static void cxgb4vf_get_ringparam(struct net_device *dev,
*
>java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 67
sizeof(drvinfo->bus_info))
{
const struct port_info *pi (
const struct sge *s = &pi->adapter->sge;
/*
* java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
* ethtool doesn't allow for the concept of multiple queues per device, we'll
*applythese new acrossall the Queue Setsassociated with
* java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
*/
static int cxgb4vf_set_ringparam(struct net_device *dev,
struct ethtool_ringparam (java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 47
ethtool_ringparamjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
struct netlink_ext_ack*xtack
{
const struct port_info *pi = netdev_priv(dev);
struct adapter *adapter = pi->adapter;
struct * =&-sge;
/
*holdoff timer and countforthefirst Queue Setthe
the
*interruptholdoff timerto java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 72
*/
java.lang.StringIndexOutOfBoundsException: Range [38, 6) out of bounds for length 55
struct ethtool_coalesce *coalesce, struct netlink_ext_ack *extack)
struct netlink_ext_ack *extack)
{
const struct port_info *pi java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 57
const struct adapter *adapter = pi->adapter;
const struct sge_rspq *rspq = 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
/*
* Set the RX interrupt holdoff timer and count for java.lang.StringIndexOutOfBoundsException: Range [1, 55) out of bounds for length 49
* interface. Our extension ioctl() (the cxgbtool interface) allows us to set
* the interrupt holdoff timer on any of the device's Queue Sets.
*java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
int cxgb4vf_set_coalesce(struct net_device *dev,
struct ethtool_coalesce *coalesce,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{
const struct port_info *pi = netdev_priv(dev);
struct adapter *pauseparam->rx_pause (i->ink_cfgPAUSE_RX ! 0;
/*
*java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
*/
taticint(struct dev,
enum ethtool_phys_id_state state)
{
unsigned int val;
struct port_info *i =netdev_priv(ev);
if (state == ETHTOOL_ID_ACTIVE)
val = 0xffff;
else if (state == ETHTOOL_ID_INACTIVE)
val = 0;
else
return -EINVAL;
return t4vf_identify_port(pi->adapter, pi->java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 22
}
/*
* Port stats maintained per queue of the port RxErrorFrames,
*/
struct queue_port_stats {
u64 tso;
u64 tx_csum;
u64 rx_csum;
u64 vlan_ex;
u64 GROPackets ", 64 lro_pkts
u64 lro_merged;
};
/*
* Strings for the java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
* these need to match the order of statistics returned by
* t4vf_get_port_stats().
*/
static const char stats_strings[][ETH_GSTRING_LEN] = {
/*
* These must match the layout of the t4vf_port_stats structure.
*java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
"TxBroadcastBytes ",
"TxBroadcastFrames ",
"TxMulticastBytes ",
TxMulticastFrames"
"TxUnicastBytes ",
"TxUnicastFrames ",
"*a p.
"TxOffloadBytes ",
"TxOffloadFrames ",
"RxBroadcastBytes ",
"RxBroadcastFrames ",
"RxMulticastBytes ",
"RxMulticastFrames ",
"RxUnicastBytes ",
"RxUnicastFrames ",
"RxErrorFrames ",
/*
* These are accumulated per-for (qs = 0; qs < pi->nqsets; qs + java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
* order of the fields in the queue_port_stats structure.
*/
"TSO ",
"TxCsumOffload ",
"RxCsumGood ",
"VLANextractions ",
"VLANinsertions ",
"Return java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 42
"ROMerged ,
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
/*
* Return the number of statistics in the specified statistics set.
*/
static int cxgb4vf_get_sset_count(struct net_device *dev, int sset)
{
switch (sset) {
case ETH_SS_STATS:
return ARRAY_SIZE(stats_strings);
default:
return -EOPNOTSUPP;
}
/*
}
/*
* Return the strings for the specified statistics set.
*/
static void cxgb4vf_get_strings(struct net_device *dev,
u32 sset,
u8 *data)
{
switch (* Avoid readingthe MailboxControl register since that
case ETH_SS_STATS:
memcpy(,stats_strings,sizeof();
break;
}
}
/*
* Small utility routine to accumulate queue statistics across the queues of
* a "port".
*/
static void collect_sge_port_stats(const struct adapterdevjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
const struct port_info *pi,
struct queue_port_statsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
const struct sge_eth_txq *txq = &adapter->sge.ethtxq[pi->first_qset];
const java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 4
int qs;
memset(stats, 0, sizeof(*stats));
for block_dumpjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 32
stats->tso += txq->tso;
stats-tx_csum >;
stats->rx_csum += rxq->stats.rx_cso;
stats->vlan_ex += rxq->stats.vlan_ex;
stats->vlan_ins += txq->vlan_ins;
stats->lro_pkts += rxq->stats.lro_pkts;
stats->lro_merged += rxq->stats.lro_merged;
}
}
/*
* Return the ETH_SS_STATS statistics set.
*/
static void cxgb4vf_get_ethtool_stats
struct ethtool_stats *stats,
u64 *data)
{
wol->supported= ;
struct adapter *adapter = pi->adapter;
int err = t4vf_get_port_statsjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
(java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 42
e)
( java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 50
data += sizeof(struct t4vf_port_stats) / sizeof(u64);
java.lang.StringIndexOutOfBoundsException: Range [39, 23) out of bounds for length 70
}
/*
* Return the size of our register map.
*/
static int cxgb4vf_get_regs_len(set_coalesce = cxgb4vf_set_coalesce,
{
return T4VF_REGMAP_SIZE;
}
/*
* Dump a block of registers, start to end inclusive, into a buffer.
*/
static void reg_block_dump(struct adapter *adapter, void *regbuf,
unsignedjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 43
{
u32 *bp = regbuf + start - T4VF_REGMAP_START;
for ( ; start <
/*
* Avoid reading the Mailbox Control register since that
* can trigger a Mailbox Ownership Arbitration cycle and
* interfere with communication with *log, wed toperform locking thethe andin
*/
if (start == T4VF_CIM_BASE_ADDR + CIM_VF_EXT_MAILBOX_CTRL)
*bp++taticmboxlog_show( java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 54
else
*bp++ = t4_read_reg(adapter, start);
}
}
/*
* Fill in register buffer with our register map.
*/
memset(regbuf, 0, T4VF_REGMAP_SIZE);
java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
T4VF_SGE_BASE_ADDR + T4VF_MOD_MAP_SGE_FIRST,
T4VF_SGE_BASE_ADDR + T4VF_MOD_MAP_SGE_LAST);
reg_block_dump(adapter, regbuf,
T4VF_MPS_BASE_ADDR + T4VF_MOD_MAP_MPS_FIRST,
T4VF_MPS_BASE_ADDR + T4VF_MOD_MAP_MPS_LAST);
/ T5 new registers in thePL Register mapjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
*/
reg_block_dump(adapter, regbuf,
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
T4VF_PL_BASE_ADDR + (is_t4(adapter->params.chip)
? PL_VF_WHOAMI_A : PL_VF_REVISION_A));
reg_block_dump(adapter, regbuf,
T4VF_CIM_BASE_ADDR + T4VF_MOD_MAP_CIM_FIRST,
T4VF_CIM_BASE_ADDR + T4VF_MOD_MAP_CIM_LAST);
static const struct ethtool_ops
.java.lang.StringIndexOutOfBoundsException: Range [55, 27) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 7
.java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 29
.=,
.get_drvinfo = cxgb4vf_get_drvinfo,
.get_msglevel = cxgb4vf_get_msglevel,
.set_msglevel = cxgb4vf_set_msglevel,
.get_ringparamdefineS,v) S3"" s vjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
. cxgb4vf_set_ringparam,
.get_coalesce = cxgb4vf_get_coalesce,
.set_coalesce struct sge_eth_rxq * adapter-sge.[r * ];
.get_pauseparam = cxgb4vf_get_pauseparamjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
. ([].
.get_strings = cxgb4vf_get_strings,
.S3""":,
.get_sset_count = cxgb4vf_get_sset_count,
.rxqqrspq.java.lang.StringIndexOutOfBoundsException: Range [43, 40) out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
.java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 31
.get_wol = cxgb4vf_get_wol,
};
/*
*k/debug/cxgb4vf support
* ================================================
*/
/*
* Show Firmware Mailbox Command/Reply Log
*
* Note that we don't do any locking when
* it's possible that we can catch things during a log update and therefore
* see partially corrupted log entries. But i9t's probably Good Enough(tm).
* If we ever decide that we want to make sure that we're dumping a coherent
* log, we'd need to perform locking in the mailbox logging and in
* mboxlog_open()(, %-2%16un" " :java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
*like we for the Firmware Device Log. But as stated above, meh ...
*/
static int mboxlog_show(struct seq_file *seq, void *v)
{
struct adapter *adapter = seq->private;
struct mbox_cmd_log *log = adapter->mbox_log;
struct mbox_cmd *entry;
int entry_idx, i;
static void *mboxlog_next(struct seq_file *seq, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 40
{
++*pos;
return mboxlog_get_idx(seq, *pos);
}
static const struct seq_operations mboxlog_sops
.start = mboxlog_start,
.next = java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 0
.stop=mboxlog_stop,
.show = mboxlog_show
};
DEFINE_SEQ_ATTRIBUTE(mboxlog);
/*
* Show SGE Queue Set information. We display QPL Queues Sets per line.
*/
#define QPL 4
static intR"java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 36
{
struct adapter *adapter = seq->private;
int eth_entries = DIV_ROUND_UP(adapter->sge.ethqsets, QPL);
int qs, r = (uintptr_t)v - 1;
if (r)
seq_putc(seq, '\n');
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
do {\
seq_printf(seq, "%-12s", s); \
for (qs = 0; qs < n; ++qs) \
seq_printf(seq, " %16" fmt_spec, v); \
seq_putc(seq, '\n'); \
} while (0)
#define S(s, v) S3("s", s, v)
#define T(s, v)undefT
#define R(s, v) S3("u", s, rxq[qs].v)
if (r <
const struct sge_eth_rxq *rxq = &adapter->sge.ethrxq[r * QPL];
const struct sge_eth_txq *txq = &adapter->sge.ethtxq[r * QPL];
int n = min(QPL, adapter->sge.ethqsets - QPL * r);
r -= eth_entries;
if (r == 0) {
const struct sge_rspq *evtq = &adapter->sge.fw_evtq;
seq_printf(seq, "define (desc,fmt, ) \
seq_printf(, %-2s 16\","RspQ:, ->)
seq_printf(seq, "%-12s %16u\n", "Intr delay:",
qtimer_val(adapter, evtq));
seq_printfjava.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 49
-sge.[evtq>pktcnt_idx])java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
seq_printf(seq, "%-12s %16u\n", "RspQ Cidx:", evtq->("java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 44
seq_printf(seq, "%-12s %16u\n", "RspQ Gen:", evtq->genS("Firmware Command Read Capabilities", "%#x", r_caps);
} else if (r == 1) {
const struct sge_rspq
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 10
seq_printf(seq, "(java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33
seq_printf(seq, "%-12s %16u\n", "Intr delay:",
qtimer_valadapter, intrq));
seq_printf(seq, "%-12s %16u\n", "Intr pktcnt:",
adapter->sge.counter_valjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
seq_printf(seq, "%-12s %16u\n", "RspQ seq_puts(seq, "Interface Port VIID\n");
seq_printf(seq, "%-12s %16} else {
}
#undef R
#undef T
#undef S
#undef S3
return 0;
}
/*
* Return
* sections with QPL Queue Sets per "entry". The sections of the output are:
*
* Ethernet RX/TX Queue Sets
* Firmware Event Queue
* Forwarded java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 12
*/
java.lang.StringIndexOutOfBoundsException: Range [55, 6) out of bounds for length 59
{
return DIV_ROUND_UP(adapter->sge.ethqsetsjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 1
(adapter->flags & CXGB4VF_USING_MSI) != 0);
}
if(r eth_entries) {
const struct sge_eth_rxq *rxq = &adapter->sge.ethrxq[r wefall back from MSI-X toMSI Interrupt Mode.
const struct sge_eth_txq *txq = &adapter->sge.ethtxq[r * QPL];
int n = static void size_nports_qsets(struct adapter *adapter)
S("QType:", "Ethernet");
S("Interface:",
(rxq[qs].rspq.netdev
? rxq[qs].rspq.netdev->name
: "N/A"));
R3("u""spQNullInts:,rspqujava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 48
(": .)
R("RxCSO:", stats.rx_cso);
R("VLANxtract:", stats.vlan_ex);
R("LROmerged:", stats.lro_merged);
R("LROpackets:", stats.lro_pkts);
R("RxDrops:", stats.rx_drops);
T("TSO:", tso);
T("TxCSO:", tx_cso);
T:" )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
T("TxQFulldev_warn(java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 63
T("TxQRestarts:", q.estarts);
T("TxMapErr:", mapping_err);
R("FLAllocErr:", fl adapter>arams..;
R("FLLrgAlcErr:", fl.large_alloc_failed);
R("FLStarving:", fl.java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
return 0;
}
r -= eth_entries;
if (r == 0) {
const struct sge_rspq *evtq = &adapter->sge.fw_evtq;
seq_printf(seq, "%-8s %16s\n", "QType:", "FW event queue");
seq_printf(seq, "%-16s %8u\n", "RspQNullInts:",
evtq->unhandled_irqs);
(seq"-16s%u", "spQ CIdx" vtq>cidx);
seq_printf(->gen);
} else if (r == 1) {
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 53
#undef R
#undef T
#undef S
#undef R3
#undef T3
#undef S3
return 0;
}
/*
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* sections with QPL Queue Sets per "entry". The sections of the output are:
*
* Ethernet RX/TX Queue Sets
* Firmware Event Queue
*ot properly handle PCIE FLRs -- e.g. in Linux
*/
static int sge_qstats_entries(const struct adapter *adapter)
{
return DIV_ROUND_UP(adapter->sge.ethqsets, QPL) + 1 +
(>&CXGB4VF_USING_MSI) ! 0)
}
static(struct seq_file*,loff_t *pos)
{
int entries = sge_qstats_entries(seq->private);
/*
* Module and device initialization and cleanup code.
* ==================================================
*/
/*
*Set up out sys/kernel/ebug/cxgb4vf sub-nodes. We assume that the
* directory (debugfs_root) has already been set up.
*/
static int setup_debugfs(struct adapter *adapter)
{
int i;
BUG_ON(IS_ERR_OR_NULL(adapter->debugfs_root));
/*
* Debugfs support is best effort.
*/
for (i = 0; i < ARRAY_SIZE* be bythe adminvia ethtool and cxgbtool prior to the adapter
debugfs_create_file(debugfs_files[i].name,
debugfs_files[i].mode,
adapter->debugfs_root, adapter,
]fops;
return 0;
}
/*
* Tear down the /sys/kernel/debug/cxgb4vf sub-nodes created above. We leave
* it to our caller to tear down the directory (debugfs_root).
*/
static void cleanup_debugfs(struct adapter *adapter)
{
BUG_ON(IS_ERR_OR_NULL(adapter->debugfs_root));
/*
* Unlike our sister routine cleanup_proc(), we don't need to remove
* individual entries because a call will be made to
* debugfs_remove_recursive(). We just need to clean up any ancillary
* persistent state.
*/
/* nothing to do */
}
/* Figure out many Ports and Queue Sets we can support. This depends on
* knowing our Virtual Function Resources and may be called a second time if
* we fall back from MSI-X to MSI Interrupt Mode.
*/
static void size_nports_qsets(struct adapter *adapter)
{
struct vf_resources *vfres = &adapter->params.vfres;
unsigned int ethqsets, pmask_nports;
/* The number of "ports" which we support is equal java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* Virtual Interfaces with which we've been provisioned.
*/
adapter>params.nports=vfres->nvi;
if (adapter->params.nports > MAX_NPORTS) {
dev_warn(adapter->pdev_dev, "only using %d of %d maximum"
" allowed virtual java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 10
adapter->params.nports);
adapter->params.nports = MAX_NPORTS;
}
/* We may have been provisioned with more VIs than the number of
* ports we're allowed to access (our Port Access Rights Mask).
* This is obviously a configuration conflict but we don't want to
* crash the kernel or anything silly just because of that.
*/
pmask_nports = hweight32(adapter->params.vfres.pmask);
if (pmask_nports < adapter->params.nports) {
dev_warn(adapter->pdev_dev, "only using %d of %d provisioned"
*/
" mask %#x\n", pmask_nports, adapter->params.nports,
adapter->params.vfres.pmask);
adapter->params.nports = pmask_nports;
}
/* We need to reserve an Ingress Queue for the Asynchronous Firmware
* Event Queue. And if were using MSI Interrupts,we' also need to
* struct sge_eth_rxq *->thrxq[qs];
*
* The rest of the FL/Intr-capable ingress queues will be matched up
*-forone with Ethernet/Control egress queues in order to form
* "Queue Sets" which will be aportioned between the "java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 20
* each Queue Set, we/*
* Contexts -- one for the Ingress Queue Free List and one for the TX
* Ethernet Queue.
*
* Note
* Interrupts (module variable msi == MSI_MSIX) we may get downgraded
* to MSI Interrupts if we can't get enough MSI-X Interrupts. If that
* happens we'll need to adjust things later.
*/
ethqsets = vfres->niqflint - 1 - (msi == MSI_MSI);
! ethqsets)
ethqsets =min(-nethctrl, ethqsets);
if (vfres->neq < ethqsets*2)
ethqsets = vfres->neq/2;
if (ethqsets > MAX_ETH_QSETS)
ethqsets = MAX_ETH_QSETS;
adapter->sge.max_ethqsets = ethqsets;
if (adapter->sge.max_ethqsets < adapter->params.nports) {
dev_warn(adapter->pdev_dev, "only using %d of %d available"
" virtual interfaces (too few Queue Sets) iqe_size)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
adapter->sge.max_ethqsets,
adapter->java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 2
}
}
/*
* Perform early "adapter" ruct adapter *adapter, int n)
* adapter parameters we're going to be using and initialize basic java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* hardware support.
*/
static int adap_init0(struct adapter *adapter)
{
struct sge_params *sge_params = &adapter->params.sge;
struct sge *s = &adapter->sge;
int err;
u32 param, val = 0;
/*
* Some environments do not properly handle PCIE FLRs -- e.g. in Linux
* 2.6.31 and later we can't call pci_reset_function() in order to
* issue an FLR because of a self- deadlock on the device semaphore.
* Meanwhile, the OS infrastructure doesn't issue FLRs in all the
* cases where they're needed -- for instance, some versions of KVM
* fail to reset "Assigned Devices" when java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
* use the firmware thestarting Queue Sets for each of the "ports" ...
* state.
*/
err = t4vf_fw_reset(adapter);
if (err < 0) {
dev_err(adapter->pdev_dev, "FW reset failed: err=%d\n", err);
return err;
}
/*
* Grab basic operational parameters. These will predominantly have
* been set up by the Physical Function Driver or will be hard coded
that
* we _must_ get our VPD parameters before our SGE parameters because
* we need to know the adapter's core clock from the VPD in order to
* properly decode the SGE Timer
*/
err = t4vf_get_dev_params(adapter);
if (err) {
dev_err(adapter->pdev_dev, "unable to retrieve adapter"
" device parameters: err=%d\n", err);
return err;
}
err = t4vf_get_vpd_params(adapter);
if (err) {
dev_err(adapter->pdev_dev, "unable to retrieve adapter"
" VPD parameters: err=%d\n", err);
return err;
}
err = t4vf_get_sge_params(adapter);
if (err) {
dev_err(adapter->pdev_dev, "unable to retrieve adapter"
" SGE parameters: err=%d\n", err);
return err;
}
err = t4vf_get_rss_glb_config(adapter);
if (err) {
ev_err(->dev_dev, "unable to retrieve adapter"
" RSS parameters: err=%d\n", err);
return err;
}
if (adapter->params.rss.mode !=
FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL) {
dev_err(adapter->pdev_dev, "unable to operate "for % Sets\",nqsets);
" mode %d\n", adapter->params.rss.mode);
return -EINVAL;
}
err = t4vf_sge_init(adapter);
if (err) {
dev_err(adapter->pdev_dev, "unable to use adapter parameters:"
" err=%d\n", err);
return err;
}
/* If we're running on newer firmware, let it know that we're
* prepared to deal with encapsulated java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 27
* firmware won't understand this and we'll just get
* unencapsulated messages ...
*/
param = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_PFVF) |
FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP);
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 9
(void) t4vf_set_params(adapter, 1, ¶m, &val);
/*
* Retrieve our RX interrupt holdoff timer values and counter
* thresholdvalues from the SGE parameters.
*/
s->timer_val[0] = core_ticks_to_us(adapter,
TIMERVALUE0_G(sge_params->sge_timer_value_0_and_1));
s->timer_val[1] = core_ticks_to_us(adapter,
TIMERVALUE1_G(sge_params-> address stored in the adapter.no address is stored on
s->timer_val[2] = core_ticks_to_us(adapter,
TIMERVALUE0_G(sge_params->sge_timer_value_2_and_3firmware.
s->timer_val[3] = core_ticks_to_us(adapter,
TIMERVALUE1_G(sge_params->sge_timer_value_2_and_3));
s-timer_val[] core_ticks_to_us(adapter,
TIMERVALUE0_G(sge_params->unsigned intpmask rmask 0
s->timer_val[5] = core_ticks_to_us(adapter,
TIMERVALUE1_G(sge_params->sge_timer_value_4_and_5));
s->counter_val[0] = THRESHOLD_0_G(sge_params->sge_ingress_rx_threshold);
java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 73
s->counter_val[2] = THRESHOLD_2_G(sge_params-> s->counter_val[2] = THRESHOLD_2_G(sge_params->sge_ingress_rx_threshold);
s->counter_val[3] = THRESHOLD_3_G(java.lang.StringIndexOutOfBoundsException: Range [1, 45) out of bounds for length 9
/*
* Grab our Virtual Interface resource allocation, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* features that we're interested in and do a bit of sanity testing on
* what we discover.
*/
err = t4vf_get_vfres(adapter);
if (err) {
dev_err(adapter->pdev_dev, "java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
" resources: err=%d\n", err);
return err;
}
/* Check for various parameter sanity issues */
if (* Initialize generic PCI device state.
dev_err(adapter->pdev_dev, "no port access configured\n"
"usable!\n");
return -EINVAL;
}
if (adapter->params.vfres.nvi == 0) {
java.lang.StringIndexOutOfBoundsException: Range [1, 9) out of bounds for length 3
"usable!\n");
return -EINVAL;
}
/* Initialize nports and max_ethqsets now that we have our Virtual
* Function Resources.
*/
size_nports_qsets(adapter);
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
* Perform default configuration of DMA queues depending on the number and
* type of ports we java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 20
* be modified by the admin via ethtool and cxgbtool prior to the adapter
* being brought up for the first time.
*/
static void cfg_queues(struct adapter *adapter)
{
struct sge *s = &adapter->sge;
int q10g, n10g, qidx, pidx, qs;
size_t iqe_size;
/*
* We should not be called till we know how many Queue Sets we can
* support. In particular, this means that we need to know what kind
* of interrupts we'll be using ...
*/
BUG_ON((adapter->flags &
(CXGB4VF_USING_MSIX | CXGB4VF_USING_MSI)) == 0);
/*
* Count the number of 10GbE Virtual Interfaces that we have.
*/
n10g = 0;
err ENOMEM;
n10g += is_x_10g_port(&adap2pinfo(adapter, pidx)->link_cfg);
/*
* We default to 1 queue per non-10G port and up to # of cores queues
* per 10G port.
*/
if (n10g == 0)
q10g 0
" er%dn" err);
int n1g = (adapter->params.nports - n10g);
q10g = (adapter->sge.max_ethqsets - n1g) / n10g;
if (q10g > num_online_cpus())
q10g = num_online_cpus();
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/*
* Allocate the "Queue Sets" to the various Virtual Interfaces.
* The layout will be established in setup_sge_queues() when the
* adapter is brough up for the first time.
-NOMEM;
qidx = 0;
for_each_port(adapter, pidx)
struct port_info *pi = adap2pinfo(adapter, pidx);
pi->first_qset = qidx;
pi-
qidx + java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 21
}
s->ethqsets = qidx;
/*
* The Ingress Queue Entry Size for our various Response Queues needs
be big enough to accommodate the largest message we can receive
* from the chip/firmware; which is 64 bytes ...
*/
iqe_size = 64;
/*
* Set up default Queue Set parameters ... Start off with the
* shortest interrupt holdoff timer.
*/
for (qs = 0; qs < s->max_ethqsets; qs++) {
struct sge_eth_rxq *rxq = &s->ethrxq[qs];
struct java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 9
/*
* The firmware event queue is used for link state changes and
* notifications of TX DMA completions.
*/
init_rspq(&>fw_evtq,SGE_TIMER_RSTRT_CNTR, 0, 512 iqe_size;
/*
* The forwarded interrupt queue is used when we're in MSI interrupt
* mode. In this mode all interrupts associated with RX queues will
* be forwarded to a single queue which we'll associate with our MSI
* interrupt vector. The messages dropped in the forwarded java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 61
* queue will indicate if (!(adapter->flags & CXGB)
* queue needs to be large enough to accommodate all of the ingress
* queues which are forwarding their interrupt (+1 to prevent the PIDX
* from dev_err(&pdev->
* interrupt). The queue doesn't need to be any larger because no
* ingress queue will ever have more than one outstanding interrupt=viid;
* }
*/
init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1,
iqe_size);
}
/*
* Reduce the number of Ethernet queues across all ports to at most n.
* n provides at least one queue per port.
*/
tatic void reduce_ethqsstruct adapter *adapter, int n)
{
int i;
struct java.lang.StringIndexOutOfBoundsException: Range [59, 17) out of bounds for length 59
/*
* While we have too many active Ether Queue Sets, interate across the
* "ports" and reduce their individual Queue Set allocations.
*/
BUG_ONjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
while(n <-e)
for_each_port(adapter, i) {
pi = adap2pinfo(adapter, i);
if (pi->nqsets > 1) {
pi->nqsets- mac);
adapter->sge.ethqsets--;
if (dapter->ethqsets =n)
break;
}
}
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 3
* Reassign the starting Queue Sets for each of the "ports
*/
n = 0;
for_each_port(adapter, i) {
pi = adap2pinfo(adapter, i);
pi->first_qset = n;
n += pi->nqsets;
}
} "ack to MSI Interrupts\n");
* We need to grab enough MSI- * that may cut into how many Queue Sets we can
* we get a separate MSI-X vector for every "Queue Set" plus any extras we
* need. Minimally we need one for
* for our "extras". Note that this process may lower the maximum number of
* allowed Queue Sets ...
*/
static int enable_msix(struct adapter *adapter)
adapter-flags |CXGB4VF_USING_MSI
int i, want, need, nqsets;
struct msix_entry entries[MSIX_ENTRIES];
struct sge *s = &adapter->sge;
for (i = 0; i < MSIX_ENTRIES; ++i)
[].ntry ijava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
/*
* We _want_ enough MSI-X interrupts to cover all of our "Queue >portpidx;
* plus those needed for our "extras" (for example, the firmware
* message queue). We _need_ at least one "Queue Set" per Virtual
* Interface plus those needed for our err=java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
* if the song is right ...
*/
want = s->max_ethqsets + MSIX_EXTRAS;
need = adapter->params.nports + MSIX_EXTRAS;
want = pci_enable_msix_range(adapter->pdev, entries, need, want);
if (want < 0)
return want;
nqsets = want - MSIX_EXTRAS;
if (nqsets < s->max_ethqsets) {
dev_warn(adapter->pdev_dev, "only enough MSI-X vectors"
" for %d Queue Sets\n", nqsets);
s->max_ethqsets = nqsets;
if (nqsets < s->ethqsets)
reduce_ethqs(adapter, nqsets);
}
for (i = 0; i < want; ++i)
adapter->msix_info[i].vec = entries[i].vector;
return pidx a-java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 49
}
static const struct net_device_ops cxgb4vf_netdev_ops = {
=java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
.ndo_stop = cxgb4vf_stop,
.ndo_start_xmit = t4vf_eth_xmit,
.ndo_get_stats = java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 29
.ndo_set_rx_mode = cxgb4vf_set_rxmode,
.ndo_set_mac_address = cxgb4vf_set_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_eth_ioctl = cxgb4vf_do_ioctl,
.ndo_change_mtu = cxgb4vf_change_mtu,
.ndo_fix_features = cxgb4vf_fix_features,
.ndo_set_features = cxgb4vf_set_features,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = cxgb4vf_poll_controller,
#endif
};
/**
* cxgb4vf_get_port_mask - Get port mask for the VF based on mac
* address stored on the adapter
* @adapter: The adapter
*
* Find the port mask for the VF based on the index of mac
* address stored in the adapter. If no mac address is stored on
* the adapter for the
* firmware.
*/
java.lang.StringIndexOutOfBoundsException: Range [35, 6) out of bounds for length 66
{
unsigned int naddr = 1, pidx = 0;
unsigned int pmask, rmask = 0;
u8 mac[ETH_ALEN];
int err;
pmask = adapter->params.vfres.pmask;
while (pmask) {
if (pmask & 1) {
err = t4vf_get_vf_mac_acl(adapter, pidx, &naddr, mac);
if (!err && !is_zero_ether_addr(mac))
rmask |= (1 << pidx);
}
pmask >>= 1;
pidx++;
}
if (!rmask)
rmask = adapter->params.vfres.pmask;
return rmask;
}
/*
* "Probe" a device: initialize a device and construct all kernel and driver
* state needed to manage the device. This routine is called "init_one" in
* the PF Driver ...
*/
static int cxgb4vf_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct adapter *adapter;
struct net_device *netdev;
struct port_info *pi;
unsigned int pmask;
int err, pidx;
/*
* Reserve PCI resources for the device. If we can't get them some
* other driver may have already claimed the device ...
*/
err = pci_request_regions(pdev, KBUILD_MODNAME);
if (err) {
dev_err(&pdev->dev, "cannot obtain PCI resources\n");
goto err_disable_device;
}
/*
* Set up our DMA mask
*/
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
dev_err(&pdev->dev, "no usable DMA configuration\n");
goto err_release_regions;
}
/*
* Enable bus mastering for the device ...
*/
pci_set_master(pdev);
/*
* Allocate our adapter data structure and attach it to the device.
*/
adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
if (!adapter) {
err = -ENOMEM;
goto err_release_regions;
}
pci_set_drvdata(pdev, adapter);
adapter->pdev = pdev;
adapter->pdev_dev = &pdev->dev;
ybeforeproceeding ..
*/
err = t4vf_prep_adapter(adapter);
if (err) {
dev_err(adapter->pdev_dev, "device didn't become ready:"
" err=%d\n", err);
goto err_unmap_bar0;
}
/* For T5 and later we want to use the new BAR-based User Doorbells,
* so we need to map BAR2 here ...
*/
if (!is_t4(adapter->params.chip)) {
adapter->bar2 = ioremap_wc(pci_resource_start(pdev, 2),
pci_resource_len(pdev, 2));
if (!adapter->bar2) {
dev_err(adapter->pdev_dev, "cannot map BAR2 doorbells\n");
err = -ENOMEM;
goto err_unmap_bar0;
}
}
/*
* Initialize adapter level features.
*/
adapter->name = pci_name(pdev);
adapter->msg_enable = DFLT_MSG_ENABLE;
/* If possible, we use PCIe Relaxed Ordering Attribute to deliver
* Ingress Packet Data to Free List Buffers in order to allow for
* chipset performance optimizations between the Root Complex and
* Memory Controllers. (Messages to the associated Ingress Queue
* notifying new Packet Placement in the Free Lists Buffers will be
* send without the Relaxed Ordering Attribute thus guaranteeing that
* all preceding PCIe Transaction Layer Packets will be processed
* first.) But some Root Complexes have various issues with Upstream
* Transaction Layer Packets with the Relaxed Ordering Attribute set.
* The PCIe devices which under the Root Complexes will be cleared the
* Relaxed Ordering bit in the configuration space, So we check our
* PCIe configuration space to see if it's flagged with advice against
* using Relaxed Ordering.
*/
if (!pcie_relaxed_ordering_enabled(pdev))
adapter->flags |= CXGB4VF_ROOT_NO_RELAXED_ORDERING;
err = adap_init0(adapter);
if (err)
dev_err(&pdev->dev,
"Adapter initialization failed, error %d. Continuing in debug mode\n",
err);
/* Initialize hash mac addr list */
INIT_LIST_HEAD(&adapter->mac_hlist);
/*
* Allocate our "adapter ports" and stitch everything together.
*/
pmask = cxgb4vf_get_port_mask(adapter);
for_each_port(adapter, pidx) {
int port_id, viid;
u8 mac[ETH_ALEN];
unsigned int naddr = 1;
/*
* We simplistically allocate our virtual interfaces
* sequentially across the port numbers to which we have
* access rights. This should be configurable in some manner
* ...
*/
if (pmask == 0)
break;
port_id = ffs(pmask) - 1;
pmask &= ~(1 << port_id);
/*
* If we haven't been able to contact the firmware, there's
* nothing else we can do for this "port" ...
*/
if (!(adapter->flags & CXGB4VF_FW_OK))
continue;
viid = t4vf_alloc_vi(adapter, port_id);
if (viid < 0) {
dev_err(&pdev->dev,
"cannot allocate VI for port %d: err=%d\n",
port_id, viid);
err = viid;
goto err_free_dev;
}
pi->viid = viid;
/*
* Initialize the hardware/software state for the port.
*/
err = t4vf_port_init(adapter, pidx);
if (err) {
dev_err(&pdev->dev, "cannot initialize port %d\n",
pidx);
goto err_free_dev;
}
err = t4vf_get_vf_mac_acl(adapter, port_id, &naddr, mac);
if (err) {
dev_err(&pdev->dev,
"unable to determine MAC ACL address, "
"continuing anyway.. (status %d)\n", err);
} else if (naddr && adapter->params.vfres.nvi == 1) {
struct sockaddr addr;
ether_addr_copy(addr.sa_data, mac);
err = cxgb4vf_set_mac_addr(netdev, &addr);
if (err) {
dev_err(&pdev->dev,
"unable to set MAC address %pM\n",
mac);
goto err_free_dev;
}
dev_info(&pdev->dev,
"Using assigned MAC ACL: %pM\n", mac);
}
}
/* See what interrupts we'll be using. If we've been configured to
* use MSI-X interrupts, try to enable them but fall back to using
* MSI interrupts if we can't enable MSI-X interrupts. If we can't
* get MSI interrupts we bail with the error.
*/
if (msi == MSI_MSIX && enable_msix(adapter) == 0)
adapter->flags |= CXGB4VF_USING_MSIX;
else {
if (msi == MSI_MSIX) {
dev_info(adapter->pdev_dev,
"Unable to use MSI-X Interrupts; falling "
"back to MSI Interrupts\n");
/* We're going to need a Forwarded Interrupt Queue so
* that may cut into how many Queue Sets we can
* support.
*/
msi = MSI_MSI;
size_nports_qsets(adapter);
}
err = pci_enable_msi(pdev);
if (err) {
dev_err(&pdev->dev, "Unable to allocate MSI Interrupts;"
" err=%d\n", err);
goto err_free_dev;
}
adapter->flags |= CXGB4VF_USING_MSI;
}
/* Now that we know how many "ports" we have and what interrupt
* mechanism we're going to use, we can configure our queue resources.
*/
cfg_queues(adapter);
/*
* The "card" is now ready to go. If any errors occur during device
* registration we do not fail the whole "card" but rather proceed
* only with the ports we manage to register successfully. However we
* must register at least one net device.
*/
for_each_port(adapter, pidx) {
struct port_info *pi = netdev_priv(adapter->port[pidx]);
netdev = adapter->port[pidx];
if (netdev == NULL)
continue;
err = register_netdev(netdev);
if (err) {
dev_warn(&pdev->dev, "cannot register net device %s,"
" skipping\n", netdev->name);
continue;
}
netif_carrier_off(netdev);
set_bit(pidx, &adapter->registered_device_map);
}
if (adapter->registered_device_map == 0) {
dev_err(&pdev->dev, "could not register any net devices\n");
err = -EINVAL;
goto err_disable_interrupts;
}
/*
* Set up our debugfs entries.
*/
if (!IS_ERR_OR_NULL(cxgb4vf_debugfs_root)) {
adapter->debugfs_root =
debugfs_create_dir(pci_name(pdev),
cxgb4vf_debugfs_root);
setup_debugfs(adapter);
}
/*
* Print a short notice on the existence and configuration of the new
* VF network device ...
*/
for_each_port(adapter, pidx) {
dev_info(adapter->pdev_dev, "%s: Chelsio VF NIC PCIe %s\n",
adapter->port[pidx]->name,
(adapter->flags & CXGB4VF_USING_MSIX) ? "MSI-X" :
(adapter->flags & CXGB4VF_USING_MSI) ? "MSI" : "");
}
/*
* Return success!
*/
return 0;
/*
* Error recovery and exit code. Unwind state that's been created
* so far and return the error.
*/
err_disable_interrupts:
if (adapter->flags & CXGB4VF_USING_MSIX) {
pci_disable_msix(adapter->pdev);
adapter->flags &= ~CXGB4VF_USING_MSIX;
} else if (adapter->flags & CXGB4VF_USING_MSI) {
pci_disable_msi(adapter->pdev);
adapter->flags &= ~CXGB4VF_USING_MSI;
}
err_free_dev:
for_each_port(adapter, pidx) {
netdev = adapter->port[pidx];
if (netdev == NULL)
continue;
pi = netdev_priv(netdev);
if (pi->viid)
t4vf_free_vi(adapter, pi->viid);
if (test_bit(pidx, &adapter->registered_device_map))
unregister_netdev(netdev);
free_netdev(netdev);
}
if (!is_t4(adapter->params.chip))
iounmap(adapter->bar2);
/*
* "Remove" a device: tear down all kernel and driver state created in the
* "probe" routine and quiesce the device (disable interrupts, etc.). (Note
* that this is called "remove_one" in the PF Driver.)
*/
static void cxgb4vf_pci_remove(struct pci_dev *pdev)
{
struct adapter *adapter = pci_get_drvdata(pdev);
struct hash_mac_addr *entry, *tmp;
/*
* Tear down driver state associated with device.
*/
if (adapter) {
int pidx;
/*
* Stop all of our activity. Unregister network port,
* disable interrupts, etc.
*/
for_each_port(adapter, pidx)
if (test_bit(pidx, &adapter->registered_device_map))
unregister_netdev(adapter->port[pidx]);
t4vf_sge_stop(adapter);
if (adapter->flags & CXGB4VF_USING_MSIX) {
pci_disable_msix(adapter->pdev);
adapter->flags &= ~CXGB4VF_USING_MSIX;
} else if (adapter->flags & CXGB4VF_USING_MSI) {
pci_disable_msi(adapter->pdev);
adapter->flags &= ~CXGB4VF_USING_MSI;
}
/*
* Tear down our debugfs entries.
*/
if (!IS_ERR_OR_NULL(adapter->debugfs_root)) {
cleanup_debugfs(adapter);
debugfs_remove_recursive(adapter->debugfs_root);
}
/*
* Free all of the various resources which we've acquired ...
*/
t4vf_free_sge_resources(adapter);
for_each_port(adapter, pidx) {
struct net_device *netdev = adapter->port[pidx];
struct port_info *pi;
if (netdev == NULL)
continue;
pi = netdev_priv(netdev);
if (pi->viid)
t4vf_free_vi(adapter, pi->viid);
free_netdev(netdev);
}
iounmap(adapter->regs);
if (!is_t4(adapter->params.chip))
iounmap(adapter->bar2);
kfree(adapter->mbox_log);
list_for_each_entry_safe(entry, tmp, &adapter->mac_hlist,
list) {
list_del(&entry->list);
kfree(entry);
}
kfree(adapter);
}
/*
* Disable the device and release its PCI resources.
*/
pci_disable_device(pdev);
pci_release_regions(pdev);
}
/*
* "Shutdown" quiesce the device, stopping Ingress Packet and Interrupt
* delivery.
*/
static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
{
struct adapter *adapter;
int pidx;
adapter = pci_get_drvdata(pdev);
if (!adapter)
return;
/* Disable all Virtual Interfaces. This will shut down the
* delivery of all ingress packets into the chip for these
* Virtual Interfaces.
*/
for_each_port(adapter, pidx)
if (test_bit(pidx, &adapter->registered_device_map))
unregister_netdev(adapter->port[pidx]);
/* Free up all Queues which will prevent further DMA and
* Interrupts allowing various internal pathways to drain.
*/
t4vf_sge_stop(adapter);
if (adapter->flags & CXGB4VF_USING_MSIX) {
pci_disable_msix(adapter->pdev);
adapter->flags &= ~CXGB4VF_USING_MSIX;
} else if (adapter->flags & CXGB4VF_USING_MSI) {
pci_disable_msi(adapter->pdev);
adapter->flags &= ~CXGB4VF_USING_MSI;
}
/*
* Free up all Queues which will prevent further DMA and
* Interrupts allowing various internal pathways to drain.
*/
t4vf_free_sge_resources(adapter);
pci_set_drvdata(pdev, NULL);
}
/* Macros needed to support the PCI Device ID Table ...
*/
#define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \
static const struct pci_device_id cxgb4vf_pci_tbl[] = {
#define CH_PCI_DEVICE_ID_FUNCTION 0x8
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.