[v1,3/4] net/hinic/base: modify vhd type for SDI

Message ID 1708e8d459d3888316a70d4eabfc3172c67eb0e9.1595648149.git.cloud.wangxiaoyun@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series some bugs fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Wangxiaoyun (Cloud) July 25, 2020, 3:48 a.m. UTC
  For ovs offload scenario, when fw processes the virtio header,
there is no need to offset; and for standard card scenarios,
fw does not care about the vhd_type parameter, so in order to
be compatible with the two scenarios, use 0 offset instead.

Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +-
 drivers/net/hinic/base/hinic_pmd_nicio.h | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c
index 2914e99..576fe59 100644
--- a/drivers/net/hinic/base/hinic_pmd_nicio.c
+++ b/drivers/net/hinic/base/hinic_pmd_nicio.c
@@ -578,7 +578,7 @@  int hinic_init_qp_ctxts(struct hinic_hwdev *hwdev)
 	rx_buf_sz = nic_io->rq_buf_size;
 
 	/* update rx buf size to function table */
-	err = hinic_set_rx_vhd_mode(hwdev, 0, rx_buf_sz);
+	err = hinic_set_rx_vhd_mode(hwdev, HINIC_VHD_TYPE_0B, rx_buf_sz);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Set rx vhd mode failed, rc: %d", err);
 		return err;
diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.h b/drivers/net/hinic/base/hinic_pmd_nicio.h
index 9a487d0..600c073 100644
--- a/drivers/net/hinic/base/hinic_pmd_nicio.h
+++ b/drivers/net/hinic/base/hinic_pmd_nicio.h
@@ -8,6 +8,11 @@ 
 #define RX_BUF_LEN_16K			16384
 #define RX_BUF_LEN_1_5K			1536
 
+/* vhd type */
+#define HINIC_VHD_TYPE_0B		2
+#define HINIC_VHD_TYPE_10B		1
+#define HINIC_VHD_TYPE_12B		0
+
 #define HINIC_Q_CTXT_MAX		42
 
 /* performance: ci addr RTE_CACHE_SIZE(64B) alignment */