* [PATCH net 1/6] qede: Don't try removing unconfigured vlans
2016-07-27 11:45 [PATCH net 0/6] qed*: Small fixes series Yuval Mintz
@ 2016-07-27 11:45 ` Yuval Mintz
2016-07-27 11:45 ` [PATCH net 2/6] qed: Fix removal of spoof checking for VFs Yuval Mintz
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2016-07-27 11:45 UTC (permalink / raw)
To: davem, netdev; +Cc: Yuval Mintz
As part of ndo_vlan_rx_kill_vid() implementation,
qede is requesting firmware to remove the vlan filter.
This currently happens even if the vlan wasn't previously
added [In case device ran out of vlan credits].
For PFs this doesn't cause any issues as the firmware
would simply ignore the removal request. But for VFs their
parent PF is holding an accounting of the configured vlans,
and such a request would cause the PF to fail the VF's
removal request.
Simply fix this for both PFs & VFs and don't remove filters
that were not previously added.
Fixes: 7c1bfcad9f3c8 ("qede: Add vlan filtering offload support")
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
drivers/net/ethernet/qlogic/qede/qede_main.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index f8e11f9..8fe3cc1 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -2050,10 +2050,13 @@ static int qede_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
}
/* Remove vlan */
- rc = qede_set_ucast_rx_vlan(edev, QED_FILTER_XCAST_TYPE_DEL, vid);
- if (rc) {
- DP_ERR(edev, "Failed to remove VLAN %d\n", vid);
- return -EINVAL;
+ if (vlan->configured) {
+ rc = qede_set_ucast_rx_vlan(edev, QED_FILTER_XCAST_TYPE_DEL,
+ vid);
+ if (rc) {
+ DP_ERR(edev, "Failed to remove VLAN %d\n", vid);
+ return -EINVAL;
+ }
}
qede_del_vlan_from_list(edev, vlan);
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 2/6] qed: Fix removal of spoof checking for VFs
2016-07-27 11:45 [PATCH net 0/6] qed*: Small fixes series Yuval Mintz
2016-07-27 11:45 ` [PATCH net 1/6] qede: Don't try removing unconfigured vlans Yuval Mintz
@ 2016-07-27 11:45 ` Yuval Mintz
2016-07-27 11:45 ` [PATCH net 3/6] qed: Don't over-do producer cleanup for Rx Yuval Mintz
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2016-07-27 11:45 UTC (permalink / raw)
To: davem, netdev; +Cc: Yuval Mintz
Driver has reverse logic for checking the result of the
spoof-checking configuration. As a result, it would log that
the configuration failed [even though it succeeded], and will
no longer do anything when requested to remove the configuration,
as it's accounting of the feature will be incorrect.
Fixes: 6ddc7608258d5 ("qed*: IOV support spoof-checking")
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
drivers/net/ethernet/qlogic/qed/qed_sriov.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index c325ee8..875c105 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -1296,7 +1296,7 @@ static int __qed_iov_spoofchk_set(struct qed_hwfn *p_hwfn,
params.anti_spoofing_en = val;
rc = qed_sp_vport_update(p_hwfn, ¶ms, QED_SPQ_MODE_EBLOCK, NULL);
- if (rc) {
+ if (!rc) {
p_vf->spoof_chk = val;
p_vf->req_spoofchk_val = p_vf->spoof_chk;
DP_VERBOSE(p_hwfn, QED_MSG_IOV,
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 3/6] qed: Don't over-do producer cleanup for Rx
2016-07-27 11:45 [PATCH net 0/6] qed*: Small fixes series Yuval Mintz
2016-07-27 11:45 ` [PATCH net 1/6] qede: Don't try removing unconfigured vlans Yuval Mintz
2016-07-27 11:45 ` [PATCH net 2/6] qed: Fix removal of spoof checking for VFs Yuval Mintz
@ 2016-07-27 11:45 ` Yuval Mintz
2016-07-27 11:45 ` [PATCH net 4/6] qede: Reset statistics on explicit down Yuval Mintz
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2016-07-27 11:45 UTC (permalink / raw)
To: davem, netdev; +Cc: Yuval Mintz
Before requesting the firmware to start Rx queues,
driver goes and sets the queue producer in the device to 0.
But while the producer is 32-bit, the driver currently clears 64 bits,
effectively zeroing an additional CID's producer as well.
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
drivers/net/ethernet/qlogic/qed/qed_l2.c | 4 ++--
drivers/net/ethernet/qlogic/qed/qed_vf.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index aada4c7..ff388208 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -587,7 +587,7 @@ qed_sp_eth_rx_queue_start(struct qed_hwfn *p_hwfn,
u16 cqe_pbl_size, void __iomem **pp_prod)
{
struct qed_hw_cid_data *p_rx_cid;
- u64 init_prod_val = 0;
+ u32 init_prod_val = 0;
u16 abs_l2_queue = 0;
u8 abs_stats_id = 0;
int rc;
@@ -615,7 +615,7 @@ qed_sp_eth_rx_queue_start(struct qed_hwfn *p_hwfn,
MSTORM_PRODS_OFFSET(abs_l2_queue);
/* Init the rcq, rx bd and rx sge (if valid) producers to 0 */
- __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u64),
+ __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u32),
(u32 *)(&init_prod_val));
/* Allocate a CID for the queue */
diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c b/drivers/net/ethernet/qlogic/qed/qed_vf.c
index 72e69c0..c39e26a 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_vf.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c
@@ -353,7 +353,7 @@ int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
/* Learn the address of the producer from the response */
if (pp_prod) {
- u64 init_prod_val = 0;
+ u32 init_prod_val = 0;
*pp_prod = (u8 __iomem *)p_hwfn->regview + resp->offset;
DP_VERBOSE(p_hwfn, QED_MSG_IOV,
@@ -361,7 +361,7 @@ int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
rx_qid, *pp_prod, resp->offset);
/* Init the rcq, rx bd and rx sge (if valid) producers to 0 */
- __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u64),
+ __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u32),
(u32 *)&init_prod_val);
}
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 4/6] qede: Reset statistics on explicit down
2016-07-27 11:45 [PATCH net 0/6] qed*: Small fixes series Yuval Mintz
` (2 preceding siblings ...)
2016-07-27 11:45 ` [PATCH net 3/6] qed: Don't over-do producer cleanup for Rx Yuval Mintz
@ 2016-07-27 11:45 ` Yuval Mintz
2016-07-27 11:45 ` [PATCH net 5/6] qed: Correct min bandwidth for 100g Yuval Mintz
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2016-07-27 11:45 UTC (permalink / raw)
To: davem, netdev; +Cc: Yuval Mintz
Adding the necessary logic to prevet statistics reset
on inner-reload introduced a bug, and now statistics
are reset only when re-probing the driver.
Fixes: a0d26d5a4fc8e ("qed*: Don't reset statistics on inner reload")
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
drivers/net/ethernet/qlogic/qede/qede_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 8fe3cc1..14f79c3 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -3256,6 +3256,7 @@ static int qede_start_queues(struct qede_dev *edev, bool clear_stats)
start.vport_id = 0;
start.drop_ttl0 = true;
start.remove_inner_vlan = vlan_removal_en;
+ start.clear_stats = clear_stats;
rc = edev->ops->vport_start(cdev, &start);
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 5/6] qed: Correct min bandwidth for 100g
2016-07-27 11:45 [PATCH net 0/6] qed*: Small fixes series Yuval Mintz
` (3 preceding siblings ...)
2016-07-27 11:45 ` [PATCH net 4/6] qede: Reset statistics on explicit down Yuval Mintz
@ 2016-07-27 11:45 ` Yuval Mintz
2016-07-27 11:45 ` [PATCH net 6/6] qed: Prevent over-usage of vlan credits by PF Yuval Mintz
2016-07-31 3:34 ` [PATCH net 0/6] qed*: Small fixes series David Miller
6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2016-07-27 11:45 UTC (permalink / raw)
To: davem, netdev; +Cc: Yuval Mintz
Driver uses reverse logic when checking if minimum
bandwidth configuration applied, causing it to
configure the guarantee only on the first hw-function.
Fixes: a0d26d5a4fc8 ("qed*: Don't reset statistics on inner reload")
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
drivers/net/ethernet/qlogic/qed/qed_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index 2d89e8c..9e305d5 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -2089,7 +2089,7 @@ int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate)
rc = __qed_configure_vport_wfq(p_hwfn, p_ptt, vp_id, rate);
- if (!rc) {
+ if (rc) {
qed_ptt_release(p_hwfn, p_ptt);
return rc;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 6/6] qed: Prevent over-usage of vlan credits by PF
2016-07-27 11:45 [PATCH net 0/6] qed*: Small fixes series Yuval Mintz
` (4 preceding siblings ...)
2016-07-27 11:45 ` [PATCH net 5/6] qed: Correct min bandwidth for 100g Yuval Mintz
@ 2016-07-27 11:45 ` Yuval Mintz
2016-07-31 3:34 ` [PATCH net 0/6] qed*: Small fixes series David Miller
6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2016-07-27 11:45 UTC (permalink / raw)
To: davem, netdev; +Cc: Yuval Mintz
Each PF/VF has a limited number of vlan filters for
configuration purposes; This information is passed to qede
and is used to prevent over-usage - once a vlan is to be
configured and no filter credit is available, the driver
would switch into working in vlan-promisc mode.
Problem is the credit pool is shared by both PFs and VFs,
and currently PFs aren't deducting the filters that are
reserved for their VFs from their quota, which may lead
to some vlan filters failing unknowingly due to lack of credit.
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
drivers/net/ethernet/qlogic/qed/qed_l2.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index ff388208..4c46d14 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -1656,6 +1656,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
info->num_tc = 1;
if (IS_PF(cdev)) {
+ int max_vf_vlan_filters = 0;
+
if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
for_each_hwfn(cdev, i)
info->num_queues +=
@@ -1668,7 +1670,12 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
info->num_queues = cdev->num_hwfns;
}
- info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN);
+ if (IS_QED_SRIOV(cdev))
+ max_vf_vlan_filters = cdev->p_iov_info->total_vfs *
+ QED_ETH_VF_NUM_VLAN_FILTERS;
+ info->num_vlan_filters = RESC_NUM(&cdev->hwfns[0], QED_VLAN) -
+ max_vf_vlan_filters;
+
ether_addr_copy(info->port_mac,
cdev->hwfns[0].hw_info.hw_mac_addr);
} else {
--
1.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net 0/6] qed*: Small fixes series
2016-07-27 11:45 [PATCH net 0/6] qed*: Small fixes series Yuval Mintz
` (5 preceding siblings ...)
2016-07-27 11:45 ` [PATCH net 6/6] qed: Prevent over-usage of vlan credits by PF Yuval Mintz
@ 2016-07-31 3:34 ` David Miller
6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2016-07-31 3:34 UTC (permalink / raw)
To: Yuval.Mintz; +Cc: netdev
From: Yuval Mintz <Yuval.Mintz@qlogic.com>
Date: Wed, 27 Jul 2016 14:45:18 +0300
> This contains several small [and straight-forward] fixes to qed*
> drivers.
>
> Please consider applying this to `net'.
Series applied, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread