* Re: [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag
[not found] <1488181923-9649-1-git-send-email-rasesh.mody@cavium.com>
@ 2017-03-02 13:04 ` Ferruh Yigit
2017-03-06 20:02 ` Mody, Rasesh
` (21 more replies)
0 siblings, 22 replies; 24+ messages in thread
From: Ferruh Yigit @ 2017-03-02 13:04 UTC (permalink / raw)
To: Rasesh Mody, dev; +Cc: Dept-EngDPDKDev, dpdk stable
On 2/27/2017 7:51 AM, Rasesh Mody wrote:
> dcbx-update-flag is incorrectly converted to boolean before assigining
> it to ramrod data, fix this typecasting. Also, added more debug
> messages in the dcbx code paths.
>
> Fixes: 26ae839d06e9 ("qede: add DCBX support")
>
> Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
> ---
<...>
Not to this patch, but for the whole patchset,
thank you for splitting fixes into small chunks, this makes review easier.
And for patches you want them in stable tree, please
- CC those patches to stable mail list (stable@dpdk.org)
- and add a new tag in commit log just below "Fixes: " line, like:
"
Fixes: xxxxxxxxxxxx ("...")
Cc: stable@dpdk.org
Signed-off-by: ....
Acked-by: ....
"
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
@ 2017-03-06 20:02 ` Mody, Rasesh
2017-03-18 6:48 ` [dpdk-stable] [PATCH v2 " Rasesh Mody
` (20 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Mody, Rasesh @ 2017-03-06 20:02 UTC (permalink / raw)
To: Ferruh Yigit, dev; +Cc: Dept-Eng DPDK Dev, dpdk stable
> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
> Sent: Thursday, March 02, 2017 5:04 AM
>
> On 2/27/2017 7:51 AM, Rasesh Mody wrote:
> > dcbx-update-flag is incorrectly converted to boolean before assigining
> > it to ramrod data, fix this typecasting. Also, added more debug
> > messages in the dcbx code paths.
> >
> > Fixes: 26ae839d06e9 ("qede: add DCBX support")
> >
> > Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
> > ---
> <...>
>
> Not to this patch, but for the whole patchset, thank you for splitting fixes into
> small chunks, this makes review easier.
>
> And for patches you want them in stable tree, please
> - CC those patches to stable mail list (stable@dpdk.org)
> - and add a new tag in commit log just below "Fixes: " line, like:
Thanks for the feedback. We'll address this and rest of the feedback on this patch set in v2 series submission.
>
> "
>
> Fixes: xxxxxxxxxxxx ("...")
> Cc: stable@dpdk.org
>
> Signed-off-by: ....
> Acked-by: ....
> "
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 01/21] net/qede/base: fix incorrect typecasting of flag
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
2017-03-06 20:02 ` Mody, Rasesh
@ 2017-03-18 6:48 ` Rasesh Mody
2017-03-20 17:15 ` Ferruh Yigit
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 02/21] net/qede/base: fix to set pointers to NULL after freeing Rasesh Mody
` (19 subsequent siblings)
21 siblings, 1 reply; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:48 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
dcbx-update-flag is incorrectly converted to boolean before assigining
it to ramrod data, fix this typecasting. Also, added more debug
messages in the dcbx code paths.
Fixes: 26ae839d06e9 ("qede: add DCBX support")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_dcbx.c | 42 +++++++++++++++++++++++++-----------
1 file changed, 29 insertions(+), 13 deletions(-)
diff --git a/drivers/net/qede/base/ecore_dcbx.c b/drivers/net/qede/base/ecore_dcbx.c
index 9fbddec..7380fd8 100644
--- a/drivers/net/qede/base/ecore_dcbx.c
+++ b/drivers/net/qede/base/ecore_dcbx.c
@@ -100,7 +100,7 @@ ecore_dcbx_dp_protocol(struct ecore_hwfn *p_hwfn,
void
ecore_dcbx_set_params(struct ecore_dcbx_results *p_data,
struct ecore_hwfn *p_hwfn,
- bool enable, bool update, u8 prio, u8 tc,
+ bool enable, u8 prio, u8 tc,
enum dcbx_protocol_type type,
enum ecore_pci_personality personality)
{
@@ -140,7 +140,7 @@ ecore_dcbx_set_params(struct ecore_dcbx_results *p_data,
static void
ecore_dcbx_update_app_info(struct ecore_dcbx_results *p_data,
struct ecore_hwfn *p_hwfn,
- bool enable, bool update, u8 prio, u8 tc,
+ bool enable, u8 prio, u8 tc,
enum dcbx_protocol_type type)
{
enum ecore_pci_personality personality;
@@ -157,7 +157,7 @@ ecore_dcbx_update_app_info(struct ecore_dcbx_results *p_data,
personality = ecore_dcbx_app_update[i].personality;
name = ecore_dcbx_app_update[i].name;
- ecore_dcbx_set_params(p_data, p_hwfn, enable, update,
+ ecore_dcbx_set_params(p_data, p_hwfn, enable,
prio, tc, type, personality);
}
}
@@ -227,7 +227,9 @@ ecore_dcbx_process_tlv(struct ecore_hwfn *p_hwfn,
enum _ecore_status_t rc = ECORE_SUCCESS;
int i;
- DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "Num APP entries = %d\n", count);
+ DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
+ "Num APP entries = %d pri_tc_tbl = 0x%x dcbx_version = %u\n",
+ count, pri_tc_tbl, dcbx_version);
ieee = (dcbx_version == DCBX_CONFIG_VERSION_IEEE);
/* Parse APP TLV */
@@ -236,6 +238,8 @@ ecore_dcbx_process_tlv(struct ecore_hwfn *p_hwfn,
DCBX_APP_PROTOCOL_ID);
priority_map = ECORE_MFW_GET_FIELD(p_tbl[i].entry,
DCBX_APP_PRI_MAP);
+ DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "Id = 0x%x pri_map = %u\n",
+ protocol_id, priority_map);
rc = ecore_dcbx_get_app_priority(priority_map, &priority);
if (rc == ECORE_INVAL) {
DP_ERR(p_hwfn, "Invalid priority\n");
@@ -254,7 +258,7 @@ ecore_dcbx_process_tlv(struct ecore_hwfn *p_hwfn,
*/
enable = !(type == DCBX_PROTOCOL_ETH);
- ecore_dcbx_update_app_info(p_data, p_hwfn, enable, true,
+ ecore_dcbx_update_app_info(p_data, p_hwfn, enable,
priority, tc, type);
}
}
@@ -271,7 +275,7 @@ ecore_dcbx_process_tlv(struct ecore_hwfn *p_hwfn,
continue;
enable = (type == DCBX_PROTOCOL_ETH) ? false : !!dcbx_version;
- ecore_dcbx_update_app_info(p_data, p_hwfn, enable, true,
+ ecore_dcbx_update_app_info(p_data, p_hwfn, enable,
priority, tc, type);
}
@@ -473,8 +477,9 @@ ecore_dcbx_get_pfc_data(struct ecore_hwfn *p_hwfn,
p_params->pfc.prio[7] = !!(pfc_map & DCBX_PFC_PRI_EN_BITMAP_PRI_7);
DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
- "PFC params: willing %d, pfc_bitmap %d\n",
- p_params->pfc.willing, pfc_map);
+ "PFC params: willing %d, pfc_bitmap %u max_tc = %u enabled = %d\n",
+ p_params->pfc.willing, pfc_map, p_params->pfc.max_tc,
+ p_params->pfc.enabled);
}
static void
@@ -493,10 +498,10 @@ ecore_dcbx_get_ets_data(struct ecore_hwfn *p_hwfn,
p_params->max_ets_tc = ECORE_MFW_GET_FIELD(p_ets->flags,
DCBX_ETS_MAX_TCS);
DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
- "ETS params: willing %d, ets_cbs %d pri_tc_tbl_0 %x"
- " max_ets_tc %d\n",
- p_params->ets_willing, p_params->ets_cbs,
- p_ets->pri_tc_tbl[0], p_params->max_ets_tc);
+ "ETS params: willing %d, enabled = %d ets_cbs %d pri_tc_tbl_0 %x max_ets_tc %d\n",
+ p_params->ets_willing, p_params->ets_enabled,
+ p_params->ets_cbs, p_ets->pri_tc_tbl[0],
+ p_params->max_ets_tc);
/* 8 bit tsa and bw data corresponding to each of the 8 TC's are
* encoded in a type u32 array of size 2.
@@ -582,6 +587,7 @@ ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
if (!enabled) {
p_operational->enabled = enabled;
p_operational->valid = false;
+ DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "Dcbx is disabled\n");
return ECORE_INVAL;
}
@@ -927,7 +933,7 @@ void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src,
struct pf_update_ramrod_data *p_dest)
{
struct protocol_dcb_data *p_dcb_data;
- bool update_flag = false;
+ u8 update_flag;
p_dest->pf_id = p_src->pf_id;
@@ -1038,6 +1044,12 @@ ecore_dcbx_set_ets_data(struct ecore_hwfn *p_hwfn,
p_ets->tc_bw_tbl[i] = OSAL_CPU_TO_BE32(p_ets->tc_bw_tbl[i]);
p_ets->tc_tsa_tbl[i] = OSAL_CPU_TO_BE32(p_ets->tc_tsa_tbl[i]);
}
+
+ DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
+ "flags = 0x%x pri_tc = 0x%x tc_bwl[] = {0x%x, 0x%x} tc_tsa = {0x%x, 0x%x}\n",
+ p_ets->flags, p_ets->pri_tc_tbl[0], p_ets->tc_bw_tbl[0],
+ p_ets->tc_bw_tbl[1], p_ets->tc_tsa_tbl[0],
+ p_ets->tc_tsa_tbl[1]);
}
static void
@@ -1109,6 +1121,8 @@ ecore_dcbx_set_app_data(struct ecore_hwfn *p_hwfn,
*entry |= ((u32)(p_params->app_entry[i].prio) <<
DCBX_APP_PRI_MAP_SHIFT);
}
+
+ DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "flags = 0x%x\n", p_app->flags);
}
static enum _ecore_status_t
@@ -1171,6 +1185,8 @@ ecore_dcbx_set_dscp_params(struct ecore_hwfn *p_hwfn,
p_hwfn->p_dcbx_info->dscp_nig_update = true;
+ DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "flags = 0x%x\n", p_dscp_map->flags);
+
return ECORE_SUCCESS;
}
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 02/21] net/qede/base: fix to set pointers to NULL after freeing
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
2017-03-06 20:02 ` Mody, Rasesh
2017-03-18 6:48 ` [dpdk-stable] [PATCH v2 " Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 03/21] net/qede/base: fix forcing driver default resc allocation Rasesh Mody
` (18 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Set pointers to NULL after freeing the allocations. Change OSAL_FREE
macro to take care of this and cleanup relevant code.
Fixes: 26ae839d06e9 ("qede: add DCBX support")
Fixes: ec94dbc57362 ("qede: add base driver")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/bcm_osal.h | 6 +++++-
drivers/net/qede/base/ecore_cxt.c | 3 ---
drivers/net/qede/base/ecore_dev.c | 10 +---------
drivers/net/qede/base/ecore_hw.c | 1 -
drivers/net/qede/base/ecore_mcp.c | 1 -
drivers/net/qede/base/ecore_sriov.c | 2 --
drivers/net/qede/base/ecore_vf.c | 1 -
7 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index a20b318..88246b7 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -90,7 +90,11 @@ typedef int bool;
#define OSAL_ZALLOC(dev, GFP, size) rte_zmalloc("qede", size, 0)
#define OSAL_CALLOC(dev, GFP, num, size) rte_calloc("qede", num, size, 0)
#define OSAL_VALLOC(dev, size) rte_malloc("qede", size, 0)
-#define OSAL_FREE(dev, memory) rte_free((void *)memory)
+#define OSAL_FREE(dev, memory) \
+ do { \
+ rte_free((void *)memory); \
+ memory = OSAL_NULL; \
+ } while (0)
#define OSAL_VFREE(dev, memory) OSAL_FREE(dev, memory)
#define OSAL_MEM_ZERO(mem, size) bzero(mem, size)
#define OSAL_MEMCPY(dst, src, size) rte_memcpy(dst, src, size)
diff --git a/drivers/net/qede/base/ecore_cxt.c b/drivers/net/qede/base/ecore_cxt.c
index 5ea4f5c..b73a6ac 100644
--- a/drivers/net/qede/base/ecore_cxt.c
+++ b/drivers/net/qede/base/ecore_cxt.c
@@ -766,7 +766,6 @@ static void ecore_cxt_src_t2_free(struct ecore_hwfn *p_hwfn)
p_mngr->t2[i].size);
OSAL_FREE(p_hwfn->p_dev, p_mngr->t2);
- p_mngr->t2 = OSAL_NULL;
}
static enum _ecore_status_t ecore_cxt_src_t2_alloc(struct ecore_hwfn *p_hwfn)
@@ -1157,8 +1156,6 @@ void ecore_cxt_mngr_free(struct ecore_hwfn *p_hwfn)
ecore_ilt_shadow_free(p_hwfn);
OSAL_MUTEX_DEALLOC(&p_hwfn->p_cxt_mngr->mutex);
OSAL_FREE(p_hwfn->p_dev, p_hwfn->p_cxt_mngr);
-
- p_hwfn->p_cxt_mngr = OSAL_NULL;
}
void ecore_cxt_mngr_setup(struct ecore_hwfn *p_hwfn)
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 0518fc7..426ff46 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -136,13 +136,9 @@ static void ecore_qm_info_free(struct ecore_hwfn *p_hwfn)
struct ecore_qm_info *qm_info = &p_hwfn->qm_info;
OSAL_FREE(p_hwfn->p_dev, qm_info->qm_pq_params);
- qm_info->qm_pq_params = OSAL_NULL;
OSAL_FREE(p_hwfn->p_dev, qm_info->qm_vport_params);
- qm_info->qm_vport_params = OSAL_NULL;
OSAL_FREE(p_hwfn->p_dev, qm_info->qm_port_params);
- qm_info->qm_port_params = OSAL_NULL;
OSAL_FREE(p_hwfn->p_dev, qm_info->wfq_data);
- qm_info->wfq_data = OSAL_NULL;
}
void ecore_resc_free(struct ecore_dev *p_dev)
@@ -153,7 +149,6 @@ void ecore_resc_free(struct ecore_dev *p_dev)
return;
OSAL_FREE(p_dev, p_dev->fw_data);
- p_dev->fw_data = OSAL_NULL;
OSAL_FREE(p_dev, p_dev->reset_stats);
@@ -161,9 +156,7 @@ void ecore_resc_free(struct ecore_dev *p_dev)
struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
OSAL_FREE(p_dev, p_hwfn->p_tx_cids);
- p_hwfn->p_tx_cids = OSAL_NULL;
OSAL_FREE(p_dev, p_hwfn->p_rx_cids);
- p_hwfn->p_rx_cids = OSAL_NULL;
}
for_each_hwfn(p_dev, i) {
@@ -668,8 +661,7 @@ enum _ecore_status_t ecore_resc_alloc(struct ecore_dev *p_dev)
DP_ERR(p_hwfn, "Cannot allocate 0x%x EQ elements."
"The maximum of a u16 chain is 0x%x\n",
n_eqes, 0xFFFF);
- rc = ECORE_INVAL;
- goto alloc_err;
+ goto alloc_no_mem;
}
p_eq = ecore_eq_alloc(p_hwfn, (u16)n_eqes);
diff --git a/drivers/net/qede/base/ecore_hw.c b/drivers/net/qede/base/ecore_hw.c
index 22da415..49d52c0 100644
--- a/drivers/net/qede/base/ecore_hw.c
+++ b/drivers/net/qede/base/ecore_hw.c
@@ -86,7 +86,6 @@ void ecore_ptt_pool_free(struct ecore_hwfn *p_hwfn)
if (p_hwfn->p_ptt_pool)
OSAL_SPIN_LOCK_DEALLOC(&p_hwfn->p_ptt_pool->lock);
OSAL_FREE(p_hwfn->p_dev, p_hwfn->p_ptt_pool);
- p_hwfn->p_ptt_pool = OSAL_NULL;
}
struct ecore_ptt *ecore_ptt_acquire(struct ecore_hwfn *p_hwfn)
diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c
index f634d98..4863ff9 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -104,7 +104,6 @@ enum _ecore_status_t ecore_mcp_free(struct ecore_hwfn *p_hwfn)
OSAL_SPIN_LOCK_DEALLOC(&p_hwfn->mcp_info->lock);
}
OSAL_FREE(p_hwfn->p_dev, p_hwfn->mcp_info);
- p_hwfn->mcp_info = OSAL_NULL;
return ECORE_SUCCESS;
}
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index 4c1a078..d28946e 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -554,7 +554,6 @@ void ecore_iov_free(struct ecore_hwfn *p_hwfn)
void ecore_iov_free_hw_info(struct ecore_dev *p_dev)
{
OSAL_FREE(p_dev, p_dev->p_iov_info);
- p_dev->p_iov_info = OSAL_NULL;
}
enum _ecore_status_t ecore_iov_hw_info(struct ecore_hwfn *p_hwfn)
@@ -597,7 +596,6 @@ enum _ecore_status_t ecore_iov_hw_info(struct ecore_hwfn *p_hwfn)
DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
"IOV capabilities, but no VFs are published\n");
OSAL_FREE(p_dev, p_dev->p_iov_info);
- p_dev->p_iov_info = OSAL_NULL;
return ECORE_SUCCESS;
}
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index 17ba4d1..0779e11 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -1142,7 +1142,6 @@ enum _ecore_status_t ecore_vf_pf_release(struct ecore_hwfn *p_hwfn)
}
OSAL_FREE(p_hwfn->p_dev, p_hwfn->vf_iov_info);
- p_hwfn->vf_iov_info = OSAL_NULL;
return rc;
}
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 03/21] net/qede/base: fix forcing driver default resc allocation
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (2 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 02/21] net/qede/base: fix to set pointers to NULL after freeing Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 04/21] net/qede/base: fix TM block ILT initialization Rasesh Mody
` (17 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Remove the forcing of the driver's default resource allocation.
Fixes: 77f7222124de ("net/qede: add PCI ids for new chip variant")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_dev.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 426ff46..8663d7a 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -2298,12 +2298,11 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn,
*p_resc_start = resc_info.offset;
if (*p_resc_num != dflt_resc_num || *p_resc_start != dflt_resc_start) {
- DP_NOTICE(p_hwfn, false,
- "Resource %d [%s]: MFW allocation [num %d, start %d]"
- " differs from default values [num %d, start %d]%s\n",
- res_id, ecore_hw_get_resc_name(res_id), *p_resc_num,
- *p_resc_start, dflt_resc_num, dflt_resc_start,
- drv_resc_alloc ? " - Applying default values" : "");
+ DP_INFO(p_hwfn,
+ "Resource %d [%s]: MFW allocation [num %d, start %d] differs from default values [num %d, start %d]%s\n",
+ res_id, ecore_hw_get_resc_name(res_id), *p_resc_num,
+ *p_resc_start, dflt_resc_num, dflt_resc_start,
+ drv_resc_alloc ? " - Applying default values" : "");
if (drv_resc_alloc) {
*p_resc_num = dflt_resc_num;
*p_resc_start = dflt_resc_start;
@@ -2332,12 +2331,7 @@ static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn,
#endif
for (res_id = 0; res_id < ECORE_MAX_RESC; res_id++) {
- /* @@@TMP for AH:
- * Force the driver's default resource allocation in case there
- * is a diff with the MFW allocation value.
- */
- rc = ecore_hw_set_resc_info(p_hwfn, res_id,
- b_ah || drv_resc_alloc);
+ rc = ecore_hw_set_resc_info(p_hwfn, res_id, drv_resc_alloc);
if (rc != ECORE_SUCCESS)
return rc;
}
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 04/21] net/qede/base: fix TM block ILT initialization
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (3 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 03/21] net/qede/base: fix forcing driver default resc allocation Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 05/21] net/qede/base: fix printout Rasesh Mody
` (16 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fix Timer(TM) block Internal Lookup Table(or ILT for logical to
physical address translation) initialization for SRIOV's coexistence
with other protocols.
Fixes: ec94dbc57362 ("qede: add base driver")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_cxt.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/net/qede/base/ecore_cxt.c b/drivers/net/qede/base/ecore_cxt.c
index b73a6ac..2635030 100644
--- a/drivers/net/qede/base/ecore_cxt.c
+++ b/drivers/net/qede/base/ecore_cxt.c
@@ -276,14 +276,24 @@ struct ecore_tm_iids {
static OSAL_INLINE void ecore_cxt_tm_iids(struct ecore_cxt_mngr *p_mngr,
struct ecore_tm_iids *iids)
{
+ bool tm_vf_required = false;
+ bool tm_required = false;
u32 i, j;
for (i = 0; i < MAX_CONN_TYPES; i++) {
struct ecore_conn_type_cfg *p_cfg = &p_mngr->conn_cfg[i];
- if (tm_cid_proto(i)) {
+ if (tm_cid_proto(i) || tm_required) {
+ if (p_cfg->cid_count)
+ tm_required = true;
+
iids->pf_cids += p_cfg->cid_count;
- iids->per_vf_cids += p_cfg->cids_per_vf;
+ }
+
+ if (tm_cid_proto(i) || tm_vf_required) {
+ if (p_cfg->cids_per_vf)
+ tm_vf_required = true;
+
}
if (tm_tid_proto(i)) {
@@ -718,12 +728,11 @@ enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct ecore_hwfn *p_hwfn)
ecore_ilt_cli_adv_line(p_hwfn, p_cli, p_blk, &curr_line,
ILT_CLI_TM);
+ p_cli->vf_total_lines = curr_line - p_blk->start_line;
for (i = 1; i < p_mngr->vf_count; i++) {
ecore_ilt_cli_adv_line(p_hwfn, p_cli, p_blk, &curr_line,
ILT_CLI_TM);
}
-
- p_cli->vf_total_lines = curr_line - p_blk->start_line;
}
/* TSDM (SRQ CONTEXT) */
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 05/21] net/qede/base: fix printout
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (4 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 04/21] net/qede/base: fix TM block ILT initialization Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 06/21] net/qede/base: fix VF init after malicious VF FLR Rasesh Mody
` (15 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Prints in ecore_get_dev_info showed only chip revision,
and did that as number instead of letter.
I.e., BB A0 --> BB0, BB B0 --> BB1, AH A0 --> AH0, AH A1 --> AH0.
Correct the printing scheme into
{AH, BB} {A, B}{0, 1}
Fixes: ec94dbc57362 ("qede: add base driver")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 8663d7a..5555174 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -2891,9 +2891,9 @@ static enum _ecore_status_t ecore_get_dev_info(struct ecore_dev *p_dev)
MISCS_REG_CHIP_METAL);
MASK_FIELD(CHIP_METAL, p_dev->chip_metal);
DP_INFO(p_dev->hwfns,
- "Chip details - %s%d, Num: %04x Rev: %04x Bond id: %04x Metal: %04x\n",
+ "Chip details - %s %c%d, Num: %04x Rev: %04x Bond id: %04x Metal: %04x\n",
ECORE_IS_BB(p_dev) ? "BB" : "AH",
- CHIP_REV_IS_A0(p_dev) ? 0 : 1,
+ 'A' + p_dev->chip_rev, (int)p_dev->chip_metal,
p_dev->chip_num, p_dev->chip_rev, p_dev->chip_bond_id,
p_dev->chip_metal);
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 06/21] net/qede/base: fix VF init after malicious VF FLR
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (5 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 05/21] net/qede/base: fix printout Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 07/21] net/qede/base: fix numbering L2 VF queues Rasesh Mody
` (14 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fix VF init after malicious VF FLR.
Fixes: 40c926ba2626 ("net/qede/base: support to initiate PF FLR")
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_sriov.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index d28946e..40671dd 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -3073,6 +3073,13 @@ ecore_iov_execute_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
return rc;
}
+ /* Workaround to make VF-PF channel ready, as FW
+ * doesn't do that as a part of FLR.
+ */
+ REG_WR(p_hwfn,
+ GTT_BAR0_MAP_REG_USDM_RAM +
+ USTORM_VF_PF_CHANNEL_READY_OFFSET(vfid), 1);
+
/* VF_STOPPED has to be set only after final cleanup
* but prior to re-enabling the VF.
*/
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 07/21] net/qede/base: fix numbering L2 VF queues
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (6 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 06/21] net/qede/base: fix VF init after malicious VF FLR Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 08/21] net/qede/base: fix index printing of multi-bit attentions Rasesh Mody
` (13 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
There are some constellations where Due to lack of resource allocation
in MFW, There would be an insufficient number of L2 queues for all the
VFs.
This introduces a new feature ECORE_VF_L2_QUE which correctly numbers
the number of VF queues. Notice it might be larger than the actual
number of VFs in configuration space, in which case its the ecore
client responsibility not to try activating that many.
As part of the fix, also correct the nubmering of the VF queues. As
their numbering is dependent on the SBs of the PF, which might only be
partially used by L2 [as half would be assigned for RDMA which doesn't
require L2 queues], we make the numbering consecutive with that of the
L2 queues only.
Fixes: ec94dbc57362 ("qede: add base driver")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore.h | 1 +
drivers/net/qede/base/ecore_dev.c | 19 +++++++++++++++----
drivers/net/qede/base/ecore_int.c | 35 +++++++++++++++++++++++++++++++++--
3 files changed, 49 insertions(+), 6 deletions(-)
diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h
index b41ff4a..b2f4910 100644
--- a/drivers/net/qede/base/ecore.h
+++ b/drivers/net/qede/base/ecore.h
@@ -288,6 +288,7 @@ enum ecore_feature {
ECORE_RDMA_CNQ,
ECORE_ISCSI_CQ,
ECORE_FCOE_CQ,
+ ECORE_VF_L2_QUE,
ECORE_MAX_FEATURES,
};
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 5555174..b5873bd 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -2057,6 +2057,7 @@ static void get_function_id(struct ecore_hwfn *p_hwfn)
static void ecore_hw_set_feat(struct ecore_hwfn *p_hwfn)
{
u32 *feat_num = p_hwfn->hw_info.feat_num;
+ struct ecore_sb_cnt_info sb_cnt_info;
int num_features = 1;
/* L2 Queues require each: 1 status block. 1 L2 queue */
@@ -2065,11 +2066,21 @@ static void ecore_hw_set_feat(struct ecore_hwfn *p_hwfn)
RESC_NUM(p_hwfn, ECORE_SB) / num_features,
RESC_NUM(p_hwfn, ECORE_L2_QUEUE));
+ OSAL_MEM_ZERO(&sb_cnt_info, sizeof(sb_cnt_info));
+ ecore_int_get_num_sbs(p_hwfn, &sb_cnt_info);
+ feat_num[ECORE_VF_L2_QUE] =
+ OSAL_MIN_T(u32,
+ RESC_NUM(p_hwfn, ECORE_L2_QUEUE) -
+ FEAT_NUM(p_hwfn, ECORE_PF_L2_QUE),
+ sb_cnt_info.sb_iov_cnt);
+
DP_VERBOSE(p_hwfn, ECORE_MSG_PROBE,
- "#PF_L2_QUEUES=%d #ROCE_CNQ=%d #SBS=%d num_features=%d\n",
- feat_num[ECORE_PF_L2_QUE],
- feat_num[ECORE_RDMA_CNQ],
- RESC_NUM(p_hwfn, ECORE_SB), num_features);
+ "#PF_L2_QUEUES=%d VF_L2_QUEUES=%d #ROCE_CNQ=%d #SBS=%d num_features=%d\n",
+ (int)FEAT_NUM(p_hwfn, ECORE_PF_L2_QUE),
+ (int)FEAT_NUM(p_hwfn, ECORE_VF_L2_QUE),
+ (int)FEAT_NUM(p_hwfn, ECORE_RDMA_CNQ),
+ RESC_NUM(p_hwfn, ECORE_SB),
+ num_features);
}
static enum resource_id_enum
diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c
index 96f283b..1a157a5 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -1964,6 +1964,31 @@ enum _ecore_status_t ecore_int_igu_read_cam(struct ecore_hwfn *p_hwfn,
}
}
}
+
+ /* There's a possibility the igu_sb_cnt_iov doesn't properly reflect
+ * the number of VF SBs [especially for first VF on engine, as we can't
+ * diffrentiate between empty entries and its entries].
+ * Since we don't really support more SBs than VFs today, prevent any
+ * such configuration by sanitizing the number of SBs to equal the
+ * number of VFs.
+ */
+ if (IS_PF_SRIOV(p_hwfn)) {
+ u16 total_vfs = p_hwfn->p_dev->p_iov_info->total_vfs;
+
+ if (total_vfs < p_igu_info->free_blks) {
+ DP_VERBOSE(p_hwfn, (ECORE_MSG_INTR | ECORE_MSG_IOV),
+ "Limiting number of SBs for IOV - %04x --> %04x\n",
+ p_igu_info->free_blks,
+ p_hwfn->p_dev->p_iov_info->total_vfs);
+ p_igu_info->free_blks = total_vfs;
+ } else if (total_vfs > p_igu_info->free_blks) {
+ DP_NOTICE(p_hwfn, true,
+ "IGU has only %04x SBs for VFs while the device has %04x VFs\n",
+ p_igu_info->free_blks, total_vfs);
+ return ECORE_INVAL;
+ }
+ }
+
p_igu_info->igu_sb_cnt_iov = p_igu_info->free_blks;
DP_VERBOSE(p_hwfn, ECORE_MSG_INTR,
@@ -2101,8 +2126,14 @@ u16 ecore_int_queue_id_from_sb_id(struct ecore_hwfn *p_hwfn, u16 sb_id)
(sb_id < p_info->igu_base_sb + p_info->igu_sb_cnt)) {
return sb_id - p_info->igu_base_sb;
} else if ((sb_id >= p_info->igu_base_sb_iov) &&
- (sb_id < p_info->igu_base_sb_iov + p_info->igu_sb_cnt_iov)) {
- return sb_id - p_info->igu_base_sb_iov + p_info->igu_sb_cnt;
+ (sb_id < p_info->igu_base_sb_iov +
+ p_info->igu_sb_cnt_iov)) {
+ /* We want the first VF queue to be adjacent to the
+ * last PF queue. Since L2 queues can be partial to
+ * SBs, we'll use the feature instead.
+ */
+ return sb_id - p_info->igu_base_sb_iov +
+ FEAT_NUM(p_hwfn, ECORE_PF_L2_QUE);
} else {
DP_NOTICE(p_hwfn, true, "SB %d not in range for function\n",
sb_id);
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 08/21] net/qede/base: fix index printing of multi-bit attentions
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (7 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 07/21] net/qede/base: fix numbering L2 VF queues Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 09/21] net/qede/base: fix to prevent VF promisc config Rasesh Mody
` (12 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fix the logic for identifying which bit amongst the Multi-bit
attention sources is set.
Fixes: e6051bd6b07d ("qede: add interrupt handling support")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_int.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c
index 1a157a5..3d6c2f1 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -913,18 +913,24 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
bit = bit_idx;
bit_len = ATTENTION_LENGTH(p_aeu->flags);
- if (p_aeu->flags & ATTENTION_PAR_INT) {
+ if (p_aeu->flags & ATTENTION_PAR) {
/* Skip Parity */
bit++;
bit_len--;
}
+ /* Find the bits relating to HW-block, then
+ * shift so they'll become LSB.
+ */
bitmask = bits & (((1 << bit_len) - 1) << bit);
+ bitmask >>= bit;
+
if (bitmask) {
u32 flags = p_aeu->flags;
char bit_name[30];
+ u8 num;
- bit = (u8)OSAL_FIND_FIRST_BIT(&bitmask,
+ num = (u8)OSAL_FIND_FIRST_BIT(&bitmask,
bit_len);
/* Some bits represent more than a
@@ -936,11 +942,17 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
ATTENTION_LENGTH(flags) > 1))
OSAL_SNPRINTF(bit_name, 30,
p_aeu->bit_name,
- bit);
+ num);
else
OSAL_STRNCPY(bit_name,
p_aeu->bit_name,
30);
+
+ /* We now need to pass bitmask in its
+ * correct position.
+ */
+ bitmask <<= bit;
+
/* Handle source of the attention */
ecore_int_deassertion_aeu_bit(p_hwfn,
p_aeu,
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 09/21] net/qede/base: fix to prevent VF promisc config
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (8 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 08/21] net/qede/base: fix index printing of multi-bit attentions Rasesh Mody
@ 2017-03-18 6:50 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 10/21] net/qede/base: add attention bits for AH chip Rasesh Mody
` (11 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:50 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
VFs are seeing the number of MACs available to them as '0',
and as a result configure themselves as PROMISC. This fix is to
prevent that.
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_vf.c | 16 +++++++---------
drivers/net/qede/base/ecore_vf_api.h | 10 +++++-----
drivers/net/qede/qede_eth_if.h | 2 +-
drivers/net/qede/qede_ethdev.c | 15 ++++++++-------
4 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index 0779e11..97a0cbe 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -1373,23 +1373,21 @@ void ecore_vf_get_num_vlan_filters(struct ecore_hwfn *p_hwfn,
*num_vlan_filters = p_vf->acquire_resp.resc.num_vlan_filters;
}
-/* @DPDK */
-void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
- u32 *num_mac)
+void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
+ u32 *num_sbs)
{
struct ecore_vf_iov *p_vf;
p_vf = p_hwfn->vf_iov_info;
- *num_mac = p_vf->acquire_resp.resc.num_mac_filters;
+ *num_sbs = (u32)p_vf->acquire_resp.resc.num_sbs;
}
-void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
- u32 *num_sbs)
+void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
+ u32 *num_mac_filters)
{
- struct ecore_vf_iov *p_vf;
+ struct ecore_vf_iov *p_vf = p_hwfn->vf_iov_info;
- p_vf = p_hwfn->vf_iov_info;
- *num_sbs = (u32)p_vf->acquire_resp.resc.num_sbs;
+ *num_mac_filters = p_vf->acquire_resp.resc.num_mac_filters;
}
bool ecore_vf_check_mac(struct ecore_hwfn *p_hwfn, u8 *mac)
diff --git a/drivers/net/qede/base/ecore_vf_api.h b/drivers/net/qede/base/ecore_vf_api.h
index 571fd37..77b93ff 100644
--- a/drivers/net/qede/base/ecore_vf_api.h
+++ b/drivers/net/qede/base/ecore_vf_api.h
@@ -78,18 +78,18 @@ void ecore_vf_get_port_mac(struct ecore_hwfn *p_hwfn,
void ecore_vf_get_num_vlan_filters(struct ecore_hwfn *p_hwfn,
u8 *num_vlan_filters);
+void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
+ u32 *num_sbs);
+
/**
* @brief Get number of MAC filters allocated for VF by ecore
*
- * @param p_hwfn
- * @param num_mac_filters - allocated MAC filters
+ * @param p_hwfn
+ * @param num_rxqs - allocated MAC filters
*/
void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
u32 *num_mac_filters);
-void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
- u32 *num_sbs);
-
/**
* @brief Check if VF can set a MAC address
*
diff --git a/drivers/net/qede/qede_eth_if.h b/drivers/net/qede/qede_eth_if.h
index 8b96df0..37b1b74 100644
--- a/drivers/net/qede/qede_eth_if.h
+++ b/drivers/net/qede/qede_eth_if.h
@@ -41,7 +41,7 @@ struct qed_dev_eth_info {
struct ether_addr port_mac;
uint16_t num_vlan_filters;
- uint32_t num_mac_addrs;
+ uint32_t num_mac_filters;
/* Legacy VF - this affects the datapath */
bool is_legacy;
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 0494dbd..c372181 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -485,7 +485,8 @@ qede_mac_int_ops(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast,
}
} else { /* Unicast */
if (add) {
- if (qdev->num_uc_addr >= qdev->dev_info.num_mac_addrs) {
+ if (qdev->num_uc_addr >=
+ qdev->dev_info.num_mac_filters) {
DP_ERR(edev,
"Ucast filter table limit exceeded,"
" Please enable promisc mode\n");
@@ -528,9 +529,9 @@ qede_mac_addr_remove(struct rte_eth_dev *eth_dev, uint32_t index)
PMD_INIT_FUNC_TRACE(edev);
- if (index >= qdev->dev_info.num_mac_addrs) {
+ if (index >= qdev->dev_info.num_mac_filters) {
DP_ERR(edev, "Index %u is above MAC filter limit %u\n",
- index, qdev->dev_info.num_mac_addrs);
+ index, qdev->dev_info.num_mac_filters);
return;
}
@@ -981,7 +982,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
QEDE_MAX_RSS_CNT(qdev), ECORE_MAX_VF_CHAINS_PER_PF);
dev_info->max_tx_queues = dev_info->max_rx_queues;
- dev_info->max_mac_addrs = qdev->dev_info.num_mac_addrs;
+ dev_info->max_mac_addrs = qdev->dev_info.num_mac_filters;
dev_info->max_vfs = 0;
dev_info->reta_size = ECORE_RSS_IND_TABLE_SIZE;
dev_info->hash_key_size = ECORE_RSS_KEY_SIZE * sizeof(uint32_t);
@@ -2177,17 +2178,17 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
adapter->ops->common->set_id(edev, edev->name, QEDE_PMD_VERSION);
if (!is_vf)
- adapter->dev_info.num_mac_addrs =
+ adapter->dev_info.num_mac_filters =
(uint32_t)RESC_NUM(ECORE_LEADING_HWFN(edev),
ECORE_MAC);
else
ecore_vf_get_num_mac_filters(ECORE_LEADING_HWFN(edev),
- &adapter->dev_info.num_mac_addrs);
+ (uint32_t *)&adapter->dev_info.num_mac_filters);
/* Allocate memory for storing MAC addr */
eth_dev->data->mac_addrs = rte_zmalloc(edev->name,
(ETHER_ADDR_LEN *
- adapter->dev_info.num_mac_addrs),
+ adapter->dev_info.num_mac_filters),
RTE_CACHE_LINE_SIZE);
if (eth_dev->data->mac_addrs == NULL) {
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 10/21] net/qede/base: add attention bits for AH chip
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (9 preceding siblings ...)
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 09/21] net/qede/base: fix to prevent VF promisc config Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 11/21] net/qede/base: fix printout Rasesh Mody
` (10 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
add attention bits for CHIP_NUM_AH_xxx
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_int.c | 77 +++++++++++++++++++++++++++++++------
1 file changed, 65 insertions(+), 12 deletions(-)
diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c
index 3d6c2f1..cb719a3 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -59,6 +59,11 @@ struct aeu_invert_reg_bit {
#define ATTENTION_OFFSET_MASK (0x000ff000)
#define ATTENTION_OFFSET_SHIFT (12)
+#define ATTENTION_BB_MASK (0x00700000)
+#define ATTENTION_BB_SHIFT (20)
+#define ATTENTION_BB(value) ((value) << ATTENTION_BB_SHIFT)
+#define ATTENTION_BB_DIFFERENT (1 << 23)
+
#define ATTENTION_CLEAR_ENABLE (1 << 28)
unsigned int flags;
@@ -468,7 +473,26 @@ static enum _ecore_status_t ecore_tm_attn_cb(struct ecore_hwfn *p_hwfn)
return ECORE_INVAL;
}
-/* Notice aeu_invert_reg must be defined in the same order of bits as HW; */
+/* Instead of major changes to the data-structure, we have a some 'special'
+ * identifiers for sources that changed meaning between adapters.
+ */
+enum aeu_invert_reg_special_type {
+ AEU_INVERT_REG_SPECIAL_CNIG_0,
+ AEU_INVERT_REG_SPECIAL_CNIG_1,
+ AEU_INVERT_REG_SPECIAL_CNIG_2,
+ AEU_INVERT_REG_SPECIAL_CNIG_3,
+ AEU_INVERT_REG_SPECIAL_MAX,
+};
+
+static struct aeu_invert_reg_bit
+aeu_descs_special[AEU_INVERT_REG_SPECIAL_MAX] = {
+ {"CNIG port 0", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+ {"CNIG port 1", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+ {"CNIG port 2", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+ {"CNIG port 3", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+};
+
+/* Notice aeu_invert_reg must be defined in the same order of bits as HW; */
static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
{
{ /* After Invert 1 */
@@ -511,8 +535,18 @@ static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
OSAL_NULL, MAX_BLOCK_ID},
{"General Attention 35", ATTENTION_SINGLE | ATTENTION_CLEAR_ENABLE,
ecore_general_attention_35, MAX_BLOCK_ID},
- {"CNIG port %d", (4 << ATTENTION_LENGTH_SHIFT), OSAL_NULL,
- BLOCK_CNIG},
+ {"NWS Parity", ATTENTION_PAR | ATTENTION_BB_DIFFERENT |
+ ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_0),
+ OSAL_NULL, BLOCK_NWS},
+ {"NWS Interrupt", ATTENTION_SINGLE | ATTENTION_BB_DIFFERENT |
+ ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_1),
+ OSAL_NULL, BLOCK_NWS},
+ {"NWM Parity", ATTENTION_PAR | ATTENTION_BB_DIFFERENT |
+ ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_2),
+ OSAL_NULL, BLOCK_NWM},
+ {"NWM Interrupt", ATTENTION_SINGLE | ATTENTION_BB_DIFFERENT |
+ ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_3),
+ OSAL_NULL, BLOCK_NWM},
{"MCP CPU", ATTENTION_SINGLE, ecore_mcp_attn_cb, MAX_BLOCK_ID},
{"MCP Watchdog timer", ATTENTION_SINGLE, OSAL_NULL, MAX_BLOCK_ID},
{"MCP M2P", ATTENTION_SINGLE, OSAL_NULL, MAX_BLOCK_ID},
@@ -634,6 +668,27 @@ static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
};
+static struct aeu_invert_reg_bit *
+ecore_int_aeu_translate(struct ecore_hwfn *p_hwfn,
+ struct aeu_invert_reg_bit *p_bit)
+{
+ if (!ECORE_IS_BB(p_hwfn->p_dev))
+ return p_bit;
+
+ if (!(p_bit->flags & ATTENTION_BB_DIFFERENT))
+ return p_bit;
+
+ return &aeu_descs_special[(p_bit->flags & ATTENTION_BB_MASK) >>
+ ATTENTION_BB_SHIFT];
+}
+
+static bool ecore_int_is_parity_flag(struct ecore_hwfn *p_hwfn,
+ struct aeu_invert_reg_bit *p_bit)
+{
+ return !!(ecore_int_aeu_translate(p_hwfn, p_bit)->flags &
+ ATTENTION_PARITY);
+}
+
#define ATTN_STATE_BITS (0xfff)
#define ATTN_BITS_MASKABLE (0x3ff)
struct ecore_sb_attn_info {
@@ -868,7 +923,7 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
struct aeu_invert_reg_bit *p_bit = &p_aeu->bits[j];
- if ((p_bit->flags & ATTENTION_PARITY) &&
+ if (ecore_int_is_parity_flag(p_hwfn, p_bit) &&
!!(parities & (1 << bit_idx))) {
ecore_int_deassertion_parity(p_hwfn, p_bit,
bit_idx);
@@ -905,15 +960,12 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
unsigned long int bitmask;
u8 bit, bit_len;
+ /* Need to account bits with changed meaning */
p_aeu = &sb_attn_sw->p_aeu_desc[i].bits[j];
- /* No need to handle attention-only bits */
- if (p_aeu->flags == ATTENTION_PAR)
- continue;
-
bit = bit_idx;
bit_len = ATTENTION_LENGTH(p_aeu->flags);
- if (p_aeu->flags & ATTENTION_PAR) {
+ if (ecore_int_is_parity_flag(p_hwfn, p_aeu)) {
/* Skip Parity */
bit++;
bit_len--;
@@ -1215,12 +1267,13 @@ static void ecore_int_sb_attn_init(struct ecore_hwfn *p_hwfn,
for (i = 0; i < NUM_ATTN_REGS; i++) {
/* j is array index, k is bit index */
for (j = 0, k = 0; k < 32; j++) {
- unsigned int flags = aeu_descs[i].bits[j].flags;
+ struct aeu_invert_reg_bit *p_aeu;
- if (flags & ATTENTION_PARITY)
+ p_aeu = &aeu_descs[i].bits[j];
+ if (ecore_int_is_parity_flag(p_hwfn, p_aeu))
sb_info->parity_mask[i] |= 1 << k;
- k += ATTENTION_LENGTH(flags);
+ k += ATTENTION_LENGTH(p_aeu->flags);
}
DP_VERBOSE(p_hwfn, ECORE_MSG_INTR,
"Attn Mask [Reg %d]: 0x%08x\n",
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 11/21] net/qede/base: fix printout
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (10 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 10/21] net/qede/base: add attention bits for AH chip Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 12/21] net/qede/base: fix DORQ attention mask Rasesh Mody
` (9 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fixes: ec94dbc57362 ("qede: add base driver")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_mcp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c
index 4863ff9..e0d247b 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -1267,9 +1267,7 @@ enum _ecore_status_t ecore_mcp_handle_events(struct ecore_hwfn *p_hwfn,
ecore_mcp_handle_critical_error(p_hwfn, p_ptt);
break;
default:
- /* @DPDK */
- DP_NOTICE(p_hwfn, false,
- "Unimplemented MFW message %d\n", i);
+ DP_INFO(p_hwfn, "Unimplemented MFW message %d\n", i);
rc = ECORE_INVAL;
}
}
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 12/21] net/qede/base: fix DORQ attention mask
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (11 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 11/21] net/qede/base: fix printout Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 13/21] net/qede/base: fix out-of-bound memory access Rasesh Mody
` (8 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fix Doorbell Queue(DORQ) attention mask
Fixes: e6051bd6b07d ("qede: add interrupt handling support")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_int.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c
index cb719a3..b6b8e2d 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -419,7 +419,7 @@ ecore_general_attention_35(struct ecore_hwfn *p_hwfn)
#define ECORE_DORQ_ATTENTION_REASON_MASK (0xfffff)
#define ECORE_DORQ_ATTENTION_OPAQUE_MASK (0xffff)
-#define ECORE_DORQ_ATTENTION_SIZE_MASK (0x7f)
+#define ECORE_DORQ_ATTENTION_SIZE_MASK (0x7f0000)
#define ECORE_DORQ_ATTENTION_SIZE_SHIFT (16)
static enum _ecore_status_t ecore_dorq_attn_cb(struct ecore_hwfn *p_hwfn)
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 13/21] net/qede/base: fix out-of-bound memory access
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (12 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 12/21] net/qede/base: fix DORQ attention mask Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 14/21] net/qede/base: fix to remove redundant memset Rasesh Mody
` (7 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fix out-of-bound memory access on Management FW interaction for
resource allocation
Fixes: 252b88b58f70 ("net/qede/base: add selftest and query sensor info")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_mcp.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c
index e0d247b..cb3e0bd 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -2426,15 +2426,15 @@ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn,
u32 *p_mcp_resp, u32 *p_mcp_param)
{
struct ecore_mcp_mb_params mb_params;
- union drv_union_data *p_union_data;
+ union drv_union_data union_data;
enum _ecore_status_t rc;
OSAL_MEM_ZERO(&mb_params, sizeof(mb_params));
mb_params.cmd = DRV_MSG_GET_RESOURCE_ALLOC_MSG;
mb_params.param = ECORE_RESC_ALLOC_VERSION;
- p_union_data = (union drv_union_data *)p_resc_info;
- mb_params.p_data_src = p_union_data;
- mb_params.p_data_dst = p_union_data;
+ OSAL_MEMCPY(&union_data.resource, p_resc_info, sizeof(*p_resc_info));
+ mb_params.p_data_src = &union_data;
+ mb_params.p_data_dst = &union_data;
rc = ecore_mcp_cmd_and_union(p_hwfn, p_ptt, &mb_params);
if (rc != ECORE_SUCCESS)
return rc;
@@ -2442,6 +2442,8 @@ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn,
*p_mcp_resp = mb_params.mcp_resp;
*p_mcp_param = mb_params.mcp_param;
+ OSAL_MEMCPY(p_resc_info, &union_data.resource, sizeof(*p_resc_info));
+
DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
"MFW resource_info: version 0x%x, res_id 0x%x, size 0x%x,"
" offset 0x%x, vf_size 0x%x, vf_offset 0x%x, flags 0x%x\n",
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 14/21] net/qede/base: fix to remove redundant memset
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (13 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 13/21] net/qede/base: fix out-of-bound memory access Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 15/21] net/qede/base: fix remove the unneeded conversion to LE Rasesh Mody
` (6 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fixes: 22d07d939c3c ("net/qede/base: update")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_vf.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index 97a0cbe..9e1be1a 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -387,8 +387,6 @@ enum _ecore_status_t ecore_vf_hw_prepare(struct ecore_hwfn *p_hwfn)
return ECORE_NOMEM;
}
- OSAL_MEMSET(p_iov, 0, sizeof(*p_iov));
-
/* Allocate vf2pf msg */
p_iov->vf2pf_request = OSAL_DMA_ALLOC_COHERENT(p_hwfn->p_dev,
&p_iov->
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 15/21] net/qede/base: fix remove the unneeded conversion to LE
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (14 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 14/21] net/qede/base: fix to remove redundant memset Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 16/21] net/qede/base: fix first VF index calculation Rasesh Mody
` (5 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Remove the unneeded conversion to LE when writing to the 32-bit
XSDM_REG_OPERATION_GEN register
Fixes: ec94dbc57362 ("qede: add base driver")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_dev.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index b5873bd..318f3d2 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -788,10 +788,9 @@ enum _ecore_status_t ecore_final_cleanup(struct ecore_hwfn *p_hwfn,
DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
"Sending final cleanup for PFVF[%d] [Command %08x\n]",
- id, OSAL_CPU_TO_LE32(command));
+ id, command);
- ecore_wr(p_hwfn, p_ptt, XSDM_REG_OPERATION_GEN,
- OSAL_CPU_TO_LE32(command));
+ ecore_wr(p_hwfn, p_ptt, XSDM_REG_OPERATION_GEN, command);
/* Poll until completion */
while (!REG_RD(p_hwfn, addr) && count--)
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 16/21] net/qede/base: fix first VF index calculation
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (15 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 15/21] net/qede/base: fix remove the unneeded conversion to LE Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 17/21] net/qede/base: fix typo Rasesh Mody
` (4 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
When a server doesn't support ARI, VF offsets begin at a much higher
number. As a result, ecore miscalculates the first_vf_in_pf and
initialization fails since base driver incorrectly learns there are
no SBs for its VF [as its VFs are out of range].
Fixes: 22d07d939c3c ("net/qede/base: update")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_sriov.c | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index 40671dd..b85055b 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -599,14 +599,30 @@ enum _ecore_status_t ecore_iov_hw_info(struct ecore_hwfn *p_hwfn)
return ECORE_SUCCESS;
}
- /* Calculate the first VF index - this is a bit tricky; Basically,
- * VFs start at offset 16 relative to PF0, and 2nd engine VFs begin
- * after the first engine's VFs.
+ /* First VF index based on offset is tricky:
+ * - If ARI is supported [likely], offset - (16 - pf_id) would
+ * provide the number for eng0. 2nd engine Vfs would begin
+ * after the first engine's VFs.
+ * - If !ARI, VFs would start on next device.
+ * so offset - (256 - pf_id) would provide the number.
+ * Utilize the fact that (256 - pf_id) is achieved only be later
+ * to diffrentiate between the two.
*/
- p_dev->p_iov_info->first_vf_in_pf = p_hwfn->p_dev->p_iov_info->offset +
- p_hwfn->abs_pf_id - 16;
- if (ECORE_PATH_ID(p_hwfn))
- p_dev->p_iov_info->first_vf_in_pf -= MAX_NUM_VFS_BB;
+
+ if (p_hwfn->p_dev->p_iov_info->offset < (256 - p_hwfn->abs_pf_id)) {
+ u32 first = p_hwfn->p_dev->p_iov_info->offset +
+ p_hwfn->abs_pf_id - 16;
+
+ p_dev->p_iov_info->first_vf_in_pf = first;
+
+ if (ECORE_PATH_ID(p_hwfn))
+ p_dev->p_iov_info->first_vf_in_pf -= MAX_NUM_VFS_BB;
+ } else {
+ u32 first = p_hwfn->p_dev->p_iov_info->offset +
+ p_hwfn->abs_pf_id - 256;
+
+ p_dev->p_iov_info->first_vf_in_pf = first;
+ }
DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
"First VF in hwfn 0x%08x\n",
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 17/21] net/qede/base: fix typo
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (16 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 16/21] net/qede/base: fix first VF index calculation Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 18/21] net/qede/base: refactor return path Rasesh Mody
` (3 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fixes: 22d07d939c3c ("net/qede/base: update")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/mcp_public.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/qede/base/mcp_public.h b/drivers/net/qede/base/mcp_public.h
index 81567d1..308b7fe 100644
--- a/drivers/net/qede/base/mcp_public.h
+++ b/drivers/net/qede/base/mcp_public.h
@@ -1056,7 +1056,7 @@ union drv_union_data {
struct lan_stats_stc lan_stats;
struct fcoe_stats_stc fcoe_stats;
- struct iscsi_stats_stc icsci_stats;
+ struct iscsi_stats_stc iscsi_stats;
struct rdma_stats_stc rdma_stats;
struct ocbb_data_stc ocbb_info;
struct temperature_status_stc temp_info;
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 18/21] net/qede/base: refactor return path
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (17 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 17/21] net/qede/base: fix typo Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 19/21] net/qede/base: fix sriov typo Rasesh Mody
` (2 subsequent siblings)
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
No need to return - base on return at end of function.
Fixes: 22d07d939c3c ("net/qede/base: update")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_vf.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index 9e1be1a..05ceefd 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -126,7 +126,6 @@ ecore_send_msg2pf(struct ecore_hwfn *p_hwfn,
"VF <-- PF Timeout [Type %d]\n",
p_req->first_tlv.tl.type);
rc = ECORE_TIMEOUT;
- return rc;
} else {
DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
"PF response: %d [Type %d]\n",
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 19/21] net/qede/base: fix sriov typo
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (18 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 18/21] net/qede/base: refactor return path Rasesh Mody
@ 2017-03-18 6:53 ` Rasesh Mody
2017-03-18 6:57 ` [dpdk-stable] [PATCH v2 20/21] net/qede/base: fix resource lock minimum value Rasesh Mody
2017-03-18 6:57 ` [dpdk-stable] [PATCH v2 21/21] net/qede/base: fix to use NULL pointer Rasesh Mody
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:53 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Typo in ecore_sriov.c; Ending line with , instead of ;
Fixes: 379cbb2c446a ("net/qede/base: semantic change")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_sriov.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index b85055b..6912cf8 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -2016,7 +2016,7 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn,
params.queue_id = (u8)vf->vf_queues[req->rx_qid].fw_rx_qid;
params.vf_qid = req->rx_qid;
params.vport_id = vf->vport_id;
- params.stats_id = vf->abs_vf_id + 0x10,
+ params.stats_id = vf->abs_vf_id + 0x10;
params.sb = req->hw_sb;
params.sb_idx = req->sb_index;
@@ -2121,7 +2121,7 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn,
params.queue_id = (u8)vf->vf_queues[req->tx_qid].fw_tx_qid;
params.qzone_id = (u8)vf->vf_queues[req->tx_qid].fw_tx_qid;
params.vport_id = vf->vport_id;
- params.stats_id = vf->abs_vf_id + 0x10,
+ params.stats_id = vf->abs_vf_id + 0x10;
params.sb = req->hw_sb;
params.sb_idx = req->sb_index;
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 20/21] net/qede/base: fix resource lock minimum value
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (19 preceding siblings ...)
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 19/21] net/qede/base: fix sriov typo Rasesh Mody
@ 2017-03-18 6:57 ` Rasesh Mody
2017-03-18 6:57 ` [dpdk-stable] [PATCH v2 21/21] net/qede/base: fix to use NULL pointer Rasesh Mody
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:57 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Fixes: ababb5203de2 ("net/qede/base: semantic/formatting changes")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/mcp_public.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/qede/base/mcp_public.h b/drivers/net/qede/base/mcp_public.h
index 308b7fe..969dd5a 100644
--- a/drivers/net/qede/base/mcp_public.h
+++ b/drivers/net/qede/base/mcp_public.h
@@ -1238,7 +1238,7 @@ struct public_drv_mb {
#define RESOURCE_OPCODE_WRONG_OWNER 5
#define RESOURCE_OPCODE_UNKNOWN_CMD 255
/* dedicate resource 0 for dump */
- #define RESOURCE_DUMP (1 << 0)
+ #define RESOURCE_DUMP 0
#define DRV_MSG_CODE_GET_MBA_VERSION 0x00240000 /* Get MBA version */
/* Send crash dump commands with param[3:0] - opcode */
#define DRV_MSG_CODE_MDUMP_CMD 0x00250000
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-stable] [PATCH v2 21/21] net/qede/base: fix to use NULL pointer
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
` (20 preceding siblings ...)
2017-03-18 6:57 ` [dpdk-stable] [PATCH v2 20/21] net/qede/base: fix resource lock minimum value Rasesh Mody
@ 2017-03-18 6:57 ` Rasesh Mody
21 siblings, 0 replies; 24+ messages in thread
From: Rasesh Mody @ 2017-03-18 6:57 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Rasesh Mody, stable, Dept-EngDPDKDev
Use OSAL NULL where appropriate
Fixes: 22d07d939c3c ("net/qede/base: update")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_dev.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 318f3d2..da9cdc9 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -641,19 +641,20 @@ enum _ecore_status_t ecore_resc_alloc(struct ecore_dev *p_dev)
ecore_cxt_get_proto_cid_count(
p_hwfn,
PROTOCOLID_ROCE,
- 0);
+ OSAL_NULL);
num_cons *= 2;
} else {
num_cons = ecore_cxt_get_proto_cid_count(
p_hwfn,
PROTOCOLID_IWARP,
- 0);
+ OSAL_NULL);
}
n_eqes += num_cons + 2 * MAX_NUM_VFS_BB;
} else if (p_hwfn->hw_info.personality == ECORE_PCI_ISCSI) {
num_cons =
ecore_cxt_get_proto_cid_count(p_hwfn,
- PROTOCOLID_ISCSI, 0);
+ PROTOCOLID_ISCSI,
+ OSAL_NULL);
n_eqes += 2 * num_cons;
}
--
1.7.10.3
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-stable] [PATCH v2 01/21] net/qede/base: fix incorrect typecasting of flag
2017-03-18 6:48 ` [dpdk-stable] [PATCH v2 " Rasesh Mody
@ 2017-03-20 17:15 ` Ferruh Yigit
0 siblings, 0 replies; 24+ messages in thread
From: Ferruh Yigit @ 2017-03-20 17:15 UTC (permalink / raw)
To: Rasesh Mody, dev; +Cc: stable, Dept-EngDPDKDev
On 3/18/2017 6:48 AM, Rasesh Mody wrote:
> dcbx-update-flag is incorrectly converted to boolean before assigining
> it to ramrod data, fix this typecasting. Also, added more debug
> messages in the dcbx code paths.
>
> Fixes: 26ae839d06e9 ("qede: add DCBX support")
>
> Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2017-03-20 17:15 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1488181923-9649-1-git-send-email-rasesh.mody@cavium.com>
2017-03-02 13:04 ` [dpdk-stable] [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
2017-03-06 20:02 ` Mody, Rasesh
2017-03-18 6:48 ` [dpdk-stable] [PATCH v2 " Rasesh Mody
2017-03-20 17:15 ` Ferruh Yigit
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 02/21] net/qede/base: fix to set pointers to NULL after freeing Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 03/21] net/qede/base: fix forcing driver default resc allocation Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 04/21] net/qede/base: fix TM block ILT initialization Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 05/21] net/qede/base: fix printout Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 06/21] net/qede/base: fix VF init after malicious VF FLR Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 07/21] net/qede/base: fix numbering L2 VF queues Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 08/21] net/qede/base: fix index printing of multi-bit attentions Rasesh Mody
2017-03-18 6:50 ` [dpdk-stable] [PATCH v2 09/21] net/qede/base: fix to prevent VF promisc config Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 10/21] net/qede/base: add attention bits for AH chip Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 11/21] net/qede/base: fix printout Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 12/21] net/qede/base: fix DORQ attention mask Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 13/21] net/qede/base: fix out-of-bound memory access Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 14/21] net/qede/base: fix to remove redundant memset Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 15/21] net/qede/base: fix remove the unneeded conversion to LE Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 16/21] net/qede/base: fix first VF index calculation Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 17/21] net/qede/base: fix typo Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 18/21] net/qede/base: refactor return path Rasesh Mody
2017-03-18 6:53 ` [dpdk-stable] [PATCH v2 19/21] net/qede/base: fix sriov typo Rasesh Mody
2017-03-18 6:57 ` [dpdk-stable] [PATCH v2 20/21] net/qede/base: fix resource lock minimum value Rasesh Mody
2017-03-18 6:57 ` [dpdk-stable] [PATCH v2 21/21] net/qede/base: fix to use NULL pointer Rasesh Mody
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).