* Re: NIC driver r8168 with r8169 for RTL8111/8168B and DGE-528T together
From: Francois Romieu @ 2011-07-20 20:30 UTC (permalink / raw)
To: Danie Wessels; +Cc: netdev
In-Reply-To: <4E26B198.4020606@telkomsa.net>
Danie Wessels <dawessels@telkomsa.net> :
[...]
> I would like to use my onboard NIC (eth0) with its r8168 driver from
> RealTek together with my D-Link NIC (eth4=eth1) with its r8169
> default driver from the install. Sepatately they seem to work...but
> I would like a firewall set up with NAT and had it before I
> "upgraded". ;^)
Remove the 8168 PCI IDs from the r8169 driver and you should be set.
[...]
> [ 1.486546] r8169 0000:03:00.0: eth0: RTL8168b/8111b at
> 0xf8024000, 00:1c:c0:a7:03:49, XID 98500000 IRQ 43
It ought to be supported by the kernel r8169 driver.
Which problem(s) do you have with it ?
--
Ueimor
^ permalink raw reply
* [PATCH net-next 3/8] tg3: Fix link down notify failure when EEE disabled
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
Occasionally, when the network cable is removed after a successful
autonegotiation, the device will not send a link down interrupt to the
driver. This happens because of a bad interaction of an EEE
workaround. The fix is to adjust the code so that the root cause
condition does not happen.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 38 +++++++++++++++++++++++++-------------
1 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 2a9ab99..e0413bc 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1858,6 +1858,12 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
}
if (!tp->setlpicnt) {
+ if (current_link_up == 1 &&
+ !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
+ tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, 0x0000);
+ TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+ }
+
val = tr32(TG3_CPMU_EEE_MODE);
tw32(TG3_CPMU_EEE_MODE, val & ~TG3_CPMU_EEEMD_LPI_ENABLE);
}
@@ -1872,7 +1878,9 @@ static void tg3_phy_eee_enable(struct tg3 *tp)
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
!TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
- tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, 0x0003);
+ val = MII_TG3_DSP_TAP26_ALNOKO |
+ MII_TG3_DSP_TAP26_RMRXSTO;
+ tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
}
@@ -3128,13 +3136,26 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
if (!err) {
u32 err2;
+ val = 0;
+ /* Advertise 100-BaseTX EEE ability */
+ if (advertise & ADVERTISED_100baseT_Full)
+ val |= MDIO_AN_EEE_ADV_100TX;
+ /* Advertise 1000-BaseT EEE ability */
+ if (advertise & ADVERTISED_1000baseT_Full)
+ val |= MDIO_AN_EEE_ADV_1000T;
+ err = tg3_phy_cl45_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val);
+ if (err)
+ val = 0;
+
switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
case ASIC_REV_5717:
case ASIC_REV_57765:
case ASIC_REV_5719:
- val = MII_TG3_DSP_TAP26_ALNOKO |
- MII_TG3_DSP_TAP26_RMRXSTO |
- MII_TG3_DSP_TAP26_OPCSINPT;
+ /* If we advertised any eee advertisements above... */
+ if (val)
+ val = MII_TG3_DSP_TAP26_ALNOKO |
+ MII_TG3_DSP_TAP26_RMRXSTO |
+ MII_TG3_DSP_TAP26_OPCSINPT;
tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
/* Fall through */
case ASIC_REV_5720:
@@ -3143,15 +3164,6 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
MII_TG3_DSP_CH34TP2_HIBW01);
}
- val = 0;
- /* Advertise 100-BaseTX EEE ability */
- if (advertise & ADVERTISED_100baseT_Full)
- val |= MDIO_AN_EEE_ADV_100TX;
- /* Advertise 1000-BaseT EEE ability */
- if (advertise & ADVERTISED_1000baseT_Full)
- val |= MDIO_AN_EEE_ADV_1000T;
- err = tg3_phy_cl45_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val);
-
err2 = TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
if (!err)
err = err2;
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 2/8] tg3: Fix link flap at 100Mbps with EEE enabled
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch increases the scope of the EEE interoperability workaround
to include more asic revisions. The workarond value is tuned to
workaround a link flap issue at 100Mbps.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 9 +++++----
drivers/net/tg3.h | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 5bf7671..2a9ab99 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3131,15 +3131,16 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
case ASIC_REV_5717:
case ASIC_REV_57765:
- if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
- tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, val |
- MII_TG3_DSP_CH34TP2_HIBW01);
- /* Fall through */
case ASIC_REV_5719:
val = MII_TG3_DSP_TAP26_ALNOKO |
MII_TG3_DSP_TAP26_RMRXSTO |
MII_TG3_DSP_TAP26_OPCSINPT;
tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
+ /* Fall through */
+ case ASIC_REV_5720:
+ if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
+ tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, val |
+ MII_TG3_DSP_CH34TP2_HIBW01);
}
val = 0;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 6a43fc5..691539b 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2180,7 +2180,7 @@
#define MII_TG3_DSP_TAP26_OPCSINPT 0x0004
#define MII_TG3_DSP_AADJ1CH0 0x001f
#define MII_TG3_DSP_CH34TP2 0x4022
-#define MII_TG3_DSP_CH34TP2_HIBW01 0x017b
+#define MII_TG3_DSP_CH34TP2_HIBW01 0x01ff
#define MII_TG3_DSP_AADJ1CH3 0x601f
#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
#define MII_TG3_DSP_EXP1_INT_STAT 0x0f01
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 8/8] tg3: Fix NVRAM selftest failures for 5720 devs
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch fixes NVRAM selftest failures for 5720 devices by fixing the
checksum area size.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index bce0f226..8035765 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10655,7 +10655,7 @@ error:
#define NVRAM_SELFBOOT_FORMAT1_3_SIZE 0x1c
#define NVRAM_SELFBOOT_FORMAT1_4_SIZE 0x20
#define NVRAM_SELFBOOT_FORMAT1_5_SIZE 0x24
-#define NVRAM_SELFBOOT_FORMAT1_6_SIZE 0x4c
+#define NVRAM_SELFBOOT_FORMAT1_6_SIZE 0x50
#define NVRAM_SELFBOOT_HW_SIZE 0x20
#define NVRAM_SELFBOOT_DATA_SIZE 0x1c
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 7/8] tg3: Return size from tg3_vpd_readblock()
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
Newer VPD datablocks can exceed the size the tg3 driver is traditionally
used to. This can cause some of the routines that operate on the VPD
data to fail when in-fact they could have succeeded had they known the
correct size. This patch fixes the problem.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f2b0839..bce0f226 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10573,7 +10573,7 @@ static void tg3_get_ethtool_stats(struct net_device *dev,
memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats));
}
-static __be32 * tg3_vpd_readblock(struct tg3 *tp)
+static __be32 *tg3_vpd_readblock(struct tg3 *tp, u32 *vpdlen)
{
int i;
__be32 *buf;
@@ -10640,6 +10640,8 @@ static __be32 * tg3_vpd_readblock(struct tg3 *tp)
goto error;
}
+ *vpdlen = len;
+
return buf;
error:
@@ -10659,7 +10661,7 @@ error:
static int tg3_test_nvram(struct tg3 *tp)
{
- u32 csum, magic;
+ u32 csum, magic, len;
__be32 *buf;
int i, j, k, err = 0, size;
@@ -10800,18 +10802,17 @@ static int tg3_test_nvram(struct tg3 *tp)
kfree(buf);
- buf = tg3_vpd_readblock(tp);
+ buf = tg3_vpd_readblock(tp, &len);
if (!buf)
return -ENOMEM;
- i = pci_vpd_find_tag((u8 *)buf, 0, TG3_NVM_VPD_LEN,
- PCI_VPD_LRDT_RO_DATA);
+ i = pci_vpd_find_tag((u8 *)buf, 0, len, PCI_VPD_LRDT_RO_DATA);
if (i > 0) {
j = pci_vpd_lrdt_size(&((u8 *)buf)[i]);
if (j < 0)
goto out;
- if (i + PCI_VPD_LRDT_TAG_SIZE + j > TG3_NVM_VPD_LEN)
+ if (i + PCI_VPD_LRDT_TAG_SIZE + j > len)
goto out;
i += PCI_VPD_LRDT_TAG_SIZE;
@@ -13209,14 +13210,14 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)
{
u8 *vpd_data;
unsigned int block_end, rosize, len;
+ u32 vpdlen;
int j, i = 0;
- vpd_data = (u8 *)tg3_vpd_readblock(tp);
+ vpd_data = (u8 *)tg3_vpd_readblock(tp, &vpdlen);
if (!vpd_data)
goto out_no_vpd;
- i = pci_vpd_find_tag(vpd_data, 0, TG3_NVM_VPD_LEN,
- PCI_VPD_LRDT_RO_DATA);
+ i = pci_vpd_find_tag(vpd_data, 0, vpdlen, PCI_VPD_LRDT_RO_DATA);
if (i < 0)
goto out_not_found;
@@ -13224,7 +13225,7 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)
block_end = i + PCI_VPD_LRDT_TAG_SIZE + rosize;
i += PCI_VPD_LRDT_TAG_SIZE;
- if (block_end > TG3_NVM_VPD_LEN)
+ if (block_end > vpdlen)
goto out_not_found;
j = pci_vpd_find_info_keyword(vpd_data, i, rosize,
@@ -13249,7 +13250,7 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)
goto partno;
memcpy(tp->fw_ver, &vpd_data[j], len);
- strncat(tp->fw_ver, " bc ", TG3_NVM_VPD_LEN - len - 1);
+ strncat(tp->fw_ver, " bc ", vpdlen - len - 1);
}
partno:
@@ -13262,7 +13263,7 @@ partno:
i += PCI_VPD_INFO_FLD_HDR_SIZE;
if (len > TG3_BPN_SIZE ||
- (len + i) > TG3_NVM_VPD_LEN)
+ (len + i) > vpdlen)
goto out_not_found;
memcpy(tp->board_part_number, &vpd_data[i], len);
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 1/8] tg3: Fix io failures after chip reset
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
Commit f2096f94b514d88593355995d5dd276961e88af1, entitled
"tg3: Add 5720 H2BMC support", needed to add code to preserve some bits
set by firmware. Unfortunately the new code causes throughput to stop
after a chip reset because it enables state machines before they are
ready. This patch undoes the problematic code. The bits will be
restored later in the init sequence.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a5ff82d..5bf7671 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7412,16 +7412,11 @@ static int tg3_chip_reset(struct tg3 *tp)
tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl);
}
- if (tg3_flag(tp, ENABLE_APE))
- tp->mac_mode = MAC_MODE_APE_TX_EN |
- MAC_MODE_APE_RX_EN |
- MAC_MODE_TDE_ENABLE;
-
if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
- tp->mac_mode |= MAC_MODE_PORT_MODE_TBI;
+ tp->mac_mode = MAC_MODE_PORT_MODE_TBI;
val = tp->mac_mode;
} else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) {
- tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
+ tp->mac_mode = MAC_MODE_PORT_MODE_GMII;
val = tp->mac_mode;
} else
val = 0;
@@ -8559,12 +8554,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
udelay(10);
}
- if (tg3_flag(tp, ENABLE_APE))
- tp->mac_mode = MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
- else
- tp->mac_mode = 0;
tp->mac_mode |= MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE |
- MAC_MODE_TDE_ENABLE | MAC_MODE_RDE_ENABLE | MAC_MODE_FHDE_ENABLE;
+ MAC_MODE_TDE_ENABLE | MAC_MODE_RDE_ENABLE |
+ MAC_MODE_FHDE_ENABLE;
+ if (tg3_flag(tp, ENABLE_APE))
+ tp->mac_mode |= MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
if (!tg3_flag(tp, 5705_PLUS) &&
!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700)
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 6/8] tg3: Fix int selftest for recent devices.
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch fixes interrupt selftest failures for recent devices (57765,
5717, 5718. 5719, 5720) by disabling MSI one-shot mode and applying the
status tag workaround to the selftest code.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e5c1bc9..f2b0839 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9183,7 +9183,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
* Turn off MSI one shot mode. Otherwise this test has no
* observable way to know whether the interrupt was delivered.
*/
- if (tg3_flag(tp, 57765_PLUS) && tg3_flag(tp, USING_MSI)) {
+ if (tg3_flag(tp, 57765_PLUS)) {
val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
tw32(MSGINT_MODE, val);
}
@@ -9211,6 +9211,10 @@ static int tg3_test_interrupt(struct tg3 *tp)
break;
}
+ if (tg3_flag(tp, 57765_PLUS) &&
+ tnapi->hw_status->status_tag != tnapi->last_tag)
+ tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24);
+
msleep(10);
}
@@ -9225,7 +9229,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
if (intr_ok) {
/* Reenable MSI one shot mode. */
- if (tg3_flag(tp, 57765_PLUS) && tg3_flag(tp, USING_MSI)) {
+ if (tg3_flag(tp, 57765_PLUS)) {
val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
tw32(MSGINT_MODE, val);
}
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 5/8] tg3: Fix RSS indirection table distribution
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
The current RSS indirection table is populated such that more traffic
will hit the first RSS ring. This patch adjusts the indirection table
so that the load is more evenly distributed.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 5110ea0..e5c1bc9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8723,15 +8723,24 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
udelay(100);
if (tg3_flag(tp, ENABLE_RSS)) {
+ int i = 0;
u32 reg = MAC_RSS_INDIR_TBL_0;
- u8 *ent = (u8 *)&val;
- /* Setup the indirection table */
- for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++) {
- int idx = i % sizeof(val);
+ if (tp->irq_cnt == 2) {
+ for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i += 8) {
+ tw32(reg, 0x0);
+ reg += 4;
+ }
+ } else {
+ u32 val;
- ent[idx] = i % (tp->irq_cnt - 1);
- if (idx == sizeof(val) - 1) {
+ while (i < TG3_RSS_INDIR_TBL_SIZE) {
+ val = i % (tp->irq_cnt - 1);
+ i++;
+ for (; i % 8; i++) {
+ val <<= 4;
+ val |= (i % (tp->irq_cnt - 1));
+ }
tw32(reg, val);
reg += 4;
}
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 4/8] tg3: Add 5719 and 5720 to EEE_CAP list
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch adds the 5719 and the 5720 to the list of devices that are
EEE capable.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e0413bc..5110ea0 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -13142,7 +13142,9 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
}
if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
- ((tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 &&
+ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
+ (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 &&
tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) ||
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
tp->pci_chip_rev_id != CHIPREV_ID_57765_A0)))
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 0/8] tg3: Misc bugfixes
From: Matt Carlson @ 2011-07-20 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patchset fixes a few random tg3 bugs.
^ permalink raw reply
* [PATCH] net: vlan: fix compile breakage from 69ecca8
From: David Lamparter @ 2011-07-20 19:43 UTC (permalink / raw)
Cc: Stephen Rothwell, netdev, linux-next, linux-kernel,
David Lamparter, linux-driver, Anirban Chakraborty,
David S. Miller, Randy Dunlap
In-Reply-To: <0E5EAE44-204C-4F4D-926C-F4D973B0CDB1@qlogic.com>
well, there was too much wood to see the tree and I messed up the
configuration dependencies. let's make it work with unset
CONFIG_VLAN_8021Q and remove the second definition of vlan_find_dev.
Signed-off-by: David Lamparter <equinox@diac24.net>
Cc: linux-driver@qlogic.com
Cc: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Randy Dunlap <rdunlap@xenotime.net>
---
sorry for the mess-up... compiled with CONFIG_VLAN_8021Q=n,m and y
this time; don't have qlcnic hw to test.
drivers/net/qlcnic/qlcnic_main.c | 4 +++-
include/linux/if_vlan.h | 5 -----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 3579229..a2c39e9 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -4198,13 +4198,15 @@ static void
qlcnic_restore_indev_addr(struct net_device *netdev, unsigned long event)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
- struct vlan_group *grp;
+ struct vlan_group *grp = NULL;
struct net_device *dev;
u16 vid;
qlcnic_config_indev_addr(adapter, netdev, event);
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
grp = rcu_dereference_rtnl(netdev->vlgrp);
+#endif
if (!grp)
return;
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index bc03e40..dbe41dc 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -135,11 +135,6 @@ vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
unsigned int vlan_tci);
#else
-static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
- u16 vlan_id)
-{
- return NULL;
-}
static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
{
--
1.7.5.3
^ permalink raw reply related
* icmp_route_lookup returns wrong source address information
From: Florian Westphal @ 2011-07-20 19:22 UTC (permalink / raw)
To: davem; +Cc: netdev
Hello David,
With linux-2.6 and net-next trees, whenever an icmp error message is
sent in response to a to-be-forwarded packet, the destination address
of the original packet is used as the IP header source address.
Example:
$ traceroute breakpoint.cc
traceroute to breakpoint.cc (85.10.199.196), 30 hops max, 40 byte packets
1 chamillionaire.breakpoint.cc (85.10.199.196) 0.476 ms 0.468 ms 0.793 ms
But the expected 1st hop is 192.168.20.7 in my setup.
I bisected this down to 77968b78242ee25e2a4d759f0fca8dd52df6d479
("ipv4: Pass flow keys down into datagram packet building engine.")
Specifically, it is caused by this hunk:
-static struct rtable *icmp_route_lookup(struct net *net, struct sk_buff *skb_in,
+static struct rtable *icmp_route_lookup(struct net *net,
+ struct flowi4 *fl4,
[..]
{
- struct flowi4 fl4 = {
- .daddr = (param->replyopts.opt.opt.srr ?
- param->replyopts.opt.opt.faddr : iph->saddr),
- .saddr = saddr,
- .flowi4_tos = RT_TOS(tos),
- .flowi4_proto = IPPROTO_ICMP,
- .fl4_icmp_type = type,
- .fl4_icmp_code = code,
- };
struct rtable *rt, *rt2;
int err;
[..]
- err = xfrm_decode_session_reverse(skb_in, flowi4_to_flowi(&fl4), AF_INET);
+ err = xfrm_decode_session_reverse(skb_in, flowi4_to_flowi(fl4), AF_INET);
if (err)
goto relookup_failed;
Problem is that xfrm_decode_session_reverse() may rebuild fl4 from scratch.
In my setup, "goto relookup_failed" will be hit a bit later on, and fl4->saddr will
be set to iph->daddr...
Thanks,
Florian
^ permalink raw reply
* Re: NIC driver r8168 with r8169 for RTL8111/8168B and DGE-528T together
From: Stephen Hemminger @ 2011-07-20 19:22 UTC (permalink / raw)
To: Danie Wessels; +Cc: netdev
In-Reply-To: <4E26B198.4020606@telkomsa.net>
On Wed, 20 Jul 2011 12:44:40 +0200
Danie Wessels <dawessels@telkomsa.net> wrote:
> I would like to use my onboard NIC (eth0) with its r8168 driver from
> RealTek together with my D-Link NIC (eth4=eth1) with its r8169 default
> driver from the install.
The kernel developers do not support the use of out of tree
vendor drivers. If there is some reason the default kernel driver does
not work for your hardware, that is a bug that should be reported and
it will get fixed.
^ permalink raw reply
* Re: [patch net-next-2.6 37/47] igb: do vlan cleanup
From: Jiri Pirko @ 2011-07-20 19:10 UTC (permalink / raw)
To: Jesse Gross
Cc: e1000-devel, netdev, bruce.w.allan, jesse.brandeburg, mirqus,
john.ronciak, shemminger, davem
In-Reply-To: <CAEP_g=_0Ej09+KYbvEJz1+joYtms+S_67XSVVPMoG_hfJnmrBQ@mail.gmail.com>
Wed, Jul 20, 2011 at 07:35:33PM CEST, jesse@nicira.com wrote:
>On Wed, Jul 20, 2011 at 7:54 AM, Jiri Pirko <jpirko@redhat.com> wrote:
>> @@ -2943,7 +2944,7 @@ static void igb_rlpml_set(struct igb_adapter *adapter)
>> struct e1000_hw *hw = &adapter->hw;
>> u16 pf_id = adapter->vfs_allocated_count;
>>
>> - if (adapter->vlgrp)
>> + if (igb_vlan_used(adapter))
>> max_frame_size += VLAN_TAG_SIZE;
>
>There are similar issues here as with the VF driver. I think you're
>also confusing vlan acceleration with vlan filtering. If no vlan
>filters are in use but the card is in promiscuous mode, the buffer
>will be undersized and we lose tagged packets.
I'm certainly not confusing vlan accel and filtering. Here is the
intension is the behaviour remains intact as well. I believe it's true.
>
>> +static void igb_vlan_mode(struct net_device *netdev, bool vlan_on)
>> {
>> struct igb_adapter *adapter = netdev_priv(netdev);
>> struct e1000_hw *hw = &adapter->hw;
>> u32 ctrl, rctl;
>>
>> igb_irq_disable(adapter);
>> - adapter->vlgrp = grp;
>>
>> - if (grp) {
>> + if (vlan_on) {
>> /* enable VLAN tag insert/strip */
>
>This should be controlled by ethtool, not by whether vlan filters are
>enabled. Essentially, with this, you are recreating the logic of the
>old vlan model in the new one.
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [patch net-next-2.6 35/47] e1000: do vlan cleanup
From: Jiri Pirko @ 2011-07-20 19:08 UTC (permalink / raw)
To: Jesse Gross
Cc: e1000-devel, netdev, bruce.w.allan, jesse.brandeburg, mirqus,
john.ronciak, shemminger, davem
In-Reply-To: <CAEP_g=-XJaq6KSwXXUzeFcqAo3WVWHCLyuqGYjcriRQiKO56bw@mail.gmail.com>
Wed, Jul 20, 2011 at 07:48:32PM CEST, jesse@nicira.com wrote:
>On Wed, Jul 20, 2011 at 7:54 AM, Jiri Pirko <jpirko@redhat.com> wrote:
>> @@ -4532,9 +4539,8 @@ static void e1000_vlan_rx_register(struct net_device *netdev,
>>
>> if (!test_bit(__E1000_DOWN, &adapter->flags))
>> e1000_irq_disable(adapter);
>> - adapter->vlgrp = grp;
>>
>> - if (grp) {
>> + if (vlan_on) {
>> /* enable VLAN tag insert/strip */
>> ctrl = er32(CTRL);
>> ctrl |= E1000_CTRL_VME;
>
>Same comment here as with the igb driver.
The driver behaviour remains intact here.
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [patch net-next-2.6 18/47] igbvf: do vlan cleanup
From: Jiri Pirko @ 2011-07-20 19:07 UTC (permalink / raw)
To: Jesse Gross
Cc: e1000-devel, netdev, bruce.w.allan, jesse.brandeburg, mirqus,
john.ronciak, shemminger, davem
In-Reply-To: <CAEP_g=9D5CEUG7AVxoyW6Q0NUEaQ+vE3g+SPdU677Y+s65JRiA@mail.gmail.com>
Wed, Jul 20, 2011 at 07:26:14PM CEST, jesse@nicira.com wrote:
>On Wed, Jul 20, 2011 at 7:54 AM, Jiri Pirko <jpirko@redhat.com> wrote:
>> @@ -1170,19 +1170,28 @@ static void igbvf_set_rlpml(struct igbvf_adapter *adapter)
>> int max_frame_size = adapter->max_frame_size;
>> struct e1000_hw *hw = &adapter->hw;
>>
>> - if (adapter->vlgrp)
>> + if (adapter->netdev->features & NETIF_F_HW_VLAN_RX)
>> max_frame_size += VLAN_TAG_SIZE;
>
>This is unconditionally true, right? NETIF_F_HW_VLAN_RX never gets
>toggled here. In any case, I think we should be able to handle vlan
>tagged packets even if stripping isn't enabled.
You are correct. This should be checked rather if any bit of
adapter->active_vlans is set. I'll repost soon.
>
>The Intel guys have expressed some concerns in the past about the MTU
>in relation to the igb driver (the PF version) with vlan tags. I'm
>not quite sure what about this NIC is different from others in the
>handling of MTU and vlans but here's one such thread:
>http://patchwork.ozlabs.org/patch/82675/
The intension is to make driver to bahave the same as before this patch.
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [patch net-next-2.6 04/47] nes: do vlan cleanup
From: Jiri Pirko @ 2011-07-20 19:00 UTC (permalink / raw)
To: Michał Mirosław
Cc: netdev, davem, shemminger, eric.dumazet, greearb, faisal.latif
In-Reply-To: <CAHXqBFJ3ERvHTcJcJLOGSGeYGbnE9XaRu7Dm_dRjAmR4PYq+VA@mail.gmail.com>
Wed, Jul 20, 2011 at 06:01:09PM CEST, mirqus@gmail.com wrote:
>W dniu 20 lipca 2011 17:45 użytkownik Michał Mirosław
><mirqus@gmail.com> napisał:
>> 2011/7/20 Jiri Pirko <jpirko@redhat.com>:
>>> - unify vlan and nonvlan rx path
>>> - kill nesvnic->vlan_grp and nes_netdev_vlan_rx_register
>>> - allow to turn on/off rx/tx vlan accel via ethtool (set_features)
>> [...]
>>> /**
>>> @@ -1656,7 +1679,7 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
>>> netdev->ethtool_ops = &nes_ethtool_ops;
>>> netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
>>> nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
>>> - netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
>>> + netdev->features |= NETIF_F_HW_VLAN_TX;
>> Just remove this line - nes_fix_features() is controlling the flag anyway.
>
>Forget it - it's good.
>
>I need to think about calling ndo_set_features callback at end of
>register_netdev() so the drivers won't need to duplicate the
>call/configuration in their ndo_init.
Yep, this came up to my thinking as well.
>
>Best Regards,
>Michał Mirosław
^ permalink raw reply
* Re: [PATCH] vhost: clean up outstanding buffers before setting vring
From: Shirley Ma @ 2011-07-20 18:12 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: David Miller, netdev, jasowang
In-Reply-To: <20110720104131.GB5164@redhat.com>
On Wed, 2011-07-20 at 13:41 +0300, Michael S. Tsirkin wrote:
> On Tue, Jul 19, 2011 at 01:50:53PM -0700, Shirley Ma wrote:
> > On Tue, 2011-07-19 at 22:49 +0300, Michael S. Tsirkin wrote:
> > > On Tue, Jul 19, 2011 at 11:02:26AM -0700, Shirley Ma wrote:
> > > > The outstanding DMA buffers need to be clean up before setting
> vring
> > > in
> > > > vhost. Otherwise the vring would be out of sync.
> > > >
> > > > Signed-off-by: Shirley Ma<xma@us.ibm.com>
> > >
> > > I suspect what is missing is calling
> > > vhost_zerocopy_signal_used then?
> > >
> > > If yes we probably should do it after
> > > changing the backend, not on vring set.
> >
> > I think vhost_zerocopy_signal_used might not be sufficient.
>
> If not, I'd like to understand what the root cause of
> the problem is.
>
> > But we can
> > test it out by remove/reloading the guest virtio_net module.
>
> Well, try out something like the below patch then.
>From the test results, below patch solves the problem. You can check in
this.
> >
> > The problem encounters when guest rmmod virtio_net module, then
> reload
> > the module, and configure the interface, it complains about some
> ring id
> > is not a head.
>
> OK, good, such a problem decription belongs in the patch commit log.
You can add this description in the change log. When removing and
reloading KVM guest virtio_net module, it complains vring data is NULL.
The vring is out of sync between vhost and virtio_net.
> > With this patch, the problem is solved.
>
> Additional info you want to put in the commit log is what in the code
> triggers the problem and how your patch fixes it.
>
> > >
> > > > +
> > > > + /* Signal guest as appropriate. */
> > > > + vhost_zerocopy_signal_used(vq);
> > > >
> > > > switch (ioctl) {
> > > > case VHOST_SET_VRING_NUM:
> > > > @@ -1592,7 +1600,6 @@ void vhost_ubuf_put_and_wait(struct
> > > vhost_ubuf_ref *ubufs)
> > > > {
> > > > kref_put(&ubufs->kref, vhost_zerocopy_done_signal);
> > > > wait_event(ubufs->wait, !
> atomic_read(&ubufs->kref.refcount));
> > > > - kfree(ubufs);
> > >
> > > Won't this leak memory when ubufs are switched in
> > > vhost_net_set_backend?
> >
> > Right, I forgot to check net.c, whenever it calls
> > vhot_ubuf_put_and_wait, it should call kfree(ubufs).
> >
>
> -->
>
> vhost-net: update used ring on backend change
>
> On backend change, we flushed out outstanding skbs
> but forgot to update the used ring. Do that to
> avoid losing heads.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> --
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 70ac604..248b250 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -711,8 +711,12 @@ static long vhost_net_set_backend(struct
> vhost_net *n, unsigned index, int fd)
>
> mutex_unlock(&vq->mutex);
>
> - if (oldubufs)
> + if (oldubufs) {
> vhost_ubuf_put_and_wait(oldubufs);
> + mutex_lock(&vq->mutex);
> + vhost_zerocopy_signal_used(vq);
> + mutex_unlock(&vq->mutex);
> + }
>
> if (oldsock) {
> vhost_net_flush_vq(n, index);
>
>
^ permalink raw reply
* Re: linux-next: Tree for July 20 (qlcnic)
From: Anirban Chakraborty @ 2011-07-20 18:10 UTC (permalink / raw)
To: Randy Dunlap
Cc: Stephen Rothwell, netdev, linux-next@vger.kernel.org,
linux-kernel, Linux Driver, David Lamparter
In-Reply-To: <20110720091945.39f0a8a5.rdunlap@xenotime.net>
On Jul 20, 2011, at 9:19 AM, Randy Dunlap wrote:
> On Wed, 20 Jul 2011 18:00:41 +1000 Stephen Rothwell wrote:
>
>> Hi all,
>
> When CONFIG_VLAN_8021Q is not enabled:
>
> drivers/net/qlcnic/qlcnic_main.c:4207: error: 'struct net_device' has no member named 'vlgrp'
This is caused by the following commit:
commit 69ecca86da4890c13a5e29c51b4ac76a1a8a62c9
Refs: v3.0-rc7-1265-g69ecca8
Author: David Lamparter <equinox@diac24.net>
AuthorDate: Sun Jul 17 08:53:12 2011 +0000
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Sun Jul 17 12:33:22 2011 -0700
net: vlan, qlcnic: make vlan_find_dev private
there is only one user of vlan_find_dev outside of the actual vlan code:
qlcnic uses it to iterate over some VLANs it knows.
let's just make vlan_find_dev private to the VLAN code and have the
iteration in qlcnic be a bit more direct. (a few rcu dereferences less
too)
Signed-off-by: David Lamparter <equinox@diac24.net>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Amit Kumar Salecha <amit.salecha@qlogic.com>
Cc: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Cc: linux-driver@qlogic.com
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: 3.0.0rc6: ethtool not working without a cable
From: Arkadiusz Miskiewicz @ 2011-07-20 17:57 UTC (permalink / raw)
To: Brandeburg, Jesse; +Cc: Ben Hutchings, netdev@vger.kernel.org
In-Reply-To: <alpine.WNT.2.00.1107201050450.1084@JBRANDEB-DESK2.amr.corp.intel.com>
On Wednesday 20 of July 2011, Brandeburg, Jesse wrote:
> On Wed, 6 Jul 2011, Arkadiusz Miskiewicz wrote:
> > On Wednesday 06 of July 2011, Ben Hutchings wrote:
> > > > If there is no cable then ethtool reports no device. It wasn't that
> > > > before AFAIK.
> > > >
> > > > ethtool version 2.6.36
> > > >
> > > >
> > > > cable disconnected:
> > > >
> > > > [root@t400 ~]# ethtool eth0
> > > > Settings for eth0:
> > > > Cannot get device settings: No such device
> > > > Cannot get wake-on-lan settings: No such device
> > > > Cannot get message level: No such device
> > > > Cannot get link status: No such device
> > > > No data available
> > > > zsh: exit 75 ethtool eth0
> > > > [root@t400 ~]# ethtool -i eth0
> > > > Cannot get driver information: No such device
> > > > zsh: exit 71 ethtool -i eth0
>
> please check lspci -vvv on your device when cable is unplugged. I'm
> wondering if OSPM (os power management) is kicking in (if enabled in your
> kernel) and somehow interacting badly with ethtool.
>
> if the device is in D3, then most ethtool stuff won't work, since all the
> registers in the device (except in config space) don't work when in D3.
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network
Connection (rev 03)
Subsystem: Lenovo Device 20ee
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 20
Region 0: Memory at fc000000 (32-bit, non-prefetchable) [disabled]
[size=128K]
Region 1: Memory at fc025000 (32-bit, non-prefetchable) [disabled]
[size=4K]
Region 2: I/O ports at 1840 [disabled] [size=32]
Capabilities: [c8] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D3 NoSoftRst- PME-Enable+ DSel=0 DScale=1 PME-
Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
Address: 00000000fee0300c Data: 41c5
Capabilities: [e0] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus: TP-
Kernel driver in use: e1000e
Kernel modules: e1000e
--
Arkadiusz Miśkiewicz PLD/Linux Team
arekm / maven.pl http://ftp.pld-linux.org/
^ permalink raw reply
* Re: 3.0.0rc6: ethtool not working without a cable
From: Brandeburg, Jesse @ 2011-07-20 17:53 UTC (permalink / raw)
To: Arkadiusz Miskiewicz; +Cc: Ben Hutchings, netdev@vger.kernel.org
In-Reply-To: <201107061653.04689.a.miskiewicz@gmail.com>
On Wed, 6 Jul 2011, Arkadiusz Miskiewicz wrote:
> On Wednesday 06 of July 2011, Ben Hutchings wrote:
> > > If there is no cable then ethtool reports no device. It wasn't that
> > > before AFAIK.
> > >
> > > ethtool version 2.6.36
> > >
> > >
> > > cable disconnected:
> > >
> > > [root@t400 ~]# ethtool eth0
> > > Settings for eth0:
> > > Cannot get device settings: No such device
> > > Cannot get wake-on-lan settings: No such device
> > > Cannot get message level: No such device
> > > Cannot get link status: No such device
> > > No data available
> > > zsh: exit 75 ethtool eth0
> > > [root@t400 ~]# ethtool -i eth0
> > > Cannot get driver information: No such device
> > > zsh: exit 71 ethtool -i eth0
please check lspci -vvv on your device when cable is unplugged. I'm
wondering if OSPM (os power management) is kicking in (if enabled in your
kernel) and somehow interacting badly with ethtool.
if the device is in D3, then most ethtool stuff won't work, since all the
registers in the device (except in config space) don't work when in D3.
^ permalink raw reply
* Re: [patch net-next-2.6 35/47] e1000: do vlan cleanup
From: Jesse Gross @ 2011-07-20 17:48 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, shemminger, eric.dumazet, greearb, mirqus,
jeffrey.t.kirsher, jesse.brandeburg, peter.p.waskiewicz.jr,
bruce.w.allan, carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
alexander.h.duyck, john.ronciak, e1000-devel
In-Reply-To: <1311173689-17419-36-git-send-email-jpirko@redhat.com>
On Wed, Jul 20, 2011 at 7:54 AM, Jiri Pirko <jpirko@redhat.com> wrote:
> @@ -4532,9 +4539,8 @@ static void e1000_vlan_rx_register(struct net_device *netdev,
>
> if (!test_bit(__E1000_DOWN, &adapter->flags))
> e1000_irq_disable(adapter);
> - adapter->vlgrp = grp;
>
> - if (grp) {
> + if (vlan_on) {
> /* enable VLAN tag insert/strip */
> ctrl = er32(CTRL);
> ctrl |= E1000_CTRL_VME;
Same comment here as with the igb driver.
^ permalink raw reply
* Re: [patch net-next-2.6 37/47] igb: do vlan cleanup
From: Jesse Gross @ 2011-07-20 17:35 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, shemminger, eric.dumazet, greearb, mirqus,
jeffrey.t.kirsher, jesse.brandeburg, peter.p.waskiewicz.jr,
bruce.w.allan, carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
alexander.h.duyck, john.ronciak, e1000-devel
In-Reply-To: <1311173689-17419-38-git-send-email-jpirko@redhat.com>
On Wed, Jul 20, 2011 at 7:54 AM, Jiri Pirko <jpirko@redhat.com> wrote:
> @@ -2943,7 +2944,7 @@ static void igb_rlpml_set(struct igb_adapter *adapter)
> struct e1000_hw *hw = &adapter->hw;
> u16 pf_id = adapter->vfs_allocated_count;
>
> - if (adapter->vlgrp)
> + if (igb_vlan_used(adapter))
> max_frame_size += VLAN_TAG_SIZE;
There are similar issues here as with the VF driver. I think you're
also confusing vlan acceleration with vlan filtering. If no vlan
filters are in use but the card is in promiscuous mode, the buffer
will be undersized and we lose tagged packets.
> +static void igb_vlan_mode(struct net_device *netdev, bool vlan_on)
> {
> struct igb_adapter *adapter = netdev_priv(netdev);
> struct e1000_hw *hw = &adapter->hw;
> u32 ctrl, rctl;
>
> igb_irq_disable(adapter);
> - adapter->vlgrp = grp;
>
> - if (grp) {
> + if (vlan_on) {
> /* enable VLAN tag insert/strip */
This should be controlled by ethtool, not by whether vlan filters are
enabled. Essentially, with this, you are recreating the logic of the
old vlan model in the new one.
^ permalink raw reply
* Re: [patch net-next-2.6 18/47] igbvf: do vlan cleanup
From: Jesse Gross @ 2011-07-20 17:26 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, shemminger, eric.dumazet, greearb, mirqus,
jeffrey.t.kirsher, jesse.brandeburg, peter.p.waskiewicz.jr,
bruce.w.allan, carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
alexander.h.duyck, john.ronciak, e1000-devel
In-Reply-To: <1311173689-17419-19-git-send-email-jpirko@redhat.com>
On Wed, Jul 20, 2011 at 7:54 AM, Jiri Pirko <jpirko@redhat.com> wrote:
> @@ -1170,19 +1170,28 @@ static void igbvf_set_rlpml(struct igbvf_adapter *adapter)
> int max_frame_size = adapter->max_frame_size;
> struct e1000_hw *hw = &adapter->hw;
>
> - if (adapter->vlgrp)
> + if (adapter->netdev->features & NETIF_F_HW_VLAN_RX)
> max_frame_size += VLAN_TAG_SIZE;
This is unconditionally true, right? NETIF_F_HW_VLAN_RX never gets
toggled here. In any case, I think we should be able to handle vlan
tagged packets even if stripping isn't enabled.
The Intel guys have expressed some concerns in the past about the MTU
in relation to the igb driver (the PF version) with vlan tags. I'm
not quite sure what about this NIC is different from others in the
handling of MTU and vlans but here's one such thread:
http://patchwork.ozlabs.org/patch/82675/
^ permalink raw reply
* [PATCH V2] vhost: fix check for # of outstanding buffers
From: Shirley Ma @ 2011-07-20 17:23 UTC (permalink / raw)
To: mst; +Cc: David Miller, netdev, jasowang
Fix the check for number of outstanding buffers returns incorrect
results due to vq->pend_idx wrap around;
Signed-off-by: Shirley Ma <xma@us.ibm.com>
---
drivers/vhost/net.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 70ac604..946a71e 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -182,15 +182,21 @@ static void handle_tx(struct vhost_net *net)
break;
/* Nothing new? Wait for eventfd to tell us they refilled. */
if (head == vq->num) {
+ int num_pends;
+
wmem = atomic_read(&sock->sk->sk_wmem_alloc);
if (wmem >= sock->sk->sk_sndbuf * 3 / 4) {
tx_poll_start(net, sock);
set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
break;
}
- /* If more outstanding DMAs, queue the work */
- if (unlikely(vq->upend_idx - vq->done_idx >
- VHOST_MAX_PEND)) {
+ /* If more outstanding DMAs, queue the work
+ * handle upend_idx wrap around
+ */
+ num_pends = (vq->upend_idx >= vq->done_idx) ?
+ (vq->upend_idx - vq->done_idx) :
+ (vq->upend_idx + UIO_MAXIOV - vq->done_idx);
+ if (unlikely(num_pends > VHOST_MAX_PEND)) {
tx_poll_start(net, sock);
set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
break;
^ permalink raw reply related
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