Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215216
b: refs/heads/master
c: a47d605
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Oct 18, 2010
1 parent d1cf7a7 commit ca6298f
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 90 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c473fc33915ddb14b71a4929c838c22b20a24ce
refs/heads/master: a47d60561e111f5009ad0964069cfff77f76dbaa
17 changes: 6 additions & 11 deletions trunk/drivers/net/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* (you will need to reboot afterwards) */
/* #define BNX2X_STOP_ON_ERROR */

#define DRV_MODULE_VERSION "1.60.00-1"
#define DRV_MODULE_RELDATE "2010/10/06"
#define DRV_MODULE_VERSION "1.60.00-2"
#define DRV_MODULE_RELDATE "2010/10/18"
#define BNX2X_BC_VER 0x040200

#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
Expand Down Expand Up @@ -1180,15 +1180,10 @@ struct bnx2x {
TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY

/* func init flags */
#define FUNC_FLG_RSS 0x0001
#define FUNC_FLG_STATS 0x0002
/* removed FUNC_FLG_UNMATCHED 0x0004 */
#define FUNC_FLG_TPA 0x0008
#define FUNC_FLG_SPQ 0x0010
#define FUNC_FLG_LEADING 0x0020 /* PF only */

#define FUNC_CONFIG(flgs) ((flgs) & (FUNC_FLG_RSS | FUNC_FLG_TPA | \
FUNC_FLG_LEADING))
#define FUNC_FLG_STATS 0x0001
#define FUNC_FLG_TPA 0x0002
#define FUNC_FLG_SPQ 0x0004
#define FUNC_FLG_LEADING 0x0008 /* PF only */

struct rxq_pause_params {
u16 bd_th_lo;
Expand Down
21 changes: 13 additions & 8 deletions trunk/drivers/net/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,11 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
len = le16_to_cpu(cqe->fast_path_cqe.pkt_len);
pad = cqe->fast_path_cqe.placement_offset;

/* If CQE is marked both TPA_START and TPA_END
it is a non-TPA CQE */
/* - If CQE is marked both TPA_START and TPA_END it is
* a non-TPA CQE.
* - FP CQE will always have either TPA_START or/and
* TPA_STOP flags set.
*/
if ((!fp->disable_tpa) &&
(TPA_TYPE(cqe_fp_flags) !=
(TPA_TYPE_START | TPA_TYPE_END))) {
Expand All @@ -526,9 +529,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
bnx2x_set_skb_rxhash(bp, cqe, skb);

goto next_rx;
}

if (TPA_TYPE(cqe_fp_flags) == TPA_TYPE_END) {
} else { /* TPA_STOP */
DP(NETIF_MSG_RX_STATUS,
"calling tpa_stop on queue %d\n",
queue);
Expand Down Expand Up @@ -830,7 +831,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp)
int i, j;

bp->rx_buf_size = bp->dev->mtu + ETH_OVREHEAD + BNX2X_RX_ALIGN +
BNX2X_FW_IP_HDR_ALIGN_PAD;
IP_HEADER_ALIGNMENT_PADDING;

DP(NETIF_MSG_IFUP,
"mtu %d rx_buf_size %d\n", bp->dev->mtu, bp->rx_buf_size);
Expand Down Expand Up @@ -1288,8 +1289,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
if (rc) {
BNX2X_ERR("HW init failed, aborting\n");
bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_DONE, 0);
bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP, 0);
bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0);
goto load_error2;
}

Expand Down Expand Up @@ -1522,6 +1521,12 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state)
{
u16 pmcsr;

/* If there is no power capability, silently succeed */
if (!bp->pm_cap) {
DP(NETIF_MSG_HW, "No power capability. Breaking.\n");
return 0;
}

pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);

switch (state) {
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/bnx2x/bnx2x_cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,4 @@ static inline void storm_memset_cmng(struct bnx2x *bp,
void bnx2x_acquire_phy_lock(struct bnx2x *bp);
void bnx2x_release_phy_lock(struct bnx2x *bp);

#define BNX2X_FW_IP_HDR_ALIGN_PAD 2 /* FW places hdr with this padding */

#endif /* BNX2X_CMN_H */
70 changes: 30 additions & 40 deletions trunk/drivers/net/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,35 +2284,31 @@ void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters)

void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p)
{
if (FUNC_CONFIG(p->func_flgs)) {
struct tstorm_eth_function_common_config tcfg = {0};

/* tpa */
if (p->func_flgs & FUNC_FLG_TPA)
tcfg.config_flags |=
TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;

/* set rss flags */
if (p->func_flgs & FUNC_FLG_RSS) {
u16 rss_flgs = (p->rss->mode <<
TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);

if (p->rss->cap & RSS_IPV4_CAP)
rss_flgs |= RSS_IPV4_CAP_MASK;
if (p->rss->cap & RSS_IPV4_TCP_CAP)
rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
if (p->rss->cap & RSS_IPV6_CAP)
rss_flgs |= RSS_IPV6_CAP_MASK;
if (p->rss->cap & RSS_IPV6_TCP_CAP)
rss_flgs |= RSS_IPV6_TCP_CAP_MASK;

tcfg.config_flags |= rss_flgs;
tcfg.rss_result_mask = p->rss->result_mask;
struct tstorm_eth_function_common_config tcfg = {0};
u16 rss_flgs;

}
/* tpa */
if (p->func_flgs & FUNC_FLG_TPA)
tcfg.config_flags |=
TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;

storm_memset_func_cfg(bp, &tcfg, p->func_id);
}
/* set rss flags */
rss_flgs = (p->rss->mode <<
TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);

if (p->rss->cap & RSS_IPV4_CAP)
rss_flgs |= RSS_IPV4_CAP_MASK;
if (p->rss->cap & RSS_IPV4_TCP_CAP)
rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
if (p->rss->cap & RSS_IPV6_CAP)
rss_flgs |= RSS_IPV6_CAP_MASK;
if (p->rss->cap & RSS_IPV6_TCP_CAP)
rss_flgs |= RSS_IPV6_TCP_CAP_MASK;

tcfg.config_flags |= rss_flgs;
tcfg.rss_result_mask = p->rss->result_mask;

storm_memset_func_cfg(bp, &tcfg, p->func_id);

/* Enable the function in the FW */
storm_memset_vf_to_pf(bp, p->func_id, p->pf_id);
Expand Down Expand Up @@ -2479,23 +2475,17 @@ void bnx2x_pf_init(struct bnx2x *bp)
else
flags |= FUNC_FLG_TPA;

/* function setup */

/**
* Although RSS is meaningless when there is a single HW queue we
* still need it enabled in order to have HW Rx hash generated.
*
* if (is_eth_multi(bp))
* flags |= FUNC_FLG_RSS;
*/
flags |= FUNC_FLG_RSS;

/* function setup */
if (flags & FUNC_FLG_RSS) {
rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP |
RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
rss.mode = bp->multi_mode;
rss.result_mask = MULTI_MASK;
func_init.rss = &rss;
}
rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP |
RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
rss.mode = bp->multi_mode;
rss.result_mask = MULTI_MASK;
func_init.rss = &rss;

func_init.func_flgs = flags;
func_init.pf_id = BP_FUNC(bp);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ns83820.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ static int ns83820_setup_rx(struct net_device *ndev)
phy_intr(ndev);

/* Okay, let it rip */
spin_lock_irq(&dev->misc_lock);
spin_lock(&dev->misc_lock);
dev->IMR_cache |= ISR_PHY;
dev->IMR_cache |= ISR_RXRCMP;
//dev->IMR_cache |= ISR_RXERR;
Expand Down
38 changes: 11 additions & 27 deletions trunk/net/tipc/bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ static struct bearer *bearer_find(const char *name)
struct bearer *b_ptr;
u32 i;

if (tipc_mode != TIPC_NET_MODE)
return NULL;

for (i = 0, b_ptr = tipc_bearers; i < MAX_BEARERS; i++, b_ptr++) {
if (b_ptr->active && (!strcmp(b_ptr->publ.name, name)))
return b_ptr;
Expand Down Expand Up @@ -630,30 +627,17 @@ int tipc_block_bearer(const char *name)
* Note: This routine assumes caller holds tipc_net_lock.
*/

static int bearer_disable(const char *name)
static int bearer_disable(struct bearer *b_ptr)
{
struct bearer *b_ptr;
struct link *l_ptr;
struct link *temp_l_ptr;

b_ptr = bearer_find(name);
if (!b_ptr) {
warn("Attempt to disable unknown bearer <%s>\n", name);
return -EINVAL;
}

info("Disabling bearer <%s>\n", name);
info("Disabling bearer <%s>\n", b_ptr->publ.name);
tipc_disc_stop_link_req(b_ptr->link_req);
spin_lock_bh(&b_ptr->publ.lock);
b_ptr->link_req = NULL;
b_ptr->publ.blocked = 1;
if (b_ptr->media->disable_bearer) {
spin_unlock_bh(&b_ptr->publ.lock);
write_unlock_bh(&tipc_net_lock);
b_ptr->media->disable_bearer(&b_ptr->publ);
write_lock_bh(&tipc_net_lock);
spin_lock_bh(&b_ptr->publ.lock);
}
b_ptr->media->disable_bearer(&b_ptr->publ);
list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
tipc_link_delete(l_ptr);
}
Expand All @@ -664,10 +648,16 @@ static int bearer_disable(const char *name)

int tipc_disable_bearer(const char *name)
{
struct bearer *b_ptr;
int res;

write_lock_bh(&tipc_net_lock);
res = bearer_disable(name);
b_ptr = bearer_find(name);
if (b_ptr == NULL) {
warn("Attempt to disable unknown bearer <%s>\n", name);
res = -EINVAL;
} else
res = bearer_disable(b_ptr);
write_unlock_bh(&tipc_net_lock);
return res;
}
Expand All @@ -680,13 +670,7 @@ void tipc_bearer_stop(void)

for (i = 0; i < MAX_BEARERS; i++) {
if (tipc_bearers[i].active)
tipc_bearers[i].publ.blocked = 1;
}
for (i = 0; i < MAX_BEARERS; i++) {
if (tipc_bearers[i].active)
bearer_disable(tipc_bearers[i].publ.name);
bearer_disable(&tipc_bearers[i]);
}
media_count = 0;
}


0 comments on commit ca6298f

Please sign in to comment.