aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea/ehea_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ehea/ehea_main.c')
-rw-r--r--drivers/net/ehea/ehea_main.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 0c1c360a85ca..9ff7538b7595 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -350,7 +350,8 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
350 pr->rq1_skba.os_skbs = 0; 350 pr->rq1_skba.os_skbs = 0;
351 351
352 if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) { 352 if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
353 pr->rq1_skba.index = index; 353 if (nr_of_wqes > 0)
354 pr->rq1_skba.index = index;
354 pr->rq1_skba.os_skbs = fill_wqes; 355 pr->rq1_skba.os_skbs = fill_wqes;
355 return; 356 return;
356 } 357 }
@@ -1465,7 +1466,9 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
1465 init_attr->act_nr_rwqes_rq2, 1466 init_attr->act_nr_rwqes_rq2,
1466 init_attr->act_nr_rwqes_rq3); 1467 init_attr->act_nr_rwqes_rq3);
1467 1468
1468 ret = ehea_init_q_skba(&pr->sq_skba, init_attr->act_nr_send_wqes + 1); 1469 pr->sq_skba_size = init_attr->act_nr_send_wqes + 1;
1470
1471 ret = ehea_init_q_skba(&pr->sq_skba, pr->sq_skba_size);
1469 ret |= ehea_init_q_skba(&pr->rq1_skba, init_attr->act_nr_rwqes_rq1 + 1); 1472 ret |= ehea_init_q_skba(&pr->rq1_skba, init_attr->act_nr_rwqes_rq1 + 1);
1470 ret |= ehea_init_q_skba(&pr->rq2_skba, init_attr->act_nr_rwqes_rq2 + 1); 1473 ret |= ehea_init_q_skba(&pr->rq2_skba, init_attr->act_nr_rwqes_rq2 + 1);
1471 ret |= ehea_init_q_skba(&pr->rq3_skba, init_attr->act_nr_rwqes_rq3 + 1); 1474 ret |= ehea_init_q_skba(&pr->rq3_skba, init_attr->act_nr_rwqes_rq3 + 1);
@@ -2622,6 +2625,22 @@ void ehea_purge_sq(struct ehea_qp *orig_qp)
2622 } 2625 }
2623} 2626}
2624 2627
2628void ehea_flush_sq(struct ehea_port *port)
2629{
2630 int i;
2631
2632 for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
2633 struct ehea_port_res *pr = &port->port_res[i];
2634 int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
2635 int k = 0;
2636 while (atomic_read(&pr->swqe_avail) < swqe_max) {
2637 msleep(5);
2638 if (++k == 20)
2639 break;
2640 }
2641 }
2642}
2643
2625int ehea_stop_qps(struct net_device *dev) 2644int ehea_stop_qps(struct net_device *dev)
2626{ 2645{
2627 struct ehea_port *port = netdev_priv(dev); 2646 struct ehea_port *port = netdev_priv(dev);
@@ -2849,6 +2868,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
2849 if (dev->flags & IFF_UP) { 2868 if (dev->flags & IFF_UP) {
2850 mutex_lock(&port->port_lock); 2869 mutex_lock(&port->port_lock);
2851 netif_stop_queue(dev); 2870 netif_stop_queue(dev);
2871 ehea_flush_sq(port);
2852 ret = ehea_stop_qps(dev); 2872 ret = ehea_stop_qps(dev);
2853 if (ret) { 2873 if (ret) {
2854 mutex_unlock(&port->port_lock); 2874 mutex_unlock(&port->port_lock);