All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net-next] ice: add support for DSCP QoS for IDC
@ 2021-11-23 18:25 Dave Ertman
  2021-11-24  9:51 ` Paul Menzel
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Ertman @ 2021-11-23 18:25 UTC (permalink / raw)
  To: intel-wired-lan

The ice driver provides QoS information to auxiliary drivers
through the exported function ice_get_qos_params.  This function
doesn't currently support L3 DSCP QoS.

Add the necessary defines, structure elements and code to support
DSCP QoS through the IDC functions.

Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_idc.c | 5 +++++
 include/linux/net/intel/iidc.h           | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c
index fc3580167e7b..263a2e7577a2 100644
--- a/drivers/net/ethernet/intel/ice/ice_idc.c
+++ b/drivers/net/ethernet/intel/ice/ice_idc.c
@@ -227,6 +227,11 @@ void ice_get_qos_params(struct ice_pf *pf, struct iidc_qos_params *qos)
 
 	for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
 		qos->tc_info[i].rel_bw = dcbx_cfg->etscfg.tcbwtable[i];
+
+	qos->pfc_mode = dcbx_cfg->pfc_mode;
+	if (qos->pfc_mode == IIDC_DSCP_PFC_MODE)
+		for (i = 0; i < IIDC_MAX_DSCP_MAPPING; i++)
+			qos->dscp_map[i] = dcbx_cfg->dscp_map[i];
 }
 EXPORT_SYMBOL_GPL(ice_get_qos_params);
 
diff --git a/include/linux/net/intel/iidc.h b/include/linux/net/intel/iidc.h
index 1289593411d3..0a90f301679d 100644
--- a/include/linux/net/intel/iidc.h
+++ b/include/linux/net/intel/iidc.h
@@ -32,6 +32,9 @@ enum iidc_rdma_protocol {
 };
 
 #define IIDC_MAX_USER_PRIORITY		8
+#define IIDC_MAX_DSCP_MAPPING		64
+#define IIDC_VLAN_PFC_MODE		0x0
+#define IIDC_DSCP_PFC_MODE		0x1
 
 /* Struct to hold per RDMA Qset info */
 struct iidc_rdma_qset_params {
@@ -60,6 +63,8 @@ struct iidc_qos_params {
 	u8 vport_relative_bw;
 	u8 vport_priority_type;
 	u8 num_tc;
+	u8 pfc_mode;
+	u8 dscp_map[IIDC_MAX_DSCP_MAPPING];
 };
 
 struct iidc_event {
-- 
2.31.1


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

* [Intel-wired-lan] [PATCH net-next] ice: add support for DSCP QoS for IDC
  2021-11-23 18:25 [Intel-wired-lan] [PATCH net-next] ice: add support for DSCP QoS for IDC Dave Ertman
@ 2021-11-24  9:51 ` Paul Menzel
  2021-11-29 16:51   ` Ertman, David M
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Menzel @ 2021-11-24  9:51 UTC (permalink / raw)
  To: intel-wired-lan

Dear Dave,


Am 23.11.21 um 19:25 schrieb Dave Ertman:
> The ice driver provides QoS information to auxiliary drivers
> through the exported function ice_get_qos_params.  This function
> doesn't currently support L3 DSCP QoS.
> 
> Add the necessary defines, structure elements and code to support
> DSCP QoS through the IDC functions.

How did you test this?

In what datasheet (name, revision, section) is that documented?

> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
> ---
>   drivers/net/ethernet/intel/ice/ice_idc.c | 5 +++++
>   include/linux/net/intel/iidc.h           | 5 +++++
>   2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c
> index fc3580167e7b..263a2e7577a2 100644
> --- a/drivers/net/ethernet/intel/ice/ice_idc.c
> +++ b/drivers/net/ethernet/intel/ice/ice_idc.c
> @@ -227,6 +227,11 @@ void ice_get_qos_params(struct ice_pf *pf, struct iidc_qos_params *qos)
>   
>   	for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
>   		qos->tc_info[i].rel_bw = dcbx_cfg->etscfg.tcbwtable[i];
> +
> +	qos->pfc_mode = dcbx_cfg->pfc_mode;
> +	if (qos->pfc_mode == IIDC_DSCP_PFC_MODE)

Just a nit as the compiler will probably do it itself, but you could use 
`dcbx_cfg->pfc_mode` in the check, and move the assignment into the body.

> +		for (i = 0; i < IIDC_MAX_DSCP_MAPPING; i++)
> +			qos->dscp_map[i] = dcbx_cfg->dscp_map[i];
>   }
>   EXPORT_SYMBOL_GPL(ice_get_qos_params);
>   
> diff --git a/include/linux/net/intel/iidc.h b/include/linux/net/intel/iidc.h
> index 1289593411d3..0a90f301679d 100644
> --- a/include/linux/net/intel/iidc.h
> +++ b/include/linux/net/intel/iidc.h
> @@ -32,6 +32,9 @@ enum iidc_rdma_protocol {
>   };
>   
>   #define IIDC_MAX_USER_PRIORITY		8
> +#define IIDC_MAX_DSCP_MAPPING		64
> +#define IIDC_VLAN_PFC_MODE		0x0
> +#define IIDC_DSCP_PFC_MODE		0x1
>   
>   /* Struct to hold per RDMA Qset info */
>   struct iidc_rdma_qset_params {
> @@ -60,6 +63,8 @@ struct iidc_qos_params {
>   	u8 vport_relative_bw;
>   	u8 vport_priority_type;
>   	u8 num_tc;
> +	u8 pfc_mode;
> +	u8 dscp_map[IIDC_MAX_DSCP_MAPPING];
>   };
>   
>   struct iidc_event {


Kind regards,

Paul

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

* [Intel-wired-lan] [PATCH net-next] ice: add support for DSCP QoS for IDC
  2021-11-24  9:51 ` Paul Menzel
