Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88300
b: refs/heads/master
c: 44fb312
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Klein authored and Jeff Garzik committed Apr 12, 2008
1 parent b2c2dd4 commit 5f6eb1f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 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: 5a81f14330ce70bc256b624593768fd1b4170d27
refs/heads/master: 44fb3126d7e6fb411775551b4653643f1d28ebe9
3 changes: 2 additions & 1 deletion trunk/drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0089"
#define DRV_VERSION "EHEA_0090"

/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
Expand Down Expand Up @@ -371,6 +371,7 @@ struct ehea_port_res {
struct ehea_q_skb_arr rq2_skba;
struct ehea_q_skb_arr rq3_skba;
struct ehea_q_skb_arr sq_skba;
int sq_skba_size;
spinlock_t netif_queue;
int queue_stopped;
int swqe_refill_th;
Expand Down
24 changes: 22 additions & 2 deletions trunk/drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
pr->rq1_skba.os_skbs = 0;

if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
pr->rq1_skba.index = index;
if (nr_of_wqes > 0)
pr->rq1_skba.index = index;
pr->rq1_skba.os_skbs = fill_wqes;
return;
}
Expand Down Expand Up @@ -1464,7 +1465,9 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
init_attr->act_nr_rwqes_rq2,
init_attr->act_nr_rwqes_rq3);

ret = ehea_init_q_skba(&pr->sq_skba, init_attr->act_nr_send_wqes + 1);
pr->sq_skba_size = init_attr->act_nr_send_wqes + 1;

ret = ehea_init_q_skba(&pr->sq_skba, pr->sq_skba_size);
ret |= ehea_init_q_skba(&pr->rq1_skba, init_attr->act_nr_rwqes_rq1 + 1);
ret |= ehea_init_q_skba(&pr->rq2_skba, init_attr->act_nr_rwqes_rq2 + 1);
ret |= ehea_init_q_skba(&pr->rq3_skba, init_attr->act_nr_rwqes_rq3 + 1);
Expand Down Expand Up @@ -2621,6 +2624,22 @@ void ehea_purge_sq(struct ehea_qp *orig_qp)
}
}

void ehea_flush_sq(struct ehea_port *port)
{
int i;

for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
int k = 0;
while (atomic_read(&pr->swqe_avail) < swqe_max) {
msleep(5);
if (++k == 20)
break;
}
}
}

int ehea_stop_qps(struct net_device *dev)
{
struct ehea_port *port = netdev_priv(dev);
Expand Down Expand Up @@ -2845,6 +2864,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
if (dev->flags & IFF_UP) {
down(&port->port_lock);
netif_stop_queue(dev);
ehea_flush_sq(port);
ret = ehea_stop_qps(dev);
if (ret) {
up(&port->port_lock);
Expand Down

0 comments on commit 5f6eb1f

Please sign in to comment.