Informativo Setembro 2010
[IMAGE] Newsletter M.Class Setembro/ 2010 Conforme sua solicitagco, estamos enviando nossa newsletter do mjs de Agosto com as acompanhantes mais acessadas do zltimo mjs. Se preferir entre no site www.mclass.com.br e tenha acesso a mais de 180 acompanhantes, com milhares de fotos e vmdeos exclusivos. Conhega o NOVO M.CLASS! Site mais largo - Fotos Maiores - Vmdeos Maiores Vmdeos em Alta Qualidade e compatmveis com iPad e iPhone [IMAGE] [IMAGE] [IMAGE] Caso nco tenha se cadastrado para receber nossa newsletter mensal, por favor clique no link abaixo e remova seu e-mail de nossa lista. Remover e-mail da lista Copyright ) 2010 - M.Class [IMAGE]
Re: MCLGETI support for xl(4)
On Thu, Sep 16, 2010 at 03:44:02PM -0400, Loganaden Velvindron wrote: Greetings, From brad, remove superfluous braces. The direction of this diff is OK. The mclgeti() usage seems OK. What made my alarmbells go off was the removal of xl_rx_resync(). Now that function in itself is dumb but it made me realize that xl(4) is missing many if not most bus_dma operations. Especially bus_dmamap_sync() are missing at various places and xl_rx_resync() was probably a workaround for it. So I have the feeling that this diff may make xl(4) worse on systems that require the syncs. It is best to test drivers not only on i386 or amd64 but also on sparc64 which is a very good system to verify proper bus_dma operation. Index: src/sys/dev/ic/xl.c === RCS file: /cvs/src/sys/dev/ic/xl.c,v retrieving revision 1.96 diff -u -p -r1.96 xl.c --- src/sys/dev/ic/xl.c 7 Sep 2010 16:21:43 - 1.96 +++ src/sys/dev/ic/xl.c 16 Sep 2010 19:36:53 - @@ -153,7 +153,6 @@ void xl_stats_update(void *); int xl_encap(struct xl_softc *, struct xl_chain *, struct mbuf * ); void xl_rxeof(struct xl_softc *); -int xl_rx_resync(struct xl_softc *); void xl_txeof(struct xl_softc *); void xl_txeof_90xB(struct xl_softc *); void xl_txeoc(struct xl_softc *); @@ -180,6 +179,7 @@ void xl_iff(struct xl_softc *); void xl_iff_90x(struct xl_softc *); void xl_iff_905b(struct xl_softc *); int xl_list_rx_init(struct xl_softc *); +void xl_fill_rx_ring(struct xl_softc *); int xl_list_tx_init(struct xl_softc *); int xl_list_tx_init_90xB(struct xl_softc *); void xl_wait(struct xl_softc *); @@ -1076,8 +1076,6 @@ xl_list_rx_init(struct xl_softc *sc) for (i = 0; i XL_RX_LIST_CNT; i++) { cd-xl_rx_chain[i].xl_ptr = (struct xl_list_onefrag *)ld-xl_rx_list[i]; - if (xl_newbuf(sc, cd-xl_rx_chain[i]) == ENOBUFS) - return(ENOBUFS); if (i == (XL_RX_LIST_CNT - 1)) n = 0; else @@ -1088,11 +1086,30 @@ xl_list_rx_init(struct xl_softc *sc) ld-xl_rx_list[i].xl_next = htole32(next); } - cd-xl_rx_head = cd-xl_rx_chain[0]; - + cd-xl_rx_prod = cd-xl_rx_cons = cd-xl_rx_chain[0]; + cd-xl_rx_cnt = 0; + xl_fill_rx_ring(sc); return (0); } +void +xl_fill_rx_ring(struct xl_softc *sc) +{ + struct xl_chain_data*cd; + struct xl_list_data *ld; + + cd = sc-xl_cdata; + ld = sc-xl_ldata; + + while (cd-xl_rx_cnt XL_RX_LIST_CNT) { + if (xl_newbuf(sc, cd-xl_rx_prod) == ENOBUFS) + break; + cd-xl_rx_prod = cd-xl_rx_prod-xl_next; + cd-xl_rx_cnt++; + } +} + + /* * Initialize an RX descriptor and attach an MBUF cluster. */ @@ -1102,15 +1119,10 @@ xl_newbuf(struct xl_softc *sc, struct xl struct mbuf *m_new = NULL; bus_dmamap_tmap; - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) - return (ENOBUFS); - - MCLGET(m_new, M_DONTWAIT); - if (!(m_new-m_flags M_EXT)) { - m_freem(m_new); + m_new = MCLGETI(NULL, M_DONTWAIT, sc-sc_arpcom.ac_if, MCLBYTES); + + if (!m_new) return (ENOBUFS); - } m_new-m_len = m_new-m_pkthdr.len = MCLBYTES; if (bus_dmamap_load(sc-sc_dmat, sc-sc_rx_sparemap, @@ -1150,32 +1162,6 @@ xl_newbuf(struct xl_softc *sc, struct xl return (0); } -int -xl_rx_resync(struct xl_softc *sc) -{ - struct xl_chain_onefrag *pos; - int i; - - pos = sc-xl_cdata.xl_rx_head; - - for (i = 0; i XL_RX_LIST_CNT; i++) { - bus_dmamap_sync(sc-sc_dmat, sc-sc_listmap, - ((caddr_t)pos-xl_ptr - sc-sc_listkva), - sizeof(struct xl_list), - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - - if (pos-xl_ptr-xl_status) - break; - pos = pos-xl_next; - } - - if (i == XL_RX_LIST_CNT) - return (0); - - sc-xl_cdata.xl_rx_head = pos; - - return (EAGAIN); -} /* * A frame has been uploaded: pass the resulting mbuf chain up to @@ -1195,12 +1181,14 @@ xl_rxeof(struct xl_softc *sc) again: - while ((rxstat = letoh32(sc-xl_cdata.xl_rx_head-xl_ptr-xl_status)) - != 0) { - cur_rx = sc-xl_cdata.xl_rx_head; - sc-xl_cdata.xl_rx_head = cur_rx-xl_next; + while ((rxstat = letoh32(sc-xl_cdata.xl_rx_cons-xl_ptr-xl_status)) + != 0 sc-xl_cdata.xl_rx_cnt 0) { + cur_rx = sc-xl_cdata.xl_rx_cons; + m = cur_rx-xl_mbuf; + cur_rx-xl_mbuf = NULL; + sc-xl_cdata.xl_rx_cons = cur_rx-xl_next; + sc-xl_cdata.xl_rx_cnt--; total_len = rxstat XL_RXSTAT_LENMASK; -
route show -label XX
I have a lot of routes from various sources and would like to just look at the ones from a particular source. So I figure this would help me. Make sense to anyone else? Or is '-v' and grep deemed sufficient? Ken Index: route.8 === RCS file: /cvs/src/sbin/route/route.8,v retrieving revision 1.64 diff -u -p -r1.64 route.8 --- route.8 20 Dec 2009 15:35:13 - 1.64 +++ route.8 20 Sep 2010 04:24:05 - @@ -165,6 +165,7 @@ are shown. .Cm show .Op Ar family .Op Fl gateway +.Op Fl label Ar label .Xc Print out the route table similar to netstat -r (see .Xr netstat 1 ) . @@ -173,6 +174,10 @@ If .Fl gateway is specified, only routes whose gateway are in the same address family as the destination are shown. +.Pp +If +.Fl label +is specified, only routes with the specified label are shown. .El .Pp The other commands relating to adding, changing, or deleting routes Index: route.c === RCS file: /cvs/src/sbin/route/route.c,v retrieving revision 1.149 diff -u -p -r1.149 route.c --- route.c 4 Sep 2010 08:06:09 - 1.149 +++ route.c 20 Sep 2010 04:24:05 - @@ -63,14 +63,7 @@ const struct if_status_description if_status_descriptions[] = LINK_STATE_DESCRIPTIONS; -union sockunion { - struct sockaddr sa; - struct sockaddr_in sin; - struct sockaddr_in6 sin6; - struct sockaddr_dl sdl; - struct sockaddr_rtlabel rtlabel; - struct sockaddr_mplssmpls; -} so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp, so_label, so_src; +union sockunion so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp, so_label, so_src; typedef union sockunion *sup; pid_t pid; @@ -681,6 +674,11 @@ show(int argc, char *argv[]) break; case K_GATEWAY: Fflag = 1; + break; + case K_LABEL: + if (!--argc) + usage(1+*argv); + getlabel(*++argv); break; default: usage(*argv); Index: show.c === RCS file: /cvs/src/sbin/route/show.c,v retrieving revision 1.87 diff -u -p -r1.87 show.c --- show.c 29 Jul 2010 16:35:40 - 1.87 +++ show.c 20 Sep 2010 04:24:05 - @@ -64,6 +64,7 @@ char *label_print(struct sockaddr *); extern int nflag; extern int Fflag; extern int verbose; +extern union sockunion so_label; #define PLEN (LONG_BIT / 4 + 2) /* XXX this is also defined in netstat.h */ @@ -285,14 +286,26 @@ p_rtentry(struct rt_msghdr *rtm) struct sockaddr *sa = (struct sockaddr *)((char *)rtm + rtm-rtm_hdrlen); struct sockaddr *mask, *rti_info[RTAX_MAX]; char ifbuf[IF_NAMESIZE]; + char*label; if (sa-sa_family == AF_KEY) return; get_rtaddrs(rtm-rtm_addrs, sa, rti_info); + if (Fflag rti_info[RTAX_GATEWAY]-sa_family != sa-sa_family) { return; } + + if (strlen(so_label.rtlabel.sr_label)) { + if (!rti_info[RTAX_LABEL]) + return; + label = ((struct sockaddr_rtlabel *)rti_info[RTAX_LABEL])- + sr_label; + if (strcmp(label, so_label.rtlabel.sr_label)) + return; + } + if (old_af != sa-sa_family) { old_af = sa-sa_family; pr_family(sa-sa_family); Index: show.h === RCS file: /cvs/src/sbin/route/show.h,v retrieving revision 1.7 diff -u -p -r1.7 show.h --- show.h 23 Mar 2010 15:01:50 - 1.7 +++ show.h 20 Sep 2010 04:24:05 - @@ -19,6 +19,15 @@ #ifndef __SHOW_H__ #define __SHOW_H__ +union sockunion { + struct sockaddr sa; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + struct sockaddr_dl sdl; + struct sockaddr_rtlabel rtlabel; + struct sockaddr_mplssmpls; +}; + voidp_rttables(int, u_int); char *routename(struct sockaddr *); char *netname(struct sockaddr *, struct sockaddr *);