@ 2021-11-29 16:51   ` Ertman, David M
  0 siblings, 0 replies; 3+ messages in thread
From: Ertman, David M @ 2021-11-29 16:51 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Paul Menzel <pmenzel@molgen.mpg.de>
> Sent: Wednesday, November 24, 2021 1:52 AM
> To: Ertman, David M <david.m.ertman@intel.com>
> Cc: intel-wired-lan at lists.osuosl.org
> Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: add support for DSCP
> QoS for IDC
> 
> Dear Dave,
> 
> 
> Am 23.11.21 um 19:25 schrieb Dave Ertman:
> > The ice driver provides QoS information to auxiliary drivers
> > through the exported function ice_get_qos_params.  This function
> > doesn't currently support L3 DSCP QoS.
> >
> > Add the necessary defines, structure elements and code to support
> > DSCP QoS through the IDC functions.
> 
> How did you test this?
> 
> In what datasheet (name, revision, section) is that documented?
> 
> > Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
> > ---
> >   drivers/net/ethernet/intel/ice/ice_idc.c | 5 +++++
> >   include/linux/net/intel/iidc.h           | 5 +++++
> >   2 files changed, 10 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c
> b/drivers/net/ethernet/intel/ice/ice_idc.c
> > index fc3580167e7b..263a2e7577a2 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_idc.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_idc.c
> > @@ -227,6 +227,11 @@ void ice_get_qos_params(struct ice_pf *pf, struct
> iidc_qos_params *qos)
> >
> >   	for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
> >   		qos->tc_info[i].rel_bw = dcbx_cfg->etscfg.tcbwtable[i];
> > +
> > +	qos->pfc_mode = dcbx_cfg->pfc_mode;
> > +	if (qos->pfc_mode == IIDC_DSCP_PFC_MODE)
> 
> Just a nit as the compiler will probably do it itself, but you could use
> `dcbx_cfg->pfc_mode` in the check, and move the assignment into the body.

That would be an incorrect implementation.  the assignment needs to happen regardless of the results
of the test.

> 
> > +		for (i = 0; i < IIDC_MAX_DSCP_MAPPING; i++)
> > +			qos->dscp_map[i] = dcbx_cfg->dscp_map[i];
> >   }
> >   EXPORT_SYMBOL_GPL(ice_get_qos_params);
> >
> > diff --git a/include/linux/net/intel/iidc.h b/include/linux/net/intel/iidc.h
> > index 1289593411d3..0a90f301679d 100644
> > --- a/include/linux/net/intel/iidc.h
> > +++ b/include/linux/net/intel/iidc.h
> > @@ -32,6 +32,9 @@ enum iidc_rdma_protocol {
> >   };
> >
> >   #define IIDC_MAX_USER_PRIORITY		8
> > +#define IIDC_MAX_DSCP_MAPPING		64
> > +#define IIDC_VLAN_PFC_MODE		0x0
> > +#define IIDC_DSCP_PFC_MODE		0x1
> >
> >   /* Struct to hold per RDMA Qset info */
> >   struct iidc_rdma_qset_params {
> > @@ -60,6 +63,8 @@ struct iidc_qos_params {
> >   	u8 vport_relative_bw;
> >   	u8 vport_priority_type;
> >   	u8 num_tc;
> > +	u8 pfc_mode;
> > +	u8 dscp_map[IIDC_MAX_DSCP_MAPPING];
> >   };
> >
> >   struct iidc_event {
> 
> 
> Kind regards,
> 
> Paul

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

end of thread, other threads:[~2021-11-29 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 18:25 [Intel-wired-lan] [PATCH net-next] ice: add support for DSCP QoS for IDC Dave Ertman
2021-11-24  9:51 ` Paul Menzel
2021-11-29 16:51   ` Ertman, David M

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.