* [PATCH v4 6/7] librte_ether: remove the set VF API's
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481550626-14539-1-git-send-email-bernard.iremonger@intel.com>
remove the following API's:
rte_eth_dev_set_vf_rxmode
rte_eth_dev_set_vf_rx
rte_eth_dev_set_vf_tx
rte_eth_dev_set_vf_vlan_filter
rte_eth_dev_set_vf_rate_limit
Increment LIBABIVER in Makefile
Remove deprecation notice for removing rte_eth_dev_set_vf_* API's.
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
doc/guides/rel_notes/deprecation.rst | 13 ---
lib/librte_ether/Makefile | 4 +-
lib/librte_ether/rte_ethdev.c | 129 ------------------------------
lib/librte_ether/rte_ethdev.h | 140 ---------------------------------
lib/librte_ether/rte_ether_version.map | 7 +-
5 files changed, 3 insertions(+), 290 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 2d17bc6..c897c18 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,19 +38,6 @@ Deprecation Notices
``_rte_eth_dev_callback_process``. In 17.02 the function will return an ``int``
instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
-* ethdev: for 17.02 it is planned to deprecate the following five functions
- and move them in ixgbe:
-
- ``rte_eth_dev_set_vf_rxmode``
-
- ``rte_eth_dev_set_vf_rx``
-
- ``rte_eth_dev_set_vf_tx``
-
- ``rte_eth_dev_set_vf_vlan_filter``
-
- ``rte_eth_set_vf_rate_limit``
-
* ABI changes are planned for 17.02 in the ``rte_mbuf`` structure: some fields
may be reordered to facilitate the writing of ``data_off``, ``refcnt``, and
``nb_segs`` in one operation, because some platforms have an overhead if the
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index efe1e5f..d23015c 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -1,6 +1,6 @@
# BSD LICENSE
#
-# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
-LIBABIVER := 5
+LIBABIVER := 6
SRCS-y += rte_ethdev.c
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 1e0f206..6a93014 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2137,32 +2137,6 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr)
return 0;
}
-int
-rte_eth_dev_set_vf_rxmode(uint8_t port_id, uint16_t vf,
- uint16_t rx_mode, uint8_t on)
-{
- uint16_t num_vfs;
- struct rte_eth_dev *dev;
- struct rte_eth_dev_info dev_info;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
- dev = &rte_eth_devices[port_id];
- rte_eth_dev_info_get(port_id, &dev_info);
-
- num_vfs = dev_info.max_vfs;
- if (vf > num_vfs) {
- RTE_PMD_DEBUG_TRACE("set VF RX mode:invalid VF id %d\n", vf);
- return -EINVAL;
- }
-
- if (rx_mode == 0) {
- RTE_PMD_DEBUG_TRACE("set VF RX mode:mode mask ca not be zero\n");
- return -EINVAL;
- }
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx_mode, -ENOTSUP);
- return (*dev->dev_ops->set_vf_rx_mode)(dev, vf, rx_mode, on);
-}
/*
* Returns index into MAC address array of addr. Use 00:00:00:00:00:00 to find
@@ -2252,76 +2226,6 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on)
return (*dev->dev_ops->uc_all_hash_table_set)(dev, on);
}
-int
-rte_eth_dev_set_vf_rx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
- uint16_t num_vfs;
- struct rte_eth_dev *dev;
- struct rte_eth_dev_info dev_info;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
- dev = &rte_eth_devices[port_id];
- rte_eth_dev_info_get(port_id, &dev_info);
-
- num_vfs = dev_info.max_vfs;
- if (vf > num_vfs) {
- RTE_PMD_DEBUG_TRACE("port %d: invalid vf id\n", port_id);
- return -EINVAL;
- }
-
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx, -ENOTSUP);
- return (*dev->dev_ops->set_vf_rx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_tx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
- uint16_t num_vfs;
- struct rte_eth_dev *dev;
- struct rte_eth_dev_info dev_info;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
- dev = &rte_eth_devices[port_id];
- rte_eth_dev_info_get(port_id, &dev_info);
-
- num_vfs = dev_info.max_vfs;
- if (vf > num_vfs) {
- RTE_PMD_DEBUG_TRACE("set pool tx:invalid pool id=%d\n", vf);
- return -EINVAL;
- }
-
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_tx, -ENOTSUP);
- return (*dev->dev_ops->set_vf_tx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_vlan_filter(uint8_t port_id, uint16_t vlan_id,
- uint64_t vf_mask, uint8_t vlan_on)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
- dev = &rte_eth_devices[port_id];
-
- if (vlan_id > ETHER_MAX_VLAN_ID) {
- RTE_PMD_DEBUG_TRACE("VF VLAN filter:invalid VLAN id=%d\n",
- vlan_id);
- return -EINVAL;
- }
-
- if (vf_mask == 0) {
- RTE_PMD_DEBUG_TRACE("VF VLAN filter:pool_mask can not be 0\n");
- return -EINVAL;
- }
-
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_vlan_filter, -ENOTSUP);
- return (*dev->dev_ops->set_vf_vlan_filter)(dev, vlan_id,
- vf_mask, vlan_on);
-}
-
int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
uint16_t tx_rate)
{
@@ -2352,39 +2256,6 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
return (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate);
}
-int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf, uint16_t tx_rate,
- uint64_t q_msk)
-{
- struct rte_eth_dev *dev;
- struct rte_eth_dev_info dev_info;
- struct rte_eth_link link;
-
- if (q_msk == 0)
- return 0;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
- dev = &rte_eth_devices[port_id];
- rte_eth_dev_info_get(port_id, &dev_info);
- link = dev->data->dev_link;
-
- if (vf > dev_info.max_vfs) {
- RTE_PMD_DEBUG_TRACE("set VF rate limit:port %d: "
- "invalid vf id=%d\n", port_id, vf);
- return -EINVAL;
- }
-
- if (tx_rate > link.link_speed) {
- RTE_PMD_DEBUG_TRACE("set VF rate limit:invalid tx_rate=%d, "
- "bigger than link speed= %d\n",
- tx_rate, link.link_speed);
- return -EINVAL;
- }
-
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rate_limit, -ENOTSUP);
- return (*dev->dev_ops->set_vf_rate_limit)(dev, vf, tx_rate, q_msk);
-}
-
int
rte_eth_mirror_rule_set(uint8_t port_id,
struct rte_eth_mirror_conf *mirror_conf,
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9678179..c602d7d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1249,39 +1249,11 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
uint8_t on);
/**< @internal Set all Unicast Hash bitmap */
-typedef int (*eth_set_vf_rx_mode_t)(struct rte_eth_dev *dev,
- uint16_t vf,
- uint16_t rx_mode,
- uint8_t on);
-/**< @internal Set a VF receive mode */
-
-typedef int (*eth_set_vf_rx_t)(struct rte_eth_dev *dev,
- uint16_t vf,
- uint8_t on);
-/**< @internal Set a VF receive mode */
-
-typedef int (*eth_set_vf_tx_t)(struct rte_eth_dev *dev,
- uint16_t vf,
- uint8_t on);
-/**< @internal Enable or disable a VF transmit */
-
-typedef int (*eth_set_vf_vlan_filter_t)(struct rte_eth_dev *dev,
- uint16_t vlan,
- uint64_t vf_mask,
- uint8_t vlan_on);
-/**< @internal Set VF VLAN pool filter */
-
typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
uint16_t queue_idx,
uint16_t tx_rate);
/**< @internal Set queue TX rate */
-typedef int (*eth_set_vf_rate_limit_t)(struct rte_eth_dev *dev,
- uint16_t vf,
- uint16_t tx_rate,
- uint64_t q_msk);
-/**< @internal Set VF TX rate */
-
typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
struct rte_eth_mirror_conf *mirror_conf,
uint8_t rule_id,
@@ -1479,16 +1451,11 @@ struct eth_dev_ops {
eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap */
eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule.*/
eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule.*/
- eth_set_vf_rx_mode_t set_vf_rx_mode; /**< Set VF RX mode */
- eth_set_vf_rx_t set_vf_rx; /**< enable/disable a VF receive */
- eth_set_vf_tx_t set_vf_tx; /**< enable/disable a VF transmit */
- eth_set_vf_vlan_filter_t set_vf_vlan_filter; /**< Set VF VLAN filter */
/** Add UDP tunnel port. */
eth_udp_tunnel_port_add_t udp_tunnel_port_add;
/** Del UDP tunnel port. */
eth_udp_tunnel_port_del_t udp_tunnel_port_del;
eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit */
- eth_set_vf_rate_limit_t set_vf_rate_limit; /**< Set VF rate limit */
/** Update redirection table. */
reta_update_t reta_update;
/** Query redirection table. */
@@ -3403,93 +3370,6 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr,
*/
int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on);
- /**
- * Set RX L2 Filtering mode of a VF of an Ethernet device.
- *
- * @param port
- * The port identifier of the Ethernet device.
- * @param vf
- * VF id.
- * @param rx_mode
- * The RX mode mask, which is one or more of accepting Untagged Packets,
- * packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
- * ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
- * ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
- * in rx_mode.
- * @param on
- * 1 - Enable a VF RX mode.
- * 0 - Disable a VF RX mode.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
- */
-int rte_eth_dev_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mode,
- uint8_t on);
-
-/**
-* Enable or disable a VF traffic transmit of the Ethernet device.
-*
-* @param port
-* The port identifier of the Ethernet device.
-* @param vf
-* VF id.
-* @param on
-* 1 - Enable a VF traffic transmit.
-* 0 - Disable a VF traffic transmit.
-* @return
-* - (0) if successful.
-* - (-ENODEV) if *port_id* invalid.
-* - (-ENOTSUP) if hardware doesn't support.
-* - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_tx(uint8_t port,uint16_t vf, uint8_t on);
-
-/**
-* Enable or disable a VF traffic receive of an Ethernet device.
-*
-* @param port
-* The port identifier of the Ethernet device.
-* @param vf
-* VF id.
-* @param on
-* 1 - Enable a VF traffic receive.
-* 0 - Disable a VF traffic receive.
-* @return
-* - (0) if successful.
-* - (-ENOTSUP) if hardware doesn't support.
-* - (-ENODEV) if *port_id* invalid.
-* - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_rx(uint8_t port,uint16_t vf, uint8_t on);
-
-/**
-* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
-* received VLAN packets tagged with a given VLAN Tag Identifier.
-*
-* @param port id
-* The port identifier of the Ethernet device.
-* @param vlan_id
-* The VLAN Tag Identifier whose filtering must be enabled or disabled.
-* @param vf_mask
-* Bitmap listing which VFs participate in the VLAN filtering.
-* @param vlan_on
-* 1 - Enable VFs VLAN filtering.
-* 0 - Disable VFs VLAN filtering.
-* @return
-* - (0) if successful.
-* - (-ENOTSUP) if hardware doesn't support.
-* - (-ENODEV) if *port_id* invalid.
-* - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
- uint64_t vf_mask,
- uint8_t vlan_on);
-
/**
* Set a traffic mirroring rule on an Ethernet device
*
@@ -3551,26 +3431,6 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
uint16_t tx_rate);
/**
- * Set the rate limitation for a vf on an Ethernet device.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param vf
- * VF id.
- * @param tx_rate
- * The tx rate allocated from the total link speed for this VF id.
- * @param q_msk
- * The queue mask which need to set the rate.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
- */
-int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf,
- uint16_t tx_rate, uint64_t q_msk);
-
-/**
* Initialize bypass logic. This function needs to be called before
* executing any other bypass API.
*
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 72be66d..7594416 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -61,10 +61,6 @@ DPDK_2.2 {
rte_eth_dev_set_mtu;
rte_eth_dev_set_rx_queue_stats_mapping;
rte_eth_dev_set_tx_queue_stats_mapping;
- rte_eth_dev_set_vf_rx;
- rte_eth_dev_set_vf_rxmode;
- rte_eth_dev_set_vf_tx;
- rte_eth_dev_set_vf_vlan_filter;
rte_eth_dev_set_vlan_offload;
rte_eth_dev_set_vlan_pvid;
rte_eth_dev_set_vlan_strip_on_queue;
@@ -94,7 +90,6 @@ DPDK_2.2 {
rte_eth_rx_queue_info_get;
rte_eth_rx_queue_setup;
rte_eth_set_queue_rate_limit;
- rte_eth_set_vf_rate_limit;
rte_eth_stats;
rte_eth_stats_get;
rte_eth_stats_reset;
@@ -146,4 +141,4 @@ DPDK_16.11 {
rte_eth_dev_pci_probe;
rte_eth_dev_pci_remove;
-} DPDK_16.07;
+} DPDK_16.07;
\ No newline at end of file
--
2.10.1
^ permalink raw reply related
* [PATCH v4 5/7] net/ixgbe: remove static set VF functions
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481550626-14539-1-git-send-email-bernard.iremonger@intel.com>
remove the following static functions:
ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 193 ---------------------------------------
1 file changed, 193 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 37b82a4..8db1410 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -276,12 +276,6 @@ static void ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev);
static int ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct
ether_addr * mac_addr, uint8_t on);
static int ixgbe_uc_all_hash_table_set(struct rte_eth_dev *dev, uint8_t on);
-static int ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev, uint16_t pool,
- uint16_t rx_mask, uint8_t on);
-static int ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
- uint64_t pool_mask, uint8_t vlan_on);
static int ixgbe_mirror_rule_set(struct rte_eth_dev *dev,
struct rte_eth_mirror_conf *mirror_conf,
uint8_t rule_id, uint8_t on);
@@ -297,8 +291,6 @@ static void ixgbe_configure_msix(struct rte_eth_dev *dev);
static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
uint16_t queue_idx, uint16_t tx_rate);
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
- uint16_t tx_rate, uint64_t q_msk);
static void ixgbevf_add_mac_addr(struct rte_eth_dev *dev,
struct ether_addr *mac_addr,
@@ -568,12 +560,7 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
.uc_all_hash_table_set = ixgbe_uc_all_hash_table_set,
.mirror_rule_set = ixgbe_mirror_rule_set,
.mirror_rule_reset = ixgbe_mirror_rule_reset,
- .set_vf_rx_mode = ixgbe_set_pool_rx_mode,
- .set_vf_rx = ixgbe_set_pool_rx,
- .set_vf_tx = ixgbe_set_pool_tx,
- .set_vf_vlan_filter = ixgbe_set_pool_vlan_filter,
.set_queue_rate_limit = ixgbe_set_queue_rate_limit,
- .set_vf_rate_limit = ixgbe_set_vf_rate_limit,
.reta_update = ixgbe_dev_rss_reta_update,
.reta_query = ixgbe_dev_rss_reta_query,
#ifdef RTE_NIC_BYPASS
@@ -4547,132 +4534,6 @@ ixgbe_convert_vm_rx_mask_to_val(uint16_t rx_mask, uint32_t orig_val)
return new_val;
}
-static int
-ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev, uint16_t pool,
- uint16_t rx_mask, uint8_t on)
-{
- int val = 0;
-
- struct ixgbe_hw *hw =
- IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- uint32_t vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(pool));
-
- if (hw->mac.type == ixgbe_mac_82598EB) {
- PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
- " on 82599 hardware and newer");
- return -ENOTSUP;
- }
- if (ixgbe_vmdq_mode_check(hw) < 0)
- return -ENOTSUP;
-
- val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
-
- if (on)
- vmolr |= val;
- else
- vmolr &= ~val;
-
- IXGBE_WRITE_REG(hw, IXGBE_VMOLR(pool), vmolr);
-
- return 0;
-}
-
-static int
-ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
- uint32_t reg, addr;
- uint32_t val;
- const uint8_t bit1 = 0x1;
-
- struct ixgbe_hw *hw =
- IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
- if (ixgbe_vmdq_mode_check(hw) < 0)
- return -ENOTSUP;
-
- if (pool >= ETH_64_POOLS)
- return -EINVAL;
-
- /* for pool >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
- if (pool >= 32) {
- addr = IXGBE_VFRE(1);
- val = bit1 << (pool - 32);
- } else {
- addr = IXGBE_VFRE(0);
- val = bit1 << pool;
- }
-
- reg = IXGBE_READ_REG(hw, addr);
-
- if (on)
- reg |= val;
- else
- reg &= ~val;
-
- IXGBE_WRITE_REG(hw, addr, reg);
-
- return 0;
-}
-
-static int
-ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
- uint32_t reg, addr;
- uint32_t val;
- const uint8_t bit1 = 0x1;
-
- struct ixgbe_hw *hw =
- IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
- if (ixgbe_vmdq_mode_check(hw) < 0)
- return -ENOTSUP;
-
- if (pool >= ETH_64_POOLS)
- return -EINVAL;
-
- /* for pool >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
- if (pool >= 32) {
- addr = IXGBE_VFTE(1);
- val = bit1 << (pool - 32);
- } else {
- addr = IXGBE_VFTE(0);
- val = bit1 << pool;
- }
-
- reg = IXGBE_READ_REG(hw, addr);
-
- if (on)
- reg |= val;
- else
- reg &= ~val;
-
- IXGBE_WRITE_REG(hw, addr, reg);
-
- return 0;
-}
-
-static int
-ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
- uint64_t pool_mask, uint8_t vlan_on)
-{
- int ret = 0;
- uint16_t pool_idx;
- struct ixgbe_hw *hw =
- IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
- if (ixgbe_vmdq_mode_check(hw) < 0)
- return -ENOTSUP;
- for (pool_idx = 0; pool_idx < ETH_64_POOLS; pool_idx++) {
- if (pool_mask & ((uint64_t)(1ULL << pool_idx))) {
- ret = hw->mac.ops.set_vfta(hw, vlan, pool_idx,
- vlan_on, false);
- if (ret < 0)
- return ret;
- }
- }
-
- return ret;
-}
int
rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
@@ -5628,60 +5489,6 @@ static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
return 0;
}
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
- uint16_t tx_rate, uint64_t q_msk)
-{
- struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct ixgbe_vf_info *vfinfo =
- *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
- uint8_t nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
- uint32_t queue_stride =
- IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
- uint32_t queue_idx = vf * queue_stride, idx = 0, vf_idx;
- uint32_t queue_end = queue_idx + nb_q_per_pool - 1;
- uint16_t total_rate = 0;
-
- if (queue_end >= hw->mac.max_tx_queues)
- return -EINVAL;
-
- if (vfinfo != NULL) {
- for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
- if (vf_idx == vf)
- continue;
- for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
- idx++)
- total_rate += vfinfo[vf_idx].tx_rate[idx];
- }
- } else
- return -EINVAL;
-
- /* Store tx_rate for this vf. */
- for (idx = 0; idx < nb_q_per_pool; idx++) {
- if (((uint64_t)0x1 << idx) & q_msk) {
- if (vfinfo[vf].tx_rate[idx] != tx_rate)
- vfinfo[vf].tx_rate[idx] = tx_rate;
- total_rate += tx_rate;
- }
- }
-
- if (total_rate > dev->data->dev_link.link_speed) {
- /*
- * Reset stored TX rate of the VF if it causes exceed
- * link speed.
- */
- memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
- return -EINVAL;
- }
-
- /* Set RTTBCNRC of each queue/pool for vf X */
- for (; queue_idx <= queue_end; queue_idx++) {
- if (0x1 & q_msk)
- ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
- q_msk = q_msk >> 1;
- }
-
- return 0;
-}
static void
ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
--
2.10.1
^ permalink raw reply related
* [PATCH v4 4/7] examples/ethtool: use ixgbe public function
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481550626-14539-1-git-send-email-bernard.iremonger@intel.com>
Replace rte_eth_dev_set_vf_rxmode with rte_pmd_ixgbe_set_vf_rx_mode.
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
examples/ethtool/lib/rte_ethtool.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index a1f91d4..bf50660 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,9 @@
#include <rte_version.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
#include "rte_ethtool.h"
#define PKTPOOL_SIZE 512
@@ -353,9 +356,12 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
num_vfs = dev_info.max_vfs;
/* Set VF vf_rx_mode, VF unsupport status is discard */
- for (vf = 0; vf < num_vfs; vf++)
- rte_eth_dev_set_vf_rxmode(port_id, vf,
+ for (vf = 0; vf < num_vfs; vf++) {
+#ifdef RTE_LIBRTE_IXGBE_PMD
+ rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
ETH_VMDQ_ACCEPT_UNTAG, 0);
+#endif
+ }
/* Enable Rx vlan filter, VF unspport status is discard */
rte_eth_dev_set_vlan_offload(port_id, ETH_VLAN_FILTER_MASK);
--
2.10.1
^ permalink raw reply related
* [PATCH v4 3/7] app/testpmd: cleanup parameter checking
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481550626-14539-1-git-send-email-bernard.iremonger@intel.com>
Parameter checking is done in the rte_pmd_ixgbe_* functions.
Remove parameter checking from before calls to the rte_pmd_ixgbe_*
functions.
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
app/test-pmd/config.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 73b0ffa..fc0424a 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2333,8 +2333,6 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
{
int diag;
- if (port_id_is_invalid(port_id, ENABLED_WARN))
- return;
if (is_rx)
diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
else
@@ -2356,11 +2354,6 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
{
int diag;
- if (port_id_is_invalid(port_id, ENABLED_WARN))
- return;
- if (vlan_id_is_invalid(vlan_id))
- return;
-
diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
if (diag == 0)
@@ -2397,19 +2390,7 @@ int
set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
{
int diag;
- struct rte_eth_link link;
-
- if (q_msk == 0)
- return 0;
- if (port_id_is_invalid(port_id, ENABLED_WARN))
- return 1;
- rte_eth_link_get_nowait(port_id, &link);
- if (rate > link.link_speed) {
- printf("Invalid rate value:%u bigger than link speed: %u\n",
- rate, link.link_speed);
- return 1;
- }
diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
if (diag == 0)
return diag;
--
2.10.1
^ permalink raw reply related
* [PATCH v4 2/7] app/testpmd: use ixgbe public functions
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481550626-14539-1-git-send-email-bernard.iremonger@intel.com>
Use the the following ixgbe public functions:
rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
app/test-pmd/cmdline.c | 18 +++++++++++++-----
app/test-pmd/config.c | 26 ++++++++++++++++++--------
2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d03a592..ed84d7a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6614,6 +6614,7 @@ cmdline_parse_inst_t cmd_set_vf_macvlan_filter = {
},
};
+#ifdef RTE_LIBRTE_IXGBE_PMD
/* *** CONFIGURE VF TRAFFIC CONTROL *** */
struct cmd_set_vf_traffic {
cmdline_fixed_string_t set;
@@ -6674,7 +6675,9 @@ cmdline_parse_inst_t cmd_set_vf_traffic = {
NULL,
},
};
+#endif
+#ifdef RTE_LIBRTE_IXGBE_PMD
/* *** CONFIGURE VF RECEIVE MODE *** */
struct cmd_set_vf_rxmode {
cmdline_fixed_string_t set;
@@ -6708,7 +6711,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
}
- ret = rte_eth_dev_set_vf_rxmode(res->port_id,res->vf_id,rx_mode,(uint8_t)is_on);
+ ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
if (ret < 0)
printf("bad VF receive mode parameter, return code = %d \n",
ret);
@@ -6756,6 +6759,7 @@ cmdline_parse_inst_t cmd_set_vf_rxmode = {
NULL,
},
};
+#endif
/* *** ADD MAC ADDRESS FILTER FOR A VF OF A PORT *** */
struct cmd_vf_mac_addr_result {
@@ -6822,6 +6826,7 @@ cmdline_parse_inst_t cmd_vf_mac_addr_filter = {
},
};
+#ifdef RTE_LIBRTE_IXGBE_PMD
/* *** ADD/REMOVE A VLAN IDENTIFIER TO/FROM A PORT VLAN RX FILTER *** */
struct cmd_vf_rx_vlan_filter {
cmdline_fixed_string_t rx_vlan;
@@ -6884,6 +6889,7 @@ cmdline_parse_inst_t cmd_vf_rxvlan_filter = {
NULL,
},
};
+#endif
/* *** SET RATE LIMIT FOR A QUEUE OF A PORT *** */
struct cmd_queue_rate_limit_result {
@@ -6952,6 +6958,7 @@ cmdline_parse_inst_t cmd_queue_rate_limit = {
},
};
+#ifdef RTE_LIBRTE_IXGBE_PMD
/* *** SET RATE LIMIT FOR A VF OF A PORT *** */
struct cmd_vf_rate_limit_result {
cmdline_fixed_string_t set;
@@ -7030,6 +7037,7 @@ cmdline_parse_inst_t cmd_vf_rate_limit = {
NULL,
},
};
+#endif
/* *** ADD TUNNEL FILTER OF A PORT *** */
struct cmd_tunnel_filter_result {
@@ -11561,15 +11569,11 @@ cmdline_parse_ctx_t main_ctx[] = {
(cmdline_parse_inst_t *)&cmd_config_burst,
(cmdline_parse_inst_t *)&cmd_config_thresh,
(cmdline_parse_inst_t *)&cmd_config_threshold,
- (cmdline_parse_inst_t *)&cmd_set_vf_rxmode,
(cmdline_parse_inst_t *)&cmd_set_uc_hash_filter,
(cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter,
(cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter,
(cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter,
- (cmdline_parse_inst_t *)&cmd_set_vf_traffic,
- (cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,
(cmdline_parse_inst_t *)&cmd_queue_rate_limit,
- (cmdline_parse_inst_t *)&cmd_vf_rate_limit,
(cmdline_parse_inst_t *)&cmd_tunnel_filter,
(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
(cmdline_parse_inst_t *)&cmd_global_config,
@@ -11624,6 +11628,10 @@ cmdline_parse_ctx_t main_ctx[] = {
(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
+ (cmdline_parse_inst_t *)&cmd_set_vf_rxmode,
+ (cmdline_parse_inst_t *)&cmd_set_vf_traffic,
+ (cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,
+ (cmdline_parse_inst_t *)&cmd_vf_rate_limit,
#endif
NULL,
};
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf537d..73b0ffa 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@
#include <rte_ethdev.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
#include "testpmd.h"
@@ -2324,6 +2327,7 @@ fdir_set_flex_payload(portid_t port_id, struct rte_eth_flex_payload_cfg *cfg)
}
+#ifdef RTE_LIBRTE_IXGBE_PMD
void
set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
{
@@ -2332,16 +2336,17 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
if (is_rx)
- diag = rte_eth_dev_set_vf_rx(port_id,vf,on);
+ diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
else
- diag = rte_eth_dev_set_vf_tx(port_id,vf,on);
+ diag = rte_pmd_ixgbe_set_vf_tx(port_id, vf, on);
+
if (diag == 0)
return;
if(is_rx)
- printf("rte_eth_dev_set_vf_rx for port_id=%d failed "
+ printf("rte_pmd_ixgbe_set_vf_rx for port_id=%d failed "
"diag=%d\n", port_id, diag);
else
- printf("rte_eth_dev_set_vf_tx for port_id=%d failed "
+ printf("rte_pmd_ixgbe_set_vf_tx for port_id=%d failed "
"diag=%d\n", port_id, diag);
}
@@ -2355,12 +2360,15 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
return;
if (vlan_id_is_invalid(vlan_id))
return;
- diag = rte_eth_dev_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+
+ diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+
if (diag == 0)
return;
- printf("rte_eth_dev_set_vf_vlan_filter for port_id=%d failed "
+ printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
"diag=%d\n", port_id, diag);
}
+#endif
int
set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
@@ -2384,6 +2392,7 @@ set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
return diag;
}
+#ifdef RTE_LIBRTE_IXGBE_PMD
int
set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
{
@@ -2401,13 +2410,14 @@ set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
rate, link.link_speed);
return 1;
}
- diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
+ diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
if (diag == 0)
return diag;
- printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
+ printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
port_id, diag);
return diag;
}
+#endif
/*
* Functions to manage the set of filtered Multicast MAC addresses.
--
2.10.1
^ permalink raw reply related
* [PATCH v4 1/7] net/ixgbe: move set VF functions from the ethdev
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481550626-14539-1-git-send-email-bernard.iremonger@intel.com>
Move the following functions from eth_dev_ops to the ixgbe PMD and rename:
ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit
Rename the functions to the following:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit
Use public function internally
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 266 +++++++++++++++++++++++++++-
drivers/net/ixgbe/rte_pmd_ixgbe.h | 104 +++++++++++
drivers/net/ixgbe/rte_pmd_ixgbe_version.map | 10 ++
3 files changed, 379 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..37b82a4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2294,7 +2294,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
for (vf = 0; vf < dev->pci_dev->max_vfs; vf++)
for (idx = 0; idx < IXGBE_MAX_QUEUE_NUM_PER_VF; idx++)
if (vfinfo[vf].tx_rate[idx] != 0)
- ixgbe_set_vf_rate_limit(dev, vf,
+ rte_pmd_ixgbe_set_vf_rate_limit(
+ dev->data->port_id, vf,
vfinfo[vf].tx_rate[idx],
1 << idx);
}
@@ -4883,6 +4884,269 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
return 0;
}
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on)
+{
+ int val = 0;
+ struct rte_eth_dev *dev;
+ struct rte_eth_dev_info dev_info;
+ struct ixgbe_hw *hw;
+ uint32_t vmolr;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+ dev = &rte_eth_devices[port];
+ rte_eth_dev_info_get(port, &dev_info);
+
+ if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ return -ENOTSUP;
+
+ if (vf >= dev_info.max_vfs)
+ return -EINVAL;
+
+ if (on > 1)
+ return -EINVAL;
+
+ hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
+
+ if (hw->mac.type == ixgbe_mac_82598EB) {
+ PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
+ " on 82599 hardware and newer");
+ return -ENOTSUP;
+ }
+ if (ixgbe_vmdq_mode_check(hw) < 0)
+ return -ENOTSUP;
+
+ val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
+
+ if (on)
+ vmolr |= val;
+ else
+ vmolr &= ~val;
+
+ IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
+
+ return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
+{
+ struct rte_eth_dev *dev;
+ struct rte_eth_dev_info dev_info;
+ uint32_t reg, addr;
+ uint32_t val;
+ const uint8_t bit1 = 0x1;
+ struct ixgbe_hw *hw;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+ dev = &rte_eth_devices[port];
+ rte_eth_dev_info_get(port, &dev_info);
+
+ if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ return -ENOTSUP;
+
+ if (vf >= dev_info.max_vfs)
+ return -EINVAL;
+
+ if (on > 1)
+ return -EINVAL;
+
+ hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+ if (ixgbe_vmdq_mode_check(hw) < 0)
+ return -ENOTSUP;
+
+ /* for vf >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+ if (vf >= 32) {
+ addr = IXGBE_VFRE(1);
+ val = bit1 << (vf - 32);
+ } else {
+ addr = IXGBE_VFRE(0);
+ val = bit1 << vf;
+ }
+
+ reg = IXGBE_READ_REG(hw, addr);
+
+ if (on)
+ reg |= val;
+ else
+ reg &= ~val;
+
+ IXGBE_WRITE_REG(hw, addr, reg);
+
+ return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
+{
+ struct rte_eth_dev *dev;
+ struct rte_eth_dev_info dev_info;
+ uint32_t reg, addr;
+ uint32_t val;
+ const uint8_t bit1 = 0x1;
+
+ struct ixgbe_hw *hw;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+ dev = &rte_eth_devices[port];
+ rte_eth_dev_info_get(port, &dev_info);
+
+ if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ return -ENOTSUP;
+
+ if (vf >= dev_info.max_vfs)
+ return -EINVAL;
+
+ if (on > 1)
+ return -EINVAL;
+
+ hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ if (ixgbe_vmdq_mode_check(hw) < 0)
+ return -ENOTSUP;
+
+ /* for vf >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+ if (vf >= 32) {
+ addr = IXGBE_VFTE(1);
+ val = bit1 << (vf - 32);
+ } else {
+ addr = IXGBE_VFTE(0);
+ val = bit1 << vf;
+ }
+
+ reg = IXGBE_READ_REG(hw, addr);
+
+ if (on)
+ reg |= val;
+ else
+ reg &= ~val;
+
+ IXGBE_WRITE_REG(hw, addr, reg);
+
+ return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
+ uint64_t vf_mask, uint8_t vlan_on)
+{
+ struct rte_eth_dev *dev;
+ struct rte_eth_dev_info dev_info;
+ int ret = 0;
+ uint16_t vf_idx;
+ struct ixgbe_hw *hw;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+ dev = &rte_eth_devices[port];
+ rte_eth_dev_info_get(port, &dev_info);
+
+ if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ return -ENOTSUP;
+
+ if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
+ return -EINVAL;
+
+ hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ if (ixgbe_vmdq_mode_check(hw) < 0)
+ return -ENOTSUP;
+
+ for (vf_idx = 0; vf_idx < 64; vf_idx++) {
+ if (vf_mask & ((uint64_t)(1ULL << vf_idx))) {
+ ret = hw->mac.ops.set_vfta(hw, vlan, vf_idx,
+ vlan_on, false);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
+ return ret;
+}
+
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
+ uint16_t tx_rate, uint64_t q_msk)
+{
+ struct rte_eth_dev *dev;
+ struct rte_eth_dev_info dev_info;
+ struct ixgbe_hw *hw;
+ struct ixgbe_vf_info *vfinfo;
+ struct rte_eth_link link;
+ uint8_t nb_q_per_pool;
+ uint32_t queue_stride;
+ uint32_t queue_idx, idx = 0, vf_idx;
+ uint32_t queue_end;
+ uint16_t total_rate = 0;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+ dev = &rte_eth_devices[port];
+ rte_eth_dev_info_get(port, &dev_info);
+ rte_eth_link_get_nowait(port, &link);
+
+ if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ return -ENOTSUP;
+
+ if (vf >= dev_info.max_vfs)
+ return -EINVAL;
+
+ if (tx_rate > link.link_speed)
+ return -EINVAL;
+
+ if (q_msk == 0)
+ return 0;
+
+ hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+ nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
+ queue_stride = IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+ queue_idx = vf * queue_stride;
+ queue_end = queue_idx + nb_q_per_pool - 1;
+ if (queue_end >= hw->mac.max_tx_queues)
+ return -EINVAL;
+
+ if (vfinfo) {
+ for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+ if (vf_idx == vf)
+ continue;
+ for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
+ idx++)
+ total_rate += vfinfo[vf_idx].tx_rate[idx];
+ }
+ } else {
+ return -EINVAL;
+ }
+
+ /* Store tx_rate for this vf. */
+ for (idx = 0; idx < nb_q_per_pool; idx++) {
+ if (((uint64_t)0x1 << idx) & q_msk) {
+ if (vfinfo[vf].tx_rate[idx] != tx_rate)
+ vfinfo[vf].tx_rate[idx] = tx_rate;
+ total_rate += tx_rate;
+ }
+ }
+
+ if (total_rate > dev->data->dev_link.link_speed) {
+ /* Reset stored TX rate of the VF if it causes exceed
+ * link speed.
+ */
+ memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
+ return -EINVAL;
+ }
+
+ /* Set RTTBCNRC of each queue/pool for vf X */
+ for (; queue_idx <= queue_end; queue_idx++) {
+ if (0x1 & q_msk)
+ ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
+ q_msk = q_msk >> 1;
+ }
+
+ return 0;
+}
+
#define IXGBE_MRCTL_VPME 0x01 /* Virtual Pool Mirroring. */
#define IXGBE_MRCTL_UPME 0x02 /* Uplink Port Mirroring. */
#define IXGBE_MRCTL_DPME 0x04 /* Downlink Port Mirroring. */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index c2fb826..4eb0c9a 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -183,6 +183,110 @@ int
rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
/**
+* Set RX L2 Filtering mode of a VF of an Ethernet device.
+*
+* @param port
+* The port identifier of the Ethernet device.
+* @param vf
+* VF id.
+* @param rx_mode
+* The RX mode mask, which is one or more of accepting Untagged Packets,
+* packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
+* ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
+* ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
+* in rx_mode.
+* @param on
+* 1 - Enable a VF RX mode.
+* 0 - Disable a VF RX mode.
+* @return
+* - (0) if successful.
+* - (-ENOTSUP) if hardware doesn't support.
+* - (-ENODEV) if *port_id* invalid.
+* - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
+
+/**
+* Enable or disable a VF traffic receive of an Ethernet device.
+*
+* @param port
+* The port identifier of the Ethernet device.
+* @param vf
+* VF id.
+* @param on
+* 1 - Enable a VF traffic receive.
+* 0 - Disable a VF traffic receive.
+* @return
+* - (0) if successful.
+* - (-ENOTSUP) if hardware doesn't support.
+* - (-ENODEV) if *port_id* invalid.
+* - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable or disable a VF traffic transmit of the Ethernet device.
+*
+* @param port
+* The port identifier of the Ethernet device.
+* @param vf
+* VF id.
+* @param on
+* 1 - Enable a VF traffic transmit.
+* 0 - Disable a VF traffic transmit.
+* @return
+* - (0) if successful.
+* - (-ENODEV) if *port_id* invalid.
+* - (-ENOTSUP) if hardware doesn't support.
+* - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
+* received VLAN packets tagged with a given VLAN Tag Identifier.
+*
+* @param port id
+* The port identifier of the Ethernet device.
+* @param vlan_id
+* The VLAN Tag Identifier whose filtering must be enabled or disabled.
+* @param vf_mask
+* Bitmap listing which VFs participate in the VLAN filtering.
+* @param vlan_on
+* 1 - Enable VFs VLAN filtering.
+* 0 - Disable VFs VLAN filtering.
+* @return
+* - (0) if successful.
+* - (-ENOTSUP) if hardware doesn't support.
+* - (-ENODEV) if *port_id* invalid.
+* - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
+
+/**
+ * Set the rate limitation for a vf on an Ethernet device.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param vf
+ * VF id.
+ * @param tx_rate
+ * The tx rate allocated from the total link speed for this VF id.
+ * @param q_msk
+ * The queue mask which need to set the rate.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
+
+/**
* Response sent back to ixgbe driver from user app after callback
*/
enum rte_pmd_ixgbe_mb_event_rsp {
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index 92434f3..5252bc2 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -15,3 +15,13 @@ DPDK_16.11 {
rte_pmd_ixgbe_set_vf_vlan_insert;
rte_pmd_ixgbe_set_vf_vlan_stripq;
} DPDK_2.0;
+
+DPDK_17.02 {
+ global:
+
+ rte_pmd_ixgbe_set_vf_rate_limit;
+ rte_pmd_ixgbe_set_vf_rx;
+ rte_pmd_ixgbe_set_vf_rxmode;
+ rte_pmd_ixgbe_set_vf_tx;
+ rte_pmd_ixgbe_set_vf_vlan_filter;
+} DPDK_16.11;
\ No newline at end of file
--
2.10.1
^ permalink raw reply related
* [PATCH v4 0/7] net/ixgbe: move set VF functions.
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481550626-14539-1-git-send-email-bernard.iremonger@intel.com>
This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether
Changes in V4:
Fixed compile issues when ixgbe PMD is not present.
Removed duplicate testpmd commands.
Added cleanup patch for testpmd.
Updated release note.
Changes in V3:
Updated LIBABIVER in Makefile in librte_ether patch.
Updated rte_ethdev.h and ret_ether_version.map in librte_ether patch.
Squashed deprecation notice patch into librte_ether patch.
Added release_note patch.
Changes in V2:
Update testpmd set vf commands help messages.
Updated ethtool to use the ixgbe public API's.
Removed the ixgbe_set_pool_* and ixgbe_set_vf_rate_limit functions.
Removed the rte_eth_dev_set_vf_* API's
Removed the deprecation notice.
Changes in V1:
The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:
ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit
Renamed the functions to the following:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit
Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit
New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
The testpmd user guide has been updated for the new commands.
Bernard Iremonger (7):
net/ixgbe: move set VF functions from the ethdev
app/testpmd: use ixgbe public functions
app/testpmd: cleanup parameter checking
examples/ethtool: use ixgbe public function
net/ixgbe: remove static set VF functions
librte_ether: remove the set VF API's
doc: update release notes
app/test-pmd/cmdline.c | 18 +-
app/test-pmd/config.c | 43 ++-
doc/guides/rel_notes/deprecation.rst | 13 -
doc/guides/rel_notes/release_17_02.rst | 23 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 459 ++++++++++++++++------------
drivers/net/ixgbe/rte_pmd_ixgbe.h | 104 +++++++
drivers/net/ixgbe/rte_pmd_ixgbe_version.map | 10 +
examples/ethtool/lib/rte_ethtool.c | 12 +-
lib/librte_ether/Makefile | 4 +-
lib/librte_ether/rte_ethdev.c | 129 --------
lib/librte_ether/rte_ethdev.h | 140 ---------
lib/librte_ether/rte_ether_version.map | 7 +-
12 files changed, 442 insertions(+), 520 deletions(-)
--
2.10.1
^ permalink raw reply
* [PATCH] doc: correct source extract command
From: Baruch Siach @ 2016-12-13 11:18 UTC (permalink / raw)
To: dev; +Cc: John McNamara, David Marchand, Baruch Siach
DPDK source archives are .tar.xz or .tar.gz, not .zip. Use .tar.xz in the
instructions, since that is what the main download page links to.
Also, correct the archive file and directory name capitalization.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
doc/guides/linux_gsg/build_dpdk.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index 527c38dc9a9b..51a6210620a8 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -45,8 +45,8 @@ First, uncompress the archive and move to the uncompressed DPDK source directory
.. code-block:: console
- unzip DPDK-<version>.zip
- cd DPDK-<version>
+ tar xJf dpdk-<version>.tar.xz
+ cd dpdk-<version>
The DPDK is composed of several directories:
--
2.10.2
^ permalink raw reply related
* Re: [PATCH 06/13] null: fake PMD capabilities
From: Ananyev, Konstantin @ 2016-12-13 10:48 UTC (permalink / raw)
To: Michal Miroslaw, dev@dpdk.org
In-Reply-To: <d393aff59d03e46fc878f874e30ba53216efb396.1481590851.git.mirq-linux@rere.qmqm.pl>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Miroslaw
> Sent: Tuesday, December 13, 2016 1:08 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 06/13] null: fake PMD capabilities
>
> From: Paweł Małachowski <pawel.malachowski@atendesoftware.pl>
>
> Thanks to that change we can use Null PMD for testing purposes.
>
> Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
> ---
> drivers/net/null/rte_eth_null.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
> index 836d982..f32ba2a 100644
> --- a/drivers/net/null/rte_eth_null.c
> +++ b/drivers/net/null/rte_eth_null.c
> @@ -284,6 +284,9 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
> return 0;
> }
>
> +static void
> +eth_dev_void_ok(struct rte_eth_dev *dev __rte_unused) { return; }
> +
>
> static void
> eth_dev_info(struct rte_eth_dev *dev,
> @@ -304,6 +307,9 @@ eth_dev_info(struct rte_eth_dev *dev,
> dev_info->pci_dev = NULL;
> dev_info->reta_size = internals->reta_size;
> dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads;
> + /* We hereby declare we can RX-offload VLAN-s out of thin air and update checksums and VLANs before sinking packets in
> /dev/null */
> + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
> + dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_IPV4_CKSUM;
Hmm, how could it be supported if all that null PMD does on TX - just free the packets?
Same question for RX.
Konstantin
> }
>
> static void
> @@ -477,7 +483,12 @@ static const struct eth_dev_ops ops = {
> .reta_update = eth_rss_reta_update,
> .reta_query = eth_rss_reta_query,
> .rss_hash_update = eth_rss_hash_update,
> - .rss_hash_conf_get = eth_rss_hash_conf_get
> + .rss_hash_conf_get = eth_rss_hash_conf_get,
> + /* Fake our capabilities */
> + .promiscuous_enable = eth_dev_void_ok,
> + .promiscuous_disable = eth_dev_void_ok,
> + .allmulticast_enable = eth_dev_void_ok,
> + .allmulticast_disable = eth_dev_void_ok
> };
>
> int
> --
> 2.10.2
^ permalink raw reply
* Re: [PATCH 05/13] acl: fix acl_flow_data comments
From: Ananyev, Konstantin @ 2016-12-13 10:43 UTC (permalink / raw)
To: Michal Miroslaw, dev@dpdk.org
In-Reply-To: <575c97e9aa780b0c5f8d7f0e38ed3f6f308f7669.1481590851.git.mirq-linux@rere.qmqm.pl>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Miroslaw
> Sent: Tuesday, December 13, 2016 1:08 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 05/13] acl: fix acl_flow_data comments
>
> Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
> ---
> lib/librte_acl/acl_run.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
> index 024f393..a862ff6 100644
> --- a/lib/librte_acl/acl_run.h
> +++ b/lib/librte_acl/acl_run.h
> @@ -69,10 +69,10 @@ struct acl_flow_data {
> uint32_t trie;
> /* current trie index (0 to N-1) */
> uint32_t cmplt_size;
> + /* maximum number of packets to process */
> uint32_t total_packets;
> - uint32_t categories;
> /* number of result categories per packet. */
> - /* maximum number of packets to process */
> + uint32_t categories;
> const uint64_t *trans;
> const uint8_t **data;
> uint32_t *results;
> --
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 2.10.2
^ permalink raw reply
* Re: [PATCH 04/13] acl: allow zero verdict
From: Ananyev, Konstantin @ 2016-12-13 10:36 UTC (permalink / raw)
To: Michal Miroslaw, dev@dpdk.org
In-Reply-To: <f6d14b640928f69ab747793cd8749b48a1b74afb.1481590851.git.mirq-linux@rere.qmqm.pl>
Hi Michal,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Miroslaw
> Sent: Tuesday, December 13, 2016 1:08 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 04/13] acl: allow zero verdict
>
> Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
> ---
> lib/librte_acl/rte_acl.c | 3 +--
> lib/librte_acl/rte_acl.h | 2 --
> lib/librte_table/rte_table_acl.c | 2 +-
> 3 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
> index 8b7e92c..d1f40be 100644
> --- a/lib/librte_acl/rte_acl.c
> +++ b/lib/librte_acl/rte_acl.c
> @@ -313,8 +313,7 @@ acl_check_rule(const struct rte_acl_rule_data *rd)
> if ((RTE_LEN2MASK(RTE_ACL_MAX_CATEGORIES, typeof(rd->category_mask)) &
> rd->category_mask) == 0 ||
> rd->priority > RTE_ACL_MAX_PRIORITY ||
> - rd->priority < RTE_ACL_MIN_PRIORITY ||
> - rd->userdata == RTE_ACL_INVALID_USERDATA)
> + rd->priority < RTE_ACL_MIN_PRIORITY)
> return -EINVAL;
> return 0;
> }
I am not sure, how it supposed to work properly?
Zero value is reserved and ifnicates that no match were found for that input.
Konstantin
> diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h
> index caa91f7..b53179a 100644
> --- a/lib/librte_acl/rte_acl.h
> +++ b/lib/librte_acl/rte_acl.h
> @@ -120,8 +120,6 @@ enum {
> RTE_ACL_MIN_PRIORITY = 0,
> };
>
> -#define RTE_ACL_INVALID_USERDATA 0
> -
> #define RTE_ACL_MASKLEN_TO_BITMASK(v, s) \
> ((v) == 0 ? (v) : (typeof(v))((uint64_t)-1 << ((s) * CHAR_BIT - (v))))
>
> diff --git a/lib/librte_table/rte_table_acl.c b/lib/librte_table/rte_table_acl.c
> index 8f1f8ce..94b69a9 100644
> --- a/lib/librte_table/rte_table_acl.c
> +++ b/lib/librte_table/rte_table_acl.c
> @@ -792,7 +792,7 @@ rte_table_acl_lookup(
>
> pkts_mask &= ~pkt_mask;
>
> - if (action_table_pos != RTE_ACL_INVALID_USERDATA) {
> + if (action_table_pos != 0) {
> pkts_out_mask |= pkt_mask;
> entries[pkt_pos] = (void *)
> &acl->memory[action_table_pos *
> --
> 2.10.2
^ permalink raw reply
* Re: [PATCH] vhost: Introduce vhost-user's REPLY_ACK feature
From: Maxime Coquelin @ 2016-12-13 10:14 UTC (permalink / raw)
To: Yuanhan Liu; +Cc: dev
In-Reply-To: <20161213100306.GD18991@yliu-dev.sh.intel.com>
On 12/13/2016 11:03 AM, Yuanhan Liu wrote:
> On Tue, Dec 13, 2016 at 10:57:10AM +0100, Maxime Coquelin wrote:
>>
>>
>> On 12/13/2016 10:56 AM, Yuanhan Liu wrote:
>>> On Mon, Dec 12, 2016 at 06:54:00PM +0100, Maxime Coquelin wrote:
>>>> REPLY_ACK features provide a generic way for QEMU to ensure both
>>>> completion and success of a request.
>>>>
>>>> As described in vhost-user spec in QEMU repository, QEMU sets
>>>> VHOST_USER_NEED_REPLY flag (bit 3) when expecting a reply_ack from
>>>> the backend. Backend must reply with 0 for success or non-zero
>>>> otherwise when flag is set.
>>>>
>>>> Currently, only VHOST_USER_SET_MEM_TABLE request implements reply_ack,
>>>> in order to synchronize mapping updates.
>>>>
>>>> This patch enables REPLY_ACK feature generally, but only checks error
>>>> code for VHOST_USER_SET_MEM_TABLE.
>>>>
>>>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>
>>> Thanks for the patch: it looks good and straightforward to me.
>> Good!
>>
>>>
>>>> ---
>>>> Hi,
>>>>
>>>> The intend of this patch is not to fix a known issue, but it is
>>>> nice to have this feature, and it will be used by upcoming MTU
>>>> feature if it remains in its current form.
>>>
>>> Just asking, when do you plan to send out the patches?
>> As soon as QEMU part is accepted, because changes in QEMU series
>> may impact DPDK's one.
>
> But maybe you could send them out earlier, so that we could have
> understand it better?
Sure, makes sense.
I'll try to send a RFC next week, that we could merge only once QEMU
part accepted.
Thanks,
Maxime
^ permalink raw reply
* [PATCH] doc: fix required tools list layout
From: Baruch Siach @ 2016-12-13 10:03 UTC (permalink / raw)
To: dev; +Cc: John McNamara, David Marchand, Baruch Siach
The Python requirement should appear in the bullet list.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
doc/guides/linux_gsg/sys_reqs.rst | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index 3d743421595a..621cc9ddaef6 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -84,9 +84,7 @@ Compilation of the DPDK
x86_x32 ABI is currently supported with distribution packages only on Ubuntu
higher than 13.10 or recent Debian distribution. The only supported compiler is gcc 4.9+.
-.. note::
-
- Python, version 2.6 or 2.7, to use various helper scripts included in the DPDK package.
+* Python, version 2.6 or 2.7, to use various helper scripts included in the DPDK package.
**Optional Tools:**
--
2.10.2
^ permalink raw reply related
* Re: [PATCH] vhost: Introduce vhost-user's REPLY_ACK feature
From: Yuanhan Liu @ 2016-12-13 10:03 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: dev
In-Reply-To: <bb639f86-526d-f9aa-3e50-2b4a02e221a1@redhat.com>
On Tue, Dec 13, 2016 at 10:57:10AM +0100, Maxime Coquelin wrote:
>
>
> On 12/13/2016 10:56 AM, Yuanhan Liu wrote:
> >On Mon, Dec 12, 2016 at 06:54:00PM +0100, Maxime Coquelin wrote:
> >>REPLY_ACK features provide a generic way for QEMU to ensure both
> >>completion and success of a request.
> >>
> >>As described in vhost-user spec in QEMU repository, QEMU sets
> >>VHOST_USER_NEED_REPLY flag (bit 3) when expecting a reply_ack from
> >>the backend. Backend must reply with 0 for success or non-zero
> >>otherwise when flag is set.
> >>
> >>Currently, only VHOST_USER_SET_MEM_TABLE request implements reply_ack,
> >>in order to synchronize mapping updates.
> >>
> >>This patch enables REPLY_ACK feature generally, but only checks error
> >>code for VHOST_USER_SET_MEM_TABLE.
> >>
> >>Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >
> >Thanks for the patch: it looks good and straightforward to me.
> Good!
>
> >
> >>---
> >>Hi,
> >>
> >>The intend of this patch is not to fix a known issue, but it is
> >>nice to have this feature, and it will be used by upcoming MTU
> >>feature if it remains in its current form.
> >
> >Just asking, when do you plan to send out the patches?
> As soon as QEMU part is accepted, because changes in QEMU series
> may impact DPDK's one.
But maybe you could send them out earlier, so that we could have
understand it better?
--yliu
^ permalink raw reply
* Re: [PATCH] vhost: Introduce vhost-user's REPLY_ACK feature
From: Maxime Coquelin @ 2016-12-13 9:57 UTC (permalink / raw)
To: Yuanhan Liu; +Cc: dev
In-Reply-To: <20161213095602.GC18991@yliu-dev.sh.intel.com>
On 12/13/2016 10:56 AM, Yuanhan Liu wrote:
> On Mon, Dec 12, 2016 at 06:54:00PM +0100, Maxime Coquelin wrote:
>> REPLY_ACK features provide a generic way for QEMU to ensure both
>> completion and success of a request.
>>
>> As described in vhost-user spec in QEMU repository, QEMU sets
>> VHOST_USER_NEED_REPLY flag (bit 3) when expecting a reply_ack from
>> the backend. Backend must reply with 0 for success or non-zero
>> otherwise when flag is set.
>>
>> Currently, only VHOST_USER_SET_MEM_TABLE request implements reply_ack,
>> in order to synchronize mapping updates.
>>
>> This patch enables REPLY_ACK feature generally, but only checks error
>> code for VHOST_USER_SET_MEM_TABLE.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> Thanks for the patch: it looks good and straightforward to me.
Good!
>
>> ---
>> Hi,
>>
>> The intend of this patch is not to fix a known issue, but it is
>> nice to have this feature, and it will be used by upcoming MTU
>> feature if it remains in its current form.
>
> Just asking, when do you plan to send out the patches?
As soon as QEMU part is accepted, because changes in QEMU series
may impact DPDK's one.
Cheers,
Maxime
^ permalink raw reply
* Re: [PATCH] vhost: Introduce vhost-user's REPLY_ACK feature
From: Yuanhan Liu @ 2016-12-13 9:56 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: dev
In-Reply-To: <20161212175400.7978-1-maxime.coquelin@redhat.com>
On Mon, Dec 12, 2016 at 06:54:00PM +0100, Maxime Coquelin wrote:
> REPLY_ACK features provide a generic way for QEMU to ensure both
> completion and success of a request.
>
> As described in vhost-user spec in QEMU repository, QEMU sets
> VHOST_USER_NEED_REPLY flag (bit 3) when expecting a reply_ack from
> the backend. Backend must reply with 0 for success or non-zero
> otherwise when flag is set.
>
> Currently, only VHOST_USER_SET_MEM_TABLE request implements reply_ack,
> in order to synchronize mapping updates.
>
> This patch enables REPLY_ACK feature generally, but only checks error
> code for VHOST_USER_SET_MEM_TABLE.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks for the patch: it looks good and straightforward to me.
> ---
> Hi,
>
> The intend of this patch is not to fix a known issue, but it is
> nice to have this feature, and it will be used by upcoming MTU
> feature if it remains in its current form.
Just asking, when do you plan to send out the patches?
--yliu
^ permalink raw reply
* Re: [PATCH v3] vhost: allow for many vhost user ports
From: Yuanhan Liu @ 2016-12-13 9:14 UTC (permalink / raw)
To: Jan Wickbom; +Cc: dev, patrik.r.andersson
In-Reply-To: <1481561434-28675-1-git-send-email-jan.wickbom@ericsson.com>
On Mon, Dec 12, 2016 at 05:50:34PM +0100, Jan Wickbom wrote:
> Currently select() is used to monitor file descriptors for vhostuser
> ports. This limits the number of ports possible to create since the
> fd number is used as index in the fd_set and we have seen fds > 1023.
> This patch changes select() to poll(). This way we can keep an
> packed (pollfd) array for the fds, e.g. as many fds as the size of
> the array.
>
> Also see:
> http://dpdk.org/ml/archives/dev/2016-April/037024.html
>
> Signed-off-by: Jan Wickbom <jan.wickbom@ericsson.com>
> Reported-by: Patrik Andersson <patrik.r.andersson@ericsson.com>
...
> +static struct pollfd rwfds[MAX_FDS];
Though it's unlikely, but just assume we have multiple instance of
fdset_event_dispatch(pfdset), a global rwfds will not work.
Thought twice, and it's better to put it into the fdset struct:
struct fdset {
struct fdentry fd[MAX_FDS];
struct pollfd rwfds[MAX_FDS];
...
> /**
> * This functions runs in infinite blocking loop until there is no fd in
> * pfdset. It calls corresponding r/w handler if there is event on the fd.
> @@ -229,55 +217,71 @@
> void
> fdset_event_dispatch(struct fdset *pfdset)
> {
> - fd_set rfds, wfds;
> - int i, maxfds;
> + int i;
> struct fdentry *pfdentry;
> - int num = MAX_FDS;
> fd_cb rcb, wcb;
> void *dat;
> int fd;
> int remove1, remove2;
> - int ret;
>
> if (pfdset == NULL)
> return;
>
> - while (1) {
> - struct timeval tv;
> - tv.tv_sec = 1;
> - tv.tv_usec = 0;
> - FD_ZERO(&rfds);
> - FD_ZERO(&wfds);
> - pthread_mutex_lock(&pfdset->fd_mutex);
> -
> - maxfds = fdset_fill(&rfds, &wfds, pfdset);
> -
> - pthread_mutex_unlock(&pfdset->fd_mutex);
> + memset(rwfds, 0, sizeof(rwfds));
>
> + while (1) {
> /*
> - * When select is blocked, other threads might unregister
> + * When poll is blocked, other threads might unregister
> * listenfds from and register new listenfds into fdset.
> - * When select returns, the entries for listenfds in the fdset
> + * When poll returns, the entries for listenfds in the fdset
> * might have been updated. It is ok if there is unwanted call
> * for new listenfds.
> */
> - ret = select(maxfds + 1, &rfds, &wfds, NULL, &tv);
> - if (ret <= 0)
> - continue;
> + poll(rwfds, pfdset->num, 1000 /* millisecs */);
>
> - for (i = 0; i < num; i++) {
> - remove1 = remove2 = 0;
> + for (i = 0; i < pfdset->num; ) {
> pthread_mutex_lock(&pfdset->fd_mutex);
> +
> pfdentry = &pfdset->fd[i];
> fd = pfdentry->fd;
> +
> + if (fd < 0) {
> + /* Removed during poll */
> +
> + fdset_move_last(pfdset, i);
> + fdset_shrink(pfdset);
> +
> + pthread_mutex_unlock(&pfdset->fd_mutex);
> +
> + continue;
> + }
> +
> + if (!rwfds[i].revents) {
> + /* No revents, maybe added during poll */
> +
> + rwfds[i].fd = fd;
> + rwfds[i].events = pfdentry->rcb ? POLLIN : 0;
> + rwfds[i].events |= pfdentry->wcb ? POLLOUT : 0;
> + pthread_mutex_unlock(&pfdset->fd_mutex);
> +
> + i++;
> + continue;
I think it's error-prone to manipulate the rwfds here. Besides, it
registers an fd repeatedly.
The way I think of is:
- set rwfds[i] at fdset_add().
This also simply makes sure that pfdset->rwfds[i] and pfdset->fd[i] is
correctly bond.
fdset_add(fdset, fd, ...) {
lock();
i = fdset_find_free_slot(..);
pfdset->fd[i]->fd = fd;
pfdset->fd[i]->rcb = rcb;
pfdset->fd[i]->...;
pfdset->rwfds[i]->fd = fd;
pfdset->rwfds[i]->events = ...;
pfdset->rwfds[i]->revents = 0;
}
- set pfdset->fd[i]->fd = -1 on fdset_del. Note we should not decrease
'num' here, as we may be at poll.
fdset_del(fdset, fd) {
lock();
i = fdset_find_fd(pfdset, fd);
pfdset->fd[i]->fd = -1;
...
}
- log down pfdset->num before poll, because 'num' may increase during poll.
I think it's optional, since even 'num' is increased during poll, it just
leads to few more rwfds entries will be accessed. But it's not tracked by
kernel, and revents is initiated with 0, that there is no issue.
- shrink the fdset and rwfds (together) for those removed entries, __outside__
the for loop after poll.
Works to you?
--yliu
^ permalink raw reply
* Re: [PATCH v3 6/9] examples/ethtool: use ixgbe public function
From: Iremonger, Bernard @ 2016-12-13 9:04 UTC (permalink / raw)
To: Yigit, Ferruh, thomas.monjalon@6wind.com, dev@dpdk.org
In-Reply-To: <ec5489d2-2c43-9ebd-6db1-ada704a43c38@intel.com>
Hi Ferruh,
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, December 12, 2016 4:25 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas.monjalon@6wind.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public
> function
>
> On 12/12/2016 1:50 PM, Bernard Iremonger wrote:
> > Replace rte_eth_dev_set_vf_rxmode with
> rte_pmd_ixgbe_set_vf_rx_mode.
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > examples/ethtool/lib/rte_ethtool.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/examples/ethtool/lib/rte_ethtool.c
> b/examples/ethtool/lib/rte_ethtool.c
> > index a1f91d4..0e539f7 100644
> > --- a/examples/ethtool/lib/rte_ethtool.c
> > +++ b/examples/ethtool/lib/rte_ethtool.c
> > @@ -1,7 +1,7 @@
> > /*-
> > * BSD LICENSE
> > *
> > - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
> > + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> > * All rights reserved.
> > *
> > * Redistribution and use in source and binary forms, with or without
> > @@ -36,6 +36,7 @@
> > #include <rte_version.h>
> > #include <rte_ethdev.h>
> > #include <rte_ether.h>
> > +#include <rte_pmd_ixgbe.h>
> > #include "rte_ethtool.h"
> >
> > #define PKTPOOL_SIZE 512
> > @@ -354,7 +355,7 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
> >
> > /* Set VF vf_rx_mode, VF unsupport status is discard */
> > for (vf = 0; vf < num_vfs; vf++)
> > - rte_eth_dev_set_vf_rxmode(port_id, vf,
> > + rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
>
> Will these cause a build error if IXGBE_PMD is not enabled?
Yes, I will send a v4.
>
> > ETH_VMDQ_ACCEPT_UNTAG, 0);
> >
> > /* Enable Rx vlan filter, VF unspport status is discard */
> >
Regards,
Bernard.
^ permalink raw reply
* Re: [PATCH] test: adding AES cipher-only tests on QAT PMD
From: Yang, GangX @ 2016-12-13 8:09 UTC (permalink / raw)
To: dev@dpdk.org
Cc: Chen, Zhaoyan, Kusztal, ArkadiuszX, Trahe, Fiona, Griffin, John,
Yang, GangX
In-Reply-To: <9DEEADBC57E43F4DA73B571777FECECA3C7CC7F7@SHSMSX103.ccr.corp.intel.com>
Tested-by: Yang Gang < gangx.yang@intel.com >
- Check patch: success
- Apply patch: success
- compilation: success
OS: fedora21
GCC: gcc_x86-64, 4.8.3
Commit: dpdk-next-crypto( e6c7b6ec57f3527ce55fa3e0d2a8ed1533722253 )
x86_64-native-linuxapp-gcc: compile pass
- dts validation:
-- Test Commit: 44a66e026d772dd626be32ad3fb0506839136f58
-- OS/Kernel: Fedora21/3.11.10-301.fc20.x86_64
-- GCC: gcc version 4.8.3
-- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
-- NIC: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572]
-- total 2,failed 0 (case1: contain cryptodev_qat_perftest and all of others cryptodev cases on unit test .
case 2: all of the related cases about AES cipher only on l2fwd-crypto test)
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Wednesday, November 30, 2016 11:16 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; dev@dpdk.org
> Cc: Griffin, John <john.griffin@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] test: adding AES cipher-only tests on
> QAT PMD
>
>
>
> > -----Original Message-----
> > From: Kusztal, ArkadiuszX
> > Sent: Friday, November 25, 2016 2:14 PM
> > To: Trahe, Fiona; dev@dpdk.org
> > Cc: De Lara Guarch, Pablo; Griffin, John
> > Subject: RE: [PATCH] test: adding AES cipher-only tests on QAT PMD
> >
> >
> >
> > > -----Original Message-----
> > > From: Trahe, Fiona
> > > Sent: Thursday, November 24, 2016 6:29 PM
> > > To: dev@dpdk.org
> > > Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Trahe,
> > > Fiona <fiona.trahe@intel.com>; Griffin, John
> > > <john.griffin@intel.com>; Kusztal, ArkadiuszX
> > > <arkadiuszx.kusztal@intel.com>
> > > Subject: [PATCH] test: adding AES cipher-only tests on QAT PMD
> > >
> > > Extended functional AES-CBC and AES-CTR cipher-only tests to run
> > > on QAT PMD.
> > > Added AES_CBC cipher-only performance tests on QAT PMD.
> > > No driver changes, but as now tested, QAT documentation is updated
> > > to remove constraint.
> > >
> > > Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
> > > ---
> > > app/test/test_cryptodev.c | 18 ++++++
> > > app/test/test_cryptodev_aes_test_vectors.h | 36 +++++++----
> > > app/test/test_cryptodev_perf.c | 96 +++++++++++++++++++------
> > ----
> > > -
> > > doc/guides/cryptodevs/qat.rst | 1 -
> > > 4 files changed, 102 insertions(+), 49 deletions(-)
> > >
> > > --
> > > 2.5.0
> > Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
>
> Applied to dpdk-next-crypto.
> Thanks,
>
> Pablo
^ permalink raw reply
* Re: [PATCH] crypto/aesni_gcm: migration from MB library to ISA-L
From: Yang, GangX @ 2016-12-13 8:09 UTC (permalink / raw)
To: dev@dpdk.org
Cc: Chen, Zhaoyan, Kusztal, ArkadiuszX, Trahe, Fiona, Griffin, John,
Yang, GangX
Tested-by: Yang Gang < gangx.yang@intel.com >
- Check patch: success
- Apply patch: success
- compilation: success
OS: fedora21
GCC: gcc_x86-64, 4.8.3
Commit: dpdk-next-crypto( e6c7b6ec57f3527ce55fa3e0d2a8ed1533722253 )
x86_64-native-linuxapp-gcc: compile pass
- dts validation:
-- Test Commit: 44a66e026d772dd626be32ad3fb0506839136f58
-- OS/Kernel: Fedora21/3.11.10-301.fc20.x86_64
-- GCC: gcc version 4.8.3
-- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
-- NIC: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572]
-- total 2,failed 0 (case1: contain cryptodev_aesni_gcm_perftest , cryptodev_aesni_gcm_autotest and all of others cryptodev cases on unit test .
case 2: all of the related cases about AESNI_GCM on l2fwd-crypto test)
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Jastrzebski
> Sent: Friday, December 2, 2016 9:05 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Azarewicz,
> PiotrX T <piotrx.t.azarewicz@intel.com>
> Subject: [dpdk-dev] [PATCH] crypto/aesni_gcm: migration from MB library to
> ISA-L
>
> From: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
>
> Current Cryptodev AESNI-GCM PMD is implemented using AESNI-MB
> library.This patch reimplement Cryptodev AESni-GCM using ISA-L Crypto
> library: https://github.com/01org/isa-l_crypto.
> In new version 256-bit key support and AAD variable lenght is available.
> Verified current unit tests and added new unit tests to verify new
> functionalities.
>
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> ---
> app/test/test_cryptodev.c | 337 +++++++++++-----
> app/test/test_cryptodev_gcm_test_vectors.h | 481
> ++++++++++++++++++++++-
> doc/guides/cryptodevs/aesni_gcm.rst | 18 +-
> drivers/crypto/aesni_gcm/Makefile | 8 +-
> drivers/crypto/aesni_gcm/aesni_gcm_ops.h | 91 +----
> drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 110 ++----
> drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 24 +-
> drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h | 15 +-
> mk/rte.app.mk | 3 +-
> 9 files changed, 776 insertions(+), 311 deletions(-)
>
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index
> 872f8b4..fdf800a 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -3916,15 +3916,13 @@ create_gcm_session(uint8_t dev_id, enum
> rte_crypto_cipher_operation op,
>
> static int
> create_gcm_operation(enum rte_crypto_cipher_operation op,
> - const uint8_t *auth_tag, const unsigned auth_tag_len,
> - const uint8_t *iv, const unsigned iv_len,
> - const uint8_t *aad, const unsigned aad_len,
> - const unsigned data_len, unsigned data_pad_len)
> + const struct gcm_test_data *tdata)
> {
> struct crypto_testsuite_params *ts_params = &testsuite_params;
> struct crypto_unittest_params *ut_params = &unittest_params;
>
> - unsigned iv_pad_len = 0, aad_buffer_len;
> + uint8_t *plaintext;
> + unsigned int iv_pad_len, aad_pad_len, plaintext_pad_len;
>
> /* Generate Crypto op data structure */
> ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
> @@ -3934,63 +3932,79 @@ create_gcm_operation(enum
> rte_crypto_cipher_operation op,
>
> struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
>
> - sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
> - ut_params->ibuf, auth_tag_len);
> - TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
> - "no room to append digest");
> - sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
> - ut_params->ibuf, data_pad_len);
> - sym_op->auth.digest.length = auth_tag_len;
> -
> - if (op == RTE_CRYPTO_CIPHER_OP_DECRYPT) {
> - rte_memcpy(sym_op->auth.digest.data, auth_tag,
> auth_tag_len);
> - TEST_HEXDUMP(stdout, "digest:",
> - sym_op->auth.digest.data,
> - sym_op->auth.digest.length);
> - }
> + /* Append aad data */
> + aad_pad_len = RTE_ALIGN_CEIL(tdata->aad.len, 16);
> + sym_op->auth.aad.data = (uint8_t
> *)rte_pktmbuf_append(ut_params->ibuf,
> + aad_pad_len);
> + TEST_ASSERT_NOT_NULL(sym_op->auth.aad.data,
> + "no room to append aad");
>
> - /* iv */
> - iv_pad_len = RTE_ALIGN_CEIL(iv_len, 16);
> + sym_op->auth.aad.length = tdata->aad.len;
> + sym_op->auth.aad.phys_addr =
> + rte_pktmbuf_mtophys(ut_params->ibuf);
> + memcpy(sym_op->auth.aad.data, tdata->aad.data, tdata->aad.len);
> + TEST_HEXDUMP(stdout, "aad:", sym_op->auth.aad.data,
> + sym_op->auth.aad.length);
>
> + /* Prepend iv */
> + iv_pad_len = RTE_ALIGN_CEIL(tdata->iv.len, 16);
> sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
> ut_params->ibuf, iv_pad_len);
> TEST_ASSERT_NOT_NULL(sym_op->cipher.iv.data, "no room to
> prepend iv");
>
> memset(sym_op->cipher.iv.data, 0, iv_pad_len);
> sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params-
> >ibuf);
> - sym_op->cipher.iv.length = iv_len;
> + sym_op->cipher.iv.length = tdata->iv.len;
>
> - rte_memcpy(sym_op->cipher.iv.data, iv, iv_len);
> + rte_memcpy(sym_op->cipher.iv.data, tdata->iv.data, tdata->iv.len);
> + TEST_HEXDUMP(stdout, "iv:", sym_op->cipher.iv.data,
> + sym_op->cipher.iv.length);
>
> - /*
> - * Always allocate the aad up to the block size.
> - * The cryptodev API calls out -
> - * - the array must be big enough to hold the AAD, plus any
> - * space to round this up to the nearest multiple of the
> - * block size (16 bytes).
> - */
> - aad_buffer_len = ALIGN_POW2_ROUNDUP(aad_len, 16);
> + /* Append plaintext/ciphertext */
> + if (op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) {
> + plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len,
> 16);
> + plaintext = (uint8_t *)rte_pktmbuf_append(ut_params-
> >ibuf,
> + plaintext_pad_len);
> + TEST_ASSERT_NOT_NULL(plaintext, "no room to append
> plaintext");
>
> - sym_op->auth.aad.data = (uint8_t *)rte_pktmbuf_prepend(
> - ut_params->ibuf, aad_buffer_len);
> - TEST_ASSERT_NOT_NULL(sym_op->auth.aad.data,
> - "no room to prepend aad");
> - sym_op->auth.aad.phys_addr = rte_pktmbuf_mtophys(
> - ut_params->ibuf);
> - sym_op->auth.aad.length = aad_len;
> + memcpy(plaintext, tdata->plaintext.data, tdata-
> >plaintext.len);
> + TEST_HEXDUMP(stdout, "plaintext:", plaintext,
> + tdata->plaintext.len);
> + } else {
> + plaintext_pad_len = RTE_ALIGN_CEIL(tdata->ciphertext.len,
> 16);
> + plaintext = (uint8_t *)rte_pktmbuf_append(ut_params-
> >ibuf,
> + plaintext_pad_len);
> + TEST_ASSERT_NOT_NULL(plaintext, "no room to append
> ciphertext");
>
> - memset(sym_op->auth.aad.data, 0, aad_buffer_len);
> - rte_memcpy(sym_op->auth.aad.data, aad, aad_len);
> + memcpy(plaintext, tdata->ciphertext.data,
> + tdata->ciphertext.len);
> + TEST_HEXDUMP(stdout, "ciphertext:", plaintext,
> + tdata->ciphertext.len);
> + }
>
> - TEST_HEXDUMP(stdout, "iv:", sym_op->cipher.iv.data, iv_pad_len);
> - TEST_HEXDUMP(stdout, "aad:",
> - sym_op->auth.aad.data, aad_len);
> + /* Append digest data */
> + sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
> + ut_params->ibuf, tdata->auth_tag.len);
> + TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
> + "no room to append digest");
> + sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
> + ut_params->ibuf,
> + plaintext_pad_len + aad_pad_len + iv_pad_len);
> + sym_op->auth.digest.length = tdata->auth_tag.len;
> +
> + if (op == RTE_CRYPTO_CIPHER_OP_DECRYPT) {
> + rte_memcpy(sym_op->auth.digest.data, tdata-
> >auth_tag.data,
> + tdata->auth_tag.len);
> + TEST_HEXDUMP(stdout, "digest:",
> + sym_op->auth.digest.data,
> + sym_op->auth.digest.length);
> + }
>
> - sym_op->cipher.data.length = data_len;
> - sym_op->cipher.data.offset = aad_buffer_len + iv_pad_len;
> + sym_op->cipher.data.length = tdata->plaintext.len;
> + sym_op->cipher.data.offset = aad_pad_len + iv_pad_len;
>
> - sym_op->auth.data.offset = aad_buffer_len + iv_pad_len;
> - sym_op->auth.data.length = data_len;
> + sym_op->auth.data.length = tdata->plaintext.len;
> + sym_op->auth.data.offset = aad_pad_len + iv_pad_len;
>
> return 0;
> }
> @@ -4002,9 +4016,9 @@
> test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data
> *tdata)
> struct crypto_unittest_params *ut_params = &unittest_params;
>
> int retval;
> -
> - uint8_t *plaintext, *ciphertext, *auth_tag;
> + uint8_t *ciphertext, *auth_tag;
> uint16_t plaintext_pad_len;
> + uint32_t i;
>
> /* Create GCM session */
> retval = create_gcm_session(ts_params->valid_devs[0],
> @@ -4015,31 +4029,20 @@
> test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data
> *tdata)
> if (retval < 0)
> return retval;
>
> -
> - ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> + if (tdata->aad.len > MBUF_SIZE) {
> + ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> + /* Populate full size of add data */
> + for (i = 32; i < GMC_MAX_AAD_LENGTH; i += 32)
> + memcpy(&tdata->aad.data[i], &tdata->aad.data[0],
> 32);
> + } else
> + ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
>
> /* clear mbuf payload */
> memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
> rte_pktmbuf_tailroom(ut_params->ibuf));
>
> - /*
> - * Append data which is padded to a multiple
> - * of the algorithms block size
> - */
> - plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16);
> -
> - plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
> - plaintext_pad_len);
> - memcpy(plaintext, tdata->plaintext.data, tdata->plaintext.len);
> -
> - TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
> -
> - /* Create GCM opertaion */
> - retval = create_gcm_operation(RTE_CRYPTO_CIPHER_OP_ENCRYPT,
> - tdata->auth_tag.data, tdata->auth_tag.len,
> - tdata->iv.data, tdata->iv.len,
> - tdata->aad.data, tdata->aad.len,
> - tdata->plaintext.len, plaintext_pad_len);
> + /* Create GCM operation */
> + retval = create_gcm_operation(RTE_CRYPTO_CIPHER_OP_ENCRYPT,
> tdata);
> if (retval < 0)
> return retval;
>
> @@ -4054,14 +4057,18 @@
> test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data
> *tdata)
> TEST_ASSERT_EQUAL(ut_params->op->status,
> RTE_CRYPTO_OP_STATUS_SUCCESS,
> "crypto op processing failed");
>
> + plaintext_pad_len = RTE_ALIGN_CEIL(tdata->plaintext.len, 16);
> +
> if (ut_params->op->sym->m_dst) {
> ciphertext = rte_pktmbuf_mtod(ut_params->op->sym-
> >m_dst,
> uint8_t *);
> auth_tag = rte_pktmbuf_mtod_offset(ut_params->op-
> >sym->m_dst,
> uint8_t *, plaintext_pad_len);
> } else {
> - ciphertext = plaintext;
> - auth_tag = plaintext + plaintext_pad_len;
> + ciphertext = rte_pktmbuf_mtod_offset(ut_params->op-
> >sym->m_src,
> + uint8_t *,
> + ut_params->op->sym->cipher.data.offset);
> + auth_tag = ciphertext + plaintext_pad_len;
> }
>
> TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata-
> >ciphertext.len); @@ -4127,15 +4134,68 @@
> test_mb_AES_GCM_authenticated_encryption_test_case_7(void)
> }
>
> static int
> +test_mb_AES_GCM_auth_encryption_test_case_256_1(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_256_2(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_2);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_256_3(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_3);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_256_4(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_4);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_256_5(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_5);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_256_6(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_6);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_256_7(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_7);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_aad_1(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_aad_1);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_encryption_test_case_aad_2(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_aad_2);
> +}
> +
> +static int
> test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data
> *tdata) {
> struct crypto_testsuite_params *ts_params = &testsuite_params;
> struct crypto_unittest_params *ut_params = &unittest_params;
>
> int retval;
> -
> - uint8_t *plaintext, *ciphertext;
> - uint16_t ciphertext_pad_len;
> + uint8_t *plaintext;
> + uint32_t i;
>
> /* Create GCM session */
> retval = create_gcm_session(ts_params->valid_devs[0],
> @@ -4146,31 +4206,23 @@
> test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data
> *tdata)
> if (retval < 0)
> return retval;
>
> -
> /* alloc mbuf and set payload */
> - ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> + if (tdata->aad.len > MBUF_SIZE) {
> + ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >large_mbuf_pool);
> + /* Populate full size of add data */
> + for (i = 32; i < GMC_MAX_AAD_LENGTH; i += 32)
> + memcpy(&tdata->aad.data[i], &tdata->aad.data[0],
> 32);
> + } else
> + ut_params->ibuf = rte_pktmbuf_alloc(ts_params-
> >mbuf_pool);
>
> memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
> rte_pktmbuf_tailroom(ut_params->ibuf));
>
> - ciphertext_pad_len = RTE_ALIGN_CEIL(tdata->ciphertext.len, 16);
> -
> - ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
> - ciphertext_pad_len);
> - memcpy(ciphertext, tdata->ciphertext.data, tdata->ciphertext.len);
> -
> - TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata-
> >ciphertext.len);
> -
> - /* Create GCM opertaion */
> - retval = create_gcm_operation(RTE_CRYPTO_CIPHER_OP_DECRYPT,
> - tdata->auth_tag.data, tdata->auth_tag.len,
> - tdata->iv.data, tdata->iv.len,
> - tdata->aad.data, tdata->aad.len,
> - tdata->ciphertext.len, ciphertext_pad_len);
> + /* Create GCM operation */
> + retval = create_gcm_operation(RTE_CRYPTO_CIPHER_OP_DECRYPT,
> tdata);
> if (retval < 0)
> return retval;
>
> -
> rte_crypto_op_attach_sym_session(ut_params->op, ut_params-
> >sess);
>
> ut_params->op->sym->m_src = ut_params->ibuf; @@ -4186,7
> +4238,9 @@ test_mb_AES_GCM_authenticated_decryption(const struct
> gcm_test_data *tdata)
> plaintext = rte_pktmbuf_mtod(ut_params->op->sym-
> >m_dst,
> uint8_t *);
> else
> - plaintext = ciphertext;
> + plaintext = rte_pktmbuf_mtod_offset(ut_params->op-
> >sym->m_src,
> + uint8_t *,
> + ut_params->op->sym->cipher.data.offset);
>
> TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata-
> >ciphertext.len);
>
> @@ -4246,6 +4300,60 @@
> test_mb_AES_GCM_authenticated_decryption_test_case_7(void)
> }
>
> static int
> +test_mb_AES_GCM_auth_decryption_test_case_256_1(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_256_2(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_2);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_256_3(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_3);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_256_4(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_4);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_256_5(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_5);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_256_6(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_6);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_256_7(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_7);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_aad_1(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_aad_1);
> +}
> +
> +static int
> +test_mb_AES_GCM_auth_decryption_test_case_aad_2(void)
> +{
> + return
> test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_aad_2);
> +}
> +
> +static int
> test_stats(void)
> {
> struct crypto_testsuite_params *ts_params = &testsuite_params;
> @@ -6283,6 +6391,7 @@ static struct unit_test_suite
> cryptodev_aesni_gcm_testsuite = {
> .teardown = testsuite_teardown,
> .unit_test_cases = {
> /** AES GCM Authenticated Encryption */
> +
> TEST_CASE_ST(ut_setup, ut_teardown,
>
> test_mb_AES_GCM_authenticated_encryption_test_case_1),
> TEST_CASE_ST(ut_setup, ut_teardown,
> @@ -6314,6 +6423,50 @@ static struct unit_test_suite
> cryptodev_aesni_gcm_testsuite = {
> TEST_CASE_ST(ut_setup, ut_teardown,
>
> test_mb_AES_GCM_authenticated_decryption_test_case_7),
>
> + /** AES GCM Authenticated Encryption 256bites key */
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_256_1),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_256_2),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_256_3),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_256_4),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_256_5),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_256_6),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_256_7),
> +
> + /** AES GCM Authenticated Decryption 256bites key */
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_256_1),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_256_2),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_256_3),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_256_4),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_256_5),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_256_6),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_256_7),
> +
> + /** AES GCM Authenticated Encryption big aad size */
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_aad_1),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_encryption_test_case_aad_2),
> +
> + /** AES GCM Authenticated Encryption big aad size */
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_aad_1),
> + TEST_CASE_ST(ut_setup, ut_teardown,
> +
> test_mb_AES_GCM_auth_decryption_test_case_aad_2),
> +
> TEST_CASES_END() /**< NULL terminate unit test array */
> }
> };
> diff --git a/app/test/test_cryptodev_gcm_test_vectors.h
> b/app/test/test_cryptodev_gcm_test_vectors.h
> index b404242..b6f81f3 100644
> --- a/app/test/test_cryptodev_gcm_test_vectors.h
> +++ b/app/test/test_cryptodev_gcm_test_vectors.h
> @@ -34,6 +34,16 @@
> #define TEST_CRYPTODEV_GCM_TEST_VECTORS_H_
>
> #define GMAC_LARGE_PLAINTEXT_LENGTH 65376
> +#define GMC_MAX_AAD_LENGTH 65536
> +#define GMC_LARGE_AAD_LENGTH 65296
> +
> +static uint8_t gcm_aad_zero_text[GMC_MAX_AAD_LENGTH] = { 0 };
> +
> +static uint8_t gcm_aad_text[GMC_MAX_AAD_LENGTH] = {
> + 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
> + 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
> + 0x00, 0xf1, 0xe2, 0xd3, 0xc4, 0xb5, 0xa6, 0x97,
> + 0x88, 0x79, 0x6a, 0x5b, 0x4c, 0x3d, 0x2e, 0x1f };
>
> struct gcm_test_data {
> struct {
> @@ -47,7 +57,7 @@ struct gcm_test_data {
> } iv;
>
> struct {
> - uint8_t data[64];
> + uint8_t *data;
> unsigned len;
> } aad;
>
> @@ -111,7 +121,7 @@ static const struct gcm_test_data gcm_test_case_1 =
> {
> .len = 12
> },
> .aad = {
> - .data = { 0 },
> + .data = gcm_aad_zero_text,
> .len = 0
> },
> .plaintext = {
> @@ -148,7 +158,7 @@ static const struct gcm_test_data gcm_test_case_2 =
> {
> .len = 12
> },
> .aad = {
> - .data = { 0 },
> + .data = gcm_aad_zero_text,
> .len = 0
> },
> .plaintext = {
> @@ -186,7 +196,7 @@ static const struct gcm_test_data gcm_test_case_3 =
> {
> .len = 12
> },
> .aad = {
> - .data = { 0 },
> + .data = gcm_aad_zero_text,
> .len = 0
> },
> .plaintext = {
> @@ -238,8 +248,7 @@ static const struct gcm_test_data gcm_test_case_4 =
> {
> .len = 12
> },
> .aad = {
> - .data = {
> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
> + .data = gcm_aad_zero_text,
> .len = 8
> },
> .plaintext = {
> @@ -294,8 +303,7 @@ static const struct gcm_test_data gcm_test_case_5 =
> {
> .len = 12
> },
> .aad = {
> - .data = {
> - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef },
> + .data = gcm_aad_text,
> .len = 8
> },
> .plaintext = {
> @@ -346,15 +354,11 @@ static const struct gcm_test_data gcm_test_case_6
> = {
> .iv = {
> .data = {
> 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> - 0xde, 0xca, 0xf8, 0x88
> - },
> + 0xde, 0xca, 0xf8, 0x88 },
> .len = 12
> },
> .aad = {
> - .data = {
> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> - 0x00, 0x00, 0x00, 0x00
> - },
> + .data = gcm_aad_zero_text,
> .len = 12
> },
> .plaintext = {
> @@ -409,10 +413,7 @@ static const struct gcm_test_data gcm_test_case_7 =
> {
> .len = 12
> },
> .aad = {
> - .data = {
> - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
> - 0xfe, 0xed, 0xfa, 0xce
> - },
> + .data = gcm_aad_text,
> .len = 12
> },
> .plaintext = {
> @@ -450,6 +451,450 @@ static const struct gcm_test_data gcm_test_case_7
> = {
> }
> };
>
> +/** AES-256 Test Vectors */
> +static const struct gcm_test_data gcm_test_case_256_1 = {
> + .key = {
> + .data = {
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_zero_text,
> + .len = 0
> + },
> + .plaintext = {
> + .data = { 0x00 },
> + .len = 0
> + },
> + .ciphertext = {
> + .data = { 0x00 },
> + .len = 0
> + },
> + .auth_tag = {
> + .data = {
> + 0x53, 0x0F, 0x8A, 0xFB, 0xC7, 0x45, 0x36, 0xB9,
> + 0xA9, 0x63, 0xB4, 0xF1, 0xC4, 0xCB, 0x73, 0x8B },
> + .len = 16
> + }
> +};
> +
> +/** AES-256 Test Vectors */
> +static const struct gcm_test_data gcm_test_case_256_2 = {
> + .key = {
> + .data = {
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_zero_text,
> + .len = 0
> + },
> + .plaintext = {
> + .data = {
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
> + .len = 16
> + },
> + .ciphertext = {
> + .data = {
> + 0xCE, 0xA7, 0x40, 0x3D, 0x4D, 0x60, 0x6B, 0x6E,
> + 0x07, 0x4E, 0xC5, 0xD3, 0xBA, 0xF3, 0x9D, 0x18 },
> + .len = 16
> + },
> + .auth_tag = {
> + .data = {
> + 0xD0, 0xD1, 0xC8, 0xA7, 0x99, 0x99, 0x6B, 0xF0,
> + 0x26, 0x5B, 0x98, 0xB5, 0xD4, 0x8A, 0xB9, 0x19 },
> + .len = 16
> + }
> +};
> +
> +/** AES-256 Test Vectors */
> +static const struct gcm_test_data gcm_test_case_256_3 = {
> + .key = {
> + .data = {
> + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
> + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> + 0xde, 0xca, 0xf8, 0x88 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_zero_text,
> + .len = 0
> + },
> + .plaintext = {
> + .data = {
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
> + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
> + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
> + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
> + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
> + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
> + 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
> + .len = 64
> + },
> + .ciphertext = {
> + .data = {
> + 0x05, 0xA2, 0x39, 0xA5, 0xE1, 0x1A, 0x74, 0xEA,
> + 0x6B, 0x2A, 0x55, 0xF6, 0xD7, 0x88, 0x44, 0x7E,
> + 0x93, 0x7E, 0x23, 0x64, 0x8D, 0xF8, 0xD4, 0x04,
> + 0x3B, 0x40, 0xEF, 0x6D, 0x7C, 0x6B, 0xF3, 0xB9,
> + 0x50, 0x15, 0x97, 0x5D, 0xB8, 0x28, 0xA1, 0xD5,
> + 0x22, 0xDE, 0x36, 0x26, 0xD0, 0x6A, 0x7A, 0xC0,
> + 0xB5, 0x14, 0x36, 0xAF, 0x3A, 0xC6, 0x50, 0xAB,
> + 0xFA, 0x47, 0xC8, 0x2E, 0xF0, 0x68, 0xE1, 0x3E },
> + .len = 64
> + },
> + .auth_tag = {
> + .data = {
> + 0x64, 0xAF, 0x1D, 0xFB, 0xE8, 0x0D, 0x37, 0xD8,
> + 0x92, 0xC3, 0xB9, 0x1D, 0xD3, 0x08, 0xAB, 0xFC },
> + .len = 16
> + }
> +};
> +
> +/** AES-256 Test Vectors */
> +static const struct gcm_test_data gcm_test_case_256_4 = {
> + .key = {
> + .data = {
> + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
> + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> + 0xde, 0xca, 0xf8, 0x88 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_zero_text,
> + .len = 8
> + },
> + .plaintext = {
> + .data = {
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
> + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
> + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
> + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
> + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
> + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
> + 0xba, 0x63, 0x7b, 0x39 },
> + .len = 60
> + },
> + .ciphertext = {
> + .data = {
> + 0x05, 0xA2, 0x39, 0xA5, 0xE1, 0x1A, 0x74, 0xEA,
> + 0x6B, 0x2A, 0x55, 0xF6, 0xD7, 0x88, 0x44, 0x7E,
> + 0x93, 0x7E, 0x23, 0x64, 0x8D, 0xF8, 0xD4, 0x04,
> + 0x3B, 0x40, 0xEF, 0x6D, 0x7C, 0x6B, 0xF3, 0xB9,
> + 0x50, 0x15, 0x97, 0x5D, 0xB8, 0x28, 0xA1, 0xD5,
> + 0x22, 0xDE, 0x36, 0x26, 0xD0, 0x6A, 0x7A, 0xC0,
> + 0xB5, 0x14, 0x36, 0xAF, 0x3A, 0xC6, 0x50, 0xAB,
> + 0xFA, 0x47, 0xC8, 0x2E },
> + .len = 60
> + },
> + .auth_tag = {
> + .data = {
> + 0x63, 0x16, 0x91, 0xAE, 0x17, 0x05, 0x5E, 0xA6,
> + 0x6D, 0x0A, 0x51, 0xE2, 0x50, 0x21, 0x85, 0x4A },
> + .len = 16
> + }
> +
> +};
> +
> +/** AES-256 Test Vectors */
> +static const struct gcm_test_data gcm_test_case_256_5 = {
> + .key = {
> + .data = {
> + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
> + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> + 0xde, 0xca, 0xf8, 0x88 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_text,
> + .len = 8
> + },
> + .plaintext = {
> + .data = {
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
> + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
> + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
> + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
> + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
> + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
> + 0xba, 0x63, 0x7b, 0x39 },
> + .len = 60
> + },
> + .ciphertext = {
> + .data = {
> + 0x05, 0xA2, 0x39, 0xA5, 0xE1, 0x1A, 0x74, 0xEA,
> + 0x6B, 0x2A, 0x55, 0xF6, 0xD7, 0x88, 0x44, 0x7E,
> + 0x93, 0x7E, 0x23, 0x64, 0x8D, 0xF8, 0xD4, 0x04,
> + 0x3B, 0x40, 0xEF, 0x6D, 0x7C, 0x6B, 0xF3, 0xB9,
> + 0x50, 0x15, 0x97, 0x5D, 0xB8, 0x28, 0xA1, 0xD5,
> + 0x22, 0xDE, 0x36, 0x26, 0xD0, 0x6A, 0x7A, 0xC0,
> + 0xB5, 0x14, 0x36, 0xAF, 0x3A, 0xC6, 0x50, 0xAB,
> + 0xFA, 0x47, 0xC8, 0x2E },
> + .len = 60
> + },
> + .auth_tag = {
> + .data = {
> + 0xA7, 0x99, 0xAC, 0xB8, 0x27, 0xDA, 0xB1, 0x82,
> + 0x79, 0xFD, 0x83, 0x73, 0x52, 0x4D, 0xDB, 0xF1 },
> + .len = 16
> + }
> +
> +};
> +
> +/** AES-256 Test Vectors */
> +static const struct gcm_test_data gcm_test_case_256_6 = {
> + .key = {
> + .data = {
> + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
> + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> + 0xde, 0xca, 0xf8, 0x88 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_zero_text,
> + .len = 12
> + },
> + .plaintext = {
> + .data = {
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
> + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
> + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
> + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
> + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
> + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
> + 0xba, 0x63, 0x7b, 0x39 },
> + .len = 60
> + },
> + .ciphertext = {
> + .data = {
> + 0x05, 0xA2, 0x39, 0xA5, 0xE1, 0x1A, 0x74, 0xEA,
> + 0x6B, 0x2A, 0x55, 0xF6, 0xD7, 0x88, 0x44, 0x7E,
> + 0x93, 0x7E, 0x23, 0x64, 0x8D, 0xF8, 0xD4, 0x04,
> + 0x3B, 0x40, 0xEF, 0x6D, 0x7C, 0x6B, 0xF3, 0xB9,
> + 0x50, 0x15, 0x97, 0x5D, 0xB8, 0x28, 0xA1, 0xD5,
> + 0x22, 0xDE, 0x36, 0x26, 0xD0, 0x6A, 0x7A, 0xC0,
> + 0xB5, 0x14, 0x36, 0xAF, 0x3A, 0xC6, 0x50, 0xAB,
> + 0xFA, 0x47, 0xC8, 0x2E },
> + .len = 60
> + },
> + .auth_tag = {
> + .data = {
> + 0x5D, 0xA5, 0x0E, 0x53, 0x64, 0x7F, 0x3F, 0xAE,
> + 0x1A, 0x1F, 0xC0, 0xB0, 0xD8, 0xBE, 0xF2, 0x64 },
> + .len = 16
> + }
> +};
> +
> +/** AES-256 Test Vectors */
> +static const struct gcm_test_data gcm_test_case_256_7 = {
> + .key = {
> + .data = {
> + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
> + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> + 0xde, 0xca, 0xf8, 0x88 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_text,
> + .len = 12
> + },
> + .plaintext = {
> + .data = {
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
> + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
> + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
> + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
> + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
> + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
> + 0xba, 0x63, 0x7b, 0x39 },
> + .len = 60
> + },
> + .ciphertext = {
> + .data = {
> + 0x05, 0xA2, 0x39, 0xA5, 0xE1, 0x1A, 0x74, 0xEA,
> + 0x6B, 0x2A, 0x55, 0xF6, 0xD7, 0x88, 0x44, 0x7E,
> + 0x93, 0x7E, 0x23, 0x64, 0x8D, 0xF8, 0xD4, 0x04,
> + 0x3B, 0x40, 0xEF, 0x6D, 0x7C, 0x6B, 0xF3, 0xB9,
> + 0x50, 0x15, 0x97, 0x5D, 0xB8, 0x28, 0xA1, 0xD5,
> + 0x22, 0xDE, 0x36, 0x26, 0xD0, 0x6A, 0x7A, 0xC0,
> + 0xB5, 0x14, 0x36, 0xAF, 0x3A, 0xC6, 0x50, 0xAB,
> + 0xFA, 0x47, 0xC8, 0x2E },
> + .len = 60
> + },
> + .auth_tag = {
> + .data = {
> + 0x4E, 0xD0, 0x91, 0x95, 0x83, 0xA9, 0x38, 0x72,
> + 0x09, 0xA9, 0xCE, 0x5F, 0x89, 0x06, 0x4E, 0xC8 },
> + .len = 16
> + }
> +};
> +
> +/** variable AAD AES-128 Test Vectors */ static const struct
> +gcm_test_data gcm_test_case_aad_1 = {
> + .key = {
> + .data = {
> + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
> + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
> + .len = 16
> + },
> + .iv = {
> + .data = {
> + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> + 0xde, 0xca, 0xf8, 0x88 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_text,
> + .len = GMC_LARGE_AAD_LENGTH
> + },
> + .plaintext = {
> + .data = {
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
> + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
> + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
> + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
> + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
> + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
> + 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
> + .len = 64
> + },
> + .ciphertext = {
> + .data = {
> + 0x42, 0x83, 0x1E, 0xC2, 0x21, 0x77, 0x74, 0x24,
> + 0x4B, 0x72, 0x21, 0xB7, 0x84, 0xD0, 0xD4, 0x9C,
> + 0xE3, 0xAA, 0x21, 0x2F, 0x2C, 0x02, 0xA4, 0xE0,
> + 0x35, 0xC1, 0x7E, 0x23, 0x29, 0xAC, 0xA1, 0x2E,
> + 0x21, 0xD5, 0x14, 0xB2, 0x54, 0x66, 0x93, 0x1C,
> + 0x7D, 0x8F, 0x6A, 0x5A, 0xAC, 0x84, 0xAA, 0x05,
> + 0x1B, 0xA3, 0x0B, 0x39, 0x6A, 0x0A, 0xAC, 0x97,
> + 0x3D, 0x58, 0xE0, 0x91, 0x47, 0x3F, 0x59, 0x85
> + },
> + .len = 64
> + },
> + .auth_tag = {
> + .data = {
> + 0xCA, 0x70, 0xAF, 0x96, 0xA8, 0x5D, 0x40, 0x47,
> + 0x0C, 0x3C, 0x48, 0xF5, 0xF0, 0xF5, 0xA5, 0x7D
> + },
> + .len = 16
> + }
> +};
> +
> +/** variable AAD AES-256 Test Vectors */ static const struct
> +gcm_test_data gcm_test_case_aad_2 = {
> + .key = {
> + .data = {
> + 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
> + 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a },
> + .len = 32
> + },
> + .iv = {
> + .data = {
> + 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
> + 0xde, 0xca, 0xf8, 0x88 },
> + .len = 12
> + },
> + .aad = {
> + .data = gcm_aad_text,
> + .len = GMC_LARGE_AAD_LENGTH
> + },
> + .plaintext = {
> + .data = {
> + 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
> + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
> + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
> + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
> + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
> + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
> + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
> + 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
> + .len = 64
> + },
> + .ciphertext = {
> + .data = {
> + 0x05, 0xA2, 0x39, 0xA5, 0xE1, 0x1A, 0x74, 0xEA,
> + 0x6B, 0x2A, 0x55, 0xF6, 0xD7, 0x88, 0x44, 0x7E,
> + 0x93, 0x7E, 0x23, 0x64, 0x8D, 0xF8, 0xD4, 0x04,
> + 0x3B, 0x40, 0xEF, 0x6D, 0x7C, 0x6B, 0xF3, 0xB9,
> + 0x50, 0x15, 0x97, 0x5D, 0xB8, 0x28, 0xA1, 0xD5,
> + 0x22, 0xDE, 0x36, 0x26, 0xD0, 0x6A, 0x7A, 0xC0,
> + 0xB5, 0x14, 0x36, 0xAF, 0x3A, 0xC6, 0x50, 0xAB,
> + 0xFA, 0x47, 0xC8, 0x2E, 0xF0, 0x68, 0xE1, 0x3E
> + },
> + .len = 64
> + },
> + .auth_tag = {
> + .data = {
> + 0xBA, 0x06, 0xDA, 0xA1, 0x91, 0xE1, 0xFE, 0x22,
> + 0x59, 0xDA, 0x67, 0xAF, 0x9D, 0xA5, 0x43, 0x94
> + },
> + .len = 16
> + }
> +};
> +
> /** GMAC Test Vectors */
> static uint8_t gmac_plaintext[GMAC_LARGE_PLAINTEXT_LENGTH] = {
> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, diff --
> git a/doc/guides/cryptodevs/aesni_gcm.rst
> b/doc/guides/cryptodevs/aesni_gcm.rst
> index 04bf43c..3d43fad 100644
> --- a/doc/guides/cryptodevs/aesni_gcm.rst
> +++ b/doc/guides/cryptodevs/aesni_gcm.rst
> @@ -32,10 +32,8 @@ AES-NI GCM Crypto Poll Mode Driver
>
>
> The AES-NI GCM PMD (**librte_pmd_aesni_gcm**) provides poll mode
> crypto driver -support for utilizing Intel multi buffer library (see AES-NI Multi-
> buffer PMD documentation -to learn more about it, including installation).
> -
> -The AES-NI GCM PMD has current only been tested on Fedora 21 64-bit with
> gcc.
> +support for utilizing Intel ISA-L crypto library, which provides
> +operation acceleration through the AES-NI instruction sets for AES-GCM
> authenticated cipher algorithm.
>
> Features
> --------
> @@ -50,15 +48,19 @@ Authentication algorithms:
>
> * RTE_CRYPTO_AUTH_AES_GCM
>
> +Installation
> +------------
> +
> +To build DPDK with the AESNI_GCM_PMD the user is required to install
> +the ``libisal_crypto`` library in the build environment.
> +For download and more details please visit `<https://github.com/01org/isa-
> l_crypto>`_.
> +
> Initialization
> --------------
>
> In order to enable this virtual crypto PMD, user must:
>
> -* Export the environmental variable AESNI_MULTI_BUFFER_LIB_PATH with
> the path where
> - the library was extracted.
> -
> -* Build the multi buffer library (go to Installation section in AES-NI MB PMD
> documentation).
> +* Install the ISA-L crypto library (explained in Installation section).
>
> * Set CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=y in config/common_base.
>
> diff --git a/drivers/crypto/aesni_gcm/Makefile
> b/drivers/crypto/aesni_gcm/Makefile
> index 5898cae..fb17fbf 100644
> --- a/drivers/crypto/aesni_gcm/Makefile
> +++ b/drivers/crypto/aesni_gcm/Makefile
> @@ -31,9 +31,6 @@
> include $(RTE_SDK)/mk/rte.vars.mk
>
> ifneq ($(MAKECMDGOALS),clean)
> -ifeq ($(AESNI_MULTI_BUFFER_LIB_PATH),)
> -$(error "Please define AESNI_MULTI_BUFFER_LIB_PATH environment
> variable") -endif endif
>
> # library name
> @@ -50,10 +47,7 @@ LIBABIVER := 1
> EXPORT_MAP := rte_pmd_aesni_gcm_version.map
>
> # external library dependencies
> -CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH) -CFLAGS += -
> I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
> -LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB -LDLIBS += -
> lcrypto
> +LDLIBS += -lisal_crypto
>
> # library source files
> SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm_pmd.c diff -
> -git a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
> b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
> index c399068..ea8a155 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
> @@ -37,91 +37,12 @@
> #define LINUX
> #endif
>
> -#include <gcm_defines.h>
> -#include <aux_funcs.h>
> -
> -/** Supported vector modes */
> -enum aesni_gcm_vector_mode {
> - RTE_AESNI_GCM_NOT_SUPPORTED = 0,
> - RTE_AESNI_GCM_SSE,
> - RTE_AESNI_GCM_AVX,
> - RTE_AESNI_GCM_AVX2
> -};
> -
> -typedef void (*aes_keyexp_128_enc_t)(void *key, void *enc_exp_keys);
> -
> -typedef void (*aesni_gcm_t)(gcm_data *my_ctx_data, u8 *out, const u8
> *in,
> - u64 plaintext_len, u8 *iv, const u8 *aad, u64 aad_len,
> - u8 *auth_tag, u64 auth_tag_len);
> -
> -typedef void (*aesni_gcm_precomp_t)(gcm_data *my_ctx_data, u8
> *hash_subkey);
> -
> -/** GCM library function pointer table */ -struct aesni_gcm_ops {
> - struct {
> - struct {
> - aes_keyexp_128_enc_t aes128_enc;
> - /**< AES128 enc key expansion */
> - } keyexp;
> - /**< Key expansion functions */
> - } aux; /**< Auxiliary functions */
> -
> - struct {
> - aesni_gcm_t enc; /**< GCM encode function pointer
> */
> - aesni_gcm_t dec; /**< GCM decode function pointer
> */
> - aesni_gcm_precomp_t precomp; /**< GCM pre-
> compute */
> - } gcm; /**< GCM functions */
> -};
> -
> -
> -static const struct aesni_gcm_ops gcm_ops[] = {
> - [RTE_AESNI_GCM_NOT_SUPPORTED] = {
> - .aux = {
> - .keyexp = {
> - NULL
> - }
> - },
> - .gcm = {
> - NULL
> - }
> - },
> - [RTE_AESNI_GCM_SSE] = {
> - .aux = {
> - .keyexp = {
> - aes_keyexp_128_enc_sse
> - }
> - },
> - .gcm = {
> - aesni_gcm_enc_sse,
> - aesni_gcm_dec_sse,
> - aesni_gcm_precomp_sse
> - }
> - },
> - [RTE_AESNI_GCM_AVX] = {
> - .aux = {
> - .keyexp = {
> - aes_keyexp_128_enc_avx,
> - }
> - },
> - .gcm = {
> - aesni_gcm_enc_avx_gen2,
> - aesni_gcm_dec_avx_gen2,
> - aesni_gcm_precomp_avx_gen2
> - }
> - },
> - [RTE_AESNI_GCM_AVX2] = {
> - .aux = {
> - .keyexp = {
> - aes_keyexp_128_enc_avx2,
> - }
> - },
> - .gcm = {
> - aesni_gcm_enc_avx_gen4,
> - aesni_gcm_dec_avx_gen4,
> - aesni_gcm_precomp_avx_gen4
> - }
> - }
> -};
> +#include <isa-l_crypto/aes_gcm.h>
>
> +typedef void (*aesni_gcm_t)(struct gcm_data *my_ctx_data,
> + uint8_t *out, uint8_t const *in, uint64_t plaintext_len,
> + uint8_t *iv,
> + uint8_t const *aad, uint64_t aad_len,
> + uint8_t *auth_tag, uint64_t auth_tag_len);
>
> #endif /* _AESNI_GCM_OPS_H_ */
> diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> index dba5e15..f5627f5 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> @@ -30,8 +30,6 @@
> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
> DAMAGE.
> */
>
> -#include <openssl/aes.h>
> -
> #include <rte_common.h>
> #include <rte_config.h>
> #include <rte_hexdump.h>
> @@ -43,6 +41,18 @@
>
> #include "aesni_gcm_pmd_private.h"
>
> +/** GCM encode function pointer table */ static const aesni_gcm_t
> +aesni_gcm_enc[] = {
> + [AESNI_GCM_KEY_128] = aesni_gcm128_enc,
> + [AESNI_GCM_KEY_256] = aesni_gcm256_enc };
> +
> +/** GCM decode function pointer table */ static const aesni_gcm_t
> +aesni_gcm_dec[] = {
> + [AESNI_GCM_KEY_128] = aesni_gcm128_dec,
> + [AESNI_GCM_KEY_256] = aesni_gcm256_dec };
> +
> /**
> * Global static parameter used to create a unique name for each AES-NI
> multi
> * buffer crypto device.
> @@ -64,26 +74,6 @@ create_unique_device_name(char *name, size_t size)
> return 0;
> }
>
> -static int
> -aesni_gcm_calculate_hash_sub_key(uint8_t *hsubkey, unsigned
> hsubkey_length,
> - uint8_t *aeskey, unsigned aeskey_length)
> -{
> - uint8_t key[aeskey_length] __rte_aligned(16);
> - AES_KEY enc_key;
> -
> - if (hsubkey_length % 16 != 0 && aeskey_length % 16 != 0)
> - return -EFAULT;
> -
> - memcpy(key, aeskey, aeskey_length);
> -
> - if (AES_set_encrypt_key(key, aeskey_length << 3, &enc_key) != 0)
> - return -EFAULT;
> -
> - AES_encrypt(hsubkey, hsubkey, &enc_key);
> -
> - return 0;
> -}
> -
> /** Get xform chain order */
> static int
> aesni_gcm_get_mode(const struct rte_crypto_sym_xform *xform) @@ -
> 111,15 +101,12 @@ aesni_gcm_get_mode(const struct
> rte_crypto_sym_xform *xform)
>
> /** Parse crypto xform chain and set private session parameters */ int -
> aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *gcm_ops,
> - struct aesni_gcm_session *sess,
> +aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
> const struct rte_crypto_sym_xform *xform) {
> const struct rte_crypto_sym_xform *auth_xform = NULL;
> const struct rte_crypto_sym_xform *cipher_xform = NULL;
>
> - uint8_t hsubkey[16] __rte_aligned(16) = { 0 };
> -
> /* Select Crypto operation - hash then cipher / cipher then hash */
> switch (aesni_gcm_get_mode(xform)) {
> case AESNI_GCM_OP_AUTHENTICATED_ENCRYPTION:
> @@ -159,17 +146,22 @@ aesni_gcm_set_session_parameters(const struct
> aesni_gcm_ops *gcm_ops,
> return -EINVAL;
> }
>
> - /* Expand GCM AES128 key */
> - (*gcm_ops->aux.keyexp.aes128_enc)(cipher_xform-
> >cipher.key.data,
> - sess->gdata.expanded_keys);
> + /* Check key length, calculate GCM pre-compute. */
> + switch (cipher_xform->cipher.key.length) {
> + case 16:
> + aesni_gcm128_pre(cipher_xform->cipher.key.data, &sess-
> >gdata);
> + sess->key = AESNI_GCM_KEY_128;
>
> - /* Calculate hash sub key here */
> - aesni_gcm_calculate_hash_sub_key(hsubkey, sizeof(hsubkey),
> - cipher_xform->cipher.key.data,
> - cipher_xform->cipher.key.length);
> + break;
> + case 32:
> + aesni_gcm256_pre(cipher_xform->cipher.key.data, &sess-
> >gdata);
> + sess->key = AESNI_GCM_KEY_256;
>
> - /* Calculate GCM pre-compute */
> - (*gcm_ops->gcm.precomp)(&sess->gdata, hsubkey);
> + break;
> + default:
> + GCM_LOG_ERR("Unsupported cipher key length");
> + return -1;
> + }
>
> return 0;
> }
> @@ -195,8 +187,8 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp,
> struct rte_crypto_sym_op *op)
> sess = (struct aesni_gcm_session *)
> ((struct rte_cryptodev_session *)_sess)->_private;
>
> - if (unlikely(aesni_gcm_set_session_parameters(qp->ops,
> - sess, op->xform) != 0)) {
> + if (unlikely(aesni_gcm_set_session_parameters(sess,
> + op->xform) != 0)) {
> rte_mempool_put(qp->sess_mp, _sess);
> sess = NULL;
> }
> @@ -216,7 +208,7 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp,
> struct rte_crypto_sym_op *op)
> *
> */
> static int
> -process_gcm_crypto_op(struct aesni_gcm_qp *qp, struct
> rte_crypto_sym_op *op,
> +process_gcm_crypto_op(struct rte_crypto_sym_op *op,
> struct aesni_gcm_session *session)
> {
> uint8_t *src, *dst;
> @@ -244,12 +236,6 @@ process_gcm_crypto_op(struct aesni_gcm_qp *qp,
> struct rte_crypto_sym_op *op,
> op->cipher.iv.data[15] = 1;
> }
>
> - if (op->auth.aad.length != 12 && op->auth.aad.length != 8 &&
> - op->auth.aad.length != 0) {
> - GCM_LOG_ERR("iv");
> - return -1;
> - }
> -
> if (op->auth.digest.length != 16 &&
> op->auth.digest.length != 12 &&
> op->auth.digest.length != 8 &&
> @@ -260,7 +246,7 @@ process_gcm_crypto_op(struct aesni_gcm_qp *qp,
> struct rte_crypto_sym_op *op,
>
> if (session->op == AESNI_GCM_OP_AUTHENTICATED_ENCRYPTION)
> {
>
> - (*qp->ops->gcm.enc)(&session->gdata, dst, src,
> + aesni_gcm_enc[session->key](&session->gdata, dst, src,
> (uint64_t)op->cipher.data.length,
> op->cipher.iv.data,
> op->auth.aad.data,
> @@ -276,7 +262,7 @@ process_gcm_crypto_op(struct aesni_gcm_qp *qp,
> struct rte_crypto_sym_op *op,
> return -1;
> }
>
> - (*qp->ops->gcm.dec)(&session->gdata, dst, src,
> + aesni_gcm_dec[session->key](&session->gdata, dst, src,
> (uint64_t)op->cipher.data.length,
> op->cipher.iv.data,
> op->auth.aad.data,
> @@ -375,7 +361,7 @@ aesni_gcm_pmd_enqueue_burst(void *queue_pair,
> break;
> }
>
> - retval = process_gcm_crypto_op(qp, ops[i]->sym, sess);
> + retval = process_gcm_crypto_op(ops[i]->sym, sess);
> if (retval < 0) {
> ops[i]->status =
> RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
> qp->qp_stats.enqueue_err_count++;
> @@ -413,7 +399,6 @@ aesni_gcm_create(const char *name,
> struct rte_cryptodev *dev;
> char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
> struct aesni_gcm_private *internals;
> - enum aesni_gcm_vector_mode vector_mode;
>
> /* Check CPU for support for AES instruction set */
> if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) { @@ -421,18
> +406,6 @@ aesni_gcm_create(const char *name,
> return -EFAULT;
> }
>
> - /* Check CPU for supported vector instruction set */
> - if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))
> - vector_mode = RTE_AESNI_GCM_AVX2;
> - else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
> - vector_mode = RTE_AESNI_GCM_AVX;
> - else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
> - vector_mode = RTE_AESNI_GCM_SSE;
> - else {
> - GCM_LOG_ERR("Vector instructions are not supported by
> CPU");
> - return -EFAULT;
> - }
> -
> /* create a unique device name */
> if (create_unique_device_name(crypto_dev_name,
> RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
> @@ -459,25 +432,8 @@ aesni_gcm_create(const char *name,
> RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
> RTE_CRYPTODEV_FF_CPU_AESNI;
>
> - switch (vector_mode) {
> - case RTE_AESNI_GCM_SSE:
> - dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
> - break;
> - case RTE_AESNI_GCM_AVX:
> - dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX;
> - break;
> - case RTE_AESNI_GCM_AVX2:
> - dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX2;
> - break;
> - default:
> - break;
> - }
> -
> - /* Set vector instructions mode supported */
> internals = dev->data->dev_private;
>
> - internals->vector_mode = vector_mode;
> -
> internals->max_nb_queue_pairs = init_params-
> >max_nb_queue_pairs;
> internals->max_nb_sessions = init_params->max_nb_sessions;
>
> diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
> b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
> index e824d4b..e3ea58b 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
> @@ -48,8 +48,8 @@ static const struct rte_cryptodev_capabilities
> aesni_gcm_pmd_capabilities[] = {
> .block_size = 16,
> .key_size = {
> .min = 16,
> - .max = 16,
> - .increment = 0
> + .max = 32,
> + .increment = 16
> },
> .digest_size = {
> .min = 8,
> @@ -57,9 +57,9 @@ static const struct rte_cryptodev_capabilities
> aesni_gcm_pmd_capabilities[] = {
> .increment = 4
> },
> .aad_size = {
> - .min = 8,
> - .max = 12,
> - .increment = 4
> + .min = 0,
> + .max = 65535,
> + .increment = 1
> }
> }, }
> }, }
> @@ -73,8 +73,8 @@ static const struct rte_cryptodev_capabilities
> aesni_gcm_pmd_capabilities[] = {
> .block_size = 16,
> .key_size = {
> .min = 16,
> - .max = 16,
> - .increment = 0
> + .max = 32,
> + .increment = 16
> },
> .iv_size = {
> .min = 16,
> @@ -221,7 +221,6 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev
> *dev, uint16_t qp_id,
> int socket_id)
> {
> struct aesni_gcm_qp *qp = NULL;
> - struct aesni_gcm_private *internals = dev->data->dev_private;
>
> /* Free memory prior to re-allocation if needed. */
> if (dev->data->queue_pairs[qp_id] != NULL) @@ -239,8 +238,6 @@
> aesni_gcm_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
> if (aesni_gcm_pmd_qp_set_unique_name(dev, qp))
> goto qp_setup_cleanup;
>
> - qp->ops = &gcm_ops[internals->vector_mode];
> -
> qp->processed_pkts =
> aesni_gcm_pmd_qp_create_processed_pkts_ring(qp,
> qp_conf->nb_descriptors, socket_id);
> if (qp->processed_pkts == NULL)
> @@ -291,18 +288,15 @@ aesni_gcm_pmd_session_get_size(struct
> rte_cryptodev *dev __rte_unused)
>
> /** Configure a aesni gcm session from a crypto xform chain */ static void *
> -aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev,
> +aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev
> __rte_unused,
> struct rte_crypto_sym_xform *xform, void *sess)
> {
> - struct aesni_gcm_private *internals = dev->data->dev_private;
> -
> if (unlikely(sess == NULL)) {
> GCM_LOG_ERR("invalid session struct");
> return NULL;
> }
>
> - if (aesni_gcm_set_session_parameters(&gcm_ops[internals-
> >vector_mode],
> - sess, xform) != 0) {
> + if (aesni_gcm_set_session_parameters(sess, xform) != 0) {
> GCM_LOG_ERR("failed configure session parameters");
> return NULL;
> }
> diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> index 9878d6e..0496b44 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> @@ -58,8 +58,6 @@
>
> /** private data structure for each virtual AESNI GCM device */ struct
> aesni_gcm_private {
> - enum aesni_gcm_vector_mode vector_mode;
> - /**< Vector mode */
> unsigned max_nb_queue_pairs;
> /**< Max number of queue pairs supported by device */
> unsigned max_nb_sessions;
> @@ -71,8 +69,6 @@ struct aesni_gcm_qp {
> /**< Queue Pair Identifier */
> char name[RTE_CRYPTODEV_NAME_LEN];
> /**< Unique Queue Pair Name */
> - const struct aesni_gcm_ops *ops;
> - /**< Architecture dependent function pointer table of the gcm APIs
> */
> struct rte_ring *processed_pkts;
> /**< Ring for placing process packets */
> struct rte_mempool *sess_mp;
> @@ -87,10 +83,17 @@ enum aesni_gcm_operation {
> AESNI_GCM_OP_AUTHENTICATED_DECRYPTION
> };
>
> +enum aesni_gcm_key {
> + AESNI_GCM_KEY_128,
> + AESNI_GCM_KEY_256
> +};
> +
> /** AESNI GCM private session structure */ struct aesni_gcm_session {
> enum aesni_gcm_operation op;
> /**< GCM operation type */
> + enum aesni_gcm_key key;
> + /**< GCM key type */
> struct gcm_data gdata __rte_cache_aligned;
> /**< GCM parameters */
> };
> @@ -98,7 +101,6 @@ struct aesni_gcm_session {
>
> /**
> * Setup GCM session parameters
> - * @param ops gcm ops function pointer table
> * @param sess aesni gcm session structure
> * @param xform crypto transform chain
> *
> @@ -107,8 +109,7 @@ struct aesni_gcm_session {
> * - On failure returns error code < 0
> */
> extern int
> -aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *ops,
> - struct aesni_gcm_session *sess,
> +aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
> const struct rte_crypto_sym_xform *xform);
>
>
> diff --git a/mk/rte.app.mk b/mk/rte.app.mk index f75f0e2..ed3eab5 100644
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -134,8 +134,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD)
> += -lrte_pmd_vmxnet3_uio
> ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -
> lrte_pmd_aesni_mb
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -
> L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
> -_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -
> lrte_pmd_aesni_gcm -lcrypto
> -_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -
> L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -
> lrte_pmd_aesni_gcm -lisal_crypto
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += -lrte_pmd_openssl -
> lcrypto
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -
> lrte_pmd_null_crypto
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat -lcrypto
> --
> 2.7.0
^ permalink raw reply
* [PATCH] app/testpmd: fix invalid port ID
From: Wenzhuo Lu @ 2016-12-13 7:11 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu, Chen Jing D(Mark), stable
Some CLIs don't check the input port ID, it
may cause segmentation fault (core dumped).
Fixes: 425781ff5afe ("app/testpmd: add ixgbe VF management")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
---
CC: stable@dpdk.org
---
app/test-pmd/cmdline.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 63b55dc..315a252 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -10807,6 +10807,9 @@ struct cmd_vf_vlan_anti_spoof_result {
int ret = 0;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_vlan_anti_spoof(res->port_id, res->vf_id,
is_on);
switch (ret) {
@@ -10892,6 +10895,9 @@ struct cmd_vf_mac_anti_spoof_result {
int ret;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_mac_anti_spoof(res->port_id, res->vf_id,
is_on);
switch (ret) {
@@ -10977,6 +10983,9 @@ struct cmd_vf_vlan_stripq_result {
int ret = 0;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_vlan_stripq(res->port_id, res->vf_id, is_on);
switch (ret) {
case 0:
@@ -11060,6 +11069,9 @@ struct cmd_vf_vlan_insert_result {
struct cmd_vf_vlan_insert_result *res = parsed_result;
int ret;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_vlan_insert(res->port_id, res->vf_id, res->vlan_id);
switch (ret) {
case 0:
@@ -11134,6 +11146,9 @@ struct cmd_tx_loopback_result {
int ret;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_tx_loopback(res->port_id, is_on);
switch (ret) {
case 0:
@@ -11211,6 +11226,9 @@ struct cmd_all_queues_drop_en_result {
int ret = 0;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_all_queues_drop_en(res->port_id, is_on);
switch (ret) {
case 0:
@@ -11294,6 +11312,9 @@ struct cmd_vf_split_drop_en_result {
int ret;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_split_drop_en(res->port_id, res->vf_id,
is_on);
switch (ret) {
@@ -11378,6 +11399,9 @@ struct cmd_set_vf_mac_addr_result {
struct cmd_set_vf_mac_addr_result *res = parsed_result;
int ret;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_mac_addr(res->port_id, res->vf_id,
&res->mac_addr);
switch (ret) {
--
1.9.3
^ permalink raw reply related
* Re: [PATCH] SDK: Add scripts to initialize DPDK runtime
From: Christian Ehrhardt @ 2016-12-13 7:00 UTC (permalink / raw)
To: Luca Boccassi
Cc: bruce.richardson@intel.com, dev@dpdk.org,
stefan.bader@canonical.com
In-Reply-To: <1481579891.8314.54.camel@brocade.com>
On Mon, Dec 12, 2016 at 10:58 PM, Luca Boccassi <lboccass@brocade.com>
wrote:
> If the 2 authors (CC'ed Stefan, the second one) agree and give
> permission it could be relicensed to BSD.
>
> Stefan, Christian, is that OK for you?
>
To re-license it for this purpose is ok for me, I'll ask Stefan later today
who was starting on it before me (and added the License initially).
Thanks for pushing that forward Luca!
--
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
^ permalink raw reply
* Re: [PATCH 00/13] Introducing EAL Bus-Device-Driver Model
From: Shreyansh Jain @ 2016-12-13 6:56 UTC (permalink / raw)
To: Jianbo Liu; +Cc: David Marchand, dev@dpdk.org, Thomas Monjalon, Ferruh Yigit
In-Reply-To: <CAP4Qi38CYGC612kQJpA49xWRF=jpqJ1COWg=Qe18HDzmiLVSuA@mail.gmail.com>
Hello Jianbo,
On Monday 12 December 2016 08:05 PM, Jianbo Liu wrote:
> Hi Shreyansh,
>
> On 7 December 2016 at 21:10, Shreyansh Jain <shreyansh.jain@nxp.com> wrote:
>> On Wednesday 07 December 2016 05:47 PM, David Marchand wrote:
>>>
>>> Hello Shreyansh,
>>>
>>> On Wed, Dec 7, 2016 at 10:55 AM, Shreyansh Jain <shreyansh.jain@nxp.com>
>>> wrote:
>>>>
>>>> On Wednesday 07 December 2016 02:22 AM, David Marchand wrote:
>>>>>>
>>>>>> 0002~0003: Introducing the basic Bus model and associated test case
>>>>>> 0005: Support insertion of device rather than addition to tail
>>>>>
>>>>>
>>>>>
>>>>> Patch 2 and 5 could be squashed.
>>>>
>>>>
>>>>
>>>> I deliberately kept them separate. I intent to extend the Patch 5 for
>>>> hotplugging. But, if I don't end up adding support for that in this
>>>> series,
>>>> I will merge these two.
>>>
>>>
>>> Fine.
>>>
>>>
>>>>> The constructor priority stuff seems unneeded as long as we use
>>>>> explicit reference to a global (or local, did not check) bus symbol
>>>>> rather than a runtime lookup.
>>>>
>>>>
>>>>
>>>> I didn't understand your point here.
>>>> IMO, constructor priority (or some other way to handle this) is
>>>> important. I
>>>> faced this issue while verifying it at my end when the drivers were
>>>> getting
>>>> registered before the bus.
>>>>
>>>> Can you elaborate more on '..use explicit reference to a global...'?
>>>
>>>
>>> The drivers register themselves to a bus using this bus specific api.
>>>
>>> For pci, this is rte_eal_pci_register().
>>> The pci_bus object must be moved to eal_common_pci.c (we can stil
>>> internally expose for bsd / linux specific implementations).
>>> Then, rte_eal_pci_register() can add the pci driver to the pci_bus
>>> drivers list even if this pci_bus object is not registered yet to the
>>> buses list.
>>
>>
>> So, in eal_common_bus.c
>>
>> --->8---
>>
>> struct rte_bus *global_ptr_to_pci_bus = NULL;
>>
>> struct rte_bus pci_bus = { ... };
>>
>> rte_eal_pci_register() {
>> if (global_ptr_to_pci_bus == NULL)
>> rte_eal_bus_register(&pci_bus)
>> else
>> // continue as if PCI bus is registered
>> }
>>
>> --->8---
>>
>> so, no RTE_REGISTER_BUS()?
>>
>> If yes, then RTE_REGISTER_BUS() should also check for an existing
>> registration for duplication.
>>
>> I was banking on a model where bus handlers (or bus drivers) are independent
>> entities, just like PMDs. So, we have a bus XYZ without any drivers
>> necessarily based on it.
>>
>> By making registration dependent on driver registration, it becomes implicit
>> that buses don't exist without drivers.
>> I am not in favor of this - or maybe I lack enough reason for this (about
>> how it will make framework/PMD life better).
>>
>>>
>>> And no constructor order issue ?
>>>
>>>
>>>>>
>>>>>
>>>>>> 0004: Add scan and match callbacks for the Bus and updated test
>>>>>> case
>>>>>
>>>>>
>>>>>
>>>>> Why do you push back the bus object in the 'scan' method ?
>>>>> This method is bus specific which means that the code "knows" the
>>>>> object registered with the callback.
>>>>
>>>>
>>>>
>>>> This 'knows' is the grey area for me.
>>>> The bus (for example, PCI) after scanning needs to call
>>>> rte_eal_bus_add_device() to link the device in bus's device_list.
>>>>
>>>> Two options:
>>>> 1. Have a global reference to "pci" bus (rte_bus) somewhere in eal_pci.c
>>>> 2. Call rte_eal_get_bus() every time someone needs the reference.
>>>> 3. C++ style, 'this->'.
>>>>
>>>> I have taken the 3rd path. It simplifies my code to not assume a handle
>>>> as
>>>> well as not allow for reference fetch calls every now and then.
>>>>
>>>> As a disadvantage: it means passing this as argument - and some cases
>>>> maintaining it as __rte_unused.
>>>>
>>>> Taking (1) or (2) is not advantageous than this approach.
>>>
>>>
>>> 1) is the simplest one.
>>>
>>> When you write a pci_scan method and embed it in you pci_bus object,
>>> but this pci_scan method still wonders which bus object it is supposed
>>> to work on, this is a bit like Schizophrenia ;-).
>>
>>
>> :)
>> This now is linked to the above issue of constructor priority and having a
>> global bus reference. I don't personally prefer it.
>> I will still give this a serious thought, though.
>>
>
> I'm also in favor of (3).
Thank you. I was almost done with v2 and in that I had changed to what
David had suggested. My preference too is (3). Now, I will prefer
sticking with it - until someone comes with technical issue (like
compiler compatibility etc) which I am unaware of.
@David: Can you re-think if you still prefer (1)? If so, I will change
it in v3 (I will send v2 in a day or two max).
>
>>>
>>>
>>>>> Is is that you want to have a single scan method used by multiple buses
>>>>> ?
>>>>
>>>>
>>>>
>>>> Yes, but only as a use case. For example, platform devices are of various
>>>> types - what if we have a south-bound bus over a platform bus. In which
>>>> case, a hierarchical bus layout is possible.
>>>> But, this is far-fetched idea for now.
>>>
>
> How to express the hierarchical bus layout as the bus in your design
> is more like independent objects to hold drivers and their devices?
What I had in mind was something on the lines of:
1) Add a new linked list 'bus_list' in rte_bus
2) OR, embed rte_device in rte_bus
(1) is for maintaining buses as independent entity; (2) is for treating
buses like devices (very similar to what Ferruh once suggested [2]). I
prefer (1), but I think programmatically (2) is much more symmetrical. I
am assuming (1) below.
If we have: (taking hint from [1])
CPU
|
====,============`============= PCI Bus 0
|
PCI-PCI
Bridge
|
=,='=======,====== PCI Bus 1
| |
SCSI Ethernet
PCI Bus 0 (rte_bus)pci_bus_0
`.-> scan(): this calls knows it is a PCI-PCI bridge. It would allocate
| a new pci_bus_1 (rte_bus object) and attach to bus_list.
| Then, assign generic SCSI scan functions to pci_bus_1->scan
| and pci_bus_1->match.
`-> eal/probe()
- bus->match() is called with rte_device/driver. In this
case, it would move over all the buses in bus_list pivoted
on pci_bus_0 and call rte_bus->match.
- (#) For each matched entry, subsequently call the
rte_bus->probe()
- (*) Cascading calls to rte_driver->probe() for pci_bus_1
(#) there is still an open discussion about whether bus->probe() should
exist or not. (I am not convinced buses should probe, but DPDK model
doesn't bode well without it)
(*) pci_bus_0->probe() would get rte_device/rte_driver as NULL and
rotate over each device/driver scanned in pci_bus_1 calling bus->probe.
[1] http://www.tldp.org/LDP/tlk/dd/pci.html
[2] http://dpdk.org/ml/archives/dev/2016-August/045947.html
(Note: I agree that there are minor holes in above theory, specifically
from implementation point. But, I am confident that with minor changes
this is achievable).
>
>>>
>>> Well, if you have no usecase at the moment, let's keep it simple, please.
>>>
>>
>> Ok.
>>
>>>
>>>>>
>>>>>> 0006: Integrate bus scan/match with EAL, without any effective
>>>>>> driver
>>>>>
>>>>>
>>>>>
>>>>> Hard to find a right balance in patch splittng, but patch 4 and 6 are
>>>>> linked, I would squash them into one.
>>>>
>>>>
>>>>
>>>> Yes, it is hard and sometimes there is simply no strong rationale for
>>>> splitting or merging. This is one of those cases.
>>>> My idea was that one patch _only_ introduces Bus services (structures,
>>>> functions etc) and another should enable the calls to it from EAL.
>>>> In that sense, I still think 4 and 6 should remain separate, may be
>>>> consecutive, though.
>>>
>>>
>>> Ok, will see in next version of the patchset.
>>
>>
>> Is there anything specific that you are looking for in patchset v2?
>> I was thinking of:
>> 0. fixing BSD compilation issue reported by CI
>> 1. improving the test_pci.c
>> 2. hotplugging
>> 3. trying to move PCI to drives/bus/pci/linux/* and resolving how drivers
>> link to it, and how EAL resources like devargs are consumed.
>>
>> Anything else?
>>
>>>
>>>
>>>>>
>>>>>> 0007: rte_pci_driver->probe replaced with rte_driver->probe
>>>>>
>>>>>
>>>>>
>>>>> This patch is too big, please separate in two patches: eal changes
>>>>> then ethdev/driver changes.
>>>>
>>>>
>>>>
>>>> I don't think that can be done. One change is incomplete without the
>>>> other.
>>>>
>>>> Changes to all files are only for rte_pci_driver->probe to
>>>> rte_driver->probe
>>>> movement. EAL changes is to allow rte_eth_dev_pci_probe function after
>>>> such
>>>> a change as rte_driver->probe has different arguments as compared to
>>>> rte_pci_driver->probe. The patches won't compile if I split.
>>>>
>>>> Am I missing something?
>>>>>
>>>>>
>>>>> Why do you push back the driver object in the 'probe' method ? (idem
>>>>> rte_bus->scan).
>>>>
>>>>
>>>>
>>>> I am assuming you are referring to rte_driver->probe().
>>>> This is being done so that implementations (specific to drivers on a
>>>> particular bus) can start extracting the rte_xxx_driver, if need be.
>>>>
>>>> For example, for e1000/em_ethdev.c, rte_driver->probe() have been set to
>>>> rte_eth_dev_pci_probe() which requires rte_pci_driver to work with. In
>>>> absence of the rte_driver object, this function cannot call
>>>> rte_pci_driver->probe (for example) for driver specific operations.
>>>
>>>
>>> Sorry, I am thinking a step ahead with eth_driver out of the picture.
>>> But once eth_driver disappears, I can see no reason to keep this
>>> driver in the probe method (Schizophrenia again).
>>
>>
>> When eth_driver disappears, i was thinking of accomodating the eth_dev_init
>> into the rte_pci_driver->probe/init.
>> But, this is still a nascent thought.
>> I am yet to start working on eth_driver.
>>
>>>
>>>
>>>
>>
>
Thanks for your comments.
-
Shreyansh
^ permalink raw reply
* Re: [PATCH v2 21/32] app/testpmd: use unicast promiscuous mode on i40e
From: Lu, Wenzhuo @ 2016-12-13 1:49 UTC (permalink / raw)
To: Yigit, Ferruh, dev@dpdk.org
In-Reply-To: <1466fda4-2097-b825-9e11-dc1aae63d803@intel.com>
Hi Ferruh,
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, December 7, 2016 11:00 PM
> To: Lu, Wenzhuo; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 21/32] app/testpmd: use unicast promiscuous
> mode on i40e
>
> On 12/7/2016 3:32 AM, Wenzhuo Lu wrote:
> > Add testpmd CLI to set VF unicast promiscuous mode on i40e.
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > ---
> > app/test-pmd/cmdline.c | 92 +++++++++++++++++++++++++++++
> > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +++
> > 2 files changed, 100 insertions(+)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 12126ce..d39712e 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -404,6 +404,11 @@ static void cmd_help_long_parsed(void
> *parsed_result,
> > "set allmulti (port_id|all) (on|off)\n"
> > " Set the allmulti mode on port_id, or all.\n\n"
> >
> > +#ifdef RTE_LIBRTE_I40E_PMD
> > + "set vf unicast-promisc (port_id) (vf_id) (on|off)\n"
>
> Previous usages are all "promisc" instead of "unicals-promisc". Is this to promisc
> mode for multicast packets? If so testpmd calls them "allmulti" I guess, so they
> won't cause trouble.
>
> Can we keep using command: "promisc"?
Yes, I'll change it.
>
> <...>
>
> > +
> > +cmdline_parse_inst_t cmd_set_vf_unicast_promisc = {
> > + .f = cmd_set_vf_unicast_promisc_parsed,
> > + .data = NULL,
> > + .help_str = "set vf unicast promiscuous port_id vf_id on|off",
>
> Can you please differentiate the keyword and variable by wrapping variables
> with <>? Like:
> "set vf unicast-promiscuous <port_id> <vf_id> on|off"
The existing style is not adding the '<>'. But this help string is not good, it looks like CLI but not help. I'll change it.
>
> <...>
>
> >
> > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > index f1c269a..e17e3d5 100644
> > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > @@ -820,6 +820,14 @@ Set the allmulti mode for a port or for all ports::
> >
> > Same as the ifconfig (8) option. Controls how multicast packets are handled.
> >
> > +set unicast promisc (for VF)
> > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Should we mention this is PMD specific feature and only enabled with some
> PMDs?
Yes. Will add more explanation.
>
> > +
> > +Set the unicast promiscuous mode for a VF from PF.
> > +In promiscuous mode packets are not dropped if they aren't for the specified
> MAC address::
> > +
> > + testpmd> set vf unicast-promisc (port_id) (vf_id) (on|off)
> > +
> > set flow_ctrl rx
> > ~~~~~~~~~~~~~~~~
> >
> >
^ permalink raw reply
* Re: [PATCH v2 22/32] app/testpmd: use multicast promiscuous mode on i40e
From: Lu, Wenzhuo @ 2016-12-13 1:45 UTC (permalink / raw)
To: Yigit, Ferruh, dev@dpdk.org
In-Reply-To: <d5e65a79-9400-a110-ab50-6ab05be4f440@intel.com>
Hi Ferruh,
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, December 7, 2016 11:02 PM
> To: Lu, Wenzhuo; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 22/32] app/testpmd: use multicast
> promiscuous mode on i40e
>
> On 12/7/2016 3:32 AM, Wenzhuo Lu wrote:
> > Add testpmd CLI to set VF multicast promiscuous mode on i40e.
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > ---
> > app/test-pmd/cmdline.c | 86 +++++++++++++++++++++++++++++
> > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +++
> > 2 files changed, 94 insertions(+)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > d39712e..7e7a016 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -407,6 +407,9 @@ static void cmd_help_long_parsed(void
> > *parsed_result, #ifdef RTE_LIBRTE_I40E_PMD
> > "set vf unicast-promisc (port_id) (vf_id) (on|off)\n"
> > " Set unicast promiscuous mode for a VF from the
> PF.\n\n"
> > +
> > + "set vf multicast-promisc (port_id) (vf_id) (on|off)\n"
> > + " Set multicast promiscuous mode for a VF from the
> PF.\n\n"
>
> Why not "allmulti" instead of multicast-promisc?
>
> Also same comments as previous patch for help_str and documentation.
Sorry for the late. You're right, I should not change the word. Will send a V3.
>
> <...>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox