All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] enable relax order mode in intel NIC's driver
@ 2017-02-03  9:30 Mao Wenan
  2017-02-03  9:30 ` [PATCH net-next 1/2] ixgbevf and 82598 relax order mode support Mao Wenan
  2017-02-03  9:30 ` [PATCH net-next 2/2] add one config to select relax order mode in intel NIC's Kconfig Mao Wenan
  0 siblings, 2 replies; 5+ messages in thread
From: Mao Wenan @ 2017-02-03  9:30 UTC (permalink / raw)
  To: netdev, alexander.duyck, jeffrey.t.kirsher

These two patches give a way to enable relax order mode in intel
NIC's driver. CONFIG_ARCH_WANT_RELAX_ORDER is a common macro for
CPU architecture to use relax order, it can be defined in
arch/xxx/Kconfig, such as arch/sparc/Kconfig; but for some special
CPU architecture, such as arm64, it can't be defined in
arch/arm64/Kconfig, because not all of arm64 CPU must use relax order
mode, so this patch give a way to select
CONFIG_ARCH_WANT_RELAX_ORDER in intel NIC's Kconfig.

Mao Wenan (2):
  ixgbevf and 82598 relax order mode support
  add one config to select relax order mode in intel NIC's Kconfig

 drivers/net/ethernet/intel/Kconfig                | 15 +++++++++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c    |  4 ++--
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |  2 +-
 3 files changed, 18 insertions(+), 3 deletions(-)

-- 
2.7.0

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

* [PATCH net-next 1/2] ixgbevf and 82598 relax order mode support
  2017-02-03  9:30 [PATCH net-next 0/2] enable relax order mode in intel NIC's driver Mao Wenan
@ 2017-02-03  9:30 ` Mao Wenan
  2017-02-03  9:30 ` [PATCH net-next 2/2] add one config to select relax order mode in intel NIC's Kconfig Mao Wenan
  1 sibling, 0 replies; 5+ messages in thread
From: Mao Wenan @ 2017-02-03  9:30 UTC (permalink / raw)
  To: netdev, alexander.duyck, jeffrey.t.kirsher

This patch allows one to use common macro
CONFIG_ARCH_WANT_RELAX_ORDER to enable or
disable to relax order mode.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c    | 4 ++--
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
index 523f9d0..167d1fc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
@@ -175,7 +175,7 @@ static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw)
  **/
 static s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw)
 {
-#ifndef CONFIG_SPARC
+#ifndef CONFIG_ARCH_WANT_RELAX_ORDER
 	u32 regval;
 	u32 i;
 #endif
@@ -183,7 +183,7 @@ static s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw)
 
 	ret_val = ixgbe_start_hw_generic(hw);
 
