patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/6] net/cxgbevf: add missing PCI uninitialization function for VF
       [not found] <cover.1541747960.git.rahul.lakkireddy@chelsio.com>
@ 2018-11-09  7:56 ` Rahul Lakkireddy
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 2/6] net/cxgbe: check Rx offload flags before doing VLAN strip offload Rahul Lakkireddy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: Rahul Lakkireddy @ 2018-11-09  7:56 UTC (permalink / raw)
  To: dev; +Cc: indranil, nirranjan, stable

Fixes: 2195df6d11bd ("net/cxgbe: rework ethdev device allocation")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbevf_ethdev.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/cxgbe/cxgbevf_ethdev.c b/drivers/net/cxgbe/cxgbevf_ethdev.c
index 3b32ca9d4..a6458d533 100644
--- a/drivers/net/cxgbe/cxgbevf_ethdev.c
+++ b/drivers/net/cxgbe/cxgbevf_ethdev.c
@@ -177,6 +177,16 @@ static int eth_cxgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	return err;
 }
 
+static int eth_cxgbevf_dev_uninit(struct rte_eth_dev *eth_dev)
+{
+	struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private);
+	struct adapter *adap = pi->adapter;
+
+	/* Free up other ports and all resources */
+	cxgbe_close(adap);
+	return 0;
+}
+
 static int eth_cxgbevf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 				 struct rte_pci_device *pci_dev)
 {
@@ -186,7 +196,7 @@ static int eth_cxgbevf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 static int eth_cxgbevf_pci_remove(struct rte_pci_device *pci_dev)
 {
-	return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
+	return rte_eth_dev_pci_generic_remove(pci_dev, eth_cxgbevf_dev_uninit);
 }
 
 static struct rte_pci_driver rte_cxgbevf_pmd = {
-- 
2.18.0

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

* [dpdk-stable] [PATCH 2/6] net/cxgbe: check Rx offload flags before doing VLAN strip offload
       [not found] <cover.1541747960.git.rahul.lakkireddy@chelsio.com>
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 1/6] net/cxgbevf: add missing PCI uninitialization function for VF Rahul Lakkireddy
@ 2018-11-09  7:56 ` Rahul Lakkireddy
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 3/6] net/cxgbe: fix check for redefined match items Rahul Lakkireddy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: Rahul Lakkireddy @ 2018-11-09  7:56 UTC (permalink / raw)
  To: dev; +Cc: indranil, nirranjan, stable

