* [dpdk-dev] [PATCH 0/3] fix flow director mask issues
@ 2016-10-10 7:46 Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
` (4 more replies)
0 siblings, 5 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-10 7:46 UTC (permalink / raw)
To: dev
There're 2 issues about flow director mask.
1, MAC address mask is not supported in mac-vlan mode.
2, All the parameter are defined as big endian, but
they're not treated approriately.
This patch set is used to fix these 2 issues.
Wenzhuo Lu (3):
ixgbe: fix wrong flow director mask
app/testpmd: fix flow director endian issue
app/testpmd: fix wrong flow director mask
app/test-pmd/cmdline.c | 11 +++-----
app/test-pmd/config.c | 43 +++++++++++++++++------------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +-
drivers/net/ixgbe/ixgbe_fdir.c | 10 +++----
4 files changed, 35 insertions(+), 32 deletions(-)
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 1/3] ixgbe: fix wrong flow director mask
2016-10-10 7:46 [dpdk-dev] [PATCH 0/3] fix flow director mask issues Wenzhuo Lu
@ 2016-10-10 7:46 ` Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 2/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
` (3 subsequent siblings)
4 siblings, 0 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-10 7:46 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Instead, only set it in tunnel mode.
Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ixgbe/ixgbe_fdir.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 861c7cb..4b81ee3 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -432,12 +432,12 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev,
fdiripv6m |= IXGBE_FDIRIP6M_TUNNEL_TYPE |
IXGBE_FDIRIP6M_TNI_VNI;
- mac_mask = input_mask->mac_addr_byte_mask;
- fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT)
- & IXGBE_FDIRIP6M_INNER_MAC;
- info->mask.mac_addr_byte_mask = input_mask->mac_addr_byte_mask;
-
if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
+ mac_mask = input_mask->mac_addr_byte_mask;
+ fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT)
+ & IXGBE_FDIRIP6M_INNER_MAC;
+ info->mask.mac_addr_byte_mask = input_mask->mac_addr_byte_mask;
+
switch (input_mask->tunnel_type_mask) {
case 0:
/* Mask turnnel type */
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 2/3] app/testpmd: fix flow director endian issue
2016-10-10 7:46 [dpdk-dev] [PATCH 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
@ 2016-10-10 7:46 ` Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 3/3] app/testpmd: fix wrong flow director mask Wenzhuo Lu
` (2 subsequent siblings)
4 siblings, 0 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-10 7:46 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
The vlan mask and tunnel id mask of flow director
are defined as big endian. So they should be
converted.
When the mask is printed, the parameters are not
converted either.
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
app/test-pmd/cmdline.c | 6 +++---
app/test-pmd/config.c | 43 +++++++++++++++++++++++++------------------
2 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 6e95ca2..39e6d59 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9074,7 +9074,7 @@ cmd_flow_director_mask_parsed(void *parsed_result,
return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(res->mode_value, "Tunnel")) {
@@ -9082,9 +9082,9 @@ cmd_flow_director_mask_parsed(void *parsed_result,
return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
- mask->tunnel_id_mask = res->tunnel_id_mask;
+ mask->tunnel_id_mask = rte_cpu_to_be_32(res->tunnel_id_mask);
mask->tunnel_type_mask = res->tunnel_type_mask;
} else {
if (strcmp(res->mode_value, "IP")) {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 83bebfe..742a8d8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2045,26 +2045,33 @@ set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
static inline void
print_fdir_mask(struct rte_eth_fdir_masks *mask)
{
- printf("\n vlan_tci: 0x%04x, ", mask->vlan_tci_mask);
+ printf("\n vlan_tci: 0x%04x", rte_be_to_cpu_16(mask->vlan_tci_mask));
- if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
- printf("mac_addr: 0x%02x", mask->mac_addr_byte_mask);
- else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
- printf("mac_addr: 0x%02x, tunnel_type: 0x%01x, tunnel_id: 0x%08x",
+ if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
+ printf(", mac_addr: 0x%02x, tunnel_type: 0x%01x,"
+ " tunnel_id: 0x%08x",
mask->mac_addr_byte_mask, mask->tunnel_type_mask,
- mask->tunnel_id_mask);
- else {
- printf("src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
- " src_port: 0x%04x, dst_port: 0x%04x",
- mask->ipv4_mask.src_ip, mask->ipv4_mask.dst_ip,
- mask->src_port_mask, mask->dst_port_mask);
-
- printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x,"
- " dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
- mask->ipv6_mask.src_ip[0], mask->ipv6_mask.src_ip[1],
- mask->ipv6_mask.src_ip[2], mask->ipv6_mask.src_ip[3],
- mask->ipv6_mask.dst_ip[0], mask->ipv6_mask.dst_ip[1],
- mask->ipv6_mask.dst_ip[2], mask->ipv6_mask.dst_ip[3]);
+ rte_be_to_cpu_32(mask->tunnel_id_mask));
+ else if (fdir_conf.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+ printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x",
+ rte_be_to_cpu_32(mask->ipv4_mask.src_ip),
+ rte_be_to_cpu_32(mask->ipv4_mask.dst_ip));
+
+ printf("\n src_port: 0x%04x, dst_port: 0x%04x",
+ rte_be_to_cpu_16(mask->src_port_mask),
+ rte_be_to_cpu_16(mask->dst_port_mask));
+
+ printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[3]));
+
+ printf("\n dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[3]));
}
printf("\n");
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 3/3] app/testpmd: fix wrong flow director mask
2016-10-10 7:46 [dpdk-dev] [PATCH 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 2/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
@ 2016-10-10 7:46 ` Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Wenzhuo Lu
4 siblings, 0 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-10 7:46 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Remove this parameter from the CLI.
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
app/test-pmd/cmdline.c | 5 +----
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +--
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 39e6d59..7c5c5e7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -720,7 +720,7 @@ static void cmd_help_long_parsed(void *parsed_result,
" Set flow director IP mask.\n\n"
"flow_director_mask (port_id) mode MAC-VLAN"
- " vlan (vlan_value) mac (mac_value)\n"
+ " vlan (vlan_value)\n"
" Set flow director MAC-VLAN mask.\n\n"
"flow_director_mask (port_id) mode Tunnel"
@@ -9075,7 +9075,6 @@ cmd_flow_director_mask_parsed(void *parsed_result,
}
mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
- mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(res->mode_value, "Tunnel")) {
printf("Please set mode to Tunnel.\n");
@@ -9206,8 +9205,6 @@ cmdline_parse_inst_t cmd_set_flow_director_mac_vlan_mask = {
(void *)&cmd_flow_director_mask_mode_mac_vlan,
(void *)&cmd_flow_director_mask_vlan,
(void *)&cmd_flow_director_mask_vlan_value,
- (void *)&cmd_flow_director_mask_mac,
- (void *)&cmd_flow_director_mask_mac_value,
NULL,
},
};
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f87e0c2..ed04532 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1844,8 +1844,7 @@ Set flow director's input masks::
src_mask (ipv4_src) (ipv6_src) (src_port) \
dst_mask (ipv4_dst) (ipv6_dst) (dst_port)
- flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value) \
- mac (mac_value)
+ flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value)
flow_director_mask (port_id) mode Tunnel vlan (vlan_value) \
mac (mac_value) tunnel-type (tunnel_type_value) \
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 0/3] fix flow director mask issues
2016-10-10 7:46 [dpdk-dev] [PATCH 0/3] fix flow director mask issues Wenzhuo Lu
` (2 preceding siblings ...)
2016-10-10 7:46 ` [dpdk-dev] [PATCH 3/3] app/testpmd: fix wrong flow director mask Wenzhuo Lu
@ 2016-10-12 6:24 ` Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
` (2 more replies)
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Wenzhuo Lu
4 siblings, 3 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-12 6:24 UTC (permalink / raw)
To: dev
There're 2 issues about flow director mask.
1, MAC address mask is not supported in mac-vlan mode.
2, All the parameter are defined as big endian, but
they're not treated approriately.
This patch set is used to fix these 2 issues.
v2:
- Re-split the patches and reword commit log. No code change.
Wenzhuo Lu (3):
ixgbe: fix wrong flow director mask
app/testpmd: fix wrong flow director mask
app/testpmd: fix flow director endian issue
app/test-pmd/cmdline.c | 11 +++-----
app/test-pmd/config.c | 43 +++++++++++++++++------------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +-
drivers/net/ixgbe/ixgbe_fdir.c | 10 +++----
4 files changed, 35 insertions(+), 32 deletions(-)
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 1/3] ixgbe: fix wrong flow director mask
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 0/3] fix flow director mask issues Wenzhuo Lu
@ 2016-10-12 6:24 ` Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: " Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
2 siblings, 0 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-12 6:24 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Instead, only set it in tunnel mode.
Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ixgbe/ixgbe_fdir.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 861c7cb..4b81ee3 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -432,12 +432,12 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev,
fdiripv6m |= IXGBE_FDIRIP6M_TUNNEL_TYPE |
IXGBE_FDIRIP6M_TNI_VNI;
- mac_mask = input_mask->mac_addr_byte_mask;
- fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT)
- & IXGBE_FDIRIP6M_INNER_MAC;
- info->mask.mac_addr_byte_mask = input_mask->mac_addr_byte_mask;
-
if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
+ mac_mask = input_mask->mac_addr_byte_mask;
+ fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT)
+ & IXGBE_FDIRIP6M_INNER_MAC;
+ info->mask.mac_addr_byte_mask = input_mask->mac_addr_byte_mask;
+
switch (input_mask->tunnel_type_mask) {
case 0:
/* Mask turnnel type */
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix wrong flow director mask
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
@ 2016-10-12 6:24 ` Wenzhuo Lu
2016-10-13 11:00 ` Ferruh Yigit
2016-10-17 20:18 ` De Lara Guarch, Pablo
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
2 siblings, 2 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-12 6:24 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Remove this parameter from the CLI. Remove MAC address
from mask print too.
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
app/test-pmd/cmdline.c | 5 +----
app/test-pmd/config.c | 13 ++++++-------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +--
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 6e95ca2..259090a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -720,7 +720,7 @@ static void cmd_help_long_parsed(void *parsed_result,
" Set flow director IP mask.\n\n"
"flow_director_mask (port_id) mode MAC-VLAN"
- " vlan (vlan_value) mac (mac_value)\n"
+ " vlan (vlan_value)\n"
" Set flow director MAC-VLAN mask.\n\n"
"flow_director_mask (port_id) mode Tunnel"
@@ -9075,7 +9075,6 @@ cmd_flow_director_mask_parsed(void *parsed_result,
}
mask->vlan_tci_mask = res->vlan_mask;
- mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(res->mode_value, "Tunnel")) {
printf("Please set mode to Tunnel.\n");
@@ -9206,8 +9205,6 @@ cmdline_parse_inst_t cmd_set_flow_director_mac_vlan_mask = {
(void *)&cmd_flow_director_mask_mode_mac_vlan,
(void *)&cmd_flow_director_mask_vlan,
(void *)&cmd_flow_director_mask_vlan_value,
- (void *)&cmd_flow_director_mask_mac,
- (void *)&cmd_flow_director_mask_mac_value,
NULL,
},
};
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 83bebfe..238c4fd 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2045,16 +2045,15 @@ set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
static inline void
print_fdir_mask(struct rte_eth_fdir_masks *mask)
{
- printf("\n vlan_tci: 0x%04x, ", mask->vlan_tci_mask);
+ printf("\n vlan_tci: 0x%04x", mask->vlan_tci_mask);
- if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
- printf("mac_addr: 0x%02x", mask->mac_addr_byte_mask);
- else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
- printf("mac_addr: 0x%02x, tunnel_type: 0x%01x, tunnel_id: 0x%08x",
+ if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
+ printf(", mac_addr: 0x%02x, tunnel_type: 0x%01x,"
+ " tunnel_id: 0x%08x",
mask->mac_addr_byte_mask, mask->tunnel_type_mask,
mask->tunnel_id_mask);
- else {
- printf("src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
+ else if (fdir_conf.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+ printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
" src_port: 0x%04x, dst_port: 0x%04x",
mask->ipv4_mask.src_ip, mask->ipv4_mask.dst_ip,
mask->src_port_mask, mask->dst_port_mask);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f87e0c2..ed04532 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1844,8 +1844,7 @@ Set flow director's input masks::
src_mask (ipv4_src) (ipv6_src) (src_port) \
dst_mask (ipv4_dst) (ipv6_dst) (dst_port)
- flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value) \
- mac (mac_value)
+ flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value)
flow_director_mask (port_id) mode Tunnel vlan (vlan_value) \
mac (mac_value) tunnel-type (tunnel_type_value) \
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian issue
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: " Wenzhuo Lu
@ 2016-10-12 6:24 ` Wenzhuo Lu
2016-10-17 20:18 ` De Lara Guarch, Pablo
2 siblings, 1 reply; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-12 6:24 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
The vlan mask and tunnel id mask of flow director
are defined as big endian. So they should be
converted.
When the mask is printed, the parameters are not
converted either. This patch converts the mask
parameters.
Some lines of the mask print are too long, split
them to more lines.
Fixes: 7c554b4f0484 ("app/testpmd: update display of flow director information")
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
app/test-pmd/cmdline.c | 6 +++---
app/test-pmd/config.c | 34 +++++++++++++++++++++-------------
2 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 259090a..7c5c5e7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9074,16 +9074,16 @@ cmd_flow_director_mask_parsed(void *parsed_result,
return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(res->mode_value, "Tunnel")) {
printf("Please set mode to Tunnel.\n");
return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
- mask->tunnel_id_mask = res->tunnel_id_mask;
+ mask->tunnel_id_mask = rte_cpu_to_be_32(res->tunnel_id_mask);
mask->tunnel_type_mask = res->tunnel_type_mask;
} else {
if (strcmp(res->mode_value, "IP")) {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 238c4fd..742a8d8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2045,25 +2045,33 @@ set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
static inline void
print_fdir_mask(struct rte_eth_fdir_masks *mask)
{
- printf("\n vlan_tci: 0x%04x", mask->vlan_tci_mask);
+ printf("\n vlan_tci: 0x%04x", rte_be_to_cpu_16(mask->vlan_tci_mask));
if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
printf(", mac_addr: 0x%02x, tunnel_type: 0x%01x,"
" tunnel_id: 0x%08x",
mask->mac_addr_byte_mask, mask->tunnel_type_mask,
- mask->tunnel_id_mask);
+ rte_be_to_cpu_32(mask->tunnel_id_mask));
else if (fdir_conf.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
- printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
- " src_port: 0x%04x, dst_port: 0x%04x",
- mask->ipv4_mask.src_ip, mask->ipv4_mask.dst_ip,
- mask->src_port_mask, mask->dst_port_mask);
-
- printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x,"
- " dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
- mask->ipv6_mask.src_ip[0], mask->ipv6_mask.src_ip[1],
- mask->ipv6_mask.src_ip[2], mask->ipv6_mask.src_ip[3],
- mask->ipv6_mask.dst_ip[0], mask->ipv6_mask.dst_ip[1],
- mask->ipv6_mask.dst_ip[2], mask->ipv6_mask.dst_ip[3]);
+ printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x",
+ rte_be_to_cpu_32(mask->ipv4_mask.src_ip),
+ rte_be_to_cpu_32(mask->ipv4_mask.dst_ip));
+
+ printf("\n src_port: 0x%04x, dst_port: 0x%04x",
+ rte_be_to_cpu_16(mask->src_port_mask),
+ rte_be_to_cpu_16(mask->dst_port_mask));
+
+ printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[3]));
+
+ printf("\n dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[3]));
}
printf("\n");
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix wrong flow director mask
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: " Wenzhuo Lu
@ 2016-10-13 11:00 ` Ferruh Yigit
2016-10-17 20:18 ` De Lara Guarch, Pablo
1 sibling, 0 replies; 17+ messages in thread
From: Ferruh Yigit @ 2016-10-13 11:00 UTC (permalink / raw)
To: Wenzhuo Lu, dev; +Cc: Pablo de Lara
Hi Wenzhuo,
On 10/12/2016 7:24 AM, Wenzhuo Lu wrote:
> In mac-vlan mode, MAC address mask is not supported by HW.
> The MAC address mask should not be set in mac-vlan mode.
> Remove this parameter from the CLI. Remove MAC address
> from mask print too.
>
> Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
I think it is good to require an ack from testpmd maintainer for this
patch. cc'ed Pablo.
Thanks,
ferruh
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix wrong flow director mask
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: " Wenzhuo Lu
2016-10-13 11:00 ` Ferruh Yigit
@ 2016-10-17 20:18 ` De Lara Guarch, Pablo
1 sibling, 0 replies; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2016-10-17 20:18 UTC (permalink / raw)
To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Tuesday, October 11, 2016 11:24 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo
> Subject: [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix wrong flow director mask
>
> In mac-vlan mode, MAC address mask is not supported by HW.
> The MAC address mask should not be set in mac-vlan mode.
> Remove this parameter from the CLI. Remove MAC address
> from mask print too.
>
> Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Commit message should have a space between the Fixes and the Signed-off line.
Apart from that:
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian issue
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
@ 2016-10-17 20:18 ` De Lara Guarch, Pablo
2016-10-19 0:46 ` Lu, Wenzhuo
0 siblings, 1 reply; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2016-10-17 20:18 UTC (permalink / raw)
To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Tuesday, October 11, 2016 11:24 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo
> Subject: [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian
> issue
>
> The vlan mask and tunnel id mask of flow director
> are defined as big endian. So they should be
> converted.
> When the mask is printed, the parameters are not
> converted either. This patch converts the mask
> parameters.
> Some lines of the mask print are too long, split
> them to more lines.
>
> Fixes: 7c554b4f0484 ("app/testpmd: update display of flow director
> information")
> Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Commit message should have a space between the Fixes and the Signed-off line.
Apart from that:
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian issue
2016-10-17 20:18 ` De Lara Guarch, Pablo
@ 2016-10-19 0:46 ` Lu, Wenzhuo
0 siblings, 0 replies; 17+ messages in thread
From: Lu, Wenzhuo @ 2016-10-19 0:46 UTC (permalink / raw)
To: De Lara Guarch, Pablo, dev
Hi Pablo,
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Tuesday, October 18, 2016 4:19 AM
> To: Lu, Wenzhuo; dev@dpdk.org
> Cc: Lu, Wenzhuo
> Subject: RE: [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian
> issue
>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> > Sent: Tuesday, October 11, 2016 11:24 PM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo
> > Subject: [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director
> > endian issue
> >
> > The vlan mask and tunnel id mask of flow director are defined as big
> > endian. So they should be converted.
> > When the mask is printed, the parameters are not converted either.
> > This patch converts the mask parameters.
> > Some lines of the mask print are too long, split them to more lines.
> >
> > Fixes: 7c554b4f0484 ("app/testpmd: update display of flow director
> > information")
> > Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
>
> Commit message should have a space between the Fixes and the Signed-off line.
> Apart from that:
>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Thanks for reviewing. I'll correct the commit log for all these patches.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues
2016-10-10 7:46 [dpdk-dev] [PATCH 0/3] fix flow director mask issues Wenzhuo Lu
` (3 preceding siblings ...)
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 0/3] fix flow director mask issues Wenzhuo Lu
@ 2016-10-19 1:22 ` Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
` (3 more replies)
4 siblings, 4 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-19 1:22 UTC (permalink / raw)
To: dev
There're 2 issues about flow director mask.
1, MAC address mask is not supported in mac-vlan mode.
2, All the parameter are defined as big endian, but
they're not treated approriately.
This patch set is used to fix these 2 issues.
v2:
- Re-split the patches and reword commit log. No code change.
v3:
- Reword the commit log.
Wenzhuo Lu (3):
ixgbe: fix wrong flow director mask
app/testpmd: fix wrong flow director mask
app/testpmd: fix flow director endian issue
app/test-pmd/cmdline.c | 11 +++-----
app/test-pmd/config.c | 43 +++++++++++++++++------------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +-
drivers/net/ixgbe/ixgbe_fdir.c | 10 +++----
4 files changed, 35 insertions(+), 32 deletions(-)
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v3 1/3] ixgbe: fix wrong flow director mask
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Wenzhuo Lu
@ 2016-10-19 1:22 ` Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: " Wenzhuo Lu
` (2 subsequent siblings)
3 siblings, 0 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-19 1:22 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Instead, only set it in tunnel mode.
Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ixgbe/ixgbe_fdir.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 861c7cb..4b81ee3 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -432,12 +432,12 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev,
fdiripv6m |= IXGBE_FDIRIP6M_TUNNEL_TYPE |
IXGBE_FDIRIP6M_TNI_VNI;
- mac_mask = input_mask->mac_addr_byte_mask;
- fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT)
- & IXGBE_FDIRIP6M_INNER_MAC;
- info->mask.mac_addr_byte_mask = input_mask->mac_addr_byte_mask;
-
if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
+ mac_mask = input_mask->mac_addr_byte_mask;
+ fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT)
+ & IXGBE_FDIRIP6M_INNER_MAC;
+ info->mask.mac_addr_byte_mask = input_mask->mac_addr_byte_mask;
+
switch (input_mask->tunnel_type_mask) {
case 0:
/* Mask turnnel type */
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v3 2/3] app/testpmd: fix wrong flow director mask
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
@ 2016-10-19 1:22 ` Wenzhuo Lu
2016-10-19 1:23 ` [dpdk-dev] [PATCH v3 3/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
2016-10-19 9:35 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Bruce Richardson
3 siblings, 0 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-19 1:22 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Remove this parameter from the CLI. Remove MAC address
from mask print too.
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test-pmd/cmdline.c | 5 +----
app/test-pmd/config.c | 13 ++++++-------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +--
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 6e95ca2..259090a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -720,7 +720,7 @@ static void cmd_help_long_parsed(void *parsed_result,
" Set flow director IP mask.\n\n"
"flow_director_mask (port_id) mode MAC-VLAN"
- " vlan (vlan_value) mac (mac_value)\n"
+ " vlan (vlan_value)\n"
" Set flow director MAC-VLAN mask.\n\n"
"flow_director_mask (port_id) mode Tunnel"
@@ -9075,7 +9075,6 @@ cmd_flow_director_mask_parsed(void *parsed_result,
}
mask->vlan_tci_mask = res->vlan_mask;
- mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(res->mode_value, "Tunnel")) {
printf("Please set mode to Tunnel.\n");
@@ -9206,8 +9205,6 @@ cmdline_parse_inst_t cmd_set_flow_director_mac_vlan_mask = {
(void *)&cmd_flow_director_mask_mode_mac_vlan,
(void *)&cmd_flow_director_mask_vlan,
(void *)&cmd_flow_director_mask_vlan_value,
- (void *)&cmd_flow_director_mask_mac,
- (void *)&cmd_flow_director_mask_mac_value,
NULL,
},
};
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 83bebfe..238c4fd 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2045,16 +2045,15 @@ set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
static inline void
print_fdir_mask(struct rte_eth_fdir_masks *mask)
{
- printf("\n vlan_tci: 0x%04x, ", mask->vlan_tci_mask);
+ printf("\n vlan_tci: 0x%04x", mask->vlan_tci_mask);
- if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
- printf("mac_addr: 0x%02x", mask->mac_addr_byte_mask);
- else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
- printf("mac_addr: 0x%02x, tunnel_type: 0x%01x, tunnel_id: 0x%08x",
+ if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
+ printf(", mac_addr: 0x%02x, tunnel_type: 0x%01x,"
+ " tunnel_id: 0x%08x",
mask->mac_addr_byte_mask, mask->tunnel_type_mask,
mask->tunnel_id_mask);
- else {
- printf("src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
+ else if (fdir_conf.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+ printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
" src_port: 0x%04x, dst_port: 0x%04x",
mask->ipv4_mask.src_ip, mask->ipv4_mask.dst_ip,
mask->src_port_mask, mask->dst_port_mask);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f87e0c2..ed04532 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1844,8 +1844,7 @@ Set flow director's input masks::
src_mask (ipv4_src) (ipv6_src) (src_port) \
dst_mask (ipv4_dst) (ipv6_dst) (dst_port)
- flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value) \
- mac (mac_value)
+ flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value)
flow_director_mask (port_id) mode Tunnel vlan (vlan_value) \
mac (mac_value) tunnel-type (tunnel_type_value) \
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v3 3/3] app/testpmd: fix flow director endian issue
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: " Wenzhuo Lu
@ 2016-10-19 1:23 ` Wenzhuo Lu
2016-10-19 9:35 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Bruce Richardson
3 siblings, 0 replies; 17+ messages in thread
From: Wenzhuo Lu @ 2016-10-19 1:23 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu
The vlan mask and tunnel id mask of flow director
are defined as big endian. So they should be
converted.
When the mask is printed, the parameters are not
converted either. This patch converts the mask
parameters.
Some lines of the mask print are too long, split
them to more lines.
Fixes: 7c554b4f0484 ("app/testpmd: update display of flow director information")
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test-pmd/cmdline.c | 6 +++---
app/test-pmd/config.c | 34 +++++++++++++++++++++-------------
2 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 259090a..7c5c5e7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9074,16 +9074,16 @@ cmd_flow_director_mask_parsed(void *parsed_result,
return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(res->mode_value, "Tunnel")) {
printf("Please set mode to Tunnel.\n");
return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
- mask->tunnel_id_mask = res->tunnel_id_mask;
+ mask->tunnel_id_mask = rte_cpu_to_be_32(res->tunnel_id_mask);
mask->tunnel_type_mask = res->tunnel_type_mask;
} else {
if (strcmp(res->mode_value, "IP")) {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 238c4fd..742a8d8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2045,25 +2045,33 @@ set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
static inline void
print_fdir_mask(struct rte_eth_fdir_masks *mask)
{
- printf("\n vlan_tci: 0x%04x", mask->vlan_tci_mask);
+ printf("\n vlan_tci: 0x%04x", rte_be_to_cpu_16(mask->vlan_tci_mask));
if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
printf(", mac_addr: 0x%02x, tunnel_type: 0x%01x,"
" tunnel_id: 0x%08x",
mask->mac_addr_byte_mask, mask->tunnel_type_mask,
- mask->tunnel_id_mask);
+ rte_be_to_cpu_32(mask->tunnel_id_mask));
else if (fdir_conf.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
- printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
- " src_port: 0x%04x, dst_port: 0x%04x",
- mask->ipv4_mask.src_ip, mask->ipv4_mask.dst_ip,
- mask->src_port_mask, mask->dst_port_mask);
-
- printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x,"
- " dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
- mask->ipv6_mask.src_ip[0], mask->ipv6_mask.src_ip[1],
- mask->ipv6_mask.src_ip[2], mask->ipv6_mask.src_ip[3],
- mask->ipv6_mask.dst_ip[0], mask->ipv6_mask.dst_ip[1],
- mask->ipv6_mask.dst_ip[2], mask->ipv6_mask.dst_ip[3]);
+ printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x",
+ rte_be_to_cpu_32(mask->ipv4_mask.src_ip),
+ rte_be_to_cpu_32(mask->ipv4_mask.dst_ip));
+
+ printf("\n src_port: 0x%04x, dst_port: 0x%04x",
+ rte_be_to_cpu_16(mask->src_port_mask),
+ rte_be_to_cpu_16(mask->dst_port_mask));
+
+ printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[3]));
+
+ printf("\n dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[3]));
}
printf("\n");
--
1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Wenzhuo Lu
` (2 preceding siblings ...)
2016-10-19 1:23 ` [dpdk-dev] [PATCH v3 3/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
@ 2016-10-19 9:35 ` Bruce Richardson
3 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2016-10-19 9:35 UTC (permalink / raw)
To: Wenzhuo Lu; +Cc: dev
On Wed, Oct 19, 2016 at 09:22:57AM +0800, Wenzhuo Lu wrote:
> There're 2 issues about flow director mask.
> 1, MAC address mask is not supported in mac-vlan mode.
> 2, All the parameter are defined as big endian, but
> they're not treated approriately.
> This patch set is used to fix these 2 issues.
>
> v2:
> - Re-split the patches and reword commit log. No code change.
>
> v3:
> - Reword the commit log.
>
> Wenzhuo Lu (3):
> ixgbe: fix wrong flow director mask
> app/testpmd: fix wrong flow director mask
> app/testpmd: fix flow director endian issue
>
Patchset applied to dpdk-next-net/rel_16_11
/Bruce
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2016-10-19 9:35 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-10 7:46 [dpdk-dev] [PATCH 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 2/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
2016-10-10 7:46 ` [dpdk-dev] [PATCH 3/3] app/testpmd: fix wrong flow director mask Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: " Wenzhuo Lu
2016-10-13 11:00 ` Ferruh Yigit
2016-10-17 20:18 ` De Lara Guarch, Pablo
2016-10-12 6:24 ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
2016-10-17 20:18 ` De Lara Guarch, Pablo
2016-10-19 0:46 ` Lu, Wenzhuo
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 1/3] ixgbe: fix wrong flow director mask Wenzhuo Lu
2016-10-19 1:22 ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: " Wenzhuo Lu
2016-10-19 1:23 ` [dpdk-dev] [PATCH v3 3/3] app/testpmd: fix flow director endian issue Wenzhuo Lu
2016-10-19 9:35 ` [dpdk-dev] [PATCH v3 0/3] fix flow director mask issues Bruce Richardson
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).