| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ix_txrx.c,v 1.24.2.13 2018/09/07 12:37:20 martin Exp $ */ | | 1 | /* $NetBSD: ix_txrx.c,v 1.24.2.14 2018/12/20 11:34:33 martin Exp $ */ |
2 | | | 2 | |
3 | /****************************************************************************** | | 3 | /****************************************************************************** |
4 | | | 4 | |
5 | Copyright (c) 2001-2017, Intel Corporation | | 5 | Copyright (c) 2001-2017, Intel Corporation |
6 | All rights reserved. | | 6 | All rights reserved. |
7 | | | 7 | |
8 | Redistribution and use in source and binary forms, with or without | | 8 | Redistribution and use in source and binary forms, with or without |
9 | modification, are permitted provided that the following conditions are met: | | 9 | modification, are permitted provided that the following conditions are met: |
10 | | | 10 | |
11 | 1. Redistributions of source code must retain the above copyright notice, | | 11 | 1. Redistributions of source code must retain the above copyright notice, |
12 | this list of conditions and the following disclaimer. | | 12 | this list of conditions and the following disclaimer. |
13 | | | 13 | |
14 | 2. Redistributions in binary form must reproduce the above copyright | | 14 | 2. Redistributions in binary form must reproduce the above copyright |
| @@ -220,27 +220,27 @@ ixgbe_mq_start(struct ifnet *ifp, struct | | | @@ -220,27 +220,27 @@ ixgbe_mq_start(struct ifnet *ifp, struct |
220 | (rss_hash2bucket(m->m_pkthdr.flowid, M_HASHTYPE_GET(m), | | 220 | (rss_hash2bucket(m->m_pkthdr.flowid, M_HASHTYPE_GET(m), |
221 | &bucket_id) == 0)) { | | 221 | &bucket_id) == 0)) { |
222 | i = bucket_id % adapter->num_queues; | | 222 | i = bucket_id % adapter->num_queues; |
223 | #ifdef IXGBE_DEBUG | | 223 | #ifdef IXGBE_DEBUG |
224 | if (bucket_id > adapter->num_queues) | | 224 | if (bucket_id > adapter->num_queues) |
225 | if_printf(ifp, | | 225 | if_printf(ifp, |
226 | "bucket_id (%d) > num_queues (%d)\n", | | 226 | "bucket_id (%d) > num_queues (%d)\n", |
227 | bucket_id, adapter->num_queues); | | 227 | bucket_id, adapter->num_queues); |
228 | #endif | | 228 | #endif |
229 | } else | | 229 | } else |
230 | i = m->m_pkthdr.flowid % adapter->num_queues; | | 230 | i = m->m_pkthdr.flowid % adapter->num_queues; |
231 | } else | | 231 | } else |
232 | #endif /* 0 */ | | 232 | #endif /* 0 */ |
233 | i = cpu_index(curcpu()) % adapter->num_queues; | | 233 | i = (cpu_index(curcpu()) % ncpu) % adapter->num_queues; |
234 | | | 234 | |
235 | /* Check for a hung queue and pick alternative */ | | 235 | /* Check for a hung queue and pick alternative */ |
236 | if (((1 << i) & adapter->active_queues) == 0) | | 236 | if (((1 << i) & adapter->active_queues) == 0) |
237 | i = ffs64(adapter->active_queues); | | 237 | i = ffs64(adapter->active_queues); |
238 | | | 238 | |
239 | txr = &adapter->tx_rings[i]; | | 239 | txr = &adapter->tx_rings[i]; |
240 | | | 240 | |
241 | if (__predict_false(!pcq_put(txr->txr_interq, m))) { | | 241 | if (__predict_false(!pcq_put(txr->txr_interq, m))) { |
242 | m_freem(m); | | 242 | m_freem(m); |
243 | txr->pcq_drops.ev_count++; | | 243 | txr->pcq_drops.ev_count++; |
244 | return ENOBUFS; | | 244 | return ENOBUFS; |
245 | } | | 245 | } |
246 | if (IXGBE_TX_TRYLOCK(txr)) { | | 246 | if (IXGBE_TX_TRYLOCK(txr)) { |