svn commit: r233849 - in projects/pf/head: sbin/ifconfig
sys/contrib/pf/net sys/dev/mpt sys/net80211
Gleb Smirnoff
glebius at FreeBSD.org
Tue Apr 3 18:24:57 UTC 2012
Author: glebius
Date: Tue Apr 3 18:24:57 2012
New Revision: 233849
URL: http://svn.freebsd.org/changeset/base/233849
Log:
Merge head r233826 through r233848 to projects/pf/head.
Modified:
projects/pf/head/sbin/ifconfig/ifconfig.8
projects/pf/head/sbin/ifconfig/ifpfsync.c
projects/pf/head/sys/contrib/pf/net/if_pfsync.c
projects/pf/head/sys/contrib/pf/net/if_pfsync.h
projects/pf/head/sys/dev/mpt/mpt_pci.c
projects/pf/head/sys/net80211/ieee80211_regdomain.c
Directory Properties:
projects/pf/head/ (props changed)
projects/pf/head/sbin/ (props changed)
projects/pf/head/sys/ (props changed)
projects/pf/head/sys/contrib/pf/ (props changed)
Modified: projects/pf/head/sbin/ifconfig/ifconfig.8
==============================================================================
--- projects/pf/head/sbin/ifconfig/ifconfig.8 Tue Apr 3 18:11:30 2012 (r233848)
+++ projects/pf/head/sbin/ifconfig/ifconfig.8 Tue Apr 3 18:24:57 2012 (r233849)
@@ -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
Modified: projects/pf/head/sbin/ifconfig/ifpfsync.c
==============================================================================
--- projects/pf/head/sbin/ifconfig/ifpfsync.c Tue Apr 3 18:11:30 2012 (r233848)
+++ projects/pf/head/sbin/ifconfig/ifpfsync.c Tue Apr 3 18:24:57 2012 (r233849)
@@ -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",
Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/if_pfsync.c Tue Apr 3 18:11:30 2012 (r233848)
+++ projects/pf/head/sys/contrib/pf/net/if_pfsync.c Tue Apr 3 18:24:57 2012 (r233849)
@@ -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
*/
#include "opt_inet.h"
@@ -213,6 +214,7 @@ struct pfsync_softc {
struct pfsync_upd_reqs sc_upd_req_list;
+ int sc_defer;
struct pfsync_deferrals sc_deferrals;
u_int sc_deferred;
@@ -1321,6 +1323,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:
@@ -1342,6 +1345,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cm
return (EINVAL);
}
sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates;
+ sc->sc_defer = pfsyncr.pfsyncr_defer;
if (pfsyncr.pfsyncr_syncdev[0] == 0) {
sc->sc_sync_if = NULL;
@@ -1671,10 +1675,7 @@ pfsync_insert_state(struct pf_state *st)
pfsync_q_ins(st, PFSYNC_S_INS);
- if (st->state_flags & PFSTATE_ACK)
- swi_sched(V_pfsync_swi_cookie, 0);
- else
- st->sync_updates = 0;
+ st->sync_updates = 0;
}
static int defer = 10;
@@ -1687,6 +1688,9 @@ pfsync_defer(struct pf_state *st, struct
PF_LOCK_ASSERT();
+ 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);
@@ -1707,6 +1711,8 @@ pfsync_defer(struct pf_state *st, struct
callout_reset(&pd->pd_tmo, defer, pfsync_defer_tmo,
pd);
+ swi_sched(V_pfsync_swi_cookie, 0);
+
return (1);
}
Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.h
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/if_pfsync.h Tue Apr 3 18:11:30 2012 (r233848)
+++ projects/pf/head/sys/contrib/pf/net/if_pfsync.h Tue Apr 3 18:24:57 2012 (r233849)
@@ -268,7 +268,7 @@ struct pfsyncreq {
char pfsyncr_syncdev[IFNAMSIZ];
struct in_addr pfsyncr_syncpeer;
int pfsyncr_maxupdates;
- int pfsyncr_authlevel;
+ int pfsyncr_defer;
};
#define SIOCSETPFSYNC _IOW('i', 247, struct ifreq)
Modified: projects/pf/head/sys/dev/mpt/mpt_pci.c
==============================================================================
--- projects/pf/head/sys/dev/mpt/mpt_pci.c Tue Apr 3 18:11:30 2012 (r233848)
+++ projects/pf/head/sys/dev/mpt/mpt_pci.c Tue Apr 3 18:24:57 2012 (r233849)
@@ -141,6 +141,10 @@ __FBSDID("$FreeBSD$");
#define MPI_MANUFACTPAGE_DEVID_SAS1068A_FB 0x0055
#endif
+#ifndef MPI_MANUFACTPAGE_DEVID_SAS1068E_FB
+#define MPI_MANUFACTPAGE_DEVID_SAS1068E_FB 0x0059
+#endif
+
#ifndef MPI_MANUFACTPAGE_DEVID_SAS1078DE_FB
#define MPI_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:
Modified: projects/pf/head/sys/net80211/ieee80211_regdomain.c
==============================================================================
--- projects/pf/head/sys/net80211/ieee80211_regdomain.c Tue Apr 3 18:11:30 2012 (r233848)
+++ projects/pf/head/sys/net80211/ieee80211_regdomain.c Tue Apr 3 18:24:57 2012 (r233849)
@@ -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);
+ }
+ }
}
if (rd != NULL)
ic->ic_regdomain = *rd;
More information about the svn-src-projects
mailing list