DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrzej Ostruszka <amo@semihalf.com>
To: dev@dpdk.org
Cc: mw@semihalf.com, nadavh@marvell.com,
	Tomasz Duszynski <tdu@semihalf.com>,
	Natalie Samsonov <nsamsono@marvell.com>,
	Yuval Caduri <cyuval@marvell.com>
Subject: [dpdk-dev] [PATCH v3 09/13] net/mvpp2: align with MUSDK 18.09
Date: Tue, 25 Sep 2018 09:05:05 +0200	[thread overview]
Message-ID: <1537859109-25659-10-git-send-email-amo@semihalf.com> (raw)
In-Reply-To: <1537859109-25659-1-git-send-email-amo@semihalf.com>

From: Tomasz Duszynski <tdu@semihalf.com>

This patch introduces necessary changes required by MUSDK 18.09 library.

* As of MUSDK 18.09, pp2_cookie_t is no longer available. Now
  RX descriptor cookie is defined as plain u64 so existing cast
  is no longer valid.

* MUSDK 18.09 increased number of available bpools (buffer hw pools) by
  introducing dma regions support. Update mvpp2 driver accordingly.

* replace MV_NET_IP4_F_TOS with MV_NET_IP4_F_DSCP

  Before this patch, API allowed to configure a classification rule
  according to IPv4 TOS, which was not supported in classifier. This patch
  fixes this by using proper field.

* use 48 bit address mask

  We cannot get pointers exceeding 48 bits thus using 48 bit
  mask for extracting higher IOVA address bits is enough.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Yuval Caduri <cyuval@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Reviewed-by: Shlomi Gridish <sgridish@marvell.com>
Reviewed-by: Alan Winkowski <walan@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 10 ++++------
 drivers/net/mvpp2/mrvl_flow.c   |  3 ++-
 drivers/net/mvpp2/mrvl_qos.c    |  2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 24bd0a5..26497ef 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -54,9 +54,7 @@
 #define MRVL_ARP_LENGTH 28
 
 #define MRVL_COOKIE_ADDR_INVALID ~0ULL
-
-#define MRVL_COOKIE_HIGH_ADDR_SHIFT	(sizeof(pp2_cookie_t) * 8)
-#define MRVL_COOKIE_HIGH_ADDR_MASK	(~0ULL << MRVL_COOKIE_HIGH_ADDR_SHIFT)
+#define MRVL_COOKIE_HIGH_ADDR_MASK 0xffffff0000000000
 
 /** Port Rx offload capabilities */
 #define MRVL_RX_OFFLOADS (DEV_RX_OFFLOAD_VLAN_FILTER | \
@@ -1534,7 +1532,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
 
 		entries[i].buff.addr =
 			rte_mbuf_data_iova_default(mbufs[i]);
-		entries[i].buff.cookie = (pp2_cookie_t)(uint64_t)mbufs[i];
+		entries[i].buff.cookie = (uint64_t)mbufs[i];
 		entries[i].bpool = bpool;
 	}
 
@@ -2170,7 +2168,7 @@ mrvl_rx_pkt_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		if (unlikely(status != PP2_DESC_ERR_OK)) {
 			struct pp2_buff_inf binf = {
 				.addr = rte_mbuf_data_iova_default(mbuf),
-				.cookie = (pp2_cookie_t)(uint64_t)mbuf,
+				.cookie = (uint64_t)mbuf,
 			};
 
 			pp2_bpool_put_buff(hif, bpool, &binf);
@@ -2431,7 +2429,7 @@ mrvl_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			rte_mbuf_prefetch_part2(pref_pkt_hdr);
 		}
 
-		sq->ent[sq->head].buff.cookie = (pp2_cookie_t)(uint64_t)mbuf;
+		sq->ent[sq->head].buff.cookie = (uint64_t)mbuf;
 		sq->ent[sq->head].buff.addr =
 			rte_mbuf_data_iova_default(mbuf);
 		sq->ent[sq->head].bpool =
diff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c
index 065b1aa..ffd1dab 100644
--- a/drivers/net/mvpp2/mrvl_flow.c
+++ b/drivers/net/mvpp2/mrvl_flow.c
@@ -2437,7 +2437,8 @@ mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
 
 	if (first_flow->pattern & F_IP4_TOS) {
 		key->proto_field[key->num_fields].proto = MV_NET_PROTO_IP4;
-		key->proto_field[key->num_fields].field.ipv4 = MV_NET_IP4_F_TOS;
+		key->proto_field[key->num_fields].field.ipv4 =
+							MV_NET_IP4_F_DSCP;
 		key->key_size += 1;
 		key->num_fields += 1;
 	}
