* [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support @ 2019-04-14 11:11 viveksharma 2019-04-14 11:11 ` viveksharma ` (2 more replies) 0 siblings, 3 replies; 24+ messages in thread From: viveksharma @ 2019-04-14 11:11 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, arybchenko, Vivek Sharma, stable From: Vivek Sharma <viveksharma@marvell.com> Enable missing support for QinQ strip rx offload in vlan offload set/get methods. Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") Cc: stable@dpdk.org Signed-off-by: Vivek Sharma <viveksharma@marvell.com> --- lib/librte_ethdev/rte_ethdev.c | 17 +++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 243beb4..222df4e 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2770,6 +2770,19 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) mask |= ETH_VLAN_EXTEND_MASK; } + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); + org = !!(dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_QINQ_STRIP); + if (cur != org) { + if (cur) + dev->data->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_QINQ_STRIP; + else + dev->data->dev_conf.rxmode.offloads &= + ~DEV_RX_OFFLOAD_QINQ_STRIP; + mask |= ETH_QINQ_STRIP_MASK; + } + /*no change*/ if (mask == 0) return ret; @@ -2805,6 +2818,10 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) DEV_RX_OFFLOAD_VLAN_EXTEND) ret |= ETH_VLAN_EXTEND_OFFLOAD; + if (dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_QINQ_STRIP) + ret |= DEV_RX_OFFLOAD_QINQ_STRIP; + return ret; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 40a068f..c1792f4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ /* Definitions used for mask VLAN setting */ #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ /* Definitions used for receive MAC address */ @@ -965,7 +967,8 @@ struct rte_eth_conf { DEV_RX_OFFLOAD_TCP_CKSUM) #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_VLAN_EXTEND) + DEV_RX_OFFLOAD_VLAN_EXTEND | \ + DEV_RX_OFFLOAD_QINQ_STRIP) /* * If new Rx offload capabilities are defined, they also must be -- 2.7.4 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support 2019-04-14 11:11 [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support viveksharma @ 2019-04-14 11:11 ` viveksharma 2019-04-15 15:54 ` Stephen Hemminger 2019-04-17 7:40 ` [dpdk-dev] [PATCH v2] " viveksharma 2 siblings, 0 replies; 24+ messages in thread From: viveksharma @ 2019-04-14 11:11 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, arybchenko, Vivek Sharma, stable From: Vivek Sharma <viveksharma@marvell.com> Enable missing support for QinQ strip rx offload in vlan offload set/get methods. Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") Cc: stable@dpdk.org Signed-off-by: Vivek Sharma <viveksharma@marvell.com> --- lib/librte_ethdev/rte_ethdev.c | 17 +++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 243beb4..222df4e 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2770,6 +2770,19 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) mask |= ETH_VLAN_EXTEND_MASK; } + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); + org = !!(dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_QINQ_STRIP); + if (cur != org) { + if (cur) + dev->data->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_QINQ_STRIP; + else + dev->data->dev_conf.rxmode.offloads &= + ~DEV_RX_OFFLOAD_QINQ_STRIP; + mask |= ETH_QINQ_STRIP_MASK; + } + /*no change*/ if (mask == 0) return ret; @@ -2805,6 +2818,10 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) DEV_RX_OFFLOAD_VLAN_EXTEND) ret |= ETH_VLAN_EXTEND_OFFLOAD; + if (dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_QINQ_STRIP) + ret |= DEV_RX_OFFLOAD_QINQ_STRIP; + return ret; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 40a068f..c1792f4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ /* Definitions used for mask VLAN setting */ #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ /* Definitions used for receive MAC address */ @@ -965,7 +967,8 @@ struct rte_eth_conf { DEV_RX_OFFLOAD_TCP_CKSUM) #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_VLAN_EXTEND) + DEV_RX_OFFLOAD_VLAN_EXTEND | \ + DEV_RX_OFFLOAD_QINQ_STRIP) /* * If new Rx offload capabilities are defined, they also must be -- 2.7.4 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support 2019-04-14 11:11 [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support viveksharma 2019-04-14 11:11 ` viveksharma @ 2019-04-15 15:54 ` Stephen Hemminger 2019-04-15 15:54 ` Stephen Hemminger 2019-04-15 21:33 ` Rami Rosen 2019-04-17 7:40 ` [dpdk-dev] [PATCH v2] " viveksharma 2 siblings, 2 replies; 24+ messages in thread From: Stephen Hemminger @ 2019-04-15 15:54 UTC (permalink / raw) To: viveksharma; +Cc: dev, thomas, ferruh.yigit, arybchenko, stable On Sun, 14 Apr 2019 16:41:42 +0530 <viveksharma@marvell.com> wrote: > > + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); > + org = !!(dev->data->dev_conf.rxmode.offloads & > + DEV_RX_OFFLOAD_QINQ_STRIP); > + if (cur != org) { > + if (cur) > + dev->data->dev_conf.rxmode.offloads |= > + DEV_RX_OFFLOAD_QINQ_STRIP; > + else > + dev->data->dev_conf.rxmode.offloads &= > + ~DEV_RX_OFFLOAD_QINQ_STRIP; > + mask |= ETH_QINQ_STRIP_MASK; > + } > + > /*no change*/ Using a local (pointer) variable for dev->data->dev_conf.rxmode.offloads would make the code more readable and lines shorter. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support 2019-04-15 15:54 ` Stephen Hemminger @ 2019-04-15 15:54 ` Stephen Hemminger 2019-04-15 21:33 ` Rami Rosen 1 sibling, 0 replies; 24+ messages in thread From: Stephen Hemminger @ 2019-04-15 15:54 UTC (permalink / raw) To: viveksharma; +Cc: dev, thomas, ferruh.yigit, arybchenko, stable On Sun, 14 Apr 2019 16:41:42 +0530 <viveksharma@marvell.com> wrote: > > + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); > + org = !!(dev->data->dev_conf.rxmode.offloads & > + DEV_RX_OFFLOAD_QINQ_STRIP); > + if (cur != org) { > + if (cur) > + dev->data->dev_conf.rxmode.offloads |= > + DEV_RX_OFFLOAD_QINQ_STRIP; > + else > + dev->data->dev_conf.rxmode.offloads &= > + ~DEV_RX_OFFLOAD_QINQ_STRIP; > + mask |= ETH_QINQ_STRIP_MASK; > + } > + > /*no change*/ Using a local (pointer) variable for dev->data->dev_conf.rxmode.offloads would make the code more readable and lines shorter. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support 2019-04-15 15:54 ` Stephen Hemminger 2019-04-15 15:54 ` Stephen Hemminger @ 2019-04-15 21:33 ` Rami Rosen 2019-04-15 21:33 ` Rami Rosen 1 sibling, 1 reply; 24+ messages in thread From: Rami Rosen @ 2019-04-15 21:33 UTC (permalink / raw) To: Stephen Hemminger Cc: viveksharma, dev, thomas, ferruh.yigit, arybchenko, stable >Using a local (pointer) variable for dev->data->dev_conf.rxmode.offloads >would make the code more readable and lines shorter. +1 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support 2019-04-15 21:33 ` Rami Rosen @ 2019-04-15 21:33 ` Rami Rosen 0 siblings, 0 replies; 24+ messages in thread From: Rami Rosen @ 2019-04-15 21:33 UTC (permalink / raw) To: Stephen Hemminger Cc: viveksharma, dev, thomas, ferruh.yigit, arybchenko, stable >Using a local (pointer) variable for dev->data->dev_conf.rxmode.offloads >would make the code more readable and lines shorter. +1 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-14 11:11 [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support viveksharma 2019-04-14 11:11 ` viveksharma 2019-04-15 15:54 ` Stephen Hemminger @ 2019-04-17 7:40 ` viveksharma 2019-04-17 7:40 ` viveksharma ` (2 more replies) 2 siblings, 3 replies; 24+ messages in thread From: viveksharma @ 2019-04-17 7:40 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, arybchenko, Vivek Sharma, stable From: Vivek Sharma <viveksharma@marvell.com> Enable missing support for QinQ strip rx offload in vlan offload set/get methods. Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") Cc: stable@dpdk.org Signed-off-by: Vivek Sharma <viveksharma@marvell.com> --- v2: * Use pointer to dereference dev->data->dev_conf.rxmode.offloads lib/librte_ethdev/rte_ethdev.c | 55 +++++++++++++++++++++++------------------- lib/librte_ethdev/rte_ethdev.h | 5 +++- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 243beb4..3e770bc 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2723,53 +2723,56 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) int mask = 0; int cur, org = 0; uint64_t orig_offloads; + uint64_t *dev_offloads; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; /* save original values in case of failure */ orig_offloads = dev->data->dev_conf.rxmode.offloads; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; /*check which option changed by application*/ cur = !!(offload_mask & ETH_VLAN_STRIP_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; mask |= ETH_VLAN_STRIP_MASK; } cur = !!(offload_mask & ETH_VLAN_FILTER_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; mask |= ETH_VLAN_FILTER_MASK; } cur = !!(offload_mask & ETH_VLAN_EXTEND_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; mask |= ETH_VLAN_EXTEND_MASK; } + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP); + if (cur != org) { + if (cur) + *dev_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP; + else + *dev_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP; + mask |= ETH_QINQ_STRIP_MASK; + } + /*no change*/ if (mask == 0) return ret; @@ -2778,7 +2781,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) ret = (*dev->dev_ops->vlan_offload_set)(dev, mask); if (ret) { /* hit an error restore original values */ - dev->data->dev_conf.rxmode.offloads = orig_offloads; + *dev_offloads = orig_offloads; } return eth_err(port_id, ret); @@ -2788,23 +2791,25 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; + uint64_t *dev_offloads; int ret = 0; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) ret |= ETH_VLAN_STRIP_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) ret |= ETH_VLAN_FILTER_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND) ret |= ETH_VLAN_EXTEND_OFFLOAD; + if (*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP) + ret |= DEV_RX_OFFLOAD_QINQ_STRIP; + return ret; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 40a068f..c1792f4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ /* Definitions used for mask VLAN setting */ #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ /* Definitions used for receive MAC address */ @@ -965,7 +967,8 @@ struct rte_eth_conf { DEV_RX_OFFLOAD_TCP_CKSUM) #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_VLAN_EXTEND) + DEV_RX_OFFLOAD_VLAN_EXTEND | \ + DEV_RX_OFFLOAD_QINQ_STRIP) /* * If new Rx offload capabilities are defined, they also must be -- 2.7.4 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-17 7:40 ` [dpdk-dev] [PATCH v2] " viveksharma @ 2019-04-17 7:40 ` viveksharma 2019-04-17 8:34 ` Thomas Monjalon 2019-04-19 5:59 ` [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration viveksharma 2 siblings, 0 replies; 24+ messages in thread From: viveksharma @ 2019-04-17 7:40 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, arybchenko, Vivek Sharma, stable From: Vivek Sharma <viveksharma@marvell.com> Enable missing support for QinQ strip rx offload in vlan offload set/get methods. Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") Cc: stable@dpdk.org Signed-off-by: Vivek Sharma <viveksharma@marvell.com> --- v2: * Use pointer to dereference dev->data->dev_conf.rxmode.offloads lib/librte_ethdev/rte_ethdev.c | 55 +++++++++++++++++++++++------------------- lib/librte_ethdev/rte_ethdev.h | 5 +++- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 243beb4..3e770bc 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2723,53 +2723,56 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) int mask = 0; int cur, org = 0; uint64_t orig_offloads; + uint64_t *dev_offloads; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; /* save original values in case of failure */ orig_offloads = dev->data->dev_conf.rxmode.offloads; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; /*check which option changed by application*/ cur = !!(offload_mask & ETH_VLAN_STRIP_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; mask |= ETH_VLAN_STRIP_MASK; } cur = !!(offload_mask & ETH_VLAN_FILTER_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; mask |= ETH_VLAN_FILTER_MASK; } cur = !!(offload_mask & ETH_VLAN_EXTEND_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; mask |= ETH_VLAN_EXTEND_MASK; } + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP); + if (cur != org) { + if (cur) + *dev_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP; + else + *dev_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP; + mask |= ETH_QINQ_STRIP_MASK; + } + /*no change*/ if (mask == 0) return ret; @@ -2778,7 +2781,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) ret = (*dev->dev_ops->vlan_offload_set)(dev, mask); if (ret) { /* hit an error restore original values */ - dev->data->dev_conf.rxmode.offloads = orig_offloads; + *dev_offloads = orig_offloads; } return eth_err(port_id, ret); @@ -2788,23 +2791,25 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; + uint64_t *dev_offloads; int ret = 0; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) ret |= ETH_VLAN_STRIP_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) ret |= ETH_VLAN_FILTER_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND) ret |= ETH_VLAN_EXTEND_OFFLOAD; + if (*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP) + ret |= DEV_RX_OFFLOAD_QINQ_STRIP; + return ret; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 40a068f..c1792f4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ /* Definitions used for mask VLAN setting */ #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ /* Definitions used for receive MAC address */ @@ -965,7 +967,8 @@ struct rte_eth_conf { DEV_RX_OFFLOAD_TCP_CKSUM) #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_VLAN_EXTEND) + DEV_RX_OFFLOAD_VLAN_EXTEND | \ + DEV_RX_OFFLOAD_QINQ_STRIP) /* * If new Rx offload capabilities are defined, they also must be -- 2.7.4 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-17 7:40 ` [dpdk-dev] [PATCH v2] " viveksharma 2019-04-17 7:40 ` viveksharma @ 2019-04-17 8:34 ` Thomas Monjalon 2019-04-17 8:34 ` Thomas Monjalon 2019-04-18 7:38 ` [dpdk-dev] [EXT] " Vivek Kumar Sharma 2019-04-19 5:59 ` [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration viveksharma 2 siblings, 2 replies; 24+ messages in thread From: Thomas Monjalon @ 2019-04-17 8:34 UTC (permalink / raw) To: viveksharma; +Cc: dev, ferruh.yigit, arybchenko, stable 17/04/2019 09:40, viveksharma@marvell.com: > From: Vivek Sharma <viveksharma@marvell.com> > > Enable missing support for QinQ strip rx offload > in vlan offload set/get methods. > > Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") > Cc: stable@dpdk.org Not sure it is a fix. The commit mentioned above allows some kind of offload config. You are extending the offload config with support in rte_eth_dev_set_vlan_offload(). ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-17 8:34 ` Thomas Monjalon @ 2019-04-17 8:34 ` Thomas Monjalon 2019-04-18 7:38 ` [dpdk-dev] [EXT] " Vivek Kumar Sharma 1 sibling, 0 replies; 24+ messages in thread From: Thomas Monjalon @ 2019-04-17 8:34 UTC (permalink / raw) To: viveksharma; +Cc: dev, ferruh.yigit, arybchenko, stable 17/04/2019 09:40, viveksharma@marvell.com: > From: Vivek Sharma <viveksharma@marvell.com> > > Enable missing support for QinQ strip rx offload > in vlan offload set/get methods. > > Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") > Cc: stable@dpdk.org Not sure it is a fix. The commit mentioned above allows some kind of offload config. You are extending the offload config with support in rte_eth_dev_set_vlan_offload(). ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-17 8:34 ` Thomas Monjalon 2019-04-17 8:34 ` Thomas Monjalon @ 2019-04-18 7:38 ` Vivek Kumar Sharma 2019-04-18 7:38 ` Vivek Kumar Sharma 2019-04-18 8:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon 1 sibling, 2 replies; 24+ messages in thread From: Vivek Kumar Sharma @ 2019-04-18 7:38 UTC (permalink / raw) To: Thomas Monjalon Cc: dev, ferruh.yigit, arybchenko, stable, intoviveksharma, Stephen Hemminger, ramirose >> From: Vivek Sharma <viveksharma@marvell.com> >> >> Enable missing support for QinQ strip rx offload >> in vlan offload set/get methods. >> >> Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") >> Cc: stable@dpdk.org >Not sure it is a fix. >The commit mentioned above allows some kind of offload config. >You are extending the offload config with support in >rte_eth_dev_set_vlan_offload(). DEV_RX_OFFLOAD_QINQ_STRIP was introduced in cc9d0456b870 ("i40e: support double vlan stripping and insertion"). But, the means to utilize this capability by enabling this rx offload for an ethdev was missing from the patch. The current patch fixes that missing functionality so that user can enable QinQ strip rx offload for capable devices. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-18 7:38 ` [dpdk-dev] [EXT] " Vivek Kumar Sharma @ 2019-04-18 7:38 ` Vivek Kumar Sharma 2019-04-18 8:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon 1 sibling, 0 replies; 24+ messages in thread From: Vivek Kumar Sharma @ 2019-04-18 7:38 UTC (permalink / raw) To: Thomas Monjalon Cc: dev, ferruh.yigit, arybchenko, stable, intoviveksharma, Stephen Hemminger, ramirose >> From: Vivek Sharma <viveksharma@marvell.com> >> >> Enable missing support for QinQ strip rx offload >> in vlan offload set/get methods. >> >> Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") >> Cc: stable@dpdk.org >Not sure it is a fix. >The commit mentioned above allows some kind of offload config. >You are extending the offload config with support in >rte_eth_dev_set_vlan_offload(). DEV_RX_OFFLOAD_QINQ_STRIP was introduced in cc9d0456b870 ("i40e: support double vlan stripping and insertion"). But, the means to utilize this capability by enabling this rx offload for an ethdev was missing from the patch. The current patch fixes that missing functionality so that user can enable QinQ strip rx offload for capable devices. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [EXT] Re: [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-18 7:38 ` [dpdk-dev] [EXT] " Vivek Kumar Sharma 2019-04-18 7:38 ` Vivek Kumar Sharma @ 2019-04-18 8:07 ` Thomas Monjalon 2019-04-18 8:07 ` Thomas Monjalon 1 sibling, 1 reply; 24+ messages in thread From: Thomas Monjalon @ 2019-04-18 8:07 UTC (permalink / raw) To: Vivek Kumar Sharma Cc: stable, dev, ferruh.yigit, arybchenko, intoviveksharma, Stephen Hemminger, ramirose 18/04/2019 09:38, Vivek Kumar Sharma: > >> From: Vivek Sharma <viveksharma@marvell.com> > >> > >> Enable missing support for QinQ strip rx offload > >> in vlan offload set/get methods. > >> > >> Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") > >> Cc: stable@dpdk.org > > >Not sure it is a fix. > >The commit mentioned above allows some kind of offload config. > >You are extending the offload config with support in > >rte_eth_dev_set_vlan_offload(). > > DEV_RX_OFFLOAD_QINQ_STRIP was introduced in cc9d0456b870 ("i40e: support double vlan stripping and insertion"). But, the means to utilize this capability by enabling this rx offload for an ethdev was missing from the patch. The current patch fixes that missing functionality so that user can enable QinQ strip rx offload for capable devices. It was possible to utilize the offload by setting the flag in mbuf. You are adding a way to configure it at port level. So it is not a fix. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [EXT] Re: [PATCH v2] ethdev: fix QinQ strip offload support 2019-04-18 8:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon @ 2019-04-18 8:07 ` Thomas Monjalon 0 siblings, 0 replies; 24+ messages in thread From: Thomas Monjalon @ 2019-04-18 8:07 UTC (permalink / raw) To: Vivek Kumar Sharma Cc: stable, dev, ferruh.yigit, arybchenko, intoviveksharma, Stephen Hemminger, ramirose 18/04/2019 09:38, Vivek Kumar Sharma: > >> From: Vivek Sharma <viveksharma@marvell.com> > >> > >> Enable missing support for QinQ strip rx offload > >> in vlan offload set/get methods. > >> > >> Fixes: cc9d0456b870 ("i40e: support double vlan stripping and insertion") > >> Cc: stable@dpdk.org > > >Not sure it is a fix. > >The commit mentioned above allows some kind of offload config. > >You are extending the offload config with support in > >rte_eth_dev_set_vlan_offload(). > > DEV_RX_OFFLOAD_QINQ_STRIP was introduced in cc9d0456b870 ("i40e: support double vlan stripping and insertion"). But, the means to utilize this capability by enabling this rx offload for an ethdev was missing from the patch. The current patch fixes that missing functionality so that user can enable QinQ strip rx offload for capable devices. It was possible to utilize the offload by setting the flag in mbuf. You are adding a way to configure it at port level. So it is not a fix. ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration 2019-04-17 7:40 ` [dpdk-dev] [PATCH v2] " viveksharma 2019-04-17 7:40 ` viveksharma 2019-04-17 8:34 ` Thomas Monjalon @ 2019-04-19 5:59 ` viveksharma 2019-04-19 5:59 ` viveksharma ` (2 more replies) 2 siblings, 3 replies; 24+ messages in thread From: viveksharma @ 2019-04-19 5:59 UTC (permalink / raw) To: dev Cc: intoviveksharma, thomas, ferruh.yigit, arybchenko, stephen, ramirose, Vivek Sharma From: Vivek Sharma <viveksharma@marvell.com> Enable missing support for runtime configuration (setting/getting) of QinQ strip rx offload for a given ethdev. Signed-off-by: Vivek Sharma <viveksharma@marvell.com> --- v3: * Make patch as 'non-fix'. v2: * Use pointer to dereference dev->data->dev_conf.rxmode.offloads. lib/librte_ethdev/rte_ethdev.c | 55 +++++++++++++++++++++++------------------- lib/librte_ethdev/rte_ethdev.h | 5 +++- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 243beb4..3e770bc 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2723,53 +2723,56 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) int mask = 0; int cur, org = 0; uint64_t orig_offloads; + uint64_t *dev_offloads; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; /* save original values in case of failure */ orig_offloads = dev->data->dev_conf.rxmode.offloads; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; /*check which option changed by application*/ cur = !!(offload_mask & ETH_VLAN_STRIP_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; mask |= ETH_VLAN_STRIP_MASK; } cur = !!(offload_mask & ETH_VLAN_FILTER_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; mask |= ETH_VLAN_FILTER_MASK; } cur = !!(offload_mask & ETH_VLAN_EXTEND_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; mask |= ETH_VLAN_EXTEND_MASK; } + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP); + if (cur != org) { + if (cur) + *dev_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP; + else + *dev_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP; + mask |= ETH_QINQ_STRIP_MASK; + } + /*no change*/ if (mask == 0) return ret; @@ -2778,7 +2781,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) ret = (*dev->dev_ops->vlan_offload_set)(dev, mask); if (ret) { /* hit an error restore original values */ - dev->data->dev_conf.rxmode.offloads = orig_offloads; + *dev_offloads = orig_offloads; } return eth_err(port_id, ret); @@ -2788,23 +2791,25 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; + uint64_t *dev_offloads; int ret = 0; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) ret |= ETH_VLAN_STRIP_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) ret |= ETH_VLAN_FILTER_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND) ret |= ETH_VLAN_EXTEND_OFFLOAD; + if (*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP) + ret |= DEV_RX_OFFLOAD_QINQ_STRIP; + return ret; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 40a068f..c1792f4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ /* Definitions used for mask VLAN setting */ #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ /* Definitions used for receive MAC address */ @@ -965,7 +967,8 @@ struct rte_eth_conf { DEV_RX_OFFLOAD_TCP_CKSUM) #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_VLAN_EXTEND) + DEV_RX_OFFLOAD_VLAN_EXTEND | \ + DEV_RX_OFFLOAD_QINQ_STRIP) /* * If new Rx offload capabilities are defined, they also must be -- 2.7.4 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration 2019-04-19 5:59 ` [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration viveksharma @ 2019-04-19 5:59 ` viveksharma 2019-06-27 11:08 ` Ferruh Yigit 2019-07-02 3:37 ` [dpdk-dev] [PATCH v4] " viveksharma 2 siblings, 0 replies; 24+ messages in thread From: viveksharma @ 2019-04-19 5:59 UTC (permalink / raw) To: dev Cc: intoviveksharma, thomas, ferruh.yigit, arybchenko, stephen, ramirose, Vivek Sharma From: Vivek Sharma <viveksharma@marvell.com> Enable missing support for runtime configuration (setting/getting) of QinQ strip rx offload for a given ethdev. Signed-off-by: Vivek Sharma <viveksharma@marvell.com> --- v3: * Make patch as 'non-fix'. v2: * Use pointer to dereference dev->data->dev_conf.rxmode.offloads. lib/librte_ethdev/rte_ethdev.c | 55 +++++++++++++++++++++++------------------- lib/librte_ethdev/rte_ethdev.h | 5 +++- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 243beb4..3e770bc 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2723,53 +2723,56 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) int mask = 0; int cur, org = 0; uint64_t orig_offloads; + uint64_t *dev_offloads; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; /* save original values in case of failure */ orig_offloads = dev->data->dev_conf.rxmode.offloads; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; /*check which option changed by application*/ cur = !!(offload_mask & ETH_VLAN_STRIP_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; mask |= ETH_VLAN_STRIP_MASK; } cur = !!(offload_mask & ETH_VLAN_FILTER_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; mask |= ETH_VLAN_FILTER_MASK; } cur = !!(offload_mask & ETH_VLAN_EXTEND_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; mask |= ETH_VLAN_EXTEND_MASK; } + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP); + if (cur != org) { + if (cur) + *dev_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP; + else + *dev_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP; + mask |= ETH_QINQ_STRIP_MASK; + } + /*no change*/ if (mask == 0) return ret; @@ -2778,7 +2781,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) ret = (*dev->dev_ops->vlan_offload_set)(dev, mask); if (ret) { /* hit an error restore original values */ - dev->data->dev_conf.rxmode.offloads = orig_offloads; + *dev_offloads = orig_offloads; } return eth_err(port_id, ret); @@ -2788,23 +2791,25 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; + uint64_t *dev_offloads; int ret = 0; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) ret |= ETH_VLAN_STRIP_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) ret |= ETH_VLAN_FILTER_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND) ret |= ETH_VLAN_EXTEND_OFFLOAD; + if (*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP) + ret |= DEV_RX_OFFLOAD_QINQ_STRIP; + return ret; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 40a068f..c1792f4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ /* Definitions used for mask VLAN setting */ #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ /* Definitions used for receive MAC address */ @@ -965,7 +967,8 @@ struct rte_eth_conf { DEV_RX_OFFLOAD_TCP_CKSUM) #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_VLAN_EXTEND) + DEV_RX_OFFLOAD_VLAN_EXTEND | \ + DEV_RX_OFFLOAD_QINQ_STRIP) /* * If new Rx offload capabilities are defined, they also must be -- 2.7.4 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration 2019-04-19 5:59 ` [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration viveksharma 2019-04-19 5:59 ` viveksharma @ 2019-06-27 11:08 ` Ferruh Yigit 2019-07-01 10:07 ` Andrew Rybchenko 2019-07-02 3:37 ` [dpdk-dev] [PATCH v4] " viveksharma 2 siblings, 1 reply; 24+ messages in thread From: Ferruh Yigit @ 2019-06-27 11:08 UTC (permalink / raw) To: viveksharma, thomas, arybchenko Cc: dev, intoviveksharma, stephen, ramirose, Jerin Jacob Kollanukkaran On 4/19/2019 6:59 AM, viveksharma@marvell.com wrote: > From: Vivek Sharma <viveksharma@marvell.com> > > Enable missing support for runtime configuration (setting/getting) > of QinQ strip rx offload for a given ethdev. > > Signed-off-by: Vivek Sharma <viveksharma@marvell.com> <...> > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h > index 40a068f..c1792f4 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { > #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ > #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ > #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ > +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ > > /* Definitions used for mask VLAN setting */ > #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ > #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ > #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ > +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ > #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ On its own patch looks ok but a few high level questions: 1- Why we need this interim defines, instead of using actual offload values? Although changing this will be API/ABI breakage. 2- Why we have specific function to set vlan offloads, for other offloads the way is stop device and reconfigure it with new offload flags. 3- If devices can change offload configuration dynamically, do we need a generic API to alter the offload configs? (similar to these vlan APIs but more generic)? Related to the patch, what do you think about following options: a) - Get this patch - Send a deprecation notice for 1) in this release - Next release remove these flags, which will be practically reverse this patch and more b) - Send a deprecation notice for 1) in this release - Next release update the APIs and a smaller/different version of this patch will be required. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration 2019-06-27 11:08 ` Ferruh Yigit @ 2019-07-01 10:07 ` Andrew Rybchenko 2019-07-01 13:05 ` Ferruh Yigit 0 siblings, 1 reply; 24+ messages in thread From: Andrew Rybchenko @ 2019-07-01 10:07 UTC (permalink / raw) To: Ferruh Yigit, viveksharma, thomas Cc: dev, intoviveksharma, stephen, ramirose, Jerin Jacob Kollanukkaran On 27.06.2019 14:08, Ferruh Yigit wrote: > On 4/19/2019 6:59 AM, viveksharma@marvell.com wrote: >> From: Vivek Sharma <viveksharma@marvell.com> >> >> Enable missing support for runtime configuration (setting/getting) >> of QinQ strip rx offload for a given ethdev. >> >> Signed-off-by: Vivek Sharma <viveksharma@marvell.com> > <...> > >> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h >> index 40a068f..c1792f4 100644 >> --- a/lib/librte_ethdev/rte_ethdev.h >> +++ b/lib/librte_ethdev/rte_ethdev.h >> @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { >> #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ >> #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ >> #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ >> +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ >> >> /* Definitions used for mask VLAN setting */ >> #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ >> #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ >> #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ >> +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ >> #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ > On its own patch looks ok but a few high level questions: > > 1- Why we need this interim defines, instead of using actual offload values? > Although changing this will be API/ABI breakage. > > 2- Why we have specific function to set vlan offloads, for other offloads the > way is stop device and reconfigure it with new offload flags. > > 3- If devices can change offload configuration dynamically, do we need a generic > API to alter the offload configs? (similar to these vlan APIs but more generic)? If dynamic switching of offloads is really required, I think it would be good if it is unified. If so, we can deprecate rte_eth_dev_{s,g}et_vlan_offload() and implement it using the new one to remove the old one from driver interface at least. It requires reporting of dynamically switchable offloads on device and queue level. Or just dynamically switchable offloads in assumption that if the offload is supported on queue level and dynamically switchable, it is dynamically switchable on queue level. > Related to the patch, what do you think about following options: > a) > - Get this patch > - Send a deprecation notice for 1) in this release > - Next release remove these flags, which will be practically reverse this patch > and more > > b) > - Send a deprecation notice for 1) in this release > - Next release update the APIs and a smaller/different version of this patch > will be required. I'm OK with both options, but I think it would be fair to go (a) to avoid postponing of the feature too long. The patch itself should update rte_eth_dev_{s,g}et_vlan_offload() descriptions which enumerate switchable offloads. Andrew. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration 2019-07-01 10:07 ` Andrew Rybchenko @ 2019-07-01 13:05 ` Ferruh Yigit 0 siblings, 0 replies; 24+ messages in thread From: Ferruh Yigit @ 2019-07-01 13:05 UTC (permalink / raw) To: Andrew Rybchenko, viveksharma, thomas Cc: dev, intoviveksharma, stephen, ramirose, Jerin Jacob Kollanukkaran On 7/1/2019 11:07 AM, Andrew Rybchenko wrote: > On 27.06.2019 14:08, Ferruh Yigit wrote: >> On 4/19/2019 6:59 AM, viveksharma@marvell.com wrote: >>> From: Vivek Sharma <viveksharma@marvell.com> >>> >>> Enable missing support for runtime configuration (setting/getting) >>> of QinQ strip rx offload for a given ethdev. >>> >>> Signed-off-by: Vivek Sharma <viveksharma@marvell.com> >> <...> >> >>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h >>> index 40a068f..c1792f4 100644 >>> --- a/lib/librte_ethdev/rte_ethdev.h >>> +++ b/lib/librte_ethdev/rte_ethdev.h >>> @@ -550,11 +550,13 @@ struct rte_eth_rss_conf { >>> #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ >>> #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ >>> #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ >>> +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ >>> >>> /* Definitions used for mask VLAN setting */ >>> #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ >>> #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ >>> #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ >>> +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ >>> #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ >> On its own patch looks ok but a few high level questions: >> >> 1- Why we need this interim defines, instead of using actual offload values? >> Although changing this will be API/ABI breakage. >> >> 2- Why we have specific function to set vlan offloads, for other offloads the >> way is stop device and reconfigure it with new offload flags. >> >> 3- If devices can change offload configuration dynamically, do we need a generic >> API to alter the offload configs? (similar to these vlan APIs but more generic)? > > If dynamic switching of offloads is really required, I think it would be > good if it is unified. If so, we can deprecate > rte_eth_dev_{s,g}et_vlan_offload() and implement it using the new one > to remove the old one from driver interface at least. > It requires reporting of dynamically switchable offloads on device and > queue level. Or just dynamically switchable offloads in assumption that > if the offload is supported on queue level and dynamically switchable, > it is dynamically switchable on queue level. Not sure if "dynamic switching of offloads" required, but I agree we may need to add "dynamically switchable offload" reporting for that. > >> Related to the patch, what do you think about following options: >> a) >> - Get this patch >> - Send a deprecation notice for 1) in this release >> - Next release remove these flags, which will be practically reverse this patch >> and more >> >> b) >> - Send a deprecation notice for 1) in this release >> - Next release update the APIs and a smaller/different version of this patch >> will be required. > > I'm OK with both options, but I think it would be fair to go (a) to avoid > postponing of the feature too long. OK > > The patch itself should update rte_eth_dev_{s,g}et_vlan_offload() > descriptions which enumerate switchable offloads. +1 @Vivek, can you please send a new version with this update? ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v4] ethdev: support QinQ strip dynamic configuration 2019-04-19 5:59 ` [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration viveksharma 2019-04-19 5:59 ` viveksharma 2019-06-27 11:08 ` Ferruh Yigit @ 2019-07-02 3:37 ` viveksharma 2019-07-03 17:48 ` Ferruh Yigit 2019-07-04 9:41 ` Ferruh Yigit 2 siblings, 2 replies; 24+ messages in thread From: viveksharma @ 2019-07-02 3:37 UTC (permalink / raw) To: dev Cc: intoviveksharma, thomas, ferruh.yigit, arybchenko, stephen, ramirose, jerinj, Vivek Sharma From: Vivek Sharma <viveksharma@marvell.com> Enable missing support for runtime configuration (setting/getting) of QinQ strip rx offload for a given ethdev. Signed-off-by: Vivek Sharma <viveksharma@marvell.com> --- v4: * Update vlan offload set/get functions description. v3: * Make patch as 'non-fix'. v2: * Use pointer to dereference dev->data->dev_conf.rxmode.offloads. lib/librte_ethdev/rte_ethdev.c | 55 +++++++++++++++++++++++------------------- lib/librte_ethdev/rte_ethdev.h | 7 +++++- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 31f02ec..6419173 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2733,53 +2733,56 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) int mask = 0; int cur, org = 0; uint64_t orig_offloads; + uint64_t *dev_offloads; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; /* save original values in case of failure */ orig_offloads = dev->data->dev_conf.rxmode.offloads; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; /*check which option changed by application*/ cur = !!(offload_mask & ETH_VLAN_STRIP_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_STRIP; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; mask |= ETH_VLAN_STRIP_MASK; } cur = !!(offload_mask & ETH_VLAN_FILTER_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_FILTER; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; mask |= ETH_VLAN_FILTER_MASK; } cur = !!(offload_mask & ETH_VLAN_EXTEND_OFFLOAD); - org = !!(dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND); if (cur != org) { if (cur) - dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_EXTEND; + *dev_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; mask |= ETH_VLAN_EXTEND_MASK; } + cur = !!(offload_mask & ETH_QINQ_STRIP_OFFLOAD); + org = !!(*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP); + if (cur != org) { + if (cur) + *dev_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP; + else + *dev_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP; + mask |= ETH_QINQ_STRIP_MASK; + } + /*no change*/ if (mask == 0) return ret; @@ -2788,7 +2791,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) ret = (*dev->dev_ops->vlan_offload_set)(dev, mask); if (ret) { /* hit an error restore original values */ - dev->data->dev_conf.rxmode.offloads = orig_offloads; + *dev_offloads = orig_offloads; } return eth_err(port_id, ret); @@ -2798,23 +2801,25 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; + uint64_t *dev_offloads; int ret = 0; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + dev_offloads = &dev->data->dev_conf.rxmode.offloads; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_STRIP) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) ret |= ETH_VLAN_STRIP_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_FILTER) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) ret |= ETH_VLAN_FILTER_OFFLOAD; - if (dev->data->dev_conf.rxmode.offloads & - DEV_RX_OFFLOAD_VLAN_EXTEND) + if (*dev_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND) ret |= ETH_VLAN_EXTEND_OFFLOAD; + if (*dev_offloads & DEV_RX_OFFLOAD_QINQ_STRIP) + ret |= DEV_RX_OFFLOAD_QINQ_STRIP; + return ret; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index c852126..dc6596b 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -584,11 +584,13 @@ struct rte_eth_rss_conf { #define ETH_VLAN_STRIP_OFFLOAD 0x0001 /**< VLAN Strip On/Off */ #define ETH_VLAN_FILTER_OFFLOAD 0x0002 /**< VLAN Filter On/Off */ #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 /**< VLAN Extend On/Off */ +#define ETH_QINQ_STRIP_OFFLOAD 0x0008 /**< QINQ Strip On/Off */ /* Definitions used for mask VLAN setting */ #define ETH_VLAN_STRIP_MASK 0x0001 /**< VLAN Strip setting mask */ #define ETH_VLAN_FILTER_MASK 0x0002 /**< VLAN Filter setting mask*/ #define ETH_VLAN_EXTEND_MASK 0x0004 /**< VLAN Extend setting mask*/ +#define ETH_QINQ_STRIP_MASK 0x0008 /**< QINQ Strip setting mask */ #define ETH_VLAN_ID_MAX 0x0FFF /**< VLAN ID is in lower 12 bits*/ /* Definitions used for receive MAC address */ @@ -1017,7 +1019,8 @@ struct rte_eth_conf { DEV_RX_OFFLOAD_TCP_CKSUM) #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_VLAN_EXTEND) + DEV_RX_OFFLOAD_VLAN_EXTEND | \ + DEV_RX_OFFLOAD_QINQ_STRIP) /* * If new Rx offload capabilities are defined, they also must be @@ -2540,6 +2543,7 @@ int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, * ETH_VLAN_STRIP_OFFLOAD * ETH_VLAN_FILTER_OFFLOAD * ETH_VLAN_EXTEND_OFFLOAD + * ETH_QINQ_STRIP_OFFLOAD * @return * - (0) if successful. * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. @@ -2558,6 +2562,7 @@ int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); * ETH_VLAN_STRIP_OFFLOAD * ETH_VLAN_FILTER_OFFLOAD * ETH_VLAN_EXTEND_OFFLOAD + * ETH_QINQ_STRIP_OFFLOAD * - (-ENODEV) if *port_id* invalid. */ int rte_eth_dev_get_vlan_offload(uint16_t port_id); -- 2.7.4 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: support QinQ strip dynamic configuration 2019-07-02 3:37 ` [dpdk-dev] [PATCH v4] " viveksharma @ 2019-07-03 17:48 ` Ferruh Yigit 2019-07-03 19:55 ` Andrew Rybchenko 2019-07-04 9:41 ` Ferruh Yigit 1 sibling, 1 reply; 24+ messages in thread From: Ferruh Yigit @ 2019-07-03 17:48 UTC (permalink / raw) To: viveksharma, dev, arybchenko Cc: intoviveksharma, thomas, stephen, ramirose, jerinj On 7/2/2019 4:37 AM, viveksharma@marvell.com wrote: > From: Vivek Sharma <viveksharma@marvell.com> > > Enable missing support for runtime configuration (setting/getting) > of QinQ strip rx offload for a given ethdev. > > Signed-off-by: Vivek Sharma <viveksharma@marvell.com> Hi Andrew, As far as I understand you were OK with the patch after change, can I add your ack? ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: support QinQ strip dynamic configuration 2019-07-03 17:48 ` Ferruh Yigit @ 2019-07-03 19:55 ` Andrew Rybchenko 0 siblings, 0 replies; 24+ messages in thread From: Andrew Rybchenko @ 2019-07-03 19:55 UTC (permalink / raw) To: Ferruh Yigit, viveksharma, dev Cc: intoviveksharma, thomas, stephen, ramirose, jerinj On 03.07.2019 20:48, Ferruh Yigit wrote: > On 7/2/2019 4:37 AM, viveksharma@marvell.com wrote: >> From: Vivek Sharma <viveksharma@marvell.com> >> >> Enable missing support for runtime configuration (setting/getting) >> of QinQ strip rx offload for a given ethdev. >> >> Signed-off-by: Vivek Sharma <viveksharma@marvell.com> > Hi Andrew, > > As far as I understand you were OK with the patch after change, can I add your ack? Yes, please. I've tried to find some time to double-check consistency vs supported offloads and error reporting, but have not found time yet to do it. Let's apply and I'll keep it in mind to take a look later. Thanks, Andrew. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: support QinQ strip dynamic configuration 2019-07-02 3:37 ` [dpdk-dev] [PATCH v4] " viveksharma 2019-07-03 17:48 ` Ferruh Yigit @ 2019-07-04 9:41 ` Ferruh Yigit 2019-07-04 10:05 ` Ferruh Yigit 1 sibling, 1 reply; 24+ messages in thread From: Ferruh Yigit @ 2019-07-04 9:41 UTC (permalink / raw) To: viveksharma, dev Cc: intoviveksharma, thomas, arybchenko, stephen, ramirose, jerinj On 7/2/2019 4:37 AM, viveksharma@marvell.com wrote: > From: Vivek Sharma <viveksharma@marvell.com> > > Enable missing support for runtime configuration (setting/getting) > of QinQ strip rx offload for a given ethdev. > > Signed-off-by: Vivek Sharma <viveksharma@marvell.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: support QinQ strip dynamic configuration 2019-07-04 9:41 ` Ferruh Yigit @ 2019-07-04 10:05 ` Ferruh Yigit 0 siblings, 0 replies; 24+ messages in thread From: Ferruh Yigit @ 2019-07-04 10:05 UTC (permalink / raw) To: viveksharma, dev Cc: intoviveksharma, thomas, arybchenko, stephen, ramirose, jerinj On 7/4/2019 10:41 AM, Ferruh Yigit wrote: > On 7/2/2019 4:37 AM, viveksharma@marvell.com wrote: >> From: Vivek Sharma <viveksharma@marvell.com> >> >> Enable missing support for runtime configuration (setting/getting) >> of QinQ strip rx offload for a given ethdev. >> >> Signed-off-by: Vivek Sharma <viveksharma@marvell.com> > > Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> > > Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> > Applied to dpdk-next-net/master, thanks. (s/review/apply, wrong tag sent) ^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2019-07-04 10:05 UTC | newest] Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-04-14 11:11 [dpdk-dev] [PATCH] ethdev: fix QinQ strip offload support viveksharma 2019-04-14 11:11 ` viveksharma 2019-04-15 15:54 ` Stephen Hemminger 2019-04-15 15:54 ` Stephen Hemminger 2019-04-15 21:33 ` Rami Rosen 2019-04-15 21:33 ` Rami Rosen 2019-04-17 7:40 ` [dpdk-dev] [PATCH v2] " viveksharma 2019-04-17 7:40 ` viveksharma 2019-04-17 8:34 ` Thomas Monjalon 2019-04-17 8:34 ` Thomas Monjalon 2019-04-18 7:38 ` [dpdk-dev] [EXT] " Vivek Kumar Sharma 2019-04-18 7:38 ` Vivek Kumar Sharma 2019-04-18 8:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon 2019-04-18 8:07 ` Thomas Monjalon 2019-04-19 5:59 ` [dpdk-dev] [PATCH v3] ethdev: support QinQ strip dynamic configuration viveksharma 2019-04-19 5:59 ` viveksharma 2019-06-27 11:08 ` Ferruh Yigit 2019-07-01 10:07 ` Andrew Rybchenko 2019-07-01 13:05 ` Ferruh Yigit 2019-07-02 3:37 ` [dpdk-dev] [PATCH v4] " viveksharma 2019-07-03 17:48 ` Ferruh Yigit 2019-07-03 19:55 ` Andrew Rybchenko 2019-07-04 9:41 ` Ferruh Yigit 2019-07-04 10:05 ` Ferruh Yigit
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).