| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ix_txrx.c,v 1.78 2021/05/20 22:36:08 ryo Exp $ */ | | 1 | /* $NetBSD: ix_txrx.c,v 1.79 2021/05/27 06:11:34 msaitoh 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 |
| @@ -54,27 +54,27 @@ | | | @@ -54,27 +54,27 @@ |
54 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 54 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
55 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 55 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
56 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 56 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
57 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 57 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
58 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 58 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
59 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 59 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
60 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 60 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
61 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 61 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
62 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 62 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
63 | * POSSIBILITY OF SUCH DAMAGE. | | 63 | * POSSIBILITY OF SUCH DAMAGE. |
64 | */ | | 64 | */ |
65 | | | 65 | |
66 | #include <sys/cdefs.h> | | 66 | #include <sys/cdefs.h> |
67 | __KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.78 2021/05/20 22:36:08 ryo Exp $"); | | 67 | __KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.79 2021/05/27 06:11:34 msaitoh Exp $"); |
68 | | | 68 | |
69 | #include "opt_inet.h" | | 69 | #include "opt_inet.h" |
70 | #include "opt_inet6.h" | | 70 | #include "opt_inet6.h" |
71 | | | 71 | |
72 | #include "ixgbe.h" | | 72 | #include "ixgbe.h" |
73 | | | 73 | |
74 | /* | | 74 | /* |
75 | * HW RSC control: | | 75 | * HW RSC control: |
76 | * this feature only works with | | 76 | * this feature only works with |
77 | * IPv4, and only on 82599 and later. | | 77 | * IPv4, and only on 82599 and later. |
78 | * Also this will cause IP forwarding to | | 78 | * Also this will cause IP forwarding to |
79 | * fail and that can't be controlled by | | 79 | * fail and that can't be controlled by |
80 | * the stack as LRO can. For all these | | 80 | * the stack as LRO can. For all these |
| @@ -1538,26 +1538,27 @@ ixgbe_setup_receive_ring(struct rx_ring | | | @@ -1538,26 +1538,27 @@ ixgbe_setup_receive_ring(struct rx_ring |
1538 | addr = PNMB(na, slot + sj, &paddr); | | 1538 | addr = PNMB(na, slot + sj, &paddr); |
1539 | netmap_load_map(na, rxr->ptag, rxbuf->pmap, addr); | | 1539 | netmap_load_map(na, rxr->ptag, rxbuf->pmap, addr); |
1540 | /* Update descriptor and the cached value */ | | 1540 | /* Update descriptor and the cached value */ |
1541 | rxr->rx_base[j].read.pkt_addr = htole64(paddr); | | 1541 | rxr->rx_base[j].read.pkt_addr = htole64(paddr); |
1542 | rxbuf->addr = htole64(paddr); | | 1542 | rxbuf->addr = htole64(paddr); |
1543 | continue; | | 1543 | continue; |
1544 | } | | 1544 | } |
1545 | #endif /* DEV_NETMAP */ | | 1545 | #endif /* DEV_NETMAP */ |
1546 | | | 1546 | |
1547 | rxbuf->flags = 0; | | 1547 | rxbuf->flags = 0; |
1548 | rxbuf->buf = ixgbe_getjcl(&rxr->jcl_head, M_NOWAIT, | | 1548 | rxbuf->buf = ixgbe_getjcl(&rxr->jcl_head, M_NOWAIT, |
1549 | MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); | | 1549 | MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); |
1550 | if (rxbuf->buf == NULL) { | | 1550 | if (rxbuf->buf == NULL) { |
| | | 1551 | rxr->no_jmbuf.ev_count++; |
1551 | error = ENOBUFS; | | 1552 | error = ENOBUFS; |
1552 | goto fail; | | 1553 | goto fail; |
1553 | } | | 1554 | } |
1554 | mp = rxbuf->buf; | | 1555 | mp = rxbuf->buf; |
1555 | mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz; | | 1556 | mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz; |
1556 | /* Get the memory mapping */ | | 1557 | /* Get the memory mapping */ |
1557 | error = bus_dmamap_load_mbuf(rxr->ptag->dt_dmat, rxbuf->pmap, | | 1558 | error = bus_dmamap_load_mbuf(rxr->ptag->dt_dmat, rxbuf->pmap, |
1558 | mp, BUS_DMA_NOWAIT); | | 1559 | mp, BUS_DMA_NOWAIT); |
1559 | if (error != 0) { | | 1560 | if (error != 0) { |
1560 | /* | | 1561 | /* |
1561 | * Clear this entry for later cleanup in | | 1562 | * Clear this entry for later cleanup in |
1562 | * ixgbe_discard() which is called via | | 1563 | * ixgbe_discard() which is called via |
1563 | * ixgbe_free_receive_ring(). | | 1564 | * ixgbe_free_receive_ring(). |