-#ifndef CONFIG_SPARC
+#ifndef CONFIG_ARCH_WANT_RELAX_ORDER
 	/* Disable relaxed ordering */
 	for (i = 0; ((i < hw->mac.max_tx_queues) &&
 	     (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) {
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index b068635..0efbf0b 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1765,7 +1765,7 @@ static void ixgbevf_configure_rx_ring(struct ixgbevf_adapter *adapter,
 	IXGBE_WRITE_REG(hw, IXGBE_VFRDLEN(reg_idx),
 			ring->count * sizeof(union ixgbe_adv_rx_desc));
 
-#ifndef CONFIG_SPARC
+#ifndef CONFIG_ARCH_WANT_RELAX_ORDER
 	/* enable relaxed ordering */
 	IXGBE_WRITE_REG(hw, IXGBE_VFDCA_RXCTRL(reg_idx),
 			IXGBE_DCA_RXCTRL_DESC_RRO_EN);
-- 
2.7.0

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

* [PATCH net-next 2/2] add one config to select relax order mode in intel NIC's Kconfig
  2017-02-03  9:30 [PATCH net-next 0/2] enable relax order mode in intel NIC's driver Mao Wenan
  2017-02-03  9:30 ` [PATCH net-next 1/2] ixgbevf and 82598 relax order mode support Mao Wenan
@ 2017-02-03  9:30 ` Mao Wenan
  2017-02-03 16:43   ` Alexander Duyck
  1 sibling, 1 reply; 5+ messages in thread
From: Mao Wenan @ 2017-02-03  9:30 UTC (permalink / raw)
  To: netdev, alexander.duyck, jeffrey.t.kirsher

This patch allows one to enable relax order mode in intel NIC's
Kconfig. CONFIG_ARCH_WANT_RELAX_ORDER is a common macro for some
CPU architecture to use relax order mode in NIC's source codes.
CONFIG_ARCH_WANT_RELAX_ORDER can be defined in arch/xxx/Kconfig,
such as sparc system exists in arch/sparc/Kconfig, but not all
of arm64 systems can use relax order mode, so it can't be defined
in arch/arm64/Kconfig. Therefore PCI_RELAX_ORDER in NIC's Kconfig
provide one way to define macro CONFIG_ARCH_WANT_RELAX_ORDER.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/net/ethernet/intel/Kconfig | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 1349b45..b366722 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -275,4 +275,19 @@ config FM10K
 	  To compile this driver as a module, choose M here. The module
 	  will be called fm10k.  MSI-X interrupt support is required
 
+config PCI_RELAX_ORDER
+        bool "PCI relax order mode support"
+        default n
+        select ARCH_WANT_RELAX_ORDER
+        ---help---
+          This allows one to enable relax order mode in driver.
+          CONFIG_ARCH_WANT_RELAX_ORDER is a common macro for some
+          CPU architecture to use relax order mode in NIC's source codes.
+          CONFIG_ARCH_WANT_RELAX_ORDER can be defined in arch/xxx/Kconfig,
+          such as sparc system exists in arch/sparc/Kconfig, but not all
+          of arm64 systems can use relax order mode, so it can't be defined
+          in arch/arm64/Kconfig. Therefore PCI_RELAX_ORDER provide one way
+          to define macro CONFIG_ARCH_WANT_RELAX_ORDER. Say Y here if you
+          want to enable relax order.
+
 endif # NET_VENDOR_INTEL
-- 
2.7.0

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

* Re: [PATCH net-next 2/2] add one config to select relax order mode in intel NIC's Kconfig
  2017-02-03  9:30 ` [PATCH net-next 2/2] add one config to select relax order mode in intel NIC's Kconfig Mao Wenan
@ 2017-02-03 16:43   ` Alexander Duyck
  2017-02-04  1:36     ` maowenan
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Duyck @ 2017-02-03 16:43 UTC (permalink / raw)
  To: Mao Wenan; +Cc: Netdev, Jeff Kirsher

On Fri, Feb 3, 2017 at 1:30 AM, Mao Wenan <maowenan@huawei.com> wrote:
> This patch allows one to enable relax order mode in intel NIC's
> Kconfig. CONFIG_ARCH_WANT_RELAX_ORDER is a common macro for some
> CPU architecture to use relax order mode in NIC's source codes.
> CONFIG_ARCH_WANT_RELAX_ORDER can be defined in arch/xxx/Kconfig,
> such as sparc system exists in arch/sparc/Kconfig, but not all
> of arm64 systems can use relax order mode, so it can't be defined
> in arch/arm64/Kconfig. Therefore PCI_RELAX_ORDER in NIC's Kconfig
> provide one way to define macro CONFIG_ARCH_WANT_RELAX_ORDER.
>
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
>  drivers/net/ethernet/intel/Kconfig | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
> index 1349b45..b366722 100644
> --- a/drivers/net/ethernet/intel/Kconfig
> +++ b/drivers/net/ethernet/intel/Kconfig
> @@ -275,4 +275,19 @@ config FM10K
>           To compile this driver as a module, choose M here. The module
>           will be called fm10k.  MSI-X interrupt support is required
>
> +config PCI_RELAX_ORDER
> +        bool "PCI relax order mode support"
> +        default n
> +        select ARCH_WANT_RELAX_ORDER
> +        ---help---
> +          This allows one to enable relax order mode in driver.
> +          CONFIG_ARCH_WANT_RELAX_ORDER is a common macro for some
> +          CPU architecture to use relax order mode in NIC's source codes.
> +          CONFIG_ARCH_WANT_RELAX_ORDER can be defined in arch/xxx/Kconfig,
> +          such as sparc system exists in arch/sparc/Kconfig, but not all
> +          of arm64 systems can use relax order mode, so it can't be defined
> +          in arch/arm64/Kconfig. Therefore PCI_RELAX_ORDER provide one way
> +          to define macro CONFIG_ARCH_WANT_RELAX_ORDER. Say Y here if you
> +          want to enable relax order.
> +
>  endif # NET_VENDOR_INTEL


You can't be dropping configuration options like this in here.  The
ARCH_WANT_RELAX_ORDER should be selected by the architecture as a
def_bool, not by the user via a kconfig option.  In addition this
option has no business in the Intel wired LAN directory as this
impacts all architectures.

This is something that would be an architecture specific PCI option
and could impact other PCI devices beyond what is just in networking.
If you are wanting to target the arm64 architecture you should
probably drop this in the /arch/arm64/Kconfig, then that way anyone
familiar with the arm64 hardware can chime in if enabling relaxed
ordering causes any known issues.

- Alex

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

* RE: [PATCH net-next 2/2] add one config to select relax order mode in intel NIC's Kconfig
  2017-02-03 16:43   ` Alexander Duyck
@ 2017-02-04  1:36     ` maowenan
  0 siblings, 0 replies; 5+ messages in thread
From: maowenan @ 2017-02-04  1:36 UTC (permalink / raw)
  To: Alexander Duyck; +Cc: Netdev, Jeff Kirsher, Dingtianhong



> -----Original Message-----
> From: Alexander Duyck [mailto:alexander.duyck@gmail.com]
> Sent: Saturday, February 04, 2017 12:43 AM
> To: maowenan
> Cc: Netdev; Jeff Kirsher
> Subject: Re: [PATCH net-next 2/2] add one config to select relax order mode in
> intel NIC's Kconfig
> 
> On Fri, Feb 3, 2017 at 1:30 AM, Mao Wenan <maowenan@huawei.com> wrote:
> > This patch allows one to enable relax order mode in intel NIC's
> > Kconfig. CONFIG_ARCH_WANT_RELAX_ORDER is a common macro for some
> CPU
> > architecture to use relax order mode in NIC's source codes.
> > CONFIG_ARCH_WANT_RELAX_ORDER can be defined in arch/xxx/Kconfig,
> such
> > as sparc system exists in arch/sparc/Kconfig, but not all of arm64
> > systems can use relax order mode, so it can't be defined in
> > arch/arm64/Kconfig. Therefore PCI_RELAX_ORDER in NIC's Kconfig provide
> > one way to define macro CONFIG_ARCH_WANT_RELAX_ORDER.
> >
> > Signed-off-by: Mao Wenan <maowenan@huawei.com>
> > ---
> >  drivers/net/ethernet/intel/Kconfig | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/intel/Kconfig
> > b/drivers/net/ethernet/intel/Kconfig
> > index 1349b45..b366722 100644
> > --- a/drivers/net/ethernet/intel/Kconfig
> > +++ b/drivers/net/ethernet/intel/Kconfig
> > @@ -275,4 +275,19 @@ config FM10K
> >           To compile this driver as a module, choose M here. The module
> >           will be called fm10k.  MSI-X interrupt support is required
> >
> > +config PCI_RELAX_ORDER
> > +        bool "PCI relax order mode support"
> > +        default n
> > +        select ARCH_WANT_RELAX_ORDER
> > +        ---help---
> > +          This allows one to enable relax order mode in driver.
> > +          CONFIG_ARCH_WANT_RELAX_ORDER is a common macro for
> some
> > +          CPU architecture to use relax order mode in NIC's source codes.
> > +          CONFIG_ARCH_WANT_RELAX_ORDER can be defined in
> arch/xxx/Kconfig,
> > +          such as sparc system exists in arch/sparc/Kconfig, but not all
> > +          of arm64 systems can use relax order mode, so it can't be
> defined
> > +          in arch/arm64/Kconfig. Therefore PCI_RELAX_ORDER provide
> one way
> > +          to define macro CONFIG_ARCH_WANT_RELAX_ORDER. Say Y
> here if you
> > +          want to enable relax order.
> > +
> >  endif # NET_VENDOR_INTEL
> 
> 
> You can't be dropping configuration options like this in here.  The
> ARCH_WANT_RELAX_ORDER should be selected by the architecture as a
> def_bool, not by the user via a kconfig option.  In addition this option has no
> business in the Intel wired LAN directory as this impacts all architectures.
> 
> This is something that would be an architecture specific PCI option and could
> impact other PCI devices beyond what is just in networking.
> If you are wanting to target the arm64 architecture you should probably drop
> this in the /arch/arm64/Kconfig, then that way anyone familiar with the arm64
> hardware can chime in if enabling relaxed ordering causes any known issues.
> 
> - Alex


I have tried to drop configuration to arch/arm64/Kconfig, but I found there will
be side effect as not all of arm64 systems really need relax order, so I put it in intel
Kconfig because it is a feature of PCI device and configured by NIC's register.
By the way, do you agree the first patch of this series, shall I repost it individually? 
[PATCH net-next 1/2] ixgbevf and 82598 relax order mode support

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

end of thread, other threads:[~2017-02-04  1:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03  9:30 [PATCH net-next 0/2] enable relax order mode in intel NIC's driver Mao Wenan
2017-02-03  9:30 ` [PATCH net-next 1/2] ixgbevf and 82598 relax order mode support Mao Wenan
2017-02-03  9:30 ` [PATCH net-next 2/2] add one config to select relax order mode in intel NIC's Kconfig Mao Wenan
2017-02-03 16:43   ` Alexander Duyck
2017-02-04  1:36     ` maowenan

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.