diff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c
index 5d80c3e..7fd9703 100644
--- a/drivers/net/mvpp2/mrvl_qos.c
+++ b/drivers/net/mvpp2/mrvl_qos.c
@@ -654,7 +654,7 @@ setup_tc(struct pp2_ppio_tc_params *param, uint8_t inqs,
 	struct pp2_ppio_inq_params *inq_params;
 
 	param->pkt_offset = MRVL_PKT_OFFS;
-	param->pools[0] = bpool;
+	param->pools[0][0] = bpool;
 	param->default_color = color;
 
 	inq_params = rte_zmalloc_socket("inq_params",
-- 
2.7.4

  parent reply	other threads:[~2018-09-25  7:05 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04  7:10 [dpdk-dev] [PATCH 0/8] net/mvpp2: add new features Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 1/8] net/mvpp2: initialize ppio only once Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 2/8] net/mvpp2: move common code Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 3/8] net/mvpp2: add metering support Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 4/8] net/mvpp2: change default policer configuration Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 5/8] net/mvpp2: add init and deinit to flow Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 6/8] net/mvpp2: add traffic manager support Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 7/8] net/mvpp2: detach tx_qos from rx cls/qos config Tomasz Duszynski
2018-09-04  7:10 ` [dpdk-dev] [PATCH 8/8] net/mvpp2: update MTU and MRU related calculations Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 00/12] net/mvpp2: add new features Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 01/12] net/mvpp2: initialize ppio only once Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 02/12] net/mvpp2: move common code Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 03/12] net/mvpp2: add metering support Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 04/12] net/mvpp2: change default policer configuration Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 05/12] net/mvpp2: add init and deinit to flow Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 06/12] net/mvpp2: add traffic manager support Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 07/12] net/mvpp2: detach tx_qos from rx cls/qos config Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 08/12] net/mvpp2: update MTU and MRU related calculations Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 09/12] net/mvpp2: align with MUSDK 18.09 Tomasz Duszynski
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 10/12] net/mvpp2: align documentation " Tomasz Duszynski
2018-09-19 17:15     ` Ferruh Yigit
2018-09-23 22:40       ` Thomas Monjalon
2018-09-24 11:36         ` Ferruh Yigit
2018-09-24 11:51           ` Marcin Wojtas
2018-09-24 12:38             ` Ferruh Yigit
2018-09-24 12:44           ` Thomas Monjalon
2018-09-24 12:48             ` Marcin Wojtas
2018-09-24 12:50               ` Ferruh Yigit
2018-09-24 13:11                 ` Andrzej Ostruszka
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 11/12] net/mvpp2: document MTR and TM usage Tomasz Duszynski
2018-09-23 22:45     ` Thomas Monjalon
2018-09-04 13:49   ` [dpdk-dev] [PATCH v2 12/12] net/mvpp2: add Tx S/G support Tomasz Duszynski
2018-09-19 17:24   ` [dpdk-dev] [PATCH v2 00/12] net/mvpp2: add new features Ferruh Yigit
2018-09-25  7:04   ` [dpdk-dev] [PATCH v3 00/13] " Andrzej Ostruszka
2018-09-25  7:04     ` [dpdk-dev] [PATCH v3 01/13] net/mvpp2: initialize ppio only once Andrzej Ostruszka
2018-09-25  7:04     ` [dpdk-dev] [PATCH v3 02/13] net/mvpp2: move common code Andrzej Ostruszka
2018-09-25  7:04     ` [dpdk-dev] [PATCH v3 03/13] net/mvpp2: add metering support Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 04/13] net/mvpp2: change default policer configuration Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 05/13] net/mvpp2: add init and deinit to flow Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 06/13] net/mvpp2: add traffic manager support Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 07/13] net/mvpp2: detach Tx QoS from Rx cls/QoS config Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 08/13] net/mvpp2: update MTU and MRU related calculations Andrzej Ostruszka
2018-09-25  7:05     ` Andrzej Ostruszka [this message]
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 10/13] crypto/mvsam: get number of CIOs dynamically Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 11/13] net/mvpp2: align documentation with MUSDK 18.09 Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 12/13] net/mvpp2: document MTR and TM usage Andrzej Ostruszka
2018-09-25  7:05     ` [dpdk-dev] [PATCH v3 13/13] net/mvpp2: add Tx scatter/gather support Andrzej Ostruszka
2018-09-25 16:12     ` [dpdk-dev] [PATCH v3 00/13] net/mvpp2: add new features Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537859109-25659-10-git-send-email-amo@semihalf.com \
    --to=amo@semihalf.com \
    --cc=cyuval@marvell.com \
    --cc=dev@dpdk.org \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=nsamsono@marvell.com \
    --cc=tdu@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).