Commit 7495ab68 authored by Glenn Streiff's avatar Glenn Streiff Committed by Roland Dreier

RDMA/nes: Formatting cleanup

Various cleanups:
	- Change // to /* .. */
	- Place whitespace around binary operators.
	- Trim down a few long lines.
	- Some minor alignment formatting for better readability.
	- Remove some silly tabs.
Signed-off-by: default avatarGlenn Streiff <gstreiff@neteffect.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 0e1de5d6
...@@ -594,7 +594,7 @@ static void nes_cm_timer_tick(unsigned long pass) ...@@ -594,7 +594,7 @@ static void nes_cm_timer_tick(unsigned long pass)
continue; continue;
} }
/* this seems like the correct place, but leave send entry unprotected */ /* this seems like the correct place, but leave send entry unprotected */
// spin_unlock_irqrestore(&cm_node->retrans_list_lock, flags); /* spin_unlock_irqrestore(&cm_node->retrans_list_lock, flags); */
atomic_inc(&send_entry->skb->users); atomic_inc(&send_entry->skb->users);
cm_packets_retrans++; cm_packets_retrans++;
nes_debug(NES_DBG_CM, "Retransmitting send_entry %p for node %p," nes_debug(NES_DBG_CM, "Retransmitting send_entry %p for node %p,"
...@@ -1335,7 +1335,7 @@ static int process_packet(struct nes_cm_node *cm_node, struct sk_buff *skb, ...@@ -1335,7 +1335,7 @@ static int process_packet(struct nes_cm_node *cm_node, struct sk_buff *skb,
cm_node->loc_addr, cm_node->loc_port, cm_node->loc_addr, cm_node->loc_port,
cm_node->rem_addr, cm_node->rem_port, cm_node->rem_addr, cm_node->rem_port,
cm_node->state, atomic_read(&cm_node->ref_count)); cm_node->state, atomic_read(&cm_node->ref_count));
// create event /* create event */
cm_node->state = NES_CM_STATE_CLOSED; cm_node->state = NES_CM_STATE_CLOSED;
create_event(cm_node, NES_CM_EVENT_ABORTED); create_event(cm_node, NES_CM_EVENT_ABORTED);
...@@ -1669,7 +1669,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core, ...@@ -1669,7 +1669,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core,
if (!cm_node) if (!cm_node)
return NULL; return NULL;
// set our node side to client (active) side /* set our node side to client (active) side */
cm_node->tcp_cntxt.client = 1; cm_node->tcp_cntxt.client = 1;
cm_node->tcp_cntxt.rcv_wscale = NES_CM_DEFAULT_RCV_WND_SCALE; cm_node->tcp_cntxt.rcv_wscale = NES_CM_DEFAULT_RCV_WND_SCALE;
...@@ -1694,7 +1694,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core, ...@@ -1694,7 +1694,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core,
loopbackremotenode->mpa_frame_size = mpa_frame_size - loopbackremotenode->mpa_frame_size = mpa_frame_size -
sizeof(struct ietf_mpa_frame); sizeof(struct ietf_mpa_frame);
// we are done handling this state, set node to a TSA state /* we are done handling this state, set node to a TSA state */
cm_node->state = NES_CM_STATE_TSA; cm_node->state = NES_CM_STATE_TSA;
cm_node->tcp_cntxt.rcv_nxt = loopbackremotenode->tcp_cntxt.loc_seq_num; cm_node->tcp_cntxt.rcv_nxt = loopbackremotenode->tcp_cntxt.loc_seq_num;
loopbackremotenode->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.loc_seq_num; loopbackremotenode->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.loc_seq_num;
......
...@@ -833,7 +833,7 @@ static void nes_init_csr_ne020(struct nes_device *nesdev, u8 hw_rev, u8 port_cou ...@@ -833,7 +833,7 @@ static void nes_init_csr_ne020(struct nes_device *nesdev, u8 hw_rev, u8 port_cou
nes_write_indexed(nesdev, 0x00000900, 0x20000001); nes_write_indexed(nesdev, 0x00000900, 0x20000001);
nes_write_indexed(nesdev, 0x000060C0, 0x0000028e); nes_write_indexed(nesdev, 0x000060C0, 0x0000028e);
nes_write_indexed(nesdev, 0x000060C8, 0x00000020); nes_write_indexed(nesdev, 0x000060C8, 0x00000020);
//
nes_write_indexed(nesdev, 0x000001EC, 0x7b2625a0); nes_write_indexed(nesdev, 0x000001EC, 0x7b2625a0);
/* nes_write_indexed(nesdev, 0x000001EC, 0x5f2625a0); */ /* nes_write_indexed(nesdev, 0x000001EC, 0x5f2625a0); */
...@@ -1382,7 +1382,7 @@ int nes_init_phy(struct nes_device *nesdev) ...@@ -1382,7 +1382,7 @@ int nes_init_phy(struct nes_device *nesdev)
nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_COMMON_CONTROL0, sds_common_control0); nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_COMMON_CONTROL0, sds_common_control0);
i = 0; i = 0;
while (((nes_read32(nesdev->regs+NES_SOFTWARE_RESET) & 0x00000040) != 0x00000040) while (((nes_read32(nesdev->regs + NES_SOFTWARE_RESET) & 0x00000040) != 0x00000040)
&& (i++ < 5000)) { && (i++ < 5000)) {
/* mdelay(1); */ /* mdelay(1); */
} }
...@@ -1849,9 +1849,9 @@ int nes_napi_isr(struct nes_device *nesdev) ...@@ -1849,9 +1849,9 @@ int nes_napi_isr(struct nes_device *nesdev)
/* iff NIC, process here, else wait for DPC */ /* iff NIC, process here, else wait for DPC */
if ((int_stat) && ((int_stat & 0x0000ff00) == int_stat)) { if ((int_stat) && ((int_stat & 0x0000ff00) == int_stat)) {
nesdev->napi_isr_ran = 0; nesdev->napi_isr_ran = 0;
nes_write32(nesdev->regs+NES_INT_STAT, nes_write32(nesdev->regs + NES_INT_STAT,
(int_stat & (int_stat &
~(NES_INT_INTF|NES_INT_TIMER|NES_INT_MAC0|NES_INT_MAC1|NES_INT_MAC2|NES_INT_MAC3))); ~(NES_INT_INTF | NES_INT_TIMER | NES_INT_MAC0 | NES_INT_MAC1 | NES_INT_MAC2 | NES_INT_MAC3)));
/* Process the CEQs */ /* Process the CEQs */
nes_process_ceq(nesdev, &nesdev->nesadapter->ceq[nesdev->nic_ceq_index]); nes_process_ceq(nesdev, &nesdev->nesadapter->ceq[nesdev->nic_ceq_index]);
...@@ -1859,7 +1859,7 @@ int nes_napi_isr(struct nes_device *nesdev) ...@@ -1859,7 +1859,7 @@ int nes_napi_isr(struct nes_device *nesdev)
if (unlikely((((nesadapter->et_rx_coalesce_usecs_irq) && if (unlikely((((nesadapter->et_rx_coalesce_usecs_irq) &&
(!nesadapter->et_use_adaptive_rx_coalesce)) || (!nesadapter->et_use_adaptive_rx_coalesce)) ||
((nesadapter->et_use_adaptive_rx_coalesce) && ((nesadapter->et_use_adaptive_rx_coalesce) &&
(nesdev->deepcq_count > nesadapter->et_pkt_rate_low)))) ) { (nesdev->deepcq_count > nesadapter->et_pkt_rate_low))))) {
if ((nesdev->int_req & NES_INT_TIMER) == 0) { if ((nesdev->int_req & NES_INT_TIMER) == 0) {
/* Enable Periodic timer interrupts */ /* Enable Periodic timer interrupts */
nesdev->int_req |= NES_INT_TIMER; nesdev->int_req |= NES_INT_TIMER;
...@@ -1937,12 +1937,12 @@ void nes_dpc(unsigned long param) ...@@ -1937,12 +1937,12 @@ void nes_dpc(unsigned long param)
} }
if (int_stat) { if (int_stat) {
if (int_stat & ~(NES_INT_INTF|NES_INT_TIMER|NES_INT_MAC0| if (int_stat & ~(NES_INT_INTF | NES_INT_TIMER | NES_INT_MAC0|
NES_INT_MAC1|NES_INT_MAC2|NES_INT_MAC3)) { NES_INT_MAC1|NES_INT_MAC2 | NES_INT_MAC3)) {
/* Ack the interrupts */ /* Ack the interrupts */
nes_write32(nesdev->regs+NES_INT_STAT, nes_write32(nesdev->regs+NES_INT_STAT,
(int_stat & ~(NES_INT_INTF|NES_INT_TIMER|NES_INT_MAC0| (int_stat & ~(NES_INT_INTF | NES_INT_TIMER | NES_INT_MAC0|
NES_INT_MAC1|NES_INT_MAC2|NES_INT_MAC3))); NES_INT_MAC1 | NES_INT_MAC2 | NES_INT_MAC3)));
} }
temp_int_stat = int_stat; temp_int_stat = int_stat;
...@@ -2007,8 +2007,8 @@ void nes_dpc(unsigned long param) ...@@ -2007,8 +2007,8 @@ void nes_dpc(unsigned long param)
} }
} }
/* Don't use the interface interrupt bit stay in loop */ /* Don't use the interface interrupt bit stay in loop */
int_stat &= ~NES_INT_INTF|NES_INT_TIMER|NES_INT_MAC0| int_stat &= ~NES_INT_INTF | NES_INT_TIMER | NES_INT_MAC0 |
NES_INT_MAC1|NES_INT_MAC2|NES_INT_MAC3; NES_INT_MAC1 | NES_INT_MAC2 | NES_INT_MAC3;
} while ((int_stat != 0) && (loop_counter++ < MAX_DPC_ITERATIONS)); } while ((int_stat != 0) && (loop_counter++ < MAX_DPC_ITERATIONS));
if (timer_ints == 1) { if (timer_ints == 1) {
...@@ -2019,9 +2019,9 @@ void nes_dpc(unsigned long param) ...@@ -2019,9 +2019,9 @@ void nes_dpc(unsigned long param)
nesdev->timer_only_int_count = 0; nesdev->timer_only_int_count = 0;
nesdev->int_req &= ~NES_INT_TIMER; nesdev->int_req &= ~NES_INT_TIMER;
nes_write32(nesdev->regs + NES_INTF_INT_MASK, ~(nesdev->intf_int_req)); nes_write32(nesdev->regs + NES_INTF_INT_MASK, ~(nesdev->intf_int_req));
nes_write32(nesdev->regs+NES_INT_MASK, ~nesdev->int_req); nes_write32(nesdev->regs + NES_INT_MASK, ~nesdev->int_req);
} else { } else {
nes_write32(nesdev->regs+NES_INT_MASK, 0x0000ffff|(~nesdev->int_req)); nes_write32(nesdev->regs+NES_INT_MASK, 0x0000ffff | (~nesdev->int_req));
} }
} else { } else {
if (unlikely(nesadapter->et_use_adaptive_rx_coalesce)) if (unlikely(nesadapter->et_use_adaptive_rx_coalesce))
...@@ -2029,7 +2029,7 @@ void nes_dpc(unsigned long param) ...@@ -2029,7 +2029,7 @@ void nes_dpc(unsigned long param)
nes_nic_init_timer(nesdev); nes_nic_init_timer(nesdev);
} }
nesdev->timer_only_int_count = 0; nesdev->timer_only_int_count = 0;
nes_write32(nesdev->regs+NES_INT_MASK, 0x0000ffff|(~nesdev->int_req)); nes_write32(nesdev->regs+NES_INT_MASK, 0x0000ffff | (~nesdev->int_req));
} }
} else { } else {
nesdev->timer_only_int_count = 0; nesdev->timer_only_int_count = 0;
...@@ -2078,7 +2078,7 @@ static void nes_process_ceq(struct nes_device *nesdev, struct nes_hw_ceq *ceq) ...@@ -2078,7 +2078,7 @@ static void nes_process_ceq(struct nes_device *nesdev, struct nes_hw_ceq *ceq)
do { do {
if (le32_to_cpu(ceq->ceq_vbase[head].ceqe_words[NES_CEQE_CQ_CTX_HIGH_IDX]) & if (le32_to_cpu(ceq->ceq_vbase[head].ceqe_words[NES_CEQE_CQ_CTX_HIGH_IDX]) &
NES_CEQE_VALID) { NES_CEQE_VALID) {
u64temp = (((u64)(le32_to_cpu(ceq->ceq_vbase[head].ceqe_words[NES_CEQE_CQ_CTX_HIGH_IDX])))<<32) | u64temp = (((u64)(le32_to_cpu(ceq->ceq_vbase[head].ceqe_words[NES_CEQE_CQ_CTX_HIGH_IDX]))) << 32) |
((u64)(le32_to_cpu(ceq->ceq_vbase[head].ceqe_words[NES_CEQE_CQ_CTX_LOW_IDX]))); ((u64)(le32_to_cpu(ceq->ceq_vbase[head].ceqe_words[NES_CEQE_CQ_CTX_LOW_IDX])));
u64temp <<= 1; u64temp <<= 1;
cq = *((struct nes_hw_cq **)&u64temp); cq = *((struct nes_hw_cq **)&u64temp);
...@@ -2106,7 +2106,7 @@ static void nes_process_ceq(struct nes_device *nesdev, struct nes_hw_ceq *ceq) ...@@ -2106,7 +2106,7 @@ static void nes_process_ceq(struct nes_device *nesdev, struct nes_hw_ceq *ceq)
*/ */
static void nes_process_aeq(struct nes_device *nesdev, struct nes_hw_aeq *aeq) static void nes_process_aeq(struct nes_device *nesdev, struct nes_hw_aeq *aeq)
{ {
// u64 u64temp; /* u64 u64temp; */
u32 head; u32 head;
u32 aeq_size; u32 aeq_size;
u32 aeqe_misc; u32 aeqe_misc;
...@@ -2125,8 +2125,10 @@ static void nes_process_aeq(struct nes_device *nesdev, struct nes_hw_aeq *aeq) ...@@ -2125,8 +2125,10 @@ static void nes_process_aeq(struct nes_device *nesdev, struct nes_hw_aeq *aeq)
if (aeqe_misc & (NES_AEQE_QP|NES_AEQE_CQ)) { if (aeqe_misc & (NES_AEQE_QP|NES_AEQE_CQ)) {
if (aeqe_cq_id >= NES_FIRST_QPN) { if (aeqe_cq_id >= NES_FIRST_QPN) {
/* dealing with an accelerated QP related AE */ /* dealing with an accelerated QP related AE */
// u64temp = (((u64)(le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_HIGH_IDX])))<<32) | /*
// ((u64)(le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_LOW_IDX]))); * u64temp = (((u64)(le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_HIGH_IDX]))) << 32) |
* ((u64)(le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_LOW_IDX])));
*/
nes_process_iwarp_aeqe(nesdev, (struct nes_hw_aeqe *)aeqe); nes_process_iwarp_aeqe(nesdev, (struct nes_hw_aeqe *)aeqe);
} else { } else {
/* TODO: dealing with a CQP related AE */ /* TODO: dealing with a CQP related AE */
...@@ -2474,8 +2476,10 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq) ...@@ -2474,8 +2476,10 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
/* bump past the vlan tag */ /* bump past the vlan tag */
wqe_fragment_length++; wqe_fragment_length++;
if (le16_to_cpu(wqe_fragment_length[wqe_fragment_index]) != 0) { if (le16_to_cpu(wqe_fragment_length[wqe_fragment_index]) != 0) {
u64temp = (u64) le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_LOW_IDX+wqe_fragment_index*2]); u64temp = (u64) le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_LOW_IDX +
u64temp += ((u64)le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_HIGH_IDX+wqe_fragment_index*2]))<<32; wqe_fragment_index * 2]);
u64temp += ((u64)le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_HIGH_IDX +
wqe_fragment_index * 2])) << 32;
bus_address = (dma_addr_t)u64temp; bus_address = (dma_addr_t)u64temp;
if (test_and_clear_bit(nesnic->sq_tail, nesnic->first_frag_overflow)) { if (test_and_clear_bit(nesnic->sq_tail, nesnic->first_frag_overflow)) {
pci_unmap_single(nesdev->pcidev, pci_unmap_single(nesdev->pcidev,
...@@ -2485,8 +2489,10 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq) ...@@ -2485,8 +2489,10 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
} }
for (; wqe_fragment_index < 5; wqe_fragment_index++) { for (; wqe_fragment_index < 5; wqe_fragment_index++) {
if (wqe_fragment_length[wqe_fragment_index]) { if (wqe_fragment_length[wqe_fragment_index]) {
u64temp = le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_LOW_IDX+wqe_fragment_index*2]); u64temp = le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_LOW_IDX +
u64temp += ((u64)le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_HIGH_IDX+wqe_fragment_index*2]))<<32; wqe_fragment_index * 2]);
u64temp += ((u64)le32_to_cpu(nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_HIGH_IDX
+ wqe_fragment_index * 2])) <<32;
bus_address = (dma_addr_t)u64temp; bus_address = (dma_addr_t)u64temp;
pci_unmap_page(nesdev->pcidev, pci_unmap_page(nesdev->pcidev,
bus_address, bus_address,
...@@ -2533,7 +2539,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq) ...@@ -2533,7 +2539,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
if (atomic_read(&nesvnic->rx_skbs_needed) > (nesvnic->nic.rq_size>>1)) { if (atomic_read(&nesvnic->rx_skbs_needed) > (nesvnic->nic.rq_size>>1)) {
nes_write32(nesdev->regs+NES_CQE_ALLOC, nes_write32(nesdev->regs+NES_CQE_ALLOC,
cq->cq_number | (cqe_count << 16)); cq->cq_number | (cqe_count << 16));
// nesadapter->tune_timer.cq_count += cqe_count; /* nesadapter->tune_timer.cq_count += cqe_count; */
nesdev->currcq_count += cqe_count; nesdev->currcq_count += cqe_count;
cqe_count = 0; cqe_count = 0;
nes_replenish_nic_rq(nesvnic); nes_replenish_nic_rq(nesvnic);
...@@ -2608,7 +2614,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq) ...@@ -2608,7 +2614,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
/* Replenish Nic CQ */ /* Replenish Nic CQ */
nes_write32(nesdev->regs+NES_CQE_ALLOC, nes_write32(nesdev->regs+NES_CQE_ALLOC,
cq->cq_number | (cqe_count << 16)); cq->cq_number | (cqe_count << 16));
// nesdev->nesadapter->tune_timer.cq_count += cqe_count; /* nesdev->nesadapter->tune_timer.cq_count += cqe_count; */
nesdev->currcq_count += cqe_count; nesdev->currcq_count += cqe_count;
cqe_count = 0; cqe_count = 0;
} }
...@@ -2636,7 +2642,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq) ...@@ -2636,7 +2642,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
cq->cqe_allocs_pending = cqe_count; cq->cqe_allocs_pending = cqe_count;
if (unlikely(nesadapter->et_use_adaptive_rx_coalesce)) if (unlikely(nesadapter->et_use_adaptive_rx_coalesce))
{ {
// nesdev->nesadapter->tune_timer.cq_count += cqe_count; /* nesdev->nesadapter->tune_timer.cq_count += cqe_count; */
nesdev->currcq_count += cqe_count; nesdev->currcq_count += cqe_count;
nes_nic_tune_timer(nesdev); nes_nic_tune_timer(nesdev);
} }
...@@ -2671,7 +2677,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq) ...@@ -2671,7 +2677,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq)
if (le32_to_cpu(cq->cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX]) & NES_CQE_VALID) { if (le32_to_cpu(cq->cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX]) & NES_CQE_VALID) {
u64temp = (((u64)(le32_to_cpu(cq->cq_vbase[head]. u64temp = (((u64)(le32_to_cpu(cq->cq_vbase[head].
cqe_words[NES_CQE_COMP_COMP_CTX_HIGH_IDX])))<<32) | cqe_words[NES_CQE_COMP_COMP_CTX_HIGH_IDX]))) << 32) |
((u64)(le32_to_cpu(cq->cq_vbase[head]. ((u64)(le32_to_cpu(cq->cq_vbase[head].
cqe_words[NES_CQE_COMP_COMP_CTX_LOW_IDX]))); cqe_words[NES_CQE_COMP_COMP_CTX_LOW_IDX])));
cqp = *((struct nes_hw_cqp **)&u64temp); cqp = *((struct nes_hw_cqp **)&u64temp);
...@@ -2688,7 +2694,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq) ...@@ -2688,7 +2694,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq)
} }
u64temp = (((u64)(le32_to_cpu(nesdev->cqp.sq_vbase[cqp->sq_tail]. u64temp = (((u64)(le32_to_cpu(nesdev->cqp.sq_vbase[cqp->sq_tail].
wqe_words[NES_CQP_WQE_COMP_SCRATCH_HIGH_IDX])))<<32) | wqe_words[NES_CQP_WQE_COMP_SCRATCH_HIGH_IDX]))) << 32) |
((u64)(le32_to_cpu(nesdev->cqp.sq_vbase[cqp->sq_tail]. ((u64)(le32_to_cpu(nesdev->cqp.sq_vbase[cqp->sq_tail].
wqe_words[NES_CQP_WQE_COMP_SCRATCH_LOW_IDX]))); wqe_words[NES_CQP_WQE_COMP_SCRATCH_LOW_IDX])));
cqp_request = *((struct nes_cqp_request **)&u64temp); cqp_request = *((struct nes_cqp_request **)&u64temp);
...@@ -2725,7 +2731,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq) ...@@ -2725,7 +2731,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq)
} else { } else {
nes_debug(NES_DBG_CQP, "CQP request %p (opcode 0x%02X) freed.\n", nes_debug(NES_DBG_CQP, "CQP request %p (opcode 0x%02X) freed.\n",
cqp_request, cqp_request,
le32_to_cpu(cqp_request->cqp_wqe.wqe_words[NES_CQP_WQE_OPCODE_IDX])&0x3f); le32_to_cpu(cqp_request->cqp_wqe.wqe_words[NES_CQP_WQE_OPCODE_IDX]) & 0x3f);
if (cqp_request->dynamic) { if (cqp_request->dynamic) {
kfree(cqp_request); kfree(cqp_request);
} else { } else {
...@@ -2739,7 +2745,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq) ...@@ -2739,7 +2745,7 @@ static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq)
} }
cq->cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX] = 0; cq->cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX] = 0;
nes_write32(nesdev->regs+NES_CQE_ALLOC, cq->cq_number | (1 << 16)); nes_write32(nesdev->regs + NES_CQE_ALLOC, cq->cq_number | (1 << 16));
if (++cqp->sq_tail >= cqp->sq_size) if (++cqp->sq_tail >= cqp->sq_size)
cqp->sq_tail = 0; cqp->sq_tail = 0;
...@@ -2814,7 +2820,7 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, ...@@ -2814,7 +2820,7 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
aeqe_context = le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_LOW_IDX]); aeqe_context = le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_LOW_IDX]);
aeqe_context += ((u64)le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_HIGH_IDX])) << 32; aeqe_context += ((u64)le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_CTXT_HIGH_IDX])) << 32;
context = (unsigned long)nesadapter->qp_table[le32_to_cpu( context = (unsigned long)nesadapter->qp_table[le32_to_cpu(
aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX])-NES_FIRST_QPN]; aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]) - NES_FIRST_QPN];
BUG_ON(!context); BUG_ON(!context);
} }
...@@ -2827,7 +2833,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, ...@@ -2827,7 +2833,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]), aeqe, le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]), aeqe,
nes_tcp_state_str[tcp_state], nes_iwarp_state_str[iwarp_state]); nes_tcp_state_str[tcp_state], nes_iwarp_state_str[iwarp_state]);
switch (async_event_id) { switch (async_event_id) {
case NES_AEQE_AEID_LLP_FIN_RECEIVED: case NES_AEQE_AEID_LLP_FIN_RECEIVED:
nesqp = *((struct nes_qp **)&context); nesqp = *((struct nes_qp **)&context);
......
...@@ -969,7 +969,7 @@ struct nes_arp_entry { ...@@ -969,7 +969,7 @@ struct nes_arp_entry {
#define NES_NIC_CQ_DOWNWARD_TREND 16 #define NES_NIC_CQ_DOWNWARD_TREND 16
struct nes_hw_tune_timer { struct nes_hw_tune_timer {
//u16 cq_count; /* u16 cq_count; */
u16 threshold_low; u16 threshold_low;
u16 threshold_target; u16 threshold_target;
u16 threshold_high; u16 threshold_high;
......
...@@ -187,6 +187,7 @@ static int nes_netdev_open(struct net_device *netdev) ...@@ -187,6 +187,7 @@ static int nes_netdev_open(struct net_device *netdev)
macaddr_high = ((u16)netdev->dev_addr[0]) << 8; macaddr_high = ((u16)netdev->dev_addr[0]) << 8;
macaddr_high += (u16)netdev->dev_addr[1]; macaddr_high += (u16)netdev->dev_addr[1];
macaddr_low = ((u32)netdev->dev_addr[2]) << 24; macaddr_low = ((u32)netdev->dev_addr[2]) << 24;
macaddr_low += ((u32)netdev->dev_addr[3]) << 16; macaddr_low += ((u32)netdev->dev_addr[3]) << 16;
macaddr_low += ((u32)netdev->dev_addr[4]) << 8; macaddr_low += ((u32)netdev->dev_addr[4]) << 8;
...@@ -451,7 +452,7 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -451,7 +452,7 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
__le16 *wqe_fragment_length; __le16 *wqe_fragment_length;
u32 nr_frags; u32 nr_frags;
u32 original_first_length; u32 original_first_length;
// u64 *wqe_fragment_address; /* u64 *wqe_fragment_address; */
/* first fragment (0) is used by copy buffer */ /* first fragment (0) is used by copy buffer */
u16 wqe_fragment_index=1; u16 wqe_fragment_index=1;
u16 hoffset; u16 hoffset;
...@@ -461,10 +462,11 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -461,10 +462,11 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
u32 old_head; u32 old_head;
u32 wqe_misc; u32 wqe_misc;
/* nes_debug(NES_DBG_NIC_TX, "%s Request to tx NIC packet length %u, headlen %u," /*
" (%u frags), tso_size=%u\n", * nes_debug(NES_DBG_NIC_TX, "%s Request to tx NIC packet length %u, headlen %u,"
netdev->name, skb->len, skb_headlen(skb), * " (%u frags), tso_size=%u\n",
skb_shinfo(skb)->nr_frags, skb_is_gso(skb)); * netdev->name, skb->len, skb_headlen(skb),
* skb_shinfo(skb)->nr_frags, skb_is_gso(skb));
*/ */
if (!netif_carrier_ok(netdev)) if (!netif_carrier_ok(netdev))
...@@ -915,7 +917,7 @@ static int nes_netdev_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -915,7 +917,7 @@ static int nes_netdev_change_mtu(struct net_device *netdev, int new_mtu)
struct nes_vnic *nesvnic = netdev_priv(netdev); struct nes_vnic *nesvnic = netdev_priv(netdev);
struct nes_device *nesdev = nesvnic->nesdev; struct nes_device *nesdev = nesvnic->nesdev;
int ret = 0; int ret = 0;
u8 jumbomode=0; u8 jumbomode = 0;
if ((new_mtu < ETH_ZLEN) || (new_mtu > max_mtu)) if ((new_mtu < ETH_ZLEN) || (new_mtu > max_mtu))
return -EINVAL; return -EINVAL;
...@@ -1438,7 +1440,7 @@ static int nes_netdev_set_settings(struct net_device *netdev, struct ethtool_cmd ...@@ -1438,7 +1440,7 @@ static int nes_netdev_set_settings(struct net_device *netdev, struct ethtool_cmd
/* Turn on Full duplex, Autoneg, and restart autonegotiation */ /* Turn on Full duplex, Autoneg, and restart autonegotiation */
phy_data |= 0x1300; phy_data |= 0x1300;
} else { } else {
// Turn off autoneg /* Turn off autoneg */
phy_data &= ~0x1000; phy_data &= ~0x1000;
} }
nes_write_1G_phy_reg(nesdev, 0, nesadapter->phy_index[nesdev->mac_index], nes_write_1G_phy_reg(nesdev, 0, nesadapter->phy_index[nesdev->mac_index],
......
...@@ -1266,7 +1266,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, ...@@ -1266,7 +1266,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
sq_size = init_attr->cap.max_send_wr; sq_size = init_attr->cap.max_send_wr;
rq_size = init_attr->cap.max_recv_wr; rq_size = init_attr->cap.max_recv_wr;
// check if the encoded sizes are OK or not... /* check if the encoded sizes are OK or not... */
sq_encoded_size = nes_get_encoded_size(&sq_size); sq_encoded_size = nes_get_encoded_size(&sq_size);
rq_encoded_size = nes_get_encoded_size(&rq_size); rq_encoded_size = nes_get_encoded_size(&rq_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment