* pull request: wireless-2.6 2011-01-12
From: John W. Linville @ 2011-01-12 18:37 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Dave,
This is an initial batch of wireless fixes intended for 2.6.38-rc1.
Highlights include a number of small ath9k fixes, some documentation
fixes from Johannes, and an ssb fix that stops loading b44 inadvertently
when certain b43 devices are present.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 5b919f833d9d60588d026ad82d17f17e8872c7a9:
net: ax25: fix information leak to userland harder (2011-01-12 00:34:49 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master
Christian Lamparter (1):
p54: fix sequence no. accounting off-by-one error
Indan Zupancic (1):
ipw2200: Check for -1 INTA in tasklet too.
Johannes Berg (5):
mac80211: add remain-on-channel docs
mac80211: add missing docs for off-chan TX flag
cfg80211: add mesh join/leave callback docs
nl80211: add/fix mesh docs
mac80211: add doc short section on LED triggers
Michael Buesch (1):
ssb: Ignore dangling ethernet cores on wireless devices
Stanislaw Gruszka (1):
hostap_cs: fix sleeping function called from invalid context
Sujith Manoharan (5):
ath9k_hw: Fix chip test
ath9k_hw: Fix calibration for AR9287 devices
ath9k_hw: Fix thermal issue with UB94
ath9k_hw: Fix RX handling for USB devices
ath9k_htc: Really fix packet injection
Documentation/DocBook/80211.tmpl | 21 +++++++++++---
drivers/net/wireless/ath/ath9k/ar9002_calib.c | 3 ++
drivers/net/wireless/ath/ath9k/eeprom_def.c | 4 +++
drivers/net/wireless/ath/ath9k/htc.h | 1 +
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 37 +++++++++++++++++-------
drivers/net/wireless/ath/ath9k/hw.c | 5 ++-
drivers/net/wireless/hostap/hostap_cs.c | 15 ++++------
drivers/net/wireless/ipw2x00/ipw2200.c | 7 +++++
drivers/net/wireless/p54/txrx.c | 2 +-
drivers/ssb/scan.c | 10 +++++++
include/linux/nl80211.h | 20 ++++++++++---
include/net/cfg80211.h | 2 +
include/net/mac80211.h | 14 +++++++++
13 files changed, 109 insertions(+), 32 deletions(-)
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl
index 03641a0..8906648 100644
--- a/Documentation/DocBook/80211.tmpl
+++ b/Documentation/DocBook/80211.tmpl
@@ -268,10 +268,6 @@
!Finclude/net/mac80211.h ieee80211_ops
!Finclude/net/mac80211.h ieee80211_alloc_hw
!Finclude/net/mac80211.h ieee80211_register_hw
-!Finclude/net/mac80211.h ieee80211_get_tx_led_name
-!Finclude/net/mac80211.h ieee80211_get_rx_led_name
-!Finclude/net/mac80211.h ieee80211_get_assoc_led_name
-!Finclude/net/mac80211.h ieee80211_get_radio_led_name
!Finclude/net/mac80211.h ieee80211_unregister_hw
!Finclude/net/mac80211.h ieee80211_free_hw
</chapter>
@@ -382,6 +378,23 @@
</para>
</partintro>
+ <chapter id="led-support">
+ <title>LED support</title>
+ <para>
+ Mac80211 supports various ways of blinking LEDs. Wherever possible,
+ device LEDs should be exposed as LED class devices and hooked up to
+ the appropriate trigger, which will then be triggered appropriately
+ by mac80211.
+ </para>
+!Finclude/net/mac80211.h ieee80211_get_tx_led_name
+!Finclude/net/mac80211.h ieee80211_get_rx_led_name
+!Finclude/net/mac80211.h ieee80211_get_assoc_led_name
+!Finclude/net/mac80211.h ieee80211_get_radio_led_name
+!Finclude/net/mac80211.h ieee80211_tpt_blink
+!Finclude/net/mac80211.h ieee80211_tpt_led_trigger_flags
+!Finclude/net/mac80211.h ieee80211_create_tpt_led_trigger
+ </chapter>
+
<chapter id="hardware-crypto-offload">
<title>Hardware crypto acceleration</title>
!Pinclude/net/mac80211.h Hardware crypto acceleration
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index 01880aa..ea2e7d7 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -954,6 +954,9 @@ static void ar9002_hw_init_cal_settings(struct ath_hw *ah)
&adc_dc_cal_multi_sample;
}
ah->supp_cals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL;
+
+ if (AR_SREV_9287(ah))
+ ah->supp_cals &= ~ADC_GAIN_CAL;
}
}
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 088f141..749a936 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -226,6 +226,10 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
eep->baseEepHeader.pwdclkind == 0)
ah->need_an_top2_fixup = 1;
+ if ((common->bus_ops->ath_bus_type == ATH_USB) &&
+ (AR_SREV_9280(ah)))
+ eep->modalHeader[0].xpaBiasLvl = 0;
+
return 0;
}
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index a099b3e..1ce506f 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -433,6 +433,7 @@ void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id,
void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
enum htc_endpoint_id ep_id, bool txok);
+int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv);
void ath9k_htc_station_work(struct work_struct *work);
void ath9k_htc_aggr_work(struct work_struct *work);
void ath9k_ani_work(struct work_struct *work);;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 845b4c9..f4d576b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -301,6 +301,16 @@ static int ath9k_htc_add_monitor_interface(struct ath9k_htc_priv *priv)
priv->nstations++;
+ /*
+ * Set chainmask etc. on the target.
+ */
+ ret = ath9k_htc_update_cap_target(priv);
+ if (ret)
+ ath_dbg(common, ATH_DBG_CONFIG,
+ "Failed to update capability in target\n");
+
+ priv->ah->is_monitoring = true;
+
return 0;
err_vif:
@@ -328,6 +338,7 @@ static int ath9k_htc_remove_monitor_interface(struct ath9k_htc_priv *priv)
}
priv->nstations--;
+ priv->ah->is_monitoring = false;
return 0;
}
@@ -419,7 +430,7 @@ static int ath9k_htc_remove_station(struct ath9k_htc_priv *priv,
return 0;
}
-static int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv)
+int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv)
{
struct ath9k_htc_cap_target tcap;
int ret;
@@ -1186,6 +1197,20 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
}
}
+ /*
+ * Monitor interface should be added before
+ * IEEE80211_CONF_CHANGE_CHANNEL is handled.
+ */
+ if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
+ if (conf->flags & IEEE80211_CONF_MONITOR) {
+ if (ath9k_htc_add_monitor_interface(priv))
+ ath_err(common, "Failed to set monitor mode\n");
+ else
+ ath_dbg(common, ATH_DBG_CONFIG,
+ "HW opmode set to Monitor mode\n");
+ }
+ }
+
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
struct ieee80211_channel *curchan = hw->conf.channel;
int pos = curchan->hw_value;
@@ -1221,16 +1246,6 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
ath_update_txpow(priv);
}
- if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
- if (conf->flags & IEEE80211_CONF_MONITOR) {
- if (ath9k_htc_add_monitor_interface(priv))
- ath_err(common, "Failed to set monitor mode\n");
- else
- ath_dbg(common, ATH_DBG_CONFIG,
- "HW opmode set to Monitor mode\n");
- }
- }
-
if (changed & IEEE80211_CONF_CHANGE_IDLE) {
mutex_lock(&priv->htc_pm_lock);
if (!priv->ps_idle) {
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index fde9786..1afb8bb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -436,9 +436,10 @@ static int ath9k_hw_init_macaddr(struct ath_hw *ah)
static int ath9k_hw_post_init(struct ath_hw *ah)
{
+ struct ath_common *common = ath9k_hw_common(ah);
int ecode;
- if (!AR_SREV_9271(ah)) {
+ if (common->bus_ops->ath_bus_type != ATH_USB) {
if (!ath9k_hw_chip_test(ah))
return -ENODEV;
}
@@ -1213,7 +1214,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
ah->txchainmask = common->tx_chainmask;
ah->rxchainmask = common->rx_chainmask;
- if (!ah->chip_fullsleep) {
+ if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) {
ath9k_hw_abortpcurecv(ah);
if (!ath9k_hw_stopdmarecv(ah)) {
ath_dbg(common, ATH_DBG_XMIT,
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index bd8a413..2176ede 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -518,22 +518,21 @@ static int prism2_config(struct pcmcia_device *link)
hw_priv->link = link;
/*
- * Make sure the IRQ handler cannot proceed until at least
- * dev->base_addr is initialized.
+ * We enable IRQ here, but IRQ handler will not proceed
+ * until dev->base_addr is set below. This protect us from
+ * receive interrupts when driver is not initialized.
*/
- spin_lock_irqsave(&local->irq_init_lock, flags);
-
ret = pcmcia_request_irq(link, prism2_interrupt);
if (ret)
- goto failed_unlock;
+ goto failed;
ret = pcmcia_enable_device(link);
if (ret)
- goto failed_unlock;
+ goto failed;
+ spin_lock_irqsave(&local->irq_init_lock, flags);
dev->irq = link->irq;
dev->base_addr = link->resource[0]->start;
-
spin_unlock_irqrestore(&local->irq_init_lock, flags);
local->shutdown = 0;
@@ -546,8 +545,6 @@ static int prism2_config(struct pcmcia_device *link)
return ret;
- failed_unlock:
- spin_unlock_irqrestore(&local->irq_init_lock, flags);
failed:
kfree(hw_priv);
prism2_release((u_long)link);
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 8d6ed5f..ae438ed 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -1973,6 +1973,13 @@ static void ipw_irq_tasklet(struct ipw_priv *priv)
inta = ipw_read32(priv, IPW_INTA_RW);
inta_mask = ipw_read32(priv, IPW_INTA_MASK_R);
+
+ if (inta == 0xFFFFFFFF) {
+ /* Hardware disappeared */
+ IPW_WARNING("TASKLET INTA == 0xFFFFFFFF\n");
+ /* Only handle the cached INTA values */
+ inta = 0;
+ }
inta &= (IPW_INTA_MASK_ALL & inta_mask);
/* Add any cached INTA values that need to be handled */
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 76b2318..f618b96 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -618,7 +618,7 @@ static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
else
*burst_possible = false;
- if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
+ if (!(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
*flags |= P54_HDR_FLAG_DATA_OUT_SEQNR;
if (info->flags & IEEE80211_TX_CTL_PSPOLL_RESPONSE)
diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c
index 5a0985d..29884c0 100644
--- a/drivers/ssb/scan.c
+++ b/drivers/ssb/scan.c
@@ -420,6 +420,16 @@ int ssb_bus_scan(struct ssb_bus *bus,
bus->pcicore.dev = dev;
#endif /* CONFIG_SSB_DRIVER_PCICORE */
break;
+ case SSB_DEV_ETHERNET:
+ if (bus->bustype == SSB_BUSTYPE_PCI) {
+ if (bus->host_pci->vendor == PCI_VENDOR_ID_BROADCOM &&
+ (bus->host_pci->device & 0xFF00) == 0x4300) {
+ /* This is a dangling ethernet core on a
+ * wireless device. Ignore it. */
+ continue;
+ }
+ }
+ break;
default:
break;
}
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2b89b71..821ffb9 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -148,6 +148,10 @@
* @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
* destination %NL80211_ATTR_MAC on the interface identified by
* %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
+ * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
+ * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
+ * %NL80211_ATTR_MAC.
* @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
* the interface identified by %NL80211_ATTR_IFINDEX.
* @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
@@ -612,7 +616,7 @@ enum nl80211_commands {
* consisting of a nested array.
*
* @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
- * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link.
+ * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link.
* @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
* @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
* info given for %NL80211_CMD_GET_MPATH, nested attribute described at
@@ -879,7 +883,9 @@ enum nl80211_commands {
* See &enum nl80211_key_default_types.
*
* @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be
- * changed once the mesh is active.
+ * changed once the mesh is active.
+ * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
+ * containing attributes from &enum nl80211_meshconf_params.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1225,8 +1231,6 @@ enum nl80211_rate_info {
* @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
* @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
* @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
- * @__NL80211_STA_INFO_AFTER_LAST: internal
- * @NL80211_STA_INFO_MAX: highest possible station info attribute
* @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
* @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
* containing info as possible, see &enum nl80211_sta_info_txrate.
@@ -1236,6 +1240,11 @@ enum nl80211_rate_info {
* @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
* @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
* @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
+ * @NL80211_STA_INFO_LLID: the station's mesh LLID
+ * @NL80211_STA_INFO_PLID: the station's mesh PLID
+ * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station
+ * @__NL80211_STA_INFO_AFTER_LAST: internal
+ * @NL80211_STA_INFO_MAX: highest possible station info attribute
*/
enum nl80211_sta_info {
__NL80211_STA_INFO_INVALID,
@@ -1626,7 +1635,7 @@ enum nl80211_mntr_flags {
* @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
* that it takes for an HWMP information element to propagate across the mesh
*
- * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not
+ * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
*
* @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
* source mesh point for path selection elements.
@@ -1678,6 +1687,7 @@ enum nl80211_meshconf_params {
* element that vendors will use to identify the path selection methods and
* metrics in use.
*
+ * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
* @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
*/
enum nl80211_mesh_setup_params {
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bcc9f44..1322695 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1103,6 +1103,8 @@ struct cfg80211_pmksa {
* @change_mpath: change a given mesh path
* @get_mpath: get a mesh path for the given parameters
* @dump_mpath: dump mesh path callback -- resume dump at index @idx
+ * @join_mesh: join the mesh network with the specified parameters
+ * @leave_mesh: leave the current mesh network
*
* @get_mesh_config: Get the current mesh configuration
*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5b3fd5a..62c0ce2 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -337,6 +337,10 @@ struct ieee80211_bss_conf {
* @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
* @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this
* frame and selects the maximum number of streams that it can use.
+ * @IEEE80211_TX_CTL_TX_OFFCHAN: Marks this packet to be transmitted on
+ * the off-channel channel when a remain-on-channel offload is done
+ * in hardware -- normal packets still flow and are expected to be
+ * handled properly by the device.
*
* Note: If you have to add new flags to the enumeration, then don't
* forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -1753,6 +1757,16 @@ enum ieee80211_ampdu_mlme_action {
* (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX).
*
* @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant).
+ *
+ * @remain_on_channel: Starts an off-channel period on the given channel, must
+ * call back to ieee80211_ready_on_channel() when on that channel. Note
+ * that normal channel traffic is not stopped as this is intended for hw
+ * offload. Frames to transmit on the off-channel channel are transmitted
+ * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the
+ * duration (which will always be non-zero) expires, the driver must call
+ * ieee80211_remain_on_channel_expired(). This callback may sleep.
+ * @cancel_remain_on_channel: Requests that an ongoing off-channel period is
+ * aborted before it expires. This callback may sleep.
*/
struct ieee80211_ops {
int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* RE: [E1000-devel] [e100] Page allocation failure warning(?) in 2.6.36.3
From: Eric Dumazet @ 2011-01-12 18:14 UTC (permalink / raw)
To: Brandeburg, Jesse
Cc: David Miller, Chris Rankin, e1000-devel@lists.sourceforge.net,
Dave, Tushar N, netdev@vger.kernel.org, Kirsher, Jeffrey T
In-Reply-To: <alpine.WNT.2.00.1101120958080.5816@JBRANDEB-DESK2.amr.corp.intel.com>
Le mercredi 12 janvier 2011 à 10:05 -0800, Brandeburg, Jesse a écrit :
> First, I don't think the following comment should hold up this patch.
>
> As a policy question when I asked about using __GFP_NOWARN before in other
> Intel ethernet drivers the consensus seemed to be that the warning
> messages were useful. All our drivers correctly handle runtime memory
> failures, but none of them are currently using __GFP_NOWARN.
>
> Can I submit patches to change our other drivers to __GFP_NOWARN? I think
> it will make for quite a few less reports of non-issues to the list. All
> our drivers that I would be patching already have ethtool counters that
> count failed allocations.
>
If an allocation failure is really handled, in the sense NIC doesnt
freeze but only lose one incoming frame, then probably yes.
I think the warning message can be useful when driver is known to let
things in a non working state ;)
As you said, this can be done later, here is a respin without this bit.
Thanks !
[PATCH v2] e100: use GFP_KERNEL allocations at device init stage
In lowmem conditions, e100 driver can fail its initialization, because
of GFP_ATOMIC abuse.
Switch to GFP_KERNEL were applicable.
Reported-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e100.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index b0aa9e6..c9a2126 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1880,9 +1880,21 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx)
}
#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
-static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
+
+static struct sk_buff *e100_alloc_skb(struct net_device *dev, gfp_t flags)
+{
+ struct sk_buff *skb;
+
+ skb = __netdev_alloc_skb(dev, RFD_BUF_LEN + NET_IP_ALIGN, flags);
+ if (NET_IP_ALIGN && skb)
+ skb_reserve(skb, NET_IP_ALIGN);
+ return skb;
+}
+
+static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx, gfp_t flags)
{
- if (!(rx->skb = netdev_alloc_skb_ip_align(nic->netdev, RFD_BUF_LEN)))
+ rx->skb = e100_alloc_skb(nic->netdev, flags);
+ if (!rx->skb)
return -ENOMEM;
/* Init, and map the RFD. */
@@ -2026,7 +2038,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
/* Alloc new skbs to refill list */
for (rx = nic->rx_to_use; !rx->skb; rx = nic->rx_to_use = rx->next) {
- if (unlikely(e100_rx_alloc_skb(nic, rx)))
+ if (unlikely(e100_rx_alloc_skb(nic, rx, GFP_ATOMIC)))
break; /* Better luck next time (see watchdog) */
}
@@ -2102,13 +2114,13 @@ static int e100_rx_alloc_list(struct nic *nic)
nic->rx_to_use = nic->rx_to_clean = NULL;
nic->ru_running = RU_UNINITIALIZED;
- if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
+ if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_KERNEL)))
return -ENOMEM;
for (rx = nic->rxs, i = 0; i < count; rx++, i++) {
rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
rx->prev = (i == 0) ? nic->rxs + count - 1 : rx - 1;
- if (e100_rx_alloc_skb(nic, rx)) {
+ if (e100_rx_alloc_skb(nic, rx, GFP_KERNEL)) {
e100_rx_clean_list(nic);
return -ENOMEM;
}
^ permalink raw reply related
* Re: [PATCH v1 1/2] TCPCT API sysctl update to draft -03
From: Eric Dumazet @ 2011-01-12 18:05 UTC (permalink / raw)
To: William Allen Simpson
Cc: Linux Kernel Developers, Linux Kernel Network Developers,
David Miller, Andrew Morton
In-Reply-To: <4D2DEA73.4000708@gmail.com>
Le mercredi 12 janvier 2011 à 12:52 -0500, William Allen Simpson a
écrit :
> Use most recently specified symbols of RFC-to-be-6013.
>
> Allows different global s_data limits for SYN and SYN_ACK.
>
> CC: "Eric W. Biederman" <ebiederm@xmission.com>
> CC: Stephen Hemminger <shemminger@vyatta.com>
> CC: Andi Kleen <andi@firstfloor.org>
> Signed-off-by: William.Allen.Simpson@gmail.com
Should be :
Signed-off-by: William Allen Simpson <William.Allen.Simpson@gmail.com>
> ---
> Documentation/networking/ip-sysctl.txt | 10 ++++++++++
> include/net/tcp.h | 2 ++
> net/ipv4/sysctl_net_ipv4.c | 25 ++++++++++++++++++++++++-
> net/ipv4/tcp_output.c | 19 +++++++++++++++++--
> 4 files changed, 53 insertions(+), 3 deletions(-)
Hmm, patch is not inlined, so I have to copy/paste
+static int tcp_cookie_max = TCP_COOKIE_MAX;
...
/* Update system visible IP port range */
static void set_local_port_range(int range[2])
@@ -588,7 +591,27 @@ static struct ctl_table ipv4_table[] = {
.data = &sysctl_tcp_cookie_size,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &zero,
+ .extra2 = &tcp_cookie_max,
+ },
Now sysctl_tcp_cookie_size has a max limit of TCP_COOKIE_MAX, you can
remove the now uneeded check in :
static u8 tcp_cookie_size_check(u8 desired)
...
if (cookie_size >= TCP_COOKIE_MAX)
/* value too large, specify maximum */
return TCP_COOKIE_MAX;
^ permalink raw reply
* RE: [E1000-devel] [e100] Page allocation failure warning(?) in 2.6.36.3
From: Brandeburg, Jesse @ 2011-01-12 18:05 UTC (permalink / raw)
To: David Miller, Eric Dumazet
Cc: Chris Rankin, e1000-devel@lists.sourceforge.net, Dave, Tushar N,
netdev@vger.kernel.org, Kirsher, Jeffrey T
In-Reply-To: <1294853710.3981.108.camel@edumazet-laptop>
Hi Eric, thanks for doing this work!
On Wed, 12 Jan 2011, Eric Dumazet wrote:
> Apparently e100 driver uses GFP_ATOMIC allocations in setup phase, and
> your machine doesnt have enough memory.
This part looks great.
> I would try following patch, allowing the use of GFP_KERNEL at init
> time, to let vm games play.
>
> Thanks
>
> [PATCH] e100: use GFP_KERNEL allocations at device init stage
>
> In lowmem conditions, e100 driver can fail its initialization, because
> of GFP_ATOMIC abuse.
>
> Switch to GFP_KERNEL were applicable.
>
> Add __GFP_NOWARN flag to GFP_ATOMIC allocations, since driver can cope
> with failed allocations (if setup succeeded)
>
> Reported-by: Chris Rankin <rankincj@yahoo.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> - if (unlikely(e100_rx_alloc_skb(nic, rx)))
> + if (unlikely(e100_rx_alloc_skb(nic, rx,
> + GFP_ATOMIC | __GFP_NOWARN)))
First, I don't think the following comment should hold up this patch.
As a policy question when I asked about using __GFP_NOWARN before in other
Intel ethernet drivers the consensus seemed to be that the warning
messages were useful. All our drivers correctly handle runtime memory
failures, but none of them are currently using __GFP_NOWARN.
Can I submit patches to change our other drivers to __GFP_NOWARN? I think
it will make for quite a few less reports of non-issues to the list. All
our drivers that I would be patching already have ethtool counters that
count failed allocations.
^ permalink raw reply
* [PATCH v1 2/2] TCPCT API sockopt update to draft -03
From: William Allen Simpson @ 2011-01-12 17:59 UTC (permalink / raw)
To: Linux Kernel Developers
Cc: Linux Kernel Network Developers, David Miller, Andrew Morton
In-Reply-To: <4D2DE824.10205@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 517 bytes --]
Use most recently specified symbols of RFC-to-be-6013.
Permit setting either cookie or s_data (alternatively).
Split the data value from socket option header, saving more than
1K of stack space in the handler by copying long data values
directly from user space into the kref block.
Signed-off-by: William.Allen.Simpson@gmail.com
---
include/linux/tcp.h | 35 ++++++++++++-----
net/ipv4/tcp.c | 102 +++++++++++++++++++++++++++++++++++---------------
2 files changed, 96 insertions(+), 41 deletions(-)
[-- Attachment #2: TCPCT+API-03v1+2.6.37.patch --]
[-- Type: text/plain, Size: 7252 bytes --]
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index e64f4c6..c8f4017 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -185,22 +185,37 @@ struct tcp_md5sig {
#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
/* Flags for both getsockopt and setsockopt */
-#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
-#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
+#define TCPCT_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
+#define TCPCT_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
* supercedes everything. */
-
-/* Flags for getsockopt */
-#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
-#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
-
-/* TCP_COOKIE_TRANSACTIONS data */
+#define TCPCT_IN_DATA (1 << 2) /* Was data received? */
+#define TCPCT_OUT_DATA (1 << 3) /* Was data sent? */
+/* reserved for future use: bits 4 .. 6 */
+#define TCPCT_EXTEND (1 << 7)
+
+/* Extended Option flags for both getsockopt and setsockopt */
+#define TCPCT_EXTEND_SIZE (0x7) /* mask */
+#define TCPCT_EXTEND_TS32 (0x1) /* default */
+#define TCPCT_EXTEND_TS64 (0x2)
+#define TCPCT_EXTEND_TS128 (0x4)
+
+/* TCP_COOKIE_TRANSACTIONS socket option header */
struct tcp_cookie_transactions {
__u16 tcpct_flags; /* see above */
- __u8 __tcpct_pad1; /* zero */
+ __u8 tcpct_extended;
__u8 tcpct_cookie_desired; /* bytes */
__u16 tcpct_s_data_desired; /* bytes of variable data */
__u16 tcpct_used; /* bytes in value */
- __u8 tcpct_value[TCP_MSS_DEFAULT];
+};
+
+struct tcpct_full {
+ struct tcp_cookie_transactions soh;
+ __u8 tcpct_value[TCP_COOKIE_PAIR_SIZE];
+};
+
+struct tcpct_half {
+ struct tcp_cookie_transactions soh;
+ __u8 tcpct_value[TCP_COOKIE_MAX];
};
#ifdef __KERNEL__
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 6c11eec..a5c7933 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2143,25 +2143,14 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
case TCP_COOKIE_TRANSACTIONS: {
struct tcp_cookie_transactions ctd;
struct tcp_cookie_values *cvp = NULL;
+ int s_data_used = 0;
if (sizeof(ctd) > optlen)
return -EINVAL;
if (copy_from_user(&ctd, optval, sizeof(ctd)))
return -EFAULT;
- if (ctd.tcpct_used > sizeof(ctd.tcpct_value) ||
- ctd.tcpct_s_data_desired > TCP_MSS_DESIRED)
- return -EINVAL;
-
- if (ctd.tcpct_cookie_desired == 0) {
- /* default to global value */
- } else if ((0x1 & ctd.tcpct_cookie_desired) ||
- ctd.tcpct_cookie_desired > TCP_COOKIE_MAX ||
- ctd.tcpct_cookie_desired < TCP_COOKIE_MIN) {
- return -EINVAL;
- }
-
- if (TCP_COOKIE_OUT_NEVER & ctd.tcpct_flags) {
+ if (TCPCT_OUT_NEVER & ctd.tcpct_flags) {
/* Supercedes all other values */
lock_sock(sk);
if (tp->cookie_values != NULL) {
@@ -2175,6 +2164,41 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
return err;
}
+ if (ctd.tcpct_cookie_desired == 0) {
+ /* default to global value */
+ } else if ((0x1 & ctd.tcpct_cookie_desired) ||
+ ctd.tcpct_cookie_desired > TCP_COOKIE_MAX ||
+ ctd.tcpct_cookie_desired < TCP_COOKIE_MIN) {
+ return -EINVAL;
+ }
+
+ if (ctd.tcpct_used > 0) {
+ if (ctd.tcpct_used + sizeof(ctd) > optlen)
+ return -EINVAL;
+ if (TCPCT_OUT_DATA & ctd.tcpct_flags) {
+ if (ctd.tcpct_used >
+ sysctl_tcp_syn_ack_data_limit)
+ return -EINVAL;
+ if (ctd.tcpct_s_data_desired > 0)
+ return -EINVAL;
+ s_data_used = ctd.tcpct_used;
+ } else {
+ if (ctd.tcpct_used > TCP_COOKIE_PAIR_SIZE)
+ return -EINVAL;
+ if (ctd.tcpct_used !=
+ ctd.tcpct_cookie_desired &&
+ ctd.tcpct_used !=
+ ctd.tcpct_cookie_desired * 2)
+ return -EINVAL;
+ if (ctd.tcpct_s_data_desired >
+ sysctl_tcp_syn_data_limit)
+ return -EINVAL;
+ }
+ } else if (TCPCT_OUT_DATA & ctd.tcpct_flags) {
+ /* unexpected flag without s_data */
+ return -EINVAL;
+ }
+
/* Allocate ancillary memory before locking.
*/
if (ctd.tcpct_used > 0 ||
@@ -2182,7 +2206,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
(sysctl_tcp_cookie_size > 0 ||
ctd.tcpct_cookie_desired > 0 ||
ctd.tcpct_s_data_desired > 0))) {
- cvp = kzalloc(sizeof(*cvp) + ctd.tcpct_used,
+ cvp = kzalloc(sizeof(*cvp) + s_data_used,
GFP_KERNEL);
if (cvp == NULL)
return -ENOMEM;
@@ -2191,7 +2215,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
}
lock_sock(sk);
tp->rx_opt.cookie_in_always =
- (TCP_COOKIE_IN_ALWAYS & ctd.tcpct_flags);
+ (TCPCT_IN_ALWAYS & ctd.tcpct_flags);
tp->rx_opt.cookie_out_never = 0; /* false */
if (tp->cookie_values != NULL) {
@@ -2210,11 +2234,27 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
if (cvp != NULL) {
cvp->cookie_desired = ctd.tcpct_cookie_desired;
- if (ctd.tcpct_used > 0) {
- memcpy(cvp->s_data_payload, ctd.tcpct_value,
- ctd.tcpct_used);
- cvp->s_data_desired = ctd.tcpct_used;
+ if (s_data_used > 0) {
+ if (copy_from_user(cvp->s_data_payload,
+ optval + sizeof(ctd),
+ s_data_used)) {
+ kref_put(&cvp->kref,
+ tcp_cookie_values_release);
+ return -EFAULT;
+ }
+ cvp->s_data_desired = s_data_used;
cvp->s_data_constant = 1; /* true */
+ } else if (ctd.tcpct_used > 0) {
+ if (copy_from_user(cvp->cookie_pair,
+ optval + sizeof(ctd),
+ ctd.tcpct_used)) {
+ kref_put(&cvp->kref,
+ tcp_cookie_values_release);
+ return -EFAULT;
+ }
+ /* No constant payload data. */
+ cvp->s_data_desired = ctd.tcpct_s_data_desired;
+ cvp->s_data_constant = 0; /* false */
} else {
/* No constant payload data. */
cvp->s_data_desired = ctd.tcpct_s_data_desired;
@@ -2574,7 +2614,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
return 0;
case TCP_COOKIE_TRANSACTIONS: {
- struct tcp_cookie_transactions ctd;
+ struct tcpct_full ctd;
struct tcp_cookie_values *cvp = tp->cookie_values;
if (get_user(len, optlen))
@@ -2583,23 +2623,23 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
return -EINVAL;
memset(&ctd, 0, sizeof(ctd));
- ctd.tcpct_flags = (tp->rx_opt.cookie_in_always ?
- TCP_COOKIE_IN_ALWAYS : 0)
- | (tp->rx_opt.cookie_out_never ?
- TCP_COOKIE_OUT_NEVER : 0);
+ ctd.soh.tcpct_flags = (tp->rx_opt.cookie_in_always ?
+ TCPCT_IN_ALWAYS : 0)
+ | (tp->rx_opt.cookie_out_never ?
+ TCPCT_OUT_NEVER : 0);
if (cvp != NULL) {
- ctd.tcpct_flags |= (cvp->s_data_in ?
- TCP_S_DATA_IN : 0)
- | (cvp->s_data_out ?
- TCP_S_DATA_OUT : 0);
+ ctd.soh.tcpct_flags |= (cvp->s_data_in ?
+ TCPCT_IN_DATA : 0)
+ | (cvp->s_data_out ?
+ TCPCT_OUT_DATA : 0);
- ctd.tcpct_cookie_desired = cvp->cookie_desired;
- ctd.tcpct_s_data_desired = cvp->s_data_desired;
+ ctd.soh.tcpct_cookie_desired = cvp->cookie_desired;
+ ctd.soh.tcpct_s_data_desired = cvp->s_data_desired;
memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0],
cvp->cookie_pair_size);
- ctd.tcpct_used = cvp->cookie_pair_size;
+ ctd.soh.tcpct_used = cvp->cookie_pair_size;
}
if (put_user(sizeof(ctd), optlen))
--
1.7.1
^ permalink raw reply related
* Re: [PATCH net-next-2.6] netdev: tilepro: Use is_multicast_ether_addr helper
From: Chris Metcalf @ 2011-01-12 17:49 UTC (permalink / raw)
To: Tobias Klauser; +Cc: netdev
In-Reply-To: <1294824713-10644-1-git-send-email-tklauser@distanz.ch>
On 1/12/2011 4:31 AM, Tobias Klauser wrote:
> Use is_multicast_ether_addr from linux/etherdevice.h instead of a custom
> macro. Also remove the broadcast address check, as it is considered a
> multicast address too.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
> drivers/net/tile/tilepro.c | 10 +---------
> 1 files changed, 1 insertions(+), 9 deletions(-)
Thanks, I've taken this into the Tilera tree!
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply
* [PATCH v1 1/2] TCPCT API sysctl update to draft -03
From: William Allen Simpson @ 2011-01-12 17:52 UTC (permalink / raw)
To: Linux Kernel Developers
Cc: Linux Kernel Network Developers, David Miller, Andrew Morton
In-Reply-To: <4D2DE824.10205@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 602 bytes --]
Use most recently specified symbols of RFC-to-be-6013.
Allows different global s_data limits for SYN and SYN_ACK.
CC: "Eric W. Biederman" <ebiederm@xmission.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Andi Kleen <andi@firstfloor.org>
Signed-off-by: William.Allen.Simpson@gmail.com
---
Documentation/networking/ip-sysctl.txt | 10 ++++++++++
include/net/tcp.h | 2 ++
net/ipv4/sysctl_net_ipv4.c | 25 ++++++++++++++++++++++++-
net/ipv4/tcp_output.c | 19 +++++++++++++++++--
4 files changed, 53 insertions(+), 3 deletions(-)
[-- Attachment #2: TCPCT+API-03u1+2.6.37.patch --]
[-- Type: text/plain, Size: 4111 bytes --]
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index d99940d..4e14b3a 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -184,6 +184,16 @@ tcp_cookie_size - INTEGER
as the minimum. Odd values are interpreted as the next even value.
Default: 0 (off).
+tcp_syn_data_limit - INTEGER
+ Limit for TCP Cookie Transactions (TCPCT) data transmitted with
+ the <SYN>. Default: 496. Maximum: 496.
+
+tcp_syn_ack_data_limit - INTEGER
+ Limit for TCP Cookie Transactions (TCPCT) data transmitted with
+ the <SYN,ACK(SYN)>. As a matter of security policy, keep the
+ setting small to avoid amplification denial of service attacks.
+ Default: 80. Maximum: 1220.
+
tcp_dsack - BOOLEAN
Allows TCP to send "duplicate" SACKs.
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 38509f0..3ac2bca 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -241,6 +241,8 @@ extern int sysctl_tcp_workaround_signed_windows;
extern int sysctl_tcp_slow_start_after_idle;
extern int sysctl_tcp_max_ssthresh;
extern int sysctl_tcp_cookie_size;
+extern int sysctl_tcp_syn_data_limit;
+extern int sysctl_tcp_syn_ack_data_limit;
extern int sysctl_tcp_thin_linear_timeouts;
extern int sysctl_tcp_thin_dupack;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 1a45665..629f90b 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -30,6 +30,9 @@ static int tcp_adv_win_scale_min = -31;
static int tcp_adv_win_scale_max = 31;
static int ip_ttl_min = 1;
static int ip_ttl_max = 255;
+static int tcp_cookie_max = TCP_COOKIE_MAX;
+static int tcp_syn_data_max = TCP_MSS_DEFAULT - 40;
+static int tcp_syn_ack_data_max = TCP_MSS_DESIRED;
/* Update system visible IP port range */
static void set_local_port_range(int range[2])
@@ -588,7 +591,27 @@ static struct ctl_table ipv4_table[] = {
.data = &sysctl_tcp_cookie_size,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &zero,
+ .extra2 = &tcp_cookie_max,
+ },
+ {
+ .procname = "tcp_syn_data_limit",
+ .data = &sysctl_tcp_syn_data_limit,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &zero,
+ .extra2 = &tcp_syn_data_max,
+ },
+ {
+ .procname = "tcp_syn_ack_data_limit",
+ .data = &sysctl_tcp_syn_ack_data_limit,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &zero,
+ .extra2 = &tcp_syn_ack_data_max,
},
{
.procname = "tcp_thin_linear_timeouts",
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index dc7c096..16a9e40 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -63,6 +63,15 @@ int sysctl_tcp_slow_start_after_idle __read_mostly = 1;
int sysctl_tcp_cookie_size __read_mostly = 0; /* TCP_COOKIE_MAX */
EXPORT_SYMBOL_GPL(sysctl_tcp_cookie_size);
+int sysctl_tcp_syn_data_limit __read_mostly = TCP_MSS_DEFAULT - 40;
+EXPORT_SYMBOL_GPL(sysctl_tcp_syn_data_limit);
+
+/* As a matter of security policy, keep the setting small to avoid
+ * amplification denial of service attacks.
+ */
+int sysctl_tcp_syn_ack_data_limit __read_mostly = 80; /* TCP_MSS_DESIRED */
+EXPORT_SYMBOL_GPL(sysctl_tcp_syn_ack_data_limit);
+
/* Account for new data that has been sent to the network. */
static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb)
@@ -2418,10 +2427,16 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
struct tcp_md5sig_key *md5;
int tcp_header_size;
int mss;
- int s_data_desired = 0;
+ int s_data_desired;
- if (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired)
+ if (cvp != NULL &&
+ cvp->s_data_constant &&
+ cvp->s_data_desired > 0 &&
+ cvp->s_data_desired <= sysctl_tcp_syn_ack_data_limit)
s_data_desired = cvp->s_data_desired;
+ else
+ s_data_desired = 0;
+
skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC);
if (skb == NULL)
return NULL;
--
1.7.1
^ permalink raw reply related
* RE: [E1000-devel] [e100] Page allocation failure warning(?) in 2.6.36.3
From: Eric Dumazet @ 2011-01-12 17:48 UTC (permalink / raw)
To: Chris Rankin
Cc: David Miller, e1000-devel@lists.sourceforge.net, Tushar NDave,
netdev@vger.kernel.org, Jeff Kirsher
In-Reply-To: <247288.34804.qm@web121705.mail.ne1.yahoo.com>
Le mercredi 12 janvier 2011 à 09:42 -0800, Chris Rankin a écrit :
> --- On Wed, 12/1/11, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Apparently e100 driver uses GFP_ATOMIC allocations in setup
> > phase, and your machine doesnt have enough memory.
>
> Thanks. You'd think 64 MB of RAM would be enough... ;-).
I remember using linux on a 8MB machine a loooong time ago, but not a
2.6 kernel :)
^ permalink raw reply
* TCPCT API update for 2.6.37
From: William Allen Simpson @ 2011-01-12 17:43 UTC (permalink / raw)
To: Linux Kernel Developers
Cc: Linux Kernel Network Developers, David Miller, Andrew Morton
With the recent flurry of messages related to TCPCT, I devoted a nice
snowy Saturday afternoon to updating the socket option code. Linux is
rather behind on TCPCT implementation, so this will help with future
software compatibility.
Currently, any userland programs written to RFC-to-be-6013 will not
interoperate with Linux 2.6.33 and beyond. I've made these patches
for 2.6.37 -- they'll also need to be ported to earlier releases.
I'm not on this list, so anybody with comments should CC me. Thanks.
^ permalink raw reply
* RE: [E1000-devel] [e100] Page allocation failure warning(?) in 2.6.36.3
From: Chris Rankin @ 2011-01-12 17:42 UTC (permalink / raw)
To: David Miller, Eric Dumazet
Cc: e1000-devel@lists.sourceforge.net, Tushar NDave,
netdev@vger.kernel.org, Jeff Kirsher
In-Reply-To: <1294853710.3981.108.camel@edumazet-laptop>
--- On Wed, 12/1/11, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Apparently e100 driver uses GFP_ATOMIC allocations in setup
> phase, and your machine doesnt have enough memory.
Thanks. You'd think 64 MB of RAM would be enough... ;-).
Cheers,
Chris
^ permalink raw reply
* Re: [e100] Page allocation failure warning(?) in 2.6.36.3
From: Eric Dumazet @ 2011-01-12 17:35 UTC (permalink / raw)
To: Chris Rankin, David Miller
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Jeff Kirsher
In-Reply-To: <314995.84049.qm@web121708.mail.ne1.yahoo.com>
Le mardi 11 janvier 2011 à 12:59 -0800, Chris Rankin a écrit :
> Tushar,
>
> As promised:
>
> $ /sbin/ifconfig -a
> br0 Link encap:Ethernet HWaddr 00:03:47:3b:29:5c
> inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
> inet6 addr: fe80::203:47ff:fe3b:295c/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:372485 errors:0 dropped:0 overruns:0 frame:0
> TX packets:383917 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:37566127 (35.8 MiB) TX bytes:225458273 (215.0 MiB)
>
> eth0 Link encap:Ethernet HWaddr 00:90:27:76:d0:ec
> inet addr:10.0.43.2 Bcast:10.0.43.255 Mask:255.255.255.0
> inet6 addr: fe80::290:27ff:fe76:d0ec/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:432016 errors:0 dropped:0 overruns:0 frame:0
> TX packets:377602 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:229629017 (218.9 MiB) TX bytes:41958103 (40.0 MiB)
>
> eth1 Link encap:Ethernet HWaddr 00:03:47:3b:29:5c
> inet6 addr: fe80::203:47ff:fe3b:295c/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:364683 errors:0 dropped:0 overruns:0 frame:0
> TX packets:369235 errors:1 dropped:0 overruns:0 carrier:1
> collisions:0 txqueuelen:1000
> RX bytes:42445811 (40.4 MiB) TX bytes:203414933 (193.9 MiB)
>
> eth2 Link encap:Ethernet HWaddr 00:03:47:3b:29:5d
> inet6 addr: fe80::203:47ff:fe3b:295d/64 Scope:Link
> UP BROADCAST MULTICAST MTU:1500 Metric:1
> RX packets:9059 errors:1 dropped:0 overruns:0 frame:1
> TX packets:15437 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:691449 (675.2 KiB) TX bytes:22232699 (21.2 MiB)
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> inet6 addr: ::1/128 Scope:Host
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:797 errors:0 dropped:0 overruns:0 frame:0
> TX packets:797 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:81543 (79.6 KiB) TX bytes:81543 (79.6 KiB)
>
> $ cat /etc/network/interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
>
> # The loopback network interface
> auto lo
> iface lo inet loopback
>
> # The primary network interface
> allow-hotplug eth0
> iface eth0 inet static
> address 10.0.43.2
> netmask 255.255.255.0
> network 10.0.43.0
> broadcast 10.0.43.255
> gateway 10.0.43.1
> # dns-* options are implemented by the resolvconf package, if installed
> dns-nameservers 192.168.0.1
> dns-search underworld
>
> auto br0
> iface br0 inet static
> address 192.168.0.1
> netmask 255.255.255.0
> network 192.168.0.0
> broadcast 192.168.0.255
> bridge-ports eth1 eth2
> bridge_hello 1
> bridge_fd 4
> bridge_maxage 4
> post-up /sbin/route add -net 224.0.0.0 netmask 240.0.0.0 dev br0
>
> Cheers,
> Chris
>
Apparently e100 driver uses GFP_ATOMIC allocations in setup phase, and
your machine doesnt have enough memory.
I would try following patch, allowing the use of GFP_KERNEL at init
time, to let vm games play.
Thanks
[PATCH] e100: use GFP_KERNEL allocations at device init stage
In lowmem conditions, e100 driver can fail its initialization, because
of GFP_ATOMIC abuse.
Switch to GFP_KERNEL were applicable.
Add __GFP_NOWARN flag to GFP_ATOMIC allocations, since driver can cope
with failed allocations (if setup succeeded)
Reported-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index b0aa9e6..e4d8a70 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1880,9 +1880,21 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx)
}
#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
-static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
+
+static struct sk_buff *e100_alloc_skb(struct net_device *dev, gfp_t flags)
+{
+ struct sk_buff *skb;
+
+ skb = __netdev_alloc_skb(dev, RFD_BUF_LEN + NET_IP_ALIGN, flags);
+ if (NET_IP_ALIGN && skb)
+ skb_reserve(skb, NET_IP_ALIGN);
+ return skb;
+}
+
+static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx, gfp_t flags)
{
- if (!(rx->skb = netdev_alloc_skb_ip_align(nic->netdev, RFD_BUF_LEN)))
+ rx->skb = e100_alloc_skb(nic->netdev, flags);
+ if (!rx->skb)
return -ENOMEM;
/* Init, and map the RFD. */
@@ -2026,7 +2038,8 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
/* Alloc new skbs to refill list */
for (rx = nic->rx_to_use; !rx->skb; rx = nic->rx_to_use = rx->next) {
- if (unlikely(e100_rx_alloc_skb(nic, rx)))
+ if (unlikely(e100_rx_alloc_skb(nic, rx,
+ GFP_ATOMIC | __GFP_NOWARN)))
break; /* Better luck next time (see watchdog) */
}
@@ -2102,13 +2115,13 @@ static int e100_rx_alloc_list(struct nic *nic)
nic->rx_to_use = nic->rx_to_clean = NULL;
nic->ru_running = RU_UNINITIALIZED;
- if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
+ if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_KERNEL)))
return -ENOMEM;
for (rx = nic->rxs, i = 0; i < count; rx++, i++) {
rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
rx->prev = (i == 0) ? nic->rxs + count - 1 : rx - 1;
- if (e100_rx_alloc_skb(nic, rx)) {
+ if (e100_rx_alloc_skb(nic, rx, GFP_KERNEL)) {
e100_rx_clean_list(nic);
return -ENOMEM;
}
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* Re: [RFC] sched: CHOKe packet scheduler (v0.6)
From: Eric Dumazet @ 2011-01-12 17:33 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev
In-Reply-To: <20110112092739.4cdcb6f4@nehalam>
Le mercredi 12 janvier 2011 à 09:27 -0800, Stephen Hemminger a écrit :
> On Wed, 12 Jan 2011 08:13:48 +0100
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > Hi Stephen, here is my v0.6 version :
> >
> > - Added sanity checks before kcalloc()/kzalloc()
> > - Added a __GFP_NOWARN to kcalloc()
> > - Added call to qdisc_bstats_update() after commit bfe0d0298f2a67d94d5
> > (net_sched: factorize qdisc stats handling)
> >
> > TODO :
> > - Added a stat specific update to track CHOKe probabilistic dual-drops
> > I temporarily use requeues counter to make sure our code works
>
> I am going to redo stats and config.
> Should thresholds be packet or byte based? I prefer packet
> Also leaning towards merging qmax and qlimit together.
I believe CHOKe spirit is per packet, I agree with you.
(This makes the tab[] array sizing directly depends on ctl->limit, not
on a computation ctl->limit/smallest_packet_size)
Not sure we can merge qmax and qlimit, are you sure its OK with CHOKe
paper and experimental results ?
(Sorry I cant spend too much time right now to check this point)
^ permalink raw reply
* Re: [RFC] sched: CHOKe packet scheduler (v0.6)
From: Stephen Hemminger @ 2011-01-12 17:27 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <1294816428.3447.106.camel@edumazet-laptop>
On Wed, 12 Jan 2011 08:13:48 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Hi Stephen, here is my v0.6 version :
>
> - Added sanity checks before kcalloc()/kzalloc()
> - Added a __GFP_NOWARN to kcalloc()
> - Added call to qdisc_bstats_update() after commit bfe0d0298f2a67d94d5
> (net_sched: factorize qdisc stats handling)
>
> TODO :
> - Added a stat specific update to track CHOKe probabilistic dual-drops
> I temporarily use requeues counter to make sure our code works
I am going to redo stats and config.
Should thresholds be packet or byte based? I prefer packet
Also leaning towards merging qmax and qlimit together.
^ permalink raw reply
* Re: [uclinux-dist-devel] [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper
From: Joe Perches @ 2011-01-12 17:18 UTC (permalink / raw)
To: Mike Frysinger
Cc: Tobias Klauser, Michael Hennerich, uclinux-dist-devel, netdev
In-Reply-To: <AANLkTimztPZB3N+ZYNsDM9L3ZEM+x__bBc-JCRgO8iDC@mail.gmail.com>
On Wed, 2011-01-12 at 11:38 -0500, Mike Frysinger wrote:
> On Wed, Jan 12, 2011 at 04:30, Tobias Klauser wrote:
> > --- a/drivers/net/bfin_mac.c
> > +++ b/drivers/net/bfin_mac.c
> > @@ -1293,7 +1293,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
> > addrs = ha->addr;
> >
> > /* skip non-multicast addresses */
> > - if (!(*addrs & 1))
> > + if (!is_multicast_ether_addr(addrs))
> > continue;
>
> looks good to me ...
> Acked-by: Mike Frysinger <vapier@gentoo.org>
Does a netdev_for_each_mc_addr loop entry really
need to verify that the address is multicast?
Couldn't this just be:
netdev_for_each_mc_addr(ha, dev) {
crc = ether_crc(ETH_ALEN, ha->addr);
crc >>= 26;
if (crc & 0x20)
emac_hashhi |= 1 << (crc & 0x1f);
else
emac_hashlo |= 1 << (crc & 0x1f);
}
^ permalink raw reply
* Re: [uclinux-dist-devel] [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper
From: Mike Frysinger @ 2011-01-12 16:38 UTC (permalink / raw)
To: Tobias Klauser; +Cc: Michael Hennerich, uclinux-dist-devel, netdev
In-Reply-To: <1294824611-10483-1-git-send-email-tklauser@distanz.ch>
On Wed, Jan 12, 2011 at 04:30, Tobias Klauser wrote:
> --- a/drivers/net/bfin_mac.c
> +++ b/drivers/net/bfin_mac.c
> @@ -1293,7 +1293,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
> addrs = ha->addr;
>
> /* skip non-multicast addresses */
> - if (!(*addrs & 1))
> + if (!is_multicast_ether_addr(addrs))
> continue;
looks good to me ...
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
^ permalink raw reply
* [PATCH ethtool 7/7] ethtool.8: Fix capitalisation
From: Ben Hutchings @ 2011-01-12 16:23 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers
In-Reply-To: <1294849266.3946.0.camel@bwh-desktop>
Write 'Ethernet' and 'PHY' thus.
Use the proper macro for the trademark symbol.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
diff --git a/ethtool.8.in b/ethtool.8.in
index 203d33d..0ee91a0 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -337,10 +337,10 @@ settings of the specified device.
Shows a short help message.
.TP
.B \-a \-\-show\-pause
-Queries the specified ethernet device for pause parameter information.
+Queries the specified Ethernet device for pause parameter information.
.TP
.B \-A \-\-pause
-Changes the pause parameters of the specified ethernet device.
+Changes the pause parameters of the specified Ethernet device.
.TP
.A2 autoneg on off
Specifies whether pause autonegotiation should be enabled.
@@ -456,7 +456,7 @@ Length of time to perform phys-id, in seconds.
Queries the specified network device for permanent hardware address.
.TP
.B \-r \-\-negotiate
-Restarts auto-negotiation on the specified ethernet device, if
+Restarts auto-negotiation on the specified Ethernet device, if
auto-negotiation is enabled.
.TP
.B \-S \-\-statistics
@@ -535,7 +535,7 @@ this option is a string of characters specifying which options to enable.
.PD 0
.TP 3
.B p
-Wake on phy activity
+Wake on PHY activity
.TP 3
.B u
Wake on unicast messages
@@ -550,10 +550,10 @@ Wake on broadcast messages
Wake on ARP
.TP 3
.B g
-Wake on MagicPacket(tm)
+Wake on MagicPacket\[tm]
.TP 3
.B s
-Enable SecureOn(tm) password for MagicPacket(tm)
+Enable SecureOn\[tm] password for MagicPacket\[tm]
.TP 3
.B d
Disable (wake on nothing). This option clears all previous options.
@@ -561,8 +561,8 @@ Disable (wake on nothing). This option clears all previous options.
.RE
.TP
.B sopass \*(MA\c
-Sets the SecureOn(tm) password. The argument to this option must be 6
-bytes in ethernet MAC hex format (\*(MA).
+Sets the SecureOn\[tm] password. The argument to this option must be 6
+bytes in Ethernet MAC hex format (\*(MA).
.PP
.BI msglvl \ N
.br
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH ethtool 6/7] ethtool.8: Reword synopses for consistency and style
From: Ben Hutchings @ 2011-01-12 16:23 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers
In-Reply-To: <1294849266.3946.0.camel@bwh-desktop>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
diff --git a/ethtool.8.in b/ethtool.8.in
index b7ba73e..203d33d 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -87,7 +87,7 @@
.TH ETHTOOL 8 "January 2011" "Ethtool version @VERSION@"
.SH NAME
-ethtool \- Display or change network driver and hardware settings
+ethtool \- query or control network driver and hardware settings
.SH SYNOPSIS
.B ethtool
.I ethX
@@ -322,8 +322,8 @@ ethtool \- Display or change network driver and hardware settings
.SH DESCRIPTION
.BI ethtool
-is used for querying and changing settings of a network device driver
-and hardware, particularly for wired Ethernet devices.
+is used to query and control network device driver and hardware
+settings, particularly for wired Ethernet devices.
.I ethX
is the name of the network device on which ethtool should operate.
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH ethtool 5/7] ethtool.8: Generalise references to network devices, not Ethernet
From: Ben Hutchings @ 2011-01-12 16:23 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers
In-Reply-To: <1294849266.3946.0.camel@bwh-desktop>
Most operations are generically applicable to devices using other
link-layer protocols.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
diff --git a/ethtool.8.in b/ethtool.8.in
index 4554ca0..b7ba73e 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -87,7 +87,7 @@
.TH ETHTOOL 8 "January 2011" "Ethtool version @VERSION@"
.SH NAME
-ethtool \- Display or change ethernet card settings
+ethtool \- Display or change network driver and hardware settings
.SH SYNOPSIS
.B ethtool
.I ethX
@@ -322,10 +322,11 @@ ethtool \- Display or change ethernet card settings
.SH DESCRIPTION
.BI ethtool
-is used for querying settings of an ethernet device and changing them.
+is used for querying and changing settings of a network device driver
+and hardware, particularly for wired Ethernet devices.
.I ethX
-is the name of the ethernet device on which ethtool should operate.
+is the name of the network device on which ethtool should operate.
.SH OPTIONS
.B ethtool
@@ -351,16 +352,16 @@ Specifies whether RX pause should be enabled.
Specifies whether TX pause should be enabled.
.TP
.B \-c \-\-show\-coalesce
-Queries the specified ethernet device for coalescing information.
+Queries the specified network device for coalescing information.
.TP
.B \-C \-\-coalesce
-Changes the coalescing settings of the specified ethernet device.
+Changes the coalescing settings of the specified network device.
.TP
.B \-g \-\-show\-ring
-Queries the specified ethernet device for rx/tx ring parameter information.
+Queries the specified network device for rx/tx ring parameter information.
.TP
.B \-G \-\-set\-ring
-Changes the rx/tx ring parameters of the specified ethernet device.
+Changes the rx/tx ring parameters of the specified network device.
.TP
.BI rx \ N
Changes the number of ring entries for the Rx ring.
@@ -375,10 +376,10 @@ Changes the number of ring entries for the Rx Jumbo ring.
Changes the number of ring entries for the Tx ring.
.TP
.B \-i \-\-driver
-Queries the specified ethernet device for associated driver information.
+Queries the specified network device for associated driver information.
.TP
.B \-d \-\-register\-dump
-Retrieves and prints a register dump for the specified ethernet device.
+Retrieves and prints a register dump for the specified network device.
The register format for some devices is known and decoded others
are printed in hex.
When
@@ -391,13 +392,13 @@ than reading from the device.
.TP
.B \-e \-\-eeprom\-dump
-Retrieves and prints an EEPROM dump for the specified ethernet device.
+Retrieves and prints an EEPROM dump for the specified network device.
When raw is enabled, then it dumps the raw EEPROM data to stdout. The
length and offset parameters allow dumping certain portions of the EEPROM.
Default is to dump the entire EEPROM.
.TP
.B \-E \-\-change\-eeprom
-If value is specified, changes EEPROM byte for the specified ethernet device.
+If value is specified, changes EEPROM byte for the specified network device.
offset and value specify which byte and it's new value. If value is not
specified, stdin is read and written to the EEPROM. The length and offset
parameters allow writing to certain portions of the EEPROM.
@@ -405,10 +406,10 @@ Because of the persistent nature of writing to the EEPROM, a device-specific
magic key must be specified to prevent the accidental writing to the EEPROM.
.TP
.B \-k \-\-show\-offload
-Queries the specified ethernet device for offload information.
+Queries the specified network device for offload information.
.TP
.B \-K \-\-offload
-Changes the offload parameters of the specified ethernet device.
+Changes the offload parameters of the specified network device.
.TP
.A2 rx on off
Specifies whether RX checksumming should be enabled.
@@ -446,24 +447,24 @@ Specifies whether receive hashing offload should be enabled
.B \-p \-\-identify
Initiates adapter-specific action intended to enable an operator to
easily identify the adapter by sight. Typically this involves
-blinking one or more LEDs on the specific ethernet port.
+blinking one or more LEDs on the specific network port.
.TP
.B N
Length of time to perform phys-id, in seconds.
.TP
.B \-P \-\-show-permaddr
-Queries the specified ethernet device for permanent hardware address.
+Queries the specified network device for permanent hardware address.
.TP
.B \-r \-\-negotiate
Restarts auto-negotiation on the specified ethernet device, if
auto-negotiation is enabled.
.TP
.B \-S \-\-statistics
-Queries the specified ethernet device for NIC- and driver-specific
+Queries the specified network device for NIC- and driver-specific
statistics.
.TP
.B \-t \-\-test
-Executes adapter selftest on the specified ethernet device. Possible test modes are:
+Executes adapter selftest on the specified network device. Possible test modes are:
.TP
.A1 offline online
defines test type:
@@ -473,7 +474,7 @@ defines test type:
means to perform limited set of tests do not interrupting normal adapter operation.
.TP
.B \-s \-\-change
-Allows changing some or all settings of the specified ethernet device.
+Allows changing some or all settings of the specified network device.
All following options only apply if
.B \-s
was specified.
@@ -799,7 +800,7 @@ Specifies the Rx queue to send packets to, or some other action.
.PD
.RE
.SH BUGS
-Not supported (in part or whole) on all ethernet drivers.
+Not supported (in part or whole) on all network drivers.
.SH AUTHOR
.B ethtool
was written by David Miller.
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH ethtool 4/7] ethtool.8: Fix obvious spelling errors
From: Ben Hutchings @ 2011-01-12 16:22 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers
In-Reply-To: <1294849266.3946.0.camel@bwh-desktop>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
diff --git a/ethtool.8.in b/ethtool.8.in
index 75f63ba..4554ca0 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -491,12 +491,12 @@ Selects device port.
.TP
.A2 autoneg on off
Specifies whether autonegotiation should be enabled. Autonegotiation
-is enabled by deafult, but in some network devices may have trouble
+is enabled by default, but in some network devices may have trouble
with it, so you can disable it if really necessary.
.TP
.BI advertise \ N
Sets the speed and duplex advertised by autonegotiation. The argument is
-a hexidecimal value using one or a combination of the following values:
+a hexadecimal value using one or a combination of the following values:
.RS
.PD 0
.TP 3
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH ethtool 3/7] ethtool.8: Substitute version at configure time
From: Ben Hutchings @ 2011-01-12 16:22 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers
In-Reply-To: <1294849266.3946.0.camel@bwh-desktop>
Rename ethtool.8 to ethtool.8.in and let autoconf set the version.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
diff --git a/configure.ac b/configure.ac
index 9bc8c26..a96fd4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,5 +29,5 @@ dnl Checks for library functions.
AC_HEADER_STDC
AC_CHECK_FUNCS(socket strtol)
-AC_CONFIG_FILES([Makefile ethtool.spec])
+AC_CONFIG_FILES([Makefile ethtool.spec ethtool.8])
AC_OUTPUT
diff --git a/ethtool.8 b/ethtool.8.in
similarity index 99%
rename from ethtool.8
rename to ethtool.8.in
index 8c2137b..75f63ba 100644
--- a/ethtool.8
+++ b/ethtool.8.in
@@ -85,7 +85,7 @@
. hy \\n(HY
..
-.TH ETHTOOL 8 "January 2011" "Ethtool version 2.6.37"
+.TH ETHTOOL 8 "January 2011" "Ethtool version @VERSION@"
.SH NAME
ethtool \- Display or change ethernet card settings
.SH SYNOPSIS
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH ethtool 2/7] ethtool.8: Update date, version, web site reference
From: Ben Hutchings @ 2011-01-12 16:22 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers
In-Reply-To: <1294849266.3946.0.camel@bwh-desktop>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
diff --git a/ethtool.8 b/ethtool.8
index 1760924..8c2137b 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -1,6 +1,7 @@
.\" -*- nroff -*-
.\" Copyright 1999 by David S. Miller. All Rights Reserved.
.\" Portions Copyright 2001 Sun Microsystems
+.\" Portions Copyright 2007, 2009 Free Software Foundation, Inc.
.\" This file may be copied under the terms of the GNU Public License.
.\"
.\" .An - list of n alternative values as in "flav vanilla|strawberry"
@@ -48,7 +49,43 @@
.\" \(*HO - hash options
.\"
.ds HO \fBm\fP|\fBv\fP|\fBt\fP|\fBs\fP|\fBd\fP|\fBf\fP|\fBn\fP|\fBr\fP...
-.TH ETHTOOL 8 "July 2007" "Ethtool version 6"
+.\" Start URL.
+.de UR
+. ds m1 \\$1\"
+. nh
+. if \\n(mH \{\
+. \" Start diversion in a new environment.
+. do ev URL-div
+. do di URL-div
+. \}
+..
+.\" End URL.
+.de UE
+. ie \\n(mH \{\
+. br
+. di
+. ev
+.
+. \" Has there been one or more input lines for the link text?
+. ie \\n(dn \{\
+. do HTML-NS "<a href=""\\*(m1"">"
+. \" Yes, strip off final newline of diversion and emit it.
+. do chop URL-div
+. do URL-div
+\c
+. do HTML-NS </a>
+. \}
+. el \
+. do HTML-NS "<a href=""\\*(m1"">\\*(m1</a>"
+\&\\$*\"
+. \}
+. el \
+\\*(la\\*(m1\\*(ra\\$*\"
+.
+. hy \\n(HY
+..
+
+.TH ETHTOOL 8 "January 2011" "Ethtool version 2.6.37"
.SH NAME
ethtool \- Display or change ethernet card settings
.SH SYNOPSIS
@@ -777,6 +814,6 @@ Scott Feldman,
Andi Kleen.
.SH AVAILABILITY
.B ethtool
-is available over the Web on the SourceForge site at
-http://sourceforge.net/projects/gkernel/
-
+is available from
+.UR http://www.kernel.org/pub/software/network/ethtool/
+.UE
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH ethtool 1/7] ethtool: Fix spelling and spacing in online help
From: Ben Hutchings @ 2011-01-12 16:22 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers, Kelly Anderson
In-Reply-To: <1294849266.3946.0.camel@bwh-desktop>
Kelly Anderson <kelly@silka.with-linux.com> pointed out that
the help for --show-nfc was missing a space between two words.
I checked the rest of the help text with aspell and found one
other error.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
diff --git a/ethtool.c b/ethtool.c
index 63e0ead..1afdfe4 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -224,13 +224,13 @@ static struct option {
" [ offset N ]\n"
" [ length N ]\n"
" [ value N ]\n" },
- { "-r", "--negotiate", MODE_NWAY_RST, "Restart N-WAY negotation" },
+ { "-r", "--negotiate", MODE_NWAY_RST, "Restart N-WAY negotiation" },
{ "-p", "--identify", MODE_PHYS_ID, "Show visible port identification (e.g. blinking)",
" [ TIME-IN-SECONDS ]\n" },
{ "-t", "--test", MODE_TEST, "Execute adapter self test",
" [ online | offline ]\n" },
{ "-S", "--statistics", MODE_GSTATS, "Show adapter statistics" },
- { "-n", "--show-nfc", MODE_GNFC, "Show Rx network flow classification"
+ { "-n", "--show-nfc", MODE_GNFC, "Show Rx network flow classification "
"options",
" [ rx-flow-hash tcp4|udp4|ah4|sctp4|"
"tcp6|udp6|ah6|sctp6 ]\n" },
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH ethtool 0/7] Documentation fixes
From: Ben Hutchings @ 2011-01-12 16:21 UTC (permalink / raw)
To: netdev; +Cc: linux-net-drivers
Some minor fixes to the online help and manual page.
Ben Hutchings (7):
ethtool: Fix spelling and spacing in online help
ethtool.8: Update date, version, web site reference
ethtool.8: Substitute version at configure time
ethtool.8: Fix obvious spelling errors
ethtool.8: Generalise references to network devices, not Ethernet
ethtool.8: Reword synopses for consistency and style
ethtool.8: Fix capitalisation
configure.ac | 2 +-
ethtool.8 => ethtool.8.in | 104 ++++++++++++++++++++++++++++++--------------
ethtool.c | 4 +-
3 files changed, 74 insertions(+), 36 deletions(-)
rename ethtool.8 => ethtool.8.in (84%)
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH v4 08/10] ARM: mxs: add ocotp read function
From: Uwe Kleine-König @ 2011-01-12 16:01 UTC (permalink / raw)
To: Sascha Hauer
Cc: Shawn Guo, davem, gerg, baruch, eric, bryan.wu, r64343, B32542,
lw, w.sang, jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <20110112145036.GY12078@pengutronix.de>
Hello Sascha,
On Wed, Jan 12, 2011 at 03:50:36PM +0100, Sascha Hauer wrote:
> On Wed, Jan 12, 2011 at 02:47:12PM +0800, Shawn Guo wrote:
> > On Tue, Jan 11, 2011 at 02:31:37PM +0100, Sascha Hauer wrote:
> > > On Thu, Jan 06, 2011 at 03:13:16PM +0800, Shawn Guo wrote:
> > > > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > > > ---
> > > > Changes for v4:
> > > > - Call cpu_relax() during polling
> > > >
> > > > Changes for v2:
> > > > - Add mutex locking for mxs_read_ocotp()
> > > > - Use type size_t for count and i
> > > > - Add comment for clk_enable/disable skipping
> > > > - Add ERROR bit clearing and polling step
> > > >
> > > > arch/arm/mach-mxs/Makefile | 2 +-
> > > > arch/arm/mach-mxs/include/mach/common.h | 1 +
> > > > arch/arm/mach-mxs/ocotp.c | 79 +++++++++++++++++++++++++++++++
> > > > 3 files changed, 81 insertions(+), 1 deletions(-)
> > > > create mode 100644 arch/arm/mach-mxs/ocotp.c
> > > >
> > > > diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
> > > > index 39d3f9c..f23ebbd 100644
> > > > --- a/arch/arm/mach-mxs/Makefile
> > > > +++ b/arch/arm/mach-mxs/Makefile
> > > > @@ -1,5 +1,5 @@
> > > > # Common support
> > > > -obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
> > > > +obj-y := clock.o devices.o gpio.o icoll.o iomux.o ocotp.o system.o timer.o
> > > >
> > > > obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
> > > > obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
> > > > diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
> > > > index 59133eb..cf02552 100644
> > > > --- a/arch/arm/mach-mxs/include/mach/common.h
> > > > +++ b/arch/arm/mach-mxs/include/mach/common.h
> > > > @@ -13,6 +13,7 @@
> > > >
> > > > struct clk;
> > > >
> > > > +extern int mxs_read_ocotp(int offset, int count, u32 *values);
> > > > extern int mxs_reset_block(void __iomem *);
> > > > extern void mxs_timer_init(struct clk *, int);
> > > >
> > > > diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
> > > > new file mode 100644
> > > > index 0000000..e2d39aa
> > > > --- /dev/null
> > > > +++ b/arch/arm/mach-mxs/ocotp.c
> > > > @@ -0,0 +1,79 @@
> > > > +/*
> > > > + * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
> > > > + *
> > > > + * This program is free software; you can redistribute it and/or modify
> > > > + * it under the terms of the GNU General Public License as published by
> > > > + * the Free Software Foundation; either version 2 of the License, or
> > > > + * (at your option) any later version.
> > > > + *
> > > > + * This program is distributed in the hope that it will be useful,
> > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > > > + * GNU General Public License for more details.
> > > > + */
> > > > +
> > > > +#include <linux/delay.h>
> > > > +#include <linux/err.h>
> > > > +#include <linux/mutex.h>
> > > > +
> > > > +#include <mach/mxs.h>
> > > > +
> > > > +#define BM_OCOTP_CTRL_BUSY (1 << 8)
> > > > +#define BM_OCOTP_CTRL_ERROR (1 << 9)
> > > > +#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
> > > > +
> > > > +static DEFINE_MUTEX(ocotp_mutex);
> > > > +
> > > > +int mxs_read_ocotp(unsigned offset, size_t count, u32 *values)
> > > > +{
> > > > + void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
> > > > + int timeout = 0x400;
> > > > + size_t i;
> > > > +
> > > > + mutex_lock(&ocotp_mutex);
> > > > +
> > > > + /*
> > > > + * clk_enable(hbus_clk) for ocotp can be skipped
> > > > + * as it must be on when system is running.
> > > > + */
> > > > +
> > > > + /* try to clear ERROR bit */
> > > > + __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
> > >
> > > This operation does not try to clear the error bit but actually clears
> > > it...
> > >
> > > > +
> > > > + /* check both BUSY and ERROR cleared */
> > > > + while ((__raw_readl(ocotp_base) &
> > > > + (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
> > > > + cpu_relax();
> > >
> > > ...which means you do not have to poll the error bit here...
> > >
> > > > +
> > > > + if (unlikely(!timeout))
> > > > + goto error_unlock;
> > > > +
> > > > + /* open OCOTP banks for read */
> > > > + __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
> > > > +
> > > > + /* approximately wait 32 hclk cycles */
> > > > + udelay(1);
> > > > +
> > > > + /* poll BUSY bit becoming cleared */
> > > > + timeout = 0x400;
> > > > + while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
> > > > + cpu_relax();
> > >
> > > ...which means you can factor out a ocotp_wait_busy function and let the
> > > code speak instead of the comments.
> > >
> > > > +
> > > > + if (unlikely(!timeout))
> > > > + goto error_unlock;
> > > > +
> > > > + for (i = 0; i < count; i++, offset += 4)
> > > > + *values++ = __raw_readl(ocotp_base + offset);
> > >
> > > The registers in the ocotp are 16 byte aligned. Does it really make
> > > sense to provide a function allowing to read the gaps between the
> > > registers?
> > >
> > Good catch. The count was added to ease the consecutive otp word
> > reading, as there is bank open/close cost for otp read. What about
> > the following changes?
> >
> > int mxs_read_ocotp(unsigned offset, size_t otp_word_cnt, u32 *values)
> > {
> > ......
> >
> > for (i = 0; i < otp_word_cnt; i++, offset += 0x10)
> > *values++ = __raw_readl(ocotp_base + offset);
> >
> > ......
> > }
>
> I would rather make a function like this:
>
> static u32 ocotp[0x27];
>
> const u32 *mxs_get_ocotp(void)
> {
> static int once = 0;
>
> if (once)
> return ocotp
>
> /* bank open */
>
> for (i = 0; i < 0x27; i++)
> ocotp[i] = readl(ocotp_base + 0x20 + i * 0x10)
>
> /* bank_close */
>
> once = 1;
>
> return ocotp;
which is save on UP when it's not called from irq context.
Additionally I suggest a #define for 0x27 and 0x20.
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH v2 2/2] netlink: support setting devgroup parameters
From: jamal @ 2011-01-12 15:44 UTC (permalink / raw)
To: Vlad Dogaru; +Cc: netdev, Octavian Purdila
In-Reply-To: <1294763724-9927-3-git-send-email-ddvlad@rosedu.org>
On Tue, 2011-01-11 at 18:35 +0200, Vlad Dogaru wrote:
> If a rtnetlink request specifies a negative or zero ifindex and has no
> interface name attribute, but has a group attribute, then the chenges
> are made to all the interfaces belonging to the specified group.
>
> Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
Looks good. Please just do some basic tests like setting a few
interfaces to the same group, changing their MTU and setting admin
up then down. If it works add my ACKed-by on both patches.
The only thing that will still generate a lot of noise is the netlink
events that will be generated afterwards for each change on a netdev in
a group i.e a single netlink message..
Maybe we could batch those in a future patch
cheers,
jamal
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox