DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types
@ 2018-09-26  2:54 John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 2/6] net/enic: enable IOVA mode John Daley
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: John Daley @ 2018-09-26  2:54 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim

From: Hyong Youb Kim <hyonkim@cisco.com>

Bugzilla ID: 39
Fixes: 9913fbb91df0 ("enic/base: common code")
Fixes: 322b355f2183 ("net/enic/base: bring NIC interface functions up to date")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/base/vnic_devcmd.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/enic/base/vnic_devcmd.h b/drivers/net/enic/base/vnic_devcmd.h
index a22d8a76c..fffe307e0 100644
--- a/drivers/net/enic/base/vnic_devcmd.h
+++ b/drivers/net/enic/base/vnic_devcmd.h
@@ -875,7 +875,7 @@ struct filter_action_v2 {
 	u32 rq_idx;
 	u32 flags;                     /* use FILTER_ACTION_XXX_FLAG defines */
 	u16 filter_id;
-	u_int8_t reserved[32];         /* for future expansion */
+	uint8_t reserved[32];         /* for future expansion */
 } __attribute__((packed));
 
 /* Specifies the filter type. */
@@ -941,9 +941,9 @@ enum {
 };
 
 struct filter_tlv {
-	u_int32_t type;
-	u_int32_t length;
-	u_int32_t val[0];
+	uint32_t type;
+	uint32_t length;
+	uint32_t val[0];
 };
 
 /* Data for CMD_ADD_FILTER is 2 TLV and filter + action structs */
