* [PATCH net-next v3] xfrm: remove useless hash_resize_mutex locks
From: Ying Xue @ 2014-08-29 9:09 UTC (permalink / raw)
To: steffen.klassert; +Cc: davem, christophe.gouault, netdev
In xfrm_state.c, hash_resize_mutex is defined as a local variable
and only used in xfrm_hash_resize() which is declared as a work
handler of xfrm.state_hash_work. But when the xfrm.state_hash_work
work is put in the global workqueue(system_wq) with schedule_work(),
the work will be really inserted in the global workqueue if it was
not already queued, otherwise, it is still left in the same position
on the the global workqueue. This means the xfrm_hash_resize() work
handler is only executed once at any time no matter how many times
its work is scheduled, that is, xfrm_hash_resize() is not called
concurrently at all, so hash_resize_mutex is redundant for us.
Cc: Christophe Gouault <christophe.gouault@6wind.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
net/xfrm/xfrm_state.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 0ab5413..de971b6 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -97,8 +97,6 @@ static unsigned long xfrm_hash_new_size(unsigned int state_hmask)
return ((state_hmask + 1) << 1) * sizeof(struct hlist_head);
}
-static DEFINE_MUTEX(hash_resize_mutex);
-
static void xfrm_hash_resize(struct work_struct *work)
{
struct net *net = container_of(work, struct net, xfrm.state_hash_work);
@@ -107,22 +105,20 @@ static void xfrm_hash_resize(struct work_struct *work)
unsigned int nhashmask, ohashmask;
int i;
- mutex_lock(&hash_resize_mutex);
-
nsize = xfrm_hash_new_size(net->xfrm.state_hmask);
ndst = xfrm_hash_alloc(nsize);
if (!ndst)
- goto out_unlock;
+ return;
nsrc = xfrm_hash_alloc(nsize);
if (!nsrc) {
xfrm_hash_free(ndst, nsize);
- goto out_unlock;
+ return;
}
nspi = xfrm_hash_alloc(nsize);
if (!nspi) {
xfrm_hash_free(ndst, nsize);
xfrm_hash_free(nsrc, nsize);
- goto out_unlock;
+ return;
}
spin_lock_bh(&net->xfrm.xfrm_state_lock);
@@ -148,9 +144,6 @@ static void xfrm_hash_resize(struct work_struct *work)
xfrm_hash_free(odst, osize);
xfrm_hash_free(osrc, osize);
xfrm_hash_free(ospi, osize);
-
-out_unlock:
- mutex_unlock(&hash_resize_mutex);
}
static DEFINE_SPINLOCK(xfrm_state_afinfo_lock);
--
1.7.9.5
^ permalink raw reply related
* [net PATCH 1/1] drivers: net: cpsw: dual_emac: fix reducing of rx descriptor during ifdown
From: Mugunthan V N @ 2014-08-29 9:22 UTC (permalink / raw)
To: netdev; +Cc: davem, Mugunthan V N
In Dual EMAC, when both interface are up and while doing ifdown with heavy
traffic then skbs already processed by DMA from that slave emac has to be
requeued as still the other interface is up and running.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 999fb72..04369cf 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -699,8 +699,27 @@ static void cpsw_rx_handler(void *token, int len, int status)
cpsw_dual_emac_src_port_detect(status, priv, ndev, skb);
if (unlikely(status < 0) || unlikely(!netif_running(ndev))) {
- /* the interface is going down, skbs are purged */
- dev_kfree_skb_any(skb);
+ bool ndev_status = false;
+ struct cpsw_slave *slave = priv->slaves;
+ int n;
+
+ if (priv->data.dual_emac) {
+ /* In dual emac mode check for all interfaces */
+ for (n = priv->data.slaves; n; n--, slave++)
+ if (netif_running(slave->ndev))
+ ndev_status = true;
+ }
+
+ if (ndev_status) {
+ /* Though this interface is down, other interface is up
+ * and running so requeue skb back to cpdma.
+ */
+ new_skb = skb;
+ goto requeue;
+ } else {
+ /* the interface is going down, skbs are purged */
+ dev_kfree_skb_any(skb);
+ }
return;
}
@@ -717,6 +736,7 @@ static void cpsw_rx_handler(void *token, int len, int status)
new_skb = skb;
}
+requeue:
ret = cpdma_chan_submit(priv->rxch, new_skb, new_skb->data,
skb_tailroom(new_skb), 0);
if (WARN_ON(ret < 0))
--
2.1.0
^ permalink raw reply related
* [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann
This series contains updates to i40e, i40evf, ixgbe and ixgbevf.
Catherine adds dual speed module support to i40e. Updates i40e to allow
the user to change link settings when the link is down.
Serey renames i40e_ndo_set_vf_spoofck() to i40e_ndo_set_vf_spookchk()
to be more consistent with what is defined in netdev and removes a
unnecessary variable assignment.
Jesse makes a malicious driver detection warning only print if extended
driver string is enabled for i40e. Fixes a panic under traffic load when
resetting or if/whenever there was a Tx-timeout because we were enabling
the Tx queue to early.
Anjali fixes an issue when PF reset fails, where we were trying to restart
the admin queue which has not been setup at that point. This resolves an
occasional kernel panic when PF reset fails for some reason.
Ethan Zhao replaces the use of a local i40e_vfs_are_assigned() with the
global kernel pci_vfs_assigned() for i40e.
Alex cleans up the FDB handling for ixgbe. This change makes it so that
the behavior for FDB handling is consistent between both the SR-IOV and
non-SR-IOV cases. The main change is that we perform bounds checking on
the number of SR-IOV addresses regardless of if SR-IOV is enabled or not
as we can only support a certain number of addresses in the hardware.
Emil extends the pending Tx work check to the VF interfaces, where the
driver initiates a reset of the interface on link loss with pending Tx
work in order to clear the rings. Introduces a delay for 82599 VFs of
at least 500 usecs to make sure the VFLINKS value is correct, since this
bit tends to flap when a DA or SFP+ cable is disconnected.
Jacob adds code comments in ixgbe to make it more obvious that we are
resetting features based on the fact that we do not have MSI-X enabled,
and cannot use the previous settings. Also resolves a kernel NULL
pointer dereference by limiting the combined total of MACVLAN and
SR-IOV VFs, since the hardware has a limited number of pools available
(64). Previously, no checks were in place to limit the number of
accelerated MACVLAN devices based on the number of pools, which would
be ok since there was already a limit for these well below the number of
available pools. However, SR-IOV uses the very same pools, therefore
we need to ensure that the total number of pools does not exceed the
number of pools available in the hardware.
The following are changes since commit a3bf5c429eb5f5ec4d364d51dfa8855efcc005f8:
r8169: add missing MODULE_FIRMWARE.
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Alexander Duyck (1):
ixgbe: Cleanup FDB handling code
Anjali Singhai Jain (1):
i40e: Fix an issue when PF reset fails
Catherine Sullivan (4):
i40e: Add dual speed module support
i40e: Allow user to change link settings if link is down
i40e: Tell OS link is going down when calling set_phy_config
i40e/i40evf: Bump i40e/i40evf versions
Emil Tantilov (2):
ixgbe: reset interface on link loss with pending Tx work from the VF
ixgbevf: introduce delay for checking VFLINKS on 82599
Ethan Zhao (1):
i40e: use global pci_vfs_assigned() to replace local
i40e_vfs_are_assigned()
Jacob Keller (2):
ixgbe: add comment noting recalculation of queues
ixgbe: limit combined total of macvlan and SR-IOV VFs
Jesse Brandeburg (2):
i40e: make warning less verbose
i40e: fix panic due to too-early Tx queue enable
Serey Kong (2):
i40e: Change wording to be more consistent
i40e: Remove unnecessary assignment
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 55 +++++++------
drivers/net/ethernet/intel/i40e/i40e_main.c | 45 +++++-----
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 36 +-------
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 +-
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 8 ++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 96 ++++++++++++----------
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 14 ++--
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 7 ++
drivers/net/ethernet/intel/ixgbevf/vf.c | 15 ++++
12 files changed, 156 insertions(+), 127 deletions(-)
--
1.9.3
^ permalink raw reply
* [net-next 02/15] i40e: Allow user to change link settings if link is down
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Catherine Sullivan <catherine.sullivan@intel.com>
Allow the user to change auto-negotiation and speed settings if
link is down.
Change-ID: I372967c627682b5e1835f623a7cbf41b21b51043
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index e701f42..de4ce0e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -466,7 +466,8 @@ static int i40e_set_settings(struct net_device *netdev,
if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET &&
hw->phy.media_type != I40E_MEDIA_TYPE_FIBER &&
- hw->phy.media_type != I40E_MEDIA_TYPE_BACKPLANE)
+ hw->phy.media_type != I40E_MEDIA_TYPE_BACKPLANE &&
+ hw->phy.link_info.link_info & I40E_AQ_LINK_UP)
return -EOPNOTSUPP;
/* get our own copy of the bits to check against */
--
1.9.3
^ permalink raw reply related
* [net-next 01/15] i40e: Add dual speed module support
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Catherine Sullivan <catherine.sullivan@intel.com>
Now that fw has implemented dual speed module support, we can add ours.
Also, add the phy type for 1G LR/SR and set its media type to fiber.
Lastly, instead of a WARN_ON if the phy type is not recognized just print
a warning.
Change-ID: I2e5227d4a8c2907b0ed423038e5dbce774e466b0
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_common.c | 2 ++
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 31 +++++++++-----------------
2 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 01874c0..30056b2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -752,6 +752,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
switch (hw->phy.link_info.phy_type) {
case I40E_PHY_TYPE_10GBASE_SR:
case I40E_PHY_TYPE_10GBASE_LR:
+ case I40E_PHY_TYPE_1000BASE_SX:
+ case I40E_PHY_TYPE_1000BASE_LX:
case I40E_PHY_TYPE_40GBASE_SR4:
case I40E_PHY_TYPE_40GBASE_LR4:
media = I40E_MEDIA_TYPE_FIBER;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 571d527..e701f42 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -313,7 +313,10 @@ static int i40e_get_settings(struct net_device *netdev,
break;
case I40E_PHY_TYPE_10GBASE_SR:
case I40E_PHY_TYPE_10GBASE_LR:
+ case I40E_PHY_TYPE_1000BASE_SX:
+ case I40E_PHY_TYPE_1000BASE_LX:
ecmd->supported = SUPPORTED_10000baseT_Full;
+ ecmd->supported |= SUPPORTED_1000baseT_Full;
break;
case I40E_PHY_TYPE_10GBASE_CR1_CU:
case I40E_PHY_TYPE_10GBASE_CR1:
@@ -352,7 +355,8 @@ static int i40e_get_settings(struct net_device *netdev,
break;
default:
/* if we got here and link is up something bad is afoot */
- WARN_ON(link_up);
+ netdev_info(netdev, "WARNING: Link is up but PHY type 0x%x is not recognized.\n",
+ hw_link_info->phy_type);
}
no_valid_phy_type:
@@ -493,11 +497,10 @@ static int i40e_set_settings(struct net_device *netdev,
if (status)
return -EAGAIN;
- /* Copy link_speed and abilities to config in case they are not
+ /* Copy abilities to config in case autoneg is not
* set below
*/
memset(&config, 0, sizeof(struct i40e_aq_set_phy_config));
- config.link_speed = abilities.link_speed;
config.abilities = abilities.abilities;
/* Check autoneg */
@@ -534,33 +537,21 @@ static int i40e_set_settings(struct net_device *netdev,
return -EINVAL;
if (advertise & ADVERTISED_100baseT_Full)
- if (!(abilities.link_speed & I40E_LINK_SPEED_100MB)) {
- config.link_speed |= I40E_LINK_SPEED_100MB;
- change = true;
- }
+ config.link_speed |= I40E_LINK_SPEED_100MB;
if (advertise & ADVERTISED_1000baseT_Full ||
advertise & ADVERTISED_1000baseKX_Full)
- if (!(abilities.link_speed & I40E_LINK_SPEED_1GB)) {
- config.link_speed |= I40E_LINK_SPEED_1GB;
- change = true;
- }
+ config.link_speed |= I40E_LINK_SPEED_1GB;
if (advertise & ADVERTISED_10000baseT_Full ||
advertise & ADVERTISED_10000baseKX4_Full ||
advertise & ADVERTISED_10000baseKR_Full)
- if (!(abilities.link_speed & I40E_LINK_SPEED_10GB)) {
- config.link_speed |= I40E_LINK_SPEED_10GB;
- change = true;
- }
+ config.link_speed |= I40E_LINK_SPEED_10GB;
if (advertise & ADVERTISED_40000baseKR4_Full ||
advertise & ADVERTISED_40000baseCR4_Full ||
advertise & ADVERTISED_40000baseSR4_Full ||
advertise & ADVERTISED_40000baseLR4_Full)
- if (!(abilities.link_speed & I40E_LINK_SPEED_40GB)) {
- config.link_speed |= I40E_LINK_SPEED_40GB;
- change = true;
- }
+ config.link_speed |= I40E_LINK_SPEED_40GB;
- if (change) {
+ if (change || (abilities.link_speed != config.link_speed)) {
/* copy over the rest of the abilities */
config.phy_type = abilities.phy_type;
config.eee_capability = abilities.eee_capability;
--
1.9.3
^ permalink raw reply related
* [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Catherine Sullivan <catherine.sullivan@intel.com>
Since we don't seem to be getting an LSE telling us link is going down
during set_phy_config (but we do get an LSE telling us we are coming
back up), fake one for the OS and tell them link is going down. Also
do an atomic restart no matter what because there are times the user
may want to end with link up even if they started with link down (like
if they accidentally set it to a speed that can't link and are trying to
fix it).
Change-ID: I0a642af9c1d0feb67bce741aba1a9c33bd349ed6
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index de4ce0e..101be2f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -559,9 +559,17 @@ static int i40e_set_settings(struct net_device *netdev,
config.eeer = abilities.eeer_val;
config.low_power_ctrl = abilities.d3_lpan;
- /* If link is up set link and an so changes take effect */
- if (hw->phy.link_info.link_info & I40E_AQ_LINK_UP)
- config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
+ /* set link and an so changes take effect */
+ config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
+ /* If link is up put link down */
+ if (hw->phy.link_info.link_info & I40E_AQ_LINK_UP) {
+ /* Tell the OS link is going down, the link will go
+ * back up when fw says it is ready asynchronously
+ */
+ netdev_info(netdev, "PHY settings change requested, NIC Link is going down.\n");
+ netif_carrier_off(netdev);
+ netif_tx_stop_all_queues(netdev);
+ }
/* make the aq call */
status = i40e_aq_set_phy_config(hw, &config, NULL);
@@ -678,6 +686,13 @@ static int i40e_set_pauseparam(struct net_device *netdev,
else
return -EINVAL;
+ /* Tell the OS link is going down, the link will go back up when fw
+ * says it is ready asynchronously
+ */
+ netdev_info(netdev, "Flow control settings change requested, NIC Link is going down.\n");
+ netif_carrier_off(netdev);
+ netif_tx_stop_all_queues(netdev);
+
/* Set the fc mode and only restart an if link is up*/
status = i40e_set_fc(hw, &aq_failures, link_up);
--
1.9.3
^ permalink raw reply related
* [net-next 03/15] i40e: Change wording to be more consistent
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Serey Kong, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Serey Kong <serey.kong@intel.com>
Change "spoofck" to "spoofchk" to be consistent with as defined in netdev.
Change-ID: I9866d6284cb5f92c8d71dc0776c6d1e71dfb62a5
Signed-off-by: Serey Kong <serey.kong@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bd192b8..2fccd06 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7469,7 +7469,7 @@ static const struct net_device_ops i40e_netdev_ops = {
.ndo_set_vf_rate = i40e_ndo_set_vf_bw,
.ndo_get_vf_config = i40e_ndo_get_vf_config,
.ndo_set_vf_link_state = i40e_ndo_set_vf_link_state,
- .ndo_set_vf_spoofchk = i40e_ndo_set_vf_spoofck,
+ .ndo_set_vf_spoofchk = i40e_ndo_set_vf_spoofchk,
#ifdef CONFIG_I40E_VXLAN
.ndo_add_vxlan_port = i40e_add_vxlan_port,
.ndo_del_vxlan_port = i40e_del_vxlan_port,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index da0f005..4d8fd22 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2423,7 +2423,7 @@ error_out:
*
* Enable or disable VF spoof checking
**/
-int i40e_ndo_set_vf_spoofck(struct net_device *netdev, int vf_id, bool enable)
+int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable)
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index 63e7e0d..0adc61e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -122,7 +122,7 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
int i40e_ndo_get_vf_config(struct net_device *netdev,
int vf_id, struct ifla_vf_info *ivi);
int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link);
-int i40e_ndo_set_vf_spoofck(struct net_device *netdev, int vf_id, bool enable);
+int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable);
void i40e_vc_notify_link_state(struct i40e_pf *pf);
void i40e_vc_notify_reset(struct i40e_pf *pf);
--
1.9.3
^ permalink raw reply related
* [net-next 04/15] i40e: Remove unnecessary assignment
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Serey Kong, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Serey Kong <serey.kong@intel.com>
Remove unnecessary setting of "ret" variable as it's already set at
the top of the function.
Change-ID: Icaccfc67f335817a23579b7c43625d59ad6c9925
Signed-off-by: Serey Kong <serey.kong@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 4d8fd22..aeae5f2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2098,7 +2098,6 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
/* Force the VF driver stop so it has to reload with new MAC address */
i40e_vc_disable_vf(pf, vf);
dev_info(&pf->pdev->dev, "Reload the VF driver to make this change effective.\n");
- ret = 0;
error_param:
return ret;
--
1.9.3
^ permalink raw reply related
* [net-next 07/15] i40e: Fix an issue when PF reset fails
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Anjali Singhai Jain, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Anjali Singhai Jain <anjali.singhai@intel.com>
We shouldn't restart Admin queue subtask if PF reset fails since we do
not have the AQ setup at that point. This patch makes sure we disable AQ
clean subtask when PF reset fails.
This will resolve an occasional kernel panic when PF reset fails for
some reason.
Change-ID: I11a747773362a8c5c0ad7a10cd34be0bda8eb9e8
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 13 ++++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 4e97ba1..f1e33f8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -145,6 +145,7 @@ enum i40e_state_t {
__I40E_BAD_EEPROM,
__I40E_DOWN_REQUESTED,
__I40E_FD_FLUSH_REQUESTED,
+ __I40E_RESET_FAILED,
};
enum i40e_interrupt_policy {
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 55a31ab..64b8683 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5568,6 +5568,10 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
u32 oldval;
u32 val;
+ /* Do not run clean AQ when PF reset fails */
+ if (test_bit(__I40E_RESET_FAILED, &pf->state))
+ return;
+
/* check for error indications */
val = rd32(&pf->hw, pf->hw.aq.arq.len);
oldval = val;
@@ -5973,19 +5977,20 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
ret = i40e_pf_reset(hw);
if (ret) {
dev_info(&pf->pdev->dev, "PF reset failed, %d\n", ret);
- goto end_core_reset;
+ set_bit(__I40E_RESET_FAILED, &pf->state);
+ goto clear_recovery;
}
pf->pfr_count++;
if (test_bit(__I40E_DOWN, &pf->state))
- goto end_core_reset;
+ goto clear_recovery;
dev_dbg(&pf->pdev->dev, "Rebuilding internal switch\n");
/* rebuild the basics for the AdminQ, HMC, and initial HW switch */
ret = i40e_init_adminq(&pf->hw);
if (ret) {
dev_info(&pf->pdev->dev, "Rebuild AdminQ failed, %d\n", ret);
- goto end_core_reset;
+ goto clear_recovery;
}
/* re-verify the eeprom if we just had an EMP reset */
@@ -6103,6 +6108,8 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
i40e_send_version(pf);
end_core_reset:
+ clear_bit(__I40E_RESET_FAILED, &pf->state);
+clear_recovery:
clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);
}
--
1.9.3
^ permalink raw reply related
* [net-next 06/15] i40e: make warning less verbose
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Jesse Brandeburg, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
The driver is un-necessarily printing a warning that is only marginally
useful to the user. Make the warning only print if extended driver
string printing is enabled, other messages related to a reset event
will still continue to print.
Change-ID: I5e8beca6516a2f176cd2e72b0ac2b3b909e6c953
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 2fccd06..55a31ab 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6148,9 +6148,9 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
I40E_GL_MDET_TX_EVENT_SHIFT;
u8 queue = (reg & I40E_GL_MDET_TX_QUEUE_MASK) >>
I40E_GL_MDET_TX_QUEUE_SHIFT;
- dev_info(&pf->pdev->dev,
- "Malicious Driver Detection event 0x%02x on TX queue %d pf number 0x%02x vf number 0x%02x\n",
- event, queue, pf_num, vf_num);
+ if (netif_msg_tx_err(pf))
+ dev_info(&pf->pdev->dev, "Malicious Driver Detection event 0x%02x on TX queue %d pf number 0x%02x vf number 0x%02x\n",
+ event, queue, pf_num, vf_num);
wr32(hw, I40E_GL_MDET_TX, 0xffffffff);
mdd_detected = true;
}
@@ -6162,9 +6162,9 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
I40E_GL_MDET_RX_EVENT_SHIFT;
u8 queue = (reg & I40E_GL_MDET_RX_QUEUE_MASK) >>
I40E_GL_MDET_RX_QUEUE_SHIFT;
- dev_info(&pf->pdev->dev,
- "Malicious Driver Detection event 0x%02x on RX queue %d of function 0x%02x\n",
- event, queue, func);
+ if (netif_msg_rx_err(pf))
+ dev_info(&pf->pdev->dev, "Malicious Driver Detection event 0x%02x on RX queue %d of function 0x%02x\n",
+ event, queue, func);
wr32(hw, I40E_GL_MDET_RX, 0xffffffff);
mdd_detected = true;
}
@@ -6173,17 +6173,13 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
reg = rd32(hw, I40E_PF_MDET_TX);
if (reg & I40E_PF_MDET_TX_VALID_MASK) {
wr32(hw, I40E_PF_MDET_TX, 0xFFFF);
- dev_info(&pf->pdev->dev,
- "MDD TX event is for this function 0x%08x, requesting PF reset.\n",
- reg);
+ dev_info(&pf->pdev->dev, "TX driver issue detected, PF reset issued\n");
pf_mdd_detected = true;
}
reg = rd32(hw, I40E_PF_MDET_RX);
if (reg & I40E_PF_MDET_RX_VALID_MASK) {
wr32(hw, I40E_PF_MDET_RX, 0xFFFF);
- dev_info(&pf->pdev->dev,
- "MDD RX event is for this function 0x%08x, requesting PF reset.\n",
- reg);
+ dev_info(&pf->pdev->dev, "RX driver issue detected, PF reset issued\n");
pf_mdd_detected = true;
}
/* Queue belongs to the PF, initiate a reset */
@@ -6200,14 +6196,16 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
if (reg & I40E_VP_MDET_TX_VALID_MASK) {
wr32(hw, I40E_VP_MDET_TX(i), 0xFFFF);
vf->num_mdd_events++;
- dev_info(&pf->pdev->dev, "MDD TX event on VF %d\n", i);
+ dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n",
+ i);
}
reg = rd32(hw, I40E_VP_MDET_RX(i));
if (reg & I40E_VP_MDET_RX_VALID_MASK) {
wr32(hw, I40E_VP_MDET_RX(i), 0xFFFF);
vf->num_mdd_events++;
- dev_info(&pf->pdev->dev, "MDD RX event on VF %d\n", i);
+ dev_info(&pf->pdev->dev, "RX driver issue detected on VF %d\n",
+ i);
}
if (vf->num_mdd_events > I40E_DEFAULT_NUM_MDD_EVENTS_ALLOWED) {
--
1.9.3
^ permalink raw reply related
* [net-next 08/15] i40e: fix panic due to too-early Tx queue enable
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem
Cc: Jesse Brandeburg, netdev, nhorman, sassmann, Mitch Williams,
Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
This fixes the panic under traffic load when resetting. This issue
could also show up if/whenever there is a Tx-timeout.
Change-ID: Ie393a1f17fd5d962e56fc3bfe784899ef25402f5
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 64b8683..d37dea1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5289,7 +5289,7 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf)
**/
static void i40e_vsi_link_event(struct i40e_vsi *vsi, bool link_up)
{
- if (!vsi)
+ if (!vsi || (test_bit(__I40E_DOWN, &vsi->state)))
return;
switch (vsi->type) {
--
1.9.3
^ permalink raw reply related
* [net-next 09/15] i40e/i40evf: Bump i40e/i40evf versions
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Catherine Sullivan <catherine.sullivan@intel.com>
Bump i40e version to 1.0.11 and i40evf version to 1.0.5.
Change-ID: I63a60fa2efe82aae87a8a3095f43218db57d46ce
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d37dea1..0a4e16f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =
#define DRV_VERSION_MAJOR 1
#define DRV_VERSION_MINOR 0
-#define DRV_VERSION_BUILD 4
+#define DRV_VERSION_BUILD 11
#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
__stringify(DRV_VERSION_MINOR) "." \
__stringify(DRV_VERSION_BUILD) DRV_KERN
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 8c80925..c51bc7a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -36,7 +36,7 @@ char i40evf_driver_name[] = "i40evf";
static const char i40evf_driver_string[] =
"Intel(R) XL710/X710 Virtual Function Network Driver";
-#define DRV_VERSION "1.0.1"
+#define DRV_VERSION "1.0.5"
const char i40evf_driver_version[] = DRV_VERSION;
static const char i40evf_copyright[] =
"Copyright (c) 2013 - 2014 Intel Corporation.";
--
1.9.3
^ permalink raw reply related
* [net-next 10/15] i40e: use global pci_vfs_assigned() to replace local i40e_vfs_are_assigned()
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Ethan Zhao, netdev, nhorman, sassmann, Ethan Zhao, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Ethan Zhao <ethan.zhao@oracle.com>
There is global funcion pci_vfs_assigned(), so use it instead of composing
local one.
Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 33 ++--------------------
1 file changed, 2 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index aeae5f2..4eeed26 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -707,35 +707,6 @@ complete_reset:
wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);
i40e_flush(hw);
}
-
-/**
- * i40e_vfs_are_assigned
- * @pf: pointer to the pf structure
- *
- * Determine if any VFs are assigned to VMs
- **/
-static bool i40e_vfs_are_assigned(struct i40e_pf *pf)
-{
- struct pci_dev *pdev = pf->pdev;
- struct pci_dev *vfdev;
-
- /* loop through all the VFs to see if we own any that are assigned */
- vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_VF , NULL);
- while (vfdev) {
- /* if we don't own it we don't care */
- if (vfdev->is_virtfn && pci_physfn(vfdev) == pdev) {
- /* if it is assigned we cannot release it */
- if (vfdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
- return true;
- }
-
- vfdev = pci_get_device(PCI_VENDOR_ID_INTEL,
- I40E_DEV_ID_VF,
- vfdev);
- }
-
- return false;
-}
#ifdef CONFIG_PCI_IOV
/**
@@ -843,7 +814,7 @@ void i40e_free_vfs(struct i40e_pf *pf)
* assigned. Setting the number of VFs to 0 through sysfs is caught
* before this function ever gets called.
*/
- if (!i40e_vfs_are_assigned(pf)) {
+ if (!pci_vfs_assigned(pf->pdev)) {
pci_disable_sriov(pf->pdev);
/* Acknowledge VFLR for all VFS. Without this, VFs will fail to
* work correctly when SR-IOV gets re-enabled.
@@ -980,7 +951,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
if (num_vfs)
return i40e_pci_sriov_enable(pdev, num_vfs);
- if (!i40e_vfs_are_assigned(pf)) {
+ if (!pci_vfs_assigned(pf->pdev)) {
i40e_free_vfs(pf);
} else {
dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n");
--
1.9.3
^ permalink raw reply related
* [net-next 12/15] ixgbe: reset interface on link loss with pending Tx work from the VF
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Emil Tantilov <emil.s.tantilov@intel.com>
ixgbe initiates a reset of the interface on link loss with pending Tx work
in order to clear the rings.
This patch extends the pending Tx work check to the VF interfaces with the
same purpose.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 54 +++++++++++++++++++++------
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 7 ++++
2 files changed, 49 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 2210c6d..bc3eff7 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6319,25 +6319,55 @@ static void ixgbe_watchdog_link_is_down(struct ixgbe_adapter *adapter)
ixgbe_ping_all_vfs(adapter);
}
+static bool ixgbe_ring_tx_pending(struct ixgbe_adapter *adapter)
+{
+ int i;
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ struct ixgbe_ring *tx_ring = adapter->tx_ring[i];
+
+ if (tx_ring->next_to_use != tx_ring->next_to_clean)
+ return true;
+ }
+
+ return false;
+}
+
+static bool ixgbe_vf_tx_pending(struct ixgbe_adapter *adapter)
+{
+ struct ixgbe_hw *hw = &adapter->hw;
+ struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
+ u32 q_per_pool = __ALIGN_MASK(1, ~vmdq->mask);
+
+ int i, j;
+
+ if (!adapter->num_vfs)
+ return false;
+
+ for (i = 0; i < adapter->num_vfs; i++) {
+ for (j = 0; j < q_per_pool; j++) {
+ u32 h, t;
+
+ h = IXGBE_READ_REG(hw, IXGBE_PVFTDHN(q_per_pool, i, j));
+ t = IXGBE_READ_REG(hw, IXGBE_PVFTDTN(q_per_pool, i, j));
+
+ if (h != t)
+ return true;
+ }
+ }
+
+ return false;
+}
+
/**
* ixgbe_watchdog_flush_tx - flush queues on link down
* @adapter: pointer to the device adapter structure
**/
static void ixgbe_watchdog_flush_tx(struct ixgbe_adapter *adapter)
{
- int i;
- int some_tx_pending = 0;
-
if (!netif_carrier_ok(adapter->netdev)) {
- for (i = 0; i < adapter->num_tx_queues; i++) {
- struct ixgbe_ring *tx_ring = adapter->tx_ring[i];
- if (tx_ring->next_to_use != tx_ring->next_to_clean) {
- some_tx_pending = 1;
- break;
- }
- }
-
- if (some_tx_pending) {
+ if (ixgbe_ring_tx_pending(adapter) ||
+ ixgbe_vf_tx_pending(adapter)) {
/* We've lost link, so the controller stops DMA,
* but we've got queued Tx work that's never going
* to get done, so reset controller to flush Tx.
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index e6b07c2..dfd55d8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -2194,6 +2194,8 @@ enum {
#define IXGBE_VFLRE(_i) ((((_i) & 1) ? 0x001C0 : 0x00600))
#define IXGBE_VFLREC(_i) (0x00700 + ((_i) * 4))
/* Translated register #defines */
+#define IXGBE_PVFTDH(P) (0x06010 + (0x40 * (P)))
+#define IXGBE_PVFTDT(P) (0x06018 + (0x40 * (P)))
#define IXGBE_PVFTDWBAL(P) (0x06038 + (0x40 * (P)))
#define IXGBE_PVFTDWBAH(P) (0x0603C + (0x40 * (P)))
@@ -2202,6 +2204,11 @@ enum {
#define IXGBE_PVFTDWBAHn(q_per_pool, vf_number, vf_q_index) \
(IXGBE_PVFTDWBAH((q_per_pool)*(vf_number) + (vf_q_index)))
+#define IXGBE_PVFTDHN(q_per_pool, vf_number, vf_q_index) \
+ (IXGBE_PVFTDH((q_per_pool)*(vf_number) + (vf_q_index)))
+#define IXGBE_PVFTDTN(q_per_pool, vf_number, vf_q_index) \
+ (IXGBE_PVFTDT((q_per_pool)*(vf_number) + (vf_q_index)))
+
enum ixgbe_fdir_pballoc_type {
IXGBE_FDIR_PBALLOC_NONE = 0,
IXGBE_FDIR_PBALLOC_64K = 1,
--
1.9.3
^ permalink raw reply related
* [net-next 11/15] ixgbe: Cleanup FDB handling code
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change makes it so that the behavior for FDB handling is consistent
between both the SR-IOV and non-SR-IOV cases. The main change here is that we
perform bounds checking on the number of SR-IOV addresses regardless of if
SR-IOV is enabled or not as we can only support a certain number of addresses
in the hardware.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 34 ++++-----------------------
1 file changed, 4 insertions(+), 30 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 53fbf06..2210c6d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7741,39 +7741,13 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
const unsigned char *addr,
u16 flags)
{
- struct ixgbe_adapter *adapter = netdev_priv(dev);
- int err;
-
- if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
- return ndo_dflt_fdb_add(ndm, tb, dev, addr, flags);
-
- /* Hardware does not support aging addresses so if a
- * ndm_state is given only allow permanent addresses
- */
- if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
- pr_info("%s: FDB only supports static addresses\n",
- ixgbe_driver_name);
- return -EINVAL;
- }
-
+ /* guarantee we can provide a unique filter for the unicast address */
if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
- u32 rar_uc_entries = IXGBE_MAX_PF_MACVLANS;
-
- if (netdev_uc_count(dev) < rar_uc_entries)
- err = dev_uc_add_excl(dev, addr);
- else
- err = -ENOMEM;
- } else if (is_multicast_ether_addr(addr)) {
- err = dev_mc_add_excl(dev, addr);
- } else {
- err = -EINVAL;
+ if (IXGBE_MAX_PF_MACVLANS <= netdev_uc_count(dev))
+ return -ENOMEM;
}
- /* Only return duplicate errors if NLM_F_EXCL is set */
- if (err == -EEXIST && !(flags & NLM_F_EXCL))
- err = 0;
-
- return err;
+ return ndo_dflt_fdb_add(ndm, tb, dev, addr, flags);
}
static int ixgbe_ndo_bridge_setlink(struct net_device *dev,
--
1.9.3
^ permalink raw reply related
* [net-next 13/15] ixgbevf: introduce delay for checking VFLINKS on 82599
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Emil Tantilov <emil.s.tantilov@intel.com>
VFLINKS.LINKUP bit tends to flap when a DA or SFP+ cable is disconnected.
It can take up to 500 usecs for the LINKUP bit to be correct.
This patch resolves the issue by introducing a delay for 82599 VFs of at
least 500 usecs to make sure the VFLINKS value is correct.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/vf.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
index 4d44d64..9cddd56 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.c
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c
@@ -434,6 +434,21 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
if (!(links_reg & IXGBE_LINKS_UP))
goto out;
+ /* for SFP+ modules and DA cables on 82599 it can take up to 500usecs
+ * before the link status is correct
+ */
+ if (mac->type == ixgbe_mac_82599_vf) {
+ int i;
+
+ for (i = 0; i < 5; i++) {
+ udelay(100);
+ links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
+
+ if (!(links_reg & IXGBE_LINKS_UP))
+ goto out;
+ }
+ }
+
switch (links_reg & IXGBE_LINKS_SPEED_82599) {
case IXGBE_LINKS_SPEED_10G_82599:
*speed = IXGBE_LINK_SPEED_10GB_FULL;
--
1.9.3
^ permalink raw reply related
* [net-next 14/15] ixgbe: add comment noting recalculation of queues
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
Since we previously called ixgbe_set_num_queues just prior to attempting
to set our interrupt scheme, it may be non obvious why we have to call
it again inside the function. Add a comment which helps make it more
obvious that we are resetting features based on the fact that we do not
have MSI-X enabled, and cannot use the previous settings.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index 2d9451e..ae36fd6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -1086,6 +1086,11 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
return;
}
+ /* At this point, we do not have MSI-X capabilities. We need to
+ * reconfigure or disable various features which require MSI-X
+ * capability.
+ */
+
/* disable DCB if number of TCs exceeds 1 */
if (netdev_get_num_tc(adapter->netdev) > 1) {
e_err(probe, "num TCs exceeds number of queues - disabling DCB\n");
@@ -1107,6 +1112,9 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
/* disable RSS */
adapter->ring_feature[RING_F_RSS].limit = 1;
+ /* recalculate number of queues now that many features have been
+ * changed or disabled.
+ */
ixgbe_set_num_queues(adapter);
adapter->num_q_vectors = 1;
--
1.9.3
^ permalink raw reply related
* [net-next 15/15] ixgbe: limit combined total of macvlan and SR-IOV VFs
From: Jeff Kirsher @ 2014-08-29 9:30 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, John Fastabend,
Jeff Kirsher
In-Reply-To: <1409304620-23251-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
Hardware has a limited number of pools available (64). Previously, no
checks were in place to limit the number of accelerated macvlan devices
based on the number of pools. Normally this would be ok, because there
was already a limit for these well below the number of available pools.
However, SR-IOV uses the very same pools. Therefor, we need to ensure
that the total number of pools (number of VFs plus the number of non-VF
pools in use for accelerated macvlans) does not exceed the number of
pools available in hardware.
This patch resolves a kernel NULL pointer dereference caused by the following commands:
$modprobe ixgbe max_vfs=63
$ethtool -K eth2 l2-fwd-offload on
$ip link add link eth2 macvlan0 type macvlan
$ip link set dev macvlan0 up
[ 992.950080] BUG: unable to handle kernel NULL pointer dereference at 0000000000000056
[ 992.951109] IP: [<ffffffffa003b71e>] ixgbe_disable_fwd_ring+0x1e/0xf0 [ixgbe]
[ 992.951684] PGD 22a80e067 PUD 232e9b067 PMD 0
[ 992.952389] Oops: 0000 [#1] SMP
[ 992.953014] Modules linked in: nfsd lockd nfs_acl exportfs auth_rpcgss oid_registry sunrpc bridge stp llc vhost_net macvtap macvlan vhost tun kvm_intel kvm ioatdma ixgbe mdio igb dca
[ 992.956042] CPU: 2 PID: 11928 Comm: ifconfig Not tainted 3.16.0-rc6-net-next-07-29-2014-FCoE+ #1
[ 992.956915] Hardware name: Intel Corporation S2600CO/S2600CO, BIOS SE5C600.86B.02.03.0003.041920141333 04/19/2014
[ 992.957791] task: ffff8804341c0000 ti: ffff8801d7dc8000 task.ti: ffff8801d7dc8000
[ 992.958660] RIP: 0010:[<ffffffffa003b71e>] [<ffffffffa003b71e>] ixgbe_disable_fwd_ring+0x1e/0xf0 [ixgbe]
[ 992.959613] RSP: 0018:ffff8801d7dcbbb8 EFLAGS: 00010286
[ 992.960093] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001
[ 992.960575] RDX: ffff880232eb7000 RSI: 0000000000000000 RDI: ffff88022dc05800
[ 992.961059] RBP: ffff8801d7dcbbd8 R08: 0000000000000000 R09: 0000000000000000
[ 992.961541] R10: 0000000000000001 R11: 0000000000000000 R12: ffff88022ec20980
[ 992.962023] R13: ffff880232eb7000 R14: 0000000000000001 R15: 0000000000000001
[ 992.962508] FS: 00007fab264887a0(0000) GS:ffff880237640000(0000) knlGS:0000000000000000
[ 992.963378] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 992.963858] CR2: 0000000000000056 CR3: 000000022a939000 CR4: 00000000001427e0
[ 992.964340] Stack:
[ 992.964806] ffff88022ec28840 ffff88022ec20980 ffff88022dc05800 ffff880232eb7000
[ 992.965976] ffff8801d7dcbc28 ffffffffa003bae8 ffff8801d7dcbbe8 0000000000000400
[ 992.967147] 000000000000000d ffff88022ec20980 ffff88022ec20000 ffff88022dc05800
[ 992.968319] Call Trace:
[ 992.968795] [<ffffffffa003bae8>] ixgbe_fwd_ring_up+0x88/0x280 [ixgbe]
[ 992.969284] [<ffffffffa0041d83>] ixgbe_fwd_add+0x173/0x220 [ixgbe]
[ 992.969767] [<ffffffffa015056c>] macvlan_open+0x1bc/0x230 [macvlan]
[ 992.970256] [<ffffffff816b8de7>] __dev_open+0xd7/0x150
[ 992.970735] [<ffffffff816b8bd7>] __dev_change_flags+0xa7/0x170
[ 992.971220] [<ffffffff816b8ccb>] dev_change_flags+0x2b/0x70
[ 992.971703] [<ffffffff817471b2>] devinet_ioctl+0x602/0x6d0
[ 992.972184] [<ffffffff81748168>] inet_ioctl+0x78/0x90
[ 992.972666] [<ffffffff816a143b>] sock_do_ioctl+0x2b/0x70
[ 992.973146] [<ffffffff816a14ed>] sock_ioctl+0x6d/0x260
[ 992.973627] [<ffffffff811ad3b4>] do_vfs_ioctl+0x84/0x540
[ 992.974109] [<ffffffff811a4c81>] ? final_putname+0x21/0x50
[ 992.974593] [<ffffffff818725d5>] ? sysret_check+0x22/0x5d
[ 992.975073] [<ffffffff811ad901>] SyS_ioctl+0x91/0xa0
[ 992.975550] [<ffffffff818725a9>] system_call_fastpath+0x16/0x1b
[ 992.976026] Code: ff 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 48 83 ec 20 48 89 5d e8 4c 89 65 f0 48 89 f3 4c 89 6d f8 4c 8b a7 08 02 00 00 <44> 0f b6 6e 56 44 03 af 14 02 00 00 4c 89 e7 e8 5e f2 ff ff be
[ 992.982261] RIP [<ffffffffa003b71e>] ixgbe_disable_fwd_ring+0x1e/0xf0 [ixgbe]
[ 992.983212] RSP <ffff8801d7dcbbb8>
[ 992.983681] CR2: 0000000000000056
[ 992.984248] ---[ end trace 9f54802b5cc3638b ]---
Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 ++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 14 ++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index bc3eff7..5a3efd9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7840,9 +7840,17 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
{
struct ixgbe_fwd_adapter *fwd_adapter = NULL;
struct ixgbe_adapter *adapter = netdev_priv(pdev);
+ int used_pools = adapter->num_vfs + adapter->num_rx_pools;
unsigned int limit;
int pool, err;
+ /* Hardware has a limited number of available pools. Each VF, and the
+ * PF require a pool. Check to ensure we don't attempt to use more
+ * then the available number of pools.
+ */
+ if (used_pools >= IXGBE_MAX_VF_FUNCTIONS)
+ return ERR_PTR(-EINVAL);
+
#ifdef CONFIG_RPS
if (vdev->num_rx_queues != vdev->num_tx_queues) {
netdev_info(pdev, "%s: Only supports a single queue count for TX and RX\n",
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index c14d4d8..706fc69 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -250,13 +250,15 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)
if (err)
return err;
- /* While the SR-IOV capability structure reports total VFs to be
- * 64 we limit the actual number that can be allocated to 63 so
- * that some transmit/receive resources can be reserved to the
- * PF. The PCI bus driver already checks for other values out of
- * range.
+ /* While the SR-IOV capability structure reports total VFs to be 64,
+ * we have to limit the actual number allocated based on two factors.
+ * First, we reserve some transmit/receive resources for the PF.
+ * Second, VMDQ also uses the same pools that SR-IOV does. We need to
+ * account for this, so that we don't accidentally allocate more VFs
+ * than we have available pools. The PCI bus driver already checks for
+ * other values out of range.
*/
- if (num_vfs > IXGBE_MAX_VFS_DRV_LIMIT)
+ if ((num_vfs + adapter->num_rx_pools) > IXGBE_MAX_VF_FUNCTIONS)
return -EPERM;
adapter->num_vfs = num_vfs;
--
1.9.3
^ permalink raw reply related
* Re: [PATCH net-next v2] lib/rhashtable: allow users to set the minimum shifts of shrinking
From: Thomas Graf @ 2014-08-29 9:31 UTC (permalink / raw)
To: Ying Xue; +Cc: davem, eric.dumazet, netdev
In-Reply-To: <1409190324-27828-1-git-send-email-ying.xue@windriver.com>
On 08/28/14 at 09:45am, Ying Xue wrote:
> Now the resizeable hash table size is allowed to shrink a too smaller
> size - HASH_MIN_SIZE(4) although users initially specify a rather big
> size when table is created. Especially when the number of objects
> saved in the table keeps a small value in comparison with the initial
> setting of table size during a quite long time, lots of actions of
> expanding and shrinking are involved with objects being inserted or
Can you work on this part of the commit message a bit? I know what
you want to say but it's not very clear from the text.
> removed from table. However, as synchronize_rcu() has to be called
> during expanding and shrinking, these unnecessary actions would
> seriously hit users' performance.
>
> Therefore, we should permit users to set the minimum table size
> through configuring the minimum of number of shifts when table is
> created according to users specific requirement.
>
> diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> index a2c7881..85a4ac2 100644
> --- a/lib/rhashtable.c
> +++ b/lib/rhashtable.c
> @@ -566,8 +568,13 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
> (!params->key_len && !params->obj_hashfn))
> return -EINVAL;
>
> + if (params->min_shift)
> + params->min_shift = max(params->min_shift, min_shift);
> + else
> + params->min_shift = min_shift;
> +
You can simplify all of the above to just:
params->min_shift = max(params->min_shift, ilog2(HASH_MIN_SIZE));
^ permalink raw reply
* [hyperv] BUG: unable to handle kernel paging request at ffff8801f5bc7cbb (netvsc_select_queue)
From: Sitsofe Wheeler @ 2014-08-29 9:31 UTC (permalink / raw)
To: Dexuan Cui
Cc: Greg Kroah-Hartman, Haiyang Zhang, linux-kernel@vger.kernel.org,
Daniel Borkmann, netdev, devel@linuxdriverproject.org,
David Miller
While booting a 10 vcpu system with a post v3.17-rc2 kernel with the
"Drivers: hv: vmbus: Eliminate calls to BUG_ON()", "Drivers: hv: vmbus:
Miscellaneous cleanup" patches and debugging/verification config options
on I'm seeing the following:
[ 31.570860] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[ 31.799558] systemd-journald[367]: Received request to flush runtime journal from PID 1
[ 32.679811] hv_utils: KVP: user-mode registering done.
[ 39.826001] hv_netvsc vmbus_0_15: net device safe to remove
[ 39.868109] hv_netvsc: hv_netvsc channel opened successfully
[ 41.585834] hv_netvsc vmbus_0_15: Send section size: 6144, Section count:2560
[ 41.644187] hv_netvsc vmbus_0_15: Device MAC 00:15:5d:6f:02:a5 link state up
[ 43.174058] BUG: unable to handle kernel paging request at ffff8801f5bc7cbb
[ 43.174956] IP: [<ffffffff814e701d>] netvsc_select_queue+0x3d/0x150
[ 43.174956] PGD 2db0067 PUD 207dc0067 PMD 207c12067 PTE 80000001f5bc7060
[ 43.174956] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
[ 43.174956] CPU: 7 PID: 640 Comm: arping Not tainted 3.17.0-rc2.x86_64-00096-g9c6196f #137
[ 43.174956] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012
[ 43.174956] task: ffff8800ebc56090 ti: ffff8800ecf04000 task.ti: ffff8800ecf04000
[ 43.174956] RIP: 0010:[<ffffffff814e701d>] [<ffffffff814e701d>] netvsc_select_queue+0x3d/0x150
[ 43.174956] RSP: 0018:ffff8800ecf07c60 EFLAGS: 00010206
[ 43.174956] RAX: 0000000000000000 RBX: ffff8800f13f0000 RCX: 000000000000ffff
[ 43.174956] RDX: ffff8801f5bb7cb0 RSI: ffff8800ecf47a80 RDI: ffff8800f13f0000
[ 43.174956] RBP: ffff8800ecf07c88 R08: 000000000000002a R09: 0000000000000000
[ 43.174956] R10: ffff8801f99b2290 R11: 000000000000000a R12: ffff8800ecf47a80
[ 43.174956] R13: 0000000000000000 R14: ffff8800ecfb1bd8 R15: ffff8800ecf47a80
[ 43.174956] FS: 00007f69fdf31740(0000) GS:ffff880206ce0000(0000) knlGS:0000000000000000
[ 43.174956] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 43.174956] CR2: ffff8801f5bc7cbb CR3: 00000000ecfc9000 CR4: 00000000000406e0
[ 43.174956] Stack:
[ 43.174956] ffffffff8167f651 ffff8800f13f0000 000000000000001c 0000000000000000
[ 43.174956] ffff8800ecfb1bd8 ffff8800ecf07d48 ffffffff816833bc ffff8800ebc567d0
[ 43.174956] 0000000000000000 ffff8800ecf07d68 0000000000000046 000000000000001c
[ 43.174956] Call Trace:
[ 43.174956] [<ffffffff8167f651>] ? packet_pick_tx_queue+0x31/0xa0
[ 43.174956] [<ffffffff816833bc>] packet_sendmsg+0xc1c/0xdd0
[ 43.174956] [<ffffffff810bd106>] ? lock_release_non_nested+0xc6/0x330
[ 43.174956] [<ffffffff815b4368>] sock_sendmsg+0x88/0xb0
[ 43.174956] [<ffffffff81185443>] ? might_fault+0xa3/0xb0
[ 43.174956] [<ffffffff811853fa>] ? might_fault+0x5a/0xb0
[ 43.174956] [<ffffffff815b449e>] SYSC_sendto+0x10e/0x150
[ 43.174956] [<ffffffff811853fa>] ? might_fault+0x5a/0xb0
[ 43.174956] [<ffffffff816a32d5>] ? sysret_check+0x22/0x5d
[ 43.174956] [<ffffffff810b97fd>] ? trace_hardirqs_on_caller+0x17d/0x210
[ 43.174956] [<ffffffff8139c09e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 43.174956] [<ffffffff815b547e>] SyS_sendto+0xe/0x10
[ 43.174956] [<ffffffff816a32a9>] system_call_fastpath+0x16/0x1b
[ 43.174956] Code: 00 4d 85 d2 0f 84 1c 01 00 00 44 8b 9f 8c 03 00 00 31 c0 41 83 fb 01 0f 86 1b 01 00 00 0f b7 8e b4 00 00 00 48 8b 96 c0 00 00 00 <66> 83 7c 0a 0c 08 0f 85 01 01 00 00 55 48 89 e5 41 55 41 54 53
[ 43.174956] RIP [<ffffffff814e701d>] netvsc_select_queue+0x3d/0x150
[ 43.174956] RSP <ffff8800ecf07c60>
[ 43.174956] CR2: ffff8801f5bc7cbb
[ 43.174956] ---[ end trace d476efa8244dbdc1 ]---
[ 43.174956] BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:41
[ 43.174956] in_atomic(): 0, irqs_disabled(): 1, pid: 640, name: arping
[ 43.174956] INFO: lockdep is turned off.
[ 43.174956] irq event stamp: 5710
[ 43.174956] hardirqs last enabled at (5709): [<ffffffff81698cb4>] __slab_alloc+0x50b/0x576
[ 43.174956] hardirqs last disabled at (5710): [<ffffffff816a5326>] error_sti+0x5/0x6
[ 43.174956] softirqs last enabled at (5662): [<ffffffff815cedb0>] __dev_queue_xmit+0x5b0/0x690
[ 43.174956] softirqs last disabled at (5628): [<ffffffff815ce858>] __dev_queue_xmit+0x58/0x690
[ 43.174956] CPU: 7 PID: 640 Comm: arping Tainted: G D 3.17.0-rc2.x86_64-00096-g9c6196f #137
[ 43.174956] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012
[ 43.174956] 0000000000000046 ffff8800ecf078e0 ffffffff8169a70b ffff8800ebc56090
[ 43.174956] ffff8800ecf078f8 ffffffff8109ec65 ffff8801f35eacd8 ffff8800ecf07918
[ 43.174956] ffffffff816a0d44 ffffffff81090f38 ffff8800ebc56090 ffff8800ecf07938
[ 43.174956] Call Trace:
[ 43.174956] [<ffffffff8169a70b>] dump_stack+0x4d/0x66
[ 43.174956] [<ffffffff8109ec65>] __might_sleep+0x115/0x120
[ 43.174956] [<ffffffff816a0d44>] down_read+0x24/0x70
[ 43.174956] [<ffffffff81090f38>] ? __validate_process_creds+0xd8/0xf0
[ 43.174956] [<ffffffff8107f9d4>] exit_signals+0x24/0x140
[ 43.174956] [<ffffffff810737d9>] do_exit+0x129/0xa20
[ 43.174956] [<ffffffff810c4bcc>] ? kmsg_dump+0xfc/0x110
[ 43.174956] [<ffffffff810c4af5>] ? kmsg_dump+0x25/0x110
[ 43.174956] [<ffffffff81006348>] oops_end+0xa8/0xc0
[ 43.174956] [<ffffffff81695288>] no_context+0x322/0x36b
[ 43.174956] [<ffffffff810b97fd>] ? trace_hardirqs_on_caller+0x17d/0x210
[ 43.174956] [<ffffffff8169549c>] __bad_area_nosemaphore+0x1cb/0x1e8
[ 43.174956] [<ffffffff810b97fd>] ? trace_hardirqs_on_caller+0x17d/0x210
[ 43.174956] [<ffffffff816954cc>] bad_area_nosemaphore+0x13/0x15
[ 43.174956] [<ffffffff8104040e>] __do_page_fault+0x1ee/0x4f0
[ 43.174956] [<ffffffff815bcd6e>] ? __alloc_skb+0x4e/0x240
[ 43.174956] [<ffffffff810bd106>] ? lock_release_non_nested+0xc6/0x330
[ 43.174956] [<ffffffff8139c0dd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[ 43.174956] [<ffffffff81040762>] do_page_fault+0x22/0x30
[ 43.174956] [<ffffffff816a5108>] page_fault+0x28/0x30
[ 43.174956] [<ffffffff814e701d>] ? netvsc_select_queue+0x3d/0x150
[ 43.174956] [<ffffffff8167f651>] ? packet_pick_tx_queue+0x31/0xa0
[ 43.174956] [<ffffffff816833bc>] packet_sendmsg+0xc1c/0xdd0
[ 43.174956] [<ffffffff810bd106>] ? lock_release_non_nested+0xc6/0x330
[ 43.174956] [<ffffffff815b4368>] sock_sendmsg+0x88/0xb0
[ 43.174956] [<ffffffff81185443>] ? might_fault+0xa3/0xb0
[ 43.174956] [<ffffffff811853fa>] ? might_fault+0x5a/0xb0
[ 43.174956] [<ffffffff815b449e>] SYSC_sendto+0x10e/0x150
[ 43.174956] [<ffffffff811853fa>] ? might_fault+0x5a/0xb0
[ 43.174956] [<ffffffff816a32d5>] ? sysret_check+0x22/0x5d
[ 43.174956] [<ffffffff810b97fd>] ? trace_hardirqs_on_caller+0x17d/0x210
[ 43.174956] [<ffffffff8139c09e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 43.174956] [<ffffffff815b547e>] SyS_sendto+0xe/0x10
[ 43.174956] [<ffffffff816a32a9>] system_call_fastpath+0x16/0x1b
[ 43.174956] BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:41
[ 43.174956] in_atomic(): 0, irqs_disabled(): 1, pid: 640, name: arping
[ 43.174956] INFO: lockdep is turned off.
[ 43.174956] irq event stamp: 5710
[ 43.174956] hardirqs last enabled at (5709): [<ffffffff81698cb4>] __slab_alloc+0x50b/0x576
[ 43.174956] hardirqs last disabled at (5710): [<ffffffff816a5326>] error_sti+0x5/0x6
[ 43.174956] softirqs last enabled at (5662): [<ffffffff815cedb0>] __dev_queue_xmit+0x5b0/0x690
[ 43.174956] softirqs last disabled at (5628): [<ffffffff815ce858>] __dev_queue_xmit+0x58/0x690
[ 43.174956] CPU: 7 PID: 640 Comm: arping Tainted: G D 3.17.0-rc2.x86_64-00096-g9c6196f #137
[ 43.174956] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012
[ 43.174956] ffff8800ebc56090 ffff8800ecf078d0 ffffffff8169a70b ffff8800ebc56090
[ 43.174956] ffff8800ecf078e8 ffffffff8109ec65 ffff8801f3afba18 ffff8800ecf07908
[ 43.174956] ffffffff816a0d44 ffffffff810d5cb1 ffff8801f35ea880 ffff8800ecf07938
[ 43.174956] Call Trace:
[ 43.174956] [<ffffffff8169a70b>] dump_stack+0x4d/0x66
[ 43.174956] [<ffffffff8109ec65>] __might_sleep+0x115/0x120
[ 43.174956] [<ffffffff816a0d44>] down_read+0x24/0x70
[ 43.174956] [<ffffffff810d5cb1>] ? hrtimer_try_to_cancel+0xf1/0x100
[ 43.174956] [<ffffffff810ec612>] acct_collect+0x52/0x1c0
[ 43.174956] [<ffffffff81074082>] do_exit+0x9d2/0xa20
[ 43.174956] [<ffffffff810c4bcc>] ? kmsg_dump+0xfc/0x110
[ 43.174956] [<ffffffff810c4af5>] ? kmsg_dump+0x25/0x110
[ 43.174956] [<ffffffff81006348>] oops_end+0xa8/0xc0
[ 43.174956] [<ffffffff81695288>] no_context+0x322/0x36b
[ 43.174956] [<ffffffff810b97fd>] ? trace_hardirqs_on_caller+0x17d/0x210
[ 43.174956] [<ffffffff8169549c>] __bad_area_nosemaphore+0x1cb/0x1e8
[ 43.174956] [<ffffffff810b97fd>] ? trace_hardirqs_on_caller+0x17d/0x210
[ 43.174956] [<ffffffff816954cc>] bad_area_nosemaphore+0x13/0x15
[ 43.174956] [<ffffffff8104040e>] __do_page_fault+0x1ee/0x4f0
[ 43.174956] [<ffffffff815bcd6e>] ? __alloc_skb+0x4e/0x240
[ 43.174956] [<ffffffff810bd106>] ? lock_release_non_nested+0xc6/0x330
[ 43.174956] [<ffffffff8139c0dd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[ 43.174956] [<ffffffff81040762>] do_page_fault+0x22/0x30
[ 43.174956] [<ffffffff816a5108>] page_fault+0x28/0x30
[ 43.174956] [<ffffffff814e701d>] ? netvsc_select_queue+0x3d/0x150
[ 43.174956] [<ffffffff8167f651>] ? packet_pick_tx_queue+0x31/0xa0
[ 43.174956] [<ffffffff816833bc>] packet_sendmsg+0xc1c/0xdd0
[ 43.174956] [<ffffffff810bd106>] ? lock_release_non_nested+0xc6/0x330
[ 43.174956] [<ffffffff815b4368>] sock_sendmsg+0x88/0xb0
[ 43.174956] [<ffffffff81185443>] ? might_fault+0xa3/0xb0
[ 43.174956] [<ffffffff811853fa>] ? might_fault+0x5a/0xb0
[ 48.347217] [<ffffffff815b449e>] SYSC_sendto+0x10e/0x150
[ 48.347217] [<ffffffff811853fa>] ? might_fault+0x5a/0xb0
[ 48.347217] [<ffffffff816a32d5>] ? sysret_check+0x22/0x5d
[ 48.347217] [<ffffffff810b97fd>] ? trace_hardirqs_on_caller+0x17d/0x210
[ 48.347217] [<ffffffff8139c09e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 48.347217] [<ffffffff815b547e>] SyS_sendto+0xe/0x10
[ 48.347217] [<ffffffff816a32a9>] system_call_fastpath+0x16/0x1b
[ 48.663676] BUG: unable to handle kernel paging request at ffff8800ee453a23
[ 48.708188] IP:
[ 48.708188] [<ffffffff814e701d>] netvsc_select_queue+0x3d/0x150
[ 48.708188] PGD 2db0067
[ 48.708188] PUD 2075be067
[ 48.708188] PMD 20744b067
[ 48.708188] PTE 80000000ee453060
[ 48.708188] Oops: 0000 [#2]
[ 48.708188] SMP
[ 48.708188] DEBUG_PAGEALLOC
[ 48.708188] CPU: 7 PID: 609 Comm: dhclient Tainted: G D 3.17.0-rc2.x86_64-00096-g9c6196f #137
[ 48.708188] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012
[ 48.708188] task: ffff8801f9946090 ti: ffff8800ee468000 task.ti: ffff8800ee468000
[ 48.708188] RIP: 0010:[<ffffffff814e701d>]
[ 48.708188] [<ffffffff814e701d>] netvsc_select_queue+0x3d/0x150
[ 48.708188] RSP: 0018:ffff8800ee46bcd8 EFLAGS: 00010206
[ 48.708188] RAX: 0000000000000000 RBX: ffff8800f13f0000 RCX: 000000000000ffff
[ 48.708188] RDX: ffff8800ee443a18 RSI: ffff8800ecf446c0 RDI: ffff8800f13f0000
[ 48.708188] RBP: ffff8800ee46bd00 R08: 0000000000000156 R09: 0000000000000000
[ 48.708188] R10: ffff8801f99b2290 R11: 000000000000000a R12: ffff8800ecf446c0
[ 48.708188] R13: 0000000000000000 R14: ffff8800ecfb0948 R15: ffff8800ecf446c0
[ 48.708188] FS: 00007f5b90b22880(0000) GS:ffff880206ce0000(0000) knlGS:0000000000000000
[ 48.708188] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 48.708188] CR2: ffff8800ee453a23 CR3: 00000000ec783000 CR4: 00000000000406e0
[ 48.708188] Stack:
[ 48.708188] ffffffff8167f651
[ 48.708188] ffff8800f13f0000
[ 48.708188] 0000000000000156
[ 48.708188] 0000000000000000
[ 48.708188] ffff8800ecfb0948
[ 48.708188] ffff8800ee46bdc0
[ 48.708188] ffffffff816833bc
[ 48.708188] ffffffff00000000
[ 48.708188] 00000000ffffffff
[ 48.708188] ffff8800ee46bd58
[ 48.708188] ffff8800f3354440
[ 48.708188] 0000000000000156
[ 48.708188] Call Trace:
[ 48.708188] [<ffffffff8167f651>] ? packet_pick_tx_queue+0x31/0xa0
[ 48.708188] [<ffffffff816833bc>] packet_sendmsg+0xc1c/0xdd0
[ 48.708188] [<ffffffff815b357b>] sock_aio_write+0xfb/0x120
[ 48.708188] [<ffffffff811c262a>] do_sync_write+0x5a/0x80
[ 48.708188] [<ffffffff811c2925>] vfs_write+0xe5/0x1d0
[ 48.708188] [<ffffffff811c2b09>] SyS_write+0x49/0xb0
[ 48.708188] [<ffffffff816a32a9>] system_call_fastpath+0x16/0x1b
[ 48.708188] Code: 00 4d 85 d2 0f 84 1c 01 00 00 44 8b 9f 8c 03 00 00 31 c0 41 83 fb 01 0f 86 1b 01 00 00 0f b7 8e b4 00 00 00 48 8b 96 c0 00 00 00 <66> 83 7c 0a 0c 08 0f 85 01 01 00 00 55 48 89 e5 41 55 41 54 53
[ 48.708188] RIP [<ffffffff814e701d>] netvsc_select_queue+0x3d/0x150
[ 48.708188] RSP <ffff8800ee46bcd8>
[ 48.708188] CR2: ffff8800ee453a23
[ 48.708188] ---[ end trace d476efa8244dbdc2 ]---
[ 48.708188] BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:41
[ 48.708188] in_atomic(): 0, irqs_disabled(): 1, pid: 609, name: dhclient
[ 48.708188] INFO: lockdep is turned off.
[ 48.708188] irq event stamp: 97752
[ 48.708188] hardirqs last enabled at (97751): [<ffffffff816a263d>] _raw_spin_unlock_irqrestore+0x4d/0x70
[ 48.708188] hardirqs last disabled at (97752): [<ffffffff816a251d>] _raw_spin_lock_irq+0x1d/0x60
[ 48.708188] softirqs last enabled at (97356): [<ffffffff810753f8>] __do_softirq+0x278/0x320
[ 48.708188] softirqs last disabled at (97341): [<ffffffff81075768>] irq_exit+0x58/0xc0
[ 48.708188] CPU: 7 PID: 609 Comm: dhclient Tainted: G D 3.17.0-rc2.x86_64-00096-g9c6196f #137
[ 48.708188] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012
[ 48.708188] 0000000000000046 ffff8800ee46b950 ffffffff8169a70b ffff8801f9946090
[ 48.708188] ffff8800ee46b968 ffffffff8109ec65 ffff8801f35e9898 ffff8800ee46b988
[ 48.708188] ffffffff816a0d44 ffffffff81090f38 ffff8801f9946090 ffff8800ee46b9a8
[ 48.708188] Call Trace:
[ 48.708188] [<ffffffff8169a70b>] dump_stack+0x4d/0x66
[ 48.708188] [<ffffffff8109ec65>] __might_sleep+0x115/0x120
[ 48.708188] [<ffffffff816a0d44>] down_read+0x24/0x70
[ 48.708188] [<ffffffff81090f38>] ? __validate_process_creds+0xd8/0xf0
[ 48.708188] [<ffffffff8107f9d4>] exit_signals+0x24/0x140
[ 48.708188] [<ffffffff810737d9>] do_exit+0x129/0xa20
[ 48.708188] [<ffffffff810c4bcc>] ? kmsg_dump+0xfc/0x110
[ 48.708188] [<ffffffff810c4af5>] ? kmsg_dump+0x25/0x110
[ 48.708188] [<ffffffff81006348>] oops_end+0xa8/0xc0
[ 48.708188] [<ffffffff81695288>] no_context+0x322/0x36b
[ 48.708188] [<ffffffff8169549c>] __bad_area_nosemaphore+0x1cb/0x1e8
[ 48.708188] [<ffffffff816954cc>] bad_area_nosemaphore+0x13/0x15
[ 48.708188] [<ffffffff8104040e>] __do_page_fault+0x1ee/0x4f0
[ 48.708188] [<ffffffff815bcd6e>] ? __alloc_skb+0x4e/0x240
[ 48.708188] [<ffffffff811a990e>] ? __kmalloc_node_track_caller+0x15e/0x2f0
[ 48.708188] [<ffffffff810b9b0d>] ? trace_hardirqs_off+0xd/0x10
[ 48.708188] [<ffffffff8139c0dd>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[ 48.708188] [<ffffffff81040762>] do_page_fault+0x22/0x30
[ 48.708188] [<ffffffff816a5108>] page_fault+0x28/0x30
[ 48.708188] [<ffffffff814e701d>] ? netvsc_select_queue+0x3d/0x150
[ 48.708188] [<ffffffff8167f651>] ? packet_pick_tx_queue+0x31/0xa0
[ 48.708188] [<ffffffff816833bc>] packet_sendmsg+0xc1c/0xdd0
[ 48.708188] [<ffffffff815b357b>] sock_aio_write+0xfb/0x120
[ 48.708188] [<ffffffff811c262a>] do_sync_write+0x5a/0x80
[ 48.708188] [<ffffffff811c2925>] vfs_write+0xe5/0x1d0
[ 48.708188] [<ffffffff811c2b09>] SyS_write+0x49/0xb0
[ 48.708188] [<ffffffff816a32a9>] system_call_fastpath+0x16/0x1b
In https://lkml.org/lkml/2014/8/19/133 (Re: BUG: unable to handle kernel
paging request at ffff8801f3febe63 (netvsc_select_queue)) there is the
following:
On Tue, Aug 19, 2014 at 10:57:30AM +0200, Daniel Borkmann wrote:
>
> Hmm, I am not really familiar with hyper-v, but it seems 5b54dac856cb
> ("hyperv: Add support for virtual Receive Side Scaling (vRSS)") has
> been introduced after 0fd5d57ba345 ("packet: check for
> ndo_select_queue during queue selection").
>
> arping seems to send a raw packet (AF_PACKET) via normal
> packet_sendmsg() out and when doing the queue selection in
> packet_pick_tx_queue(), we discover that the device has
> ndo_select_queue implemented, so we respect that and call into it. In
> netvsc_select_queue(), the fallback of __packet_pick_tx_queue() is not
> being invoked here.
>
> Given that the next log message is "hv_netvsc vmbus_0_15: net device
> safe to remove" ... could it be that your back pointer to the device
> context (the actual struct hv_device) is already invalid when you try
> to get hv_get_drvdata(hdev) as it's sort of decoupled from
> netdev_priv(ndev) ? (Just a wild guess ...)
So I'm guessing this is the same issue.
--
Sitsofe | http://sucs.org/~sits/
^ permalink raw reply
* Re: [PATCH ipsec-next v3 2/2] xfrm: configure policy hash table thresholds by netlink
From: Steffen Klassert @ 2014-08-29 9:54 UTC (permalink / raw)
To: Christophe Gouault; +Cc: David S. Miller, netdev
In-Reply-To: <1409154495-1343-3-git-send-email-christophe.gouault@6wind.com>
On Wed, Aug 27, 2014 at 05:48:15PM +0200, Christophe Gouault wrote:
>
> +static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
> + struct nlattr **attrs)
> +{
> + struct net *net = sock_net(skb->sk);
> + u32 *flags = nlmsg_data(nlh);
> + u32 sportid = NETLINK_CB(skb).portid;
> + u32 seq = nlh->nlmsg_seq;
flags, sportid and seq are unused now. Please remove them.
^ permalink raw reply
* Re: [PATCH ipsec-next v3 2/2] xfrm: configure policy hash table thresholds by netlink
From: Christophe Gouault @ 2014-08-29 10:02 UTC (permalink / raw)
To: Steffen Klassert; +Cc: David S. Miller, netdev@vger.kernel.org
In-Reply-To: <20140829095431.GF6390@secunet.com>
2014-08-29 11:54 GMT+02:00 Steffen Klassert <steffen.klassert@secunet.com>:
> On Wed, Aug 27, 2014 at 05:48:15PM +0200, Christophe Gouault wrote:
>>
>> +static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
>> + struct nlattr **attrs)
>> +{
>> + struct net *net = sock_net(skb->sk);
>> + u32 *flags = nlmsg_data(nlh);
>> + u32 sportid = NETLINK_CB(skb).portid;
>> + u32 seq = nlh->nlmsg_seq;
>
> flags, sportid and seq are unused now. Please remove them.
OK, I'll send an update.
Christophe.
^ permalink raw reply
* Re: [PATCH net-next v2] lib/rhashtable: allow users to set the minimum shifts of shrinking
From: Ying Xue @ 2014-08-29 10:08 UTC (permalink / raw)
To: Thomas Graf; +Cc: davem, eric.dumazet, netdev
In-Reply-To: <20140829093107.GA3563@casper.infradead.org>
On 08/29/2014 05:31 PM, Thomas Graf wrote:
> On 08/28/14 at 09:45am, Ying Xue wrote:
>> Now the resizeable hash table size is allowed to shrink a too smaller
>> size - HASH_MIN_SIZE(4) although users initially specify a rather big
>> size when table is created. Especially when the number of objects
>> saved in the table keeps a small value in comparison with the initial
>> setting of table size during a quite long time, lots of actions of
>> expanding and shrinking are involved with objects being inserted or
>
> Can you work on this part of the commit message a bit? I know what
> you want to say but it's not very clear from the text.
>
OK. I will revise it.
>> removed from table. However, as synchronize_rcu() has to be called
>> during expanding and shrinking, these unnecessary actions would
>> seriously hit users' performance.
>>
>> Therefore, we should permit users to set the minimum table size
>> through configuring the minimum of number of shifts when table is
>> created according to users specific requirement.
>>
>> diff --git a/lib/rhashtable.c b/lib/rhashtable.c
>> index a2c7881..85a4ac2 100644
>> --- a/lib/rhashtable.c
>> +++ b/lib/rhashtable.c
>> @@ -566,8 +568,13 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
>> (!params->key_len && !params->obj_hashfn))
>> return -EINVAL;
>>
>> + if (params->min_shift)
>> + params->min_shift = max(params->min_shift, min_shift);
>> + else
>> + params->min_shift = min_shift;
>> +
>
> You can simplify all of the above to just:
>
> params->min_shift = max(params->min_shift, ilog2(HASH_MIN_SIZE));
>
>
Oops! when I created the code, I wrongly deemed params->min_shift as a
pointer so that the code became so complex. Thanks, I will change it
with your good advice.
Regards,
Ying
^ permalink raw reply
* Re: [PATCH net-next] bonding: add slave_changelink support and use it for queue_id
From: Nikolay Aleksandrov @ 2014-08-29 11:27 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Jay Vosburgh, Veaceslav Falico, Andy Gospodarek
In-Reply-To: <1409148406-5576-1-git-send-email-nikolay@redhat.com>
On 08/27/2014 04:06 PM, Nikolay Aleksandrov wrote:
> This patch adds support for slave_changelink to the bonding and uses it
> to give the ability to change the queue_id of the enslaved devices via
> netlink. It sets slave_maxtype and uses bond_changelink as a prototype for
> bond_slave_changelink.
> Example/test command after the iproute2 patch:
> ip link set eth0 type bond_slave queue_id 10
>
> CC: David S. Miller <davem@davemloft.net>
> CC: Jay Vosburgh <j.vosburgh@gmail.com>
> CC: Veaceslav Falico <vfalico@gmail.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
>
> Suggested-by: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
> ---
Hi Dave,
Would you mind telling me why did this patch get rejected so I can fix it up ?
I didn't see any complains and Jiri acked it.
Thanks,
Nik
^ permalink raw reply
* Re: [PATCH net-next] tcp: whitespace fixes
From: Jeff Kirsher @ 2014-08-29 12:27 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev
In-Reply-To: <20140829000646.0647e9c5@urahara>
On Fri, Aug 29, 2014 at 12:06 AM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> Fix places where there is space before tab, long lines, and
> awkward if(){.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
>
> --- a/net/ipv4/tcp_bic.c 2014-05-05 23:44:19.000000000 -0700
> +++ b/net/ipv4/tcp_bic.c 2014-08-22 17:17:51.448069718 -0700
> @@ -50,7 +50,7 @@ MODULE_PARM_DESC(smooth_part, "log(B/(B*
> /* BIC TCP Parameters */
> struct bictcp {
> u32 cnt; /* increase cwnd by 1 after ACKs */
> - u32 last_max_cwnd; /* last maximum snd_cwnd */
> + u32 last_max_cwnd; /* last maximum snd_cwnd */
> u32 loss_cwnd; /* congestion window at last loss */
> u32 last_cwnd; /* the last snd_cwnd */
> u32 last_time; /* time when updated last_cwnd */
> @@ -103,7 +103,7 @@ static inline void bictcp_update(struct
>
> /* binary increase */
> if (cwnd < ca->last_max_cwnd) {
> - __u32 dist = (ca->last_max_cwnd - cwnd)
> + __u32 dist = (ca->last_max_cwnd - cwnd)
> / BICTCP_B;
>
> if (dist > max_increment)
> --- a/net/ipv4/tcp_cubic.c 2014-06-16 14:48:29.000000000 -0700
> +++ b/net/ipv4/tcp_cubic.c 2014-08-22 17:20:10.368073438 -0700
> @@ -82,7 +82,7 @@ MODULE_PARM_DESC(hystart_ack_delta, "spa
> /* BIC TCP Parameters */
> struct bictcp {
> u32 cnt; /* increase cwnd by 1 after ACKs */
> - u32 last_max_cwnd; /* last maximum snd_cwnd */
> + u32 last_max_cwnd; /* last maximum snd_cwnd */
> u32 loss_cwnd; /* congestion window at last loss */
> u32 last_cwnd; /* the last snd_cwnd */
> u32 last_time; /* time when updated last_cwnd */
> @@ -263,9 +263,9 @@ static inline void bictcp_update(struct
>
> /* c/rtt * (t-K)^3 */
> delta = (cube_rtt_scale * offs * offs * offs) >> (10+3*BICTCP_HZ);
> - if (t < ca->bic_K) /* below origin*/
> + if (t < ca->bic_K) /* below origin*/
> bic_target = ca->bic_origin_point - delta;
> - else /* above origin*/
> + else /* above origin*/
> bic_target = ca->bic_origin_point + delta;
>
> /* cubic function - calc bictcp_cnt*/
> @@ -291,7 +291,7 @@ static inline void bictcp_update(struct
> ca->tcp_cwnd++;
> }
>
> - if (ca->tcp_cwnd > cwnd){ /* if bic is slower than tcp */
> + if (ca->tcp_cwnd > cwnd) { /* if bic is slower than tcp */
> delta = ca->tcp_cwnd - cwnd;
> max_cnt = cwnd / delta;
> if (ca->cnt > max_cnt)
> @@ -452,7 +452,7 @@ static int __init cubictcp_register(void
> * based on SRTT of 100ms
> */
>
> - beta_scale = 8*(BICTCP_BETA_SCALE+beta)/ 3 / (BICTCP_BETA_SCALE - beta);
> + beta_scale = 8*(BICTCP_BETA_SCALE+beta) / 3 / (BICTCP_BETA_SCALE - beta);
Since you are fixing up the line, shouldn't it be:
beta_scale = 8 * (BICTCP_BETA_SCALE + beta) / 3 /
(BICTCP_BETA_SCALE - beta);
>
> cube_rtt_scale = (bic_scale * 10); /* 1024*c/rtt */
>
> --- a/net/ipv4/tcp_yeah.c 2014-05-05 23:44:19.000000000 -0700
> +++ b/net/ipv4/tcp_yeah.c 2014-08-22 17:15:47.788066407 -0700
> @@ -84,7 +84,7 @@ static void tcp_yeah_cong_avoid(struct s
> /* Scalable */
>
> tp->snd_cwnd_cnt += yeah->pkts_acked;
> - if (tp->snd_cwnd_cnt > min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT)){
> + if (tp->snd_cwnd_cnt > min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT)) {
> if (tp->snd_cwnd < tp->snd_cwnd_clamp)
> tp->snd_cwnd++;
> tp->snd_cwnd_cnt = 0;
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Cheers,
Jeff
^ 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