Fixes: 436125e64174 ("net/cxgbe: update to Rx/Tx offloada API")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 88dc851f8..409c9f821 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -1339,18 +1339,22 @@ inline bool force_linkup(struct adapter *adap)
 int link_start(struct port_info *pi)
 {
 	struct adapter *adapter = pi->adapter;
-	int ret;
+	u64 conf_offloads;
 	unsigned int mtu;
+	int ret;
 
 	mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
 	      (ETHER_HDR_LEN + ETHER_CRC_LEN);
 
+	conf_offloads = pi->eth_dev->data->dev_conf.rxmode.offloads;
+
 	/*
 	 * We do not set address filters and promiscuity here, the stack does
 	 * that step explicitly.
 	 */
-	ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, mtu, -1, -1,
-			    -1, 1, true);
+	ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, mtu, -1, -1, -1,
+			    !!(conf_offloads & DEV_RX_OFFLOAD_VLAN_STRIP),
+			    true);
 	if (ret == 0) {
 		ret = cxgbe_mpstcam_modify(pi, (int)pi->xact_addr_filt,
 				(u8 *)&pi->eth_dev->data->mac_addrs[0]);
-- 
2.18.0

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

* [dpdk-stable] [PATCH 3/6] net/cxgbe: fix check for redefined match items
       [not found] <cover.1541747960.git.rahul.lakkireddy@chelsio.com>
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 1/6] net/cxgbevf: add missing PCI uninitialization function for VF Rahul Lakkireddy
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 2/6] net/cxgbe: check Rx offload flags before doing VLAN strip offload Rahul Lakkireddy
@ 2018-11-09  7:56 ` Rahul Lakkireddy
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 4/6] net/cxgbe: increase completion wait time for flow operations Rahul Lakkireddy
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 5/6] net/cxgbe: fix wrong ingress port value set in filter spec Rahul Lakkireddy
  4 siblings, 0 replies; 5+ messages in thread
From: Rahul Lakkireddy @ 2018-11-09  7:56 UTC (permalink / raw)
  To: dev; +Cc: indranil, nirranjan, stable

Fix issue where ethertype is set to 0x800 for IPv4 by ether match
item and IPv4 match item also inherently sets ethertype to 0x800.

Current logic returns error when IPv4 match item is parsed. So, fix
by only bailing if the redefined match items have different values.

Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_flow.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
index 54ec7e595..a8f076e6c 100644
--- a/drivers/net/cxgbe/cxgbe_flow.c
+++ b/drivers/net/cxgbe/cxgbe_flow.c
@@ -7,14 +7,12 @@
 
 #define __CXGBE_FILL_FS(__v, __m, fs, elem, e) \
 do { \
-	if (!((fs)->val.elem || (fs)->mask.elem)) { \
-		(fs)->val.elem = (__v); \
-		(fs)->mask.elem = (__m); \
-	} else { \
+	if ((fs)->mask.elem && ((fs)->val.elem != (__v))) \
 		return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, \
-					  NULL, "a filter can be specified" \
-					  " only once"); \
-	} \
+					  NULL, "Redefined match item with" \
+					  " different values found"); \
+	(fs)->val.elem = (__v); \
+	(fs)->mask.elem = (__m); \
 } while (0)
 
 #define __CXGBE_FILL_FS_MEMCPY(__v, __m, fs, elem) \
-- 
2.18.0

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

* [dpdk-stable] [PATCH 4/6] net/cxgbe: increase completion wait time for flow operations
       [not found] <cover.1541747960.git.rahul.lakkireddy@chelsio.com>
                   ` (2 preceding siblings ...)
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 3/6] net/cxgbe: fix check for redefined match items Rahul Lakkireddy
@ 2018-11-09  7:56 ` Rahul Lakkireddy
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 5/6] net/cxgbe: fix wrong ingress port value set in filter spec Rahul Lakkireddy
  4 siblings, 0 replies; 5+ messages in thread
From: Rahul Lakkireddy @ 2018-11-09  7:56 UTC (permalink / raw)
  To: dev; +Cc: indranil, nirranjan, stable

Under heavy load, flow related operations can take more time to
complete. Increase max completion wait time to 10 seconds. Also
increase max receive budget to read more replies from firmware
in every cycle.

Fixes: 9eb2c9a48072 ("net/cxgbe: implement flow create operation")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_flow.c | 4 ++--
 drivers/net/cxgbe/cxgbe_flow.h | 5 +++--
 drivers/net/cxgbe/cxgbe_main.c | 8 ++++----
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
index a8f076e6c..4deaff8f2 100644
--- a/drivers/net/cxgbe/cxgbe_flow.c
+++ b/drivers/net/cxgbe/cxgbe_flow.c
@@ -797,7 +797,7 @@ static int __cxgbe_flow_create(struct rte_eth_dev *dev, struct rte_flow *flow)
 
 	/* Poll the FW for reply */
 	err = cxgbe_poll_for_completion(&adap->sge.fw_evtq,
-					CXGBE_FLOW_POLL_US,
+					CXGBE_FLOW_POLL_MS,
 					CXGBE_FLOW_POLL_CNT,
 					&ctx.completion);
 	if (err) {
@@ -883,7 +883,7 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
 
 	/* Poll the FW for reply */
 	err = cxgbe_poll_for_completion(&adap->sge.fw_evtq,
-					CXGBE_FLOW_POLL_US,
+					CXGBE_FLOW_POLL_MS,
 					CXGBE_FLOW_POLL_CNT,
 					&ctx.completion);
 	if (err) {
diff --git a/drivers/net/cxgbe/cxgbe_flow.h b/drivers/net/cxgbe/cxgbe_flow.h
index 718bf3d05..ec8e47aeb 100644
--- a/drivers/net/cxgbe/cxgbe_flow.h
+++ b/drivers/net/cxgbe/cxgbe_flow.h
@@ -10,8 +10,9 @@
 #include "mps_tcam.h"
 #include "cxgbe.h"
 
-#define CXGBE_FLOW_POLL_US  10
-#define CXGBE_FLOW_POLL_CNT 10
+/* Max poll time is 100 * 100msec = 10 sec */
+#define CXGBE_FLOW_POLL_MS  100 /* 100 milliseconds */
+#define CXGBE_FLOW_POLL_CNT 100 /* Max number of times to poll */
 
 struct chrte_fparse {
 	int (*fptr)(const void *mask, /* currently supported mask */
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 409c9f821..ec080e5d3 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -157,18 +157,18 @@ int setup_sge_ctrl_txq(struct adapter *adapter)
 /**
  * cxgbe_poll_for_completion: Poll rxq for completion
  * @q: rxq to poll
- * @us: microseconds to delay
+ * @ms: milliseconds to delay
  * @cnt: number of times to poll
  * @c: completion to check for 'done' status
  *
  * Polls the rxq for reples until completion is done or the count
  * expires.
  */
-int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int us,
+int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int ms,
 			      unsigned int cnt, struct t4_completion *c)
 {
 	unsigned int i;
-	unsigned int work_done, budget = 4;
+	unsigned int work_done, budget = 32;
 
 	if (!c)
 		return -EINVAL;
@@ -181,7 +181,7 @@ int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int us,
 			return 0;
 		}
 		t4_os_unlock(&c->lock);
-		udelay(us);
+		rte_delay_ms(ms);
 	}
 	return -ETIMEDOUT;
 }
-- 
2.18.0

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

* [dpdk-stable] [PATCH 5/6] net/cxgbe: fix wrong ingress port value set in filter spec
       [not found] <cover.1541747960.git.rahul.lakkireddy@chelsio.com>
                   ` (3 preceding siblings ...)
  2018-11-09  7:56 ` [dpdk-stable] [PATCH 4/6] net/cxgbe: increase completion wait time for flow operations Rahul Lakkireddy
@ 2018-11-09  7:56 ` Rahul Lakkireddy
  4 siblings, 0 replies; 5+ messages in thread
