#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_common.h>
+#include <rte_cycles.h>
#include "mlx5.h"
#include "mlx5_flow.h"
struct tcf_neigh_rule {
LIST_ENTRY(tcf_neigh_rule) next;
uint32_t refcnt;
- struct ether_addr eth;
+ struct rte_ether_addr eth;
uint16_t mask;
union {
struct {
uint8_t ip_tos;
uint8_t ip_ttl_hop;
struct {
- struct ether_addr dst;
- struct ether_addr src;
+ struct rte_ether_addr dst;
+ struct rte_ether_addr src;
} eth;
union {
struct {
{
int idx = p_parser->sel.nkeys;
uint32_t off = actions->type == RTE_FLOW_ACTION_TYPE_SET_MAC_SRC ?
- offsetof(struct ether_hdr, s_addr) :
- offsetof(struct ether_hdr, d_addr);
+ offsetof(struct rte_ether_hdr, s_addr) :
+ offsetof(struct rte_ether_hdr, d_addr);
const struct rte_flow_action_set_mac *conf =
(const struct rte_flow_action_set_mac *)actions->conf;
*/
if ((action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN) &&
(action_flags & MLX5_FLOW_ACTION_PORT_ID) &&
- ((struct priv *)port_id_dev->data->dev_private)->representor)
+ ((struct mlx5_priv *)port_id_dev->data->dev_private)->representor)
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION, actions,
"vlan push can only be applied"
* VXLAN VNI in 24-bit wire format.
*
* @return
- * VXLAN VNI as a 32-bit integer value in network endian.
+ * VXLAN VNI as a 32-bit integer value in network endianness.
*/
static inline rte_be32_t
vxlan_vni_as_be32(const uint8_t vni[3])
nlh->nlmsg_flags |= NLM_F_ACK;
ret = mnl_socket_sendto(tcf->nl, nlh, nlh->nlmsg_len);
if (ret <= 0) {
- /* Message send error occurres. */
+ /* Message send error occurred. */
rte_errno = errno;
return -rte_errno;
}
* @param[in] tcf
* Context object initialized by mlx5_flow_tcf_context_create().
* @param[in] ifindex
- * Network inferface index to perform cleanup.
+ * Network interface index to perform cleanup.
*/
static void
flow_tcf_encap_local_cleanup(struct mlx5_flow_tcf_context *tcf,
}
/**
- * Collect neigh permament rules on specified network device.
+ * Collect neigh permanent rules on specified network device.
* This is callback routine called by libmnl mnl_cb_run() in loop for
* every message in received packet.
*
}
if (!na_mac || !na_ip)
return 1;
- /* Neigh rule with permenent attribute found. */
+ /* Neigh rule with permanent attribute found. */
size = MNL_ALIGN(sizeof(struct nlmsghdr)) +
MNL_ALIGN(sizeof(struct ndmsg)) +
SZ_NLATTR_DATA_OF(ETHER_ADDR_LEN) +
* @param[in] tcf
* Context object initialized by mlx5_flow_tcf_context_create().
* @param[in] ifindex
- * Network inferface index to perform cleanup.
+ * Network interface index to perform cleanup.
*/
static void
flow_tcf_encap_neigh_cleanup(struct mlx5_flow_tcf_context *tcf,
* Note that an implicit route is maintained by the kernel due to the
* presence of a peer address (IFA_ADDRESS).
*
- * These rules are used for encapsultion only and allow to assign
+ * These rules are used for encapsulation only and allow to assign
* the outer tunnel source IP address.
*
* @param[in] tcf
/**
* Releases VXLAN encap rules container by pointer. Decrements the
- * reference cointer and deletes the container if counter is zero.
+ * reference counter and deletes the container if counter is zero.
*
* @param[in] irule
* VXLAN rule container pointer to release.
* @param[in] tcf
* Context object initialized by mlx5_flow_tcf_context_create().
* @param[in] vtep
- * Object represinting the network device to delete. Memory
+ * Object representing the network device to delete. Memory
* allocated for this object is freed by routine.
*/
static void
}
/**
- * Aqcuire target interface index for VXLAN tunneling encapsulation.
+ * Acquire target interface index for VXLAN tunneling encapsulation.
*
* @param[in] tcf
* Context object initialized by mlx5_flow_tcf_context_create().
static void
flow_tcf_remove(struct rte_eth_dev *dev, struct rte_flow *flow)
{
- struct priv *priv = dev->data->dev_private;
+ struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_flow_tcf_context *ctx = priv->tcf_context;
struct mlx5_flow *dev_flow;
struct nlmsghdr *nlh;
/**
* Fetch the applied rule handle. This is callback routine called by
* libmnl mnl_cb_run() in loop for every message in received packet.
- * When the NLM_F_ECHO flag i sspecified the kernel sends the created
+ * When the NLM_F_ECHO flag is specified the kernel sends the created
* rule descriptor back to the application and we can retrieve the
* actual rule handle from updated descriptor.
*
flow_tcf_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
struct rte_flow_error *error)
{
- struct priv *priv = dev->data->dev_private;
+ struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_flow_tcf_context *ctx = priv->tcf_context;
struct mlx5_flow *dev_flow;
struct nlmsghdr *nlh;
{
struct flow_tcf_stats_basic sb_data;
struct rte_flow_query_count *qc = data;
- struct priv *priv = dev->data->dev_private;
+ struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_flow_tcf_context *ctx = priv->tcf_context;
struct mnl_socket *nl = ctx->nl;
struct mlx5_flow *dev_flow;