* [PATCH net-next v3 2/9] qlcnic: Enhance ethtool to display ring indices and interrupt mask
From: Himanshu Madhani @ 2013-10-15 16:57 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Pratik Pujar, himanshu.madhani
In-Reply-To: <cover.1381882600.git.himanshu.madhani@qlogic.com>
From: Pratik Pujar <pratik.pujar@qlogic.com>
o Updated ethtool -d <ethX> option to display ring indices for Transmit(Tx),
Receive(Rx), and Status(St) rings.
o Updated ethtool -d <ethX> option to display ring interrupt mask for Transmit(Tx),
and Status(St) rings.
Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 8 ++--
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 54 ++++++++++++++++------
2 files changed, 44 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 66e94dc..c2df4ce 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -3267,12 +3267,12 @@ int qlcnic_83xx_reg_test(struct qlcnic_adapter *adapter)
return 0;
}
-int qlcnic_83xx_get_regs_len(struct qlcnic_adapter *adapter)
+inline int qlcnic_83xx_get_regs_len(struct qlcnic_adapter *adapter)
{
return (ARRAY_SIZE(qlcnic_83xx_ext_reg_tbl) *
- sizeof(adapter->ahw->ext_reg_tbl)) +
- (ARRAY_SIZE(qlcnic_83xx_reg_tbl) +
- sizeof(adapter->ahw->reg_tbl));
+ sizeof(*adapter->ahw->ext_reg_tbl)) +
+ (ARRAY_SIZE(qlcnic_83xx_reg_tbl) *
+ sizeof(*adapter->ahw->reg_tbl));
}
int qlcnic_83xx_get_registers(struct qlcnic_adapter *adapter, u32 *regs_buff)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index ebe4c86..66355b7 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -187,8 +187,8 @@ static int qlcnic_dev_statistics_len(struct qlcnic_adapter *adapter)
return -1;
}
-#define QLCNIC_RING_REGS_COUNT 20
-#define QLCNIC_RING_REGS_LEN (QLCNIC_RING_REGS_COUNT * sizeof(u32))
+#define QLCNIC_TX_INTR_NOT_CONFIGURED 0X78563412
+
#define QLCNIC_MAX_EEPROM_LEN 1024
static const u32 diag_registers[] = {
@@ -219,7 +219,15 @@ static const u32 ext_diag_registers[] = {
};
#define QLCNIC_MGMT_API_VERSION 2
-#define QLCNIC_ETHTOOL_REGS_VER 3
+#define QLCNIC_ETHTOOL_REGS_VER 4
+
+static inline int qlcnic_get_ring_regs_len(struct qlcnic_adapter *adapter)
+{
+ int ring_regs_cnt = (adapter->max_drv_tx_rings * 5) +
+ (adapter->max_rds_rings * 2) +
+ (adapter->max_sds_rings * 3) + 5;
+ return ring_regs_cnt * sizeof(u32);
+}
static int qlcnic_get_regs_len(struct net_device *dev)
{
@@ -231,7 +239,9 @@ static int qlcnic_get_regs_len(struct net_device *dev)
else
len = sizeof(ext_diag_registers) + sizeof(diag_registers);
- return QLCNIC_RING_REGS_LEN + len + QLCNIC_DEV_INFO_SIZE + 1;
+ len += ((QLCNIC_DEV_INFO_SIZE + 2) * sizeof(u32));
+ len += qlcnic_get_ring_regs_len(adapter);
+ return len;
}
static int qlcnic_get_eeprom_len(struct net_device *dev)
@@ -493,6 +503,8 @@ qlcnic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
struct qlcnic_adapter *adapter = netdev_priv(dev);
struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
struct qlcnic_host_sds_ring *sds_ring;
+ struct qlcnic_host_rds_ring *rds_rings;
+ struct qlcnic_host_tx_ring *tx_ring;
u32 *regs_buff = p;
int ring, i = 0;
@@ -512,21 +524,35 @@ qlcnic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
if (!test_bit(__QLCNIC_DEV_UP, &adapter->state))
return;
- regs_buff[i++] = 0xFFEFCDAB; /* Marker btw regs and ring count*/
-
- regs_buff[i++] = 1; /* No. of tx ring */
- regs_buff[i++] = le32_to_cpu(*(adapter->tx_ring->hw_consumer));
- regs_buff[i++] = readl(adapter->tx_ring->crb_cmd_producer);
-
- regs_buff[i++] = 2; /* No. of rx ring */
- regs_buff[i++] = readl(recv_ctx->rds_rings[0].crb_rcv_producer);
- regs_buff[i++] = readl(recv_ctx->rds_rings[1].crb_rcv_producer);
+ /* Marker btw regs and TX ring count */
+ regs_buff[i++] = 0xFFEFCDAB;
+
+ regs_buff[i++] = adapter->max_drv_tx_rings; /* No. of TX ring */
+ for (ring = 0; ring < adapter->max_drv_tx_rings; ring++) {
+ tx_ring = &adapter->tx_ring[ring];
+ regs_buff[i++] = le32_to_cpu(*(tx_ring->hw_consumer));
+ regs_buff[i++] = tx_ring->sw_consumer;
+ regs_buff[i++] = readl(tx_ring->crb_cmd_producer);
+ regs_buff[i++] = tx_ring->producer;
+ if (tx_ring->crb_intr_mask)
+ regs_buff[i++] = readl(tx_ring->crb_intr_mask);
+ else
+ regs_buff[i++] = QLCNIC_TX_INTR_NOT_CONFIGURED;
+ }
- regs_buff[i++] = adapter->max_sds_rings;
+ regs_buff[i++] = adapter->max_rds_rings; /* No. of RX ring */
+ for (ring = 0; ring < adapter->max_rds_rings; ring++) {
+ rds_rings = &recv_ctx->rds_rings[ring];
+ regs_buff[i++] = readl(rds_rings->crb_rcv_producer);
+ regs_buff[i++] = rds_rings->producer;
+ }
+ regs_buff[i++] = adapter->max_sds_rings; /* No. of SDS ring */
for (ring = 0; ring < adapter->max_sds_rings; ring++) {
sds_ring = &(recv_ctx->sds_rings[ring]);
regs_buff[i++] = readl(sds_ring->crb_sts_consumer);
+ regs_buff[i++] = sds_ring->consumer;
+ regs_buff[i++] = readl(sds_ring->crb_intr_mask);
}
}
--
1.8.1.4
^ permalink raw reply related
* [PATCH net-next v3 8/9] qlcnic: Skip unknown entry type while collecting firmware dump
From: Himanshu Madhani @ 2013-10-15 16:57 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Shahed Shaikh, himanshu.madhani
In-Reply-To: <cover.1381882600.git.himanshu.madhani@qlogic.com>
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
o Driver aborts the minidump collection operation when it finds
an unknown entry opcode. This patch skips unknown entry type
and resumes the minidump collection operation.
o Removed a comparision of collected dump size with expected dump size.
Size may differ when driver decides to skip an entry.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 41 ++++++++++------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
index 1551360..7763962 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
@@ -1187,41 +1187,38 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
}
if (ops_index == ops_cnt) {
- dev_info(&adapter->pdev->dev,
- "Invalid entry type %d, exiting dump\n",
+ dev_info(dev, "Skipping unknown entry opcode %d\n",
entry->hdr.type);
- goto error;
+ entry->hdr.flags |= QLCNIC_DUMP_SKIP;
+ entry_offset += entry->hdr.offset;
+ continue;
}
/* Collect dump for this entry */
dump = fw_dump_ops[ops_index].handler(adapter, entry, buffer);
- if (!qlcnic_valid_dump_entry(&adapter->pdev->dev, entry, dump))
+ if (!qlcnic_valid_dump_entry(dev, entry, dump)) {
entry->hdr.flags |= QLCNIC_DUMP_SKIP;
+ entry_offset += entry->hdr.offset;
+ continue;
+ }
+
buf_offset += entry->hdr.cap_size;
entry_offset += entry->hdr.offset;
buffer = fw_dump->data + buf_offset;
}
- if (dump_size != buf_offset) {
- dev_info(&adapter->pdev->dev,
- "Captured(%d) and expected size(%d) do not match\n",
- buf_offset, dump_size);
- goto error;
- } else {
- fw_dump->clr = 1;
- snprintf(mesg, sizeof(mesg), "FW_DUMP=%s",
- adapter->netdev->name);
- dev_info(&adapter->pdev->dev, "%s: Dump data, %d bytes captured\n",
- adapter->netdev->name, fw_dump->size);
- /* Send a udev event to notify availability of FW dump */
- kobject_uevent_env(&adapter->pdev->dev.kobj, KOBJ_CHANGE, msg);
- return 0;
- }
-error:
+
+ fw_dump->clr = 1;
+ snprintf(mesg, sizeof(mesg), "FW_DUMP=%s", adapter->netdev->name);
+ dev_info(dev, "%s: Dump data %d bytes captured, template header size %d bytes\n",
+ adapter->netdev->name, fw_dump->size, tmpl_hdr->size);
+ /* Send a udev event to notify availability of FW dump */
+ kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, msg);
+
if (fw_dump->use_pex_dma)
dma_free_coherent(dev, QLC_PEX_DMA_READ_SIZE,
fw_dump->dma_buffer, fw_dump->phys_addr);
- vfree(fw_dump->data);
- return -EINVAL;
+
+ return 0;
}
void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
--
1.8.1.4
^ permalink raw reply related
* [PATCH net-next v3 3/9] qlcnic: Firmware dump collection when auto recovery is disabled.
From: Himanshu Madhani @ 2013-10-15 16:57 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Pratik Pujar, himanshu.madhani
In-Reply-To: <cover.1381882600.git.himanshu.madhani@qlogic.com>
From: Pratik Pujar <pratik.pujar@qlogic.com>
o Allow collecting the firmware dump of halted firmware when auto
recovery is disabled.
Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 11 +++++++++++
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 7 ++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index f09e787..d303fab 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -818,6 +818,7 @@ static int qlcnic_83xx_idc_ready_state(struct qlcnic_adapter *adapter)
struct qlcnic_hardware_context *ahw = adapter->ahw;
struct qlcnic_mailbox *mbx = ahw->mailbox;
int ret = 0;
+ u32 owner;
u32 val;
/* Perform NIC configuration based ready state entry actions */
@@ -846,6 +847,10 @@ static int qlcnic_83xx_idc_ready_state(struct qlcnic_adapter *adapter)
clear_bit(QLC_83XX_MBX_READY, &mbx->status);
set_bit(__QLCNIC_RESETTING, &adapter->state);
qlcnic_83xx_idc_enter_need_reset_state(adapter, 1);
+ } else {
+ owner = qlcnic_83xx_idc_find_reset_owner_id(adapter);
+ if (ahw->pci_func == owner)
+ qlcnic_dump_fw(adapter);
}
return -EIO;
}
@@ -1058,6 +1063,12 @@ void qlcnic_83xx_idc_poll_dev_state(struct work_struct *work)
adapter->ahw->idc.prev_state = adapter->ahw->idc.curr_state;
qlcnic_83xx_periodic_tasks(adapter);
+ /* Do not reschedule if firmaware is in hanged state and auto
+ * recovery is disabled
+ */
+ if ((adapter->flags & QLCNIC_FW_HANG) && !qlcnic_auto_fw_reset)
+ return;
+
/* Re-schedule the function */
if (test_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status))
qlcnic_schedule_work(adapter, qlcnic_83xx_idc_poll_dev_state,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 55e8b23..5195972 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -3353,6 +3353,8 @@ done:
static int
qlcnic_check_health(struct qlcnic_adapter *adapter)
{
+ struct qlcnic_hardware_context *ahw = adapter->ahw;
+ struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump;
u32 state = 0, heartbeat;
u32 peg_status;
int err = 0;
@@ -3377,7 +3379,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
if (adapter->need_fw_reset)
goto detach;
- if (adapter->ahw->reset_context && qlcnic_auto_fw_reset)
+ if (ahw->reset_context && qlcnic_auto_fw_reset)
qlcnic_reset_hw_context(adapter);
return 0;
@@ -3420,6 +3422,9 @@ detach:
qlcnic_schedule_work(adapter, qlcnic_detach_work, 0);
QLCDB(adapter, DRV, "fw recovery scheduled.\n");
+ } else if (!qlcnic_auto_fw_reset && fw_dump->enable &&
+ adapter->flags & QLCNIC_FW_RESET_OWNER) {
+ qlcnic_dump_fw(adapter);
}
return 1;
--
1.8.1.4
^ permalink raw reply related
* [PATCH net-next v3 0/9] qlcnic: fixes and ethtool enhancements.
From: Himanshu Madhani @ 2013-10-15 16:57 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Himanshu Madhani
From: Himanshu Madhani <himanshu.madhani@qlogic.com>
This patch series contains
o patch to fix regression introduced by commit
aa4a1f7df7cbb98797c9f4edfde3c726e2b3841f.
o updates to ethtool for pause settings and enhance
register dump to display mask and ring indices.
o cleanup in DCB code and remove redundant eSwitch enablement command.
o fixed firmware dump collection logic to skip unknown entries.
Changes from v2 -> v3
o Updated patch to print informational messages as per Joe Perches's comment.
Changes from v1 -> v2
o Dropped patch to register device if adapter is in FAILED state for more rework.
o Updated patch to display ring indices via ethtool per Ben Hutchings's comment.
o Update patch for DCB cleanup per Stephen Hemminger's comment.
Please apply to net-next.
Thanks,
Himanshu
Himanshu Madhani (2):
qlcnic: Validate Tx queue only for 82xx adapters.
qlcnic: update version to 5.3.51
Jitendra Kalsaria (1):
qlcnic: Update ethtool standard pause settings.
Pratik Pujar (2):
qlcnic: Enhance ethtool to display ring indices and interrupt mask
qlcnic: Firmware dump collection when auto recovery is disabled.
Shahed Shaikh (1):
qlcnic: Skip unknown entry type while collecting firmware dump
Sony Chacko (1):
qlcnic: Remove redundant eSwitch enable commands
Sucheta Chakraborty (2):
qlcnic: Print informational messages only once during driver load.
qlcnic: dcb code cleanup and refactoring.
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 101 +----------
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 40 ++---
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 5 +-
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 20 ++-
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c | 47 +++---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c | 184 ++++++++++-----------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h | 109 ++++++++++--
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 56 +++++--
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 53 +++---
.../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 41 +++--
.../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 9 +-
12 files changed, 343 insertions(+), 324 deletions(-)
--
1.8.1.4
^ permalink raw reply
* [PATCH net-next v3 4/9] qlcnic: Update ethtool standard pause settings.
From: Himanshu Madhani @ 2013-10-15 16:57 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Jitendra Kalsaria,
himanshu.madhani
In-Reply-To: <cover.1381882600.git.himanshu.madhani@qlogic.com>
From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Update ethtool standard pause parameter settings and display
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 18 +++++++++++++++---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 3 +++
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index c2df4ce..268fda6 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -3369,10 +3369,21 @@ void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *adapter,
}
config = ahw->port_config;
if (config & QLC_83XX_CFG_STD_PAUSE) {
- if (config & QLC_83XX_CFG_STD_TX_PAUSE)
+ switch (MSW(config)) {
+ case QLC_83XX_TX_PAUSE:
+ pause->tx_pause = 1;
+ break;
+ case QLC_83XX_RX_PAUSE:
+ pause->rx_pause = 1;
+ break;
+ case QLC_83XX_TX_RX_PAUSE:
+ default:
+ /* Backward compatibility for existing
+ * flash definitions
+ */
pause->tx_pause = 1;
- if (config & QLC_83XX_CFG_STD_RX_PAUSE)
pause->rx_pause = 1;
+ }
}
if (QLC_83XX_AUTONEG(config))
@@ -3415,7 +3426,8 @@ int qlcnic_83xx_set_pauseparam(struct qlcnic_adapter *adapter,
ahw->port_config &= ~QLC_83XX_CFG_STD_RX_PAUSE;
ahw->port_config |= QLC_83XX_CFG_STD_TX_PAUSE;
} else if (!pause->rx_pause && !pause->tx_pause) {
- ahw->port_config &= ~QLC_83XX_CFG_STD_TX_RX_PAUSE;
+ ahw->port_config &= ~(QLC_83XX_CFG_STD_TX_RX_PAUSE |
+ QLC_83XX_CFG_STD_PAUSE);
}
status = qlcnic_83xx_set_port_config(adapter);
if (status) {
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
index 533e150..2883b57 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
@@ -363,6 +363,9 @@ enum qlcnic_83xx_states {
#define QLC_83XX_LINK_EEE(data) ((data) & BIT_13)
#define QLC_83XX_DCBX(data) (((data) >> 28) & 7)
#define QLC_83XX_AUTONEG(data) ((data) & BIT_15)
+#define QLC_83XX_TX_PAUSE 0x10
+#define QLC_83XX_RX_PAUSE 0x20
+#define QLC_83XX_TX_RX_PAUSE 0x30
#define QLC_83XX_CFG_STD_PAUSE (1 << 5)
#define QLC_83XX_CFG_STD_TX_PAUSE (1 << 20)
#define QLC_83XX_CFG_STD_RX_PAUSE (2 << 20)
--
1.8.1.4
^ permalink raw reply related
* Re: [PATCH] For for each TSN t being newly acked (Not only cumulatively, but also SELECTIVELY) cacc_saw_newack should be set to 1.
From: Vlad Yasevich @ 2013-10-15 17:25 UTC (permalink / raw)
To: Chang Xiangzhong; +Cc: nhorman, davem, linux-sctp, netdev, linux-kernel
In-Reply-To: <1381856348-15503-1-git-send-email-changxiangzhong@gmail.com>
On 10/15/2013 12:59 PM, Chang Xiangzhong wrote:
> Signed-off-by: Xiangzhong Chang <changxiangzhong@gmail.com>
> ---
> net/sctp/outqueue.c | 142 ++++++++++++++++++++++++---------------------------
> 1 file changed, 68 insertions(+), 74 deletions(-)
>
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 94df758..f10d848 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -1357,84 +1357,78 @@ static void sctp_check_transmitted(struct sctp_outq *q,
>
> tsn = ntohl(tchunk->subh.data_hdr->tsn);
> if (sctp_acked(sack, tsn)) {
> - /* If this queue is the retransmit queue, the
> - * retransmit timer has already reclaimed
> - * the outstanding bytes for this chunk, so only
> - * count bytes associated with a transport.
> - */
> - if (transport) {
> - /* If this chunk is being used for RTT
> - * measurement, calculate the RTT and update
> - * the RTO using this value.
> - *
> - * 6.3.1 C5) Karn's algorithm: RTT measurements
> - * MUST NOT be made using packets that were
> - * retransmitted (and thus for which it is
> - * ambiguous whether the reply was for the
> - * first instance of the packet or a later
> - * instance).
> - */
> - if (!tchunk->tsn_gap_acked &&
> - tchunk->rtt_in_progress) {
> - tchunk->rtt_in_progress = 0;
> - rtt = jiffies - tchunk->sent_at;
> - sctp_transport_update_rto(transport,
> - rtt);
> - }
> - }
> -
> - /* If the chunk hasn't been marked as ACKED,
> - * mark it and account bytes_acked if the
> - * chunk had a valid transport (it will not
> - * have a transport if ASCONF had deleted it
> - * while DATA was outstanding).
> - */
> if (!tchunk->tsn_gap_acked) {
> - tchunk->tsn_gap_acked = 1;
> - *highest_new_tsn_in_sack = tsn;
> - bytes_acked += sctp_data_size(tchunk);
> - if (!tchunk->transport)
> - migrate_bytes += sctp_data_size(tchunk);
> - forward_progress = true;
> + /* If this queue is the retransmit queue, the
> + * retransmit timer has already reclaimed
> + * the outstanding bytes for this chunk, so only
> + * count bytes associated with a transport.
> + *
> + * If this chunk is being used for RTT
> + * measurement, calculate the RTT and update
> + * the RTO using this value.
> + *
> + * 6.3.1 C5) Karn's algorithm: RTT measurements
> + * MUST NOT be made using packets that were
> + * retransmitted (and thus for which it is
> + * ambiguous whether the reply was for the
> + * first instance of the packet or a later
> + * instance).
> + */
> + if (transport && tchunk->rtt_in_progress) {
> + tchunk->rtt_in_progress = 0;
> + rtt = jiffies - tchunk->sent_at;
> + sctp_transport_update_rto(transport,
> + rtt);
> + }
> +
> + /* If the chunk hasn't been marked as ACKED,
> + * mark it and account bytes_acked if the
> + * chunk had a valid transport (it will not
> + * have a transport if ASCONF had deleted it
> + * while DATA was outstanding).
> + */
> + tchunk->tsn_gap_acked = 1;
> + *highest_new_tsn_in_sack = tsn;
> + bytes_acked += sctp_data_size(tchunk);
> + if (!tchunk->transport)
> + migrate_bytes += sctp_data_size(tchunk);
> + forward_progress = true;
> +
> + /*
> + * SFR-CACC algorithm:
> + * 2) If the SACK contains gap acks
> + * and the flag CHANGEOVER_ACTIVE is
> + * set the receiver of the SACK MUST
> + * take the following action:
> + *
> + * B) For each TSN t being acked that
> + * has not been acked in any SACK so
> + * far, set cacc_saw_newack to 1 for
> + * the destination that the TSN was
> + * sent to.
> + */
> + if (transport &&
> + sack->num_gap_ack_blocks &&
> + q->asoc->peer.primary_path->cacc.
> + changeover_active)
> + transport->cacc.cacc_saw_newack = 1;
> }
Indents should be tab based.
This is a bit more of a re-write that is needed for the this particualar
patch. What's wrong with just doing this?
@@ -1396,6 +1396,25 @@ static void sctp_check_transmitted(struct
sctp_outq *q,
if (!tchunk->transport)
migrate_bytes +=
sctp_data_size(tchunk);
forward_progress = true;
+
+ /*
+ * SFR-CACC algorithm:
+ * 2) If the SACK contains gap acks
+ * and the flag CHANGEOVER_ACTIVE is
+ * set the receiver of the SACK MUST
+ * take the following action:
+ *
+ * B) For each TSN t being acked that
+ * has not been acked in any SACK so
+ * far, set cacc_saw_newack to 1 for
+ * the destination that the TSN was
+ * sent to.
+ */
+ if (transport &&
+ sack->num_gap_ack_blocks &&
+ q->asoc->peer.primary_path->cacc.
+ changeover_active)
+ transport->cacc.cacc_saw_newack = 1;
}
if (TSN_lte(tsn, sack_ctsn)) {
-vlad
>
> if (TSN_lte(tsn, sack_ctsn)) {
> - /* RFC 2960 6.3.2 Retransmission Timer Rules
> - *
> - * R3) Whenever a SACK is received
> - * that acknowledges the DATA chunk
> - * with the earliest outstanding TSN
> - * for that address, restart T3-rtx
> - * timer for that address with its
> - * current RTO.
> - */
> - restart_timer = 1;
> - forward_progress = true;
> -
> - if (!tchunk->tsn_gap_acked) {
> - /*
> - * SFR-CACC algorithm:
> - * 2) If the SACK contains gap acks
> - * and the flag CHANGEOVER_ACTIVE is
> - * set the receiver of the SACK MUST
> - * take the following action:
> - *
> - * B) For each TSN t being acked that
> - * has not been acked in any SACK so
> - * far, set cacc_saw_newack to 1 for
> - * the destination that the TSN was
> - * sent to.
> - */
> - if (transport &&
> - sack->num_gap_ack_blocks &&
> - q->asoc->peer.primary_path->cacc.
> - changeover_active)
> - transport->cacc.cacc_saw_newack
> - = 1;
> - }
> -
> - list_add_tail(&tchunk->transmitted_list,
> - &q->sacked);
> + /* RFC 2960 6.3.2 Retransmission Timer Rules
> + *
> + * R3) Whenever a SACK is received
> + * that acknowledges the DATA chunk
> + * with the earliest outstanding TSN
> + * for that address, restart T3-rtx
> + * timer for that address with its
> + * current RTO.
> + */
> + restart_timer = 1;
> + forward_progress = true;
> +
> + list_add_tail(&tchunk->transmitted_list,
> + &q->sacked);
> } else {
> /* RFC2960 7.2.4, sctpimpguide-05 2.8.2
> * M2) Each time a SACK arrives reporting
>
^ permalink raw reply
* Re: [PATCH] drivers: net: phy: marvell.c: removed checkpatch.pl warnings
From: Sergei Shtylyov @ 2013-10-15 17:12 UTC (permalink / raw)
To: Avinash kumar; +Cc: davem, michal.simek, lars, RHoover, netdev
In-Reply-To: <1380514004-8701-1-git-send-email-avi.kp.137@gmail.com>
Hello.
On 09/30/2013 08:06 AM, Avinash kumar wrote:
> removes following warnings-
> drivers/net/phy/marvell.c:37: WARNING: Use #include <linux/io.h> instead of <asm/io.h>
> drivers/net/phy/marvell.c:39: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
> Signed-off-by: Avinash Kumar <avi.kp.137@gmail.com>
> ---
> drivers/net/phy/marvell.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index 2e91477..2e3c778e 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -34,9 +34,9 @@
> #include <linux/marvell_phy.h>
> #include <linux/of.h>
>
> -#include <asm/io.h>
> +#include <linux/io.h>
> #include <asm/irq.h>
> -#include <asm/uaccess.h>
> +#include <linux/uaccess.h>
You should move these #include's to the group of <linux/> #include's now.
WBR, Sergei
^ permalink raw reply
* [PATCH] For for each TSN t being newly acked (Not only cumulatively, but also SELECTIVELY) cacc_saw_newack should be set to 1.
From: Chang Xiangzhong @ 2013-10-15 16:59 UTC (permalink / raw)
To: vyasevich
Cc: nhorman, davem, linux-sctp, netdev, linux-kernel,
Chang Xiangzhong
Signed-off-by: Xiangzhong Chang <changxiangzhong@gmail.com>
---
net/sctp/outqueue.c | 142 ++++++++++++++++++++++++---------------------------
1 file changed, 68 insertions(+), 74 deletions(-)
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 94df758..f10d848 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -1357,84 +1357,78 @@ static void sctp_check_transmitted(struct sctp_outq *q,
tsn = ntohl(tchunk->subh.data_hdr->tsn);
if (sctp_acked(sack, tsn)) {
- /* If this queue is the retransmit queue, the
- * retransmit timer has already reclaimed
- * the outstanding bytes for this chunk, so only
- * count bytes associated with a transport.
- */
- if (transport) {
- /* If this chunk is being used for RTT
- * measurement, calculate the RTT and update
- * the RTO using this value.
- *
- * 6.3.1 C5) Karn's algorithm: RTT measurements
- * MUST NOT be made using packets that were
- * retransmitted (and thus for which it is
- * ambiguous whether the reply was for the
- * first instance of the packet or a later
- * instance).
- */
- if (!tchunk->tsn_gap_acked &&
- tchunk->rtt_in_progress) {
- tchunk->rtt_in_progress = 0;
- rtt = jiffies - tchunk->sent_at;
- sctp_transport_update_rto(transport,
- rtt);
- }
- }
-
- /* If the chunk hasn't been marked as ACKED,
- * mark it and account bytes_acked if the
- * chunk had a valid transport (it will not
- * have a transport if ASCONF had deleted it
- * while DATA was outstanding).
- */
if (!tchunk->tsn_gap_acked) {
- tchunk->tsn_gap_acked = 1;
- *highest_new_tsn_in_sack = tsn;
- bytes_acked += sctp_data_size(tchunk);
- if (!tchunk->transport)
- migrate_bytes += sctp_data_size(tchunk);
- forward_progress = true;
+ /* If this queue is the retransmit queue, the
+ * retransmit timer has already reclaimed
+ * the outstanding bytes for this chunk, so only
+ * count bytes associated with a transport.
+ *
+ * If this chunk is being used for RTT
+ * measurement, calculate the RTT and update
+ * the RTO using this value.
+ *
+ * 6.3.1 C5) Karn's algorithm: RTT measurements
+ * MUST NOT be made using packets that were
+ * retransmitted (and thus for which it is
+ * ambiguous whether the reply was for the
+ * first instance of the packet or a later
+ * instance).
+ */
+ if (transport && tchunk->rtt_in_progress) {
+ tchunk->rtt_in_progress = 0;
+ rtt = jiffies - tchunk->sent_at;
+ sctp_transport_update_rto(transport,
+ rtt);
+ }
+
+ /* If the chunk hasn't been marked as ACKED,
+ * mark it and account bytes_acked if the
+ * chunk had a valid transport (it will not
+ * have a transport if ASCONF had deleted it
+ * while DATA was outstanding).
+ */
+ tchunk->tsn_gap_acked = 1;
+ *highest_new_tsn_in_sack = tsn;
+ bytes_acked += sctp_data_size(tchunk);
+ if (!tchunk->transport)
+ migrate_bytes += sctp_data_size(tchunk);
+ forward_progress = true;
+
+ /*
+ * SFR-CACC algorithm:
+ * 2) If the SACK contains gap acks
+ * and the flag CHANGEOVER_ACTIVE is
+ * set the receiver of the SACK MUST
+ * take the following action:
+ *
+ * B) For each TSN t being acked that
+ * has not been acked in any SACK so
+ * far, set cacc_saw_newack to 1 for
+ * the destination that the TSN was
+ * sent to.
+ */
+ if (transport &&
+ sack->num_gap_ack_blocks &&
+ q->asoc->peer.primary_path->cacc.
+ changeover_active)
+ transport->cacc.cacc_saw_newack = 1;
}
if (TSN_lte(tsn, sack_ctsn)) {
- /* RFC 2960 6.3.2 Retransmission Timer Rules
- *
- * R3) Whenever a SACK is received
- * that acknowledges the DATA chunk
- * with the earliest outstanding TSN
- * for that address, restart T3-rtx
- * timer for that address with its
- * current RTO.
- */
- restart_timer = 1;
- forward_progress = true;
-
- if (!tchunk->tsn_gap_acked) {
- /*
- * SFR-CACC algorithm:
- * 2) If the SACK contains gap acks
- * and the flag CHANGEOVER_ACTIVE is
- * set the receiver of the SACK MUST
- * take the following action:
- *
- * B) For each TSN t being acked that
- * has not been acked in any SACK so
- * far, set cacc_saw_newack to 1 for
- * the destination that the TSN was
- * sent to.
- */
- if (transport &&
- sack->num_gap_ack_blocks &&
- q->asoc->peer.primary_path->cacc.
- changeover_active)
- transport->cacc.cacc_saw_newack
- = 1;
- }
-
- list_add_tail(&tchunk->transmitted_list,
- &q->sacked);
+ /* RFC 2960 6.3.2 Retransmission Timer Rules
+ *
+ * R3) Whenever a SACK is received
+ * that acknowledges the DATA chunk
+ * with the earliest outstanding TSN
+ * for that address, restart T3-rtx
+ * timer for that address with its
+ * current RTO.
+ */
+ restart_timer = 1;
+ forward_progress = true;
+
+ list_add_tail(&tchunk->transmitted_list,
+ &q->sacked);
} else {
/* RFC2960 7.2.4, sctpimpguide-05 2.8.2
* M2) Each time a SACK arrives reporting
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v3 net-next] openvswitch: fix vport-netdev unregister
From: Alexei Starovoitov @ 2013-10-15 16:53 UTC (permalink / raw)
To: Jesse Gross
Cc: David S. Miller, Pravin B Shelar, Jiri Pirko, Cong Wang,
dev@openvswitch.org, netdev
In-Reply-To: <CAEP_g=-hkjjph8qO8MQL=BBA8MnaUdE2vTy3jN+m7Vh5skfa6g@mail.gmail.com>
On Tue, Oct 15, 2013 at 8:31 AM, Jesse Gross <jesse@nicira.com> wrote:
> On Sun, Oct 13, 2013 at 8:50 PM, Alexei Starovoitov <ast@plumgrid.com> wrote:
>> diff --git a/net/openvswitch/dp_notify.c b/net/openvswitch/dp_notify.c
>> index c323567..ffa429a 100644
>> --- a/net/openvswitch/dp_notify.c
>> +++ b/net/openvswitch/dp_notify.c
>> @@ -59,15 +59,9 @@ void ovs_dp_notify_wq(struct work_struct *work)
>> struct hlist_node *n;
>>
>> hlist_for_each_entry_safe(vport, n, &dp->ports[i], dp_hash_node) {
>> - struct netdev_vport *netdev_vport;
>> -
>> if (vport->ops->type != OVS_VPORT_TYPE_NETDEV)
>> continue;
>> -
>> - netdev_vport = netdev_vport_priv(vport);
>> - if (netdev_vport->dev->reg_state == NETREG_UNREGISTERED ||
>> - netdev_vport->dev->reg_state == NETREG_UNREGISTERING)
>> - dp_detach_port_notify(vport);
>> + dp_detach_port_notify(vport);
>
> Doesn't this free *all* ports of type OVS_VPORT_TYPE_NETDEV when any
> one of them is removed?
sorry. not sure what I was thinking on Sunday evening. will respin
^ permalink raw reply
* Re: [PATCH] veth: Showing peer of veth type dev in ip link (kernel side)
From: Nicolas Dichtel @ 2013-10-15 16:44 UTC (permalink / raw)
To: Eric W. Biederman, Stephen Hemminger; +Cc: David Miller, yamato, netdev
In-Reply-To: <87li22vv1w.fsf@xmission.com>
Le 10/10/2013 02:17, Eric W. Biederman a écrit :
> Stephen Hemminger <stephen@networkplumber.org> writes:
>
>> On Tue, 8 Oct 2013 14:13:37 -0700
>> Stephen Hemminger <stephen@networkplumber.org> wrote:
>>
>>> On Tue, 08 Oct 2013 15:23:49 -0400 (EDT)
>>> David Miller <davem@davemloft.net> wrote:
>>>
>>>> From: Masatake YAMATO <yamato@redhat.com>
>>>> Date: Fri, 4 Oct 2013 11:34:21 +0900
>>>>
>>>>> ip link has ability to show extra information of net work device if
>>>>> kernel provides sunh information. With this patch veth driver can
>>>>> provide its peer ifindex information to ip command via netlink
>>>>> interface.
>>>>>
>>>>> Signed-off-by: Masatake YAMATO <yamato@redhat.com>
>>>>
>>>> Applied to net-next, thank you.
>>>> --
>>>> 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
>>>
>>> Please revert this. It is incorrect.
>>> The info returned by any netlink message should be equal to the message
>>> for setting.
>>>
>>> I think the correct patch would be something like this (compile tested only).
>>>
>>> --- a/drivers/net/veth.c 2013-10-06 14:48:23.806461177 -0700
>>> +++ b/drivers/net/veth.c 2013-10-08 14:11:42.434074690 -0700
>>> @@ -434,6 +434,35 @@ static const struct nla_policy veth_poli
>>> [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) },
>>> };
>>>
>>> +static size_t veth_get_size(const struct net_device *dev)
>>> +{
>>> + return nla_total_size(sizeof(struct ifinfomsg)) + /* VETH_INFO_PEER */
>>> + 0;
>>> +}
>>> +
>>> +static int veth_fill_info(struct sk_buff *skb, const struct net_device *dev)
>>> +{
>>> + struct veth_priv *priv = netdev_priv(dev);
>>> + struct net_device *peer = rtnl_dereference(priv->peer);
>>> +
>>> + if (peer) {
>>> + struct ifinfomsg ifi = {
>>> + .ifi_family = AF_UNSPEC,
>>> + .ifi_type = peer->type,
>>> + .ifi_index = peer->ifindex,
>>> + .ifi_flags = dev_get_flags(peer),
>>> + };
>>> +
>>> + if (nla_put(skb, VETH_INFO_PEER, sizeof(ifi), &ifi))
>>> + goto nla_put_failure;
>>> + }
>>> +
>>> + return 0;
>>> +
>>> +nla_put_failure:
>>> + return -EMSGSIZE;
>>> +}
>>> +
>>> static struct rtnl_link_ops veth_link_ops = {
>>> .kind = DRV_NAME,
>>> .priv_size = sizeof(struct veth_priv),
>>> @@ -443,6 +472,8 @@ static struct rtnl_link_ops veth_link_op
>>> .dellink = veth_dellink,
>>> .policy = veth_policy,
>>> .maxtype = VETH_INFO_MAX,
>>> + .get_size = veth_get_size,
>>> + .fill_info = veth_fill_info,
>>> };
>>>
>>> /*
>>>
>>>
>>
>> This patch is ok as RFC starting point but the full implementation needs to
>> add on IFLA_NAME and other attributes such that the full peer can be reconstructed.
>>
>> Ideally, the output of 'ip link' command can be in a format that can be used
>> to recreate the same veth pair.
>>
>> One issue is that veth has the ability to make a peer in a different namespace
>> and the network namespace code does not appear to have the ability to be invertable.
>> I.e it is not possible to construct IFLA_NET_NS_PID or IFLA_NET_NS_FD attributes
>> from an existing network device namespace.
>
> Right.
>
> IFLA_NET_NS_PID is not invertible as there may be no processes running
> in a pid namespace.
>
> IFLA_NET_NS_FD is in principle invertible. We just need to add a file
> descriptor to the callers fd table. I don't see IFLA_NET_NS_FD being
> invertible for broadcast messages, but for unicast it looks like a bit
> of a pain but there are no fundamental problems.
I'm not sure to understand why it is invertible only for unicast message.
Or are you saying that it is invertible only for the netns where the caller
stands (and then not for the veth peer)?
>
> I don't know if we care enough yet to write the code for the
> IFLA_NET_NS_FD attribute but it is doable.
I care ;-)
Has somebody already started to write a patch?
^ permalink raw reply
* Re: [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code
From: Joe Perches @ 2013-10-15 16:24 UTC (permalink / raw)
To: Kefeng Wang
Cc: linux-kernel, Greg Kroah-Hartman, David S. Miller,
Pablo Neira Ayuso, Stephen Hemminger, Johannes Berg,
John W. Linville, Stanislaw Gruszka, Johannes Berg,
Francois Romieu, Ben Hutchings, Chas Williams, Marc Kleine-Budde,
Samuel Ortiz, Paul Mackerras, Oliver Neukum,
Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel,
Rusty Russell, Michael S. Tsirkin, netfilter
In-Reply-To: <1381837514-50660-3-git-send-email-wangkefeng.wang@huawei.com>
On Tue, 2013-10-15 at 19:44 +0800, Kefeng Wang wrote:
> Wrapper functions net_ratelimited_function() and net_XXX_ratelimited()
> are called to simplify code.
[]
> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
[]
> @@ -465,10 +465,8 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
> if (likely(fdb)) {
> /* attempt to update an entry for a local interface */
> if (unlikely(fdb->is_local)) {
> - if (net_ratelimit())
> - br_warn(br, "received packet on %s with "
> - "own address as source address\n",
> - source->dev->name);
> + net_ratelimited_function(br_warn, br, "received packet on %s "
> + "with own address as source address\n", source->dev->name);
Hello Kefeng.
When these types of lines are changed, please coalesce the
fragmented format pieces into a single string.
It makes grep a bit easier and 80 columns limits don't
apply to formats.
I think using net_ratelimited_function is not particularly
clarifying here.
Maybe net_ratelimited_function should be removed instead
of its use sites expanded.
Perhaps adding macros like #define br_warn_ratelimited()
would be better.
This comment applies to the whole series.
^ permalink raw reply
* Re: DomU's network interface will hung when Dom0 running 32bit
From: jianhai luan @ 2013-10-15 16:23 UTC (permalink / raw)
To: Wei Liu; +Cc: Ian Campbell, xen-devel, netdev, ANNIE LI
In-Reply-To: <20131015160336.GT11739@zion.uk.xensource.com>
On 2013-10-16 0:03, Wei Liu wrote:
> On Tue, Oct 15, 2013 at 11:19:42PM +0800, jianhai luan wrote:
> [...]
>>>>>> * time_after_eq(now, next_credit) -> false
>>>>>> * time_before(now, expires) -> false
>>>>> If now is placed in above environment, the result will be correct
>>>>> (Sending package will be not allowed until next_credit).
>>>> No, it is not necessarily correct. Keep in mind that "now" wraps around,
>>>> which is the issue you try to fix. You still have a window to stall your
>>>> frontend.
>>> Remember that time_after_eq is supposed to work even with wraparound
>>> occurring, so long as the two times are less than MAX_LONG/2 apart.
>> Sorry for my misunderstand explanation. I mean that
>> * time_after_eq()/time_before_eq() fix the jiffies wraparound, so
>> please think about jiffies in line increasing.
>> * time_after_eq()/time_before_eq() have the range (0, MAX_LONG/2),
>> the judge will be wrong if out of the range.
>>
>> So please think about three kind environment
>> - expires now next_credit
>> --------time increases this direction ---------->
>>
>> - expires [next_credit now next_credit+MAX_LONG/2
>> --------time increase this direction ----------->
>>
>> - expires next_credit next_credit+MAX_LONG/2 now
>> --------time increadse this direction ---------->
>>
>> The first environment should be netfront consume all credit_byte
>> before next_credit, So we should pending one timer to calculator the
>> new credit_byte, and don't transmit until next_credit.
>>
>> the second environment should be calculator the credit_byte because
>> netfront don't consume all credit_byte before next_credit, and
>> time_after_eq() do correct judge.
>>
>> the third environment should be calculator in time because netfront
>> don't consume all credit_byte until next_credit.But time_after_eq do
>> error judge (time_after_eq(now, next_credit) is false), so the
>> remaining_byte isn't be increased.
>>
>> and I work on the third environment. You know now >
>> next_credit+MAX_LONG/2, time_before(now, expire) should be
>> true(time_before(now, expire) is false in first environment)
> Thanks for staighten this out for me. I'm just too dumb for this, please
> be patient with me. :-)
>
> Could you prove that time_before(now, expire) is always true in third
> case? That's where my main cencern lies. Is it because msecs_to_jiffies
> always returns MAX_JIFFY_OFFSET (which is ((LONG_MAX >> 1)-1) ) at most?
I have wrong judge in third environment. If now large than expires +
MAX_UNLONG, time_before(now, expires) will be false.
expires next_credit next_credit+MAX_UNLONG/2 expires +
MAX_UNLONG now next_credit+MAX_UNLONG
--------------------------------------------------------- time
increadse this direction ---------------------------------->
In the above environment, time_before(now, expires) will return
false. But the jiffies elapsed more time and next_credit will be
reachable in soon(time_after_eq(now, next_credit) will be true).
>
> Wei.
^ permalink raw reply
* getting lldp DCB_CMD_IEEE_GET after DCB_CMD_GCAP fails
From: Olaf Hering @ 2013-10-15 16:18 UTC (permalink / raw)
To: netdev
If this list is the wrong place, please point me to the right direction.
In the example code below the part which grabs DCB_CMD_IEEE_GET fails,
unless the "hack" part is executed. What I see inside the kernel is that
__netlink_dump_start gets to the err=-EBUSY case because nlk->cb is
still set. The nl_ack_handler is executed, an "empty" error is returned.
I have compared my code with open-lldp-0.9.46/test/nltest.c and did not
spot the difference.
Is the code below supposed to work anyway? Thanks for any help.
Olaf
/* cc -lnl lldptest.c -o lldptest */
#include <stdio.h>
#include <netlink/msg.h>
#include <linux/dcbnl.h>
static int nl_dump_valid(struct nl_msg *msg, void *p)
{
struct nlmsghdr *nlh = p;
nlh = nlmsg_hdr(msg);
printf("%s: %x\n", __func__, nlh->nlmsg_len);
return NL_OK;
}
static int nl_ack_handler(struct nl_msg *msg, void *arg)
{
arg = msg;
printf("%s: %p\n", __func__, arg);
return NL_STOP;
}
static int nl_error_handler(struct sockaddr_nl *sender, struct nlmsgerr *err, void *arg)
{
char *s = arg;
printf("%s: %p %s %x\n", __func__, sender, s, err->error);
return NL_STOP;
}
int main(int argc, char *argv[])
{
struct nl_handle *nl_handle;
struct nl_cb *nl_cb, *tmp_cb;
struct nl_msg *msg;
struct nlattr *nla;
struct dcbmsg dcb = {.dcb_family = AF_UNSPEC, };
char *ifname;
int hack;
int protocol = 0;
int ret = 1;
if (argc < 2) {
printf("Usage: %s <ifname> [hack]\n", argv[0]);
goto out;
}
ifname = argv[1];
hack = !!argv[2];
nl_cb = nl_cb_alloc(NL_CB_DEFAULT);
if (!nl_cb) {
perror("nl_cb_alloc");
goto out;
}
nl_handle = nl_handle_alloc_cb(nl_cb);
if (nl_connect(nl_handle, protocol) < 0) {
perror("nl_connect");
goto out;
}
tmp_cb = nl_cb_clone(nl_cb);
dcb.cmd = DCB_CMD_GCAP;
nl_cb_err(tmp_cb, NL_CB_CUSTOM, nl_error_handler, "DCB_CMD_GCAP");
nl_cb_set(tmp_cb, NL_CB_ACK, NL_CB_CUSTOM, nl_ack_handler, NULL);
nl_cb_set(tmp_cb, NL_CB_VALID, NL_CB_CUSTOM, nl_dump_valid, NULL);
msg = nlmsg_alloc_simple(RTM_GETDCB, NLM_F_REQUEST);
if (!msg) {
perror("nlmsg_alloc_simple");
goto out;
}
if (nlmsg_append(msg, &dcb, sizeof(dcb), NLMSG_ALIGNTO) < 0) {
perror("nlmsg_append");
goto out;
}
NLA_PUT_STRING(msg, DCB_ATTR_IFNAME, ifname);
nla = nla_nest_start(msg, DCB_ATTR_CAP);
NLA_PUT_FLAG(msg, DCB_CAP_ATTR_ALL);
nla_nest_end(msg, nla);
if (nl_send_auto_complete(nl_handle, msg) < 0) {
perror("nl_send_auto_complete");
goto out;
}
if ((nl_recvmsgs(nl_handle, tmp_cb)) < 0) {
perror("nl_recvmsgs");
goto out;
}
nl_cb_put(tmp_cb);
nlmsg_free(msg);
if (hack) {
nl_close(nl_handle);
nl_handle = nl_handle_alloc_cb(nl_cb);
if (nl_connect(nl_handle, protocol) < 0) {
perror("nl_connect");
goto out;
}
}
tmp_cb = nl_cb_clone(nl_cb);
dcb.cmd = DCB_CMD_IEEE_GET;
nl_cb_err(tmp_cb, NL_CB_CUSTOM, nl_error_handler, "DCB_CMD_IEEE_GET");
nl_cb_set(tmp_cb, NL_CB_ACK, NL_CB_CUSTOM, nl_ack_handler, NULL);
nl_cb_set(tmp_cb, NL_CB_VALID, NL_CB_CUSTOM, nl_dump_valid, NULL);
msg = nlmsg_alloc_simple(RTM_GETDCB, NLM_F_REQUEST);
if (!msg) {
perror("nlmsg_alloc_simple");
goto out;
}
if (nlmsg_append(msg, &dcb, sizeof(dcb), NLMSG_ALIGNTO) < 0) {
perror("nlmsg_append");
goto out;
}
NLA_PUT_STRING(msg, DCB_ATTR_IFNAME, ifname);
if (nl_send_auto_complete(nl_handle, msg) < 0) {
perror("nl_send_auto_complete");
goto out;
}
if ((nl_recvmsgs(nl_handle, tmp_cb)) < 0) {
perror("nl_recvmsgs");
goto out;
}
nl_cb_put(tmp_cb);
nlmsg_free(msg);
ret = 0;
nla_put_failure:
out:
return ret;
}
^ permalink raw reply
* Re: [PATCH] net: qmi_wwan: Olivetti Olicard 200 support
From: Enrico Mioso @ 2013-10-15 16:07 UTC (permalink / raw)
To: Dan Williams
Cc: gregkh, davem, bjorn, christian.schmiedl, linux-usb, netdev,
linux-kernel, Antonella Pellizzari
In-Reply-To: <1381848597.25397.4.camel@dcbw.foobar.com>
:) I'm very happy you got it working.
The firmware of our device seems so fragile still - and several QMI calls can
bring it to a crashing state, especially when asking a network scan to the NAS
service.
On Tue, 15 Oct 2013, Dan Williams wrote:
==Date: Tue, 15 Oct 2013 09:49:57 -0500
==From: Dan Williams <dcbw@redhat.com>
==To: Enrico Mioso <mrkiko.rs@gmail.com>
==Cc: gregkh@linuxfoundation.org, davem@davemloft.net, bjorn@mork.no,
== christian.schmiedl@gemalto.com, linux-usb@vger.kernel.org,
== netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
== Antonella Pellizzari <anto.pellizzari83@gmail.com>
==Subject: Re: [PATCH] net: qmi_wwan: Olivetti Olicard 200 support
==
==On Tue, 2013-10-15 at 15:06 +0200, Enrico Mioso wrote:
==> This is a QMI device, manufactured by TCT Mobile Phones.
==> A companion patch blacklisting this device's QMI interface in the option.c
==> driver has been sent.
==>
==> Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
==> Signed-off-by: Antonella Pellizzari <anto.pellizzari83@gmail.com>
==
==Good find. For the record, mine has:
==
==PX1522E16X 1 [Oct 15 2010 02:00:00]
==
== ctl (1.4)
== wds (1.8)
== dms (1.3)
== nas (1.2)
== qos (1.2)
== wms (1.1)
== pds (1.4)
== auth (1.0)
== voice (1.0)
== cat2 (1.1)
==
==Tested-by: Dan Williams <dcbw@redhat.com>
==
==> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
==> index 3d6aaf7..818ce90 100644
==> --- a/drivers/net/usb/qmi_wwan.c
==> +++ b/drivers/net/usb/qmi_wwan.c
==> @@ -714,6 +714,7 @@ static const struct usb_device_id products[] = {
==> {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
==> {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
==> {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
==> + {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */
==> {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */
==>
==> /* 4. Gobi 1000 devices */
==
==
==
^ permalink raw reply
* Re: DomU's network interface will hung when Dom0 running 32bit
From: Wei Liu @ 2013-10-15 16:03 UTC (permalink / raw)
To: jianhai luan; +Cc: Ian Campbell, Wei Liu, xen-devel, netdev, ANNIE LI
In-Reply-To: <525D5D0E.5070107@oracle.com>
On Tue, Oct 15, 2013 at 11:19:42PM +0800, jianhai luan wrote:
[...]
> >>>>
> >>>>* time_after_eq(now, next_credit) -> false
> >>>>* time_before(now, expires) -> false
> >>>If now is placed in above environment, the result will be correct
> >>>(Sending package will be not allowed until next_credit).
> >>No, it is not necessarily correct. Keep in mind that "now" wraps around,
> >>which is the issue you try to fix. You still have a window to stall your
> >>frontend.
> >Remember that time_after_eq is supposed to work even with wraparound
> >occurring, so long as the two times are less than MAX_LONG/2 apart.
>
> Sorry for my misunderstand explanation. I mean that
> * time_after_eq()/time_before_eq() fix the jiffies wraparound, so
> please think about jiffies in line increasing.
> * time_after_eq()/time_before_eq() have the range (0, MAX_LONG/2),
> the judge will be wrong if out of the range.
>
> So please think about three kind environment
> - expires now next_credit
> --------time increases this direction ---------->
>
> - expires [next_credit now next_credit+MAX_LONG/2
> --------time increase this direction ----------->
>
> - expires next_credit next_credit+MAX_LONG/2 now
> --------time increadse this direction ---------->
>
> The first environment should be netfront consume all credit_byte
> before next_credit, So we should pending one timer to calculator the
> new credit_byte, and don't transmit until next_credit.
>
> the second environment should be calculator the credit_byte because
> netfront don't consume all credit_byte before next_credit, and
> time_after_eq() do correct judge.
>
> the third environment should be calculator in time because netfront
> don't consume all credit_byte until next_credit.But time_after_eq do
> error judge (time_after_eq(now, next_credit) is false), so the
> remaining_byte isn't be increased.
>
> and I work on the third environment. You know now >
> next_credit+MAX_LONG/2, time_before(now, expire) should be
> true(time_before(now, expire) is false in first environment)
> >
Thanks for staighten this out for me. I'm just too dumb for this, please
be patient with me. :-)
Could you prove that time_before(now, expire) is always true in third
case? That's where my main cencern lies. Is it because msecs_to_jiffies
always returns MAX_JIFFY_OFFSET (which is ((LONG_MAX >> 1)-1) ) at most?
Wei.
^ permalink raw reply
* Re: kernel policy routing table src ip not respected since 2.6.37 and commit 9fc3bbb4a752
From: Vincent Li @ 2013-10-15 16:02 UTC (permalink / raw)
To: Julian Anastasov; +Cc: netdev@vger.kernel.org, Joel Sing
In-Reply-To: <alpine.LFD.2.03.1310151144580.1562@ssi.bg>
thanks for the clue, the arp indeed is from 10.1.1.2 in my test and i
made 10.1.1.9 ip reachable and tcpdump on 10.1.1.9 indeed show
sourcing from ip 10.1.1.2:
08:48:41.576588 IP 10.1.1.2 > 10.1.1.9: ICMP echo request, id 6972,
seq 1, length 64
08:48:41.576614 IP 10.1.1.9 > 10.1.1.2: ICMP echo reply, id 6972, seq
1, length 64
08:48:42.576909 IP 10.1.1.2 > 10.1.1.9: ICMP echo request, id 6972,
seq 2, length 64
08:48:42.576932 IP 10.1.1.9 > 10.1.1.2: ICMP echo reply, id 6972, seq
2, length 64
it is strange though when 10.1.1.9 is unreachable address and the ping
utility reports error 'Destination Host Unreachable' with source
10.1.1.1. before 2.6.37, it reports 10.1.1..2
the ping utility is standard ping command from centos6.4 and I am
running centos6.4 on KVM, here is strace
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025),
sin_addr=inet_addr("10.1.1.9")}, 16) = 0
getsockname(4, {sa_family=AF_INET, sin_port=htons(49991),
sin_addr=inet_addr("10.1.1.2")}, [16]) = 0
close(4) = 0
setsockopt(3, SOL_RAW, ICMP_FILTER,
~(ICMP_ECHOREPLY|ICMP_DEST_UNREACH|ICMP_SOURCE_QUENCH|ICMP_REDIRECT|ICMP_TIME_EXCEEDED|ICMP_PARAMETERPROB),
4) = 0
setsockopt(3, SOL_IP, IP_RECVERR, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_SNDBUF, [324], 4) = 0
setsockopt(3, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0
getsockopt(3, SOL_SOCKET, SO_RCVBUF, [4851439803083915264], [4]) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7f0b4332e000
write(1, "PING 10.1.1.9 (10.1.1.9) 56(84) "..., 47PING 10.1.1.9
(10.1.1.9) 56(84) bytes of data.
) = 47
setsockopt(3, SOL_SOCKET, SO_TIMESTAMP, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_SNDTIMEO,
"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
setsockopt(3, SOL_SOCKET, SO_RCVTIMEO,
"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
getpid() = 15633
rt_sigaction(SIGINT, {0x7f0b43337a40, [], SA_RESTORER|SA_INTERRUPT,
0x7f0b42b7e920}, NULL, 8) = 0
rt_sigaction(SIGALRM, {0x7f0b43337a40, [], SA_RESTORER|SA_INTERRUPT,
0x7f0b42b7e920}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {0x7f0b43337a50, [], SA_RESTORER|SA_INTERRUPT,
0x7f0b42b7e920}, NULL, 8) = 0
gettimeofday({1381852599, 797511}, NULL) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=71, ws_col=158, ws_xpixel=0, ws_ypixel=0}) = 0
gettimeofday({1381852599, 797672}, NULL) = 0
gettimeofday({1381852599, 797708}, NULL) = 0
sendmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("10.1.1.9")},
msg_iov(1)=[{"\10\0\373\n\21=\0\1\267e]R\0\0\0\0\f,\f\0\0\0\0\0\20\21\22\23\24\25\26\27"...,
64}], msg_controllen=0, msg_flags=0}, 0) = 64
setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={10, 0}}, NULL) = 0
recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("127.0.0.1")},
msg_iov(1)=[{"E\300\0D\237\210\0\0@\1\334n\177\0\0\1\177\0\0\1\3\3v9\0\0\0\0E\0\0("...,
192}], msg_controllen=32, {cmsg_len=32, cmsg_level=SOL_SOCKET,
cmsg_type=0x1d /* SCM_??? */, ...}, msg_flags=0}, 0) = 68
setsockopt(3, SOL_SOCKET, SO_ATTACH_FILTER,
"\10\0\0\0\0\0\0\0\300\305SC\v\177\0\0", 16) = 0
recvmsg(3, 0x7fffccde57b0, MSG_DONTWAIT) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, 0x7fffccde57b0, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, 0x7fffccde57b0, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("10.1.1.1")},
msg_iov(1)=[{"E\300\0pd{\0\0@\1\377M\n\1\1\1\n\1\1\2\3\1\374\376\0\0\0\0E\0\0T"...,
192}], msg_controllen=32, {cmsg_len=32, cmsg_level=SOL_SOCKET,
cmsg_type=0x1d /* SCM_??? */, ...}, msg_flags=0}, 0) = 112
recvmsg(3, 0x7fffccde57b0, 0) = -1 EHOSTUNREACH (No route to host)
recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("10.1.1.9")}, msg_iov(1)=[{"\10\0\373\n\21=\0\1",
8}], msg_controllen=80, {cmsg_len=32, cmsg_level=SOL_SOCKET,
cmsg_type=0x1d /* SCM_??? */, ...}, msg_flags=MSG_TRUNC|MSG_ERRQUEUE},
MSG_ERRQUEUE|MSG_DONTWAIT) = 8
setsockopt(3, SOL_RAW, ICMP_FILTER,
~(ICMP_ECHOREPLY|ICMP_SOURCE_QUENCH|ICMP_REDIRECT), 4) = 0
write(1, "From 10.1.1.1 icmp_seq=1 Destina"..., 54From 10.1.1.1
icmp_seq=1 Destination Host Unreachable
) = 54
gettimeofday({1381852602, 805123}, NULL) = 0
write(1, "\n", 1
) = 1
write(1, "--- 10.1.1.9 ping statistics ---"..., 33--- 10.1.1.9 ping
statistics ---
) = 33
write(1, "1 packets transmitted, 0 receive"..., 761 packets
transmitted, 0 received, +1 errors, 100% packet loss, time 3007ms
) = 76
write(1, "\n", 1
) = 1
exit_group(1) = ?
I
On Tue, Oct 15, 2013 at 1:51 AM, Julian Anastasov <ja@ssi.bg> wrote:
>
> Hello,
>
> On Mon, 14 Oct 2013, Vincent Li wrote:
>
>> I had a simple bash script to test if the policy routing table src ip
>> is respected or not, git bisect found the commit 9fc3bbb4a752 to
>> change the policy routing table source ip behavior.
>>
>> commit 9fc3bbb4a752f108cf096d96640f3b548bbbce6c
>> Author: Joel Sing <jsing@google.com>
>> Date: Mon Jan 3 20:24:20 2011 +0000
>>
>> ipv4/route.c: respect prefsrc for local routes
>>
>> The preferred source address is currently ignored for local routes,
>> which results in all local connections having a src address that is the
>> same as the local dst address. Fix this by respecting the preferred source
>> address when it is provided for local routes.
>>
>> test script:
>>
>> #!/bin/bash
>> ip addr add 10.1.1.1/24 dev eth0
>> ip addr add 10.1.1.2/24 dev eth0
>> ip rule add priority 245 table 245
>> ip route add 10.1.1.0/24 dev eth0 proto kernel scope link src
>> 10.1.1.2 table 245 <===source ip 10.1.1.2 to be preferred
>>
>> ip addr show dev eth0
>> ip route list table main
>> ip route list table 245
>>
>>
>> tcpdump -nn -i eth0 host 10.1.1.9 and icmp &
>>
>> ping 10.1.1.9
>>
>>
>>
>> --before commit 9fc3bbb4a752
>>
>> the source is from ip 10.1.1.2 as expected
>>
>> --after commit 9fc3bbb4a752
>>
>> the source is from ip 10.1.1.1 which not expected since I have high
>> priority table 245 with source ip 10.1.1.2
>>
>> is this regression of commit 9fc3bbb4a752 ?
>
> Hm, it works here on 3.11.3. ARP request uses
> 10.1.1.2 and ICMP packet has such source. May be something with
> the ping tool you are using? Check 'strace ping -c 1 10.1.1.9', may
> be it binds to first device IP?
>
> Regards
>
> --
> Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: [PATCH net-next] 8390 ei_debug : Reenable the use of debugging in 8390 based chips
From: Matthew Whitehead @ 2013-10-15 15:35 UTC (permalink / raw)
To: netdev
In-Reply-To: <1381782794-11334-1-git-send-email-tedheadster@gmail.com>
Dave,
please decline this patch set and instead use the later one posted with subject
"[net-next REPOST] 8390 ei_debug : Reenable the use of debugging in 8390 based chips"
- Matthew
^ permalink raw reply
* Re: [PATCH RFC 5/5] net: macb: Adjust tx_clk when link speed changes
From: Sören Brinkmann @ 2013-10-15 15:34 UTC (permalink / raw)
To: Michal Simek; +Cc: Nicolas Ferre, netdev, David Miller, linux-kernel
In-Reply-To: <dd225b7c-ee2a-4747-9a50-55b77a114376@DB9EHSMHS006.ehs.local>
On Tue, Oct 15, 2013 at 09:58:09AM +0200, Michal Simek wrote:
> On 10/15/2013 09:54 AM, Nicolas Ferre wrote:
> > On 15/10/2013 01:59, Soren Brinkmann :
> >> Adjust the ethernet clock according to the negotiated link speed.
> >>
> >> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> >
> > I will need more time to study this one.
> >
> > Moreover, I will have to add the "tx_clk" to every user of this driver before switchin to the addition of this clock.
>
> As I am reading this patch, Soren just protected this
> case that if this clk is not specified then it is not used.
That is how I sketched things in this patch. But as I said, I'm not
fully convinced this approach fits all or is the best. So, if anybody
has a better approach, let us know.
Sören
^ permalink raw reply
* Re: [PATCH v3 net-next] openvswitch: fix vport-netdev unregister
From: Jesse Gross @ 2013-10-15 15:31 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: David S. Miller, Pravin B Shelar, Jiri Pirko, Cong Wang,
dev@openvswitch.org, netdev
In-Reply-To: <1381722652-3689-1-git-send-email-ast@plumgrid.com>
On Sun, Oct 13, 2013 at 8:50 PM, Alexei Starovoitov <ast@plumgrid.com> wrote:
> diff --git a/net/openvswitch/dp_notify.c b/net/openvswitch/dp_notify.c
> index c323567..ffa429a 100644
> --- a/net/openvswitch/dp_notify.c
> +++ b/net/openvswitch/dp_notify.c
> @@ -59,15 +59,9 @@ void ovs_dp_notify_wq(struct work_struct *work)
> struct hlist_node *n;
>
> hlist_for_each_entry_safe(vport, n, &dp->ports[i], dp_hash_node) {
> - struct netdev_vport *netdev_vport;
> -
> if (vport->ops->type != OVS_VPORT_TYPE_NETDEV)
> continue;
> -
> - netdev_vport = netdev_vport_priv(vport);
> - if (netdev_vport->dev->reg_state == NETREG_UNREGISTERED ||
> - netdev_vport->dev->reg_state == NETREG_UNREGISTERING)
> - dp_detach_port_notify(vport);
> + dp_detach_port_notify(vport);
Doesn't this free *all* ports of type OVS_VPORT_TYPE_NETDEV when any
one of them is removed?
^ permalink raw reply
* Re: [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern
From: Alexander Gordeev @ 2013-10-15 15:30 UTC (permalink / raw)
To: Mark Lord
Cc: H. Peter Anvin, Benjamin Herrenschmidt, linux-kernel,
Bjorn Helgaas, Ralf Baechle, Michael Ellerman, Martin Schwidefsky,
Ingo Molnar, Tejun Heo, Dan Williams, Andy King, Jon Mason,
Matt Porter, linux-pci, linux-mips, linuxppc-dev, linux390,
linux-s390, x86, linux-ide, iss_storagedev, linux-nvme,
linux-rdma, netdev, e1000-dev
In-Reply-To: <52585FB3.7080508@start.ca>
On Fri, Oct 11, 2013 at 04:29:39PM -0400, Mark Lord wrote:
> > static int xx_alloc_msix_irqs(struct xx_dev *dev, int nvec)
> > {
> > nvec = roundup_pow_of_two(nvec); /* assume 0 > nvec <= 16 */
> >
> > xx_disable_all_irqs(dev);
> >
> > pci_lock_msi(dev->pdev);
> >
> > rc = pci_get_msix_limit(dev->pdev, nvec);
> > if (rc < 0)
> > goto err;
> >
> > nvec = min(nvec, rc); /* if limit is more than requested */
> > nvec = rounddown_pow_of_two(nvec); /* (a) */
> >
> > xx_prep_for_msix_vectors(dev, nvec);
> >
> > rc = pci_enable_msix(dev->pdev, dev->irqs, nvec); /* (b) */
> > if (rc < 0)
> > goto err;
> >
> > pci_unlock_msi(dev->pdev);
> >
> > dev->num_vectors = nvec; /* (b) */
> > return 0;
> >
> > err:
> > pci_unlock_msi(dev->pdev);
> >
> > kerr(dev->name, "pci_enable_msix() failed, err=%d", rc);
> > dev->num_vectors = 0;
> > return rc;
> > }
>
> That would still need a loop, to handle the natural race between
> the calls to pci_get_msix_limit() and pci_enable_msix() -- the driver and device
> can and should fall back to a smaller number of vectors when pci_enable_msix() fails.
Could you please explain why the value returned by pci_get_msix_limit()
might change before pci_enable_msix() returned, while both protected by
pci_lock_msi()?
Anyway, although the loop-free code (IMHO) reads better, pci_lock_msi()
it is not a part of the original proposal and the more I think about it
the less I like it.
--
Regards,
Alexander Gordeev
agordeev@redhat.com
^ permalink raw reply
* Re: DomU's network interface will hung when Dom0 running 32bit
From: jianhai luan @ 2013-10-15 15:19 UTC (permalink / raw)
To: Ian Campbell, Wei Liu; +Cc: xen-devel, netdev, ANNIE LI
In-Reply-To: <1381848632.21901.42.camel@kazak.uk.xensource.com>
On 2013-10-15 22:50, Ian Campbell wrote:
> On Tue, 2013-10-15 at 15:49 +0100, Wei Liu wrote:
>> On Tue, Oct 15, 2013 at 10:29:15PM +0800, jianhai luan wrote:
>>> On 2013-10-15 20:58, Wei Liu wrote:
>>>> On Tue, Oct 15, 2013 at 07:26:31PM +0800, jianhai luan wrote:
>>>> [...]
>>>>>>>> Can you propose a patch?
>>>>>>> Because credit_timeout.expire always after jiffies, i judge the
>>>>>>> value over the range of time_after_eq() by time_before(now,
>>>>>>> vif->credit_timeout.expires). please check the patch.
>>>>>> I don't think this really fix the issue for you. You still have chance
>>>>>> that now wraps around and falls between expires and next_credit. In that
>>>>>> case it's stalled again.
>>>>> if time_before(now, vif->credit_timeout.expires) is true, time wrap
>>>>> and do operation. Otherwise time_before(now,
>>>>> vif->credit_timeout.expires) isn't true, now -
>>>>> vif->credit_timeout.expires should be letter than ULONG_MAX/2.
>>>>> Because next_credit large than vif->credit_timeout.expires
>>>>> (next_crdit = vif->credit_timeout.expires +
>>>>> msecs_to_jiffies(vif->credit_usec/1000)), the delta between now and
>>>>> next_credit should be in range of time_after_eq(). So
>>>>> time_after_eq() do correctly judge.
>>>>>
>>>> Not sure I understand you. Consider "now" is placed like this:
>>>>
>>>> expires now next_credit
>>>> ----time increases this direction--->
>>>>
>>>> * time_after_eq(now, next_credit) -> false
>>>> * time_before(now, expires) -> false
>>> If now is placed in above environment, the result will be correct
>>> (Sending package will be not allowed until next_credit).
>> No, it is not necessarily correct. Keep in mind that "now" wraps around,
>> which is the issue you try to fix. You still have a window to stall your
>> frontend.
> Remember that time_after_eq is supposed to work even with wraparound
> occurring, so long as the two times are less than MAX_LONG/2 apart.
Sorry for my misunderstand explanation. I mean that
* time_after_eq()/time_before_eq() fix the jiffies wraparound, so
please think about jiffies in line increasing.
* time_after_eq()/time_before_eq() have the range (0, MAX_LONG/2),
the judge will be wrong if out of the range.
So please think about three kind environment
- expires now next_credit
--------time increases this direction ---------->
- expires [next_credit now next_credit+MAX_LONG/2
--------time increase this direction ----------->
- expires next_credit next_credit+MAX_LONG/2 now
--------time increadse this direction ---------->
The first environment should be netfront consume all credit_byte before
next_credit, So we should pending one timer to calculator the new
credit_byte, and don't transmit until next_credit.
the second environment should be calculator the credit_byte because
netfront don't consume all credit_byte before next_credit, and
time_after_eq() do correct judge.
the third environment should be calculator in time because netfront
don't consume all credit_byte until next_credit.But time_after_eq do
error judge (time_after_eq(now, next_credit) is false), so the
remaining_byte isn't be increased.
and I work on the third environment. You know now >
next_credit+MAX_LONG/2, time_before(now, expire) should be
true(time_before(now, expire) is false in first environment)
>
>>> * time_after_eq(now, next_credit) --> false will include two environment:
>>> expires now next_credit
>>> -----------time increases this direction ---->
>>>
>>> Or
>>> expires next_credit next_credit + MAX_LONG/2 now
>>> -----------time increases this direction ---->
>>>
>>>
>>> the first environment should be correct to control transmit. the
>>> second environment is our included environment.
>>>
>>> Jason
>>>> Then it's stuck again. You're merely narrowing the window, not fixing
>>>> the real problem.
>>>>
>>>> Wei.
>>>>
>>>>> Jason
>>>>>> Wei.
>
^ permalink raw reply
* Re: [PATCH] net: sctp: fix a cacc_saw_newack missetting issue
From: Chang @ 2013-10-15 15:13 UTC (permalink / raw)
To: Vlad Yasevich, nhorman; +Cc: davem, linux-sctp, netdev, linux-kernel
In-Reply-To: <525D525E.8010508@gmail.com>
Thanks, I've got it and will submit a new patch later.
On 10/15/2013 04:34 PM, Vlad Yasevich wrote:
> On 10/15/2013 10:27 AM, Chang wrote:
>>
>> On 10/15/2013 04:11 PM, Vlad Yasevich wrote:
>>> On 10/14/2013 09:33 AM, Chang Xiangzhong wrote:
>>>> For for each TSN t being newly acked (Not only cumulatively,
>>>> but also SELECTIVELY) cacc_saw_newack should be set to 1.
>>>>
>>>> Signed-off-by: Xiangzhong Chang <changxiangzhong@gmail.com>
>>>> ---
>>>> net/sctp/outqueue.c | 42
>>>> +++++++++++++++++++++---------------------
>>>> 1 file changed, 21 insertions(+), 21 deletions(-)
>>>>
>>>> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
>>>> index 94df758..d86032b 100644
>>>> --- a/net/sctp/outqueue.c
>>>> +++ b/net/sctp/outqueue.c
>>>> @@ -1398,6 +1398,27 @@ static void sctp_check_transmitted(struct
>>>> sctp_outq *q,
>>>> forward_progress = true;
>>>> }
>>>>
>>>> + if (!tchunk->tsn_gap_acked) {
>>>
>>> You can remove this test since the block just above already performs
>>> it. Just fold this code into the block above.
>>>
>>> -vlad
>>>
>> Sorry, I'm not sure if I fully understand you. There are code blocks
>> which checking the tchunk->tsn_gap_acked. In addition, they check other
>> states as well.
>
> The flow is:
>
> if (sctp_acked(sack, tsn)) {
> ...
> if (transport) {
> ....
> }
>
> if (!tchunk->tsn_gap_acked) {
> ....
> }
>
> if (TSN_lte(tsn, sack_ctsn)) {
> ....
> /* SFR-CACC ...
> }
>
> Since you are moving this up, you can simply re-use
> the if (!tchunk->tsn_gap_acked) immediately above.
>
>>>> + /*
>>>> + * SFR-CACC algorithm:
>>>> + * 2) If the SACK contains gap acks
>>>> + * and the flag CHANGEOVER_ACTIVE is
>>>> + * set the receiver of the SACK MUST
>>>> + * take the following action:
>>>> + *
>>>> + * B) For each TSN t being acked that
>>>> + * has not been acked in any SACK so
>>>> + * far, set cacc_saw_newack to 1 for
>>>> + * the destination that the TSN was
>>>> + * sent to.
>>>> + */
>>>> + if (transport &&
>>>> + sack->num_gap_ack_blocks &&
>>>> + q->asoc->peer.primary_path->cacc.
>>>> + changeover_active)
>>>> + transport->cacc.cacc_saw_newack = 1;
> ^^^^
>
> Don't need that many spaces...
>
> -vlad
>>>> + }
>>>> +
>>>> if (TSN_lte(tsn, sack_ctsn)) {
>>>> /* RFC 2960 6.3.2 Retransmission Timer Rules
>>>> *
>>>> @@ -1411,27 +1432,6 @@ static void sctp_check_transmitted(struct
>>>> sctp_outq *q,
>>>> restart_timer = 1;
>>>> forward_progress = true;
>>>>
>>>> - if (!tchunk->tsn_gap_acked) {
>>>> - /*
>>>> - * SFR-CACC algorithm:
>>>> - * 2) If the SACK contains gap acks
>>>> - * and the flag CHANGEOVER_ACTIVE is
>>>> - * set the receiver of the SACK MUST
>>>> - * take the following action:
>>>> - *
>>>> - * B) For each TSN t being acked that
>>>> - * has not been acked in any SACK so
>>>> - * far, set cacc_saw_newack to 1 for
>>>> - * the destination that the TSN was
>>>> - * sent to.
>>>> - */
>>>> - if (transport &&
>>>> - sack->num_gap_ack_blocks &&
>>>> - q->asoc->peer.primary_path->cacc.
>>>> - changeover_active)
>>>> - transport->cacc.cacc_saw_newack
>>>> - = 1;
>>>> - }
>>>>
>>>> list_add_tail(&tchunk->transmitted_list,
>>>> &q->sacked);
>>>>
>>>
>>
>
^ permalink raw reply
* [PATCH net-next 2/4] net/mlx4: Fix typo, move similar defs to same location
From: Amir Vadai @ 2013-10-15 14:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Eyal Perry, Amir Vadai, Or Gerlitz
In-Reply-To: <1381848924-18992-1-git-send-email-amirv@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Small code cleanup:
1. change MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN to MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN
2. put MLX4_SET_PORT_PRIO2TC and MLX4_SET_PORT_SCHEDULER in the same union with the
other MLX4_SET_PORT_yyy
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +-
include/linux/mlx4/cmd.h | 6 ++----
include/linux/mlx4/device.h | 2 +-
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index fa37b7a..85d9166 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1733,7 +1733,7 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
/* Unregister Mac address for the port */
mlx4_en_put_qp(priv);
- if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN))
+ if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN))
mdev->mac_removed[priv->port] = 1;
/* Free RX Rings */
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 0d63daa..a377484 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -652,7 +652,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
QUERY_DEV_CAP_RSVD_LKEY_OFFSET);
MLX4_GET(field, outbox, QUERY_DEV_CAP_FW_REASSIGN_MAC);
if (field & 1<<6)
- dev_cap->flags2 |= MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN;
+ dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN;
MLX4_GET(dev_cap->max_icm_sz, outbox,
QUERY_DEV_CAP_MAX_ICM_SZ_OFFSET);
if (dev_cap->flags & MLX4_DEV_CAP_FLAG_COUNTERS)
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index cd1fdf7..8df61bc 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -154,10 +154,6 @@ enum {
MLX4_CMD_QUERY_IF_STAT = 0X54,
MLX4_CMD_SET_IF_STAT = 0X55,
- /* set port opcode modifiers */
- MLX4_SET_PORT_PRIO2TC = 0x8,
- MLX4_SET_PORT_SCHEDULER = 0x9,
-
/* register/delete flow steering network rules */
MLX4_QP_FLOW_STEERING_ATTACH = 0x65,
MLX4_QP_FLOW_STEERING_DETACH = 0x66,
@@ -182,6 +178,8 @@ enum {
MLX4_SET_PORT_VLAN_TABLE = 0x3,
MLX4_SET_PORT_PRIO_MAP = 0x4,
MLX4_SET_PORT_GID_TABLE = 0x5,
+ MLX4_SET_PORT_PRIO2TC = 0x8,
+ MLX4_SET_PORT_SCHEDULER = 0x9,
};
enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 24ce6bd..9ad0c18 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -155,7 +155,7 @@ enum {
MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1,
MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2,
MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3,
- MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4,
+ MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 4,
MLX4_DEV_CAP_FLAG2_TS = 1LL << 5,
MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6,
MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7,
--
1.8.3.4
^ permalink raw reply related
* [PATCH net-next 3/4] net/mlx4: Unused local variable in mlx4_opreq_action
From: Amir Vadai @ 2013-10-15 14:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Eyal Perry, Amir Vadai
In-Reply-To: <1381848924-18992-1-git-send-email-amirv@mellanox.com>
Clean up warning added by commit fe6f700d "net/mlx4_core: Respond to
operation request by firmware".
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/fw.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index a377484..c151e7a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -1713,7 +1713,6 @@ void mlx4_opreq_action(struct work_struct *work)
u32 *outbox;
u32 modifier;
u16 token;
- u16 type_m;
u16 type;
int err;
u32 num_qps;
@@ -1746,7 +1745,6 @@ void mlx4_opreq_action(struct work_struct *work)
MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET);
MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET);
MLX4_GET(type, outbox, GET_OP_REQ_TYPE_OFFSET);
- type_m = type >> 12;
type &= 0xfff;
switch (type) {
--
1.8.3.4
^ permalink raw reply related
* [PATCH net-next 4/4] net/mlx4_core: Load higher level modules according to ports type
From: Amir Vadai @ 2013-10-15 14:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Eyal Perry, Amir Vadai
In-Reply-To: <1381848924-18992-1-git-send-email-amirv@mellanox.com>
From: Eyal Perry <eyalpe@mellanox.com>
Mellanox ConnectX architecture is: mlx4_core is the lower level
PCI driver which register on the PCI id, and protocol specific drivers
are depended on it: mlx4_en - for Ethernet and mlx4_ib for Infiniband.
NIC could have multiple ports which can change their type dynamically.
We use the request_module() call to load the relevant protocol driver
when needed: on loading time or at port type change event.
Signed-off-by: Eyal Perry <eyalpe@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/main.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 60c9f4f..179d267 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -42,6 +42,7 @@
#include <linux/io-mapping.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
+#include <linux/kmod.h>
#include <linux/mlx4/device.h>
#include <linux/mlx4/doorbell.h>
@@ -650,6 +651,27 @@ err_mem:
return err;
}
+static void mlx4_request_modules(struct mlx4_dev *dev)
+{
+ int port;
+ int has_ib_port = false;
+ int has_eth_port = false;
+#define EN_DRV_NAME "mlx4_en"
+#define IB_DRV_NAME "mlx4_ib"
+
+ for (port = 1; port <= dev->caps.num_ports; port++) {
+ if (dev->caps.port_type[port] == MLX4_PORT_TYPE_IB)
+ has_ib_port = true;
+ else if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH)
+ has_eth_port = true;
+ }
+
+ if (has_ib_port)
+ request_module_nowait(IB_DRV_NAME);
+ if (has_eth_port)
+ request_module_nowait(EN_DRV_NAME);
+}
+
/*
* Change the port configuration of the device.
* Every user of this function must hold the port mutex.
@@ -681,6 +703,11 @@ int mlx4_change_port_types(struct mlx4_dev *dev,
}
mlx4_set_port_mask(dev);
err = mlx4_register_device(dev);
+ if (err) {
+ mlx4_err(dev, "Failed to register device\n");
+ goto out;
+ }
+ mlx4_request_modules(dev);
}
out:
@@ -2305,6 +2332,8 @@ slave_start:
if (err)
goto err_port;
+ mlx4_request_modules(dev);
+
mlx4_sense_init(dev);
mlx4_start_sense(dev);
--
1.8.3.4
^ 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