From: Rahul Lakkireddy @ 2018-11-09  7:56 UTC (permalink / raw)
  To: dev; +Cc: indranil, nirranjan, stable

Set the "value" in the filter spec and not the "mask". Also, remove
duplicate comparison for hardware supported match items already done
earlier.

Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_filter.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index ef1102be3..3a7912e48 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -263,8 +263,8 @@ static u64 hash_filter_ntuple(const struct filter_entry *f)
 	u64 ntuple = 0;
 	u16 tcp_proto = IPPROTO_TCP; /* TCP Protocol Number */
 
-	if (tp->port_shift >= 0)
-		ntuple |= (u64)f->fs.mask.iport << tp->port_shift;
+	if (tp->port_shift >= 0 && f->fs.mask.iport)
+		ntuple |= (u64)f->fs.val.iport << tp->port_shift;
 
 	if (tp->protocol_shift >= 0) {
 		if (!f->fs.val.proto)
@@ -278,9 +278,6 @@ static u64 hash_filter_ntuple(const struct filter_entry *f)
 	if (tp->macmatch_shift >= 0 && f->fs.mask.macidx)
 		ntuple |= (u64)(f->fs.val.macidx) << tp->macmatch_shift;
 
-	if (ntuple != tp->hash_filter_mask)
-		return 0;
-
 	return ntuple;
 }
 
-- 
2.18.0

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

end of thread, other threads:[~2018-11-09  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1541747960.git.rahul.lakkireddy@chelsio.com>
2018-11-09  7:56 ` [dpdk-stable] [PATCH 1/6] net/cxgbevf: add missing PCI uninitialization function for VF Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-stable] [PATCH 2/6] net/cxgbe: check Rx offload flags before doing VLAN strip offload Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-stable] [PATCH 3/6] net/cxgbe: fix check for redefined match items Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-stable] [PATCH 4/6] net/cxgbe: increase completion wait time for flow operations Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-stable] [PATCH 5/6] net/cxgbe: fix wrong ingress port value set in filter spec Rahul Lakkireddy

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