| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_ixl.c,v 1.41 2020/02/12 06:37:21 yamaguchi Exp $ */ | | 1 | /* $NetBSD: if_ixl.c,v 1.42 2020/02/12 06:41:44 yamaguchi Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2013-2015, Intel Corporation | | 4 | * Copyright (c) 2013-2015, Intel Corporation |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | | | 6 | |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions are met: | | 8 | * modification, are permitted provided that the following conditions are met: |
9 | * | | 9 | * |
10 | * 1. Redistributions of source code must retain the above copyright notice, | | 10 | * 1. Redistributions of source code must retain the above copyright notice, |
11 | * this list of conditions and the following disclaimer. | | 11 | * this list of conditions and the following disclaimer. |
12 | * | | 12 | * |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -3389,29 +3389,26 @@ ixl_rxfill(struct ixl_softc *sc, struct | | | @@ -3389,29 +3389,26 @@ ixl_rxfill(struct ixl_softc *sc, struct |
3389 | return error; | | 3389 | return error; |
3390 | } | | 3390 | } |
3391 | | | 3391 | |
3392 | static inline int | | 3392 | static inline int |
3393 | ixl_handle_queue_common(struct ixl_softc *sc, struct ixl_queue_pair *qp, | | 3393 | ixl_handle_queue_common(struct ixl_softc *sc, struct ixl_queue_pair *qp, |
3394 | u_int txlimit, struct evcnt *txevcnt, | | 3394 | u_int txlimit, struct evcnt *txevcnt, |
3395 | u_int rxlimit, struct evcnt *rxevcnt) | | 3395 | u_int rxlimit, struct evcnt *rxevcnt) |
3396 | { | | 3396 | { |
3397 | struct ixl_tx_ring *txr = qp->qp_txr; | | 3397 | struct ixl_tx_ring *txr = qp->qp_txr; |
3398 | struct ixl_rx_ring *rxr = qp->qp_rxr; | | 3398 | struct ixl_rx_ring *rxr = qp->qp_rxr; |
3399 | int txmore, rxmore; | | 3399 | int txmore, rxmore; |
3400 | int rv; | | 3400 | int rv; |
3401 | | | 3401 | |
3402 | KASSERT(!mutex_owned(&txr->txr_lock)); | | | |
3403 | KASSERT(!mutex_owned(&rxr->rxr_lock)); | | | |
3404 | | | | |
3405 | mutex_enter(&txr->txr_lock); | | 3402 | mutex_enter(&txr->txr_lock); |
3406 | txevcnt->ev_count++; | | 3403 | txevcnt->ev_count++; |
3407 | txmore = ixl_txeof(sc, txr, txlimit); | | 3404 | txmore = ixl_txeof(sc, txr, txlimit); |
3408 | mutex_exit(&txr->txr_lock); | | 3405 | mutex_exit(&txr->txr_lock); |
3409 | | | 3406 | |
3410 | mutex_enter(&rxr->rxr_lock); | | 3407 | mutex_enter(&rxr->rxr_lock); |
3411 | rxevcnt->ev_count++; | | 3408 | rxevcnt->ev_count++; |
3412 | rxmore = ixl_rxeof(sc, rxr, rxlimit); | | 3409 | rxmore = ixl_rxeof(sc, rxr, rxlimit); |
3413 | mutex_exit(&rxr->rxr_lock); | | 3410 | mutex_exit(&rxr->rxr_lock); |
3414 | | | 3411 | |
3415 | rv = txmore | (rxmore << 1); | | 3412 | rv = txmore | (rxmore << 1); |
3416 | | | 3413 | |
3417 | return rv; | | 3414 | return rv; |