All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4] qed: Dcbx bug fixes
@ 2017-04-19 10:19 Sudarsana Reddy Kalluru
  2017-04-19 10:19 ` [PATCH net 1/4] qed: Fix possible error in populating max_tc field Sudarsana Reddy Kalluru
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Sudarsana Reddy Kalluru @ 2017-04-19 10:19 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz, Sudarsana Reddy Kalluru

From: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>

The series has set of bug fixes for dcbx implementation of qed driver.
Please consider applying this to 'net' branch.

Sudarsana Reddy Kalluru (4):
  qed: Fix possible error in populating max_tc field.
  qed: Fix sending an invalid PFC error mask to MFW.
  qed: Fix possible system hang in the dcbnl-getdcbx() path.
  qed: Fix issue in populating the PFC config paramters.

 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

-- 
1.8.3.1

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

* [PATCH net 1/4] qed: Fix possible error in populating max_tc field.
  2017-04-19 10:19 [PATCH net 0/4] qed: Dcbx bug fixes Sudarsana Reddy Kalluru
@ 2017-04-19 10:19 ` Sudarsana Reddy Kalluru
  2017-04-19 10:19 ` [PATCH net 2/4] qed: Fix sending an invalid PFC error mask to MFW Sudarsana Reddy Kalluru
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sudarsana Reddy Kalluru @ 2017-04-19 10:19 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz

Some adapters may not publish the max_tc value. Populate the default
value for max_tc field in case the mfw didn't provide one.

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

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 5bd36a4..c24436c 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -583,6 +583,13 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 		   p_params->ets_cbs,
 		   p_ets->pri_tc_tbl[0], p_params->max_ets_tc);
 
+	if (p_params->ets_enabled && !p_params->max_ets_tc) {
+		p_params->max_ets_tc = QED_MAX_PFC_PRIORITIES;
+		DP_VERBOSE(p_hwfn, QED_MSG_DCB,
+			   "ETS params: max_ets_tc is forced to %d\n",
+		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.
 	 */
-- 
1.8.3.1

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

* [PATCH net 2/4] qed: Fix sending an invalid PFC error mask to MFW.
  2017-04-19 10:19 [PATCH net 0/4] qed: Dcbx bug fixes Sudarsana Reddy Kalluru
  2017-04-19 10:19 ` [PATCH net 1/4] qed: Fix possible error in populating max_tc field Sudarsana Reddy Kalluru
