[6/8] net/i40e/base: add disable unused ports capability

Message ID 20200721074000.30449-7-guinanx.sun@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series update i40e base code |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Guinan Sun July 21, 2020, 7:39 a.m. UTC
This patch adds support for "Disable Unused Ports" functionality.

Signed-off-by: Damian Milosek <damian.milosek@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
 drivers/net/i40e/base/i40e_common.c     | 6 ++++++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 8 insertions(+)
  

Comments

Guo, Jia July 27, 2020, 4:24 a.m. UTC | #1
hi, guinan

On 7/21/2020 3:39 PM, Guinan Sun wrote:
> This patch adds support for "Disable Unused Ports" functionality.


"This patch adds support for disabling unused ports" is enough for reader i think.

And use 2 verb is not good in title, "Support unused ports disabling" or 
other you want.


>
> Signed-off-by: Damian Milosek <damian.milosek@intel.com>
> Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> ---
>   drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
>   drivers/net/i40e/base/i40e_common.c     | 6 ++++++
>   drivers/net/i40e/base/i40e_type.h       | 1 +
>   3 files changed, 8 insertions(+)
>
> diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h
> index e1018ed49..c7686b0d3 100644
> --- a/drivers/net/i40e/base/i40e_adminq_cmd.h
> +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
> @@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
>   #define I40E_AQ_CAP_ID_SDP		0x0062
>   #define I40E_AQ_CAP_ID_MDIO		0x0063
>   #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
> +#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067


Please double check if it is "0x0066" or "0x0067", if it is conform, 
please add my ACK for this patch at next version.


>   #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
>   #define I40E_AQ_CAP_ID_FLEX10		0x00F1
>   #define I40E_AQ_CAP_ID_CEM		0x00F2
> diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
> index 85c22849e..65317f6c6 100644
> --- a/drivers/net/i40e/base/i40e_common.c
> +++ b/drivers/net/i40e/base/i40e_common.c
> @@ -4021,6 +4021,12 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
>   				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
>   				   (p->wr_csr_prot & 0xffff));
>   			break;
> +		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
> +			p->dis_unused_ports = (bool)number;
> +			i40e_debug(hw, I40E_DEBUG_INIT,
> +				   "HW Capability: dis_unused_ports = %d\n\n",
> +				   p->dis_unused_ports);
> +			break;
>   		case I40E_AQ_CAP_ID_NVM_MGMT:
>   			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
>   				p->sec_rev_disabled = true;
> diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h
> index 0eeb55975..cf4134583 100644
> --- a/drivers/net/i40e/base/i40e_type.h
> +++ b/drivers/net/i40e/base/i40e_type.h
> @@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
>   	u32 enabled_tcmap;
>   	u32 maxtc;
>   	u64 wr_csr_prot;
> +	bool dis_unused_ports;
>   	bool apm_wol_support;
>   	enum i40e_acpi_programming_method acpi_prog_method;
>   	bool proxy_support;
  
Guinan Sun July 27, 2020, 5:01 a.m. UTC | #2
Hi Jeff

> -----Original Message-----
> From: Guo, Jia
> Sent: Monday, July 27, 2020 12:25 PM
> To: Sun, GuinanX <guinanx.sun@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Milosek, Damian
> <damian.milosek@intel.com>
> Subject: Re: [PATCH 6/8] net/i40e/base: add disable unused ports capability
> 
> hi, guinan
> 
> On 7/21/2020 3:39 PM, Guinan Sun wrote:
> > This patch adds support for "Disable Unused Ports" functionality.
> 
> 
> "This patch adds support for disabling unused ports" is enough for reader i think.
> 
> And use 2 verb is not good in title, "Support unused ports disabling" or other
> you want.
> 

I think you are right.
Patch V2 will modify it.

> 
> >
> > Signed-off-by: Damian Milosek <damian.milosek@intel.com>
> > Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> > ---
> >   drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
> >   drivers/net/i40e/base/i40e_common.c     | 6 ++++++
> >   drivers/net/i40e/base/i40e_type.h       | 1 +
> >   3 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h
> b/drivers/net/i40e/base/i40e_adminq_cmd.h
> > index e1018ed49..c7686b0d3 100644
> > --- a/drivers/net/i40e/base/i40e_adminq_cmd.h
> > +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
> > @@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
> >   #define I40E_AQ_CAP_ID_SDP		0x0062
> >   #define I40E_AQ_CAP_ID_MDIO		0x0063
> >   #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
> > +#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067
> 
> 
> Please double check if it is "0x0066" or "0x0067", if it is conform,
> please add my ACK for this patch at next version.
> 
> 
> >   #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
> >   #define I40E_AQ_CAP_ID_FLEX10		0x00F1
> >   #define I40E_AQ_CAP_ID_CEM		0x00F2
> > diff --git a/drivers/net/i40e/base/i40e_common.c
> b/drivers/net/i40e/base/i40e_common.c
> > index 85c22849e..65317f6c6 100644
> > --- a/drivers/net/i40e/base/i40e_common.c
> > +++ b/drivers/net/i40e/base/i40e_common.c
> > @@ -4021,6 +4021,12 @@ STATIC void
> i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
> >   				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
> >   				   (p->wr_csr_prot & 0xffff));
> >   			break;
> > +		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
> > +			p->dis_unused_ports = (bool)number;
> > +			i40e_debug(hw, I40E_DEBUG_INIT,
> > +				   "HW Capability: dis_unused_ports = %d\n\n",
> > +				   p->dis_unused_ports);
> > +			break;
> >   		case I40E_AQ_CAP_ID_NVM_MGMT:
> >   			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
> >   				p->sec_rev_disabled = true;
> > diff --git a/drivers/net/i40e/base/i40e_type.h
> b/drivers/net/i40e/base/i40e_type.h
> > index 0eeb55975..cf4134583 100644
> > --- a/drivers/net/i40e/base/i40e_type.h
> > +++ b/drivers/net/i40e/base/i40e_type.h
> > @@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
> >   	u32 enabled_tcmap;
> >   	u32 maxtc;
> >   	u64 wr_csr_prot;
> > +	bool dis_unused_ports;
> >   	bool apm_wol_support;
> >   	enum i40e_acpi_programming_method acpi_prog_method;
> >   	bool proxy_support;
  

Patch

diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h
index e1018ed49..c7686b0d3 100644
--- a/drivers/net/i40e/base/i40e_adminq_cmd.h
+++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
@@ -440,6 +440,7 @@  struct i40e_aqc_list_capabilities_element_resp {
 #define I40E_AQ_CAP_ID_SDP		0x0062
 #define I40E_AQ_CAP_ID_MDIO		0x0063
 #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
+#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067
 #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
 #define I40E_AQ_CAP_ID_FLEX10		0x00F1
 #define I40E_AQ_CAP_ID_CEM		0x00F2
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 85c22849e..65317f6c6 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -4021,6 +4021,12 @@  STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
 				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
 				   (p->wr_csr_prot & 0xffff));
 			break;
+		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
+			p->dis_unused_ports = (bool)number;
+			i40e_debug(hw, I40E_DEBUG_INIT,
+				   "HW Capability: dis_unused_ports = %d\n\n",
+				   p->dis_unused_ports);
+			break;
 		case I40E_AQ_CAP_ID_NVM_MGMT:
 			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
 				p->sec_rev_disabled = true;
diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h
index 0eeb55975..cf4134583 100644
--- a/drivers/net/i40e/base/i40e_type.h
+++ b/drivers/net/i40e/base/i40e_type.h
@@ -425,6 +425,7 @@  struct i40e_hw_capabilities {
 	u32 enabled_tcmap;
 	u32 maxtc;
 	u64 wr_csr_prot;
+	bool dis_unused_ports;
 	bool apm_wol_support;
 	enum i40e_acpi_programming_method acpi_prog_method;
 	bool proxy_support;