patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v1 1/3] net/hinic: increase the protection of the VLAN
       [not found] <cover.1626429126.git.zhouguoyang@huawei.com>
@ 2021-07-16  9:54 ` Guoyang Zhou
  2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 2/3] net/hinic/base: fix the problem of LRO Guoyang Zhou
  2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 3/3] net/hinic: fix the problem of MTU inconsistent Guoyang Zhou
  2 siblings, 0 replies; 3+ messages in thread
From: Guoyang Zhou @ 2021-07-16  9:54 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bluca, cloud.wangxiaoyun, luoxianjun, yin.yinshi,
	luojiachen, zhouguoyang, chenlizhong, zhaohui8, chenchanghu,
	stevex.yang, stable

If the vlan id 0 is deleted for hinic, all packets without
vlan will be discarded when the vlan filter is turned on.

Fixes: 50ce3e7aec8f ("ethdev: fix VLAN offloads set if no relative capabilities")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
---
 drivers/net/hinic/hinic_pmd_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9464657..75849f2 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -1617,6 +1617,9 @@ static int hinic_vlan_filter_set(struct rte_eth_dev *dev,
 	if (vlan_id > RTE_ETHER_MAX_VLAN_ID)
 		return -EINVAL;
 
+	if (vlan_id == 0)
+		return 0;
+
 	func_id = hinic_global_func_id(nic_dev->hwdev);
 
 	if (enable) {
-- 
1.8.3.1


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

* [dpdk-stable] [PATCH v1 2/3] net/hinic/base: fix the problem of LRO
       [not found] <cover.1626429126.git.zhouguoyang@huawei.com>
  2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 1/3] net/hinic: increase the protection of the VLAN Guoyang Zhou
@ 2021-07-16  9:54 ` Guoyang Zhou
  2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 3/3] net/hinic: fix the problem of MTU inconsistent Guoyang Zhou
  2 siblings, 0 replies; 3+ messages in thread
From: Guoyang Zhou @ 2021-07-16  9:54 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bluca, cloud.wangxiaoyun, luoxianjun, yin.yinshi,
	luojiachen, zhouguoyang, chenlizhong, zhaohui8, chenchanghu,
	stevex.yang, stable

The rx queue must config as ceq disable, and must set msix
state disable. Otherwise when lro is enable, there will be
problems with packet aggregation because of firmware.

Fixes: 9d02f40d6503 ("net/hinic: fix LRO")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
---
 drivers/net/hinic/base/hinic_pmd_nicio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c
index 162308b..ad5db9f 100644
--- a/drivers/net/hinic/base/hinic_pmd_nicio.c
+++ b/drivers/net/hinic/base/hinic_pmd_nicio.c
@@ -230,8 +230,8 @@ static void hinic_rq_prepare_ctxt(struct hinic_rq *rq,
 	wq_block_pfn_hi = upper_32_bits(wq_block_pfn);
 	wq_block_pfn_lo = lower_32_bits(wq_block_pfn);
 
-	/* must config as ceq enable but do not generate ceq */
-	rq_ctxt->ceq_attr = RQ_CTXT_CEQ_ATTR_SET(1, EN) |
+	/* config as ceq disable, but must set msix state disable */
+	rq_ctxt->ceq_attr = RQ_CTXT_CEQ_ATTR_SET(0, EN) |
 			    RQ_CTXT_CEQ_ATTR_SET(1, OWNER);
 
 	rq_ctxt->pi_intr_attr = RQ_CTXT_PI_SET(pi_start, IDX) |
-- 
1.8.3.1


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

* [dpdk-stable] [PATCH v1 3/3] net/hinic: fix the problem of MTU inconsistent
       [not found] <cover.1626429126.git.zhouguoyang@huawei.com>
  2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 1/3] net/hinic: increase the protection of the VLAN Guoyang Zhou
  2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 2/3] net/hinic/base: fix the problem of LRO Guoyang Zhou
