net/enic: enable GENEVE offload via VNIC configuration
PATCH 1/1 net/enic: enable GENEVE offload via VNIC configuration
The admin-configured vNIC settings (i.e. via CIMC or UCSM) now include Geneve offload. Use that setting to decide whether to enable or disable Geneve offload and remove the devarg 'geneve-opt'.
Also, the firmware now allows the driver to change the Geneve port number. So extend udp_tunnel_port_{add,del} to accept Geneve port, in addition to VXLAN.
--- doc/guides/nics/enic.rst | 32 +++--- drivers/net/enic/base/vnic_dev.c | 2 +- drivers/net/enic/base/vnic_enet.h | 1 + drivers/net/enic/enic.h | 4 +- drivers/net/enic/enic_ethdev.c | 71 +++++++------ drivers/net/enic/enic_main.c | 161 +++++++++++++++++------------- drivers/net/enic/enic_res.c | 7 +- 7 files changed, 154 insertions(+), 124 deletions(-)
doc/guides/nics/enic.rst +14 -18
@@ -294,35 +294,31 @@ inner and outer packets can be IPv4 or IPv6. RSS hash calculation, therefore queue selection, is done on inner packets. -In order to enable overlay offload, the 'Enable VXLAN' box should be checked +In order to enable overlay offload, enable VXLAN and/or Geneve on vNIC via CIMC or UCSM followed by a reboot of the server. When PMD successfully -enables overlay offload, it prints the following message on the console. +enables overlay offload, it prints one of the following messages on the console. .. code-block:: console - Overlay offload is enabled + Overlay offload is enabled (VxLAN) + Overlay offload is enabled (Geneve) + Overlay offload is enabled (VxLAN, Geneve) By default, PMD enables overlay offload if hardware supports it. To disable it, set ``devargs`` parameter ``disable-overlay=1``. For example:: -a 12:00.0,disable-overlay=1 -By default, the NIC uses 4789 as the VXLAN port. The user may change -it through ``rte_eth_dev_udp_tunnel_port_{add,delete}``. However, as -the current NIC has a single VXLAN port number, the user cannot -configure multiple port numbers. - -Geneve headers with non-zero options are not supported by default. To -use Geneve with options, update the VIC firmware to the latest version -and then set ``devargs`` parameter ``geneve-opt=1``. When Geneve with -options is enabled, flow API cannot be used as the features are -currently mutually exclusive. When this feature is successfully -enabled, PMD prints the following message. - -.. code-block:: console - - Geneve with options is enabled +By default, the NIC uses 4789 and 6081 as the VXLAN and Geneve ports, +respectively. The user may change them through +``rte_eth_dev_udp_tunnel_port_{add,delete}``. However, as the current +NIC has a single VXLAN port number and a single Geneve port number, +the user cannot configure multiple port numbers for each tunnel type. +Geneve offload support has evolved over VIC models. On older models, +Geneve offload and advanced filters are mutually exclusive. This is +enforced by UCSM and CIMC, which only allow one of the two features +to be selected at one time. Newer VIC models do not have this restriction. Ingress VLAN Rewrite --------------------
drivers/net/enic/base/vnic_dev.c +1 -1
@@ -1318,7 +1318,7 @@ int vnic_dev_capable_geneve(struct vnic_dev *vdev)int ret; ret =vnic_dev_cmd (vdev,CMD_GET_SUPP_FEATURE_VER , &a0, &a1, wait); -return ret ==0 && (a1 &FEATURE_GENEVE_OPTIONS ); +return ret ==0 && !!(a1 &FEATURE_GENEVE_OPTIONS ); }uint64_t vnic_dev_capable_cq_entry_size (struct vnic_dev *vdev)
drivers/net/enic/base/vnic_enet.h +1 -0
@@ -55,6 +55,7 @@ struct vnic_enet_config {#define VENETF_NICSWITCH 0x80000/* NICSWITCH enabled */ #define VENETF_RSSHASH_UDPIPV4 0x100000/* Hash on UDP + IPv4 fields */ #define VENETF_RSSHASH_UDPIPV6 0x200000/* Hash on UDP + IPv6 fields */ +#define VENETF_GENEVE 0x400000/* GENEVE offload */ #define VENET_INTR_TYPE_MIN 0/* Timer specs min interrupt spacing */ #define VENET_INTR_TYPE_IDLE 1/* Timer specs idle time before irq */
drivers/net/enic/enic.h +2 -2
@@ -118,17 +118,17 @@ struct enic {uint32_t flow_filter_mode;uint8_t filter_actions;/* HW supported actions */ uint64_t cq_entry_sizes;/* supported CQ entry sizes */ +bool geneve;bool vxlan;bool cq64;/* actually using 64B CQ entry */ bool cq64_request;/* devargs cq64=1 */ bool disable_overlay;/* devargs disable_overlay=1 */ uint8_t enable_avx2_rx;/* devargs enable-avx2-rx=1 */ -uint8_t geneve_opt_avail;/* Geneve with options offload available */ -uint8_t geneve_opt_enabled;/* Geneve with options offload enabled */ uint8_t geneve_opt_request;/* devargs geneve-opt=1 */ bool nic_cfg_chk;/* NIC_CFG_CHK available */ bool udp_rss_weak;/* Bodega style UDP RSS */ uint8_t ig_vlan_rewrite_mode;/* devargs ig-vlan-rewrite */ +uint16_t geneve_port;/* current geneve port pushed to NIC */ uint16_t vxlan_port;/* current vxlan port pushed to NIC */ int use_simple_tx_handler;int use_noscatter_vec_rx_handler;
drivers/net/enic/enic_ethdev.c +39 -32
172 lines not on this page · raw message
drivers/net/enic/enic_main.c +94 -67
191 lines not on this page · raw message
drivers/net/enic/enic_res.c +3 -4
@@ -179,10 +179,9 @@ int enic_get_vnic_config(struct enic *enic) enic->vxlan =ENIC_SETTING (enic,VXLAN ) &&vnic_dev_capable_vxlan (enic->vdev); -if (vnic_dev_capable_geneve (enic->vdev)) { -dev_info (NULL ,"Geneve with options offload available\n" ); - enic->geneve_opt_avail =1 ; - } + enic->geneve =ENIC_SETTING (enic,GENEVE ) && +vnic_dev_capable_geneve (enic->vdev); +/* Supported CQ entry sizes */ enic->cq_entry_sizes =vnic_dev_capable_cq_entry_size (enic->vdev); sizes = enic->cq_entry_sizes;
Signature · 1 line
2.26.2
Quoted 13 lines · John Daley
The admin-configured vNIC settings (i.e. via CIMC or UCSM) now include Geneve offload. Use that setting to decide whether to enable or disable Geneve offload and remove the devarg 'geneve-opt'.
Also, the firmware now allows the driver to change the Geneve port number. So extend udp_tunnel_port_{add,del} to accept Geneve port, in addition to VXLAN.
Fixes 93fb21fdbe23 ("net/enic: enable overlay offload for VXLAN and GENEVE")Signed-off-by John Daley <[email protected]>Reviewed-by Hyong Youb Kim <[email protected]>
Quoted 9 lines
--- doc/guides/nics/enic.rst | 32 +++--- drivers/net/enic/base/vnic_dev.c | 2 +- drivers/net/enic/base/vnic_enet.h | 1 + drivers/net/enic/enic.h | 4 +- drivers/net/enic/enic_ethdev.c | 71 +++++++------ drivers/net/enic/enic_main.c | 161 +++++++++++++++++------------- drivers/net/enic/enic_res.c | 7 +- 7 files changed, 154 insertions(+), 124 deletions(-)
Hi John, Andrew,
Can you please update release notes too?
PATCH 1/1 net/enic: enable GENEVE offload via VNIC configuration
In reply to John DaleyThe admin-configured vNIC settings (i.e. via CIMC or UCSM) now include Geneve offload. Use that setting to decide whether to enable or disable Geneve offload and remove the devarg 'geneve-opt'.
Also, the firmware now allows the driver to change the Geneve port number. So extend udp_tunnel_port_{add,del} to accept Geneve port, in addition to VXLAN.
---
v1: update release notes
doc/guides/nics/enic.rst | 32 +++-- doc/guides/rel_notes/release_20_05.rst | 7 ++ drivers/net/enic/base/vnic_dev.c | 2 +- drivers/net/enic/base/vnic_enet.h | 1 + drivers/net/enic/enic.h | 4 +- drivers/net/enic/enic_ethdev.c | 71 ++++++----- drivers/net/enic/enic_main.c | 161 +++++++++++++++---------- drivers/net/enic/enic_res.c | 7 +- 8 files changed, 161 insertions(+), 124 deletions(-)
doc/guides/nics/enic.rst +14 -18
@@ -294,35 +294,31 @@ inner and outer packets can be IPv4 or IPv6. RSS hash calculation, therefore queue selection, is done on inner packets. -In order to enable overlay offload, the 'Enable VXLAN' box should be checked +In order to enable overlay offload, enable VXLAN and/or Geneve on vNIC via CIMC or UCSM followed by a reboot of the server. When PMD successfully -enables overlay offload, it prints the following message on the console. +enables overlay offload, it prints one of the following messages on the console. .. code-block:: console - Overlay offload is enabled + Overlay offload is enabled (VxLAN) + Overlay offload is enabled (Geneve) + Overlay offload is enabled (VxLAN, Geneve) By default, PMD enables overlay offload if hardware supports it. To disable it, set ``devargs`` parameter ``disable-overlay=1``. For example:: -a 12:00.0,disable-overlay=1 -By default, the NIC uses 4789 as the VXLAN port. The user may change -it through ``rte_eth_dev_udp_tunnel_port_{add,delete}``. However, as -the current NIC has a single VXLAN port number, the user cannot -configure multiple port numbers. - -Geneve headers with non-zero options are not supported by default. To -use Geneve with options, update the VIC firmware to the latest version -and then set ``devargs`` parameter ``geneve-opt=1``. When Geneve with -options is enabled, flow API cannot be used as the features are -currently mutually exclusive. When this feature is successfully -enabled, PMD prints the following message. - -.. code-block:: console - - Geneve with options is enabled +By default, the NIC uses 4789 and 6081 as the VXLAN and Geneve ports, +respectively. The user may change them through +``rte_eth_dev_udp_tunnel_port_{add,delete}``. However, as the current +NIC has a single VXLAN port number and a single Geneve port number, +the user cannot configure multiple port numbers for each tunnel type. +Geneve offload support has evolved over VIC models. On older models, +Geneve offload and advanced filters are mutually exclusive. This is +enforced by UCSM and CIMC, which only allow one of the two features +to be selected at one time. Newer VIC models do not have this restriction. Ingress VLAN Rewrite --------------------
doc/guides/rel_notes/release_20_05.rst +7 -0
@@ -178,6 +178,13 @@ New Features * Added support for flow patterns with wildcard VLAN items (without VID value). * Updated support for matching on GTP headers, added match on GTP flags. +* **Updated Cisco enic driver.** + + Updated Cisco enic driver GENEVE tunneling support: + + * Added support to control GENEVE tunneling via UCSM/CIMC and removed devarg. + * Added GENEVE port number configuration. + * **Added Chacha20-Poly1305 algorithm to Cryptodev API.** Added support for Chacha20-Poly1305 AEAD algorithm in Cryptodev.
drivers/net/enic/base/vnic_dev.c +1 -1
@@ -1318,7 +1318,7 @@ int vnic_dev_capable_geneve(struct vnic_dev *vdev)int ret; ret =vnic_dev_cmd (vdev,CMD_GET_SUPP_FEATURE_VER , &a0, &a1, wait); -return ret ==0 && (a1 &FEATURE_GENEVE_OPTIONS ); +return ret ==0 && !!(a1 &FEATURE_GENEVE_OPTIONS ); }uint64_t vnic_dev_capable_cq_entry_size (struct vnic_dev *vdev)
drivers/net/enic/base/vnic_enet.h +1 -0
@@ -55,6 +55,7 @@ struct vnic_enet_config {#define VENETF_NICSWITCH 0x80000/* NICSWITCH enabled */ #define VENETF_RSSHASH_UDPIPV4 0x100000/* Hash on UDP + IPv4 fields */ #define VENETF_RSSHASH_UDPIPV6 0x200000/* Hash on UDP + IPv6 fields */ +#define VENETF_GENEVE 0x400000/* GENEVE offload */ #define VENET_INTR_TYPE_MIN 0/* Timer specs min interrupt spacing */ #define VENET_INTR_TYPE_IDLE 1/* Timer specs idle time before irq */
drivers/net/enic/enic.h +2 -2
@@ -118,17 +118,17 @@ struct enic {uint32_t flow_filter_mode;uint8_t filter_actions;/* HW supported actions */ uint64_t cq_entry_sizes;/* supported CQ entry sizes */ +bool geneve;bool vxlan;bool cq64;/* actually using 64B CQ entry */ bool cq64_request;/* devargs cq64=1 */ bool disable_overlay;/* devargs disable_overlay=1 */ uint8_t enable_avx2_rx;/* devargs enable-avx2-rx=1 */ -uint8_t geneve_opt_avail;/* Geneve with options offload available */ -uint8_t geneve_opt_enabled;/* Geneve with options offload enabled */ uint8_t geneve_opt_request;/* devargs geneve-opt=1 */ bool nic_cfg_chk;/* NIC_CFG_CHK available */ bool udp_rss_weak;/* Bodega style UDP RSS */ uint8_t ig_vlan_rewrite_mode;/* devargs ig-vlan-rewrite */ +uint16_t geneve_port;/* current geneve port pushed to NIC */ uint16_t vxlan_port;/* current vxlan port pushed to NIC */ int use_simple_tx_handler;int use_noscatter_vec_rx_handler;
drivers/net/enic/enic_ethdev.c +39 -32
172 lines not on this page · raw message
drivers/net/enic/enic_main.c +94 -67
191 lines not on this page · raw message
drivers/net/enic/enic_res.c +3 -4
@@ -179,10 +179,9 @@ int enic_get_vnic_config(struct enic *enic) enic->vxlan =ENIC_SETTING (enic,VXLAN ) &&vnic_dev_capable_vxlan (enic->vdev); -if (vnic_dev_capable_geneve (enic->vdev)) { -dev_info (NULL ,"Geneve with options offload available\n" ); - enic->geneve_opt_avail =1 ; - } + enic->geneve =ENIC_SETTING (enic,GENEVE ) && +vnic_dev_capable_geneve (enic->vdev); +/* Supported CQ entry sizes */ enic->cq_entry_sizes =vnic_dev_capable_cq_entry_size (enic->vdev); sizes = enic->cq_entry_sizes;
Signature · 1 line
2.26.2
Ferruh Yigit
AppliedQuoted 8 lines · John Daley
The admin-configured vNIC settings (i.e. via CIMC or UCSM) now include Geneve offload. Use that setting to decide whether to enable or disable Geneve offload and remove the devarg 'geneve-opt'.
Also, the firmware now allows the driver to change the Geneve port number. So extend udp_tunnel_port_{add,del} to accept Geneve port, in addition to VXLAN.
Quoted 5 lines
Fixes 93fb21fdbe23 ("net/enic: enable overlay offload for VXLAN and GENEVE")Signed-off-by John Daley <[email protected]>Reviewed-by Hyong Youb Kim <[email protected]>
Applied to dpdk-next-net/main, thanks.