DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeontx2: extend RSS supported offload types
@ 2020-01-22  3:46 kirankumark
  2020-01-22  8:05 ` Jerin Jacob
  2020-01-24  3:46 ` [dpdk-dev] [PATCH v2] " kirankumark
  0 siblings, 2 replies; 5+ messages in thread
From: kirankumark @ 2020-01-22  3:46 UTC (permalink / raw)
  To: Jerin Jacob, Nithin Dabilpuram, Vamsi Attunuru, Kiran Kumar K; +Cc: dev

From: Kiran Kumar K <kirankumark@marvell.com>

Extend RSS offload types for octeontx2. Add support to select
L3 SRC, L3 DST, L4 SRC and L4 DST for RSS calculation.

Add support to select L3 SRC or DST only, L4 SRC or DST only for RSS
calculation.

With this requirement there will be following combinations,
IPV[4,6]_SRC_ONLY, IPV[4,6]_DST_ONLY, [TCP,UDP,SCTP]_SRC_ONLY,
[TCP,UDP,SCTP]_DST_ONLY. So, instead of creating a bit for each
combination, we are using upper 4 bits (31:28) in the flow_key_cfg
to represent the SRC, DST selection. 31 => L3_SRC, 30 => L3_DST,
29 => L4_SRC, 28 => L4_DST. These won't be part of flow_cfg, so that
we don't need to change the existing ABI.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
 drivers/common/octeontx2/otx2_mbox.h |  6 +++++-
 drivers/net/octeontx2/otx2_rss.c     | 12 ++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/common/octeontx2/otx2_mbox.h b/drivers/common/octeontx2/otx2_mbox.h