@@ -957,10 +957,10 @@ struct filter_tlv {
  * drivers should use this instead of "sizeof (struct filter_v2)" when
  * computing length for TLV.
  */
-static inline u_int32_t
+static inline uint32_t
 vnic_filter_size(struct filter_v2 *fp)
 {
-	u_int32_t size;
+	uint32_t size;
 
 	switch (fp->type) {
 	case FILTER_USNIC_ID:
@@ -999,10 +999,10 @@ enum {
  * drivers should use this instead of "sizeof (struct filter_action_v2)"
  * when computing length for TLV.
  */
-static inline u_int32_t
+static inline uint32_t
 vnic_action_size(struct filter_action_v2 *fap)
 {
-	u_int32_t size;
+	uint32_t size;
 
 	switch (fap->type) {
 	case FILTER_ACTION_RQ_STEERING:
-- 
2.16.2

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

* [dpdk-dev] [PATCH 2/6] net/enic: enable IOVA mode
  2018-09-26  2:54 [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types John Daley
@ 2018-09-26  2:54 ` John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 3/6] net/enic: set Rx VLAN offload flag for non-stripped packets John Daley
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: John Daley @ 2018-09-26  2:54 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim

From: Hyong Youb Kim <hyonkim@cisco.com>

Cisco VIC models support RTE_IOVA_VA, so enable it. This change allows
the driver to work properly when --no-huge is used, in combination
with vfio and iommu.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index b3d57771f..65333c47a 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -1044,7 +1044,8 @@ static int eth_enic_pci_remove(struct rte_pci_device *pci_dev)
 
 static struct rte_pci_driver rte_enic_pmd = {
 	.id_table = pci_id_enic_map,
-	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
+		     RTE_PCI_DRV_IOVA_AS_VA,
 	.probe = eth_enic_pci_probe,
 	.remove = eth_enic_pci_remove,
 };
-- 
2.16.2

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

* [dpdk-dev] [PATCH 3/6] net/enic: set Rx VLAN offload flag for non-stripped packets
  2018-09-26  2:54 [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 2/6] net/enic: enable IOVA mode John Daley
@ 2018-09-26  2:54 ` John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 4/6] net/enic: do not use deprecated Tx VLAN packet flag John Daley
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: John Daley @ 2018-09-26  2:54 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim, stable

From: Hyong Youb Kim <hyonkim@cisco.com>

The NIC indicates VLAN TCI to the driver even when VLAN stripping is
disabled. The driver sets mbuf's vlan_tci but not PKT_RX_VLAN. Set
PKT_RX_VLAN to indicate that vlan_tci is valid.

Fixes: c6f455507411 ("net/enic: add ethernet VLAN packet type")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 7129e1217..0eb113d75 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -233,10 +233,12 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf)
 		pkt_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
 		mbuf->packet_type |= RTE_PTYPE_L2_ETHER;
 	} else {
-		if (vlan_tci != 0)
+		if (vlan_tci != 0) {
+			pkt_flags |= PKT_RX_VLAN;
 			mbuf->packet_type |= RTE_PTYPE_L2_ETHER_VLAN;
-		else
+		} else {
 			mbuf->packet_type |= RTE_PTYPE_L2_ETHER;
+		}
 	}
 	mbuf->vlan_tci = vlan_tci;
 
-- 
2.16.2

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

* [dpdk-dev] [PATCH 4/6] net/enic: do not use deprecated Tx VLAN packet flag
  2018-09-26  2:54 [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 2/6] net/enic: enable IOVA mode John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 3/6] net/enic: set Rx VLAN offload flag for non-stripped packets John Daley
@ 2018-09-26  2:54 ` John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 5/6] net/enic: add VLAN and csum offloads to simple Tx handler John Daley
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: John Daley @ 2018-09-26  2:54 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim

From: Hyong Youb Kim <hyonkim@cisco.com>

Replace PKT_TX_VLAN_PKT (deprecated) with PKT_TX_VLAN.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_res.c  | 2 +-
 drivers/net/enic/enic_rxtx.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index abe004b24..84486cace 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -200,7 +200,7 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM;
 	enic->tx_offload_mask =
-		PKT_TX_VLAN_PKT |
+		PKT_TX_VLAN |
 		PKT_TX_IP_CKSUM |
 		PKT_TX_L4_MASK |
 		PKT_TX_TCP_SEG;
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 0eb113d75..8d57c418f 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -709,7 +709,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	wq_desc_avail = vnic_wq_desc_avail(wq);
 	head_idx = wq->head_idx;
 	desc_count = wq->ring.desc_count;
-	ol_flags_mask = PKT_TX_VLAN_PKT | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK;
+	ol_flags_mask = PKT_TX_VLAN | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK;
 	tx_oversized = &enic->soft_stats.tx_oversized;
 
 	nb_pkts = RTE_MIN(nb_pkts, ENIC_TX_XMIT_MAX);
@@ -737,7 +737,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		mss = 0;
 		vlan_id = tx_pkt->vlan_tci;
-		vlan_tag_insert = !!(ol_flags & PKT_TX_VLAN_PKT);
+		vlan_tag_insert = !!(ol_flags & PKT_TX_VLAN);
 		bus_addr = (dma_addr_t)
 			   (tx_pkt->buf_iova + tx_pkt->data_off);
 
-- 
2.16.2

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

* [dpdk-dev] [PATCH 5/6] net/enic: add VLAN and csum offloads to simple Tx handler
  2018-09-26  2:54 [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types John Daley
                   ` (2 preceding siblings ...)
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 4/6] net/enic: do not use deprecated Tx VLAN packet flag John Daley
@ 2018-09-26  2:54 ` John Daley
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 6/6] net/enic: explicitly disable overlay offload John Daley
  2018-10-01 14:32 ` [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types Ferruh Yigit
  5 siblings, 0 replies; 7+ messages in thread
From: John Daley @ 2018-09-26  2:54 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim

From: Hyong Youb Kim <hyonkim@cisco.com>

Currently the simple Tx handler supports no offloads, which makes it
usable only for a small number of benchmarks. Add vlan and checksum
offloads to the handler, as cycles/packet increases only by about 3
cycles, and applications commonly use those offloads.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 14 +++++++++++---
 drivers/net/enic/enic_rxtx.c | 21 +++++++++++++++++++++
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index fd940c583..03c5ef741 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -534,6 +534,7 @@ int enic_enable(struct enic *enic)
 	unsigned int index;
 	int err;
 	struct rte_eth_dev *eth_dev = enic->rte_dev;
+	uint64_t simple_tx_offloads;
 
 	eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev);
 	eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
@@ -572,10 +573,17 @@ int enic_enable(struct enic *enic)
 	}
 
 	/*
-	 * Use the simple TX handler if possible. All offloads must be
-	 * disabled.
+	 * Use the simple TX handler if possible. Only checksum offloads
+	 * and vlan insertion are supported.
 	 */
-	if (eth_dev->data->dev_conf.txmode.offloads == 0) {
+	simple_tx_offloads = enic->tx_offload_capa &
+		(DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+		 DEV_TX_OFFLOAD_VLAN_INSERT |
+		 DEV_TX_OFFLOAD_IPV4_CKSUM |
+		 DEV_TX_OFFLOAD_UDP_CKSUM |
+		 DEV_TX_OFFLOAD_TCP_CKSUM);
+	if ((eth_dev->data->dev_conf.txmode.offloads &
+	     ~simple_tx_offloads) == 0) {
 		PMD_INIT_LOG(DEBUG, " use the simple tx handler");
 		eth_dev->tx_pkt_burst = &enic_simple_xmit_pkts;
 		for (index = 0; index < enic->wq_count; index++)
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 8d57c418f..276a2e559 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -842,12 +842,33 @@ static void enqueue_simple_pkts(struct rte_mbuf **pkts,
 				struct enic *enic)
 {
 	struct rte_mbuf *p;
+	uint16_t mss;
 
 	while (n) {
 		n--;
 		p = *pkts++;
 		desc->address = p->buf_iova + p->data_off;
 		desc->length = p->pkt_len;
+		/* VLAN insert */
+		desc->vlan_tag = p->vlan_tci;
+		desc->header_length_flags &=
+			((1 << WQ_ENET_FLAGS_EOP_SHIFT) |
+			 (1 << WQ_ENET_FLAGS_CQ_ENTRY_SHIFT));
+		if (p->ol_flags & PKT_TX_VLAN) {
+			desc->header_length_flags |=
+				1 << WQ_ENET_FLAGS_VLAN_TAG_INSERT_SHIFT;
+		}
+		/*
+		 * Checksum offload. We use WQ_ENET_OFFLOAD_MODE_CSUM, which
+		 * is 0, so no need to set offload_mode.
+		 */
+		mss = 0;
+		if (p->ol_flags & PKT_TX_IP_CKSUM)
+			mss |= ENIC_CALC_IP_CKSUM << WQ_ENET_MSS_SHIFT;
+		if (p->ol_flags & PKT_TX_L4_MASK)
+			mss |= ENIC_CALC_TCP_UDP_CKSUM << WQ_ENET_MSS_SHIFT;
+		desc->mss_loopback = mss;
+
 		/*
 		 * The app should not send oversized
 		 * packets. tx_pkt_prepare includes a check as
-- 
2.16.2

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

* [dpdk-dev] [PATCH 6/6] net/enic: explicitly disable overlay offload
  2018-09-26  2:54 [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types John Daley
                   ` (3 preceding siblings ...)
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 5/6] net/enic: add VLAN and csum offloads to simple Tx handler John Daley
@ 2018-09-26  2:54 ` John Daley
  2018-10-01 14:32 ` [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types Ferruh Yigit
  5 siblings, 0 replies; 7+ messages in thread
From: John Daley @ 2018-09-26  2:54 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Hyong Youb Kim, stable

From: Hyong Youb Kim <hyonkim@cisco.com>

Reopening vNIC does not automatically disable overlay offload. If it
is previously enabled, it remains enabled even when the user restarts
DPDK and requests overlay offload to be disabled via devarg
disable-overlay=1. So explicitly disable overlay offload when
requested.

Fixes: 93fb21fdbe23 ("net/enic: enable overlay offload for VXLAN and GENEVE")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 03c5ef741..af29f9d90 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1652,6 +1652,19 @@ static int enic_dev_init(struct enic *enic)
 	vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */
 
 	enic->overlay_offload = false;
+	if (enic->disable_overlay && enic->vxlan) {
+		/*
+		 * Explicitly disable overlay offload as the setting is
+		 * sticky, and resetting vNIC does not disable it.
+		 */
+		if (vnic_dev_overlay_offload_ctrl(enic->vdev,
+						  OVERLAY_FEATURE_VXLAN,
+						  OVERLAY_OFFLOAD_DISABLE)) {
+			dev_err(enic, "failed to disable overlay offload\n");
+		} else {
+			dev_info(enic, "Overlay offload is disabled\n");
+		}
+	}
 	if (!enic->disable_overlay && enic->vxlan &&
 	    /* 'VXLAN feature' enables VXLAN, NVGRE, and GENEVE. */
 	    vnic_dev_overlay_offload_ctrl(enic->vdev,
-- 
2.16.2

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

* Re: [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types
  2018-09-26  2:54 [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types John Daley
                   ` (4 preceding siblings ...)
  2018-09-26  2:54 ` [dpdk-dev] [PATCH 6/6] net/enic: explicitly disable overlay offload John Daley
@ 2018-10-01 14:32 ` Ferruh Yigit
  5 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2018-10-01 14:32 UTC (permalink / raw)
  To: John Daley; +Cc: dev, Hyong Youb Kim

On 9/26/2018 3:54 AM, John Daley wrote:
> From: Hyong Youb Kim <hyonkim@cisco.com>
> 
> Bugzilla ID: 39
> Fixes: 9913fbb91df0 ("enic/base: common code")
> Fixes: 322b355f2183 ("net/enic/base: bring NIC interface functions up to date")
> 
> Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-10-01 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26  2:54 [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types John Daley
2018-09-26  2:54 ` [dpdk-dev] [PATCH 2/6] net/enic: enable IOVA mode John Daley
2018-09-26  2:54 ` [dpdk-dev] [PATCH 3/6] net/enic: set Rx VLAN offload flag for non-stripped packets John Daley
2018-09-26  2:54 ` [dpdk-dev] [PATCH 4/6] net/enic: do not use deprecated Tx VLAN packet flag John Daley
2018-09-26  2:54 ` [dpdk-dev] [PATCH 5/6] net/enic: add VLAN and csum offloads to simple Tx handler John Daley
2018-09-26  2:54 ` [dpdk-dev] [PATCH 6/6] net/enic: explicitly disable overlay offload John Daley
2018-10-01 14:32 ` [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types Ferruh Yigit

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).