summaryrefslogtreecommitdiff
path: root/drivers/net/softnic
AgeCommit message (Collapse)Author
2019-10-25net/softnic: add subport config flexibility to TMJasvinder Singh
Modify softnic traffic management function to allow different subports of the same port to have different configuration in terms of number of pipes, pipe queue sizes, etc. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-10-07ethdev: change device info get callback to return intIvan Ilchenko
Change eth_dev_infos_get_t return value from void to int. Make eth_dev_infos_get_t implementations across all drivers to return negative errno values if case of error conditions. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07net/softnic: check status of getting ethdev infoIvan Ilchenko
rte_eth_dev_info_get() return value was changed from void to int, so this patch modify rte_eth_dev_info_get() usage across net/softnic according to its new return type. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-07-22net/softnic: add config flexibility to TMJasvinder Singh
Update softnic tm function for configuration flexiblity of pipe traffic classes and queues size. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-07-19cryptodev: make xform key pointer constantFan Zhang
This patch changes the key pointer data types in cipher, auth, and aead xforms from "uint8_t *" to "const uint8_t *" for a more intuitive and safe sessionn creation. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com> Acked-by: Liron Himi <lironh@marvell.com>
2019-07-02drivers: add reasons for components being disabledBruce Richardson
For each driver where we optionally disable it, add in the reason why it's being disabled, so the user knows how to fix it. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-28net/softnic: remove trace of legacy linuxappDavid Marchand
This check on Linux environment has been added at a time when we already had switched to using the boolean RTE_EXEC_ENV_LINUXAPP. It was then missed when converting to RTE_EXEC_ENV_LINUX. Fixes: 7709a63bf178 ("net/softnic: add connection agent") Fixes: 742bde12f3bd ("build/linux: rename macro from LINUXAPP to LINUX") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-29enforce experimental tag at beginning of declarationsDavid Marchand
Putting a '__attribute__((deprecated))' in the middle of a function prototype does not result in the expected result with gcc (while clang is fine with this syntax). $ cat deprecated.c void * __attribute__((deprecated)) incorrect() { return 0; } __attribute__((deprecated)) void *correct(void) { return 0; } int main(int argc, char *argv[]) { incorrect(); correct(); return 0; } $ gcc -o deprecated.o -c deprecated.c deprecated.c: In function ‘main’: deprecated.c:3:1: warning: ‘correct’ is deprecated (declared at deprecated.c:2) [-Wdeprecated-declarations] int main(int argc, char *argv[]) { incorrect(); correct(); return 0; } ^ Move the tag on a separate line and make it the first thing of function prototypes. This is not perfect but we will trust reviewers to catch the other not so easy to detect patterns. sed -i \ -e '/^\([^#].*\)\?__rte_experimental */{' \ -e 's//\1/; s/ *$//; i\' \ -e __rte_experimental \ -e '/^$/d}' \ $(git grep -l __rte_experimental -- '*.h') Special mention for rte_mbuf_data_addr_default(): There is either a bug or a (not yet understood) issue with gcc. gcc won't drop this inline when unused and rte_mbuf_data_addr_default() calls rte_mbuf_buf_addr() which itself is experimental. This results in a build warning when not accepting experimental apis from sources just including rte_mbuf.h. For this specific case, we hide the call to rte_mbuf_buf_addr() under the ALLOW_EXPERIMENTAL_API flag. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Signed-off-by: David Marchand <david.marchand@redhat.com>
2019-05-30net/softnic: do not dereference global config structDavid Marchand
Prefer the existing apis rather than direct access the configuration structure. Fixes: a958a5c07f4b ("net/softnic: support service cores") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-05-24net: add rte prefix to TCP structureOlivier Matz
Add 'rte_' prefix to structures: - rename struct tcp_hdr as struct rte_tcp_hdr. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to IP structureOlivier Matz
Add 'rte_' prefix to structures: - rename struct ipv4_hdr as struct rte_ipv4_hdr. - rename struct ipv6_hdr as struct rte_ipv6_hdr. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to ether definesOlivier Matz
Add 'RTE_' prefix to defines: - rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN. - rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN. - rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN. - rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN. - rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN. - rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN. - rename ETHER_MTU as RTE_ETHER_MTU. - rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN. - rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID. - rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN. - rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU. - rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR. - rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR. - rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4. - rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6. - rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP. - rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN. - rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP. - rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ. - rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG. - rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588. - rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW. - rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB. - rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP. - rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS. - rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM. - rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN. - rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE. - rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4. - rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6. - rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH. - rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH. - rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS. - rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP. - rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG. - rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to ether functionsOlivier Matz
Add 'rte_' prefix to functions: - rename is_same_ether_addr() as rte_is_same_ether_addr(). - rename is_zero_ether_addr() as rte_is_zero_ether_addr(). - rename is_unicast_ether_addr() as rte_is_unicast_ether_addr(). - rename is_multicast_ether_addr() as rte_is_multicast_ether_addr(). - rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr(). - rename is_universal_ether_addr() as rte_is_universal_ether_addr(). - rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr(). - rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr(). - rename eth_random_addr() as rte_eth_random_addr(). - rename ether_addr_copy() as rte_ether_addr_copy(). - rename ether_format_addr() as rte_ether_format_addr(). Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to ether structuresOlivier Matz
Add 'rte_' prefix to structures: - rename struct ether_addr as struct rte_ether_addr. - rename struct ether_hdr as struct rte_ether_hdr. - rename struct vlan_hdr as struct rte_vlan_hdr. - rename struct vxlan_hdr as struct rte_vxlan_hdr. - rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-04-17build: increase readability via shortcut variablesBruce Richardson
Define variables for "is_linux", "is_freebsd" and "is_windows" to make the code shorter for comparisons and more readable. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: David Marchand <david.marchand@redhat.com> Acked-by: Luca Boccassi <bluca@debian.org>
2019-04-11meter: replace color definitionsJasvinder Singh
This patch implements the changes proposed in the deprecation note[1]. Replace multiple color definitions in various places such as rte_meter.h, rte_tm.h and rte_mtr.h with single rte_color defined in rte_meter.h. This is simple search and replace exercise without any implementation change. [1] https://mails.dpdk.org/archives/dev/2019-January/123861.html Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-04-05net/softnic: fix unchecked return valueJasvinder Singh
Fix unchecked return value issue reported by Coverity. Coverity issue: 336852 Fixes: a958a5c07f4b ("net/softnic: support service cores") Cc: stable@dpdk.org Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Acked-by: Rami Rosen <ramirose@gmail.com>
2019-04-04replace snprintf with strlcpy without adding extra includeBruce Richardson
For files that already have rte_string_fns.h included in them, we can do a straight replacement of snprintf(..."%s",...) with strlcpy. The changes in this patch were auto-generated via command: spatch --sp-file devtools/cocci/strlcpy-with-header.cocci --dir . --in-place Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-03-29net/softnic: support QinQ PPPoE encapsulationNemanja Marjanovic
Add implementation of QinQ PPPoE packet encapsulation action. Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-03-12mk: use linux and freebsd in config namesBruce Richardson
Rather than using linuxapp and bsdapp everywhere, we can change things to use the, more readable, terms "linux" and "freebsd" in our build configs. Rather than renaming the configs we can just duplicate the existing ones with the new names using symlinks, and use the new names exclusively internally. ["make showconfigs" also only shows the new names to keep the list short] The result is that backward compatibility is kept fully but any new builds or development can be done using the newer names, i.e. both "make config T=x86_64-native-linuxapp-gcc" and "T=x86_64-native-linux-gcc" work. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-03-12build/linux: rename macro from LINUXAPP to LINUXBruce Richardson
Rename the macro to make things shorter and more comprehensible. For both meson and make builds, keep the old macro around for backward compatibility. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-03-01net/softnic: fix possible buffer overflowPallantla Poornima
sprintf function is not secure as it doesn't check the length of string. More secure function snprintf is used. Fixes: daabf2fb949b ("net/softnic: map flow action to table action") Cc: stable@dpdk.org Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-01-10net/softnic: use separate session mempoolsFan Zhang
This patch uses the two session mempool approach to softnic PMD. One mempool is for session header objects, and the other is for session private data. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-01-10cryptodev: change queue pair configure structureFan Zhang
This patch changes the cryptodev queue pair configure structure to enable two mempool passed into cryptodev PMD simutaneously. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-01-10net/softnic: support service coresCristian Dumitrescu
Add support to run the Soft NIC device on service cores, based on the value of the sc parameter: 0: The current Soft NIC device is run explicitly by the application. The firmware creates one or several pipelines for this dev and maps them to CPU cores that should not be service cores. The app is required to call rte_pmd_softnic_run() to make this dev work. 1 (default): The current device is run on the service cores transparently to the app. The firmware creates one or several pipelines for this dev current device and maps them to CPU cores that should be service cores. Each of these service cores is calling rte_pmd_softnic_run() in order to make this dev work with no app intervention. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-11-21net/softnic: fix undefined device info fieldsJasvinder Singh
The memcpy operation overwrites the device info fields set by ethdev API and leaves the device field undefined. Thus, replaces memcpy by only updating the required fields at the driver layer. error log: testpmd> show port info 1 **** Infos for port 1 **** MAC address: 00:00:00:00:00:00 Device name: net_softnic0 Segmentation fault. port_infos_display (port_id=1) at /dpdk/app/test-pmd/config.c:418 if (dev_info.device->devargs && dev_info.device->devargs->args) Fixes: cc6d421574fe ("net/softnic: add softnic PMD") Cc: stable@dpdk.org Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-02net/softnic: fix string copyReshma Pattan
Use strlcpy instead of strcpy to avoid buffer overrun. Coverity issues: 323475,323478,323514,323515 Fixes: b767f8efc8 ("net/softnic: replace pointers with arrays") Fixes: c169b6a588 ("net/softnic: map flow attribute to pipeline table") Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-11-02net/softnic: fix mixing enum valuesJasvinder Singh
Fix mixing enum types enum rte_table_action_policer and enum rte_mtr_policer_action for dereference of policer action. Coverity issue 323483, 323511 Fixes: 7e30e444c3e4 ("net/softnic: support flow meter action") Fixes: 8a917ef88db7 ("net/softnic: update policer actions") Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-29add missing static keyword to globalsFerruh Yigit
Some global variables can indeed be static, add static keyword to them. Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-27net/softnic: disable in FreeBSD build with mesonAgalya Babu RadhaKrishnan
Disabled softnic build in FreeBSD because it is not supported Added changes to enable softnic build if it is Linux OS and disable in FreeBSD. Fixes: 6b2a3900e2fb ("net/softnic: add to meson build") Cc: stable@dpdk.org Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com> Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-26ethdev: free all common data when releasing portThomas Monjalon
This is a clean-up of common ethdev data freeing. All data freeing are moved to rte_eth_dev_release_port() and done only in case of primary process. It is probably fixing some memory leaks for PMDs which were not freeing all data. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26net/softnic: add crypto commandsFan Zhang
This patch updates the CLI parsing of softnic with extra symmetric cryptodev, port, session, and action support. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26net/softnic: add symmetric crypto actionFan Zhang
This patch adds symmetric crypto action support to softnic. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26net/softnic: configure crypto portFan Zhang
This patch enables the crypt port configuration in softnic. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26net/softnic: add cryptodevFan Zhang
This patch adds cryptodev abstraction to softnic. The DPDK Cryptodevs are abstracted as crypto ports in the softnic. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-17net/softnic: support flow API VXLAN encap actionReshma Pattan
Added support for ethdev flow API VXLAN encap action. Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-17net/softnic: support VXLAN encapCristian Dumitrescu
Add CLI support for VXLAN encap. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-22mk: build with _GNU_SOURCE defined by defaultAnatoly Burakov
We use _GNU_SOURCE all over the place, but often times we miss defining it, resulting in broken builds on musl. Rather than fixing every library's and driver's and application's makefile, fix it by simply defining _GNU_SOURCE by default for all builds. Remove all usages of _GNU_SOURCE in source files and makefiles, and also fixup a couple of instances of using __USE_GNU instead of _GNU_SOURCE. Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-12net/softnic: support VXLAN flow decap actionCristian Dumitrescu
Add support for ethdev flow API VXLAN decap action. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12net/softnic: support packet decap actionCristian Dumitrescu
Add support for packet decap table action. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12net/softnic: support flow mark actionCristian Dumitrescu
Add support for ethdev flow API mark action. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12net/softnic: support packet tag actionCristian Dumitrescu
Add support for packet tag table action. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12net/softnic: support flow flushReshma Pattan
Add rte flow flush api for flushing all the flows of the port. Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12net/softnic: fix IPv6 endiannessReshma Pattan
Fix IPv6 endianness from big endian to CPU order. Fixes: ee19326a4b ("net/softnic: add command for pipeline table entries") Cc: stable@dpdk.org Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12net/softnic: support flow meter actionJasvinder Singh
Implement flow rules with meter action. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12net/softnic: read meter statisticsJasvinder Singh
Implement meter object stats read function. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12net/softnic: update policer actionsJasvinder Singh
Implement meter object policer actions function. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12net/softnic: update DSCP tableJasvinder Singh
Implement meter object dscp table update. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12net/softnic: update meter profileJasvinder Singh
Implement meter profile update function Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12net/softnic: destroy meter objectJasvinder Singh
Implement meter object destroy function. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>