@ 2017-04-19 10:19 ` Sudarsana Reddy Kalluru
  2017-04-19 10:19 ` [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path Sudarsana Reddy Kalluru
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sudarsana Reddy Kalluru @ 2017-04-19 10:19 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz

PFC error-mask value is not supported by MFW, but this bit could be
set in the pfc bit-map of the operational parameters if remote device
supports it. These operational parameters are used as basis for
populating the dcbx config parameters. User provided configs will be
applied on top of these parameters and then send them to MFW when
requested. Driver need to clear the error-mask bit before sending the
config parameters to MFW.

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

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index c24436c..ff058a3 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -1008,6 +1008,8 @@ static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
 	u8 pfc_map = 0;
 	int i;
 
+	*pfc &= ~DCBX_PFC_ERROR_MASK;
+
 	if (p_params->pfc.willing)
 		*pfc |= DCBX_PFC_WILLING_MASK;
 	else
-- 
1.8.3.1

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

* [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path.
  2017-04-19 10:19 [PATCH net 0/4] qed: Dcbx bug fixes Sudarsana Reddy Kalluru
  2017-04-19 10:19 ` [PATCH net 1/4] qed: Fix possible error in populating max_tc field Sudarsana Reddy Kalluru
  2017-04-19 10:19 ` [PATCH net 2/4] qed: Fix sending an invalid PFC error mask to MFW Sudarsana Reddy Kalluru
@ 2017-04-19 10:19 ` Sudarsana Reddy Kalluru
  2017-04-19 13:56   ` Lance Richardson
  2017-04-19 10:19 ` [PATCH net 4/4] qed: Fix issue in populating the PFC config paramters Sudarsana Reddy Kalluru
  2017-04-20 20:29 ` [PATCH net 0/4] qed: Dcbx bug fixes David Miller
  4 siblings, 1 reply; 8+ messages in thread
From: Sudarsana Reddy Kalluru @ 2017-04-19 10:19 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz

qed_dcbnl_get_dcbx() API uses kmalloc in GFT_KERNEL mode. The API gets
invoked in the interrupt context by qed_dcbnl_getdcbx callback. Need
to invoke this kmalloc in atomic mode.

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

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index ff058a3..8f0783a 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -1264,7 +1264,7 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
 {
 	struct qed_dcbx_get *dcbx_info;
 
-	dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL);
+	dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC);
 	if (!dcbx_info)
 		return NULL;
 
-- 
1.8.3.1

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

* [PATCH net 4/4] qed: Fix issue in populating the PFC config paramters.
  2017-04-19 10:19 [PATCH net 0/4] qed: Dcbx bug fixes Sudarsana Reddy Kalluru
                   ` (2 preceding siblings ...)
  2017-04-19 10:19 ` [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path Sudarsana Reddy Kalluru
@ 2017-04-19 10:19 ` Sudarsana Reddy Kalluru
  2017-04-20 20:29 ` [PATCH net 0/4] qed: Dcbx bug fixes David Miller
  4 siblings, 0 replies; 8+ messages in thread
From: Sudarsana Reddy Kalluru @ 2017-04-19 10:19 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yuval.Mintz

Change ieee_setpfc() callback implementation to populate traffic class
count with the user provided value.

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

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 8f0783a..a6e2bbe 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -2082,6 +2082,8 @@ static int qed_dcbnl_ieee_setpfc(struct qed_dev *cdev, struct ieee_pfc *pfc)
 	for (i = 0; i < QED_MAX_PFC_PRIORITIES; i++)
 		dcbx_set.config.params.pfc.prio[i] = !!(pfc->pfc_en & BIT(i));
 
+	dcbx_set.config.params.pfc.max_tc = pfc->pfc_cap;
+
 	ptt = qed_ptt_acquire(hwfn);
 	if (!ptt)
 		return -EINVAL;
-- 
1.8.3.1

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

* Re: [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path.
  2017-04-19 10:19 ` [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path Sudarsana Reddy Kalluru
@ 2017-04-19 13:56   ` Lance Richardson
  2017-04-19 14:14     ` Mintz, Yuval
  0 siblings, 1 reply; 8+ messages in thread
From: Lance Richardson @ 2017-04-19 13:56 UTC (permalink / raw)
  To: Sudarsana Reddy Kalluru; +Cc: davem, netdev, Yuval Mintz

> From: "Sudarsana Reddy Kalluru" <sudarsana.kalluru@cavium.com>
> To: davem@davemloft.net
> Cc: netdev@vger.kernel.org, "Yuval Mintz" <Yuval.Mintz@cavium.com>
> Sent: Wednesday, 19 April, 2017 6:19:54 AM
> Subject: [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path.
> 
> qed_dcbnl_get_dcbx() API uses kmalloc in GFT_KERNEL mode. The API gets
> invoked in the interrupt context by qed_dcbnl_getdcbx callback. Need
> to invoke this kmalloc in atomic mode.
> 
> Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
> ---
>  drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> index ff058a3..8f0783a 100644
> --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> @@ -1264,7 +1264,7 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct
> qed_hwfn *hwfn,
>  {
>  	struct qed_dcbx_get *dcbx_info;
>  
> -	dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL);
> +	dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC);

You are changing a kzalloc to kmalloc, was that intentional?

>  	if (!dcbx_info)
>  		return NULL;
>  
> --
> 1.8.3.1
> 
> 

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

* RE: [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path.
  2017-04-19 13:56   ` Lance Richardson
@ 2017-04-19 14:14     ` Mintz, Yuval
  0 siblings, 0 replies; 8+ messages in thread
From: Mintz, Yuval @ 2017-04-19 14:14 UTC (permalink / raw)
  To: Lance Richardson, Kalluru, Sudarsana; +Cc: davem, netdev

> > qed_dcbnl_get_dcbx() API uses kmalloc in GFT_KERNEL mode. The API gets
> > invoked in the interrupt context by qed_dcbnl_getdcbx callback. Need
> > to invoke this kmalloc in atomic mode.
> >
> > Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
> > Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
> > ---
> >  drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> > b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> > index ff058a3..8f0783a 100644
> > --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> > +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> > @@ -1264,7 +1264,7 @@ static struct qed_dcbx_get
> > *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,  {
> >  	struct qed_dcbx_get *dcbx_info;
> >
> > -	dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL);
> > +	dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC);
> 
> You are changing a kzalloc to kmalloc, was that intentional?

Not really. Apparently the confusion resulted from the fact that
immediately after the next condition we're memsetting dcbx_info
to zero [so current code zeros the memory twice], which also
means there's no functional problem with this change.

Dave, do you want us to re-spin this [even though change isn't
functionally broken]?
Notice this is a recurrent pattern, so in future we'd have to send
a cleanup for these kind of stuff, regardless of whether we re-spin
now or not.

> 
> >  	if (!dcbx_info)
> >  		return NULL;
> >
> > --
> > 1.8.3.1
> >
> >

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

* Re: [PATCH net 0/4] qed: Dcbx bug fixes
  2017-04-19 10:19 [PATCH net 0/4] qed: Dcbx bug fixes Sudarsana Reddy Kalluru
                   ` (3 preceding siblings ...)
  2017-04-19 10:19 ` [PATCH net 4/4] qed: Fix issue in populating the PFC config paramters Sudarsana Reddy Kalluru
@ 2017-04-20 20:29 ` David Miller
  4 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2017-04-20 20:29 UTC (permalink / raw)
  To: sudarsana.kalluru; +Cc: netdev, Yuval.Mintz

From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Date: Wed, 19 Apr 2017 03:19:51 -0700

> The series has set of bug fixes for dcbx implementation of qed driver.
> Please consider applying this to 'net' branch.

Series applied, thanks.

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

end of thread, other threads:[~2017-04-20 20:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 10:19 [PATCH net 0/4] qed: Dcbx bug fixes Sudarsana Reddy Kalluru
2017-04-19 10:19 ` [PATCH net 1/4] qed: Fix possible error in populating max_tc field Sudarsana Reddy Kalluru
2017-04-19 10:19 ` [PATCH net 2/4] qed: Fix sending an invalid PFC error mask to MFW Sudarsana Reddy Kalluru
2017-04-19 10:19 ` [PATCH net 3/4] qed: Fix possible system hang in the dcbnl-getdcbx() path Sudarsana Reddy Kalluru
2017-04-19 13:56   ` Lance Richardson
2017-04-19 14:14     ` Mintz, Yuval
2017-04-19 10:19 ` [PATCH net 4/4] qed: Fix issue in populating the PFC config paramters Sudarsana Reddy Kalluru
2017-04-20 20:29 ` [PATCH net 0/4] qed: Dcbx bug fixes 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.