* [net-next PATCH 5/5] bnx2x: use native EEE instead of auto-greeen
From: Yuval Mintz @ 2012-09-10 15:51 UTC (permalink / raw)
To: davem, netdev; +Cc: eilong, Yuval Mintz
In-Reply-To: <1347292268-30348-1-git-send-email-yuvalmin@broadcom.com>
This patch enables boards with 54618SE phys and a sufficiently new
firmware to use native EEE instead of auto-greeen.
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 105 +++++++++++++---------
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 1 +
drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 13 ++-
3 files changed, 73 insertions(+), 46 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 839ddd2..c660afd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -1584,6 +1584,16 @@ static void bnx2x_umac_enable(struct link_params *params,
REG_WR(bp, umac_base + UMAC_REG_COMMAND_CONFIG, val);
udelay(50);
+ /* Configure UMAC for EEE */
+ if (vars->eee_status & SHMEM_EEE_ADV_STATUS_MASK) {
+ DP(NETIF_MSG_LINK, "configured UMAC for EEE\n");
+ REG_WR(bp, umac_base + UMAC_REG_UMAC_EEE_CTRL,
+ UMAC_UMAC_EEE_CTRL_REG_EEE_EN);
+ REG_WR(bp, umac_base + UMAC_REG_EEE_WAKE_TIMER, 0x11);
+ } else {
+ REG_WR(bp, umac_base + UMAC_REG_UMAC_EEE_CTRL, 0x0);
+ }
+
/* Set MAC address for source TX Pause/PFC frames (under SW reset) */
REG_WR(bp, umac_base + UMAC_REG_MAC_ADDR0,
((params->mac_addr[2] << 24) |
@@ -4263,6 +4273,8 @@ static void bnx2x_warpcore_set_sgmii_speed(struct bnx2x_phy *phy,
bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
MDIO_WC_REG_RX66_CONTROL, val16 & ~(3<<13));
+ bnx2x_warpcore_set_lpi_passthrough(phy, params);
+
if (always_autoneg || phy->req_line_speed == SPEED_AUTO_NEG) {
/* SGMII Autoneg */
bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
@@ -10792,28 +10804,52 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
DP(NETIF_MSG_LINK, "Setting 10M force\n");
}
- /* Check if we should turn on Auto-GrEEEn */
- bnx2x_cl22_read(bp, phy, MDIO_REG_GPHY_PHYID_LSB, &temp);
- if (temp == MDIO_REG_GPHY_ID_54618SE) {
- if (params->feature_config_flags &
- FEATURE_CONFIG_AUTOGREEEN_ENABLED) {
- temp = 6;
- DP(NETIF_MSG_LINK, "Enabling Auto-GrEEEn\n");
+ if ((phy->flags & FLAGS_EEE) && bnx2x_eee_has_cap(params)) {
+ int rc;
+
+ bnx2x_cl22_write(bp, phy, MDIO_REG_GPHY_EXP_ACCESS,
+ MDIO_REG_GPHY_EXP_ACCESS_TOP |
+ MDIO_REG_GPHY_EXP_TOP_2K_BUF);
+ bnx2x_cl22_read(bp, phy, MDIO_REG_GPHY_EXP_ACCESS_GATE, &temp);
+ temp &= 0xfffe;
+ bnx2x_cl22_write(bp, phy, MDIO_REG_GPHY_EXP_ACCESS_GATE, temp);
+
+ rc = bnx2x_eee_initial_config(params, vars, SHMEM_EEE_1G_ADV);
+ if (rc) {
+ DP(NETIF_MSG_LINK, "Failed to configure EEE timers\n");
+ bnx2x_eee_disable(phy, params, vars);
+ } else if ((params->eee_mode & EEE_MODE_ADV_LPI) &&
+ (phy->req_duplex == DUPLEX_FULL) &&
+ (bnx2x_eee_calc_timer(params) ||
+ !(params->eee_mode & EEE_MODE_ENABLE_LPI))) {
+ /* Need to advertise EEE only when requested,
+ * and either no LPI assertion was requested,
+ * or it was requested and a valid timer was set.
+ * Also notice full duplex is required for EEE.
+ */
+ bnx2x_eee_advertise(phy, params, vars,
+ SHMEM_EEE_1G_ADV);
} else {
- temp = 0;
- DP(NETIF_MSG_LINK, "Disabling Auto-GrEEEn\n");
+ DP(NETIF_MSG_LINK, "Don't Advertise 1GBase-T EEE\n");
+ bnx2x_eee_disable(phy, params, vars);
+ }
+ } else {
+ vars->eee_status &= ~SHMEM_EEE_1G_ADV <<
+ SHMEM_EEE_SUPPORTED_SHIFT;
+
+ if (phy->flags & FLAGS_EEE) {
+ /* Handle legacy auto-grEEEn */
+ if (params->feature_config_flags &
+ FEATURE_CONFIG_AUTOGREEEN_ENABLED) {
+ temp = 6;
+ DP(NETIF_MSG_LINK, "Enabling Auto-GrEEEn\n");
+ } else {
+ temp = 0;
+ DP(NETIF_MSG_LINK, "Don't Adv. EEE\n");
+ }
+ bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
+ MDIO_AN_REG_EEE_ADV, temp);
}
- bnx2x_cl22_write(bp, phy,
- MDIO_REG_GPHY_CL45_ADDR_REG, MDIO_AN_DEVAD);
- bnx2x_cl22_write(bp, phy,
- MDIO_REG_GPHY_CL45_DATA_REG,
- MDIO_REG_GPHY_EEE_ADV);
- bnx2x_cl22_write(bp, phy,
- MDIO_REG_GPHY_CL45_ADDR_REG,
- (0x1 << 14) | MDIO_AN_DEVAD);
- bnx2x_cl22_write(bp, phy,
- MDIO_REG_GPHY_CL45_DATA_REG,
- temp);
}
bnx2x_cl22_write(bp, phy,
@@ -10960,29 +10996,6 @@ static u8 bnx2x_54618se_read_status(struct bnx2x_phy *phy,
DP(NETIF_MSG_LINK, "BCM54618SE: link speed is %d\n",
vars->line_speed);
- /* Report whether EEE is resolved. */
- bnx2x_cl22_read(bp, phy, MDIO_REG_GPHY_PHYID_LSB, &val);
- if (val == MDIO_REG_GPHY_ID_54618SE) {
- if (vars->link_status &
- LINK_STATUS_AUTO_NEGOTIATE_COMPLETE)
- val = 0;
- else {
- bnx2x_cl22_write(bp, phy,
- MDIO_REG_GPHY_CL45_ADDR_REG,
- MDIO_AN_DEVAD);
- bnx2x_cl22_write(bp, phy,
- MDIO_REG_GPHY_CL45_DATA_REG,
- MDIO_REG_GPHY_EEE_RESOLVED);
- bnx2x_cl22_write(bp, phy,
- MDIO_REG_GPHY_CL45_ADDR_REG,
- (0x1 << 14) | MDIO_AN_DEVAD);
- bnx2x_cl22_read(bp, phy,
- MDIO_REG_GPHY_CL45_DATA_REG,
- &val);
- }
- DP(NETIF_MSG_LINK, "EEE resolution: 0x%x\n", val);
- }
-
bnx2x_ext_phy_resolve_fc(phy, params, vars);
if (vars->link_status & LINK_STATUS_AUTO_NEGOTIATE_COMPLETE) {
@@ -11012,6 +11025,10 @@ static u8 bnx2x_54618se_read_status(struct bnx2x_phy *phy,
if (val & (1<<11))
vars->link_status |=
LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE;
+
+ if ((phy->flags & FLAGS_EEE) &&
+ bnx2x_eee_has_cap(params))
+ bnx2x_eee_an_resolve(phy, params, vars);
}
}
return link_up;
@@ -11925,6 +11942,8 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp,
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616:
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE:
*phy = phy_54618se;
+ if (phy_type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE)
+ phy->flags |= FLAGS_EEE;
break;
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101:
*phy = phy_7101;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
index 3967aa8..360ecf9 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
@@ -155,6 +155,7 @@ struct bnx2x_phy {
#define FLAGS_DUMMY_READ (1<<9)
#define FLAGS_MDC_MDIO_WA_B0 (1<<10)
#define FLAGS_TX_ERROR_CHECK (1<<12)
+#define FLAGS_EEE (1<<13)
/* preemphasis values for the rx side */
u16 rx_preemphasis[4];
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
index d32293f..1b1999d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
@@ -4949,6 +4949,10 @@
#define UMAC_COMMAND_CONFIG_REG_SW_RESET (0x1<<13)
#define UMAC_COMMAND_CONFIG_REG_TX_ENA (0x1<<0)
#define UMAC_REG_COMMAND_CONFIG 0x8
+/* [RW 16] This is the duration for which MAC must wait to go back to ACTIVE
+ * state from LPI state when it receives packet for transmission. The
+ * decrement unit is 1 micro-second. */
+#define UMAC_REG_EEE_WAKE_TIMER 0x6c
/* [RW 32] Register Bit 0 refers to Bit 16 of the MAC address; Bit 1 refers
* to bit 17 of the MAC address etc. */
#define UMAC_REG_MAC_ADDR0 0xc
@@ -4958,6 +4962,8 @@
/* [RW 14] Defines a 14-Bit maximum frame length used by the MAC receive
* logic to check frames. */
#define UMAC_REG_MAXFR 0x14
+#define UMAC_REG_UMAC_EEE_CTRL 0x64
+#define UMAC_UMAC_EEE_CTRL_REG_EEE_EN (0x1<<3)
/* [RW 8] The event id for aggregated interrupt 0 */
#define USDM_REG_AGG_INT_EVENT_0 0xc4038
#define USDM_REG_AGG_INT_EVENT_1 0xc403c
@@ -7161,10 +7167,11 @@ Theotherbitsarereservedandshouldbezero*/
#define MDIO_REG_GPHY_ID_54618SE 0x5cd5
#define MDIO_REG_GPHY_CL45_ADDR_REG 0xd
#define MDIO_REG_GPHY_CL45_DATA_REG 0xe
-#define MDIO_REG_GPHY_EEE_ADV 0x3c
-#define MDIO_REG_GPHY_EEE_1G (0x1 << 2)
-#define MDIO_REG_GPHY_EEE_100 (0x1 << 1)
#define MDIO_REG_GPHY_EEE_RESOLVED 0x803e
+#define MDIO_REG_GPHY_EXP_ACCESS_GATE 0x15
+#define MDIO_REG_GPHY_EXP_ACCESS 0x17
+#define MDIO_REG_GPHY_EXP_ACCESS_TOP 0xd00
+#define MDIO_REG_GPHY_EXP_TOP_2K_BUF 0x40
#define MDIO_REG_GPHY_AUX_STATUS 0x19
#define MDIO_REG_INTR_STATUS 0x1a
#define MDIO_REG_INTR_MASK 0x1b
--
1.7.9.rc2
^ permalink raw reply related
* Re: [PATCH v2] iproute2: tc.8: update UNITS section.
From: Stephen Hemminger @ 2012-09-10 16:35 UTC (permalink / raw)
To: Li Wei; +Cc: netdev
In-Reply-To: <504D4252.4030104@cn.fujitsu.com>
On Mon, 10 Sep 2012 09:28:50 +0800
Li Wei <lw@cn.fujitsu.com> wrote:
> On 08/30/2012 02:19 AM, Stephen Hemminger wrote:
> > On Wed, 29 Aug 2012 14:41:56 +0800
> > Li Wei <lw@cn.fujitsu.com> wrote:
> >
> >> - rename section UNITS to PARAMETERS.
> >> - break section PARAMETERS down to four subsections to cover the
> >> common used parameter types(RATES, TIMES, SIZES, VALUES).
> >> - add some explaination for IEC units in RATES.
> >> - point out the max value we can set for RATES, TIMES and SIZES.
> >>
> >> Signed-off-by: Li Wei <lw@cn.fujitsu.com>
> >
> > Plan to merge this when I get back next week.
>
> ping ...
>
> >
> >
Pushed it out this morning.
^ permalink raw reply
* Re: [net-next.git 5/8] stmmac: get/set coalesce parameters via ethtool
From: Ben Hutchings @ 2012-09-10 16:45 UTC (permalink / raw)
To: Giuseppe CAVALLARO; +Cc: netdev, davem
In-Reply-To: <1347262689-21251-6-git-send-email-peppe.cavallaro@st.com>
On Mon, 2012-09-10 at 09:38 +0200, Giuseppe CAVALLARO wrote:
> This patch is to get/set the tx/rx coalesce parameters
> via ethtool interface.
>
> Tests have been done on several platform with
> different GMAC chips w/o w/ RX watchdog feature.
[...]
> +static int stmmac_set_coalesce(struct net_device *dev,
> + struct ethtool_coalesce *ec)
> +{
> + struct stmmac_priv *priv = netdev_priv(dev);
> + unsigned int rx_riwt;
> +
> + /* No rx interrupts will be generated if both are zero */
> + if (ec->rx_coalesce_usecs == 0)
> + return -EINVAL;
> +
> + /* No tx interrupts will be generated if both are zero */
> + if ((ec->tx_coalesce_usecs == 0) &&
> + (ec->tx_max_coalesced_frames == 0))
> + return -EINVAL;
> +
> + if ((ec->tx_coalesce_usecs > STMMAC_COAL_TX_TIMER) ||
> + (ec->tx_max_coalesced_frames > STMMAC_TX_MAX_FRAMES))
> + return -EINVAL;
[...]
You should also check that the settings you don't support
(rx_max_coalesced_frames, use_adaptive_rx_coalesce,
use_adaptive_tx_coalesce, *_irq) are equal to 0. (This isn't done
consistently in all drivers - but I believe best practice is to reject
rather than quietly ignoring settings you don't support.)
I don't have time to review the other changes properly, but at a quick
look they seem to be OK.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
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 06/12] qlcnic: 83xx data path and HW interfaces routines
From: Ben Hutchings @ 2012-09-10 16:54 UTC (permalink / raw)
To: Sony Chacko; +Cc: davem, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1347058893-30165-7-git-send-email-sony.chacko@qlogic.com>
On Fri, 2012-09-07 at 19:01 -0400, Sony Chacko wrote:
> From: Sony Chacko <sony.chacko@qlogic.com>
>
> Modify 82xx driver to support new adapter - Qlogic 83XX CNA
> Create 83xx adapter data path and hardware interface routines
[...]
> +int qlcnic_83xx_set_pauseparam(struct qlcnic_adapter *adapter,
> + struct ethtool_pauseparam *pause)
> +{
> + int status = 0;
> + u32 config = adapter->ahw->port_config;
> +
> + if ((pause->rx_pause) || (pause->tx_pause) || (pause->autoneg))
> + adapter->ahw->port_config |= QLC_83XX_CFG_PAUSE_STD;
> + else if (!(pause->rx_pause && pause->tx_pause && pause->autoneg))
Since you appear to support only all-enabled or all-disabled, this
second condition should be:
!pause->rx_pause && !pause->tx_pause && !pause->autoneg
> + adapter->ahw->port_config &= ~QLC_83XX_CFG_PAUSE_STD;
> + else
> + return -EINVAL;
[...]
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> @@ -35,28 +35,31 @@ char qlcnic_driver_name[] = "qlcnic";
[...]
> -static int use_msi = 1;
> +int use_msi = 1;
> module_param(use_msi, int, 0444);
> MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled");
>
> -static int use_msi_x = 1;
> +int use_msi_x = 1;
> module_param(use_msi_x, int, 0444);
> MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled");
>
> -static int auto_fw_reset = 1;
> +int auto_fw_reset = 1;
> module_param(auto_fw_reset, int, 0644);
> MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled");
>
> -static int load_fw_file;
> +int load_fw_file;
> module_param(load_fw_file, int, 0444);
> MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file");
[...]
All the variables being declared extern need to be renamed to have a
'qlcnic_' prefix. (The parameters shouldn't be renamed, though - use
module_param_named().)
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
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 1/2] iproute2: add libgenl files
From: Stephen Hemminger @ 2012-09-10 16:55 UTC (permalink / raw)
To: Julian Anastasov; +Cc: netdev
In-Reply-To: <1347097705-2906-2-git-send-email-ja@ssi.bg>
On Sat, 8 Sep 2012 12:48:24 +0300
Julian Anastasov <ja@ssi.bg> wrote:
> +
> +#define GENL_INIT_REQUEST(req, family, hdrsize, ver, cmd_, flags) \
> + do { \
> + memset(&req, 0, sizeof(req)); \
> + req.n.nlmsg_type = family; \
> + req.n.nlmsg_flags = flags; \
> + req.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN + hdrsize); \
> + req.g.cmd = cmd_; \
> + req.g.version = ver; \
> + } while (0)
> +
Why not an inline function, macro code is error prone.
^ permalink raw reply
* Re: [PATCH 1/2] iproute2: add libgenl files
From: Stephen Hemminger @ 2012-09-10 16:56 UTC (permalink / raw)
To: Julian Anastasov; +Cc: netdev
In-Reply-To: <1347097705-2906-2-git-send-email-ja@ssi.bg>
On Sat, 8 Sep 2012 12:48:24 +0300
Julian Anastasov <ja@ssi.bg> wrote:
> +static int libgenl_parse_getfamily(struct nlmsghdr *nlh)
I prefer just using 'genl' rather than 'libgenl' here. Shorter variable
names are clearer.
^ permalink raw reply
* [PATCH 1/1] [PATCH] net: qmi_wwan: fix Gobi device probing for un2430
From: pierre.sauter @ 2012-09-10 17:02 UTC (permalink / raw)
To: gregkh; +Cc: netdev, Pierre Sauter
From: Pierre Sauter <pierre.sauter@gmail.com>
HP un2430 is a Gobi 3000 device. It was mistakenly treated as Gobi 1000
in patch b9f90eb2740203ff2592efe640409ad48335d1c2.
I own this device and qmi_wwan works again with this fix.
Signed-off-by: Pierre Sauter <pierre.sauter@gmail.com>
---
drivers/net/usb/qmi_wwan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index adfab3f..17b8f3e 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -398,7 +398,6 @@ static const struct usb_device_id products[] = {
/* 4. Gobi 1000 devices */
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
{QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
- {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
{QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
{QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
{QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */
@@ -440,6 +439,7 @@ static const struct usb_device_id products[] = {
{QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
{QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
{QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
+ {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
{QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
{QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
{QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH net] ixp4xx_hss: fix build failure after logging conversion
From: Ben Hutchings @ 2012-09-10 17:04 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, khc, joe, David Miller, stable
In-Reply-To: <1347266590-884-1-git-send-email-florian@openwrt.org>
On Mon, 2012-09-10 at 10:43 +0200, Florian Fainelli wrote:
> Commit c75bb2c6f0cf455c23e60f14d780e841dd47f801 (ixp4xx_hss: Update to
> current logging forms) converted the ixp4xx_hss module to use the current
> logging macros, but forgot to include linux/module.h, leading to the
> following build failures:
>
> CC [M] drivers/net/wan/ixp4xx_hss.o
> drivers/net/wan/ixp4xx_hss.c:1412:20: error: expected ';', ',' or ')'
> before string constant
> drivers/net/wan/ixp4xx_hss.c:1413:25: error: expected ';', ',' or ')'
> before string constant
> drivers/net/wan/ixp4xx_hss.c:1414:21: error: expected ';', ',' or ')'
> before string constant
> drivers/net/wan/ixp4xx_hss.c:1415:19: error: expected ';', ',' or ')'
> before string constant
> make[8]: *** [drivers/net/wan/ixp4xx_hss.o] Error 1
>
> CC: stable@vger.kernel.org
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> [stable: 3.1+]
The versions to receive stable updates should be noted on the inline Cc
line, not in non-committed comments. (But David prefers to collect up
networking patches in his own stable queue rather than using the inline
Cc mechanism. So the Cc may not be appropriate at all.)
Ben.
> drivers/net/wan/ixp4xx_hss.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
> index aaaca9a..3f575af 100644
> --- a/drivers/net/wan/ixp4xx_hss.c
> +++ b/drivers/net/wan/ixp4xx_hss.c
> @@ -10,6 +10,7 @@
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> +#include <linux/module.h>
> #include <linux/bitops.h>
> #include <linux/cdev.h>
> #include <linux/dma-mapping.h>
--
Ben Hutchings, Staff Engineer, Solarflare
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: changing usbnet's API to better deal with cdc-ncm
From: Alexey ORISHKO @ 2012-09-10 17:10 UTC (permalink / raw)
To: Oliver Neukum
Cc: Bjørn Mork, Ming Lei,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1609320.M17H7UceTZ-ugxBuEnWX9yG/4A2pS7c2Q@public.gmane.org>
> -----Original Message-----
> From: Oliver Neukum [mailto:oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org]
> Sent: Friday, September 07, 2012 8:23 PM
>
> > There is a temptation to send full NTBs even with a single IP packet,
> > But it will lead to wasted USB bandwidth and reduced ability to send
> > real data for other functions in the device or other devices on the
> > same root hub. Most important it will also harm IN direction.
>
> Well, we will eventually need to do so. In that case, shall we send a
> short package or not?
The trick is to find a compromise for device load vs wasted bandwidth.
Currently if data size is less than 512 bytes, a shot packet will be sent.
However, this value might be better tuned based on bus speed (HS/SS)
and max NTB size negotiated.
Note, that ZLP was avoided in the ncm driver by using flag in usbnet,
because on some embedded USB controllers handling ZLP was more costly
than short packet.
> Well, we know how many packages are available to the device because
> they have already been scheduled. It seems to be clear that we need to
> batch while enough are on the way.
It doesn't matter much that some packets on the way to device. What
matters is the amount of packets in the application Tx queue for
ncm network device.
> > But an optimal implementation requires that the amount of IP packets
> > "in progress" or queued up is known to NCM so NCM can decide to send
> > short or padded NTB or aggregate and send one or more full NTBs plus
> > short or padded NTB.
>
> What exactly means "in progress"?
Sent by application to the network device.
>
> > An implementation where NCM only knows if there is more data
> available
> > or not can be shown to have side-effects that are not easily
> circumvented.
> > And likewise shown to limit throughput compared to a timer-based
> solution.
>
> Well, I must say that the timer is ugly. If absolutely necessary we can
> keep it, but then I'd much prefer to put it into usbnet and have a
> generic batching functionality. However, I'd like to explore
> aternatives.
Is it possible to implement upper layer Tx queue in usbnet, so mini driver
could get a clue about outstanding packets to be transmitted?
Regards,
Alexey
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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
* Re: [PATCH net-next v2] Take care of xfrm policy when checking dst entries
From: David Miller @ 2012-09-10 17:18 UTC (permalink / raw)
To: vyasevich; +Cc: nicolas.dichtel, eric.dumazet, sri, linux-sctp, netdev
In-Reply-To: <504DFA97.7070509@gmail.com>
From: Vlad Yasevich <vyasevich@gmail.com>
Date: Mon, 10 Sep 2012 10:35:03 -0400
> I am not sure this is right... This has a side-effect that when an
> rt_cache_flush() is called, it invalidates IPv6 routes a well....
>
> Its all fine and good do this when a new policy is added, but not when
> IPv4 routing table changes.
I disagree.
^ permalink raw reply
* Re: [PATCH v2] lxt PHY: Support for the buggy LXT973 rev A2
From: Richard Cochran @ 2012-09-10 17:28 UTC (permalink / raw)
To: Christophe Leroy; +Cc: David S Miller, netdev, linux-kernel
In-Reply-To: <201209101545.q8AFjn7u021483@localhost.localdomain>
On Mon, Sep 10, 2012 at 05:45:49PM +0200, Christophe Leroy wrote:
> This patch adds proper handling of the buggy revision A2 of LXT973 phy, adding
> precautions linked to ERRATA Item 4:
I have a few nit picking remarks, below...
> Item 4: MDIO Interface and Repeated Polling
> Problem: Repeated polling of odd-numbered registers via the MDIO interface
> randomly returns the contents of the previous even register.
> Implication: Managed applications may not obtain the correct register contents
> when a particular register is monitored for device status.
> Workaround: None.
> Status: This erratum has been previously fixed (in rev A3)
This text looks like it has been copied verbatim from a errata
sheet. If so, that document is probably under someone else's
copyright. If am right, then you should paraphrase the erratum
instead, both here and in the code comment.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
> diff -u linux-3.5-vanilla/drivers/net/phy/lxt.c linux-3.5/drivers/net/phy/lxt.c
> --- linux-3.5-vanilla/drivers/net/phy/lxt.c 2012-07-21 22:58:29.000000000 +0200
> +++ linux-3.5/drivers/net/phy/lxt.c 2012-09-07 18:08:54.000000000 +0200
> @@ -7,6 +7,10 @@
> *
> * Copyright (c) 2004 Freescale Semiconductor, Inc.
> *
> + * Copyright (c) 2010 CSSI
> + *
> + * Added support for buggy LXT973 rev A2
We don't do change logs in the code. That is what git is for.
Also, I think it is a bit of a stretch to add your copyright here.
> + *
> * 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
> @@ -54,8 +58,12 @@
> #define MII_LXT971_ISR 19 /* Interrupt Status Register */
>
> /* register definitions for the 973 */
> -#define MII_LXT973_PCR 16 /* Port Configuration Register */
> +#define MII_LXT973_PCR 16 /* Port Configuration Register */
> #define PCR_FIBER_SELECT 1
> +#define MII_LXT973_SFR 27 /* Special Function Register */
> +
> +#define PHYDEV_PRIV_FIBER 1
> +#define PHYDEV_PRIV_REVA2 2
>
> MODULE_DESCRIPTION("Intel LXT PHY driver");
> MODULE_AUTHOR("Andy Fleming");
> @@ -99,6 +107,9 @@
> return err;
> }
>
> +/* register definitions for the 973 */
> +#define MII_LXT973_PCR 16 /* Port Configuration Register */
> +#define PCR_FIBER_SELECT 1
>
> static int lxt971_ack_interrupt(struct phy_device *phydev)
> {
> @@ -122,9 +133,141 @@
> return err;
> }
>
> +/*
> + * ERRATA on LXT973
> + *
> + * Item 4: MDIO Interface and Repeated Polling
> + * Problem: Repeated polling of odd-numbered registers via the MDIO interface randomly returns the
> + * contents of the previous even register.
> + * Implication: Managed applications may not obtain the correct register contents when a particular
> + * register is monitored for device status.
> + * Workaround: None.
> + * Status: This erratum has been previously fixed (in rev A3)
> + *
> + */
Please make sure that the above text is your own words.
> +static int lxt973a2_update_link(struct phy_device *phydev)
> +{
> + int status;
> + int control;
> + int retry = 8; /* we try 8 times */
> +
> + /* Do a fake read */
> + status = phy_read(phydev, MII_BMSR);
> +
> + if (status < 0)
> + return status;
> +
> + control = phy_read(phydev, MII_BMCR);
> + if (control < 0)
> + return control;
> +
> + do {
> + /* Read link and autonegotiation status */
> + status = phy_read(phydev, MII_BMSR);
> + } while (status>=0 && retry-- && status == control);
spacing: status >= 0
> +
> + if (status < 0)
> + return status;
> +
> + if ((status & BMSR_LSTATUS) == 0)
> + phydev->link = 0;
> + else
> + phydev->link = 1;
> +
> + return 0;
> +}
> +
> +int lxt973a2_read_status(struct phy_device *phydev)
> +{
> + int adv;
> + int err;
> + int lpa;
> + int lpagb = 0;
> +
> + /* Update the link, but return if there was an error */
> + err = lxt973a2_update_link(phydev);
> + if (err)
> + return err;
> +
> + if (AUTONEG_ENABLE == phydev->autoneg) {
> + int retry = 1;
> +
> + adv = phy_read(phydev, MII_ADVERTISE);
> +
> + if (adv < 0)
> + return adv;
> +
> + do {
> + lpa = phy_read(phydev, MII_LPA);
> +
> + if (lpa < 0)
> + return lpa;
> +
> + /* If both registers are equal, it is suspect but not impossible, hence a new try */
Trailing white space. Line is way too long.
> + } while (lpa == adv && retry--);
> +
> + lpa &= adv;
> +
> + phydev->speed = SPEED_10;
> + phydev->duplex = DUPLEX_HALF;
> + phydev->pause = phydev->asym_pause = 0;
> +
> + if (lpagb & (LPA_1000FULL | LPA_1000HALF)) {
> + phydev->speed = SPEED_1000;
> +
> + if (lpagb & LPA_1000FULL)
> + phydev->duplex = DUPLEX_FULL;
> + } else if (lpa & (LPA_100FULL | LPA_100HALF)) {
> + phydev->speed = SPEED_100;
> +
> + if (lpa & LPA_100FULL)
> + phydev->duplex = DUPLEX_FULL;
> + } else
I would either put this 'else' with the 'if' on the same line, or add
braces like in the other cases.
> + if (lpa & LPA_10FULL)
> + phydev->duplex = DUPLEX_FULL;
> +
> + if (phydev->duplex == DUPLEX_FULL){
> + phydev->pause = lpa & LPA_PAUSE_CAP ? 1 : 0;
> + phydev->asym_pause = lpa & LPA_PAUSE_ASYM ? 1 : 0;
> + }
> + } else {
> + int bmcr = phy_read(phydev, MII_BMCR);
> +
> + if (bmcr < 0)
> + return bmcr;
> +
> + if (bmcr & BMCR_FULLDPLX)
> + phydev->duplex = DUPLEX_FULL;
> + else
> + phydev->duplex = DUPLEX_HALF;
> +
> + if (bmcr & BMCR_SPEED1000)
> + phydev->speed = SPEED_1000;
> + else if (bmcr & BMCR_SPEED100)
> + phydev->speed = SPEED_100;
> + else
> + phydev->speed = SPEED_10;
> +
> + phydev->pause = phydev->asym_pause = 0;
> + }
> +
> + return 0;
> +}
> +
> +static int lxt973_read_status(struct phy_device *phydev)
> +{
> + return (int)phydev->priv&PHYDEV_PRIV_REVA2 ? lxt973a2_read_status(phydev) : genphy_read_status(phydev);
spacing, and way too long line.
return (int) phydev->priv & PHYDEV_PRIV_REVA2 ?
lxt973a2_read_status(phydev) : genphy_read_status(phydev);
> +}
> +
> static int lxt973_probe(struct phy_device *phydev)
> {
> int val = phy_read(phydev, MII_LXT973_PCR);
> + int priv = 0;
> +
> + phydev->priv = NULL;
> +
> + if (val<0) return val;
spacing
>
> if (val & PCR_FIBER_SELECT) {
> /*
> @@ -136,17 +279,24 @@
> val &= ~BMCR_ANENABLE;
> phy_write(phydev, MII_BMCR, val);
> /* Remember that the port is in fiber mode. */
> - phydev->priv = lxt973_probe;
> - } else {
> - phydev->priv = NULL;
> + priv |= PHYDEV_PRIV_FIBER;
> }
> + val = phy_read(phydev, MII_PHYSID2);
> +
> + if (val<0) return val;
spacing
> +
> + if ((val & 0xf) == 0) { /* rev A2 */
> + dev_info(&phydev->dev, " LXT973 revision A2 has bugs\n");
> + priv |= PHYDEV_PRIV_REVA2;
> + }
> + phydev->priv = (void*)priv;
spacing
> return 0;
> }
>
> static int lxt973_config_aneg(struct phy_device *phydev)
> {
> /* Do nothing if port is in fiber mode. */
> - return phydev->priv ? 0 : genphy_config_aneg(phydev);
> + return (int)phydev->priv&PHYDEV_PRIV_FIBER ? 0 : genphy_config_aneg(phydev);
spacing, and a long line.
You might want to try checkpatch next time.
Thanks,
Richard
^ permalink raw reply
* Re: Modular arithmetic
From: Guy Harris @ 2012-09-10 17:50 UTC (permalink / raw)
To: David Laight
Cc: netdev, Jay Schulist, Andi Kleen, tcpdump-workers, Eric Dumazet
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6FE5@saturn3.aculab.com>
On Sep 10, 2012, at 3:41 AM, "David Laight" <David.Laight@ACULAB.COM> wrote:
>>> What about the other OS - eg all the BSDs?
>>> I had a vague idea that BPF was supposed to be reasonable portable.
>>
>> Yes, does it mean BPF is frozen ?
>>
>> Or is BSD so hard to update these days ?
>
> Not really - but it some other places that need updating in order
> to make this useful for cross-platform tools (like tcpdump).
>
> The 'real fun (tm)' happens when NetBSD tries to run Linux binaries
> that include the Linux libpcap.
Additional fun happens when a Linux system with a kernel that doesn't have the mod instruction tries to run Linux binaries that include a Linux libpcap that generates code using the mod instruction; this is not a BSD-vs.-Linux issue, it's a "kernel that lacks the mod instruction vs. libpcap that generates code that includes the mod instruction" issue.
BSD/OS X, Linux, Solaris, and the WinPcap driver need, if they adopt new BPF instructions, to have a mechanism by which libpcap (or anything else using BPF filtering) can inquire about the capabilities of the OS BPF interpreter; libpcap would use that to determine what code to generate if generating code for the in-kernel BPF interpreter.
(Please reply to tcpdump-workers@lists.tcpdump.org as well as to netdev@vger.kernel.org, so that people not on both of those lists can follow the discussion. Messages from non-members of tcpdump-workers to tcpdump-workers shouldn't bounce, but they do need to be approved by a moderator; Michael, if you want to at least temporarily turn the flood on for my e-mail address, so I can help moderate, go ahead.)
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers
^ permalink raw reply
* [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
From: Eric Dumazet @ 2012-09-10 17:55 UTC (permalink / raw)
To: Larry Finger; +Cc: linville, linux-wireless, netdev
In-Reply-To: <1347289446.1234.1717.camel@edumazet-glaptop>
From: Eric Dumazet <edumazet@google.com>
64bit arches have a buggy r8712u driver, let's fix it.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/staging/rtl8712/recv_linux.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 0e26d5f..495ee12 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
if (skb == NULL)
goto _recv_indicatepkt_drop;
skb->data = precv_frame->u.hdr.rx_data;
-#ifdef NET_SKBUFF_DATA_USES_OFFSET
- skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
- precv_frame->u.hdr.rx_head);
-#else
- skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
-#endif
skb->len = precv_frame->u.hdr.len;
+ skb_set_tail_pointer(skb, skb->len);
if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
^ permalink raw reply related
* Re: [PATCH net-next v2] Take care of xfrm policy when checking dst entries
From: Vlad Yasevich @ 2012-09-10 17:59 UTC (permalink / raw)
To: David Miller; +Cc: nicolas.dichtel, eric.dumazet, sri, linux-sctp, netdev
In-Reply-To: <20120910.131829.193126565067890591.davem@davemloft.net>
On 09/10/2012 01:18 PM, David Miller wrote:
> From: Vlad Yasevich <vyasevich@gmail.com>
> Date: Mon, 10 Sep 2012 10:35:03 -0400
>
>> I am not sure this is right... This has a side-effect that when an
>> rt_cache_flush() is called, it invalidates IPv6 routes a well....
>>
>> Its all fine and good do this when a new policy is added, but not when
>> IPv4 routing table changes.
>
> I disagree.
>
So you are perfectly ok with invalidating IPv6 cache when IPv4 table
changes, but not invalidating IPv4 cache if IPv6 table changes?
-vlad
^ permalink raw reply
* Re: [PATCH net-next v2] Take care of xfrm policy when checking dst entries
From: David Miller @ 2012-09-10 18:01 UTC (permalink / raw)
To: vyasevich; +Cc: nicolas.dichtel, eric.dumazet, sri, linux-sctp, netdev
In-Reply-To: <504E2A7A.9000003@gmail.com>
From: Vlad Yasevich <vyasevich@gmail.com>
Date: Mon, 10 Sep 2012 13:59:22 -0400
> On 09/10/2012 01:18 PM, David Miller wrote:
>> From: Vlad Yasevich <vyasevich@gmail.com>
>> Date: Mon, 10 Sep 2012 10:35:03 -0400
>>
>>> I am not sure this is right... This has a side-effect that when an
>>> rt_cache_flush() is called, it invalidates IPv6 routes a well....
>>>
>>> Its all fine and good do this when a new policy is added, but not when
>>> IPv4 routing table changes.
>>
>> I disagree.
>>
>
> So you are perfectly ok with invalidating IPv6 cache when IPv4 table
> changes, but not invalidating IPv4 cache if IPv6 table changes?
Due to tunneling I can't see how this is avoidable?
We do ipv6 over ipv4, but not vice-versa.
^ permalink raw reply
* Re: [PATCH v2] lxt PHY: Support for the buggy LXT973 rev A2
From: Lutz Jaenicke @ 2012-09-10 18:17 UTC (permalink / raw)
To: Christophe Leroy; +Cc: David S Miller, netdev, linux-kernel
In-Reply-To: <201209101545.q8AFjn7u021483@localhost.localdomain>
On Mon, Sep 10, 2012 at 05:45:49PM +0200, Christophe Leroy wrote:
> This patch adds proper handling of the buggy revision A2 of LXT973 phy, adding
> precautions linked to ERRATA Item 4:
>
> Item 4: MDIO Interface and Repeated Polling
> Problem: Repeated polling of odd-numbered registers via the MDIO interface
> randomly returns the contents of the previous even register.
> Implication: Managed applications may not obtain the correct register contents
> when a particular register is monitored for device status.
> Workaround: None.
> Status: This erratum has been previously fixed (in rev A3)
Hmm. Were did you get the hardware from? We have been using LXT973 in
our products and the A2 was replaced by A3 in 2003.
Best regards,
Lutz
--
Dr.-Ing. Lutz Jänicke
CTO
Innominate Security Technologies AG /protecting industrial networks/
tel: +49.30.921028-200
fax: +49.30.921028-020
Rudower Chaussee 13
D-12489 Berlin, Germany
www.innominate.com
Register Court: AG Charlottenburg, HR B 81603
Management Board: Dirk Seewald
Chairman of the Supervisory Board: Christoph Leifer
^ permalink raw reply
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
From: Larry Finger @ 2012-09-10 18:34 UTC (permalink / raw)
To: Eric Dumazet
Cc: linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev, Greg Kroah-Hartman
In-Reply-To: <1347299715.1234.1902.camel@edumazet-glaptop>
On 09/10/2012 12:55 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>
> 64bit arches have a buggy r8712u driver, let's fix it.
>
> Signed-off-by: Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/staging/rtl8712/recv_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
> index 0e26d5f..495ee12 100644
> --- a/drivers/staging/rtl8712/recv_linux.c
> +++ b/drivers/staging/rtl8712/recv_linux.c
> @@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
> if (skb == NULL)
> goto _recv_indicatepkt_drop;
> skb->data = precv_frame->u.hdr.rx_data;
> -#ifdef NET_SKBUFF_DATA_USES_OFFSET
> - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
> - precv_frame->u.hdr.rx_head);
> -#else
> - skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
> -#endif
> skb->len = precv_frame->u.hdr.len;
> + skb_set_tail_pointer(skb, skb->len);
> if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> else
Eric,
Thanks for this. It works for me. I had looked at this code a number of times,
but for some reason, I thought that the u.hdr.rx_yyyy parameters were like
32-bit systems and that all 4 values were pointers, and not like 64-bit systems,
thus the funny conversion. Strange that the bug was never triggered until commit
c8628155ece3 - this code has not changed since the driver was accepted into 2.6.37.
A few points on the patch. As the driver is in staging, the patch needs to go to
Greg Kroah-Hartman. In addition, please add the "Cc: Stable
<stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>" line. You may also give an a s-o-b for me. Finally,
this patch should fix https://bugzilla.redhat.com/show_bug.cgi?id=847525, and
https://bugzilla.kernel.org/show_bug.cgi?id=45071.
Larry
--
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
* Re: [PATCHv4] virtio-spec: virtio network device multiqueue support
From: Rick Jones @ 2012-09-10 18:39 UTC (permalink / raw)
To: Rusty Russell
Cc: kvm, Michael S. Tsirkin, netdev, virtualization, levinsasha928,
pbonzini, Tom Herbert
In-Reply-To: <878vcifwxi.fsf@rustcorp.com.au>
On 09/09/2012 07:12 PM, Rusty Russell wrote:
> OK, I read the spec (pasted below for easy of reading), but I'm still
> confused over how this will work.
>
> I thought normal net drivers have the hardware provide an rxhash for
> each packet, and we map that to CPU to queue the packet on[1]. We hope
> that the receiving process migrates to that CPU, so xmit queue
> matches.
>
> For virtio this would mean a new per-packet rxhash value, right?
>
> Why are we doing something different? What am I missing?
>
> Thanks,
> Rusty.
> [1] Everything I Know About Networking I Learned From LWN:
> https://lwn.net/Articles/362339/
In my taxonomy at least, "multi-queue" predates RPS and RFS and is
simply where the NIC via some means, perhaps a headers hash, separates
incoming frames to different queues.
RPS can be thought of as doing something similar inside the host. That
could be used to get a spread from an otherwise "dumb" NIC (certainly
that is what one of its predecessors - Inbound Packet Scheduling - used
it for in HP-UX 10.20), or it could be used to augment the multi-queue
support of a not-so-dump NIC - say if said NIC had a limit of queues
that was rather lower than the number of cores/threads in the host.
Indeed some driver/NIC combinations provide a hash value to the host for
the host to use as it sees fit.
However, there is still the matter of a single thread of an application
servicing multiple connections, each of which would hash to different
locations.
RFS (Receive Flow Steering) then goes one step further, and looks-up
where the flow endpoint was last accessed and steers the traffic there.
The idea being that a thread of execution servicing multiple flows
will have the traffic of those flows sent to the same place. It then
allows the scheduler to decide where things should be run rather than
the networking code.
rick jones
^ permalink raw reply
* Re: Endianess bug fix for sierra_net
From: David Miller @ 2012-09-10 19:06 UTC (permalink / raw)
To: lsorense; +Cc: linux-kernel, bjorn, linux, netdev
In-Reply-To: <20120907221402.GJ15650@csclub.uwaterloo.ca>
From: "Lennart Sorensen" <lsorense@csclub.uwaterloo.ca>
Date: Fri, 7 Sep 2012 18:14:02 -0400
> I discovered I couldn't get sierra_net to work on a powerpc. Turns out
> the firmware attribute check assumes the system is little endian and
> hence fails because the attributes is a 16 bit value.
>
> Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH] scsi_netlink: Remove dead and buggy code
From: David Miller @ 2012-09-10 19:07 UTC (permalink / raw)
To: ebiederm; +Cc: netdev, James.Bottomley, James.Smart, linux-scsi
In-Reply-To: <87pq5xjw4m.fsf@xmission.com>
From: ebiederm@xmission.com (Eric W. Biederman)
Date: Fri, 07 Sep 2012 15:39:21 -0700
>
> The scsi netlink code confuses the netlink port id with a process id,
> going so far as to read NETLINK_CREDS(skb)->pid instead of the correct
> NETLINK_CB(skb).pid. Fortunately it does not matter because nothing
> registers to respond to scsi netlink requests.
>
> The only interesting use of the scsi_netlink interface is
> fc_host_post_vendor_event which sends a netlink multicast message.
>
> Since nothing registers to handle scsi netlink messages kill all of the
> registration logic, while retaining the same error handling behavior
> preserving the userspace visible behavior and removing all of the
> confused code that thought a netlink port id was a process id.
>
> This was tested with a kernel allyesconfig build which had no problems.
>
> Cc: James Bottomley <James.Bottomley@parallels.com>
> Cc: James Smart <James.Smart@Emulex.Com>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
James et al., please review and ACK.
> ---
> drivers/scsi/scsi_netlink.c | 555 ++-----------------------------------------
> include/scsi/scsi_netlink.h | 24 --
> 2 files changed, 15 insertions(+), 564 deletions(-)
>
> diff --git a/drivers/scsi/scsi_netlink.c b/drivers/scsi/scsi_netlink.c
> index 8818dd6..abd43a3 100644
> --- a/drivers/scsi/scsi_netlink.c
> +++ b/drivers/scsi/scsi_netlink.c
> @@ -33,40 +33,6 @@
> struct sock *scsi_nl_sock = NULL;
> EXPORT_SYMBOL_GPL(scsi_nl_sock);
>
> -static DEFINE_SPINLOCK(scsi_nl_lock);
> -static struct list_head scsi_nl_drivers;
> -
> -static u32 scsi_nl_state;
> -#define STATE_EHANDLER_BSY 0x00000001
> -
> -struct scsi_nl_transport {
> - int (*msg_handler)(struct sk_buff *);
> - void (*event_handler)(struct notifier_block *, unsigned long, void *);
> - unsigned int refcnt;
> - int flags;
> -};
> -
> -/* flags values (bit flags) */
> -#define HANDLER_DELETING 0x1
> -
> -static struct scsi_nl_transport transports[SCSI_NL_MAX_TRANSPORTS] =
> - { {NULL, }, };
> -
> -
> -struct scsi_nl_drvr {
> - struct list_head next;
> - int (*dmsg_handler)(struct Scsi_Host *shost, void *payload,
> - u32 len, u32 pid);
> - void (*devt_handler)(struct notifier_block *nb,
> - unsigned long event, void *notify_ptr);
> - struct scsi_host_template *hostt;
> - u64 vendor_id;
> - unsigned int refcnt;
> - int flags;
> -};
> -
> -
> -
> /**
> * scsi_nl_rcv_msg - Receive message handler.
> * @skb: socket receive buffer
> @@ -81,7 +47,6 @@ scsi_nl_rcv_msg(struct sk_buff *skb)
> {
> struct nlmsghdr *nlh;
> struct scsi_nl_hdr *hdr;
> - unsigned long flags;
> u32 rlen;
> int err, tport;
>
> @@ -126,22 +91,24 @@ scsi_nl_rcv_msg(struct sk_buff *skb)
> /*
> * Deliver message to the appropriate transport
> */
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> -
> tport = hdr->transport;
> - if ((tport < SCSI_NL_MAX_TRANSPORTS) &&
> - !(transports[tport].flags & HANDLER_DELETING) &&
> - (transports[tport].msg_handler)) {
> - transports[tport].refcnt++;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - err = transports[tport].msg_handler(skb);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - transports[tport].refcnt--;
> - } else
> + if (tport == SCSI_NL_TRANSPORT) {
> + switch (hdr->msgtype) {
> + case SCSI_NL_SHOST_VENDOR:
> + /* Locate the driver that corresponds to the message */
> + err = -ESRCH;
> + break;
> + default:
> + err = -EBADR;
> + break;
> + }
> + if (err)
> + printk(KERN_WARNING "%s: Msgtype %d failed - err %d\n",
> + __func__, hdr->msgtype, err);
> + }
> + else
> err = -ENOENT;
>
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> next_msg:
> if ((err) || (nlh->nlmsg_flags & NLM_F_ACK))
> netlink_ack(skb, nlh, err);
> @@ -150,333 +117,6 @@ next_msg:
> }
> }
>
> -
> -/**
> - * scsi_nl_rcv_event - Event handler for a netlink socket.
> - * @this: event notifier block
> - * @event: event type
> - * @ptr: event payload
> - *
> - **/
> -static int
> -scsi_nl_rcv_event(struct notifier_block *this, unsigned long event, void *ptr)
> -{
> - struct netlink_notify *n = ptr;
> - struct scsi_nl_drvr *driver;
> - unsigned long flags;
> - int tport;
> -
> - if (n->protocol != NETLINK_SCSITRANSPORT)
> - return NOTIFY_DONE;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - scsi_nl_state |= STATE_EHANDLER_BSY;
> -
> - /*
> - * Pass event on to any transports that may be listening
> - */
> - for (tport = 0; tport < SCSI_NL_MAX_TRANSPORTS; tport++) {
> - if (!(transports[tport].flags & HANDLER_DELETING) &&
> - (transports[tport].event_handler)) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - transports[tport].event_handler(this, event, ptr);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - }
> -
> - /*
> - * Pass event on to any drivers that may be listening
> - */
> - list_for_each_entry(driver, &scsi_nl_drivers, next) {
> - if (!(driver->flags & HANDLER_DELETING) &&
> - (driver->devt_handler)) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - driver->devt_handler(this, event, ptr);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - }
> -
> - scsi_nl_state &= ~STATE_EHANDLER_BSY;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return NOTIFY_DONE;
> -}
> -
> -static struct notifier_block scsi_netlink_notifier = {
> - .notifier_call = scsi_nl_rcv_event,
> -};
> -
> -
> -/*
> - * GENERIC SCSI transport receive and event handlers
> - */
> -
> -/**
> - * scsi_generic_msg_handler - receive message handler for GENERIC transport messages
> - * @skb: socket receive buffer
> - **/
> -static int
> -scsi_generic_msg_handler(struct sk_buff *skb)
> -{
> - struct nlmsghdr *nlh = nlmsg_hdr(skb);
> - struct scsi_nl_hdr *snlh = NLMSG_DATA(nlh);
> - struct scsi_nl_drvr *driver;
> - struct Scsi_Host *shost;
> - unsigned long flags;
> - int err = 0, match, pid;
> -
> - pid = NETLINK_CREDS(skb)->pid;
> -
> - switch (snlh->msgtype) {
> - case SCSI_NL_SHOST_VENDOR:
> - {
> - struct scsi_nl_host_vendor_msg *msg = NLMSG_DATA(nlh);
> -
> - /* Locate the driver that corresponds to the message */
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - match = 0;
> - list_for_each_entry(driver, &scsi_nl_drivers, next) {
> - if (driver->vendor_id == msg->vendor_id) {
> - match = 1;
> - break;
> - }
> - }
> -
> - if ((!match) || (!driver->dmsg_handler)) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - err = -ESRCH;
> - goto rcv_exit;
> - }
> -
> - if (driver->flags & HANDLER_DELETING) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - err = -ESHUTDOWN;
> - goto rcv_exit;
> - }
> -
> - driver->refcnt++;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> -
> - /* if successful, scsi_host_lookup takes a shost reference */
> - shost = scsi_host_lookup(msg->host_no);
> - if (!shost) {
> - err = -ENODEV;
> - goto driver_exit;
> - }
> -
> - /* is this host owned by the vendor ? */
> - if (shost->hostt != driver->hostt) {
> - err = -EINVAL;
> - goto vendormsg_put;
> - }
> -
> - /* pass message on to the driver */
> - err = driver->dmsg_handler(shost, (void *)&msg[1],
> - msg->vmsg_datalen, pid);
> -
> -vendormsg_put:
> - /* release reference by scsi_host_lookup */
> - scsi_host_put(shost);
> -
> -driver_exit:
> - /* release our own reference on the registration object */
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - driver->refcnt--;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - break;
> - }
> -
> - default:
> - err = -EBADR;
> - break;
> - }
> -
> -rcv_exit:
> - if (err)
> - printk(KERN_WARNING "%s: Msgtype %d failed - err %d\n",
> - __func__, snlh->msgtype, err);
> - return err;
> -}
> -
> -
> -/**
> - * scsi_nl_add_transport -
> - * Registers message and event handlers for a transport. Enables
> - * receipt of netlink messages and events to a transport.
> - *
> - * @tport: transport registering handlers
> - * @msg_handler: receive message handler callback
> - * @event_handler: receive event handler callback
> - **/
> -int
> -scsi_nl_add_transport(u8 tport,
> - int (*msg_handler)(struct sk_buff *),
> - void (*event_handler)(struct notifier_block *, unsigned long, void *))
> -{
> - unsigned long flags;
> - int err = 0;
> -
> - if (tport >= SCSI_NL_MAX_TRANSPORTS)
> - return -EINVAL;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> -
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> -
> - if (transports[tport].msg_handler || transports[tport].event_handler) {
> - err = -EALREADY;
> - goto register_out;
> - }
> -
> - transports[tport].msg_handler = msg_handler;
> - transports[tport].event_handler = event_handler;
> - transports[tport].flags = 0;
> - transports[tport].refcnt = 0;
> -
> -register_out:
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return err;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_add_transport);
> -
> -
> -/**
> - * scsi_nl_remove_transport -
> - * Disable transport receiption of messages and events
> - *
> - * @tport: transport deregistering handlers
> - *
> - **/
> -void
> -scsi_nl_remove_transport(u8 tport)
> -{
> - unsigned long flags;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> -
> - if (tport < SCSI_NL_MAX_TRANSPORTS) {
> - transports[tport].flags |= HANDLER_DELETING;
> -
> - while (transports[tport].refcnt != 0) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - schedule_timeout_uninterruptible(HZ/4);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - transports[tport].msg_handler = NULL;
> - transports[tport].event_handler = NULL;
> - transports[tport].flags = 0;
> - }
> -
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_remove_transport);
> -
> -
> -/**
> - * scsi_nl_add_driver -
> - * A driver is registering its interfaces for SCSI netlink messages
> - *
> - * @vendor_id: A unique identification value for the driver.
> - * @hostt: address of the driver's host template. Used
> - * to verify an shost is bound to the driver
> - * @nlmsg_handler: receive message handler callback
> - * @nlevt_handler: receive event handler callback
> - *
> - * Returns:
> - * 0 on Success
> - * error result otherwise
> - **/
> -int
> -scsi_nl_add_driver(u64 vendor_id, struct scsi_host_template *hostt,
> - int (*nlmsg_handler)(struct Scsi_Host *shost, void *payload,
> - u32 len, u32 pid),
> - void (*nlevt_handler)(struct notifier_block *nb,
> - unsigned long event, void *notify_ptr))
> -{
> - struct scsi_nl_drvr *driver;
> - unsigned long flags;
> -
> - driver = kzalloc(sizeof(*driver), GFP_KERNEL);
> - if (unlikely(!driver)) {
> - printk(KERN_ERR "%s: allocation failure\n", __func__);
> - return -ENOMEM;
> - }
> -
> - driver->dmsg_handler = nlmsg_handler;
> - driver->devt_handler = nlevt_handler;
> - driver->hostt = hostt;
> - driver->vendor_id = vendor_id;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - list_add_tail(&driver->next, &scsi_nl_drivers);
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return 0;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_add_driver);
> -
> -
> -/**
> - * scsi_nl_remove_driver -
> - * An driver is unregistering with the SCSI netlink messages
> - *
> - * @vendor_id: The unique identification value for the driver.
> - **/
> -void
> -scsi_nl_remove_driver(u64 vendor_id)
> -{
> - struct scsi_nl_drvr *driver;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> -
> - list_for_each_entry(driver, &scsi_nl_drivers, next) {
> - if (driver->vendor_id == vendor_id) {
> - driver->flags |= HANDLER_DELETING;
> - while (driver->refcnt != 0) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - schedule_timeout_uninterruptible(HZ/4);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - list_del(&driver->next);
> - kfree(driver);
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - return;
> - }
> - }
> -
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - printk(KERN_ERR "%s: removal of driver failed - vendor_id 0x%llx\n",
> - __func__, (unsigned long long)vendor_id);
> - return;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_remove_driver);
> -
> -
> /**
> * scsi_netlink_init - Called by SCSI subsystem to initialize
> * the SCSI transport netlink interface
> @@ -485,36 +125,19 @@ EXPORT_SYMBOL_GPL(scsi_nl_remove_driver);
> void
> scsi_netlink_init(void)
> {
> - int error;
> struct netlink_kernel_cfg cfg = {
> .input = scsi_nl_rcv_msg,
> .groups = SCSI_NL_GRP_CNT,
> };
>
> - INIT_LIST_HEAD(&scsi_nl_drivers);
> -
> - error = netlink_register_notifier(&scsi_netlink_notifier);
> - if (error) {
> - printk(KERN_ERR "%s: register of event handler failed - %d\n",
> - __func__, error);
> - return;
> - }
> -
> scsi_nl_sock = netlink_kernel_create(&init_net, NETLINK_SCSITRANSPORT,
> THIS_MODULE, &cfg);
> if (!scsi_nl_sock) {
> printk(KERN_ERR "%s: register of receive handler failed\n",
> __func__);
> - netlink_unregister_notifier(&scsi_netlink_notifier);
> return;
> }
>
> - /* Register the entry points for the generic SCSI transport */
> - error = scsi_nl_add_transport(SCSI_NL_TRANSPORT,
> - scsi_generic_msg_handler, NULL);
> - if (error)
> - printk(KERN_ERR "%s: register of GENERIC transport handler"
> - " failed - %d\n", __func__, error);
> return;
> }
>
> @@ -526,158 +149,10 @@ scsi_netlink_init(void)
> void
> scsi_netlink_exit(void)
> {
> - scsi_nl_remove_transport(SCSI_NL_TRANSPORT);
> -
> if (scsi_nl_sock) {
> netlink_kernel_release(scsi_nl_sock);
> - netlink_unregister_notifier(&scsi_netlink_notifier);
> }
>
> return;
> }
>
> -
> -/*
> - * Exported Interfaces
> - */
> -
> -/**
> - * scsi_nl_send_transport_msg -
> - * Generic function to send a single message from a SCSI transport to
> - * a single process
> - *
> - * @pid: receiving pid
> - * @hdr: message payload
> - *
> - **/
> -void
> -scsi_nl_send_transport_msg(u32 pid, struct scsi_nl_hdr *hdr)
> -{
> - struct sk_buff *skb;
> - struct nlmsghdr *nlh;
> - const char *fn;
> - char *datab;
> - u32 len, skblen;
> - int err;
> -
> - if (!scsi_nl_sock) {
> - err = -ENOENT;
> - fn = "netlink socket";
> - goto msg_fail;
> - }
> -
> - len = NLMSG_SPACE(hdr->msglen);
> - skblen = NLMSG_SPACE(len);
> -
> - skb = alloc_skb(skblen, GFP_KERNEL);
> - if (!skb) {
> - err = -ENOBUFS;
> - fn = "alloc_skb";
> - goto msg_fail;
> - }
> -
> - nlh = nlmsg_put(skb, pid, 0, SCSI_TRANSPORT_MSG, len - sizeof(*nlh), 0);
> - if (!nlh) {
> - err = -ENOBUFS;
> - fn = "nlmsg_put";
> - goto msg_fail_skb;
> - }
> - datab = NLMSG_DATA(nlh);
> - memcpy(datab, hdr, hdr->msglen);
> -
> - err = nlmsg_unicast(scsi_nl_sock, skb, pid);
> - if (err < 0) {
> - fn = "nlmsg_unicast";
> - /* nlmsg_unicast already kfree_skb'd */
> - goto msg_fail;
> - }
> -
> - return;
> -
> -msg_fail_skb:
> - kfree_skb(skb);
> -msg_fail:
> - printk(KERN_WARNING
> - "%s: Dropped Message : pid %d Transport %d, msgtype x%x, "
> - "msglen %d: %s : err %d\n",
> - __func__, pid, hdr->transport, hdr->msgtype, hdr->msglen,
> - fn, err);
> - return;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_send_transport_msg);
> -
> -
> -/**
> - * scsi_nl_send_vendor_msg - called to send a shost vendor unique message
> - * to a specific process id.
> - *
> - * @pid: process id of the receiver
> - * @host_no: host # sending the message
> - * @vendor_id: unique identifier for the driver's vendor
> - * @data_len: amount, in bytes, of vendor unique payload data
> - * @data_buf: pointer to vendor unique data buffer
> - *
> - * Returns:
> - * 0 on successful return
> - * otherwise, failing error code
> - *
> - * Notes:
> - * This routine assumes no locks are held on entry.
> - */
> -int
> -scsi_nl_send_vendor_msg(u32 pid, unsigned short host_no, u64 vendor_id,
> - char *data_buf, u32 data_len)
> -{
> - struct sk_buff *skb;
> - struct nlmsghdr *nlh;
> - struct scsi_nl_host_vendor_msg *msg;
> - u32 len, skblen;
> - int err;
> -
> - if (!scsi_nl_sock) {
> - err = -ENOENT;
> - goto send_vendor_fail;
> - }
> -
> - len = SCSI_NL_MSGALIGN(sizeof(*msg) + data_len);
> - skblen = NLMSG_SPACE(len);
> -
> - skb = alloc_skb(skblen, GFP_KERNEL);
> - if (!skb) {
> - err = -ENOBUFS;
> - goto send_vendor_fail;
> - }
> -
> - nlh = nlmsg_put(skb, 0, 0, SCSI_TRANSPORT_MSG,
> - skblen - sizeof(*nlh), 0);
> - if (!nlh) {
> - err = -ENOBUFS;
> - goto send_vendor_fail_skb;
> - }
> - msg = NLMSG_DATA(nlh);
> -
> - INIT_SCSI_NL_HDR(&msg->snlh, SCSI_NL_TRANSPORT,
> - SCSI_NL_SHOST_VENDOR, len);
> - msg->vendor_id = vendor_id;
> - msg->host_no = host_no;
> - msg->vmsg_datalen = data_len; /* bytes */
> - memcpy(&msg[1], data_buf, data_len);
> -
> - err = nlmsg_unicast(scsi_nl_sock, skb, pid);
> - if (err)
> - /* nlmsg_multicast already kfree_skb'd */
> - goto send_vendor_fail;
> -
> - return 0;
> -
> -send_vendor_fail_skb:
> - kfree_skb(skb);
> -send_vendor_fail:
> - printk(KERN_WARNING
> - "%s: Dropped SCSI Msg : host %d vendor_unique - err %d\n",
> - __func__, host_no, err);
> - return err;
> -}
> -EXPORT_SYMBOL(scsi_nl_send_vendor_msg);
> -
> -
> diff --git a/include/scsi/scsi_netlink.h b/include/scsi/scsi_netlink.h
> index 5cb20cc..62b4eda 100644
> --- a/include/scsi/scsi_netlink.h
> +++ b/include/scsi/scsi_netlink.h
> @@ -119,29 +119,5 @@ struct scsi_nl_host_vendor_msg {
> (hdr)->msglen = mlen; \
> }
>
> -
> -#ifdef __KERNEL__
> -
> -#include <scsi/scsi_host.h>
> -
> -/* Exported Kernel Interfaces */
> -int scsi_nl_add_transport(u8 tport,
> - int (*msg_handler)(struct sk_buff *),
> - void (*event_handler)(struct notifier_block *, unsigned long, void *));
> -void scsi_nl_remove_transport(u8 tport);
> -
> -int scsi_nl_add_driver(u64 vendor_id, struct scsi_host_template *hostt,
> - int (*nlmsg_handler)(struct Scsi_Host *shost, void *payload,
> - u32 len, u32 pid),
> - void (*nlevt_handler)(struct notifier_block *nb,
> - unsigned long event, void *notify_ptr));
> -void scsi_nl_remove_driver(u64 vendor_id);
> -
> -void scsi_nl_send_transport_msg(u32 pid, struct scsi_nl_hdr *hdr);
> -int scsi_nl_send_vendor_msg(u32 pid, unsigned short host_no, u64 vendor_id,
> - char *data_buf, u32 data_len);
> -
> -#endif /* __KERNEL__ */
> -
> #endif /* SCSI_NETLINK_H */
>
> --
> 1.7.5.4
>
^ permalink raw reply
* Re: ndo_get_stats and rtnl_netlink
From: Or Gerlitz @ 2012-09-10 19:10 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Shlomo Pongartz, netdev
In-Reply-To: <1347268189.1234.1301.camel@edumazet-glaptop>
On Mon, Sep 10, 2012 at 12:09 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> RTNL locking is not needed to fetch stats, and would be overkill.
> Each driver has its own way to protect/gather its stats.
FWIW, again, when dev_get_stats is called from rtnl_fill_ifinfo e.g as
of invocation
of "ip link show <interface>, there IS RTNL locking, is that a problem?
Or.
^ permalink raw reply
* zero length sg in scatterwalk_start.
From: Dave Jones @ 2012-09-10 19:12 UTC (permalink / raw)
To: netdev; +Cc: Fedora Kernel Team, sergei.litvinenko, herbert
In-Reply-To: <bug-855961-176318@bugzilla.redhat.com>
Sergei (Cc'd) just filed this against our 3.6rc4 kernel
It's falling over on the
BUG_ON(!sg->length);
in scatterwalk_start
Dave
On Mon, Sep 10, 2012 at 06:41:07PM +0000, bugzilla@redhat.com wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=855961
>
> Description of problem:
>
> Message with diagnostic and openswan stop to work
>
> Version-Release number of selected component (if applicable):
> kernel-3.6.0-0.rc4.git2.1.fc18.i686
> openswan-2.6.38-3.fc18.i686
>
>
> Steps to Reproduce:
> 1. Install f18 to KVM
> 2. install openswan
> 3. prepare configuration on Host and kvm guest:
>
> conn fedora18
> #----------------------------------
> left=10.x.x.100
> leftrsasigkey=0sAQPHXz0 ...
> #----------------------------------
> right=10.x.x.18
> rightrsasigkey=0sAQOi...
> #----------------------------------
> type=transport
> keyingtries=%forever
> auth=esp
> ike=aes256-sha1-modp1024
> esp=aes256-sha1
> authby=rsasig
> keyexchange=ike
> disablearrivalcheck=yes
> pfs=no
> compress=no
> #-----------------------------
> auto=add
>
> 4. run from host: ipsec auto --up fedora18
>
> Actual results:
>
> Message ... and ipsec service is not accessible any more. Guest do not crash
> and stil work (accessible by ssh).
>
> Expected results:
> ipsec start and work
>
>
> [ 105.063277] ------------[ cut here ]------------
> [ 105.063281] kernel BUG at crypto/scatterwalk.c:37!
> [ 105.063283] invalid opcode: 0000 [#1] SMP
> [ 105.063286] Modules linked in: authenc rmd160 crypto_null camellia_generic lzo cast6 cast5 deflate zlib_deflate cts gcm ccm serpent_sse2_i586 xts serpent_generic lrw gf128mul glue_helper blowfish_generic blowfish_common twofish_generic twofish_i586 twofish_common xcbc sha512_generic des_generic geode_aes ah6 ah4 esp6 esp4 xfrm4_mode_beet xfrm4_tunnel tunnel4 xfrm4_mode_tunnel xfrm4_mode_transport xfrm6_mode_transport xfrm6_mode_ro xfrm6_mode_beet xfrm6_mode_tunnel ipcomp ipcomp6 xfrm6_tunnel tunnel6 xfrm_ipcomp af_key lockd sunrpc bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ppdev microcode virtio_net i2c_piix4 parport_pc i2c_core parport uinput virtio_blk
> [ 105.063327] Pid: 995, comm: cryptomgr_test Not tainted 3.6.0-0.rc4.git2.1.fc18.i686 #1 Bochs Bochs
> [ 105.063329] EIP: 0060:[<c06829e9>] EFLAGS: 00010246 CPU: 0
> [ 105.063363] EIP is at scatterwalk_start+0x19/0x20
> [ 105.063365] EAX: f334bbe0 EBX: f286a5d8 ECX: 00000000 EDX: f286a5d8
> [ 105.063367] ESI: 00000020 EDI: 00000000 EBP: f334bbd0 ESP: f334bbd0
> [ 105.063368] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> [ 105.063372] CR0: 8005003b CR2: 45cb04bc CR3: 00ede000 CR4: 000006d0
> [ 105.063381] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> [ 105.063386] DR6: ffff0ff0 DR7: 00000400
> [ 105.063388] Process cryptomgr_test (pid: 995, ti=f334a000 task=f26e5640 task.ti=f334a000)
> [ 105.063389] Stack:
> [ 105.063390] f334bbf4 c0682bfa f334bbe0 f286a640 f286a5d8 f80851a3 f286a5a0 f286a5d8
> [ 105.063395] f3378a50 f334bc38 f80859db 00000014 00000001 f2bd5000 00000000 87654321
> [ 105.063400] 00000668 f54cdc80 00000200 00000000 00000000 f286a5d8 00000020 f286a678
> [ 105.063406] Call Trace:
> [ 105.063409] [<c0682bfa>] scatterwalk_map_and_copy+0x2a/0xa0
> [ 105.063413] [<f80851a3>] ? crypto_authenc_ahash+0x63/0x80 [authenc]
> [ 105.063416] [<f80859db>] crypto_authenc_genicv+0xdb/0x330 [authenc]
> [ 105.063419] [<f8085dbc>] crypto_authenc_encrypt+0x8c/0xa0 [authenc]
> [ 105.063422] [<c068a48a>] test_aead+0x5aa/0xd40
> [ 105.063432] [<c047e685>] ? local_clock+0x65/0x70
> [ 105.063444] [<c055d239>] ? deactivate_slab+0x419/0x540
> [ 105.063449] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063451] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063455] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063457] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063460] [<c055e2eb>] ? __kmalloc+0x11b/0x290
> [ 105.063463] [<c068121f>] ? __crypto_alloc_tfm+0x11f/0x150
> [ 105.063466] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063468] [<c068f6d2>] ? crypto_cbc_init_tfm+0x22/0x40
> [ 105.063471] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063473] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063476] [<c0685022>] ? skcipher_geniv_init+0x22/0x40
> [ 105.063478] [<c0685edb>] ? async_chainiv_init+0x7b/0x90
> [ 105.063481] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063484] [<c068ac68>] alg_test_aead+0x48/0xa0
> [ 105.063487] [<c068992e>] ? alg_find_test+0x2e/0x60
> [ 105.063489] [<c0689a06>] alg_test+0xa6/0x270
> [ 105.063511] [<c09fb836>] ? _raw_spin_unlock_irqrestore+0x36/0x70
> [ 105.063514] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063517] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063519] [<c06886c0>] ? cryptomgr_probe+0xb0/0xb0
> [ 105.063522] [<c0688701>] cryptomgr_test+0x41/0x50
> [ 105.063525] [<c046640d>] kthread+0x7d/0x90
> [ 105.063528] [<c0466390>] ? __init_kthread_worker+0x60/0x60
> [ 105.063532] [<c0a03502>] kernel_thread_helper+0x6/0x10
> [ 105.063533] Code: c3 90 31 f6 83 c4 08 89 f0 5b 5e 5f 5d c3 66 90 66 90 55 89 e5 3e 8d 74 26 00 89 10 8b 4a 0c 85 c9 74 08 8b 52 08 5d 89 50 04 c3 <0f> 0b 90 8d 74 26 00 55 89 e5 53 3e 8d 74 26 00 89 c3 8b 00 81
> [ 105.063565] EIP: [<c06829e9>] scatterwalk_start+0x19/0x20 SS:ESP 0068:f334bbd0
> [ 105.063570] ---[ end trace 5057a14544445946 ]---
> [ 105.063573] BUG: sleeping function called from invalid context at kernel/rwsem.c:20
> [ 105.063574] in_atomic(): 1, irqs_disabled(): 0, pid: 995, name: cryptomgr_test
> [ 105.063575] INFO: lockdep is turned off.
> [ 105.063577] Pid: 995, comm: cryptomgr_test Tainted: G D 3.6.0-0.rc4.git2.1.fc18.i686 #1
> [ 105.063578] Call Trace:
> [ 105.063581] [<c0475227>] __might_sleep+0x167/0x210
> [ 105.063584] [<c09f9230>] down_read+0x20/0x8b
> [ 105.063587] [<c046e6ef>] ? __validate_process_creds+0x6f/0xd0
> [ 105.063590] [<c0457f6e>] exit_signals+0x1e/0x110
> [ 105.063595] [<c0446cef>] do_exit+0x9f/0xa10
> [ 105.063597] [<c0443b11>] ? kmsg_dump+0x21/0x210
> [ 105.063600] [<c0443c80>] ? kmsg_dump+0x190/0x210
> [ 105.063602] [<c0443c94>] ? kmsg_dump+0x1a4/0x210
> [ 105.063605] [<c0443b11>] ? kmsg_dump+0x21/0x210
> [ 105.063607] [<c09fc92a>] oops_end+0x8a/0xd0
> [ 105.063611] [<c04061d4>] die+0x54/0x80
> [ 105.063613] [<c09fc366>] do_trap+0x96/0xd0
> [ 105.063616] [<c0403b70>] ? do_bounds+0x90/0x90
> [ 105.063618] [<c0403c16>] do_invalid_op+0xa6/0xb0
> [ 105.063620] [<c06829e9>] ? scatterwalk_start+0x19/0x20
> [ 105.063623] [<c068c1ed>] ? hmac_final+0x8d/0xa0
> [ 105.063625] [<c0687d67>] ? crypto_shash_final+0x27/0xa0
> [ 105.063628] [<c0688173>] ? shash_ahash_finup+0x73/0x80
> [ 105.063637] [<c06c8dc8>] ? trace_hardirqs_off_thunk+0xc/0x14
> [ 105.063640] [<c09fc0f8>] error_code+0x6c/0x74
> [ 105.063643] [<c06800d8>] ? devcgroup_seq_read+0x2a8/0x2f0
> [ 105.063645] [<c06829e9>] ? scatterwalk_start+0x19/0x20
> [ 105.063648] [<c0682bfa>] scatterwalk_map_and_copy+0x2a/0xa0
> [ 105.063651] [<f80851a3>] ? crypto_authenc_ahash+0x63/0x80 [authenc]
> [ 105.063653] [<f80859db>] crypto_authenc_genicv+0xdb/0x330 [authenc]
> [ 105.063656] [<f8085dbc>] crypto_authenc_encrypt+0x8c/0xa0 [authenc]
> [ 105.063659] [<c068a48a>] test_aead+0x5aa/0xd40
> [ 105.063661] [<c047e685>] ? local_clock+0x65/0x70
> [ 105.063664] [<c055d239>] ? deactivate_slab+0x419/0x540
> [ 105.063667] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063670] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063672] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063675] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063678] [<c055e2eb>] ? __kmalloc+0x11b/0x290
> [ 105.063681] [<c068121f>] ? __crypto_alloc_tfm+0x11f/0x150
> [ 105.063683] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063685] [<c068f6d2>] ? crypto_cbc_init_tfm+0x22/0x40
> [ 105.063688] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063690] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063693] [<c0685022>] ? skcipher_geniv_init+0x22/0x40
> [ 105.063695] [<c0685edb>] ? async_chainiv_init+0x7b/0x90
> [ 105.063698] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063701] [<c068ac68>] alg_test_aead+0x48/0xa0
> [ 105.063703] [<c068992e>] ? alg_find_test+0x2e/0x60
> [ 105.063706] [<c0689a06>] alg_test+0xa6/0x270
> [ 105.063709] [<c09fb836>] ? _raw_spin_unlock_irqrestore+0x36/0x70
> [ 105.063711] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063713] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063716] [<c06886c0>] ? cryptomgr_probe+0xb0/0xb0
> [ 105.063718] [<c0688701>] cryptomgr_test+0x41/0x50
> [ 105.063721] [<c046640d>] kthread+0x7d/0x90
> [ 105.063724] [<c0466390>] ? __init_kthread_worker+0x60/0x60
> [ 105.063726] [<c0a03502>] kernel_thread_helper+0x6/0x10
> [ 105.063728] note: cryptomgr_test[995] exited with preempt_count 1
^ permalink raw reply
* Re: ndo_get_stats and rtnl_netlink
From: Eric Dumazet @ 2012-09-10 19:15 UTC (permalink / raw)
To: Or Gerlitz; +Cc: Shlomo Pongartz, netdev
In-Reply-To: <CAJZOPZKKca6Yea=E9reL+x-cfvX0HwsgLAWKzjonmGwutH0MxA@mail.gmail.com>
On Mon, 2012-09-10 at 22:10 +0300, Or Gerlitz wrote:
> On Mon, Sep 10, 2012 at 12:09 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > RTNL locking is not needed to fetch stats, and would be overkill.
> > Each driver has its own way to protect/gather its stats.
>
> FWIW, again, when dev_get_stats is called from rtnl_fill_ifinfo e.g as
> of invocation
> of "ip link show <interface>, there IS RTNL locking, is that a problem?
>
> Or.
Why should it be a problem ?
A dev_get_stats() is not allowed to sleep, so its not allowed to use
RTNL by itself.
So caller might use RTNL, we dont care at all.
^ permalink raw reply
* [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
From: Eric Dumazet @ 2012-09-10 19:22 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Larry Finger, netdev, Dave Jones
From: Eric Dumazet <edumazet@google.com>
64bit arches have a buggy r8712u driver, let's fix it.
skb->tail must be set properly or network stack behavior is undefined.
Addresses https://bugzilla.redhat.com/show_bug.cgi?id=847525
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45071
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Dave Jones <davej@redhat.com>
Cc: stable@vger.kernel.org [2.6.37+]
---
drivers/staging/rtl8712/recv_linux.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 0e26d5f..495ee12 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
if (skb == NULL)
goto _recv_indicatepkt_drop;
skb->data = precv_frame->u.hdr.rx_data;
-#ifdef NET_SKBUFF_DATA_USES_OFFSET
- skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
- precv_frame->u.hdr.rx_head);
-#else
- skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
-#endif
skb->len = precv_frame->u.hdr.len;
+ skb_set_tail_pointer(skb, skb->len);
if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
^ permalink raw reply related
* Re: [PATCH] netlink: Rename pid to portid to avoid confusion
From: David Miller @ 2012-09-10 19:31 UTC (permalink / raw)
To: shemminger; +Cc: ebiederm, netdev
In-Reply-To: <20120908095441.359df1d1@s6510.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sat, 8 Sep 2012 09:54:41 -0700
> On Fri, 07 Sep 2012 23:12:54 -0700
> ebiederm@xmission.com (Eric W. Biederman) wrote:
>
>> It is a frequent mistake to confuse the netlink port identifier with a
>> process identifier. Try to reduce this confusion by renaming fields
>> that hold port identifiers portid instead of pid.
>>
>> I have carefully avoided changing the structures exported to
>> userspace to avoid changing the userspace API.
>>
>> I have successfully built an allyesconfig kernel with this change.
>>
>> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
>> ---
>
> Ok. I validated that no header file used by iproute2 is affected.
>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Applied to net-next, thanks.
^ 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