svn commit: r233827 - head/sys/dev/mpt
Author: marius Date: Tue Apr 3 08:28:43 2012 New Revision: 233827 URL: http://svn.freebsd.org/changeset/base/233827 Log: Fix probing of SAS1068E with a device ID of 0x0059 after r232411. Reported by: infofarmer MFC after:3 days Modified: head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt_pci.c == --- head/sys/dev/mpt/mpt_pci.c Tue Apr 3 08:24:32 2012(r233826) +++ head/sys/dev/mpt/mpt_pci.c Tue Apr 3 08:28:43 2012(r233827) @@ -141,6 +141,10 @@ __FBSDID($FreeBSD$); #define MPI_MANUFACTPAGE_DEVID_SAS1068A_FB 0x0055 #endif +#ifndefMPI_MANUFACTPAGE_DEVID_SAS1068E_FB +#defineMPI_MANUFACTPAGE_DEVID_SAS1068E_FB 0x0059 +#endif + #ifndefMPI_MANUFACTPAGE_DEVID_SAS1078DE_FB #defineMPI_MANUFACTPAGE_DEVID_SAS1078DE_FB 0x007C #endif @@ -236,6 +240,7 @@ mpt_pci_probe(device_t dev) case MPI_MANUFACTPAGE_DEVID_SAS1068: case MPI_MANUFACTPAGE_DEVID_SAS1068A_FB: case MPI_MANUFACTPAGE_DEVID_SAS1068E: + case MPI_MANUFACTPAGE_DEVID_SAS1068E_FB: case MPI_MANUFACTPAGE_DEVID_SAS1078: case MPI_MANUFACTPAGE_DEVID_SAS1078DE_FB: desc = LSILogic SAS/SATA Adapter; @@ -419,6 +424,7 @@ mpt_pci_attach(device_t dev) case MPI_MANUFACTPAGE_DEVID_SAS1068: case MPI_MANUFACTPAGE_DEVID_SAS1068A_FB: case MPI_MANUFACTPAGE_DEVID_SAS1068E: + case MPI_MANUFACTPAGE_DEVID_SAS1068E_FB: mpt-is_sas = 1; break; default: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r233845 - head/sys/net80211
Author: bschmidt Date: Tue Apr 3 17:48:42 2012 New Revision: 233845 URL: http://svn.freebsd.org/changeset/base/233845 Log: Add basic HT channel setup to ieee80211_init_channels(), this will be used by at least ral(4). Reviewed by: ray Modified: head/sys/net80211/ieee80211_regdomain.c Modified: head/sys/net80211/ieee80211_regdomain.c == --- head/sys/net80211/ieee80211_regdomain.c Tue Apr 3 17:10:19 2012 (r233844) +++ head/sys/net80211/ieee80211_regdomain.c Tue Apr 3 17:48:42 2012 (r233845) @@ -105,7 +105,12 @@ addchan(struct ieee80211com *ic, int iee c-ic_freq = ieee80211_ieee2mhz(ieee, flags); c-ic_ieee = ieee; c-ic_flags = flags; - c-ic_extieee = 0; + if (flags IEEE80211_CHAN_HT40U) + c-ic_extieee = ieee + 4; + else if (flags IEEE80211_CHAN_HT40D) + c-ic_extieee = ieee - 4; + else + c-ic_extieee = 0; } /* @@ -123,7 +128,8 @@ ieee80211_init_channels(struct ieee80211 /* XXX just do something for now */ ic-ic_nchans = 0; if (isset(bands, IEEE80211_MODE_11B) || - isset(bands, IEEE80211_MODE_11G)) { + isset(bands, IEEE80211_MODE_11G) || + isset(bands, IEEE80211_MODE_11NG)) { int maxchan = 11; if (rd != NULL rd-ecm) maxchan = 14; @@ -132,15 +138,67 @@ ieee80211_init_channels(struct ieee80211 addchan(ic, i, IEEE80211_CHAN_B); if (isset(bands, IEEE80211_MODE_11G)) addchan(ic, i, IEEE80211_CHAN_G); + if (isset(bands, IEEE80211_MODE_11NG)) { + addchan(ic, i, + IEEE80211_CHAN_G | IEEE80211_CHAN_HT20); + } + if ((ic-ic_htcaps IEEE80211_HTCAP_CHWIDTH40) == 0) + continue; + if (i = 7) { + addchan(ic, i, + IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U); + addchan(ic, i + 4, + IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D); + } } } - if (isset(bands, IEEE80211_MODE_11A)) { - for (i = 36; i = 64; i += 4) + if (isset(bands, IEEE80211_MODE_11A) || + isset(bands, IEEE80211_MODE_11NA)) { + for (i = 36; i = 64; i += 4) { addchan(ic, i, IEEE80211_CHAN_A); - for (i = 100; i = 140; i += 4) + if (isset(bands, IEEE80211_MODE_11NA)) { + addchan(ic, i, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT20); + } + if ((ic-ic_htcaps IEEE80211_HTCAP_CHWIDTH40) == 0) + continue; + if ((i % 8) == 4) { + addchan(ic, i, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U); + addchan(ic, i + 4, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D); + } + } + for (i = 100; i = 140; i += 4) { addchan(ic, i, IEEE80211_CHAN_A); - for (i = 149; i = 161; i += 4) + if (isset(bands, IEEE80211_MODE_11NA)) { + addchan(ic, i, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT20); + } + if ((ic-ic_htcaps IEEE80211_HTCAP_CHWIDTH40) == 0) + continue; + if ((i % 8) == 4 i != 140) { + addchan(ic, i, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U); + addchan(ic, i + 4, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D); + } + } + for (i = 149; i = 161; i += 4) { addchan(ic, i, IEEE80211_CHAN_A); + if (isset(bands, IEEE80211_MODE_11NA)) { + addchan(ic, i, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT20); + } + if ((ic-ic_htcaps IEEE80211_HTCAP_CHWIDTH40) == 0) + continue; + if ((i % 8) == 5) { + addchan(ic, i, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U); + addchan(ic, i + 4, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D); +
svn commit: r233846 - head/sys/contrib/pf/net
Author: glebius Date: Tue Apr 3 18:09:20 2012 New Revision: 233846 URL: http://svn.freebsd.org/changeset/base/233846 Log: Since pf 4.5 import pf(4) has a mechanism to defer forwarding a packet, that creates state, until pfsync(4) peer acks state addition (or 10 msec timeout passes). This is needed for active-active CARP configurations, which are poorly supported in FreeBSD and arguably a good idea at all. Unfortunately by the time of import this feature in OpenBSD was turned on, and did not have a switch to turn it off. This leaked to FreeBSD. This change make it possible to turn this feature off via ioctl() and turns it off by default. Obtained from:OpenBSD Modified: head/sys/contrib/pf/net/if_pfsync.c head/sys/contrib/pf/net/if_pfsync.h Modified: head/sys/contrib/pf/net/if_pfsync.c == --- head/sys/contrib/pf/net/if_pfsync.c Tue Apr 3 17:48:42 2012 (r233845) +++ head/sys/contrib/pf/net/if_pfsync.c Tue Apr 3 18:09:20 2012 (r233846) @@ -50,6 +50,7 @@ * 1.128 - cleanups * 1.146 - bzero() mbuf before sparsely filling it with data * 1.170 - SIOCSIFMTU checks + * 1.126, 1.142 - deferred packets processing */ #ifdef __FreeBSD__ @@ -262,6 +263,7 @@ struct pfsync_softc { struct pfsync_upd_reqs sc_upd_req_list; + int sc_defer; struct pfsync_deferrals sc_deferrals; u_intsc_deferred; @@ -1805,6 +1807,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cm } pfsyncr.pfsyncr_syncpeer = sc-sc_sync_peer; pfsyncr.pfsyncr_maxupdates = sc-sc_maxupdates; + pfsyncr.pfsyncr_defer = sc-sc_defer; return (copyout(pfsyncr, ifr-ifr_data, sizeof(pfsyncr))); case SIOCSETPFSYNC: @@ -1840,6 +1843,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cm } #endif sc-sc_maxupdates = pfsyncr.pfsyncr_maxupdates; + sc-sc_defer = pfsyncr.pfsyncr_defer; if (pfsyncr.pfsyncr_syncdev[0] == 0) { sc-sc_sync_if = NULL; @@ -2378,10 +2382,7 @@ pfsync_insert_state(struct pf_state *st) pfsync_q_ins(st, PFSYNC_S_INS); - if (ISSET(st-state_flags, PFSTATE_ACK)) - schednetisr(NETISR_PFSYNC); - else - st-sync_updates = 0; + st-sync_updates = 0; } int defer = 10; @@ -2402,6 +2403,9 @@ pfsync_defer(struct pf_state *st, struct splassert(IPL_SOFTNET); #endif + if (!sc-sc_defer || m-m_flags (M_BCAST|M_MCAST)) + return (0); + if (sc-sc_deferred = 128) pfsync_undefer(TAILQ_FIRST(sc-sc_deferrals), 0); @@ -2430,6 +2434,8 @@ pfsync_defer(struct pf_state *st, struct timeout_add(pd-pd_tmo, defer); #endif + swi_sched(V_pfsync_swi_cookie, 0); + return (1); } Modified: head/sys/contrib/pf/net/if_pfsync.h == --- head/sys/contrib/pf/net/if_pfsync.h Tue Apr 3 17:48:42 2012 (r233845) +++ head/sys/contrib/pf/net/if_pfsync.h Tue Apr 3 18:09:20 2012 (r233846) @@ -265,7 +265,7 @@ struct pfsyncreq { char pfsyncr_syncdev[IFNAMSIZ]; struct in_addr pfsyncr_syncpeer; int pfsyncr_maxupdates; - int pfsyncr_authlevel; + int pfsyncr_defer; }; #ifdef __FreeBSD__ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r233847 - head/sbin/ifconfig
Author: glebius Date: Tue Apr 3 18:10:48 2012 New Revision: 233847 URL: http://svn.freebsd.org/changeset/base/233847 Log: Make it possible to switch pfsync(4) deferral mechanism on/off. Obtained from:OpenBSD Modified: head/sbin/ifconfig/ifpfsync.c Modified: head/sbin/ifconfig/ifpfsync.c == --- head/sbin/ifconfig/ifpfsync.c Tue Apr 3 18:09:20 2012 (r233846) +++ head/sbin/ifconfig/ifpfsync.c Tue Apr 3 18:10:48 2012 (r233847) @@ -52,6 +52,7 @@ void setpfsync_syncpeer(const char *, in void unsetpfsync_syncpeer(const char *, int, int, const struct afswtch *); void setpfsync_syncpeer(const char *, int, int, const struct afswtch *); void setpfsync_maxupd(const char *, int, int, const struct afswtch *); +void setpfsync_defer(const char *, int, int, const struct afswtch *); void pfsync_status(int); void @@ -162,6 +163,23 @@ setpfsync_maxupd(const char *val, int d, err(1, SIOCSETPFSYNC); } +/* ARGSUSED */ +void +setpfsync_defer(const char *val, int d, int s, const struct afswtch *rafp) +{ + struct pfsyncreq preq; + + memset((char *)preq, 0, sizeof(struct pfsyncreq)); + ifr.ifr_data = (caddr_t)preq; + + if (ioctl(s, SIOCGETPFSYNC, (caddr_t)ifr) == -1) + err(1, SIOCGETPFSYNC); + + preq.pfsyncr_defer = d; + if (ioctl(s, SIOCSETPFSYNC, (caddr_t)ifr) == -1) + err(1, SIOCSETPFSYNC); +} + void pfsync_status(int s) { @@ -183,8 +201,10 @@ pfsync_status(int s) printf(syncpeer: %s , inet_ntoa(preq.pfsyncr_syncpeer)); if (preq.pfsyncr_syncdev[0] != '\0' || - preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP) - printf(maxupd: %d\n, preq.pfsyncr_maxupdates); + preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP) { + printf(maxupd: %d , preq.pfsyncr_maxupdates); + printf(defer: %s\n, preq.pfsyncr_defer ? on : off); + } } static struct cmd pfsync_cmds[] = { @@ -194,7 +214,9 @@ static struct cmd pfsync_cmds[] = { DEF_CMD(-syncif, 1, unsetpfsync_syncdev), DEF_CMD_ARG(syncpeer, setpfsync_syncpeer), DEF_CMD(-syncpeer,1, unsetpfsync_syncpeer), - DEF_CMD_ARG(maxupd, setpfsync_maxupd) + DEF_CMD_ARG(maxupd, setpfsync_maxupd), + DEF_CMD(defer,1, setpfsync_defer), + DEF_CMD(-defer, 0, setpfsync_defer), }; static struct afswtch af_pfsync = { .af_name= af_pfsync, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r233848 - head/sbin/ifconfig
Author: glebius Date: Tue Apr 3 18:11:30 2012 New Revision: 233848 URL: http://svn.freebsd.org/changeset/base/233848 Log: Document syncdev, syncpeer and defer keywords for pfsync(4) interfaces. Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 == --- head/sbin/ifconfig/ifconfig.8 Tue Apr 3 18:10:48 2012 (r233847) +++ head/sbin/ifconfig/ifconfig.8 Tue Apr 3 18:11:30 2012 (r233848) @@ -28,7 +28,7 @@ .\ From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\ $FreeBSD$ .\ -.Dd March 7, 2012 +.Dd April 3, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2380,10 +2380,28 @@ The following parameters are specific to .Xr pfsync 4 interfaces: .Bl -tag -width indent +.It Cm syncdev Ar iface +Use the specified interface +to send and receive pfsync state synchronisation messages. +.It Fl syncdev +Stop sending pfsync state synchronisation messages over the network. +.It Cm syncpeer Ar peer_address +Make the pfsync link point-to-point rather than using +multicast to broadcast the state synchronisation messages. +The peer_address is the IP address of the other host taking part in +the pfsync cluster. +.It Fl syncpeer +Broadcast the packets using multicast. .It Cm maxupd Ar n Set the maximum number of updates for a single state which can be collapsed into one. This is an 8-bit number; the default value is 128. +.It Cm defer +Defer transmission of the first packet in a state until a peer has +acknowledged that the associated state has been inserted. +.It Fl defer +Do not defer the first packet in a state. +This is the default. .El .Pp The following parameters are specific to ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r233846 - head/sys/contrib/pf/net
On Tue, Apr 03, 2012 at 06:09:21PM +, Gleb Smirnoff wrote: T Author: glebius T Date: Tue Apr 3 18:09:20 2012 T New Revision: 233846 T URL: http://svn.freebsd.org/changeset/base/233846 T T Log: T Since pf 4.5 import pf(4) has a mechanism to defer T forwarding a packet, that creates state, until T pfsync(4) peer acks state addition (or 10 msec T timeout passes). T T This is needed for active-active CARP configurations, T which are poorly supported in FreeBSD and arguably T a good idea at all. T T Unfortunately by the time of import this feature in T OpenBSD was turned on, and did not have a switch to T turn it off. This leaked to FreeBSD. T T This change make it possible to turn this feature T off via ioctl() and turns it off by default. Fortunately, we got an unused field in struct pfsyncreq, so this commit doesn't break ioctl() ABI, and this is mergeable. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r233846 - head/sys/contrib/pf/net
You are sure that the defer feature is linked only to active-active? 2012/4/3 Gleb Smirnoff gleb...@freebsd.org: On Tue, Apr 03, 2012 at 06:09:21PM +, Gleb Smirnoff wrote: T Author: glebius T Date: Tue Apr 3 18:09:20 2012 T New Revision: 233846 T URL: http://svn.freebsd.org/changeset/base/233846 T T Log: T Since pf 4.5 import pf(4) has a mechanism to defer T forwarding a packet, that creates state, until T pfsync(4) peer acks state addition (or 10 msec T timeout passes). T T This is needed for active-active CARP configurations, T which are poorly supported in FreeBSD and arguably T a good idea at all. T T Unfortunately by the time of import this feature in T OpenBSD was turned on, and did not have a switch to T turn it off. This leaked to FreeBSD. T T This change make it possible to turn this feature T off via ioctl() and turns it off by default. Fortunately, we got an unused field in struct pfsyncreq, so this commit doesn't break ioctl() ABI, and this is mergeable. -- Totus tuus, Glebius. -- Ermal ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r233846 - head/sys/contrib/pf/net
Ermal, On Tue, Apr 03, 2012 at 08:30:41PM +0200, Ermal Lu?i wrote: E You are sure that the defer feature is linked only to active-active? I don't see any sane reason for deferring in normal master/backup configuration. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r233850 - head/sys/kern
Author: np Date: Tue Apr 3 18:38:00 2012 New Revision: 233850 URL: http://svn.freebsd.org/changeset/base/233850 Log: - Remove redundant call to pr_ctloutput from code that handles SO_SETFIB. - Add a check for errors during copyin while here. Reviewed by: julian, bz MFC after:2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c == --- head/sys/kern/uipc_socket.c Tue Apr 3 18:24:57 2012(r233849) +++ head/sys/kern/uipc_socket.c Tue Apr 3 18:38:00 2012(r233850) @@ -2504,20 +2504,19 @@ sosetopt(struct socket *so, struct socko case SO_SETFIB: error = sooptcopyin(sopt, optval, sizeof optval, sizeof optval); + if (error) + goto bad; + if (optval 0 || optval = rt_numfibs) { error = EINVAL; goto bad; } if (((so-so_proto-pr_domain-dom_family == PF_INET) || (so-so_proto-pr_domain-dom_family == PF_INET6) || - (so-so_proto-pr_domain-dom_family == PF_ROUTE))) { + (so-so_proto-pr_domain-dom_family == PF_ROUTE))) so-so_fibnum = optval; - /* Note: ignore error */ - if (so-so_proto-pr_ctloutput) - (*so-so_proto-pr_ctloutput)(so, sopt); - } else { + else so-so_fibnum = 0; - } break; case SO_USER_COOKIE: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r233745 - head/sys/netinet/ipfw
On 3/31/12 4:20 AM, Gleb Smirnoff wrote: Many years ago there was the possibility that malloc M_WAITOK could return on shutdown or in some other rare error cases. Are we certain this is no longer true? Author: glebius Date: Sat Mar 31 11:20:48 2012 New Revision: 233745 URL: http://svn.freebsd.org/changeset/base/233745 Log: Don't check malloc(M_WAITOK) results. Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c == --- head/sys/netinet/ipfw/ip_fw_sockopt.c Sat Mar 31 10:47:40 2012 (r233744) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Sat Mar 31 11:20:48 2012 (r233745) @@ -163,8 +163,6 @@ ipfw_add_rule(struct ip_fw_chain *chain, l = RULESIZE(input_rule); rule = malloc(l, M_IPFW, M_WAITOK | M_ZERO); - if (rule == NULL) - return (ENOSPC); /* get_map returns with IPFW_UH_WLOCK if successful */ map = get_map(chain, 1, 0 /* not locked */); if (map == NULL) { @@ -1010,8 +1008,6 @@ ipfw_ctl(struct sockopt *sopt) if (size= sopt-sopt_valsize) break; buf = malloc(size, M_TEMP, M_WAITOK); - if (buf == NULL) - break; IPFW_UH_RLOCK(chain); /* check again how much space we need */ want = chain-static_len + ipfw_dyn_len(); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org