Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Do IXL_AQ_OP_SET_VSI_PROMISC in ixl_ifflags_cb()...



details:   https://anonhg.NetBSD.org/src/rev/00aaee8f5426
branches:  trunk
changeset: 1005768:00aaee8f5426
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Fri Dec 20 01:54:39 2019 +0000

description:
Do IXL_AQ_OP_SET_VSI_PROMISC in ixl_ifflags_cb() for
applying IFF_PROMISC

diffstat:

 sys/dev/pci/if_ixl.c |  21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diffs (57 lines):

diff -r c7d40e83d61b -r 00aaee8f5426 sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Fri Dec 20 01:49:30 2019 +0000
+++ b/sys/dev/pci/if_ixl.c      Fri Dec 20 01:54:39 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.8 2019/12/20 01:49:30 yamaguchi Exp $     */
+/*     $NetBSD: if_ixl.c,v 1.9 2019/12/20 01:54:39 yamaguchi Exp $     */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -3414,6 +3414,8 @@
        unsigned int prod;
        unsigned int t = 0;
 
+       mutex_enter(&sc->sc_atq_lock);
+
        atq = IXL_DMA_KVA(&sc->sc_atq);
        prod = sc->sc_atq_prod;
        slot = atq + prod;
@@ -3435,8 +3437,10 @@
        while (ixl_rd(sc, sc->sc_aq_regs->atq_head) != prod) {
                delaymsec(1);
 
-               if (t++ > tm)
+               if (t++ > tm) {
+                       mutex_exit(&sc->sc_atq_lock);
                        return ETIMEDOUT;
+               }
        }
 
        bus_dmamap_sync(sc->sc_dmat, IXL_DMA_MAP(&sc->sc_atq),
@@ -3448,6 +3452,8 @@
 
        sc->sc_atq_cons = prod;
 
+       mutex_exit(&sc->sc_atq_lock);
+
        return 0;
 }
 
@@ -4820,8 +4826,15 @@
 static int
 ixl_ifflags_cb(struct ethercom *ec)
 {
-
-       return 0;
+       struct ifnet *ifp = &ec->ec_if;
+       struct ixl_softc *sc = ifp->if_softc;
+       int rv;
+
+       mutex_enter(&sc->sc_cfg_lock);
+       rv = ixl_iff(sc);
+       mutex_exit(&sc->sc_cfg_lock);
+
+       return rv;
 }
 
 static int



Home | Main Index | Thread Index | Old Index