@ 2021-07-16  9:54 ` Guoyang Zhou
  2 siblings, 0 replies; 3+ messages in thread
From: Guoyang Zhou @ 2021-07-16  9:54 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bluca, cloud.wangxiaoyun, luoxianjun, yin.yinshi,
	luojiachen, zhouguoyang, chenlizhong, zhaohui8, chenchanghu,
	stevex.yang, stable

The configuration of mtu is inconsistent in the driver and
firmware when the port is stopped, started and reconfigured.
Before, HINIC_MAX_JUMBO_FRAME_SIZE include vlan tag, but when
frame and pktlen are converted to each other do not include
vlan tag. And port_mtu_set function will use HINIC_MAX_JUMBO_FRAME_SIZE
to calculate eth_overhead, so mtu will be inconsistent in the driver and
firmware.

Fixes: e542ab51ab27 ("net/hinic: fix jumbo frame flag condition for MTU set")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
---
 drivers/net/hinic/base/hinic_pmd_niccfg.h |  9 ---------
 drivers/net/hinic/hinic_pmd_ethdev.c      |  9 ---------
 drivers/net/hinic/hinic_pmd_ethdev.h      | 17 +++++++++++++++++
 3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/net/hinic/base/hinic_pmd_niccfg.h b/drivers/net/hinic/base/hinic_pmd_niccfg.h
index 04cd374..0d0a670 100644
--- a/drivers/net/hinic/base/hinic_pmd_niccfg.h
+++ b/drivers/net/hinic/base/hinic_pmd_niccfg.h
@@ -116,15 +116,6 @@ enum hinic_link_mode {
 #define HINIC_DEFAULT_RX_MODE	(HINIC_RX_MODE_UC | HINIC_RX_MODE_MC |	\
 				HINIC_RX_MODE_BC)
 
-#define HINIC_MAX_MTU_SIZE		(9600)
-#define HINIC_MIN_MTU_SIZE		(256)
-
-/* MIN_MTU + ETH_HLEN + CRC (256+14+4) */
-#define HINIC_MIN_FRAME_SIZE		274
-
-/* MAX_MTU + ETH_HLEN + CRC + VLAN(9600+14+4+4) */
-#define HINIC_MAX_JUMBO_FRAME_SIZE	(9622)
-
 #define HINIC_PORT_DISABLE		0x0
 #define HINIC_PORT_ENABLE		0x3
 
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 75849f2..1a72401 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -69,15 +69,6 @@
 
 #define HINIC_VLAN_FILTER_EN		(1U << 0)
 
-#define HINIC_MTU_TO_PKTLEN(mtu)	\
-	((mtu) + ETH_HLEN + ETH_CRC_LEN)
-
-#define HINIC_PKTLEN_TO_MTU(pktlen)	\
-	((pktlen) - (ETH_HLEN + ETH_CRC_LEN))
-
-/* The max frame size with default MTU */
-#define HINIC_ETH_MAX_LEN (RTE_ETHER_MTU + ETH_HLEN + ETH_CRC_LEN)
-
 /* lro numer limit for one packet */
 #define HINIC_LRO_WQE_NUM_DEFAULT	8
 
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.h b/drivers/net/hinic/hinic_pmd_ethdev.h
index 70b4d32..8f1b3d5 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.h
+++ b/drivers/net/hinic/hinic_pmd_ethdev.h
@@ -32,6 +32,23 @@
 #define HINIC_UINT32_BIT_SIZE      (CHAR_BIT * sizeof(uint32_t))
 #define HINIC_VFTA_SIZE            (4096 / HINIC_UINT32_BIT_SIZE)
 
+#define HINIC_MAX_MTU_SIZE              9600
+#define HINIC_MIN_MTU_SIZE              256
+
+#define HINIC_VLAN_TAG_SIZE             4
+#define HINIC_ETH_OVERHEAD \
+	(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + HINIC_VLAN_TAG_SIZE * 2)
+
+#define HINIC_MIN_FRAME_SIZE        (HINIC_MIN_MTU_SIZE + HINIC_ETH_OVERHEAD)
+#define HINIC_MAX_JUMBO_FRAME_SIZE  (HINIC_MAX_MTU_SIZE + HINIC_ETH_OVERHEAD)
+
+#define HINIC_MTU_TO_PKTLEN(mtu)    ((mtu) + HINIC_ETH_OVERHEAD)
+
+#define HINIC_PKTLEN_TO_MTU(pktlen) ((pktlen) - HINIC_ETH_OVERHEAD)
+
+/* The max frame size with default MTU */
+#define HINIC_ETH_MAX_LEN           (RTE_ETHER_MTU + HINIC_ETH_OVERHEAD)
+
 enum hinic_dev_status {
 	HINIC_DEV_INIT,
 	HINIC_DEV_CLOSE,
-- 
1.8.3.1


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

end of thread, other threads:[~2021-07-16  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1626429126.git.zhouguoyang@huawei.com>
2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 1/3] net/hinic: increase the protection of the VLAN Guoyang Zhou
2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 2/3] net/hinic/base: fix the problem of LRO Guoyang Zhou
2021-07-16  9:54 ` [dpdk-stable] [PATCH v1 3/3] net/hinic: fix the problem of MTU inconsistent Guoyang Zhou

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