* [PATCH net-next] be2net: fix vfs enumeration
From: Ivan Vecera @ 2012-09-25 12:50 UTC (permalink / raw)
To: netdev; +Cc: sathya.perla, ajit.khaparde
Current VFs enumeration algorithm used in be_find_vfs does not take domain
number into the match. The match found in igb/ixgbe is more elegant and
safe.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 84379f4..966d9af 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1076,7 +1076,7 @@ static int be_set_vf_tx_rate(struct net_device *netdev,
static int be_find_vfs(struct be_adapter *adapter, int vf_state)
{
struct pci_dev *dev, *pdev = adapter->pdev;
- int vfs = 0, assigned_vfs = 0, pos, vf_fn;
+ int vfs = 0, assigned_vfs = 0, pos;
u16 offset, stride;
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
@@ -1087,9 +1087,7 @@ static int be_find_vfs(struct be_adapter *adapter, int vf_state)
dev = pci_get_device(pdev->vendor, PCI_ANY_ID, NULL);
while (dev) {
- vf_fn = (pdev->devfn + offset + stride * vfs) & 0xFFFF;
- if (dev->is_virtfn && dev->devfn == vf_fn &&
- dev->bus->number == pdev->bus->number) {
+ if (dev->is_virtfn && dev->physfn == pdev) {
vfs++;
if (dev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
assigned_vfs++;
--
1.7.8.6
^ permalink raw reply related
* Re: bnx2x: link detected up at startup even when it should be down
From: Jean-Michel Hautbois @ 2012-09-25 12:22 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <504C9EFCA2D0054393414C9CB605C37F3086A3@SJEXCHMB06.corp.ad.broadcom.com>
2012/9/25 Dmitry Kravkov <dmitry@broadcom.com>:
>> -----Original Message-----
>> From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
>> Sent: Tuesday, September 25, 2012 10:11 AM
>> To: Dmitry Kravkov
>> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
>> Subject: Re: bnx2x: link detected up at startup even when it should be down
>>
>>
>> I have tested several things, and I added some traces in order to get
>> information.
>> For instance, I trace the load_code in the function named "bnx2x_nic_load".
>>
>> [ 25.693677] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load load_code=0x10130000
>> [ 25.693679] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load start period
>> [ 102.748934] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load load_code=0x10100000
>> [ 102.749065] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load start period
>> [ 104.007074] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load load_code=0x10120000
>> [ 104.007197] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load NOT start period
>> [ 104.423789] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load load_code=0x10120000
>> [ 104.423914] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load NOT start period
>> [ 104.836505] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load load_code=0x10120000
>> [ 104.836632] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load NOT start period
>> [ 105.254220] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load load_code=0x10120000
>> [ 105.254350] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load NOT start period
>> [ 105.667935] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load load_code=0x10120000
>> [ 105.668066] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load NOT start period
>> [ 106.081652] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load load_code=0x10120000
>> [ 106.081779] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load NOT start period
>>
>> This is a FlexNIC use.
>> Here is my (quick and dirty) patch which makes the link detection
>> working and adds the traces shown above :
>>
>> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>> index 580b44e..dedd810 100644
>> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>> @@ -1769,6 +1769,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>> */
>> if (!BP_NOMCP(bp)) {
>> load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ, 0);
>> +netdev_info(bp->dev, "bnx2x_nic_load bnx2x_fw_command
>> load_code=0x%08X\n",load_code);
>> if (!load_code) {
>> BNX2X_ERR("MCP response failure, aborting\n");
>> rc = -EBUSY;
>> @@ -1785,22 +1786,31 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>> DP(NETIF_MSG_IFUP, "NO MCP - load counts[%d] %d, %d, %d\n",
>> path, load_count[path][0], load_count[path][1],
>> load_count[path][2]);
>> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - load counts[%d]
>> %d, %d, %d\n",
>> + path, load_count[path][0], load_count[path][1],
>> + load_count[path][2]);
>> load_count[path][0]++;
>> load_count[path][1 + port]++;
>> DP(NETIF_MSG_IFUP, "NO MCP - new load counts[%d] %d, %d, %d\n",
>> path, load_count[path][0], load_count[path][1],
>> load_count[path][2]);
>> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - new load counts[%d]
>> %d, %d, %d\n",
>> + path, load_count[path][0], load_count[path][1],
>> + load_count[path][2]);
>> if (load_count[path][0] == 1)
>> load_code = FW_MSG_CODE_DRV_LOAD_COMMON;
>> else if (load_count[path][1 + port] == 1)
>> load_code = FW_MSG_CODE_DRV_LOAD_PORT;
>> else
>> load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION;
>> +netdev_info(bp->dev, "bnx2x_nic_load autre
>> load_code=0x%08X\n",load_code);
>> }
>>
>> +netdev_info(bp->dev, "bnx2x_nic_load load_code=0x%08X\n",load_code);
>> if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) ||
>> (load_code == FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) ||
>> - (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) {
>> + (load_code == FW_MSG_CODE_DRV_LOAD_PORT) ||
>> + (load_code == FW_MSG_CODE_DRV_LOAD_FUNCTION)) {
>> bp->port.pmf = 1;
>> /*
>> * We need the barrier to ensure the ordering between the
>> @@ -1808,9 +1818,13 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>> * bnx2x_periodic_task().
>> */
>> smp_mb();
>> +netdev_info(bp->dev, "bnx2x_nic_load start period\n");
>> queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
>> } else
>> +{
>> +netdev_info(bp->dev, "bnx2x_nic_load NOT start period\n");
>> bp->port.pmf = 0;
>> +}
>>
>> DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf);
>>
> Thanks Jean,
> But your output does not suit the patch.
Yes, you are right, here it is :
Sep 25 07:56:08 debian kernel: [ 26.607197] bnx2x 0000:04:00.0:
eth0: bnx2x_nic_load bnx2x_fw_command load_code=0x10130000
Sep 25 07:56:08 debian kernel: [ 26.608642] bnx2x 0000:04:00.0:
eth0: bnx2x_nic_load load_code=0x10130000
Sep 25 07:56:08 debian kernel: [ 26.608644] bnx2x 0000:04:00.0:
eth0: bnx2x_nic_load start period
Sep 25 07:57:20 debian kernel: [ 101.068231] bnx2x 0000:04:00.1:
eth1: bnx2x_nic_load bnx2x_fw_command load_code=0x10100000
Sep 25 07:57:20 debian kernel: [ 101.068416] bnx2x 0000:04:00.1:
eth1: bnx2x_nic_load load_code=0x10100000
Sep 25 07:57:20 debian kernel: [ 101.068533] bnx2x 0000:04:00.1:
eth1: bnx2x_nic_load start period
Sep 25 07:57:21 debian kernel: [ 102.294393] bnx2x 0000:04:00.2:
eth2: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
Sep 25 07:57:21 debian kernel: [ 102.294585] bnx2x 0000:04:00.2:
eth2: bnx2x_nic_load load_code=0x10120000
Sep 25 07:57:21 debian kernel: [ 102.294711] bnx2x 0000:04:00.2:
eth2: bnx2x_nic_load start period
Sep 25 07:57:22 debian kernel: [ 102.782057] bnx2x 0000:04:00.3:
eth3: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
Sep 25 07:57:22 debian kernel: [ 102.782240] bnx2x 0000:04:00.3:
eth3: bnx2x_nic_load load_code=0x10120000
Sep 25 07:57:22 debian kernel: [ 102.782359] bnx2x 0000:04:00.3:
eth3: bnx2x_nic_load start period
Sep 25 07:57:22 debian kernel: [ 103.265731] bnx2x 0000:04:00.4:
eth4: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
Sep 25 07:57:22 debian kernel: [ 103.265924] bnx2x 0000:04:00.4:
eth4: bnx2x_nic_load load_code=0x10120000
Sep 25 07:57:22 debian kernel: [ 103.266051] bnx2x 0000:04:00.4:
eth4: bnx2x_nic_load start period
Sep 25 07:57:23 debian kernel: [ 103.758390] bnx2x 0000:04:00.5:
eth5: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
Sep 25 07:57:23 debian kernel: [ 103.758583] bnx2x 0000:04:00.5:
eth5: bnx2x_nic_load load_code=0x10120000
Sep 25 07:57:23 debian kernel: [ 103.758711] bnx2x 0000:04:00.5:
eth5: bnx2x_nic_load start period
Sep 25 07:57:23 debian kernel: [ 104.252053] bnx2x 0000:04:00.6:
eth6: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
Sep 25 07:57:23 debian kernel: [ 104.252247] bnx2x 0000:04:00.6:
eth6: bnx2x_nic_load load_code=0x10120000
Sep 25 07:57:23 debian kernel: [ 104.252373] bnx2x 0000:04:00.6:
eth6: bnx2x_nic_load start period
Sep 25 07:57:24 debian kernel: [ 104.836655] bnx2x 0000:04:00.7:
eth7: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
Sep 25 07:57:24 debian kernel: [ 104.836849] bnx2x 0000:04:00.7:
eth7: bnx2x_nic_load load_code=0x10120000
Sep 25 07:57:24 debian kernel: [ 104.836976] bnx2x 0000:04:00.7:
eth7: bnx2x_nic_load start period
Sep 25 07:57:25 debian kernel: [ 106.145755] bnx2x 0000:04:00.1:
eth1: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
Sep 25 07:57:25 debian kernel: [ 106.145940] bnx2x 0000:04:00.1:
eth1: bnx2x_nic_load load_code=0x10120000
Sep 25 07:57:25 debian kernel: [ 106.146056] bnx2x 0000:04:00.1:
eth1: bnx2x_nic_load start period
> Your patch will start periodic for every instance, but printout show that it's started for PMF only (which is correct).
> Generally if all functions are marked as PMF (port management function) you will get into the problem accessing shared port resources, like phys and internal data structures, then configuration/data will be corrupted.
>
> Is it feasible to provide ethtool -i output and syslog when driver is loaded debug=0x4?
$> ethtool -i eth0
driver: bnx2x
version: 1.70.30-1
firmware-version: bc 7.0.49
bus-info: 0000:04:00.0
And msglvl set to 4 says this :
Sep 25 12:29:20 debian kernel: [16410.336897] bnx2x:
[bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
Sep 25 12:29:20 debian kernel: [16410.337215] bnx2x:
[bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
Sep 25 12:29:20 debian kernel: [16410.337511] bnx2x:
[bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
Sep 25 12:29:21 debian kernel: [16410.395363] bnx2x:
[bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
Sep 25 12:29:21 debian kernel: [16410.633207] bnx2x:
[bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
Sep 25 12:29:21 debian kernel: [16411.174842] bnx2x:
[bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
Sep 25 12:29:22 debian kernel: [16411.396739] bnx2x:
[bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
Sep 25 12:29:22 debian kernel: [16411.432249] bnx2x:
[bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
Sep 25 12:29:22 debian kernel: [16411.432566] bnx2x:
[bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
Sep 25 12:29:22 debian kernel: [16411.433348] bnx2x:
[bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
Sep 25 12:29:22 debian kernel: [16411.634797] bnx2x:
[bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
Sep 25 12:29:22 debian kernel: [16412.176170] bnx2x:
[bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
Sep 25 12:29:23 debian kernel: [16412.408747] bnx2x:
[bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
Sep 25 12:29:23 debian kernel: [16412.489861] bnx2x:
[bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
Sep 25 12:29:23 debian kernel: [16412.490182] bnx2x:
[bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
Sep 25 12:29:23 debian kernel: [16412.490505] bnx2x:
[bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
Sep 25 12:29:23 debian kernel: [16412.635849] bnx2x:
[bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
Sep 25 12:29:23 debian kernel: [16413.177496] bnx2x:
[bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
Sep 25 12:29:24 debian kernel: [16413.411329] bnx2x:
[bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
JM
^ permalink raw reply
* RE: removing the timer from cdc-ncm
From: Alexey ORISHKO @ 2012-09-25 11:18 UTC (permalink / raw)
To: Oliver Neukum
Cc: bjorn@mork.no, netdev@vger.kernel.org, linux-usb@vger.kernel.org
In-Reply-To: <6020948.EvS2esPpc0@linux-lqwf.site>
> -----Original Message-----
> From: Oliver Neukum [mailto:oneukum@suse.de]
>
> here is the patch that does everything I consider theoretically
> necessary to have bundling of frames in usbnet and adapting cdc-ncm to
> it.
>
> I'd appreciate any review in case I am doing something stupid.
>
I had a brief look at cdc_ncm and a few corrections needed:
- remove the following:
#include <linux/hrtimer.h>
...
/* Restart the timer, if amount of datagrams is less than given value */
#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3
#define CDC_NCM_TIMER_PENDING_CNT 2
#define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC)
...
In struct cdc_ncm_ctx {
...
struct hrtimer tx_timer;
struct tasklet_struct bh;
...
In cdc_ncm_unbind():
if (hrtimer_active(&ctx->tx_timer))
hrtimer_cancel(&ctx->tx_timer);
tasklet_kill(&ctx->bh);
I didn't have time to check the new logic for data path, but I've
tried to run it on Ubuntu 12.04.
Linux host got panic right after data path has been established
(i.e. connected to mobile network).
Regards,
Alexey
^ permalink raw reply
* RE: bnx2x: link detected up at startup even when it should be down
From: Dmitry Kravkov @ 2012-09-25 10:42 UTC (permalink / raw)
To: Jean-Michel Hautbois
Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <CAL8zT=gp5uZ-Q36=vw--j35txrnLRhguoiMHi8a1kzX=VC3nJg@mail.gmail.com>
> -----Original Message-----
> From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
> Sent: Tuesday, September 25, 2012 10:11 AM
> To: Dmitry Kravkov
> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
> Subject: Re: bnx2x: link detected up at startup even when it should be down
>
>
> I have tested several things, and I added some traces in order to get
> information.
> For instance, I trace the load_code in the function named "bnx2x_nic_load".
>
> [ 25.693677] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load load_code=0x10130000
> [ 25.693679] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load start period
> [ 102.748934] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load load_code=0x10100000
> [ 102.749065] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load start period
> [ 104.007074] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load load_code=0x10120000
> [ 104.007197] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load NOT start period
> [ 104.423789] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load load_code=0x10120000
> [ 104.423914] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load NOT start period
> [ 104.836505] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load load_code=0x10120000
> [ 104.836632] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load NOT start period
> [ 105.254220] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load load_code=0x10120000
> [ 105.254350] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load NOT start period
> [ 105.667935] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load load_code=0x10120000
> [ 105.668066] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load NOT start period
> [ 106.081652] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load load_code=0x10120000
> [ 106.081779] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load NOT start period
>
> This is a FlexNIC use.
> Here is my (quick and dirty) patch which makes the link detection
> working and adds the traces shown above :
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> index 580b44e..dedd810 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> @@ -1769,6 +1769,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
> */
> if (!BP_NOMCP(bp)) {
> load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ, 0);
> +netdev_info(bp->dev, "bnx2x_nic_load bnx2x_fw_command
> load_code=0x%08X\n",load_code);
> if (!load_code) {
> BNX2X_ERR("MCP response failure, aborting\n");
> rc = -EBUSY;
> @@ -1785,22 +1786,31 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
> DP(NETIF_MSG_IFUP, "NO MCP - load counts[%d] %d, %d, %d\n",
> path, load_count[path][0], load_count[path][1],
> load_count[path][2]);
> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - load counts[%d]
> %d, %d, %d\n",
> + path, load_count[path][0], load_count[path][1],
> + load_count[path][2]);
> load_count[path][0]++;
> load_count[path][1 + port]++;
> DP(NETIF_MSG_IFUP, "NO MCP - new load counts[%d] %d, %d, %d\n",
> path, load_count[path][0], load_count[path][1],
> load_count[path][2]);
> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - new load counts[%d]
> %d, %d, %d\n",
> + path, load_count[path][0], load_count[path][1],
> + load_count[path][2]);
> if (load_count[path][0] == 1)
> load_code = FW_MSG_CODE_DRV_LOAD_COMMON;
> else if (load_count[path][1 + port] == 1)
> load_code = FW_MSG_CODE_DRV_LOAD_PORT;
> else
> load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION;
> +netdev_info(bp->dev, "bnx2x_nic_load autre
> load_code=0x%08X\n",load_code);
> }
>
> +netdev_info(bp->dev, "bnx2x_nic_load load_code=0x%08X\n",load_code);
> if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) ||
> (load_code == FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) ||
> - (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) {
> + (load_code == FW_MSG_CODE_DRV_LOAD_PORT) ||
> + (load_code == FW_MSG_CODE_DRV_LOAD_FUNCTION)) {
> bp->port.pmf = 1;
> /*
> * We need the barrier to ensure the ordering between the
> @@ -1808,9 +1818,13 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
> * bnx2x_periodic_task().
> */
> smp_mb();
> +netdev_info(bp->dev, "bnx2x_nic_load start period\n");
> queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
> } else
> +{
> +netdev_info(bp->dev, "bnx2x_nic_load NOT start period\n");
> bp->port.pmf = 0;
> +}
>
> DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf);
>
Thanks Jean,
But your output does not suit the patch.
Your patch will start periodic for every instance, but printout show that it's started for PMF only (which is correct).
Generally if all functions are marked as PMF (port management function) you will get into the problem accessing shared port resources, like phys and internal data structures, then configuration/data will be corrupted.
Is it feasible to provide ethtool -i output and syslog when driver is loaded debug=0x4?
Thanks
^ permalink raw reply
* [PATCH] net: sh-eth: fix sleeping in atomic context
From: Guennadi Liakhovetski @ 2012-09-25 10:38 UTC (permalink / raw)
To: linux-sh; +Cc: Paul Mundt, netdev
The .ndo_get_stats() net-device operation can sleep, which leads on sh_eth
to the following BUG on the armadillo800eva board:
BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:867
in_atomic(): 1, irqs_disabled(): 0, pid: 561, name: rpc.statd
Backtrace:
[<c000bfa0>] (dump_backtrace+0x0/0x110) from [<c0276a44>] (dump_stack+0x18/0x1c)
r6:c0294118 r5:00000004 r4:c035e898 r3:60000013
[<c0276a2c>] (dump_stack+0x0/0x1c) from [<c0035c14>] (__might_sleep+0xec/0x10c)
[<c0035b28>] (__might_sleep+0x0/0x10c) from [<c019a918>] (__pm_runtime_resume+0x3c/0xac)
[<c019a8dc>] (__pm_runtime_resume+0x0/0xac) from [<c01b5a10>] (sh_eth_get_stats+0x24/0x180)
r6:c0294118 r5:de0c6400 r4:de0c6000 r3:c01b59ec
[<c01b59ec>] (sh_eth_get_stats+0x0/0x180) from [<c01f12e8>] (dev_get_stats+0x5c/0x84)
r6:c0294118 r5:de0c6000 r4:de1efad0 r3:c01b59ec
[<c01f128c>] (dev_get_stats+0x0/0x84) from [<c0202044>] (rtnl_fill_ifinfo+0x354/0x76c)
r6:00000000 r5:de0c6000 r4:de3df980 r3:00000334
[<c0201cf0>] (rtnl_fill_ifinfo+0x0/0x76c) from [<c0202554>] (rtnl_dump_ifinfo+0xf8/0x1a8)
[<c020245c>] (rtnl_dump_ifinfo+0x0/0x1a8) from [<c020a010>] (netlink_dump+0x58/0x1c0)
[<c0209fb8>] (netlink_dump+0x0/0x1c0) from [<c020a6f8>] (netlink_dump_start+0x108/0x144)
r7:de3a9e30 r6:de3bcd80 r5:de04f200 r4:de3a9e00
[<c020a5f0>] (netlink_dump_start+0x0/0x144) from [<c02036e4>] (rtnetlink_rcv_msg+0x160/0x2a0)
r8:c020245c r7:00000f40 r6:de1efd00 r5:de3de180 r4:de3da680
r3:de1efd00
[<c0203584>] (rtnetlink_rcv_msg+0x0/0x2a0) from [<c020b47c>] (netlink_rcv_skb+0x54/0xb8)
[<c020b428>] (netlink_rcv_skb+0x0/0xb8) from [<c0203578>] (rtnetlink_rcv+0x20/0x2c)
r6:de3a9e00 r5:de3de180 r4:de3de180 r3:c0203558
[<c0203558>] (rtnetlink_rcv+0x0/0x2c) from [<c020b1b4>] (netlink_unicast+0x14c/0x21c)
r4:de04f200 r3:c0203558
[<c020b068>] (netlink_unicast+0x0/0x21c) from [<c020bb4c>] (netlink_sendmsg+0x210/0x288)
r8:00000000 r7:de1efe78 r6:de1eff54 r5:de3a9e00 r4:de3de180
[<c020b93c>] (netlink_sendmsg+0x0/0x288) from [<c01e21e0>] (sock_sendmsg+0x9c/0xb8)
[<c01e2144>] (sock_sendmsg+0x0/0xb8) from [<c01e2904>] (sys_sendto+0xb8/0xdc)
r5:00000014 r4:de1efed4
[<c01e284c>] (sys_sendto+0x0/0xdc) from [<c0009120>] (ret_fast_syscall+0x0/0x30)
Remove sleeping functions from sh_eth_get_stats() to fix it.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
I'm not sure, whether this is the correct fix, i.e., whether this function
is guaranteed to be called on a resumed device, but at least this fixes
this specific issue in 3.6-rc7, but leaves another BUG open:
BUG: sleeping function called from invalid context at include/linux/kernel.h:207
in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper
Backtrace:
[<c00114e4>] (dump_backtrace+0x0/0x110) from [<c02b687c>] (dump_stack+0x18/0x1c)
r6:c03a7cf8 r5:00000000 r4:00000000 r3:60000113
[<c02b6864>] (dump_stack+0x0/0x1c) from [<c003d704>] (__might_sleep+0xec/0x10c)
[<c003d618>] (__might_sleep+0x0/0x10c) from [<c0015a84>] (do_alignment+0x29c/0x700)
[<c00157e8>] (do_alignment+0x0/0x700) from [<c00084b4>] (do_DataAbort+0x3c/0xa0)
[<c0008478>] (do_DataAbort+0x0/0xa0) from [<c000da18>] (__dabt_svc+0x38/0x60)
Exception stack(0xc03a7cf8 to 0xc03a7d40)
7ce0: dd385cc0 dd2937c2
7d00: 00000000 dd385cc0 dd385cc0 c03cf8c8 dd23c7c0 00000000 00000001 00000000
7d20: 00000001 c03a7db4 c03a7d50 c03a7d40 c027832c c0277eb8 60000113 ffffffff
r7:c03a7d2c r6:ffffffff r5:60000113 r4:c0277eb8
[<c0277e80>] (icmp_echo+0x0/0x70) from [<c027832c>] (icmp_rcv+0x144/0x16c)
[<c02781e8>] (icmp_rcv+0x0/0x16c) from [<c024e7f4>] (ip_local_deliver+0x104/0x1b8)
r6:c03cf8c8 r5:00000001 r4:dd385cc0 r3:c02781e8
[<c024e6f0>] (ip_local_deliver+0x0/0x1b8) from [<c024e6ac>] (ip_rcv+0x4c0/0x504)
r7:00000000 r6:0125010d r5:dd2937ae r4:dd385cc0
[<c024e1ec>] (ip_rcv+0x0/0x504) from [<c022eb7c>] (__netif_receive_skb+0x4cc/0x560)
r9:00200000 r8:00000000 r7:00000008 r6:c03af040 r5:dd0e2000
r4:c03ae5e0
[<c022e6b0>] (__netif_receive_skb+0x0/0x560) from [<c022ec88>] (process_backlog+0x78/0x12c)
[<c022ec10>] (process_backlog+0x0/0x12c) from [<c022efa4>] (net_rx_action+0x58/0x148)
[<c022ef4c>] (net_rx_action+0x0/0x148) from [<c00211f4>] (__do_softirq+0x88/0x140)
[<c002116c>] (__do_softirq+0x0/0x140) from [<c002144c>] (irq_exit+0x4c/0x70)
[<c0021400>] (irq_exit+0x0/0x70) from [<c000e670>] (handle_IRQ+0x6c/0x8c)
[<c000e604>] (handle_IRQ+0x0/0x8c) from [<c00081d0>] (asm_do_IRQ+0x10/0x14)
r5:60000013 r4:c000e8c0
[<c00081c0>] (asm_do_IRQ+0x0/0x14) from [<c0016de8>] (shmobile_handle_irq_intc+0x8/0x40)
Exception stack(0xc03a7f38 to 0xc03a7f80)
7f20: 00000000 00000000
7f40: 00000000 00000000 c03a6000 ffffffff c039d3d0 7fffffff 40004059 412fc093
7f60: 00000000 c03a7f8c c03a7f90 c03a7f80 c000e8bc c000e8c0 60000013 ffffffff
[<c000e894>] (default_idle+0x0/0x34) from [<c000ee78>] (cpu_idle+0x58/0x9c)
[<c000ee20>] (cpu_idle+0x0/0x9c) from [<c02b22b4>] (rest_init+0x78/0x90)
r4:c03a6000 r3:c02bac68
[<c02b223c>] (rest_init+0x0/0x90) from [<c0383874>] (start_kernel+0x248/0x288)
r4:c03ae0ec r3:c03bff40
[<c038362c>] (start_kernel+0x0/0x288) from [<40008040>] (0x40008040)
drivers/net/ethernet/renesas/sh_eth.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index bad8f2e..512c7cb 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1809,8 +1809,6 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
- pm_runtime_get_sync(&mdp->pdev->dev);
-
ndev->stats.tx_dropped += sh_eth_read(ndev, TROCR);
sh_eth_write(ndev, 0, TROCR); /* (write clear) */
ndev->stats.collisions += sh_eth_read(ndev, CDCR);
@@ -1826,7 +1824,6 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev)
ndev->stats.tx_carrier_errors += sh_eth_read(ndev, CNDCR);
sh_eth_write(ndev, 0, CNDCR); /* (write clear) */
}
- pm_runtime_put_sync(&mdp->pdev->dev);
return &ndev->stats;
}
--
1.7.2.5
^ permalink raw reply related
* [PATCH] ipv6: del unreachable route when an addr is deleted on lo
From: Nicolas Dichtel @ 2012-09-25 10:24 UTC (permalink / raw)
To: netdev, yoshfuji, davem; +Cc: Nicolas Dichtel
When an address is added on loopback (ip -6 a a 2002::1/128 dev lo), two routes
are added:
- one in the local table:
local 2002::1 via :: dev lo proto none metric 0
- one the in main table (for the prefix):
unreachable 2002::1 dev lo proto kernel metric 256 error -101
When the address is deleted, the route inserted in the main table remains
because we use rt6_lookup(), which returns NULL when dst->error is set, which
is the case here! Thus, it is better to use ip6_route_lookup() to avoid this
kind of filter.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
net/ipv6/addrconf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 6bc85f7..b6b2f9f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -788,8 +788,12 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
struct in6_addr prefix;
struct rt6_info *rt;
struct net *net = dev_net(ifp->idev->dev);
+ struct flowi6 fl6 = {};
ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
- rt = rt6_lookup(net, &prefix, NULL, ifp->idev->dev->ifindex, 1);
+ fl6.flowi6_oif = ifp->idev->dev->ifindex;
+ fl6.daddr = prefix;
+ rt = (struct rt6_info *)ip6_route_lookup(net, &fl6,
+ RT6_LOOKUP_F_IFACE);
if (rt && addrconf_is_prefix_route(rt)) {
if (onlink == 0) {
--
1.7.12
^ permalink raw reply related
* bridge igmp snooping implementation
From: Felix Fietkau @ 2012-09-25 10:18 UTC (permalink / raw)
To: netdev; +Cc: Herbert Xu
Hi,
I'v been looking at the bridge IGMP snooping code and I noticed that it
appears to not keep track of multicast group member IP addresses. Is
this intentional?
It seems to me that this would lead to issues when multiple members of
the same multicast group are behind the same bridge port, and one of
them leaves.
I'm currently looking into adding a feature that allows bridge ports to
be configured to selectively turn multicast traffic into unicast
traffic. For this I would need to change the code to keep track of
member IP and MAC addresses.
This helps a lot on 802.11, where unicast is often much cheaper than
multicast, even when sending out duplicate packets (higher data rates
and aggregation heavily reduce airtime utilization).
- Felix
^ permalink raw reply
* [PATCH] List interfaces without net address by default
From: Petr Písař @ 2012-09-25 9:36 UTC (permalink / raw)
To: netdev; +Cc: Petr Písař
This fixes regression in iproute2-3.5.1 when `ip addr show' skipped
interfaces without network layer address.
Wrong output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:54:00:0f:03 brd ff:ff:ff:ff:ff:ff
inet 10.34.25.198/23 brd 10.34.25.255 scope global eth0
inet6 2620:52:0:2219:250:54ff:fe00:f03/64 scope global dynamic
valid_lft 2591919sec preferred_lft 604719sec
inet6 fe80::250:54ff:fe00:f03/64 scope link
valid_lft forever preferred_lft forever
Expected output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:54:00:0f:03 brd ff:ff:ff:ff:ff:ff
inet 10.34.25.198/23 brd 10.34.25.255 scope global eth0
inet6 2620:52:0:2219:250:54ff:fe00:f03/64 scope global dynamic
valid_lft 2591896sec preferred_lft 604696sec
inet6 fe80::250:54ff:fe00:f03/64 scope link
valid_lft forever preferred_lft forever
5: veth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 8a:ec:35:34:1f:a8 brd ff:ff:ff:ff:ff:ff
6: veth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 2e:97:ef:77:40:82 brd ff:ff:ff:ff:ff:ff
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
ip/ipaddress.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 69a63b3..4382ab5 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -785,6 +785,7 @@ static void ipaddr_filter(struct nlmsg_chain *linfo, struct nlmsg_chain *ainfo)
lp = &linfo->head;
while ( (l = *lp) != NULL) {
int ok = 0;
+ int missing_net_address = 1;
struct ifinfomsg *ifi = NLMSG_DATA(&l->h);
struct nlmsg_list *a;
@@ -792,8 +793,10 @@ static void ipaddr_filter(struct nlmsg_chain *linfo, struct nlmsg_chain *ainfo)
struct nlmsghdr *n = &a->h;
struct ifaddrmsg *ifa = NLMSG_DATA(n);
- if (ifa->ifa_index != ifi->ifi_index ||
- (filter.family && filter.family != ifa->ifa_family))
+ if (ifa->ifa_index != ifi->ifi_index)
+ continue;
+ missing_net_address = 0;
+ if (filter.family && filter.family != ifa->ifa_family)
continue;
if ((filter.scope^ifa->ifa_scope)&filter.scopemask)
continue;
@@ -828,6 +831,9 @@ static void ipaddr_filter(struct nlmsg_chain *linfo, struct nlmsg_chain *ainfo)
ok = 1;
break;
}
+ if (missing_net_address &&
+ (filter.family == AF_UNSPEC || filter.family == AF_PACKET))
+ ok = 1;
if (!ok) {
*lp = l->next;
free(l);
--
1.7.11.4
^ permalink raw reply related
* [PATCH net-next] netxen: write IP address to firmware when using bonding
From: Nikolay Aleksandrov @ 2012-09-25 8:48 UTC (permalink / raw)
To: sony.chacko; +Cc: netdev, agospoda, rajesh.borundia, davem
From: Nikolay Aleksandrov <naleksan@redhat.com>
This patch allows LRO aggregation on bonded devices that contain an NX3031
device. It also adds a for_each_netdev_in_bond_rcu(bond, slave) macro
which executes for each slave that has bond as master.
Signed-off-by: Andy Gospodarek <agospoda@redhat.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
.../net/ethernet/qlogic/netxen/netxen_nic_main.c | 113 +++++++++++++++------
include/linux/netdevice.h | 3 +
2 files changed, 87 insertions(+), 29 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index e2a4858..aaf6cf7 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -3244,6 +3244,25 @@ netxen_restore_indev_addr(struct net_device *netdev, unsigned long event)
}
}
+static inline int
+netxen_config_checkdev(struct net_device *dev)
+{
+ struct netxen_adapter *adapter;
+
+ if (!is_netxen_netdev(dev))
+ return -ENODEV;
+
+ adapter = netdev_priv(dev);
+
+ if(!adapter)
+ return -ENODEV;
+
+ if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
+ return -ENODEV;
+
+ return 0;
+}
+
static int netxen_netdev_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
@@ -3260,18 +3279,27 @@ recheck:
goto recheck;
}
- if (!is_netxen_netdev(dev))
- goto done;
-
- adapter = netdev_priv(dev);
-
- if (!adapter)
- goto done;
+ /* If this is a bonding device, look for netxen-based slaves*/
+ if (dev->priv_flags & IFF_BONDING) {
+ struct net_device *slave;
- if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
- goto done;
+ rcu_read_lock();
+ for_each_netdev_in_bond_rcu(dev, slave) {
+ if (netxen_config_checkdev(slave) < 0)
+ continue;
+
+ adapter = netdev_priv(slave);
+ netxen_config_indev_addr(adapter, orig_dev, event);
+ }
+ rcu_read_unlock();
- netxen_config_indev_addr(adapter, orig_dev, event);
+ } else {
+ if (netxen_config_checkdev(dev) < 0)
+ goto done;
+
+ adapter = netdev_priv(dev);
+ netxen_config_indev_addr(adapter, orig_dev, event);
+ }
done:
return NOTIFY_DONE;
}
@@ -3296,30 +3324,57 @@ recheck:
goto recheck;
}
- if (!is_netxen_netdev(dev))
- goto done;
+ /* If this is a bonding device, look for netxen-based slaves*/
+ if (dev->priv_flags & IFF_BONDING) {
+ struct net_device *slave;
- adapter = netdev_priv(dev);
+ rcu_read_lock();
+ for_each_netdev_in_bond_rcu(dev, slave) {
+ if (netxen_config_checkdev(slave) < 0)
+ continue;
- if (!adapter || !netxen_destip_supported(adapter))
- goto done;
+ adapter = netdev_priv(slave);
- if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
- goto done;
+ if (!netxen_destip_supported(adapter))
+ continue;
- switch (event) {
- case NETDEV_UP:
- netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
- netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
- break;
- case NETDEV_DOWN:
- netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
- netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
- break;
- default:
- break;
- }
+ switch (event) {
+ case NETDEV_UP:
+ netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
+ netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
+ break;
+ case NETDEV_DOWN:
+ netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
+ netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
+ break;
+ default:
+ break;
+ }
+ }
+ rcu_read_unlock();
+ } else {
+ if (netxen_config_checkdev(dev) < 0)
+ goto done;
+
+ adapter = netdev_priv(dev);
+
+ if (!netxen_destip_supported(adapter))
+ goto done;
+
+ switch (event) {
+ case NETDEV_UP:
+ netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
+ netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
+ break;
+ case NETDEV_DOWN:
+ netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
+ netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
+ break;
+ default:
+ break;
+ }
+ }
done:
return NOTIFY_DONE;
}
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 59dc05f3..463bb40 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1578,6 +1578,9 @@ extern rwlock_t dev_base_lock; /* Device list lock */
list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list)
#define for_each_netdev_continue_rcu(net, d) \
list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)
+#define for_each_netdev_in_bond_rcu(bond, slave) \
+ for_each_netdev_rcu(&init_net, slave) \
+ if (slave->master == bond)
#define net_device_entry(lh) list_entry(lh, struct net_device, dev_list)
static inline struct net_device *next_net_device(struct net_device *dev)
--
1.7.11.4
^ permalink raw reply related
* [PATCH net-next] tcp: avoid tcp loop connection on lo device
From: Shan Wei @ 2012-09-25 8:12 UTC (permalink / raw)
To: David Miller; +Cc: NetDev
Tcp supports simultaneous Connection, but we meat odd phenomenon that tcp client can receive what
send by itself. tcp client and tcp server communicate through loop device. tcp server selects
port 40000 to listen which is in local port range. But after tcp server program is killed, tcp client
still can connect successfully.
Client Server
connect <-----OK---------> listen:127.0.0.1,port:40000
send(d1) -----------------> recv
recv(d2) <----------------- send(d2)
----------------- killed(40000 not listened)
connect <-----OK--------->
send(d1) ----------------->
recv(d1) <-----------------
The simultaneous connection has no meaning for lo device, and for this case,
tcp client don't know whether server is listen on port 40000.
Just fix it sending reset to keep consistent state machine.
Reproduced step:
1. while true ; do nc 127.0.0.1 40001 ;done
2. ss -nt dst 127.0.0.1
State Recv-Q Send-Q Local Address:Port Peer Address:Port
ESTAB 0 0 127.0.0.1:40001 127.0.0.1:40001
Signed-off-by: Shan Wei <davidshan@tencent.com>
---
net/ipv4/tcp_input.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e037697..a2f5a10 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5659,6 +5659,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
struct tcp_cookie_values *cvp = tp->cookie_values;
struct tcp_fastopen_cookie foc = { .len = -1 };
int saved_clamp = tp->rx_opt.mss_clamp;
+ struct inet_sock *isk = inet_sk(sk);
tcp_parse_options(skb, &tp->rx_opt, &hash_location, 0, &foc);
@@ -5832,8 +5833,13 @@ discard:
if (th->syn) {
/* We see SYN without ACK. It is attempt of
* simultaneous connect with crossed SYNs.
- * Particularly, it can be connect to self.
+ * But, avoid tcp loop connection on single socket.
*/
+
+ if (isk->inet_dport == isk->inet_sport &&
+ isk->inet_saddr == isk->inet_daddr)
+ goto reset_and_undo;
+
tcp_set_state(sk, TCP_SYN_RECV);
if (tp->rx_opt.saw_tstamp) {
--
1.7.1
^ permalink raw reply related
* Re: bnx2x: link detected up at startup even when it should be down
From: Jean-Michel Hautbois @ 2012-09-25 8:11 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <504C9EFCA2D0054393414C9CB605C37F3079E4@SJEXCHMB06.corp.ad.broadcom.com>
2012/9/25 Dmitry Kravkov <dmitry@broadcom.com>:
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
>> On Behalf Of Dmitry Kravkov
>> Sent: Friday, September 21, 2012 10:23 PM
>> To: Jean-Michel Hautbois
>> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
>> Subject: RE: bnx2x: link detected up at startup even when it should be down
>>
>> Hi Jean,
>>
>> Thank you for the info
>>
>> > -----Original Message-----
>> > From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
>> > Sent: Friday, September 21, 2012 9:04 AM
>> > To: Dmitry Kravkov
>> > Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
>> > Subject: Re: bnx2x: link detected up at startup even when it should be down
>> >
>> > I already did it twice. I think this is FW related and not only the
>> > commit adding afex support. It may have solved a link issue (I am just
>> > guessing, based on experiments) ?
>>
>> FW replaced in this commit does not deal with link at all,
>>
>> One is involved in link management is displayed using 'ethtool -i' - it comes with
>> a card and driver independent.
>>
>> Is device configured for MF by the switch?
>> Can you please share lspci output?
>>
>> Other thing that can help in analysis is msglvl 0x4 for both situations
>>
> We were unable to reproduce the issue on 3.2. Can you please provide logs from your setup?
Yes, I was off until today, I have a workaround, but here are some
informations :
$> lspci -vv -d 14e4:168e
04:00.0 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 32
Region 0: Memory at ea000000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at e9800000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at e97f0000 (64-bit, prefetchable) [size=64K]
[virtual] Expansion ROM at def00000 [disabled] [size=256K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 48-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Capabilities: [300] #19
Kernel driver in use: bnx2x
Kernel modules: bnx2x
04:00.1 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin B routed to IRQ 36
Region 0: Memory at e8800000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at e8000000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at e7ff0000 (64-bit, prefetchable) [size=64K]
[virtual] Expansion ROM at def40000 [disabled] [size=256K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 4c-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Kernel driver in use: bnx2x
Kernel modules: bnx2x
04:00.2 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin B routed to IRQ 36
Region 0: Memory at e7000000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at e6800000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at e67f0000 (64-bit, prefetchable) [size=64K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 48-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Kernel driver in use: bnx2x
Kernel modules: bnx2x
04:00.3 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin C routed to IRQ 37
Region 0: Memory at e5800000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at e5000000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at e4ff0000 (64-bit, prefetchable) [size=64K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 4c-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Kernel driver in use: bnx2x
Kernel modules: bnx2x
04:00.4 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin C routed to IRQ 37
Region 0: Memory at e4000000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at e3800000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at e37f0000 (64-bit, prefetchable) [size=64K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 48-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Kernel driver in use: bnx2x
Kernel modules: bnx2x
04:00.5 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin D routed to IRQ 38
Region 0: Memory at e2800000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at e2000000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at e1ff0000 (64-bit, prefetchable) [size=64K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 4c-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Kernel driver in use: bnx2x
Kernel modules: bnx2x
04:00.6 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin D routed to IRQ 38
Region 0: Memory at e1000000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at e0800000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at e07f0000 (64-bit, prefetchable) [size=64K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 48-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Kernel driver in use: bnx2x
Kernel modules: bnx2x
04:00.7 Ethernet controller: Broadcom Corporation Device 168e (rev 10)
Subsystem: Hewlett-Packard Company Device 1798
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-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 32
Region 0: Memory at df800000 (64-bit, prefetchable) [size=8M]
Region 2: Memory at df000000 (64-bit, prefetchable) [size=8M]
Region 4: Memory at deff0000 (64-bit, prefetchable) [size=64K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D3 PME-Enable+ DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data <?>
Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+
Queue=0/3 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=17
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00001000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s
<4us, L1 <64us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+
Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1,
Latency L0 <2us, L1 <4us
ClockPM+ Suprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [13c] Device Serial Number 4c-49-7a-fe-ff-6e-c1-80
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel <?>
Capabilities: [1b8] #0e
Capabilities: [220] #15
Kernel driver in use: bnx2x
Kernel modules: bnx2x
I have tested several things, and I added some traces in order to get
information.
For instance, I trace the load_code in the function named "bnx2x_nic_load".
[ 25.693677] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load load_code=0x10130000
[ 25.693679] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load start period
[ 102.748934] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load load_code=0x10100000
[ 102.749065] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load start period
[ 104.007074] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load load_code=0x10120000
[ 104.007197] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load NOT start period
[ 104.423789] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load load_code=0x10120000
[ 104.423914] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load NOT start period
[ 104.836505] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load load_code=0x10120000
[ 104.836632] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load NOT start period
[ 105.254220] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load load_code=0x10120000
[ 105.254350] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load NOT start period
[ 105.667935] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load load_code=0x10120000
[ 105.668066] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load NOT start period
[ 106.081652] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load load_code=0x10120000
[ 106.081779] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load NOT start period
This is a FlexNIC use.
Here is my (quick and dirty) patch which makes the link detection
working and adds the traces shown above :
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 580b44e..dedd810 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -1769,6 +1769,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
*/
if (!BP_NOMCP(bp)) {
load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ, 0);
+netdev_info(bp->dev, "bnx2x_nic_load bnx2x_fw_command
load_code=0x%08X\n",load_code);
if (!load_code) {
BNX2X_ERR("MCP response failure, aborting\n");
rc = -EBUSY;
@@ -1785,22 +1786,31 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
DP(NETIF_MSG_IFUP, "NO MCP - load counts[%d] %d, %d, %d\n",
path, load_count[path][0], load_count[path][1],
load_count[path][2]);
+netdev_info(bp->dev, "bnx2x_nic_load NO MCP - load counts[%d]
%d, %d, %d\n",
+ path, load_count[path][0], load_count[path][1],
+ load_count[path][2]);
load_count[path][0]++;
load_count[path][1 + port]++;
DP(NETIF_MSG_IFUP, "NO MCP - new load counts[%d] %d, %d, %d\n",
path, load_count[path][0], load_count[path][1],
load_count[path][2]);
+netdev_info(bp->dev, "bnx2x_nic_load NO MCP - new load counts[%d]
%d, %d, %d\n",
+ path, load_count[path][0], load_count[path][1],
+ load_count[path][2]);
if (load_count[path][0] == 1)
load_code = FW_MSG_CODE_DRV_LOAD_COMMON;
else if (load_count[path][1 + port] == 1)
load_code = FW_MSG_CODE_DRV_LOAD_PORT;
else
load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION;
+netdev_info(bp->dev, "bnx2x_nic_load autre load_code=0x%08X\n",load_code);
}
+netdev_info(bp->dev, "bnx2x_nic_load load_code=0x%08X\n",load_code);
if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) ||
(load_code == FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) ||
- (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) {
+ (load_code == FW_MSG_CODE_DRV_LOAD_PORT) ||
+ (load_code == FW_MSG_CODE_DRV_LOAD_FUNCTION)) {
bp->port.pmf = 1;
/*
* We need the barrier to ensure the ordering between the
@@ -1808,9 +1818,13 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
* bnx2x_periodic_task().
*/
smp_mb();
+netdev_info(bp->dev, "bnx2x_nic_load start period\n");
queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
} else
+{
+netdev_info(bp->dev, "bnx2x_nic_load NOT start period\n");
bp->port.pmf = 0;
+}
DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf);
Hope it can help...
Regards,
JM
^ permalink raw reply related
* [PATCH] ipconfig: fix trivial build error
From: Andy Shevchenko @ 2012-09-25 8:09 UTC (permalink / raw)
To: netdev, linux-next; +Cc: Andy Shevchenko, Christoph Fritz, David S. Miller
In-Reply-To: <1348255713.12456.43.camel@mars>
The commit 5e953778a2aab04929a5e7b69f53dc26e39b079e ("ipconfig: add nameserver
IPs to kernel-parameter ip=") introduces ic_nameservers_predef() that defined
only for BOOTP. However it is used by ip_auto_config_setup() as well. This
patch moves it outside of #ifdef BOOTP.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Christoph Fritz <chf.fritz@googlemail.com>
Cc: David S. Miller <davem@davemloft.net>
---
net/ipv4/ipconfig.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 1c0e7e0..798358b 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -583,6 +583,17 @@ static void __init ic_rarp_send_if(struct ic_device *d)
#endif
/*
+ * Predefine Nameservers
+ */
+static inline void __init ic_nameservers_predef(void)
+{
+ int i;
+
+ for (i = 0; i < CONF_NAMESERVERS_MAX; i++)
+ ic_nameservers[i] = NONE;
+}
+
+/*
* DHCP/BOOTP support.
*/
@@ -743,17 +754,6 @@ static void __init ic_bootp_init_ext(u8 *e)
/*
- * Predefine Nameservers
- */
-static inline void __init ic_nameservers_predef(void)
-{
- int i;
-
- for (i = 0; i < CONF_NAMESERVERS_MAX; i++)
- ic_nameservers[i] = NONE;
-}
-
-/*
* Initialize the DHCP/BOOTP mechanism.
*/
static inline void __init ic_bootp_init(void)
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH v4] lxt PHY: Support for the buggy LXT973 rev A2
From: Richard Cochran @ 2012-09-25 7:47 UTC (permalink / raw)
To: leroy christophe; +Cc: David S Miller, netdev, linux-kernel
In-Reply-To: <50614DEE.9050400@c-s.fr>
On Tue, Sep 25, 2012 at 08:23:42AM +0200, leroy christophe wrote:
>
> A2 chip has phy_id 0x00137a10
> A3 chip has phy_id 0x00137a11
Okay then, thanks.
Acked-by: Richard Cochran <richardcochran@gmail.com>
^ permalink raw reply
* RE: bnx2x: link detected up at startup even when it should be down
From: Dmitry Kravkov @ 2012-09-25 7:40 UTC (permalink / raw)
To: Jean-Michel Hautbois
Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <504C9EFCA2D0054393414C9CB605C37F2F1B50@SJEXCHMB06.corp.ad.broadcom.com>
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Dmitry Kravkov
> Sent: Friday, September 21, 2012 10:23 PM
> To: Jean-Michel Hautbois
> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
> Subject: RE: bnx2x: link detected up at startup even when it should be down
>
> Hi Jean,
>
> Thank you for the info
>
> > -----Original Message-----
> > From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
> > Sent: Friday, September 21, 2012 9:04 AM
> > To: Dmitry Kravkov
> > Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
> > Subject: Re: bnx2x: link detected up at startup even when it should be down
> >
> > I already did it twice. I think this is FW related and not only the
> > commit adding afex support. It may have solved a link issue (I am just
> > guessing, based on experiments) ?
>
> FW replaced in this commit does not deal with link at all,
>
> One is involved in link management is displayed using 'ethtool -i' - it comes with
> a card and driver independent.
>
> Is device configured for MF by the switch?
> Can you please share lspci output?
>
> Other thing that can help in analysis is msglvl 0x4 for both situations
>
We were unable to reproduce the issue on 3.2. Can you please provide logs from your setup?
^ permalink raw reply
* Re: [PATCH] inet_diag: fix panic when unload inet_diag
From: Gao feng @ 2012-09-25 7:27 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, stephen.hemminger, jengelh, kuznet, netdev
In-Reply-To: <50615B30.80901@cn.fujitsu.com>
于 2012年09月25日 15:20, Gao feng 写道:
> It's need to modify netlink_dump_start not only wrap netlink_dump_start.
maybe it's better to add a struct module *module in struct netlink_callback..
^ permalink raw reply
* Re: [PATCH] inet_diag: fix panic when unload inet_diag
From: Gao feng @ 2012-09-25 7:20 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, stephen.hemminger, jengelh, kuznet, netdev
In-Reply-To: <1348555011.26828.2031.camel@edumazet-glaptop>
于 2012年09月25日 14:36, Eric Dumazet 写道:
> On Tue, 2012-09-25 at 10:48 +0800, Gao feng wrote:
>> when inet_diag being compiled as module, inet_diag_handler_dump
>> set netlink_dump_control.dump to inet_diag_dump,so if module
>> inet_diag is unloaded,netlink will still try to call this function
>> in netlink_dump. this will cause kernel panic.
>>
>> fix this by adding a reference of inet_diag module before
>> setting netlink_callback, and release this reference in
>> netlink_callback.done.
>>
>> Thanks for all help from Stephen,Jan and Eric.
> ...
>
>>
>> @@ -1001,8 +1025,26 @@ static int inet_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
>> {
>> struct netlink_dump_control c = {
>> .dump = inet_diag_dump,
>> + .done = inet_diag_done,
>> };
>> - return netlink_dump_start(net->diag_nlsk, skb, h, &c);
>> + int err;
>> + /*
>> + * netlink_dump will call inet_diag_dump,
>> + * so we need a reference of THIS_MODULE.
>> + */
>> + if (!try_module_get(THIS_MODULE))
>> + return -EPROTONOSUPPORT;
>> +
>> + err = netlink_dump_start(net->diag_nlsk, skb, h, &c);
>> +
>> + if ((err != -EINTR) && (err != -ENOBUFS)) {
>> + /*
>> + * netlink_callback set failed, release the
>> + * referenct of THIS_MODULE.
>> + */
>> + module_put(THIS_MODULE);
>> + }
>> + return err;
>> }
>> }
>>
>
> Hmm... this seems error prone...
>
> In the future, netlink_dump_start() could be changed to return other
> errors than EINTR or ENOBUFS that need the module_put()
>
EINTR and ENOBUFS is returned by netlink_dump, netlink_dump is called by
netlink_dump_start after netlink_callback being set successfully.
so this checking of EINTR and ENOBUFS here is to determinate if we set
netlink_callback successfully.
I think in order to reduce error prone,we have to change netlink_dump_start
to determinate if we set netlink_callback successfully.
> I would change netlink_dump_start() to __netlink_dump_start() and add a
> module param to it, so that this module stuff is centralized in
> __netlink_dump_start()
>
> Then, instead of calling (from inet_diag)
>
> netlink_dump_start(net->diag_nlsk, skb, nlh, &c);
>
> you would use :
>
> __netlink_dump_start(net->diag_nlsk, skb, nlh, &c, THIS_MODULE);
>
> I wonder if this fix is not needed elsewhere eventually
> (net/unix/af_unix.c for example ?)
>
do you mean net/unix/unix_diag.c ?
I test nfnetlink module,it has the same problem.
It's need to modify netlink_dump_start not only wrap netlink_dump_start.
^ permalink raw reply
* Re: [PATCH net-next] net: raw: revert unrelated change
From: David Miller @ 2012-09-25 7:11 UTC (permalink / raw)
To: eric.dumazet; +Cc: sfr, netdev, linux-next, linux-kernel
In-Reply-To: <1348554076.26828.1990.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 25 Sep 2012 08:21:16 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Commit 5640f7685831 ("net: use a per task frag allocator")
> accidentally contained an unrelated change to net/ipv4/raw.c,
> later committed (without the pr_err() debugging bits) in
> net tree as commit ab43ed8b749 (ipv4: raw: fix icmp_filter())
>
> This patch reverts this glitch, noticed by Stephen Rothwell.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [PATCH] inet_diag: fix panic when unload inet_diag
From: Eric Dumazet @ 2012-09-25 6:36 UTC (permalink / raw)
To: Gao feng; +Cc: davem, stephen.hemminger, jengelh, kuznet, netdev
In-Reply-To: <1348541310-31913-1-git-send-email-gaofeng@cn.fujitsu.com>
On Tue, 2012-09-25 at 10:48 +0800, Gao feng wrote:
> when inet_diag being compiled as module, inet_diag_handler_dump
> set netlink_dump_control.dump to inet_diag_dump,so if module
> inet_diag is unloaded,netlink will still try to call this function
> in netlink_dump. this will cause kernel panic.
>
> fix this by adding a reference of inet_diag module before
> setting netlink_callback, and release this reference in
> netlink_callback.done.
>
> Thanks for all help from Stephen,Jan and Eric.
...
>
> @@ -1001,8 +1025,26 @@ static int inet_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
> {
> struct netlink_dump_control c = {
> .dump = inet_diag_dump,
> + .done = inet_diag_done,
> };
> - return netlink_dump_start(net->diag_nlsk, skb, h, &c);
> + int err;
> + /*
> + * netlink_dump will call inet_diag_dump,
> + * so we need a reference of THIS_MODULE.
> + */
> + if (!try_module_get(THIS_MODULE))
> + return -EPROTONOSUPPORT;
> +
> + err = netlink_dump_start(net->diag_nlsk, skb, h, &c);
> +
> + if ((err != -EINTR) && (err != -ENOBUFS)) {
> + /*
> + * netlink_callback set failed, release the
> + * referenct of THIS_MODULE.
> + */
> + module_put(THIS_MODULE);
> + }
> + return err;
> }
> }
>
Hmm... this seems error prone...
In the future, netlink_dump_start() could be changed to return other
errors than EINTR or ENOBUFS that need the module_put()
I would change netlink_dump_start() to __netlink_dump_start() and add a
module param to it, so that this module stuff is centralized in
__netlink_dump_start()
Then, instead of calling (from inet_diag)
netlink_dump_start(net->diag_nlsk, skb, nlh, &c);
you would use :
__netlink_dump_start(net->diag_nlsk, skb, nlh, &c, THIS_MODULE);
I wonder if this fix is not needed elsewhere eventually
(net/unix/af_unix.c for example ?)
^ permalink raw reply
* Re: [PATCH v4] lxt PHY: Support for the buggy LXT973 rev A2
From: leroy christophe @ 2012-09-25 6:23 UTC (permalink / raw)
To: Richard Cochran; +Cc: David S Miller, netdev, linux-kernel
In-Reply-To: <20120924183035.GA2252@netboy.at.omicron.at>
Le 24/09/2012 20:30, Richard Cochran a écrit :
> On Mon, Sep 24, 2012 at 04:00:58PM +0200, Christophe Leroy wrote:
>
>> diff -u a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
>> --- a/drivers/net/phy/lxt.c 2012-09-23 03:08:48.000000000 +0200
>> +++ b/drivers/net/phy/lxt.c 2012-09-23 03:18:00.000000000 +0200
> ...
>
>> @@ -175,6 +292,16 @@
>> .driver = { .owner = THIS_MODULE,},
>> }, {
>> .phy_id = 0x00137a10,
>> + .name = "LXT973-A2",
>> + .phy_id_mask = 0xffffffff,
>> + .features = PHY_BASIC_FEATURES,
>> + .flags = 0,
>> + .probe = lxt973_probe,
>> + .config_aneg = lxt973_config_aneg,
>> + .read_status = lxt973a2_read_status,
> I like this way of matching the A2 chips much better than what you had
> before. But are you sure this will work correctly?
Apparently it does.
>
> What do A3 chips have in the last nibble of phy_id?
A2 chip has phy_id 0x00137a10
A3 chip has phy_id 0x00137a11
Christophe
>
>> + .driver = { .owner = THIS_MODULE,},
>> +}, {
>> + .phy_id = 0x00137a10,
>> .name = "LXT973",
>> .phy_id_mask = 0xfffffff0,
>> .features = PHY_BASIC_FEATURES,
> Thanks,
> Richard
>
^ permalink raw reply
* [PATCH net-next] net: raw: revert unrelated change
From: Eric Dumazet @ 2012-09-25 6:21 UTC (permalink / raw)
To: David Miller; +Cc: sfr, netdev, linux-next, linux-kernel
In-Reply-To: <1348550602.26828.1918.camel@edumazet-glaptop>
From: Eric Dumazet <edumazet@google.com>
Commit 5640f7685831 ("net: use a per task frag allocator")
accidentally contained an unrelated change to net/ipv4/raw.c,
later committed (without the pr_err() debugging bits) in
net tree as commit ab43ed8b749 (ipv4: raw: fix icmp_filter())
This patch reverts this glitch, noticed by Stephen Rothwell.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/ipv4/raw.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index a80740b..f242578 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -131,23 +131,18 @@ found:
* 0 - deliver
* 1 - block
*/
-static int icmp_filter(const struct sock *sk, const struct sk_buff *skb)
+static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb)
{
- struct icmphdr _hdr;
- const struct icmphdr *hdr;
-
- pr_err("icmp_filter skb_transport_offset %d data-head %ld len %d/%d\n",
- skb_transport_offset(skb), skb->data - skb->head, skb->len, skb->data_len);
- hdr = skb_header_pointer(skb, skb_transport_offset(skb),
- sizeof(_hdr), &_hdr);
- pr_err("head %p data %p hdr %p type %d\n", skb->head, skb->data, hdr, hdr ? hdr->type : -1);
- if (!hdr)
+ int type;
+
+ if (!pskb_may_pull(skb, sizeof(struct icmphdr)))
return 1;
- if (hdr->type < 32) {
+ type = icmp_hdr(skb)->type;
+ if (type < 32) {
__u32 data = raw_sk(sk)->filter.data;
- return ((1U << hdr->type) & data) != 0;
+ return ((1 << type) & data) != 0;
}
/* Do not block unknown ICMP types */
^ permalink raw reply related
* Re: [PATCH] team: fix return value check
From: Jiri Pirko @ 2012-09-25 5:40 UTC (permalink / raw)
To: Wei Yongjun; +Cc: jpirko, yongjun_wei, netdev
In-Reply-To: <CAPgLHd9GYYu21FhiKAr2MvmYtWbL=85-E0EzJmiJm6cDDp=WcA@mail.gmail.com>
Tue, Sep 25, 2012 at 06:29:35AM CEST, weiyj.lk@gmail.com wrote:
>From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
>In case of error, the function genlmsg_put() returns NULL pointer
>not ERR_PTR(). The IS_ERR() test in the return value check should
>be replaced with NULL test.
>
>dpatch engine is used to auto generate this patch.
>(https://github.com/weiyj/dpatch)
>
>Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>---
> drivers/net/team/team.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index 341b65d..e19da26 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -1652,8 +1652,8 @@ static int team_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
>
> hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq,
> &team_nl_family, 0, TEAM_CMD_NOOP);
>- if (IS_ERR(hdr)) {
>- err = PTR_ERR(hdr);
>+ if (!hdr) {
>+ err = -EMSGSIZE;
> goto err_msg_put;
> }
>
>@@ -1847,8 +1847,8 @@ start_again:
>
> hdr = genlmsg_put(skb, pid, seq, &team_nl_family, flags | NLM_F_MULTI,
> TEAM_CMD_OPTIONS_GET);
>- if (IS_ERR(hdr))
>- return PTR_ERR(hdr);
>+ if (!hdr)
>+ return -EMSGSIZE;
>
> if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
> goto nla_put_failure;
>@@ -2067,8 +2067,8 @@ static int team_nl_fill_port_list_get(struct sk_buff *skb,
>
> hdr = genlmsg_put(skb, pid, seq, &team_nl_family, flags,
> TEAM_CMD_PORT_LIST_GET);
>- if (IS_ERR(hdr))
>- return PTR_ERR(hdr);
>+ if (!hdr)
>+ return -EMSGSIZE;
>
> if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
> goto nla_put_failure;
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
Acked-by: Jiri Pirko <jiri@resnulli.us>
^ permalink raw reply
* Re: [PATCH] tcp: sysctl for initial receive window
From: Jan Engelhardt @ 2012-09-25 5:29 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: netdev, Nandita Dukkipati, Eric Dumazet
In-Reply-To: <20120921085502.4534.20232.stgit@dragon>
On Friday 2012-09-21 10:55, Jesper Dangaard Brouer wrote:
>diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
>index c7fc107..684131c 100644
>--- a/Documentation/networking/ip-sysctl.txt
>+++ b/Documentation/networking/ip-sysctl.txt
>@@ -257,6 +257,18 @@ tcp_frto_response - INTEGER
> to the values prior timeout
> Default: 0 (rate halving based)
>
>+tcp_init_recv_window - INTEGER
>+ Default initial advertised receive window. Actual window size
>+ is this value multiplied by the MSS of the connection. Its
is this value multiplied by the MSS of the connection. It is
>+ possible to control/override this value per route table entry
>+ via the iproute2 option initrwnd.
>+ Minimum value is 1, but 2 is the recommended minimum.
>+ The effective max value, is limited by the sockets receive
The effective max value is limited by the sockets receive
>+ buffer size (default tcp_rmem[1], and possibly scaled by
>+ tcp_adv_win_scale), and can further be limited by window
tcp_adv_win_scale) and can further be limited by window
>+ clamp.
clamping.
>+ Default: 10
>+
> tcp_keepalive_time - INTEGER
> How often TCP sends out keepalive messages when keepalive is enabled.
> Default: 2hours.
The "recommended minimum" is somewhat strange from a language POV,
since the recommendation is actually to _not touch_ the option at all
(because the default works and there is potential abuse as Dave
mentions).
^ permalink raw reply
* Re: linux-next: manual merge of the net-next tree with the net tree
From: Eric Dumazet @ 2012-09-25 5:23 UTC (permalink / raw)
To: David Miller; +Cc: sfr, netdev, linux-next, linux-kernel, edumazet
In-Reply-To: <20120925.011343.1495275645575636949.davem@davemloft.net>
On Tue, 2012-09-25 at 01:13 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 25 Sep 2012 07:10:42 +0200
>
> > Oops, my bad, net/ipv4/raw.c changes in 5640f7685831 ("net: use a per
> > task frag allocator") should not be there :
> >
> > I accidentally left a debugging version of the patch I sent to fix the
> > icmp bug.
> >
> > Sorry David for this, I am not sure how I can help on this ?
>
> The thing to do is send me a patch to revert the raw.c change from
> net-next, right?
Sure, I'll do that after my breakfast and some coffee ;)
^ permalink raw reply
* Re: [RFC] gre: conform to RFC6040 ECN progogation
From: Eric Dumazet @ 2012-09-25 5:17 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Chris Wright, David Miller, netdev
In-Reply-To: <20120924153013.553f0b76@nehalam.linuxnetplumber.net>
On Mon, 2012-09-24 at 15:30 -0700, Stephen Hemminger wrote:
> Logging is a bad idea in this case since the tunnel might be from a remote
> host/protocol and the log would be filled with crap.
>
> The tunnels in general do need to have rx_dropped counter, but it looks
> like that isn't being done right either.
>
I never suggested to log _all_ messages.
Stephen, I personally was hit by some provider playing with TOS bits so
wrong I had to patch linux to fix a minor problem. [1]
I would like to know why my tunnels are going to fail, and what should I
do to get a fallback. Ie reverting your patches.
RFC 6040 states :
In these cases,
particularly the more dangerous ones, the decapsulator SHOULD log
the event and MAY also raise an alarm.
Just because the highlighted combinations are currently unused,
does not mean that all the other combinations are always valid.
Some are only valid if they have arrived from a particular type of
legacy ingress, and dangerous otherwise. Therefore, an
implementation MAY allow an operator to configure logging and
alarms for such additional header combinations known to be
dangerous or CU for the particular configuration of tunnel
endpoints deployed at run-time.
Alarms SHOULD be rate-limited so that the anomalous combinations
will not amplify into a flood of alarm messages. It MUST be
possible to suppress alarms or logging, e.g., if it becomes
apparent that a combination that previously was not used has
started to be used for legitimate purposes such as a new standards
action.
[1]
commit 7a269ffad72f3604b8982fa09c387670e0d2ee14
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu Sep 22 20:02:19 2011 +0000
tcp: ECN blackhole should not force quickack mode
While playing with a new ADSL box at home, I discovered that ECN
blackhole can trigger suboptimal quickack mode on linux : We send one
ACK for each incoming data frame, without any delay and eventual
piggyback.
This is because TCP_ECN_check_ce() considers that if no ECT is seen on a
segment, this is because this segment was a retransmit.
Refine this heuristic and apply it only if we seen ECT in a previous
segment, to detect ECN blackhole at IP level.
^ permalink raw reply
* Re: linux-next: manual merge of the net-next tree with the net tree
From: David Miller @ 2012-09-25 5:13 UTC (permalink / raw)
To: eric.dumazet; +Cc: sfr, netdev, linux-next, linux-kernel, edumazet
In-Reply-To: <1348549842.26828.1897.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 25 Sep 2012 07:10:42 +0200
> Oops, my bad, net/ipv4/raw.c changes in 5640f7685831 ("net: use a per
> task frag allocator") should not be there :
>
> I accidentally left a debugging version of the patch I sent to fix the
> icmp bug.
>
> Sorry David for this, I am not sure how I can help on this ?
The thing to do is send me a patch to revert the raw.c change from
net-next, right?
^ 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