* [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e @ 2016-01-25 7:25 Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun ` (4 more replies) 0 siblings, 5 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-25 7:25 UTC (permalink / raw) To: dev This patch set adds tunnel filter support for IP in GRE on i40e. Jijiang Liu (4): change the 'rte_eth_tunnel_filter_conf' structure add IP in GRE type in the enum 'rte_eth_tunnel_type' implement cloud filter for IP in GRE on i40e add codes to test tunnel filter for IP in GRE app/test-pmd/cmdline.c | 23 ++++++++++++++++------- drivers/net/i40e/i40e_ethdev.c | 21 +++++++++++++++------ lib/librte_ether/rte_eth_ctrl.h | 5 +++-- 3 files changed, 34 insertions(+), 15 deletions(-) -- 1.7.7.6 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure 2016-01-25 7:25 [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun @ 2016-01-25 7:25 ` Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 2/4] lib/ether: add IP in GRE type Xutao Sun ` (3 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-25 7:25 UTC (permalink / raw) To: dev Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 ++++-- drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 73298c9..71ccbab 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6638,8 +6638,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + (void)rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index bf6220d..1dd1077 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 1.7.7.6 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH 2/4] lib/ether: add IP in GRE type 2016-01-25 7:25 [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-01-25 7:25 ` Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun ` (2 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-25 7:25 UTC (permalink / raw) To: dev Signed-off-by: Xutao, Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 30cbde7..0e948a1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 1.7.7.6 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-01-25 7:25 [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 2/4] lib/ether: add IP in GRE type Xutao Sun @ 2016-01-25 7:25 ` Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 4/4] app/test-pmd: test " Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-25 7:25 UTC (permalink / raw) To: dev Signed-off-by: Xutao, Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 1dd1077..25975d2 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5797,6 +5797,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5854,6 +5860,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); -- 1.7.7.6 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-01-25 7:25 [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (2 preceding siblings ...) 2016-01-25 7:25 ` [dpdk-dev] [PATCH 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-01-25 7:25 ` Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-25 7:25 UTC (permalink / raw) To: dev This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Signed-off-by: Xutao, Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 792da7d..f871095 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -299,12 +299,14 @@ static void cmd_help_long_parsed(void *parsed_result, " Set the outer VLAN TPID for Packet Filtering on" " a port\n\n" - "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter add (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|iningre) (filter_type)" + "(tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" - "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter rm (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|ipingre) (filter_type)" + "(tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6638,6 +6640,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + (void)rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); (void)rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6666,6 +6670,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6675,6 +6683,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6720,11 +6730,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6738,8 +6748,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { -- 1.7.7.6 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e 2016-01-25 7:25 [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (3 preceding siblings ...) 2016-01-25 7:25 ` [dpdk-dev] [PATCH 4/4] app/test-pmd: test " Xutao Sun @ 2016-01-28 7:30 ` Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun ` (4 more replies) 4 siblings, 5 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-28 7:30 UTC (permalink / raw) To: dev This patch set adds tunnel filter support for IP in GRE on i40e. v2 changes: Fix the byte order problem. Xutao Sun (4): change the 'rte_eth_tunnel_filter_conf' structure add IP in GRE type in the enum 'rte_eth_tunnel_type' implement cloud filter for ip in GRE on i40e test tunnel filter for IP in GRE app/test-pmd/cmdline.c | 42 ++++++++++++++++++++++++++------------- drivers/net/i40e/i40e_ethdev.c | 44 ++++++++++++++++++++++++++++------------- lib/librte_ether/rte_eth_ctrl.h | 5 +++-- 3 files changed, 61 insertions(+), 30 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun @ 2016-01-28 7:30 ` Xutao Sun 2016-01-28 8:21 ` Thomas Monjalon 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 2/4] lib/ether: add IP in GRE type Xutao Sun ` (3 subsequent siblings) 4 siblings, 1 reply; 56+ messages in thread From: Xutao Sun @ 2016-01-28 7:30 UTC (permalink / raw) To: dev Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 ++++-- drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 6d28c1b..6084449 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6640,8 +6640,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + (void)rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index bf6220d..1dd1077 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-01-28 8:21 ` Thomas Monjalon 2016-01-28 9:05 ` Sun, Xutao 0 siblings, 1 reply; 56+ messages in thread From: Thomas Monjalon @ 2016-01-28 8:21 UTC (permalink / raw) To: Xutao Sun; +Cc: dev 2016-01-28 15:30, Xutao Sun: > Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. [...] > - tunnel_filter_conf.outer_mac = &res->outer_mac; > - tunnel_filter_conf.inner_mac = &res->inner_mac; > + (void)rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, > + ETHER_ADDR_LEN); > + (void)rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, > + ETHER_ADDR_LEN); The (void) casting is useless here. > --- a/lib/librte_ether/rte_eth_ctrl.h > +++ b/lib/librte_ether/rte_eth_ctrl.h > @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { > * Tunneling Packet filter configuration. > */ > struct rte_eth_tunnel_filter_conf { > - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ > - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ > + struct ether_addr outer_mac; /**< Outer MAC address filter. */ > + struct ether_addr inner_mac; /**< Inner MAC address filter. */ It is an API change. Please remove the deprecation notice and update the release notes in this patch (atomically). ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure 2016-01-28 8:21 ` Thomas Monjalon @ 2016-01-28 9:05 ` Sun, Xutao 0 siblings, 0 replies; 56+ messages in thread From: Sun, Xutao @ 2016-01-28 9:05 UTC (permalink / raw) To: Thomas Monjalon; +Cc: dev Hi, Thomas > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Thursday, January 28, 2016 4:22 PM > To: Sun, Xutao <xutao.sun@intel.com> > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the > 'rte_eth_tunnel_filter_conf' structure > > 2016-01-28 15:30, Xutao Sun: > > Change the fields of outer_mac and inner_mac from pointer to struct in > order to keep the code's readability. > > [...] > > - tunnel_filter_conf.outer_mac = &res->outer_mac; > > - tunnel_filter_conf.inner_mac = &res->inner_mac; > > + (void)rte_memcpy(&tunnel_filter_conf.outer_mac, &res- > >outer_mac, > > + ETHER_ADDR_LEN); > > + (void)rte_memcpy(&tunnel_filter_conf.inner_mac, &res- > >inner_mac, > > + ETHER_ADDR_LEN); > > The (void) casting is useless here. > > > --- a/lib/librte_ether/rte_eth_ctrl.h > > +++ b/lib/librte_ether/rte_eth_ctrl.h > > @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { > > * Tunneling Packet filter configuration. > > */ > > struct rte_eth_tunnel_filter_conf { > > - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ > > - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ > > + struct ether_addr outer_mac; /**< Outer MAC address filter. */ > > + struct ether_addr inner_mac; /**< Inner MAC address filter. */ > > It is an API change. > Please remove the deprecation notice and update the release notes in this > patch (atomically). I will remove the deprecation notice and update the release notes. Is it an ABI change instead of an API change? Thanks, Xutao ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v2 2/4] lib/ether: add IP in GRE type 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-01-28 7:30 ` Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun ` (2 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-28 7:30 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 30cbde7..0e948a1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v2 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 2/4] lib/ether: add IP in GRE type Xutao Sun @ 2016-01-28 7:30 ` Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 4/4] app/test-pmd: test " Xutao Sun [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-28 7:30 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 1dd1077..5c0eff9 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5797,6 +5797,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5811,7 +5817,7 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, uint8_t add) { uint16_t ip_type; - uint8_t tun_type = 0; + uint8_t i, tun_type = 0; int val, ret = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi = pf->main_vsi; @@ -5833,16 +5839,22 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, ETHER_ADDR_LEN); - pfilter->inner_vlan = tunnel_filter->inner_vlan; + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; + tunnel_filter->ip_addr.ipv4_addr = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr); (void)rte_memcpy(&pfilter->ipaddr.v4.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv4_addr, sizeof(pfilter->ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; + for (i = 0; i < 4; i++) { + tunnel_filter->ip_addr.ipv6_addr[i] = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]); + } (void)rte_memcpy(&pfilter->ipaddr.v6.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv6_addr, sizeof(pfilter->ipaddr.v6.data)); } @@ -5854,6 +5866,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); @@ -5868,10 +5883,11 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, return -EINVAL; } - pfilter->flags |= I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | ip_type | - (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT); - pfilter->tenant_id = tunnel_filter->tenant_id; - pfilter->queue_number = tunnel_filter->queue_id; + pfilter->flags |= rte_cpu_to_le_16( + I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE + | ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); + pfilter->tenant_id = rte_cpu_to_le_32(tunnel_filter->tenant_id); + pfilter->queue_number = rte_cpu_to_le_16(tunnel_filter->queue_id); if (add) ret = i40e_aq_add_cloud_filters(hw, vsi->seid, cld_filter, 1); -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v2 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (2 preceding siblings ...) 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-01-28 7:30 ` Xutao Sun [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-28 7:30 UTC (permalink / raw) To: dev This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 6084449..ad09a4a 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -301,12 +301,14 @@ static void cmd_help_long_parsed(void *parsed_result, " Set the outer VLAN TPID for Packet Filtering on" " a port\n\n" - "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter add (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|iningre) (filter_type)" + "(tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" - "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter rm (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|ipingre) (filter_type)" + "(tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6640,6 +6642,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + (void)rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); (void)rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6648,12 +6652,14 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (res->ip_value.family == AF_INET) { tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; + rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4; } else { - memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), - sizeof(struct in6_addr)); + int i; + for (i = 0; i < 4; i++) { + tunnel_filter_conf.ip_addr.ipv6_addr[i] = + rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); + } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } @@ -6669,6 +6675,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6678,6 +6688,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6723,11 +6735,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6741,8 +6753,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
[parent not found: <1453976778-27807-1-git-send-email-xutao.sun@intel.com>]
* [dpdk-dev] [PATCH v3 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> @ 2016-01-28 10:26 ` Xutao Sun 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 2/4] lib/ether: add IP in GRE type Xutao Sun ` (3 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-28 10:26 UTC (permalink / raw) To: dev Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 ++++-- doc/guides/rel_notes/deprecation.rst | 5 ----- doc/guides/rel_notes/release_2_3.rst | 2 ++ drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 6d28c1b..67df259 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6640,8 +6640,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index e94d4a2..a895364 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -32,11 +32,6 @@ Deprecation Notices RTE_ETH_FLOW_MAX. The release 2.2 does not contain these ABI changes, but release 2.3 will. -* ABI changes are planned for rte_eth_tunnel_filter_conf. Change the fields - of outer_mac and inner_mac from pointer to struct in order to keep the - code's readability. The release 2.2 does not contain these ABI changes, but - release 2.3 will, and no backwards compatibility is planned. - * The scheduler statistics structure will change to allow keeping track of RED actions. diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst index 99de186..ee7fd48 100644 --- a/doc/guides/rel_notes/release_2_3.rst +++ b/doc/guides/rel_notes/release_2_3.rst @@ -39,6 +39,8 @@ API Changes ABI Changes ----------- +* The fields of outer_mac and inner_mac were changed from pointer + to struct in order to keep the code's readability. Shared Library Versions ----------------------- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index bf6220d..1dd1077 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v3 2/4] lib/ether: add IP in GRE type [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-01-28 10:26 ` Xutao Sun 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun ` (2 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-28 10:26 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 30cbde7..0e948a1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v3 3/4] driver/i40e: implement tunnel filter for IP in GRE [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 2/4] lib/ether: add IP in GRE type Xutao Sun @ 2016-01-28 10:26 ` Xutao Sun 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test " Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-01-28 10:26 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 1dd1077..5c0eff9 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5797,6 +5797,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5811,7 +5817,7 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, uint8_t add) { uint16_t ip_type; - uint8_t tun_type = 0; + uint8_t i, tun_type = 0; int val, ret = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi = pf->main_vsi; @@ -5833,16 +5839,22 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, ETHER_ADDR_LEN); - pfilter->inner_vlan = tunnel_filter->inner_vlan; + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; + tunnel_filter->ip_addr.ipv4_addr = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr); (void)rte_memcpy(&pfilter->ipaddr.v4.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv4_addr, sizeof(pfilter->ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; + for (i = 0; i < 4; i++) { + tunnel_filter->ip_addr.ipv6_addr[i] = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]); + } (void)rte_memcpy(&pfilter->ipaddr.v6.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv6_addr, sizeof(pfilter->ipaddr.v6.data)); } @@ -5854,6 +5866,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); @@ -5868,10 +5883,11 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, return -EINVAL; } - pfilter->flags |= I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | ip_type | - (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT); - pfilter->tenant_id = tunnel_filter->tenant_id; - pfilter->queue_number = tunnel_filter->queue_id; + pfilter->flags |= rte_cpu_to_le_16( + I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE + | ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); + pfilter->tenant_id = rte_cpu_to_le_32(tunnel_filter->tenant_id); + pfilter->queue_number = rte_cpu_to_le_16(tunnel_filter->queue_id); if (add) ret = i40e_aq_add_cloud_filters(hw, vsi->seid, cld_filter, 1); -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test tunnel filter for IP in GRE [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> ` (2 preceding siblings ...) 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-01-28 10:26 ` Xutao Sun 2016-02-12 13:46 ` De Lara Guarch, Pablo 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 1 reply; 56+ messages in thread From: Xutao Sun @ 2016-01-28 10:26 UTC (permalink / raw) To: dev This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 67df259..4dedf28 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -301,12 +301,14 @@ static void cmd_help_long_parsed(void *parsed_result, " Set the outer VLAN TPID for Packet Filtering on" " a port\n\n" - "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter add (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|iningre) (filter_type)" + "(tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" - "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter rm (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|ipingre) (filter_type)" + "(tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6640,6 +6642,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6648,12 +6652,14 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (res->ip_value.family == AF_INET) { tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; + rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4; } else { - memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), - sizeof(struct in6_addr)); + int i; + for (i = 0; i < 4; i++) { + tunnel_filter_conf.ip_addr.ipv6_addr[i] = + rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); + } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } @@ -6669,6 +6675,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6678,6 +6688,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6723,11 +6735,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6741,8 +6753,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test " Xutao Sun @ 2016-02-12 13:46 ` De Lara Guarch, Pablo 2016-02-18 7:19 ` Sun, Xutao 0 siblings, 1 reply; 56+ messages in thread From: De Lara Guarch, Pablo @ 2016-02-12 13:46 UTC (permalink / raw) To: Sun, Xutao, dev Hi Xutao, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xutao Sun > Sent: Thursday, January 28, 2016 10:26 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test tunnel filter for IP in > GRE > > This patch add some options in tunnel_filter command to test IP in GRE > packet classification on i40e. > > Signed-off-by: Xutao Sun <xutao.sun@intel.com> > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> This patch needs to include a documentation update in testpmd_funcs.rst. ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-02-12 13:46 ` De Lara Guarch, Pablo @ 2016-02-18 7:19 ` Sun, Xutao 0 siblings, 0 replies; 56+ messages in thread From: Sun, Xutao @ 2016-02-18 7:19 UTC (permalink / raw) To: De Lara Guarch, Pablo, dev Hi Pablo, > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Friday, February 12, 2016 9:47 PM > To: Sun, Xutao <xutao.sun@intel.com>; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test tunnel filter for IP > in GRE > > Hi Xutao, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xutao Sun > > Sent: Thursday, January 28, 2016 10:26 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test tunnel filter > > for IP in GRE > > > > This patch add some options in tunnel_filter command to test IP in GRE > > packet classification on i40e. > > > > Signed-off-by: Xutao Sun <xutao.sun@intel.com> > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > > This patch needs to include a documentation update in testpmd_funcs.rst. I have checked testpmd_funcs.rst before. The content in the testpmd_funcs.rst is: testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) It does not include the options, so I think I don't need to update this document. Regards, Xutao ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> ` (3 preceding siblings ...) 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test " Xutao Sun @ 2016-02-18 9:58 ` Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun ` (4 more replies) 4 siblings, 5 replies; 56+ messages in thread From: Xutao Sun @ 2016-02-18 9:58 UTC (permalink / raw) To: dev This patch set adds tunnel filter support for IP in GRE on i40e. v2 changes: Fix the byte order problem. v3 changes: Remove the deprecation notice and update the release notes. v4 changes: Modify the mistakes in cmdline.c in the old patch Xutao Sun (4): lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure lib/ether: add IP in GRE type driver/i40e: implement tunnel filter for IP in GRE app/test-pmd: test tunnel filter for IP in GRE app/test-pmd/cmdline.c | 42 +++++++++++++++++++++----------- doc/guides/rel_notes/deprecation.rst | 5 ---- doc/guides/rel_notes/release_16_04.rst | 2 ++ drivers/net/i40e/i40e_ethdev.c | 44 +++++++++++++++++++++++----------- lib/librte_ether/rte_eth_ctrl.h | 5 ++-- 5 files changed, 63 insertions(+), 35 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v4 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun @ 2016-02-18 9:58 ` Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 2/4] lib/ether: add IP in GRE type Xutao Sun ` (3 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-02-18 9:58 UTC (permalink / raw) To: dev Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 ++++-- doc/guides/rel_notes/deprecation.rst | 5 ----- doc/guides/rel_notes/release_16_04.rst | 2 ++ drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 52e9f5f..c707318 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6640,8 +6640,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index e94d4a2..a895364 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -32,11 +32,6 @@ Deprecation Notices RTE_ETH_FLOW_MAX. The release 2.2 does not contain these ABI changes, but release 2.3 will. -* ABI changes are planned for rte_eth_tunnel_filter_conf. Change the fields - of outer_mac and inner_mac from pointer to struct in order to keep the - code's readability. The release 2.2 does not contain these ABI changes, but - release 2.3 will, and no backwards compatibility is planned. - * The scheduler statistics structure will change to allow keeping track of RED actions. diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index eb1b3b2..2588225 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -104,6 +104,8 @@ ABI Changes the previous releases and made in this release. Use fixed width quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense. +* The fields of outer_mac and inner_mac were changed from pointer + to struct in order to keep the code's readability. Shared Library Versions ----------------------- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index ef24122..7c22358 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v4 2/4] lib/ether: add IP in GRE type 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-02-18 9:58 ` Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun ` (2 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-02-18 9:58 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 30cbde7..0e948a1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v4 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 2/4] lib/ether: add IP in GRE type Xutao Sun @ 2016-02-18 9:58 ` Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test " Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-02-18 9:58 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 7c22358..a33fef5 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5797,6 +5797,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5811,7 +5817,7 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, uint8_t add) { uint16_t ip_type; - uint8_t tun_type = 0; + uint8_t i, tun_type = 0; int val, ret = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi = pf->main_vsi; @@ -5833,16 +5839,22 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, ETHER_ADDR_LEN); - pfilter->inner_vlan = tunnel_filter->inner_vlan; + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; + tunnel_filter->ip_addr.ipv4_addr = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr); (void)rte_memcpy(&pfilter->ipaddr.v4.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv4_addr, sizeof(pfilter->ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; + for (i = 0; i < 4; i++) { + tunnel_filter->ip_addr.ipv6_addr[i] = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]); + } (void)rte_memcpy(&pfilter->ipaddr.v6.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv6_addr, sizeof(pfilter->ipaddr.v6.data)); } @@ -5854,6 +5866,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); @@ -5868,10 +5883,11 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, return -EINVAL; } - pfilter->flags |= I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | ip_type | - (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT); - pfilter->tenant_id = tunnel_filter->tenant_id; - pfilter->queue_number = tunnel_filter->queue_id; + pfilter->flags |= rte_cpu_to_le_16( + I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE + | ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); + pfilter->tenant_id = rte_cpu_to_le_32(tunnel_filter->tenant_id); + pfilter->queue_number = rte_cpu_to_le_16(tunnel_filter->queue_id); if (add) ret = i40e_aq_add_cloud_filters(hw, vsi->seid, cld_filter, 1); -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (2 preceding siblings ...) 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-02-18 9:58 ` Xutao Sun 2016-02-18 12:16 ` De Lara Guarch, Pablo 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 1 reply; 56+ messages in thread From: Xutao Sun @ 2016-02-18 9:58 UTC (permalink / raw) To: dev This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index c707318..6a5cd9f 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -301,12 +301,14 @@ static void cmd_help_long_parsed(void *parsed_result, " Set the outer VLAN TPID for Packet Filtering on" " a port\n\n" - "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr)" + "(inner_vlan) (vxlan|nvgre|iningre) (filter_type)" + "(tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" - "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr)" + "(inner_vlan) (vxlan|nvgre|ipingre) (filter_type)" + "(tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6640,6 +6642,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6648,12 +6652,14 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (res->ip_value.family == AF_INET) { tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; + rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4; } else { - memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), - sizeof(struct in6_addr)); + int i; + for (i = 0; i < 4; i++) { + tunnel_filter_conf.ip_addr.ipv6_addr[i] = + rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); + } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } @@ -6669,6 +6675,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6678,6 +6688,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6723,11 +6735,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6741,8 +6753,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test " Xutao Sun @ 2016-02-18 12:16 ` De Lara Guarch, Pablo 2016-02-19 2:40 ` Sun, Xutao 0 siblings, 1 reply; 56+ messages in thread From: De Lara Guarch, Pablo @ 2016-02-18 12:16 UTC (permalink / raw) To: Sun, Xutao, dev Hi Xutao, > -----Original Message----- > From: Sun, Xutao > Sent: Thursday, February 18, 2016 9:58 AM > To: dev@dpdk.org > Cc: Zhang, Helin; Wu, Jingjing; De Lara Guarch, Pablo; Sun, Xutao; Liu, Jijiang > Subject: [PATCH v4 4/4] app/test-pmd: test tunnel filter for IP in GRE > > This patch add some options in tunnel_filter command to test IP in GRE > packet classification on i40e. > > Signed-off-by: Xutao Sun <xutao.sun@intel.com> > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> Sorry, I see your point now, that the tunnel/filter types are not being specified in the testpmd documentation. But actually, I think it would be a good idea to enumerate the different types in that document as well (and maybe add a description like "set fwd"). Plus, see one extra comment below. > --- > app/test-pmd/cmdline.c | 36 ++++++++++++++++++++++++------------ > 1 file changed, 24 insertions(+), 12 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index c707318..6a5cd9f 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -301,12 +301,14 @@ static void cmd_help_long_parsed(void > *parsed_result, > " Set the outer VLAN TPID for Packet Filtering on" > " a port\n\n" > > - "tunnel_filter add (port_id) (outer_mac) (inner_mac) > (ip_addr) " > - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) > (queue_id)\n" > + "tunnel_filter add (port_id) (outer_mac) (inner_mac) > (ip_addr)" > + "(inner_vlan) (vxlan|nvgre|iningre) (filter_type)" Should be ipingre? > + "(tenant_id) (queue_id)\n" > " add a tunnel filter of a port.\n\n" > > - "tunnel_filter rm (port_id) (outer_mac) (inner_mac) > (ip_addr) " > - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) > (queue_id)\n" > + "tunnel_filter rm (port_id) (outer_mac) (inner_mac) > (ip_addr)" > + "(inner_vlan) (vxlan|nvgre|ipingre) (filter_type)" > + "(tenant_id) (queue_id)\n" > " remove a tunnel filter of a port.\n\n" > ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-02-18 12:16 ` De Lara Guarch, Pablo @ 2016-02-19 2:40 ` Sun, Xutao 0 siblings, 0 replies; 56+ messages in thread From: Sun, Xutao @ 2016-02-19 2:40 UTC (permalink / raw) To: De Lara Guarch, Pablo, dev Hi Pablo, > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Thursday, February 18, 2016 8:17 PM > To: Sun, Xutao <xutao.sun@intel.com>; dev@dpdk.org > Cc: Zhang, Helin <helin.zhang@intel.com>; Wu, Jingjing > <jingjing.wu@intel.com>; Liu, Jijiang <jijiang.liu@intel.com> > Subject: RE: [PATCH v4 4/4] app/test-pmd: test tunnel filter for IP in GRE > > Hi Xutao, > > > -----Original Message----- > > From: Sun, Xutao > > Sent: Thursday, February 18, 2016 9:58 AM > > To: dev@dpdk.org > > Cc: Zhang, Helin; Wu, Jingjing; De Lara Guarch, Pablo; Sun, Xutao; > > Liu, Jijiang > > Subject: [PATCH v4 4/4] app/test-pmd: test tunnel filter for IP in GRE > > > > This patch add some options in tunnel_filter command to test IP in GRE > > packet classification on i40e. > > > > Signed-off-by: Xutao Sun <xutao.sun@intel.com> > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > > Sorry, I see your point now, that the tunnel/filter types are not being > specified in the testpmd documentation. > But actually, I think it would be a good idea to enumerate the different types > in that document as well (and maybe add a description like "set fwd"). > > Plus, see one extra comment below. > > > --- > > app/test-pmd/cmdline.c | 36 ++++++++++++++++++++++++------------ > > 1 file changed, 24 insertions(+), 12 deletions(-) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > c707318..6a5cd9f 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -301,12 +301,14 @@ static void cmd_help_long_parsed(void > > *parsed_result, > > " Set the outer VLAN TPID for Packet Filtering on" > > " a port\n\n" > > > > - "tunnel_filter add (port_id) (outer_mac) (inner_mac) > > (ip_addr) " > > - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) > > (queue_id)\n" > > + "tunnel_filter add (port_id) (outer_mac) (inner_mac) > > (ip_addr)" > > + "(inner_vlan) (vxlan|nvgre|iningre) (filter_type)" > > Should be ipingre? > > > + "(tenant_id) (queue_id)\n" > > " add a tunnel filter of a port.\n\n" > > > > - "tunnel_filter rm (port_id) (outer_mac) (inner_mac) > > (ip_addr) " > > - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) > > (queue_id)\n" > > + "tunnel_filter rm (port_id) (outer_mac) (inner_mac) > > (ip_addr)" > > + "(inner_vlan) (vxlan|nvgre|ipingre) (filter_type)" > > + "(tenant_id) (queue_id)\n" > > " remove a tunnel filter of a port.\n\n" > > Thanks for your advice, I will update the document. Regards, Xutao ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (3 preceding siblings ...) 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test " Xutao Sun @ 2016-02-19 7:31 ` Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun ` (4 more replies) 4 siblings, 5 replies; 56+ messages in thread From: Xutao Sun @ 2016-02-19 7:31 UTC (permalink / raw) To: dev This patch set adds tunnel filter support for IP in GRE on i40e. v2 changes: Fix the byte order problem. v3 changes: Remove the deprecation notice and update the release notes. v4 changes: Modify the mistakes in cmdline.c in the old patch. v5 changes: Fix type errors and update the testpmd documentation. Xutao Sun (4): lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure lib/ether: add IP in GRE type driver/i40e: implement tunnel filter for IP in GRE app/test-pmd: test tunnel filter for IP in GRE app/test-pmd/cmdline.c | 38 +++++++++++++++++-------- doc/guides/rel_notes/deprecation.rst | 5 ---- doc/guides/rel_notes/release_16_04.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 +++++++++++++++++++++-- drivers/net/i40e/i40e_ethdev.c | 44 ++++++++++++++++++++--------- lib/librte_ether/rte_eth_ctrl.h | 5 ++-- 6 files changed, 94 insertions(+), 35 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun @ 2016-02-19 7:31 ` Xutao Sun 2016-02-25 1:22 ` Wu, Jingjing 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 2/4] lib/ether: add IP in GRE type Xutao Sun ` (3 subsequent siblings) 4 siblings, 1 reply; 56+ messages in thread From: Xutao Sun @ 2016-02-19 7:31 UTC (permalink / raw) To: dev Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 +++-- doc/guides/rel_notes/deprecation.rst | 5 ----- doc/guides/rel_notes/release_16_04.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 +++++++++++++++++++++++++++-- drivers/net/i40e/i40e_ethdev.c | 12 +++++----- lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 6 files changed, 47 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 52e9f5f..c707318 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6640,8 +6640,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index e94d4a2..a895364 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -32,11 +32,6 @@ Deprecation Notices RTE_ETH_FLOW_MAX. The release 2.2 does not contain these ABI changes, but release 2.3 will. -* ABI changes are planned for rte_eth_tunnel_filter_conf. Change the fields - of outer_mac and inner_mac from pointer to struct in order to keep the - code's readability. The release 2.2 does not contain these ABI changes, but - release 2.3 will, and no backwards compatibility is planned. - * The scheduler statistics structure will change to allow keeping track of RED actions. diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index eb1b3b2..2588225 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -104,6 +104,8 @@ ABI Changes the previous releases and made in this release. Use fixed width quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense. +* The fields of outer_mac and inner_mac were changed from pointer + to struct in order to keep the code's readability. Shared Library Versions ----------------------- diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a520cc5..3ee629a 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -553,7 +553,37 @@ tunnel_filter add Add a tunnel filter on a port:: testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) + +The available information categories are: + +* ``vxlan``: Set tunnel type as VXLAN. + +* ``nvgre``: Set tunnel type as NVGRE. + +* ``ipingre``: Set tunnel type as IP-in-GRE. + +* ``imac-ivlan``: Set filter type as Inner MAC and VLAN. + +* ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID. + +* ``imac-tenid``: Set filter type as Inner MAC and tenant ID. + +* ``imac``: Set filter type as Inner MAC. + +* ``omac-imac-tenid``: Set filter type as Outer MAC, Inner MAC and tenant ID. + +* ``oip``: Set filter type as Outer IP. + +* ``iip``: Set filter type as Inner IP. + +Example:: + + testpmd> tunnel_filter add 0 68:05:CA:28:09:82 00:00:00:00:00:00 \ + 192.168.2.2 0 ipingre oip 1 1 + + Set an IP-in-GRE tunnel on port 0, and the filter type is Outer IP. tunnel_filter remove ~~~~~~~~~~~~~~~~~~~~ @@ -561,7 +591,8 @@ tunnel_filter remove Remove a tunnel filter on a port:: testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) rx_vxlan_port add ~~~~~~~~~~~~~~~~~ diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index ef24122..7c22358 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-02-25 1:22 ` Wu, Jingjing 0 siblings, 0 replies; 56+ messages in thread From: Wu, Jingjing @ 2016-02-25 1:22 UTC (permalink / raw) To: Sun, Xutao, dev > -----Original Message----- > From: Sun, Xutao > Sent: Friday, February 19, 2016 3:32 PM > To: dev@dpdk.org > Cc: Zhang, Helin; Wu, Jingjing; De Lara Guarch, Pablo; Sun, Xutao; Liu, Jijiang > Subject: [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' > structure > > Change the fields of outer_mac and inner_mac from pointer to struct in > order to keep the code's readability. > > Signed-off-by: Xutao Sun <xutao.sun@intel.com> > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index a520cc5..3ee629a 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -553,7 +553,37 @@ tunnel_filter add > Add a tunnel filter on a port:: > > testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ > - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) > + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ > + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) > + (queue_id) > + > +The available information categories are: > + > +* ``vxlan``: Set tunnel type as VXLAN. > + > +* ``nvgre``: Set tunnel type as NVGRE. > + > +* ``ipingre``: Set tunnel type as IP-in-GRE. > + > +* ``imac-ivlan``: Set filter type as Inner MAC and VLAN. > + > +* ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID. > + > +* ``imac-tenid``: Set filter type as Inner MAC and tenant ID. > + > +* ``imac``: Set filter type as Inner MAC. > + > +* ``omac-imac-tenid``: Set filter type as Outer MAC, Inner MAC and tenant > ID. > + > +* ``oip``: Set filter type as Outer IP. > + > +* ``iip``: Set filter type as Inner IP. > + Doc for tunnel_filter is extended, and ipingre type is also mentioned here. This part seems no relationship with the commit log "Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability". It's better to move to latter patch. > +Example:: > + > + testpmd> tunnel_filter add 0 68:05:CA:28:09:82 00:00:00:00:00:00 \ > + 192.168.2.2 0 ipingre oip 1 1 > + > + Set an IP-in-GRE tunnel on port 0, and the filter type is Outer IP. > > tunnel_filter remove > ~~~~~~~~~~~~~~~~~~~~ > @@ -561,7 +591,8 @@ tunnel_filter remove Remove a tunnel filter on a > port:: > > testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \ > - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) > + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ > + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) > + (queue_id) > > rx_vxlan_port add > ~~~~~~~~~~~~~~~~~ > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c > index ef24122..7c22358 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, > } > pfilter = cld_filter; > > - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, > - sizeof(struct ether_addr)); > - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, > - sizeof(struct ether_addr)); > + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, > + ETHER_ADDR_LEN); > + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, > + ETHER_ADDR_LEN); > > pfilter->inner_vlan = tunnel_filter->inner_vlan; > if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ - > 6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, > } > > if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && > - (is_zero_ether_addr(filter->outer_mac))) { > + (is_zero_ether_addr(&filter->outer_mac))) { > PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC > address"); > return -EINVAL; > } > > if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && > - (is_zero_ether_addr(filter->inner_mac))) { > + (is_zero_ether_addr(&filter->inner_mac))) { > PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); > return -EINVAL; > } > diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h > index ce224ad..30cbde7 100644 > --- a/lib/librte_ether/rte_eth_ctrl.h > +++ b/lib/librte_ether/rte_eth_ctrl.h > @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { > * Tunneling Packet filter configuration. > */ > struct rte_eth_tunnel_filter_conf { > - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ > - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ > + struct ether_addr outer_mac; /**< Outer MAC address filter. */ > + struct ether_addr inner_mac; /**< Inner MAC address filter. */ > uint16_t inner_vlan; /**< Inner VLAN filter. */ > enum rte_tunnel_iptype ip_type; /**< IP address type. */ > union { > -- > 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v5 2/4] lib/ether: add IP in GRE type 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-02-19 7:31 ` Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun ` (2 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-02-19 7:31 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 30cbde7..0e948a1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 2/4] lib/ether: add IP in GRE type Xutao Sun @ 2016-02-19 7:31 ` Xutao Sun 2016-02-25 1:50 ` Wu, Jingjing 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 4/4] app/test-pmd: test " Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 1 reply; 56+ messages in thread From: Xutao Sun @ 2016-02-19 7:31 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 7c22358..a33fef5 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5797,6 +5797,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5811,7 +5817,7 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, uint8_t add) { uint16_t ip_type; - uint8_t tun_type = 0; + uint8_t i, tun_type = 0; int val, ret = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi = pf->main_vsi; @@ -5833,16 +5839,22 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, ETHER_ADDR_LEN); - pfilter->inner_vlan = tunnel_filter->inner_vlan; + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; + tunnel_filter->ip_addr.ipv4_addr = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr); (void)rte_memcpy(&pfilter->ipaddr.v4.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv4_addr, sizeof(pfilter->ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; + for (i = 0; i < 4; i++) { + tunnel_filter->ip_addr.ipv6_addr[i] = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]); + } (void)rte_memcpy(&pfilter->ipaddr.v6.data, - &tunnel_filter->ip_addr, + &tunnel_filter->ip_addr.ipv6_addr, sizeof(pfilter->ipaddr.v6.data)); } @@ -5854,6 +5866,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); @@ -5868,10 +5883,11 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, return -EINVAL; } - pfilter->flags |= I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | ip_type | - (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT); - pfilter->tenant_id = tunnel_filter->tenant_id; - pfilter->queue_number = tunnel_filter->queue_id; + pfilter->flags |= rte_cpu_to_le_16( + I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE + | ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); + pfilter->tenant_id = rte_cpu_to_le_32(tunnel_filter->tenant_id); + pfilter->queue_number = rte_cpu_to_le_16(tunnel_filter->queue_id); if (add) ret = i40e_aq_add_cloud_filters(hw, vsi->seid, cld_filter, 1); -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-02-25 1:50 ` Wu, Jingjing 0 siblings, 0 replies; 56+ messages in thread From: Wu, Jingjing @ 2016-02-25 1:50 UTC (permalink / raw) To: Sun, Xutao, dev > @@ -5833,16 +5839,22 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, > (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, > ETHER_ADDR_LEN); > > - pfilter->inner_vlan = tunnel_filter->inner_vlan; > + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); > if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { > ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; > + tunnel_filter->ip_addr.ipv4_addr = > + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr); > (void)rte_memcpy(&pfilter->ipaddr.v4.data, > - &tunnel_filter->ip_addr, > + &tunnel_filter->ip_addr.ipv4_addr, > sizeof(pfilter->ipaddr.v4.data)); > } else { > ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; > + for (i = 0; i < 4; i++) { > + tunnel_filter->ip_addr.ipv6_addr[i] = > + rte_cpu_to_le_32(tunnel_filter- > >ip_addr.ipv6_addr[i]); You changed the value of in parameter. It's better to use an internal variable to convert byte order. Thanks Jingjing > 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v5 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (2 preceding siblings ...) 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-02-19 7:31 ` Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-02-19 7:31 UTC (permalink / raw) To: dev This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index c707318..3e7cec8 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -302,11 +302,13 @@ static void cmd_help_long_parsed(void *parsed_result, " a port\n\n" "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6640,6 +6642,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6648,12 +6652,14 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (res->ip_value.family == AF_INET) { tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; + rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4; } else { - memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), - sizeof(struct in6_addr)); + int i; + for (i = 0; i < 4; i++) { + tunnel_filter_conf.ip_addr.ipv6_addr[i] = + rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); + } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } @@ -6669,6 +6675,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6678,6 +6688,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6723,11 +6735,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6741,8 +6753,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (3 preceding siblings ...) 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 4/4] app/test-pmd: test " Xutao Sun @ 2016-03-01 3:47 ` Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun ` (4 more replies) 4 siblings, 5 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 3:47 UTC (permalink / raw) To: dev This patch set adds tunnel filter support for IP in GRE on i40e. v2 changes: Fix the byte order problem. v3 changes: Remove the deprecation notice and update the release notes. v4 changes: Modify the mistakes in cmdline.c in the old patch. v5 changes: Fix type errors and update the testpmd documentation. v6 changes: Use internal variables to convert byte order. Xutao Sun (4): lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure lib/ether: add IP in GRE type driver/i40e: implement tunnel filter for IP in GRE app/test-pmd: test tunnel filter for IP in GRE app/test-pmd/cmdline.c | 38 +++++++++++++++------- doc/guides/rel_notes/deprecation.rst | 5 --- doc/guides/rel_notes/release_16_04.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 +++++++++++++++++++-- drivers/net/i40e/i40e_ethdev.c | 49 +++++++++++++++++++---------- lib/librte_ether/rte_eth_ctrl.h | 5 +-- 6 files changed, 97 insertions(+), 37 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun @ 2016-03-01 3:47 ` Xutao Sun 2016-03-01 8:53 ` Panu Matilainen 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 2/4] lib/ether: add IP in GRE type Xutao Sun ` (3 subsequent siblings) 4 siblings, 1 reply; 56+ messages in thread From: Xutao Sun @ 2016-03-01 3:47 UTC (permalink / raw) To: dev Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 ++++-- doc/guides/rel_notes/deprecation.rst | 5 ----- doc/guides/rel_notes/release_16_04.rst | 2 ++ drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 52e9f5f..c707318 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6640,8 +6640,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index e94d4a2..a895364 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -32,11 +32,6 @@ Deprecation Notices RTE_ETH_FLOW_MAX. The release 2.2 does not contain these ABI changes, but release 2.3 will. -* ABI changes are planned for rte_eth_tunnel_filter_conf. Change the fields - of outer_mac and inner_mac from pointer to struct in order to keep the - code's readability. The release 2.2 does not contain these ABI changes, but - release 2.3 will, and no backwards compatibility is planned. - * The scheduler statistics structure will change to allow keeping track of RED actions. diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index 64e913d..704d0f6 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -123,6 +123,8 @@ ABI Changes the previous releases and made in this release. Use fixed width quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense. +* The fields of outer_mac and inner_mac were changed from pointer + to struct in order to keep the code's readability. Shared Library Versions ----------------------- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index ef24122..7c22358 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-03-01 8:53 ` Panu Matilainen 2016-03-02 3:10 ` Sun, Xutao 0 siblings, 1 reply; 56+ messages in thread From: Panu Matilainen @ 2016-03-01 8:53 UTC (permalink / raw) To: Xutao Sun, dev On 03/01/2016 05:47 AM, Xutao Sun wrote: > Change the fields of outer_mac and inner_mac from pointer to struct > in order to keep the code's readability. > > Signed-off-by: Xutao Sun <xutao.sun@intel.com> > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > --- > app/test-pmd/cmdline.c | 6 ++++-- > doc/guides/rel_notes/deprecation.rst | 5 ----- > doc/guides/rel_notes/release_16_04.rst | 2 ++ > drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ > lib/librte_ether/rte_eth_ctrl.h | 4 ++-- > 5 files changed, 14 insertions(+), 15 deletions(-) > Since this is the commit actually changing the ABI, its best to actually bump LIBABIVER right here as well lest it go forgotten, and also update the list of shared library versions in release notes. See commit d8c4ae275582784ec0ff3b2c54a4c861b55bc056 for an example. Oh and sorry for not noticing this earlier. - Panu - ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-03-01 8:53 ` Panu Matilainen @ 2016-03-02 3:10 ` Sun, Xutao 2016-03-02 7:12 ` Panu Matilainen 0 siblings, 1 reply; 56+ messages in thread From: Sun, Xutao @ 2016-03-02 3:10 UTC (permalink / raw) To: Panu Matilainen, dev Hi, Panu > -----Original Message----- > From: Panu Matilainen [mailto:pmatilai@redhat.com] > Sent: Tuesday, March 01, 2016 4:54 PM > To: Sun, Xutao <xutao.sun@intel.com>; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize > the'rte_eth_tunnel_filter_conf' structure > > On 03/01/2016 05:47 AM, Xutao Sun wrote: > > Change the fields of outer_mac and inner_mac from pointer to struct in > > order to keep the code's readability. > > > > Signed-off-by: Xutao Sun <xutao.sun@intel.com> > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > > --- > > app/test-pmd/cmdline.c | 6 ++++-- > > doc/guides/rel_notes/deprecation.rst | 5 ----- > > doc/guides/rel_notes/release_16_04.rst | 2 ++ > > drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ > > lib/librte_ether/rte_eth_ctrl.h | 4 ++-- > > 5 files changed, 14 insertions(+), 15 deletions(-) > > > > Since this is the commit actually changing the ABI, its best to actually bump > LIBABIVER right here as well lest it go forgotten, and also update the list of > shared library versions in release notes. > See commit d8c4ae275582784ec0ff3b2c54a4c861b55bc056 for an example. > > Oh and sorry for not noticing this earlier. > > - Panu - I didn't use the Macro "RTE_NEXT_ABI", so I think I don't need to update the shared library verisons. And I also updated the doc about ABI change in the deprecation.rst and release notes. Thanks, Xutao ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-03-02 3:10 ` Sun, Xutao @ 2016-03-02 7:12 ` Panu Matilainen 0 siblings, 0 replies; 56+ messages in thread From: Panu Matilainen @ 2016-03-02 7:12 UTC (permalink / raw) To: Sun, Xutao, dev On 03/02/2016 05:10 AM, Sun, Xutao wrote: > Hi, Panu > >> -----Original Message----- >> From: Panu Matilainen [mailto:pmatilai@redhat.com] >> Sent: Tuesday, March 01, 2016 4:54 PM >> To: Sun, Xutao <xutao.sun@intel.com>; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize >> the'rte_eth_tunnel_filter_conf' structure >> >> On 03/01/2016 05:47 AM, Xutao Sun wrote: >>> Change the fields of outer_mac and inner_mac from pointer to struct in >>> order to keep the code's readability. >>> >>> Signed-off-by: Xutao Sun <xutao.sun@intel.com> >>> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> >>> --- >>> app/test-pmd/cmdline.c | 6 ++++-- >>> doc/guides/rel_notes/deprecation.rst | 5 ----- >>> doc/guides/rel_notes/release_16_04.rst | 2 ++ >>> drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ >>> lib/librte_ether/rte_eth_ctrl.h | 4 ++-- >>> 5 files changed, 14 insertions(+), 15 deletions(-) >>> >> >> Since this is the commit actually changing the ABI, its best to actually bump >> LIBABIVER right here as well lest it go forgotten, and also update the list of >> shared library versions in release notes. >> See commit d8c4ae275582784ec0ff3b2c54a4c861b55bc056 for an example. >> >> Oh and sorry for not noticing this earlier. >> >> - Panu - > > I didn't use the Macro "RTE_NEXT_ABI", so I think I don't need to update the shared library verisons. > And I also updated the doc about ABI change in the deprecation.rst and release notes. Shared library version MUST change when there's an incompatible change to prevent programs/libraries linked against the older version to be used with the incompatible version, that is the sole reason for versioning the libraries in the first place. Whether RTE_NEXT_ABI is used or not is not relevant. In fact RTE_NEXT_ABI creates a shared library version of its own, sort of parallel to the current one. The basic idea remains the same though: shared library version has to change when an incompatible change goes in. - Panu - - Panu - - Panu - - Panu - ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v6 2/4] lib/ether: add IP in GRE type 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-03-01 3:47 ` Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun ` (2 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 3:47 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 30cbde7..0e948a1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v6 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 2/4] lib/ether: add IP in GRE type Xutao Sun @ 2016-03-01 3:47 ` Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 4/4] app/test-pmd: test " Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 3:47 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 7c22358..6d860ee 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5797,6 +5797,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5811,7 +5817,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, uint8_t add) { uint16_t ip_type; - uint8_t tun_type = 0; + uint8_t i, tun_type = 0; + /* internal varialbe to convert byte order */ + uint32_t convert_ipv4; + uint32_t convert_ipv6[4]; int val, ret = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi = pf->main_vsi; @@ -5833,16 +5842,20 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, ETHER_ADDR_LEN); - pfilter->inner_vlan = tunnel_filter->inner_vlan; + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; - (void)rte_memcpy(&pfilter->ipaddr.v4.data, - &tunnel_filter->ip_addr, + convert_ipv4 = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr); + (void)rte_memcpy(&pfilter->ipaddr.v4.data, &convert_ipv4, sizeof(pfilter->ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; - (void)rte_memcpy(&pfilter->ipaddr.v6.data, - &tunnel_filter->ip_addr, + for (i = 0; i < 4; i++) { + convert_ipv6[i] = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]); + } + (void)rte_memcpy(&pfilter->ipaddr.v6.data, &convert_ipv6, sizeof(pfilter->ipaddr.v6.data)); } @@ -5854,6 +5867,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); @@ -5868,10 +5884,11 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, return -EINVAL; } - pfilter->flags |= I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | ip_type | - (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT); - pfilter->tenant_id = tunnel_filter->tenant_id; - pfilter->queue_number = tunnel_filter->queue_id; + pfilter->flags |= rte_cpu_to_le_16( + I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE + | ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); + pfilter->tenant_id = rte_cpu_to_le_32(tunnel_filter->tenant_id); + pfilter->queue_number = rte_cpu_to_le_16(tunnel_filter->queue_id); if (add) ret = i40e_aq_add_cloud_filters(hw, vsi->seid, cld_filter, 1); -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v6 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (2 preceding siblings ...) 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-03-01 3:47 ` Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 4 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 3:47 UTC (permalink / raw) To: dev This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Update the testpmd documentation. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 32 +++++++++++++++++--------- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 +++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index c707318..3e7cec8 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -302,11 +302,13 @@ static void cmd_help_long_parsed(void *parsed_result, " a port\n\n" "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6640,6 +6642,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6648,12 +6652,14 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (res->ip_value.family == AF_INET) { tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; + rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4; } else { - memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), - sizeof(struct in6_addr)); + int i; + for (i = 0; i < 4; i++) { + tunnel_filter_conf.ip_addr.ipv6_addr[i] = + rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); + } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } @@ -6669,6 +6675,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6678,6 +6688,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6723,11 +6735,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6741,8 +6753,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a520cc5..3ee629a 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -553,7 +553,37 @@ tunnel_filter add Add a tunnel filter on a port:: testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) + +The available information categories are: + +* ``vxlan``: Set tunnel type as VXLAN. + +* ``nvgre``: Set tunnel type as NVGRE. + +* ``ipingre``: Set tunnel type as IP-in-GRE. + +* ``imac-ivlan``: Set filter type as Inner MAC and VLAN. + +* ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID. + +* ``imac-tenid``: Set filter type as Inner MAC and tenant ID. + +* ``imac``: Set filter type as Inner MAC. + +* ``omac-imac-tenid``: Set filter type as Outer MAC, Inner MAC and tenant ID. + +* ``oip``: Set filter type as Outer IP. + +* ``iip``: Set filter type as Inner IP. + +Example:: + + testpmd> tunnel_filter add 0 68:05:CA:28:09:82 00:00:00:00:00:00 \ + 192.168.2.2 0 ipingre oip 1 1 + + Set an IP-in-GRE tunnel on port 0, and the filter type is Outer IP. tunnel_filter remove ~~~~~~~~~~~~~~~~~~~~ @@ -561,7 +591,8 @@ tunnel_filter remove Remove a tunnel filter on a port:: testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) rx_vxlan_port add ~~~~~~~~~~~~~~~~~ -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (3 preceding siblings ...) 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 4/4] app/test-pmd: test " Xutao Sun @ 2016-03-01 8:41 ` Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun ` (6 more replies) 4 siblings, 7 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 8:41 UTC (permalink / raw) To: dev This patch set adds tunnel filter support for IP in GRE on i40e. v2 changes: Fix the byte order problem. v3 changes: Remove the deprecation notice and update the release notes. v4 changes: Modify the mistakes in cmdline.c in the old patch. v5 changes: Fix type errors and update the testpmd documentation. v6 changes: Use internal variables to convert byte order. v7 changes: Modify the mistakes of code style. Xutao Sun (4): lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure lib/ether: add IP in GRE type driver/i40e: implement tunnel filter for IP in GRE app/test-pmd: test tunnel filter for IP in GRE app/test-pmd/cmdline.c | 38 ++++++++++++++++-------- doc/guides/rel_notes/deprecation.rst | 5 ---- doc/guides/rel_notes/release_16_04.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 ++++++++++++++++++++-- drivers/net/i40e/i40e_ethdev.c | 45 +++++++++++++++++++---------- lib/librte_ether/rte_eth_ctrl.h | 5 ++-- 6 files changed, 94 insertions(+), 36 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun @ 2016-03-01 8:41 ` Xutao Sun 2016-03-08 23:08 ` Thomas Monjalon 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 2/4] lib/ether: add IP in GRE type Xutao Sun ` (5 subsequent siblings) 6 siblings, 1 reply; 56+ messages in thread From: Xutao Sun @ 2016-03-01 8:41 UTC (permalink / raw) To: dev Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 ++++-- doc/guides/rel_notes/deprecation.rst | 5 ----- doc/guides/rel_notes/release_16_04.rst | 2 ++ drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 52e9f5f..c707318 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6640,8 +6640,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index e94d4a2..a895364 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -32,11 +32,6 @@ Deprecation Notices RTE_ETH_FLOW_MAX. The release 2.2 does not contain these ABI changes, but release 2.3 will. -* ABI changes are planned for rte_eth_tunnel_filter_conf. Change the fields - of outer_mac and inner_mac from pointer to struct in order to keep the - code's readability. The release 2.2 does not contain these ABI changes, but - release 2.3 will, and no backwards compatibility is planned. - * The scheduler statistics structure will change to allow keeping track of RED actions. diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index 64e913d..704d0f6 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -123,6 +123,8 @@ ABI Changes the previous releases and made in this release. Use fixed width quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense. +* The fields of outer_mac and inner_mac were changed from pointer + to struct in order to keep the code's readability. Shared Library Versions ----------------------- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index ef24122..7c22358 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-03-08 23:08 ` Thomas Monjalon 2016-03-08 23:20 ` Thomas Monjalon 0 siblings, 1 reply; 56+ messages in thread From: Thomas Monjalon @ 2016-03-08 23:08 UTC (permalink / raw) To: Xutao Sun; +Cc: dev Hi, 2016-03-01 16:41, Xutao Sun: > --- a/doc/guides/rel_notes/release_16_04.rst > +++ b/doc/guides/rel_notes/release_16_04.rst > @@ -123,6 +123,8 @@ ABI Changes > the previous releases and made in this release. Use fixed width quotes for > ``rte_function_names`` or ``rte_struct_names``. Use the past tense. > > +* The fields of outer_mac and inner_mac were changed from pointer > + to struct in order to keep the code's readability. It is an API change. Proof: you changed the testpmd code. ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure 2016-03-08 23:08 ` Thomas Monjalon @ 2016-03-08 23:20 ` Thomas Monjalon 0 siblings, 0 replies; 56+ messages in thread From: Thomas Monjalon @ 2016-03-08 23:20 UTC (permalink / raw) To: Xutao Sun; +Cc: dev 2016-03-09 00:08, Thomas Monjalon: > Hi, > > 2016-03-01 16:41, Xutao Sun: > > --- a/doc/guides/rel_notes/release_16_04.rst > > +++ b/doc/guides/rel_notes/release_16_04.rst > > @@ -123,6 +123,8 @@ ABI Changes > > the previous releases and made in this release. Use fixed width quotes for > > ``rte_function_names`` or ``rte_struct_names``. Use the past tense. > > > > +* The fields of outer_mac and inner_mac were changed from pointer > > + to struct in order to keep the code's readability. > > It is an API change. Proof: you changed the testpmd code. Please move it and reword to precise the ethdev context. Also the fields should be enclosed with backquotes as in the template. ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v7 2/4] lib/ether: add IP in GRE type 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun @ 2016-03-01 8:41 ` Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun ` (4 subsequent siblings) 6 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 8:41 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 30cbde7..0e948a1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v7 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 2/4] lib/ether: add IP in GRE type Xutao Sun @ 2016-03-01 8:41 ` Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 4/4] app/test-pmd: test " Xutao Sun ` (3 subsequent siblings) 6 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 8:41 UTC (permalink / raw) To: dev Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 7c22358..237c735 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5797,6 +5797,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5811,7 +5817,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, uint8_t add) { uint16_t ip_type; - uint8_t tun_type = 0; + uint8_t i, tun_type = 0; + /* internal varialbe to convert ipv6 byte order */ + uint32_t convert_ipv6[4]; int val, ret = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi = pf->main_vsi; @@ -5833,16 +5841,19 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, ETHER_ADDR_LEN); - pfilter->inner_vlan = tunnel_filter->inner_vlan; + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; (void)rte_memcpy(&pfilter->ipaddr.v4.data, - &tunnel_filter->ip_addr, + &rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr), sizeof(pfilter->ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; - (void)rte_memcpy(&pfilter->ipaddr.v6.data, - &tunnel_filter->ip_addr, + for (i = 0; i < 4; i++) { + convert_ipv6[i] = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]); + } + (void)rte_memcpy(&pfilter->ipaddr.v6.data, &convert_ipv6, sizeof(pfilter->ipaddr.v6.data)); } @@ -5854,6 +5865,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); @@ -5868,10 +5882,11 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, return -EINVAL; } - pfilter->flags |= I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | ip_type | - (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT); - pfilter->tenant_id = tunnel_filter->tenant_id; - pfilter->queue_number = tunnel_filter->queue_id; + pfilter->flags |= rte_cpu_to_le_16( + I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | + ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); + pfilter->tenant_id = rte_cpu_to_le_32(tunnel_filter->tenant_id); + pfilter->queue_number = rte_cpu_to_le_16(tunnel_filter->queue_id); if (add) ret = i40e_aq_add_cloud_filters(hw, vsi->seid, cld_filter, 1); -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v7 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (2 preceding siblings ...) 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun @ 2016-03-01 8:41 ` Xutao Sun 2016-03-02 7:04 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Liu, Yong ` (2 subsequent siblings) 6 siblings, 0 replies; 56+ messages in thread From: Xutao Sun @ 2016-03-01 8:41 UTC (permalink / raw) To: dev This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Update the testpmd documentation. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 32 +++++++++++++++++--------- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 +++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index c707318..3e7cec8 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -302,11 +302,13 @@ static void cmd_help_long_parsed(void *parsed_result, " a port\n\n" "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6640,6 +6642,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6648,12 +6652,14 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (res->ip_value.family == AF_INET) { tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; + rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4; } else { - memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), - sizeof(struct in6_addr)); + int i; + for (i = 0; i < 4; i++) { + tunnel_filter_conf.ip_addr.ipv6_addr[i] = + rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); + } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } @@ -6669,6 +6675,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6678,6 +6688,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6723,11 +6735,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6741,8 +6753,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a520cc5..3ee629a 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -553,7 +553,37 @@ tunnel_filter add Add a tunnel filter on a port:: testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) + +The available information categories are: + +* ``vxlan``: Set tunnel type as VXLAN. + +* ``nvgre``: Set tunnel type as NVGRE. + +* ``ipingre``: Set tunnel type as IP-in-GRE. + +* ``imac-ivlan``: Set filter type as Inner MAC and VLAN. + +* ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID. + +* ``imac-tenid``: Set filter type as Inner MAC and tenant ID. + +* ``imac``: Set filter type as Inner MAC. + +* ``omac-imac-tenid``: Set filter type as Outer MAC, Inner MAC and tenant ID. + +* ``oip``: Set filter type as Outer IP. + +* ``iip``: Set filter type as Inner IP. + +Example:: + + testpmd> tunnel_filter add 0 68:05:CA:28:09:82 00:00:00:00:00:00 \ + 192.168.2.2 0 ipingre oip 1 1 + + Set an IP-in-GRE tunnel on port 0, and the filter type is Outer IP. tunnel_filter remove ~~~~~~~~~~~~~~~~~~~~ @@ -561,7 +591,8 @@ tunnel_filter remove Remove a tunnel filter on a port:: testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) rx_vxlan_port add ~~~~~~~~~~~~~~~~~ -- 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (3 preceding siblings ...) 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 4/4] app/test-pmd: test " Xutao Sun @ 2016-03-02 7:04 ` Liu, Yong 2016-03-02 7:31 ` Wu, Jingjing 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu 6 siblings, 0 replies; 56+ messages in thread From: Liu, Yong @ 2016-03-02 7:04 UTC (permalink / raw) To: Sun, Xutao, dev Tested-by: Yong Liu <yong.liu@intel.com> - Tested Branch: dpdk-next-net - Tested Commit: 5fa83b5398e26af7537b09605432fcb3d0cc1d41 - OS: Fedora20 3.11.10-301.fc20.x86_64 - GCC: gcc version 4.8.3 20140911 - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz - NIC: Intel Corporation Device RedrockCanyou [8086:15a4] - Default x86_64-native-linuxapp-gcc configuration - Prerequisites: - Total 4 cases, 4 passed, 0 failed - Prerequisites command / instruction: Intel(r) X710 (Fortville) NIC plugged in - Case: GRE ipv4 packet detect Description: check IPGRE packet can be normally detected Command / instruction: Start testpmd and enable rxonly forwarding mode testpmd -c ffff -n 4 -- -i --txqflags=0x0 testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start Send ipv4+GRE+ipv4 packet and check testpmd log match packet type - Case: GRE ipv6 packet detect Description: check IPGRE packet can be normally detected Command / instruction: Start testpmd and enable rxonly forwarding mode testpmd -c ffff -n 4 -- -i --txqflags=0x0 testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start Send ipv6+GRE+ipv4 packet and check testpmd log match packet type Send ipv6+GRE+ipv6 packet and check testpmd log match packet type - Case: GRE packet filter Description: check IPGRE cloud filter work as expected Command / instruction: Start testpmd with multi queues testpmd -c ff -n 3 -- -i --rxq=4 --txq=4 --txqflags=0x0 testpmd> set fwd rxonly testpmd> set nbcore 4 testpmd> set verbose 1 testpmd> start Add GRE filter that forward inner ip address 0.0.0.0 packets to queue 3 testpmd> tunnel_filter add 0 XX:XX:XX:XX:XX:XX YY:YY:YY:YY:YY:YY \ 0.0.0.0 1 ipingre iip 0 3 Send packet inner ip address matched and check packet recevied by queue 3. Remove tunnel filter and check same packet recevied by queue 0 testpmd> tunnel_filter rm 0 XX:XX:XX:XX:XX:XX YY:YY:YY:YY:YY:YY \ 0.0.0.0 1 ipingre iip 0 3 Add GRE filter that forward outer ip address 0.0.0.0 to queue 3 testpmd> tunnel_filter add 0 XX:XX:XX:XX:XX:XX YY:YY:YY:YY:YY:YY \ 0.0.0.0 1 ipingre oip 0 3 Send packet outer ip address matched and check packet recevied by queue 3. Remove tunnel filter and check same packet recevied by queue 0. testpmd> tunnel_filter rm 0 XX:XX:XX:XX:XX:XX YY:YY:YY:YY:YY:YY \ 0.0.0.0 1 ipingre iip 0 3 - Case: GRE packet chksum offload Description: check IPGRE packet's checksum can be offloaded Command / instruction: Start testpmd with hardware checksum offload enabled:: testpmd -c ff -n 3 -- -i --txqflags=0x0 --enable-rx-cksum testpmd> set verbose 1 testpmd> set fwd csum testpmd> csum set ip hw 0 testpmd> csum set udp hw 0 testpmd> csum set sctp hw 0 testpmd> csum set outer-ip hw 0 testpmd> csum set tcp hw 0 testpmd> csum parse_tunnel on 0 testpmd> start Send packet with wrong outer IP checksum and check forwarded packet IP checksum is correct. Send packet with wrong inner IP checksum and check forwarded packet IP checksum is correct. Send packet with wrong inner TCP checksum and check forwarded packet TCP checksum is correct. Send packet with wrong inner UDP checksum and check forwarded packet UDP checksum is correct. Send packet with wrong inner SCTP checksum and check forwarded packet SCTP checksum is correct. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xutao Sun > Sent: Tuesday, March 01, 2016 4:41 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in > GRE on i40e > > This patch set adds tunnel filter support for IP in GRE on i40e. > > v2 changes: > Fix the byte order problem. > > v3 changes: > Remove the deprecation notice and update the release notes. > > v4 changes: > Modify the mistakes in cmdline.c in the old patch. > > v5 changes: > Fix type errors and update the testpmd documentation. > > v6 changes: > Use internal variables to convert byte order. > > v7 changes: > Modify the mistakes of code style. > > Xutao Sun (4): > lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure > lib/ether: add IP in GRE type > driver/i40e: implement tunnel filter for IP in GRE > app/test-pmd: test tunnel filter for IP in GRE > > app/test-pmd/cmdline.c | 38 ++++++++++++++++------- > - > doc/guides/rel_notes/deprecation.rst | 5 ---- > doc/guides/rel_notes/release_16_04.rst | 2 ++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 ++++++++++++++++++++-- > drivers/net/i40e/i40e_ethdev.c | 45 +++++++++++++++++++---- > ------ > lib/librte_ether/rte_eth_ctrl.h | 5 ++-- > 6 files changed, 94 insertions(+), 36 deletions(-) > > -- > 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (4 preceding siblings ...) 2016-03-02 7:04 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Liu, Yong @ 2016-03-02 7:31 ` Wu, Jingjing 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu 6 siblings, 0 replies; 56+ messages in thread From: Wu, Jingjing @ 2016-03-02 7:31 UTC (permalink / raw) To: Sun, Xutao, dev > -----Original Message----- > From: Sun, Xutao > Sent: Tuesday, March 01, 2016 4:41 PM > To: dev@dpdk.org > Cc: Wu, Jingjing; Zhang, Helin > Subject: [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e > > This patch set adds tunnel filter support for IP in GRE on i40e. > > v2 changes: > Fix the byte order problem. > > v3 changes: > Remove the deprecation notice and update the release notes. > > v4 changes: > Modify the mistakes in cmdline.c in the old patch. > > v5 changes: > Fix type errors and update the testpmd documentation. > > v6 changes: > Use internal variables to convert byte order. > > v7 changes: > Modify the mistakes of code style. > > Xutao Sun (4): > lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure > lib/ether: add IP in GRE type > driver/i40e: implement tunnel filter for IP in GRE > app/test-pmd: test tunnel filter for IP in GRE > > app/test-pmd/cmdline.c | 38 ++++++++++++++++-------- > doc/guides/rel_notes/deprecation.rst | 5 ---- > doc/guides/rel_notes/release_16_04.rst | 2 ++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 > ++++++++++++++++++++-- > drivers/net/i40e/i40e_ethdev.c | 45 +++++++++++++++++++---------- > lib/librte_ether/rte_eth_ctrl.h | 5 ++-- > 6 files changed, 94 insertions(+), 36 deletions(-) > Acked-by: Jingjing Wu <jingjing.wu@intel.com> > -- > 1.9.3 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v8 0/4] This patch set adds tunnel filter support for IP in GRE on i40e. 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun ` (5 preceding siblings ...) 2016-03-02 7:31 ` Wu, Jingjing @ 2016-03-10 3:05 ` Jingjing Wu 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Jingjing Wu ` (4 more replies) 6 siblings, 5 replies; 56+ messages in thread From: Jingjing Wu @ 2016-03-10 3:05 UTC (permalink / raw) To: thomas.monjalon; +Cc: dev From: Xutao Sun <xutao.sun@intel.com> v2 changes: Fix the byte order problem. v3 changes: Remove the deprecation notice and update the release notes. v4 changes: Modify the mistakes in cmdline.c in the old patch. v5 changes: Fix type errors and update the testpmd documentation. v6 changes: Use internal variables to convert byte order. v7 changes: Modify the mistakes of code style. v8 changes: Fix API change in release note. Xutao Sun (4): lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure lib/ether: add IP in GRE type driver/i40e: implement tunnel filter for IP in GRE app/test-pmd: test tunnel filter for IP in GRE app/test-pmd/cmdline.c | 38 ++++++++++++++++-------- doc/guides/rel_notes/deprecation.rst | 5 ---- doc/guides/rel_notes/release_16_04.rst | 4 +++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 ++++++++++++++++++++-- drivers/net/i40e/i40e_ethdev.c | 45 +++++++++++++++++++---------- lib/librte_ether/rte_eth_ctrl.h | 5 ++-- 6 files changed, 96 insertions(+), 36 deletions(-) -- 2.4.0 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu @ 2016-03-10 3:05 ` Jingjing Wu 2016-03-13 12:01 ` Thomas Monjalon 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 2/4] lib/ether: add IP in GRE type Jingjing Wu ` (3 subsequent siblings) 4 siblings, 1 reply; 56+ messages in thread From: Jingjing Wu @ 2016-03-10 3:05 UTC (permalink / raw) To: thomas.monjalon; +Cc: dev From: Xutao Sun <xutao.sun@intel.com> Change the fields of outer_mac and inner_mac in struct rte_eth_tunnel_filter_conf from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 6 ++++-- doc/guides/rel_notes/deprecation.rst | 5 ----- doc/guides/rel_notes/release_16_04.rst | 4 ++++ drivers/net/i40e/i40e_ethdev.c | 12 ++++++------ lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 81ba2bd..5104301 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6628,8 +6628,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; - tunnel_filter_conf.outer_mac = &res->outer_mac; - tunnel_filter_conf.inner_mac = &res->inner_mac; + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index f033bbc..a2017f1 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -34,10 +34,5 @@ Deprecation Notices RTE_ETH_FLOW_MAX. The release 2.2 does not contain these ABI changes, but release 2.3 will. -* ABI changes are planned for rte_eth_tunnel_filter_conf. Change the fields - of outer_mac and inner_mac from pointer to struct in order to keep the - code's readability. The release 2.2 does not contain these ABI changes, but - release 2.3 will, and no backwards compatibility is planned. - * The scheduler statistics structure will change to allow keeping track of RED actions. diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index aa9eabc..3211747 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -162,6 +162,10 @@ This section should contain API changes. Sample format: handlers are updated: the pipeline parameter is added, the packets mask parameter has been either removed or made input-only. +* The ``outer_mac`` and ``inner_mac`` fields in structure + ``rte_eth_tunnel_filter_conf`` are changed from pointer to struct in order + to keep code's readability. + ABI Changes ----------- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 7e68c61..127ed72 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5839,10 +5839,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, - sizeof(struct ether_addr)); - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, - sizeof(struct ether_addr)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6142,13 +6142,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(filter->outer_mac))) { + (is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(filter->inner_mac))) { + (is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index d433e0b..736cfc1 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr *outer_mac; /**< Outer MAC address filter. */ - struct ether_addr *inner_mac; /**< Inner MAC address filter. */ + struct ether_addr outer_mac; /**< Outer MAC address filter. */ + struct ether_addr inner_mac; /**< Inner MAC address filter. */ uint16_t inner_vlan; /**< Inner VLAN filter. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ union { -- 2.4.0 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Jingjing Wu @ 2016-03-13 12:01 ` Thomas Monjalon 0 siblings, 0 replies; 56+ messages in thread From: Thomas Monjalon @ 2016-03-13 12:01 UTC (permalink / raw) To: Jingjing Wu, xutao.sun; +Cc: dev, helin.zhang, Jijiang Liu 2016-03-10 11:05, Jingjing Wu: > From: Xutao Sun <xutao.sun@intel.com> > > Change the fields of outer_mac and inner_mac in struct > rte_eth_tunnel_filter_conf from pointer to struct in order to > keep the code's readability. It breaks compilation of examples/tep_termination. > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -6628,8 +6628,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, > struct rte_eth_tunnel_filter_conf tunnel_filter_conf; > int ret = 0; > > - tunnel_filter_conf.outer_mac = &res->outer_mac; > - tunnel_filter_conf.inner_mac = &res->inner_mac; > + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, > + ETHER_ADDR_LEN); > + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, > + ETHER_ADDR_LEN); Please use ether_addr_copy(). > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -5839,10 +5839,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, > } > pfilter = cld_filter; > > - (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac, > - sizeof(struct ether_addr)); > - (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac, > - sizeof(struct ether_addr)); > + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, > + ETHER_ADDR_LEN); > + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, > + ETHER_ADDR_LEN); As already commented in January, please stop this useless return cast. There is a dedicated function to copy MAC addresses: ether_addr_copy() ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v8 2/4] lib/ether: add IP in GRE type 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Jingjing Wu @ 2016-03-10 3:06 ` Jingjing Wu 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 3/4] driver/i40e: implement tunnel filter for IP in GRE Jingjing Wu ` (2 subsequent siblings) 4 siblings, 0 replies; 56+ messages in thread From: Jingjing Wu @ 2016-03-10 3:06 UTC (permalink / raw) To: thomas.monjalon; +Cc: dev From: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 736cfc1..70635e9 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -244,6 +244,7 @@ enum rte_eth_tunnel_type { RTE_TUNNEL_TYPE_GENEVE, RTE_TUNNEL_TYPE_TEREDO, RTE_TUNNEL_TYPE_NVGRE, + RTE_TUNNEL_TYPE_IP_IN_GRE, RTE_TUNNEL_TYPE_MAX, }; -- 2.4.0 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v8 3/4] driver/i40e: implement tunnel filter for IP in GRE 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Jingjing Wu 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 2/4] lib/ether: add IP in GRE type Jingjing Wu @ 2016-03-10 3:06 ` Jingjing Wu 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 4/4] app/test-pmd: test " Jingjing Wu 2016-03-13 14:18 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds tunnel filter support for IP in GRE on i40e Thomas Monjalon 4 siblings, 0 replies; 56+ messages in thread From: Jingjing Wu @ 2016-03-10 3:06 UTC (permalink / raw) To: thomas.monjalon; +Cc: dev From: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- drivers/net/i40e/i40e_ethdev.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 127ed72..3b9bf77 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5808,6 +5808,12 @@ i40e_dev_get_filter_type(uint16_t filter_type, uint16_t *flag) case ETH_TUNNEL_FILTER_IMAC: *flag = I40E_AQC_ADD_CLOUD_FILTER_IMAC; break; + case ETH_TUNNEL_FILTER_OIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_OIP; + break; + case ETH_TUNNEL_FILTER_IIP: + *flag = I40E_AQC_ADD_CLOUD_FILTER_IIP; + break; default: PMD_DRV_LOG(ERR, "invalid tunnel filter type"); return -EINVAL; @@ -5822,7 +5828,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, uint8_t add) { uint16_t ip_type; - uint8_t tun_type = 0; + uint8_t i, tun_type = 0; + /* internal varialbe to convert ipv6 byte order */ + uint32_t convert_ipv6[4]; int val, ret = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); struct i40e_vsi *vsi = pf->main_vsi; @@ -5844,16 +5852,19 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, ETHER_ADDR_LEN); - pfilter->inner_vlan = tunnel_filter->inner_vlan; + pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; (void)rte_memcpy(&pfilter->ipaddr.v4.data, - &tunnel_filter->ip_addr, + &rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr), sizeof(pfilter->ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; - (void)rte_memcpy(&pfilter->ipaddr.v6.data, - &tunnel_filter->ip_addr, + for (i = 0; i < 4; i++) { + convert_ipv6[i] = + rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]); + } + (void)rte_memcpy(&pfilter->ipaddr.v6.data, &convert_ipv6, sizeof(pfilter->ipaddr.v6.data)); } @@ -5865,6 +5876,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, case RTE_TUNNEL_TYPE_NVGRE: tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC; break; + case RTE_TUNNEL_TYPE_IP_IN_GRE: + tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP; + break; default: /* Other tunnel types is not supported. */ PMD_DRV_LOG(ERR, "tunnel type is not supported."); @@ -5879,10 +5893,11 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, return -EINVAL; } - pfilter->flags |= I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | ip_type | - (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT); - pfilter->tenant_id = tunnel_filter->tenant_id; - pfilter->queue_number = tunnel_filter->queue_id; + pfilter->flags |= rte_cpu_to_le_16( + I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | + ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); + pfilter->tenant_id = rte_cpu_to_le_32(tunnel_filter->tenant_id); + pfilter->queue_number = rte_cpu_to_le_16(tunnel_filter->queue_id); if (add) ret = i40e_aq_add_cloud_filters(hw, vsi->seid, cld_filter, 1); -- 2.4.0 ^ permalink raw reply [flat|nested] 56+ messages in thread
* [dpdk-dev] [PATCH v8 4/4] app/test-pmd: test tunnel filter for IP in GRE 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu ` (2 preceding siblings ...) 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 3/4] driver/i40e: implement tunnel filter for IP in GRE Jingjing Wu @ 2016-03-10 3:06 ` Jingjing Wu 2016-03-13 14:18 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds tunnel filter support for IP in GRE on i40e Thomas Monjalon 4 siblings, 0 replies; 56+ messages in thread From: Jingjing Wu @ 2016-03-10 3:06 UTC (permalink / raw) To: thomas.monjalon; +Cc: dev From: Xutao Sun <xutao.sun@intel.com> This patch added some options in tunnel_filter command to test IP in GRE packet classification on i40e. Update the testpmd documentation. Signed-off-by: Xutao Sun <xutao.sun@intel.com> Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> --- app/test-pmd/cmdline.c | 32 +++++++++++++++++--------- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 +++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 5104301..0c793fa 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -302,11 +302,13 @@ static void cmd_help_long_parsed(void *parsed_result, " a port\n\n" "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6628,6 +6630,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6636,12 +6640,14 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (res->ip_value.family == AF_INET) { tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; + rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4; } else { - memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), - sizeof(struct in6_addr)); + int i; + for (i = 0; i < 4; i++) { + tunnel_filter_conf.ip_addr.ipv6_addr[i] = + rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); + } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } @@ -6657,6 +6663,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6666,6 +6676,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6711,11 +6723,11 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6729,8 +6741,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a520cc5..3ee629a 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -553,7 +553,37 @@ tunnel_filter add Add a tunnel filter on a port:: testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) + +The available information categories are: + +* ``vxlan``: Set tunnel type as VXLAN. + +* ``nvgre``: Set tunnel type as NVGRE. + +* ``ipingre``: Set tunnel type as IP-in-GRE. + +* ``imac-ivlan``: Set filter type as Inner MAC and VLAN. + +* ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID. + +* ``imac-tenid``: Set filter type as Inner MAC and tenant ID. + +* ``imac``: Set filter type as Inner MAC. + +* ``omac-imac-tenid``: Set filter type as Outer MAC, Inner MAC and tenant ID. + +* ``oip``: Set filter type as Outer IP. + +* ``iip``: Set filter type as Inner IP. + +Example:: + + testpmd> tunnel_filter add 0 68:05:CA:28:09:82 00:00:00:00:00:00 \ + 192.168.2.2 0 ipingre oip 1 1 + + Set an IP-in-GRE tunnel on port 0, and the filter type is Outer IP. tunnel_filter remove ~~~~~~~~~~~~~~~~~~~~ @@ -561,7 +591,8 @@ tunnel_filter remove Remove a tunnel filter on a port:: testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) rx_vxlan_port add ~~~~~~~~~~~~~~~~~ -- 2.4.0 ^ permalink raw reply [flat|nested] 56+ messages in thread
* Re: [dpdk-dev] [PATCH v8 0/4] This patch set adds tunnel filter support for IP in GRE on i40e. 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu ` (3 preceding siblings ...) 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 4/4] app/test-pmd: test " Jingjing Wu @ 2016-03-13 14:18 ` Thomas Monjalon 4 siblings, 0 replies; 56+ messages in thread From: Thomas Monjalon @ 2016-03-13 14:18 UTC (permalink / raw) To: Jingjing Wu, xutao.sun; +Cc: dev, helin.zhang 2016-03-10 11:05, Jingjing Wu: > Xutao Sun (4): > lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure > lib/ether: add IP in GRE type > driver/i40e: implement tunnel filter for IP in GRE > app/test-pmd: test tunnel filter for IP in GRE I've done the changes for ether_addr_copy and fixed tep_termination. Applied, thanks ^ permalink raw reply [flat|nested] 56+ messages in thread
end of thread, other threads:[~2016-03-13 14:19 UTC | newest] Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-01-25 7:25 [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 2/4] lib/ether: add IP in GRE type Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun 2016-01-25 7:25 ` [dpdk-dev] [PATCH 4/4] app/test-pmd: test " Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-01-28 8:21 ` Thomas Monjalon 2016-01-28 9:05 ` Sun, Xutao 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 2/4] lib/ether: add IP in GRE type Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun 2016-01-28 7:30 ` [dpdk-dev] [PATCH v2 4/4] app/test-pmd: test " Xutao Sun [not found] ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com> 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 2/4] lib/ether: add IP in GRE type Xutao Sun 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun 2016-01-28 10:26 ` [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test " Xutao Sun 2016-02-12 13:46 ` De Lara Guarch, Pablo 2016-02-18 7:19 ` Sun, Xutao 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 2/4] lib/ether: add IP in GRE type Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun 2016-02-18 9:58 ` [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test " Xutao Sun 2016-02-18 12:16 ` De Lara Guarch, Pablo 2016-02-19 2:40 ` Sun, Xutao 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-02-25 1:22 ` Wu, Jingjing 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 2/4] lib/ether: add IP in GRE type Xutao Sun 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun 2016-02-25 1:50 ` Wu, Jingjing 2016-02-19 7:31 ` [dpdk-dev] [PATCH v5 4/4] app/test-pmd: test " Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-03-01 8:53 ` Panu Matilainen 2016-03-02 3:10 ` Sun, Xutao 2016-03-02 7:12 ` Panu Matilainen 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 2/4] lib/ether: add IP in GRE type Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun 2016-03-01 3:47 ` [dpdk-dev] [PATCH v6 4/4] app/test-pmd: test " Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun 2016-03-08 23:08 ` Thomas Monjalon 2016-03-08 23:20 ` Thomas Monjalon 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 2/4] lib/ether: add IP in GRE type Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun 2016-03-01 8:41 ` [dpdk-dev] [PATCH v7 4/4] app/test-pmd: test " Xutao Sun 2016-03-02 7:04 ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Liu, Yong 2016-03-02 7:31 ` Wu, Jingjing 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu 2016-03-10 3:05 ` [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Jingjing Wu 2016-03-13 12:01 ` Thomas Monjalon 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 2/4] lib/ether: add IP in GRE type Jingjing Wu 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 3/4] driver/i40e: implement tunnel filter for IP in GRE Jingjing Wu 2016-03-10 3:06 ` [dpdk-dev] [PATCH v8 4/4] app/test-pmd: test " Jingjing Wu 2016-03-13 14:18 ` [dpdk-dev] [PATCH v8 0/4] This patch set adds tunnel filter support for IP in GRE on i40e Thomas Monjalon
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).