Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci wm_tx_offload() and wm_nq_tx_offload() actually ...



details:   https://anonhg.NetBSD.org/src/rev/423924153536
branches:  trunk
changeset: 970966:423924153536
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Apr 08 21:57:24 2020 +0000

description:
wm_tx_offload() and wm_nq_tx_offload() actually always return 0, make them
return void and remove the check for their return value

diffstat:

 sys/dev/pci/if_wm.c |  36 ++++++++++++------------------------
 1 files changed, 12 insertions(+), 24 deletions(-)

diffs (127 lines):

diff -r 6d2a7d73db84 -r 423924153536 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Apr 08 21:56:01 2020 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Apr 08 21:57:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.672 2020/04/08 21:56:01 jdolecek Exp $     */
+/*     $NetBSD: if_wm.c,v 1.673 2020/04/08 21:57:24 jdolecek Exp $     */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.672 2020/04/08 21:56:01 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.673 2020/04/08 21:57:24 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -795,7 +795,7 @@
 static void    wm_free_txrx_queues(struct wm_softc *);
 static int     wm_init_txrx_queues(struct wm_softc *);
 /* Start */
-static int     wm_tx_offload(struct wm_softc *, struct wm_txqueue *,
+static void    wm_tx_offload(struct wm_softc *, struct wm_txqueue *,
     struct wm_txsoft *, uint32_t *, uint8_t *);
 static inline int      wm_select_txqueue(struct ifnet *, struct mbuf *);
 static void    wm_start(struct ifnet *);
@@ -804,7 +804,7 @@
 static void    wm_transmit_locked(struct ifnet *, struct wm_txqueue *);
 static void    wm_send_common_locked(struct ifnet *, struct wm_txqueue *,
                    bool);
-static int     wm_nq_tx_offload(struct wm_softc *, struct wm_txqueue *,
+static void    wm_nq_tx_offload(struct wm_softc *, struct wm_txqueue *,
     struct wm_txsoft *, uint32_t *, uint32_t *, bool *);
 static void    wm_nq_start(struct ifnet *);
 static void    wm_nq_start_locked(struct ifnet *);
@@ -7373,7 +7373,7 @@
  *     Set up TCP/IP checksumming parameters for the
  *     specified packet.
  */
-static int
+static void
 wm_tx_offload(struct wm_softc *sc, struct wm_txqueue *txq,
     struct wm_txsoft *txs, uint32_t *cmdp, uint8_t *fieldsp)
 {
@@ -7408,7 +7408,7 @@
                txq->txq_last_hw_tucs = 0;
                *fieldsp = 0;
                *cmdp = 0;
-               return 0;
+               return;
        }
 
        if ((m0->m_pkthdr.csum_flags &
@@ -7577,7 +7577,7 @@
                    txq->txq_last_hw_ipcs == (ipcs & 0xffff) &&
                    txq->txq_last_hw_tucs == (tucs & 0xffff)) {
                        WM_Q_EVCNT_INCR(txq, skipcontext);
-                       return 0;
+                       return;
                }
        }
 
@@ -7597,8 +7597,6 @@
 
        txq->txq_next = WM_NEXTTX(txq, txq->txq_next);
        txs->txs_ndesc++;
-
-       return 0;
 }
 
 static inline int
@@ -7875,12 +7873,7 @@
                    (M_CSUM_TSOv4 | M_CSUM_TSOv6 |
                    M_CSUM_IPv4 | M_CSUM_TCPv4 | M_CSUM_UDPv4 |
                    M_CSUM_TCPv6 | M_CSUM_UDPv6)) {
-                       if (wm_tx_offload(sc, txq, txs, &cksumcmd,
-                                         &cksumfields) != 0) {
-                               /* Error message already displayed. */
-                               bus_dmamap_unload(sc->sc_dmat, dmamap);
-                               continue;
-                       }
+                       wm_tx_offload(sc, txq, txs, &cksumcmd, &cksumfields);
                } else {
                        txq->txq_last_hw_cmd = txq->txq_last_hw_fields = 0;
                        txq->txq_last_hw_ipcs = txq->txq_last_hw_tucs = 0;
@@ -8014,7 +8007,7 @@
  *     Set up TCP/IP checksumming parameters for the
  *     specified packet, for NEWQUEUE devices
  */
-static int
+static void
 wm_nq_tx_offload(struct wm_softc *sc, struct wm_txqueue *txq,
     struct wm_txsoft *txs, uint32_t *cmdlenp, uint32_t *fieldsp, bool *do_csum)
 {
@@ -8044,7 +8037,7 @@
        default:
                /* Don't support this protocol or encapsulation. */
                *do_csum = false;
-               return 0;
+               return;
        }
        *do_csum = true;
        *cmdlenp = NQTX_DTYP_D | NQTX_CMD_DEXT | NQTX_CMD_IFCS;
@@ -8210,7 +8203,6 @@
        DPRINTF(WM_DEBUG_TX, ("\t0x%08x%08x\n", mssidx, cmdc));
        txq->txq_next = WM_NEXTTX(txq, txq->txq_next);
        txs->txs_ndesc++;
-       return 0;
 }
 
 /*
@@ -8444,12 +8436,8 @@
                    (M_CSUM_TSOv4 | M_CSUM_TSOv6 |
                        M_CSUM_IPv4 | M_CSUM_TCPv4 | M_CSUM_UDPv4 |
                        M_CSUM_TCPv6 | M_CSUM_UDPv6)) {
-                       if (wm_nq_tx_offload(sc, txq, txs, &cmdlen, &fields,
-                           &do_csum) != 0) {
-                               /* Error message already displayed. */
-                               bus_dmamap_unload(sc->sc_dmat, dmamap);
-                               continue;
-                       }
+                       wm_nq_tx_offload(sc, txq, txs, &cmdlen, &fields,
+                           &do_csum);
                } else {
                        do_csum = false;
                        cmdlen = 0;



Home | Main Index | Thread Index | Old Index