All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/3] qed*: dcbx fix series.
@ 2016-08-29 12:29 Sudarsana Reddy Kalluru
  2016-08-29 12:29 ` [PATCH net 1/3] qed*: Disallow dcbx configuration for VF interfaces Sudarsana Reddy Kalluru
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2016-08-29 12:29 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz, sudarsana.kalluru

The series contains several small fixes for qed* dcbx module.

Sudarsana Reddy Kalluru (3):
  qed*: Disallow dcbx configuration for VF interfaces.
  qed: Set selection-field while configuring the app entry in ieee mode.
  qed: Clear dcbx memory buffers before the usage.
---
Please consider applying this to 'net' branch.
---

 drivers/net/ethernet/qlogic/qed/qed_dcbx.c   | 18 +++++++++++++++++-
 drivers/net/ethernet/qlogic/qede/qede_main.c |  3 ++-
 2 files changed, 19 insertions(+), 2 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 1/3] qed*: Disallow dcbx configuration for VF interfaces.
  2016-08-29 12:29 [PATCH net 0/3] qed*: dcbx fix series Sudarsana Reddy Kalluru
@ 2016-08-29 12:29 ` Sudarsana Reddy Kalluru
  2016-08-29 12:29 ` [PATCH net 2/3] qed: Set selection-field while configuring the app entry in ieee mode Sudarsana Reddy Kalluru
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2016-08-29 12:29 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz, sudarsana.kalluru

Dcbx configuration is not supported for VF interfaces. Hence don't populate
the callbacks for VFs and also fail the dcbx-query for VFs.

Signed-off-by: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c   | 4 ++++
 drivers/net/ethernet/qlogic/qede/qede_main.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 226cb08..7ad1667 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -19,6 +19,7 @@
 #include "qed_dcbx.h"
 #include "qed_hsi.h"
 #include "qed_sp.h"
+#include "qed_sriov.h"
 #ifdef CONFIG_DCB
 #include <linux/qed/qed_eth_if.h>
 #endif
@@ -945,6 +946,9 @@ static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
 	struct qed_ptt *p_ptt;
 	int rc;
 
+	if (IS_VF(p_hwfn->cdev))
+		return -EINVAL;
+
 	p_ptt = qed_ptt_acquire(p_hwfn);
 	if (!p_ptt)
 		return -EBUSY;
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index a6eb6af..9544e4c 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -2520,7 +2520,8 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level,
 	edev->ops->register_ops(cdev, &qede_ll_ops, edev);
 
 #ifdef CONFIG_DCB
-	qede_set_dcbnl_ops(edev->ndev);
+	if (!IS_VF(edev))
+		qede_set_dcbnl_ops(edev->ndev);
 #endif
 
 	INIT_DELAYED_WORK(&edev->sp_task, qede_sp_task);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 2/3] qed: Set selection-field while configuring the app entry in ieee mode.
  2016-08-29 12:29 [PATCH net 0/3] qed*: dcbx fix series Sudarsana Reddy Kalluru
  2016-08-29 12:29 ` [PATCH net 1/3] qed*: Disallow dcbx configuration for VF interfaces Sudarsana Reddy Kalluru
