Commit Graph

20 Commits

Author SHA1 Message Date
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
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-24 13:34:45 +02:00
Jasvinder Singh
c1656328db meter: replace color definitions
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-11 14:27:32 +02:00
Pallantla Poornima
fef6b21639 net/softnic: fix possible buffer overflow
sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: daabf2fb94 ("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-03-01 18:17:36 +01:00
Reshma Pattan
69fd1729c6 net/softnic: fix string copy
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-02 11:23:00 +01:00
Jasvinder Singh
ce13d80c36 net/softnic: fix mixing enum values
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: 7e30e444c3 ("net/softnic: support flow meter action")
Fixes: 8a917ef88d ("net/softnic: update policer actions")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-11-02 11:20:57 +01:00
Reshma Pattan
636e5af038 net/softnic: support flow API VXLAN encap action
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-17 15:04:39 +02:00
Cristian Dumitrescu
abe92131c9 net/softnic: support VXLAN flow decap action
Add support for ethdev flow API VXLAN decap action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:40 +02:00
Cristian Dumitrescu
974a48d42b net/softnic: support flow mark action
Add support for ethdev flow API mark action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:33 +02:00
Reshma Pattan
b53258c14c net/softnic: support flow flush
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-12 19:33:23 +02:00
Jasvinder Singh
7e30e444c3 net/softnic: support flow meter action
Implement flow rules with meter action.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:16 +02:00
Reshma Pattan
193de77b60 net/softnic: parse raw flow item
Added support for parsing raw flow item.
flow_item_raw_preprocess() is added for the same.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:08 +02:00
Reshma Pattan
a373200590 net/softnic: support flow query
Added pmd_flow_query() API, for flow query
support.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:07 +02:00
Reshma Pattan
bd0447d2c5 net/softnic: support flow destroy
pmd_flow_destroy() API is added to destroy the
created flow.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:06 +02:00
Reshma Pattan
11c5da41c7 net/softnic: support flow create
pmd_flow_create API is added to support
rte flow create.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:05 +02:00
Reshma Pattan
daabf2fb94 net/softnic: map flow action to table action
Added validation and mapping of flow rule action
with table action profile.

Added flow_rule_action_get() to do the same.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:05 +02:00
Reshma Pattan
061ee47cf5 net/softnic: map flow match to hash table
Support for validating and mapping flow rule with HASH
table match is added.

As part of this, below helper functions are added.
flow_rule_match_hash_get()
hash_key_mask_is_same()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:04 +02:00
Reshma Pattan
6655737d2f net/softnic: parse flow match for ACL table
Added flow protocol parsing for IPV4/IPV6 and
TCP/UDP/SCTP for ACL table rule match.

Added below helper functions for doing the same.
port_mask_to_range()
ipv6_mask_to_depth()
ipv4_mask_to_depth()
mask_to_depth()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:03 +02:00
Reshma Pattan
fd9f4290e5 net/softnic: map flow match to ACL table
Support for validating and mapping rte flow rule with
ACL table match is added.

As part of this support below utility functions
been added
flow_rule_match_get()
flow_rule_match_acl_get()
flow_item_skip_disabled_protos()
flow_item_proto_preprocess()
flow_item_is_proto()
flow_item_raw_preprocess()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:03 +02:00
Reshma Pattan
8364aa4734 net/softnic: support flow validate
Start adding flow api operations.

Started with flow validate api support by adding
below basic infrastructure.

flow_pipeline_table_get()
pmd_flow_validate()

Additional flow validate changes will be
added in next patches.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:02 +02:00
Reshma Pattan
c169b6a588 net/softnic: map flow attribute to pipeline table
Added mapping support from rte_flow attributes
to softnic pipeline and table.

So added flow attribute map set and get functions
definition to new file rte_eth_sofnic_flow.c.

Added pmd flow internals with ingress and egress
flow attribute maps.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:58:57 +02:00