Re: rtadvd bug

2015-11-27 Thread Sly Midnight
Ok no problem.

Just reporting this bug is now fixed after the patch supplied by Jérémie
Courrèges-Anglas.

Thanks again!

On 11/27/2015 12:27 PM, Jérémie Courrèges-Anglas wrote:
> Sly Midnight  writes:
>
>> Sorry it took me a bit to reply, I was still drinking my coffee and
>> figuring out what I needed to do to apply and test this.
>>
>> I figured it out and, yes, I am happy to report it works beautifully now!
> Thanks, but please report on bugs@, where people expect your reply.
>
>> Thanks again for attending to this so quickly!
> One week.  Not that bad... ;)
>



Re: kernel panic - sparc64 on Netra X1 - psycho0: uncorrectable DMA error AFAR

2015-11-27 Thread BSD Lists

On 27/11/15 12:43, David Gwynne wrote:

On Wed, Nov 25, 2015 at 08:32:19PM +, Fred wrote:


Well with that diff I hit another panic - which seems to be
triggered by the nic:


i also think this is related to the nic. i have started cleaning
dc(4), but would like some tests before going further.

could you guys try this and let me know how it goes? i dont expect
it to fix the problems, but i also dont expect them to get worse.

cheers,
dlg

Index: dc.c
===
RCS file: /cvs/src/sys/dev/ic/dc.c,v
retrieving revision 1.148
diff -u -p -r1.148 dc.c
--- dc.c25 Nov 2015 03:09:58 -  1.148
+++ dc.c27 Nov 2015 12:37:04 -
@@ -125,8 +125,7 @@
  int dc_intr(void *);
  struct dc_type *dc_devtype(void *);
  int dc_newbuf(struct dc_softc *, int, struct mbuf *);
-int dc_encap(struct dc_softc *, struct mbuf *, u_int32_t *);
-int dc_coal(struct dc_softc *, struct mbuf **);
+int dc_encap(struct dc_softc *, bus_dmamap_t, struct mbuf *, u_int32_t *);

  void dc_pnic_rx_bug_war(struct dc_softc *, int);
  int dc_rx_resync(struct dc_softc *);
@@ -1658,17 +1657,19 @@ hasmac:
BUS_DMA_NOWAIT, >sc_rx_sparemap) != 0) {
printf(": can't create rx spare map\n");
return;
-   }
+   }   

for (i = 0; i < DC_TX_LIST_CNT; i++) {
if (bus_dmamap_create(sc->sc_dmat, MCLBYTES,
-   DC_TX_LIST_CNT - 5, MCLBYTES, 0, BUS_DMA_NOWAIT,
+   (sc->dc_flags & DC_TX_COALESCE) ? 1 : DC_TX_LIST_CNT - 5,
+   MCLBYTES, 0, BUS_DMA_NOWAIT,
>dc_cdata.dc_tx_chain[i].sd_map) != 0) {
printf(": can't create tx map\n");
return;
}
}
-   if (bus_dmamap_create(sc->sc_dmat, MCLBYTES, DC_TX_LIST_CNT - 5,
+   if (bus_dmamap_create(sc->sc_dmat, MCLBYTES,
+   (sc->dc_flags & DC_TX_COALESCE) ? 1 : DC_TX_LIST_CNT - 5,
MCLBYTES, 0, BUS_DMA_NOWAIT, >sc_tx_sparemap) != 0) {
printf(": can't create tx spare map\n");
return;
@@ -2488,39 +2489,14 @@ dc_intr(void *arg)
   * pointers to the fragment pointers.
   */
  int
-dc_encap(struct dc_softc *sc, struct mbuf *m_head, u_int32_t *txidx)
+dc_encap(struct dc_softc *sc, bus_dmamap_t map, struct mbuf *m, u_int32_t *idx)
  {
struct dc_desc *f = NULL;
int frag, cur, cnt = 0, i;
-   bus_dmamap_t map;
-
-   /*
-* Start packing the mbufs in this chain into
-* the fragment pointers. Stop when we run out
-* of fragments or hit the end of the mbuf chain.
-*/
-   map = sc->sc_tx_sparemap;
-
-   if (bus_dmamap_load_mbuf(sc->sc_dmat, map,
-   m_head, BUS_DMA_NOWAIT) != 0)
-   return (ENOBUFS);

-   cur = frag = *txidx;
+   cur = frag = *idx;

for (i = 0; i < map->dm_nsegs; i++) {
-   if (sc->dc_flags & DC_TX_ADMTEK_WAR) {
-   if (*txidx != sc->dc_cdata.dc_tx_prod &&
-   frag == (DC_TX_LIST_CNT - 1)) {
-   bus_dmamap_unload(sc->sc_dmat, map);
-   return (ENOBUFS);
-   }
-   }
-   if ((DC_TX_LIST_CNT -
-   (sc->dc_cdata.dc_tx_cnt + cnt)) < 5) {
-   bus_dmamap_unload(sc->sc_dmat, map);
-   return (ENOBUFS);
-   }
-
f = >dc_ldata->dc_tx_list[frag];
f->dc_ctl = htole32(DC_TXCTL_TLINK | map->dm_segs[i].ds_len);
if (cnt == 0) {
@@ -2535,12 +2511,12 @@ dc_encap(struct dc_softc *sc, struct mbu
}

sc->dc_cdata.dc_tx_cnt += cnt;
-   sc->dc_cdata.dc_tx_chain[cur].sd_mbuf = m_head;
+   sc->dc_cdata.dc_tx_chain[cur].sd_mbuf = m;
sc->sc_tx_sparemap = sc->dc_cdata.dc_tx_chain[cur].sd_map;
sc->dc_cdata.dc_tx_chain[cur].sd_map = map;
sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_LASTFRAG);
if (sc->dc_flags & DC_TX_INTR_FIRSTFRAG)
-   sc->dc_ldata->dc_tx_list[*txidx].dc_ctl |=
+   sc->dc_ldata->dc_tx_list[*idx].dc_ctl |=
htole32(DC_TXCTL_FINT);
if (sc->dc_flags & DC_TX_INTR_ALWAYS)
sc->dc_ldata->dc_tx_list[cur].dc_ctl |=
@@ -2551,43 +2527,9 @@ dc_encap(struct dc_softc *sc, struct mbu
bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize,
BUS_DMASYNC_PREWRITE);

-   sc->dc_ldata->dc_tx_list[*txidx].dc_status = htole32(DC_TXSTAT_OWN);
-
-   bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap,
-   offsetof(struct dc_list_data, dc_tx_list[*txidx]),
-   sizeof(struct dc_desc) * cnt,
-   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
-
-   *txidx = frag;
+   sc->dc_ldata->dc_tx_list[*idx].dc_status = htole32(DC_TXSTAT_OWN);

-   return (0);
-}
-
-/*
- * 

Re: kernel panic - sparc64 on Netra X1 - psycho0: uncorrectable DMA error AFAR

2015-11-27 Thread David Gwynne
On Wed, Nov 25, 2015 at 08:32:19PM +, Fred wrote:
> 
> Well with that diff I hit another panic - which seems to be
> triggered by the nic:

i also think this is related to the nic. i have started cleaning
dc(4), but would like some tests before going further.

could you guys try this and let me know how it goes? i dont expect
it to fix the problems, but i also dont expect them to get worse.

cheers,
dlg

Index: dc.c
===
RCS file: /cvs/src/sys/dev/ic/dc.c,v
retrieving revision 1.148
diff -u -p -r1.148 dc.c
--- dc.c25 Nov 2015 03:09:58 -  1.148
+++ dc.c27 Nov 2015 12:37:04 -
@@ -125,8 +125,7 @@
 int dc_intr(void *);
 struct dc_type *dc_devtype(void *);
 int dc_newbuf(struct dc_softc *, int, struct mbuf *);
-int dc_encap(struct dc_softc *, struct mbuf *, u_int32_t *);
-int dc_coal(struct dc_softc *, struct mbuf **);
+int dc_encap(struct dc_softc *, bus_dmamap_t, struct mbuf *, u_int32_t *);
 
 void dc_pnic_rx_bug_war(struct dc_softc *, int);
 int dc_rx_resync(struct dc_softc *);
@@ -1658,17 +1657,19 @@ hasmac:
BUS_DMA_NOWAIT, >sc_rx_sparemap) != 0) {
printf(": can't create rx spare map\n");
return;
-   }
+   }   
 
for (i = 0; i < DC_TX_LIST_CNT; i++) {
if (bus_dmamap_create(sc->sc_dmat, MCLBYTES,
-   DC_TX_LIST_CNT - 5, MCLBYTES, 0, BUS_DMA_NOWAIT,
+   (sc->dc_flags & DC_TX_COALESCE) ? 1 : DC_TX_LIST_CNT - 5,
+   MCLBYTES, 0, BUS_DMA_NOWAIT,
>dc_cdata.dc_tx_chain[i].sd_map) != 0) {
printf(": can't create tx map\n");
return;
}
}
-   if (bus_dmamap_create(sc->sc_dmat, MCLBYTES, DC_TX_LIST_CNT - 5,
+   if (bus_dmamap_create(sc->sc_dmat, MCLBYTES,
+   (sc->dc_flags & DC_TX_COALESCE) ? 1 : DC_TX_LIST_CNT - 5,
MCLBYTES, 0, BUS_DMA_NOWAIT, >sc_tx_sparemap) != 0) {
printf(": can't create tx spare map\n");
return;
@@ -2488,39 +2489,14 @@ dc_intr(void *arg)
  * pointers to the fragment pointers.
  */
 int
-dc_encap(struct dc_softc *sc, struct mbuf *m_head, u_int32_t *txidx)
+dc_encap(struct dc_softc *sc, bus_dmamap_t map, struct mbuf *m, u_int32_t *idx)
 {
struct dc_desc *f = NULL;
int frag, cur, cnt = 0, i;
-   bus_dmamap_t map;
-
-   /*
-* Start packing the mbufs in this chain into
-* the fragment pointers. Stop when we run out
-* of fragments or hit the end of the mbuf chain.
-*/
-   map = sc->sc_tx_sparemap;
-
-   if (bus_dmamap_load_mbuf(sc->sc_dmat, map,
-   m_head, BUS_DMA_NOWAIT) != 0)
-   return (ENOBUFS);
 
-   cur = frag = *txidx;
+   cur = frag = *idx;
 
for (i = 0; i < map->dm_nsegs; i++) {
-   if (sc->dc_flags & DC_TX_ADMTEK_WAR) {
-   if (*txidx != sc->dc_cdata.dc_tx_prod &&
-   frag == (DC_TX_LIST_CNT - 1)) {
-   bus_dmamap_unload(sc->sc_dmat, map);
-   return (ENOBUFS);
-   }
-   }
-   if ((DC_TX_LIST_CNT -
-   (sc->dc_cdata.dc_tx_cnt + cnt)) < 5) {
-   bus_dmamap_unload(sc->sc_dmat, map);
-   return (ENOBUFS);
-   }
-
f = >dc_ldata->dc_tx_list[frag];
f->dc_ctl = htole32(DC_TXCTL_TLINK | map->dm_segs[i].ds_len);
if (cnt == 0) {
@@ -2535,12 +2511,12 @@ dc_encap(struct dc_softc *sc, struct mbu
}
 
sc->dc_cdata.dc_tx_cnt += cnt;
-   sc->dc_cdata.dc_tx_chain[cur].sd_mbuf = m_head;
+   sc->dc_cdata.dc_tx_chain[cur].sd_mbuf = m;
sc->sc_tx_sparemap = sc->dc_cdata.dc_tx_chain[cur].sd_map;
sc->dc_cdata.dc_tx_chain[cur].sd_map = map;
sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_LASTFRAG);
if (sc->dc_flags & DC_TX_INTR_FIRSTFRAG)
-   sc->dc_ldata->dc_tx_list[*txidx].dc_ctl |=
+   sc->dc_ldata->dc_tx_list[*idx].dc_ctl |=
htole32(DC_TXCTL_FINT);
if (sc->dc_flags & DC_TX_INTR_ALWAYS)
sc->dc_ldata->dc_tx_list[cur].dc_ctl |=
@@ -2551,43 +2527,9 @@ dc_encap(struct dc_softc *sc, struct mbu
bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize,
BUS_DMASYNC_PREWRITE);
 
-   sc->dc_ldata->dc_tx_list[*txidx].dc_status = htole32(DC_TXSTAT_OWN);
-
-   bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap,
-   offsetof(struct dc_list_data, dc_tx_list[*txidx]),
-   sizeof(struct dc_desc) * cnt,
-   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
-
-   *txidx = frag;
+   sc->dc_ldata->dc_tx_list[*idx].dc_status = htole32(DC_TXSTAT_OWN);
 
-   return (0);
-}
-
-/*
- * Coalesce an mbuf chain into a single mbuf 

Re: No route to host for IPv6 link local traffic

2015-11-27 Thread Martin Pieuchot
Hello Gregor,

On 26/11/15(Thu) 22:10, Gregor Best wrote:
> Hi bugs@,
> 
> I just upgraded my mailserver to today's snapshot and noticed a
> weird "situation" with IPv6 link local traffic: I get a "No route
> to host" for all operations such as ping6:

I cannot reproduce that with the next snapshot available:

OpenBSD 5.8-current (GENERIC.MP) #1671: Thu Nov 26 20:36:24 MST 2015

I couldn't spot anything wrong in your setup.  Could you share privatly
your hostname.if*, sysctl.conf and any other relevant file to reproduce
the problem?

Cheers,
Martin