@ 2016-08-29 12:29 ` Sudarsana Reddy Kalluru
  2016-08-29 12:29 ` [PATCH net 3/3] qed: Clear dcbx memory buffers before the usage Sudarsana Reddy Kalluru
  2016-09-01  4:04 ` [PATCH net 0/3] qed*: dcbx fix series David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2016-08-29 12:29 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz, sudarsana.kalluru

Management firmware requires the selection-field (SF) to be set for
configuring the application/protocol entry in IEEE mode. Without this
setting, the app entry will be configured incorrectly in MFW.

Signed-off-by: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 7ad1667..192a886 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -1063,23 +1063,31 @@ qed_dcbx_set_app_data(struct qed_hwfn *p_hwfn,
 	for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
 		entry = &p_app->app_pri_tbl[i].entry;
 		if (ieee) {
-			*entry &= ~DCBX_APP_SF_IEEE_MASK;
+			*entry &= ~(DCBX_APP_SF_IEEE_MASK | DCBX_APP_SF_MASK);
 			switch (p_params->app_entry[i].sf_ieee) {
 			case QED_DCBX_SF_IEEE_ETHTYPE:
 				*entry |= ((u32)DCBX_APP_SF_IEEE_ETHTYPE <<
 					   DCBX_APP_SF_IEEE_SHIFT);
+				*entry |= ((u32)DCBX_APP_SF_ETHTYPE <<
+					   DCBX_APP_SF_SHIFT);
 				break;
 			case QED_DCBX_SF_IEEE_TCP_PORT:
 				*entry |= ((u32)DCBX_APP_SF_IEEE_TCP_PORT <<
 					   DCBX_APP_SF_IEEE_SHIFT);
+				*entry |= ((u32)DCBX_APP_SF_PORT <<
+					   DCBX_APP_SF_SHIFT);
 				break;
 			case QED_DCBX_SF_IEEE_UDP_PORT:
 				*entry |= ((u32)DCBX_APP_SF_IEEE_UDP_PORT <<
 					   DCBX_APP_SF_IEEE_SHIFT);
+				*entry |= ((u32)DCBX_APP_SF_PORT <<
+					   DCBX_APP_SF_SHIFT);
 				break;
 			case QED_DCBX_SF_IEEE_TCP_UDP_PORT:
 				*entry |= ((u32)DCBX_APP_SF_IEEE_TCP_UDP_PORT <<
 					   DCBX_APP_SF_IEEE_SHIFT);
+				*entry |= ((u32)DCBX_APP_SF_PORT <<
+					   DCBX_APP_SF_SHIFT);
 				break;
 			}
 		} else {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 3/3] qed: Clear dcbx memory buffers before the usage.
  2016-08-29 12:29 [PATCH net 0/3] qed*: dcbx fix series Sudarsana Reddy Kalluru
  2016-08-29 12:29 ` [PATCH net 1/3] qed*: Disallow dcbx configuration for VF interfaces Sudarsana Reddy Kalluru
  2016-08-29 12:29 ` [PATCH net 2/3] qed: Set selection-field while configuring the app entry in ieee mode Sudarsana Reddy Kalluru
@ 2016-08-29 12:29 ` Sudarsana Reddy Kalluru
  2016-09-01  4:04 ` [PATCH net 0/3] qed*: dcbx fix series David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2016-08-29 12:29 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz, sudarsana.kalluru

This patch takes care of clearing the uninitialized buffer before using it.
1. pfc pri-enable bitmap need to be cleared before setting the requested
   enable bits. Without this, the un-touched values will be merged with
   requested values and sent to MFW.
2. The data in app-entry field need to be cleared before using it.
3. Clear the output data buffer used in qed_dcbx_query_params().

Signed-off-by: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 192a886..ad023fe 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -988,6 +988,7 @@ qed_dcbx_set_pfc_data(struct qed_hwfn *p_hwfn,
 		if (p_params->pfc.prio[i])
 			pfc_map |= BIT(i);
 
+	*pfc &= ~DCBX_PFC_PRI_EN_BITMAP_MASK;
 	*pfc |= (pfc_map << DCBX_PFC_PRI_EN_BITMAP_SHIFT);
 
 	DP_VERBOSE(p_hwfn, QED_MSG_DCB, "pfc = 0x%x\n", *pfc);
@@ -1062,6 +1063,7 @@ qed_dcbx_set_app_data(struct qed_hwfn *p_hwfn,
 
 	for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
 		entry = &p_app->app_pri_tbl[i].entry;
+		*entry = 0;
 		if (ieee) {
 			*entry &= ~(DCBX_APP_SF_IEEE_MASK | DCBX_APP_SF_MASK);
 			switch (p_params->app_entry[i].sf_ieee) {
@@ -1193,6 +1195,7 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
 		return -ENOMEM;
 	}
 
+	memset(dcbx_info, 0, sizeof(*dcbx_info));
 	rc = qed_dcbx_query_params(p_hwfn, dcbx_info, QED_DCBX_OPERATIONAL_MIB);
 	if (rc) {
 		kfree(dcbx_info);
@@ -1230,6 +1233,7 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
 		return NULL;
 	}
 
+	memset(dcbx_info, 0, sizeof(*dcbx_info));
 	if (qed_dcbx_query_params(hwfn, dcbx_info, type)) {
 		kfree(dcbx_info);
 		return NULL;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net 0/3] qed*: dcbx fix series.
  2016-08-29 12:29 [PATCH net 0/3] qed*: dcbx fix series Sudarsana Reddy Kalluru
                   ` (2 preceding siblings ...)
  2016-08-29 12:29 ` [PATCH net 3/3] qed: Clear dcbx memory buffers before the usage Sudarsana Reddy Kalluru
@ 2016-09-01  4:04 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-09-01  4:04 UTC (permalink / raw)
  To: sudarsana.kalluru; +Cc: netdev, Yuval.Mintz

From: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Date: Mon, 29 Aug 2016 08:29:51 -0400

> The series contains several small fixes for qed* dcbx module.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-01  4:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-29 12:29 [PATCH net 0/3] qed*: dcbx fix series Sudarsana Reddy Kalluru
2016-08-29 12:29 ` [PATCH net 1/3] qed*: Disallow dcbx configuration for VF interfaces Sudarsana Reddy Kalluru
2016-08-29 12:29 ` [PATCH net 2/3] qed: Set selection-field while configuring the app entry in ieee mode Sudarsana Reddy Kalluru
2016-08-29 12:29 ` [PATCH net 3/3] qed: Clear dcbx memory buffers before the usage Sudarsana Reddy Kalluru
2016-09-01  4:04 ` [PATCH net 0/3] qed*: dcbx fix series David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.