index e0e4e2f63..4972b8a6e 100644
--- a/drivers/common/octeontx2/otx2_mbox.h
+++ b/drivers/common/octeontx2/otx2_mbox.h
@@ -918,7 +918,11 @@ struct nix_rss_flowkey_cfg {
 #define FLOW_KEY_TYPE_INNR_UDP      BIT(15)
 #define FLOW_KEY_TYPE_INNR_SCTP     BIT(16)
 #define FLOW_KEY_TYPE_INNR_ETH_DMAC BIT(17)
-	uint8_t	group;       /* RSS context or group */
+#define FLOW_KEY_TYPE_L4_DST BIT(28)
+#define FLOW_KEY_TYPE_L4_SRC BIT(29)
+#define FLOW_KEY_TYPE_L3_DST BIT(30)
+#define FLOW_KEY_TYPE_L3_SRC BIT(31)
+	uint8_t	__otx2_io group;       /* RSS context or group */
 };
 
 struct nix_rss_flowkey_cfg_rsp {
diff --git a/drivers/net/octeontx2/otx2_rss.c b/drivers/net/octeontx2/otx2_rss.c
index bc7b64387..7a8c8f3de 100644
--- a/drivers/net/octeontx2/otx2_rss.c
+++ b/drivers/net/octeontx2/otx2_rss.c
@@ -210,6 +210,18 @@ otx2_rss_ethdev_to_nix(struct otx2_eth_dev *dev, uint64_t ethdev_rss,
 
 	dev->rss_info.nix_rss = ethdev_rss;
 
+	if (ethdev_rss & ETH_RSS_L3_SRC_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L3_SRC;
+
+	if (ethdev_rss & ETH_RSS_L3_DST_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L3_DST;
+
+	if (ethdev_rss & ETH_RSS_L4_SRC_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L4_SRC;
+
+	if (ethdev_rss & ETH_RSS_L4_DST_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L4_DST;
+
 	if (ethdev_rss & RSS_IPV4_ENABLE)
 		flowkey_cfg |= flow_key_type[rss_level][RSS_IPV4_INDEX];
 
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/octeontx2: extend RSS supported offload types
  2020-01-22  3:46 [dpdk-dev] [PATCH] net/octeontx2: extend RSS supported offload types kirankumark
@ 2020-01-22  8:05 ` Jerin Jacob
  2020-01-23  5:30   ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda
  2020-01-24  3:46 ` [dpdk-dev] [PATCH v2] " kirankumark
  1 sibling, 1 reply; 5+ messages in thread
From: Jerin Jacob @ 2020-01-22  8:05 UTC (permalink / raw)
  To: Kiran Kumar K; +Cc: Jerin Jacob, Nithin Dabilpuram, Vamsi Attunuru, dpdk-dev

On Wed, Jan 22, 2020 at 9:16 AM <kirankumark@marvell.com> wrote:
>
> From: Kiran Kumar K <kirankumark@marvell.com>
>
> Extend RSS offload types for octeontx2. Add support to select
> L3 SRC, L3 DST, L4 SRC and L4 DST for RSS calculation.
>
> Add support to select L3 SRC or DST only, L4 SRC or DST only for RSS
> calculation.
>
> With this requirement there will be following combinations,
> IPV[4,6]_SRC_ONLY, IPV[4,6]_DST_ONLY, [TCP,UDP,SCTP]_SRC_ONLY,
> [TCP,UDP,SCTP]_DST_ONLY. So, instead of creating a bit for each
> combination, we are using upper 4 bits (31:28) in the flow_key_cfg
> to represent the SRC, DST selection. 31 => L3_SRC, 30 => L3_DST,
> 29 => L4_SRC, 28 => L4_DST. These won't be part of flow_cfg, so that
> we don't need to change the existing ABI.
>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> ---
>
>  struct nix_rss_flowkey_cfg_rsp {
> diff --git a/drivers/net/octeontx2/otx2_rss.c b/drivers/net/octeontx2/otx2_rss.c
> index bc7b64387..7a8c8f3de 100644
> --- a/drivers/net/octeontx2/otx2_rss.c
> +++ b/drivers/net/octeontx2/otx2_rss.c
> @@ -210,6 +210,18 @@ otx2_rss_ethdev_to_nix(struct otx2_eth_dev *dev, uint64_t ethdev_rss,
>
>         dev->rss_info.nix_rss = ethdev_rss;
>

Should n't we update the struct
rte_eth_dev_info::flow_type_rss_offloads to show this capability to
the driver. Please check other drivers.



> +       if (ethdev_rss & ETH_RSS_L3_SRC_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L3_SRC;
> +
> +       if (ethdev_rss & ETH_RSS_L3_DST_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L3_DST;
> +
> +       if (ethdev_rss & ETH_RSS_L4_SRC_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L4_SRC;
> +
> +       if (ethdev_rss & ETH_RSS_L4_DST_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L4_DST;
> +
>         if (ethdev_rss & RSS_IPV4_ENABLE)
>                 flowkey_cfg |= flow_key_type[rss_level][RSS_IPV4_INDEX];
>
> --
> 2.17.1
>

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

* Re: [dpdk-dev] [EXT] Re: [PATCH] net/octeontx2: extend RSS supported offload types
  2020-01-22  8:05 ` Jerin Jacob
@ 2020-01-23  5:30   ` Kiran Kumar Kokkilagadda
  0 siblings, 0 replies; 5+ messages in thread
From: Kiran Kumar Kokkilagadda @ 2020-01-23  5:30 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Jerin Jacob Kollanukkaran, Nithin Kumar Dabilpuram,
	Vamsi Krishna Attunuru, dpdk-dev



> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Wednesday, January 22, 2020 1:35 PM
> To: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpuram@marvell.com>; Vamsi Krishna Attunuru
> <vattunuru@marvell.com>; dpdk-dev <dev@dpdk.org>
> Subject: [EXT] Re: [dpdk-dev] [PATCH] net/octeontx2: extend RSS supported
> offload types
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Wed, Jan 22, 2020 at 9:16 AM <kirankumark@marvell.com> wrote:
> >
> > From: Kiran Kumar K <kirankumark@marvell.com>
> >
> > Extend RSS offload types for octeontx2. Add support to select
> > L3 SRC, L3 DST, L4 SRC and L4 DST for RSS calculation.
> >
> > Add support to select L3 SRC or DST only, L4 SRC or DST only for RSS
> > calculation.
> >
> > With this requirement there will be following combinations,
> > IPV[4,6]_SRC_ONLY, IPV[4,6]_DST_ONLY, [TCP,UDP,SCTP]_SRC_ONLY,
> > [TCP,UDP,SCTP]_DST_ONLY. So, instead of creating a bit for each
> > combination, we are using upper 4 bits (31:28) in the flow_key_cfg to
> > represent the SRC, DST selection. 31 => L3_SRC, 30 => L3_DST,
> > 29 => L4_SRC, 28 => L4_DST. These won't be part of flow_cfg, so that
> > we don't need to change the existing ABI.
> >
> > Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> > ---
> >
> >  struct nix_rss_flowkey_cfg_rsp {
> > diff --git a/drivers/net/octeontx2/otx2_rss.c
> > b/drivers/net/octeontx2/otx2_rss.c
> > index bc7b64387..7a8c8f3de 100644
> > --- a/drivers/net/octeontx2/otx2_rss.c
> > +++ b/drivers/net/octeontx2/otx2_rss.c
> > @@ -210,6 +210,18 @@ otx2_rss_ethdev_to_nix(struct otx2_eth_dev *dev,
> > uint64_t ethdev_rss,
> >
> >         dev->rss_info.nix_rss = ethdev_rss;
> >
> 
> Should n't we update the struct
> rte_eth_dev_info::flow_type_rss_offloads to show this capability to the driver.
> Please check other drivers.

Verified with testpmd. I need to update the supported RSS offloads. Will send V2.

> 
> 
> 
> > +       if (ethdev_rss & ETH_RSS_L3_SRC_ONLY)
> > +               flowkey_cfg |= FLOW_KEY_TYPE_L3_SRC;
> > +
> > +       if (ethdev_rss & ETH_RSS_L3_DST_ONLY)
> > +               flowkey_cfg |= FLOW_KEY_TYPE_L3_DST;
> > +
> > +       if (ethdev_rss & ETH_RSS_L4_SRC_ONLY)
> > +               flowkey_cfg |= FLOW_KEY_TYPE_L4_SRC;
> > +
> > +       if (ethdev_rss & ETH_RSS_L4_DST_ONLY)
> > +               flowkey_cfg |= FLOW_KEY_TYPE_L4_DST;
> > +
> >         if (ethdev_rss & RSS_IPV4_ENABLE)
> >                 flowkey_cfg |=
> > flow_key_type[rss_level][RSS_IPV4_INDEX];
> >
> > --
> > 2.17.1
> >

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

* [dpdk-dev] [PATCH v2] net/octeontx2: extend RSS supported offload types
  2020-01-22  3:46 [dpdk-dev] [PATCH] net/octeontx2: extend RSS supported offload types kirankumark
  2020-01-22  8:05 ` Jerin Jacob
@ 2020-01-24  3:46 ` kirankumark
  2020-01-28 11:14   ` Jerin Jacob
  1 sibling, 1 reply; 5+ messages in thread
From: kirankumark @ 2020-01-24  3:46 UTC (permalink / raw)
  To: Jerin Jacob, Nithin Dabilpuram, Vamsi Attunuru, Kiran Kumar K; +Cc: dev

From: Kiran Kumar K <kirankumark@marvell.com>

Extend RSS offload types for octeontx2. Add support to select
L3 SRC, L3 DST, L4 SRC and L4 DST for RSS calculation.

Add support to select L3 SRC or DST only, L4 SRC or DST only for RSS
calculation.

With this requirement there will be following combinations,
IPV[4,6]_SRC_ONLY, IPV[4,6]_DST_ONLY, [TCP,UDP,SCTP]_SRC_ONLY,
[TCP,UDP,SCTP]_DST_ONLY. So, instead of creating a bit for each
combination, we are using upper 4 bits (31:28) in the flow_key_cfg
to represent the SRC, DST selection. 31 => L3_SRC, 30 => L3_DST,
29 => L4_SRC, 28 => L4_DST. These won't be part of flow_cfg, so that
we don't need to change the existing ABI.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
V2 Changes:
* Updated supported offloads

 drivers/common/octeontx2/otx2_mbox.h |  6 +++++-
 drivers/net/octeontx2/otx2_ethdev.h  |  6 +++++-
 drivers/net/octeontx2/otx2_rss.c     | 12 ++++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/common/octeontx2/otx2_mbox.h b/drivers/common/octeontx2/otx2_mbox.h
index e0e4e2f63..4972b8a6e 100644
--- a/drivers/common/octeontx2/otx2_mbox.h
+++ b/drivers/common/octeontx2/otx2_mbox.h
@@ -918,7 +918,11 @@ struct nix_rss_flowkey_cfg {
 #define FLOW_KEY_TYPE_INNR_UDP      BIT(15)
 #define FLOW_KEY_TYPE_INNR_SCTP     BIT(16)
 #define FLOW_KEY_TYPE_INNR_ETH_DMAC BIT(17)
-	uint8_t	group;       /* RSS context or group */
+#define FLOW_KEY_TYPE_L4_DST BIT(28)
+#define FLOW_KEY_TYPE_L4_SRC BIT(29)
+#define FLOW_KEY_TYPE_L3_DST BIT(30)
+#define FLOW_KEY_TYPE_L3_SRC BIT(31)
+	uint8_t	__otx2_io group;       /* RSS context or group */
 };

 struct nix_rss_flowkey_cfg_rsp {
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 3f3fdecc4..c075b8d1a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -113,9 +113,13 @@
 #define CQ_TIMER_THRESH_DEFAULT	0xAULL /* ~1usec i.e (0xA * 100nsec) */
 #define CQ_TIMER_THRESH_MAX     255

+#define NIX_RSS_L3_L4_SRC_DST  (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY \
+				| ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY)
+
 #define NIX_RSS_OFFLOAD		(ETH_RSS_PORT | ETH_RSS_IP | ETH_RSS_UDP |\
 				 ETH_RSS_TCP | ETH_RSS_SCTP | \
-				 ETH_RSS_TUNNEL | ETH_RSS_L2_PAYLOAD)
+				 ETH_RSS_TUNNEL | ETH_RSS_L2_PAYLOAD | \
+				 NIX_RSS_L3_L4_SRC_DST)

 #define NIX_TX_OFFLOAD_CAPA ( \
 	DEV_TX_OFFLOAD_MBUF_FAST_FREE	| \
diff --git a/drivers/net/octeontx2/otx2_rss.c b/drivers/net/octeontx2/otx2_rss.c
index bc7b64387..7a8c8f3de 100644
--- a/drivers/net/octeontx2/otx2_rss.c
+++ b/drivers/net/octeontx2/otx2_rss.c
@@ -210,6 +210,18 @@ otx2_rss_ethdev_to_nix(struct otx2_eth_dev *dev, uint64_t ethdev_rss,

 	dev->rss_info.nix_rss = ethdev_rss;

+	if (ethdev_rss & ETH_RSS_L3_SRC_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L3_SRC;
+
+	if (ethdev_rss & ETH_RSS_L3_DST_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L3_DST;
+
+	if (ethdev_rss & ETH_RSS_L4_SRC_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L4_SRC;
+
+	if (ethdev_rss & ETH_RSS_L4_DST_ONLY)
+		flowkey_cfg |= FLOW_KEY_TYPE_L4_DST;
+
 	if (ethdev_rss & RSS_IPV4_ENABLE)
 		flowkey_cfg |= flow_key_type[rss_level][RSS_IPV4_INDEX];

--
2.17.1


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

* Re: [dpdk-dev] [PATCH v2] net/octeontx2: extend RSS supported offload types
  2020-01-24  3:46 ` [dpdk-dev] [PATCH v2] " kirankumark
@ 2020-01-28 11:14   ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2020-01-28 11:14 UTC (permalink / raw)
  To: Kiran Kumar K; +Cc: Jerin Jacob, Nithin Dabilpuram, Vamsi Attunuru, dpdk-dev

On Fri, Jan 24, 2020 at 9:16 AM <kirankumark@marvell.com> wrote:
>
> From: Kiran Kumar K <kirankumark@marvell.com>
>
> Extend RSS offload types for octeontx2. Add support to select
> L3 SRC, L3 DST, L4 SRC and L4 DST for RSS calculation.
>
> Add support to select L3 SRC or DST only, L4 SRC or DST only for RSS
> calculation.
>
> With this requirement there will be following combinations,
> IPV[4,6]_SRC_ONLY, IPV[4,6]_DST_ONLY, [TCP,UDP,SCTP]_SRC_ONLY,
> [TCP,UDP,SCTP]_DST_ONLY. So, instead of creating a bit for each
> combination, we are using upper 4 bits (31:28) in the flow_key_cfg
> to represent the SRC, DST selection. 31 => L3_SRC, 30 => L3_DST,
> 29 => L4_SRC, 28 => L4_DST. These won't be part of flow_cfg, so that
> we don't need to change the existing ABI.
>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied to dpdk-next-net-mrvl/master. Thanks


> ---
> V2 Changes:
> * Updated supported offloads
>
>  drivers/common/octeontx2/otx2_mbox.h |  6 +++++-
>  drivers/net/octeontx2/otx2_ethdev.h  |  6 +++++-
>  drivers/net/octeontx2/otx2_rss.c     | 12 ++++++++++++
>  3 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/common/octeontx2/otx2_mbox.h b/drivers/common/octeontx2/otx2_mbox.h
> index e0e4e2f63..4972b8a6e 100644
> --- a/drivers/common/octeontx2/otx2_mbox.h
> +++ b/drivers/common/octeontx2/otx2_mbox.h
> @@ -918,7 +918,11 @@ struct nix_rss_flowkey_cfg {
>  #define FLOW_KEY_TYPE_INNR_UDP      BIT(15)
>  #define FLOW_KEY_TYPE_INNR_SCTP     BIT(16)
>  #define FLOW_KEY_TYPE_INNR_ETH_DMAC BIT(17)
> -       uint8_t group;       /* RSS context or group */
> +#define FLOW_KEY_TYPE_L4_DST BIT(28)
> +#define FLOW_KEY_TYPE_L4_SRC BIT(29)
> +#define FLOW_KEY_TYPE_L3_DST BIT(30)
> +#define FLOW_KEY_TYPE_L3_SRC BIT(31)
> +       uint8_t __otx2_io group;       /* RSS context or group */
>  };
>
>  struct nix_rss_flowkey_cfg_rsp {
> diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
> index 3f3fdecc4..c075b8d1a 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.h
> +++ b/drivers/net/octeontx2/otx2_ethdev.h
> @@ -113,9 +113,13 @@
>  #define CQ_TIMER_THRESH_DEFAULT        0xAULL /* ~1usec i.e (0xA * 100nsec) */
>  #define CQ_TIMER_THRESH_MAX     255
>
> +#define NIX_RSS_L3_L4_SRC_DST  (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY \
> +                               | ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY)
> +
>  #define NIX_RSS_OFFLOAD                (ETH_RSS_PORT | ETH_RSS_IP | ETH_RSS_UDP |\
>                                  ETH_RSS_TCP | ETH_RSS_SCTP | \
> -                                ETH_RSS_TUNNEL | ETH_RSS_L2_PAYLOAD)
> +                                ETH_RSS_TUNNEL | ETH_RSS_L2_PAYLOAD | \
> +                                NIX_RSS_L3_L4_SRC_DST)
>
>  #define NIX_TX_OFFLOAD_CAPA ( \
>         DEV_TX_OFFLOAD_MBUF_FAST_FREE   | \
> diff --git a/drivers/net/octeontx2/otx2_rss.c b/drivers/net/octeontx2/otx2_rss.c
> index bc7b64387..7a8c8f3de 100644
> --- a/drivers/net/octeontx2/otx2_rss.c
> +++ b/drivers/net/octeontx2/otx2_rss.c
> @@ -210,6 +210,18 @@ otx2_rss_ethdev_to_nix(struct otx2_eth_dev *dev, uint64_t ethdev_rss,
>
>         dev->rss_info.nix_rss = ethdev_rss;
>
> +       if (ethdev_rss & ETH_RSS_L3_SRC_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L3_SRC;
> +
> +       if (ethdev_rss & ETH_RSS_L3_DST_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L3_DST;
> +
> +       if (ethdev_rss & ETH_RSS_L4_SRC_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L4_SRC;
> +
> +       if (ethdev_rss & ETH_RSS_L4_DST_ONLY)
> +               flowkey_cfg |= FLOW_KEY_TYPE_L4_DST;
> +
>         if (ethdev_rss & RSS_IPV4_ENABLE)
>                 flowkey_cfg |= flow_key_type[rss_level][RSS_IPV4_INDEX];
>
> --
> 2.17.1
>

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

end of thread, other threads:[~2020-01-28 11:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22  3:46 [dpdk-dev] [PATCH] net/octeontx2: extend RSS supported offload types kirankumark
2020-01-22  8:05 ` Jerin Jacob
2020-01-23  5:30   ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda
2020-01-24  3:46 ` [dpdk-dev] [PATCH v2] " kirankumark
2020-01-28 11:14   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).