summaryrefslogtreecommitdiff
path: root/drivers/net/qede
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/qede')
-rw-r--r--drivers/net/qede/base/bcm_osal.h4
-rw-r--r--drivers/net/qede/qede_ethdev.c18
-rw-r--r--drivers/net/qede/qede_filter.c24
-rw-r--r--drivers/net/qede/qede_if.h2
-rw-r--r--drivers/net/qede/qede_main.c6
-rw-r--r--drivers/net/qede/qede_rxtx.c6
-rw-r--r--drivers/net/qede/qede_rxtx.h2
7 files changed, 33 insertions, 29 deletions
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 1abf44f..51edc41 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -332,7 +332,9 @@ u32 qede_find_first_zero_bit(unsigned long *, u32);
qede_find_first_zero_bit(bitmap, length)
#define OSAL_BUILD_BUG_ON(cond) nothing
-#define ETH_ALEN ETHER_ADDR_LEN
+#define ETH_ALEN RTE_ETHER_ADDR_LEN
+#define ETHER_TYPE_VLAN RTE_ETHER_TYPE_VLAN
+#define ETHER_TYPE_QINQ RTE_ETHER_TYPE_QINQ
#define OSAL_BITMAP_WEIGHT(bitmap, count) 0
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index c7fadf2..84d8984 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -565,7 +565,7 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast,
if (add) {
SLIST_FOREACH(tmp, &qdev->uc_list_head, list) {
if ((memcmp(mac_addr, &tmp->mac,
- ETHER_ADDR_LEN) == 0) &&
+ RTE_ETHER_ADDR_LEN) == 0) &&
ucast->vni == tmp->vni &&
ucast->vlan == tmp->vlan) {
DP_INFO(edev, "Unicast MAC is already added"
@@ -588,7 +588,7 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast,
} else {
SLIST_FOREACH(tmp, &qdev->uc_list_head, list) {
if ((memcmp(mac_addr, &tmp->mac,
- ETHER_ADDR_LEN) == 0) &&
+ RTE_ETHER_ADDR_LEN) == 0) &&
ucast->vlan == tmp->vlan &&
ucast->vni == tmp->vni)
break;
@@ -1216,7 +1216,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
if (rxmode->offloads & DEV_RX_OFFLOAD_JUMBO_FRAME)
eth_dev->data->mtu =
eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
- ETHER_HDR_LEN - QEDE_ETH_OVERHEAD;
+ RTE_ETHER_HDR_LEN - QEDE_ETH_OVERHEAD;
if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER)
eth_dev->data->scattered_rx = 1;
@@ -2232,9 +2232,9 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
qede_dev_info_get(dev, &dev_info);
max_rx_pkt_len = mtu + QEDE_MAX_ETHER_HDR_LEN;
frame_size = max_rx_pkt_len;
- if ((mtu < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen)) {
+ if (mtu < RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) {
DP_ERR(edev, "MTU %u out of range, %u is maximum allowable\n",
- mtu, dev_info.max_rx_pktlen - ETHER_HDR_LEN -
+ mtu, dev_info.max_rx_pktlen - RTE_ETHER_HDR_LEN -
QEDE_ETH_OVERHEAD);
return -EINVAL;
}
@@ -2274,7 +2274,7 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
fp->rxq->rx_buf_size = rc;
}
}
- if (max_rx_pkt_len > ETHER_MAX_LEN)
+ if (max_rx_pkt_len > RTE_ETHER_MAX_LEN)
dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
else
dev->data->dev_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
@@ -2408,7 +2408,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
struct qed_slowpath_params params;
static bool do_once = true;
uint8_t bulletin_change;
- uint8_t vf_mac[ETHER_ADDR_LEN];
+ uint8_t vf_mac[RTE_ETHER_ADDR_LEN];
uint8_t is_mac_forced;
bool is_mac_exist;
/* Fix up ecore debug level */
@@ -2538,7 +2538,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
/* Allocate memory for storing MAC addr */
eth_dev->data->mac_addrs = rte_zmalloc(edev->name,
- (ETHER_ADDR_LEN *
+ (RTE_ETHER_ADDR_LEN *
adapter->dev_info.num_mac_filters),
RTE_CACHE_LINE_SIZE);
@@ -2596,7 +2596,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
SLIST_INIT(&adapter->vlan_list_head);
SLIST_INIT(&adapter->uc_list_head);
SLIST_INIT(&adapter->mc_list_head);
- adapter->mtu = ETHER_MTU;
+ adapter->mtu = RTE_ETHER_MTU;
adapter->vport_started = false;
/* VF tunnel offloads is enabled by default in PF driver */
diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index 792b9ef..c2f39ce 100644
--- a/drivers/net/qede/qede_filter.c
+++ b/drivers/net/qede/qede_filter.c
@@ -221,7 +221,7 @@ qede_fdir_to_arfs_filter(struct rte_eth_dev *eth_dev,
case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
/* fill the common ip header */
- arfs->tuple.eth_proto = ETHER_TYPE_IPv4;
+ arfs->tuple.eth_proto = RTE_ETHER_TYPE_IPv4;
arfs->tuple.dst_ipv4 = input->flow.ip4_flow.dst_ip;
arfs->tuple.src_ipv4 = input->flow.ip4_flow.src_ip;
arfs->tuple.ip_proto = next_proto[input->flow_type];
@@ -237,7 +237,7 @@ qede_fdir_to_arfs_filter(struct rte_eth_dev *eth_dev,
break;
case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
- arfs->tuple.eth_proto = ETHER_TYPE_IPv6;
+ arfs->tuple.eth_proto = RTE_ETHER_TYPE_IPv6;
arfs->tuple.ip_proto = next_proto[input->flow_type];
rte_memcpy(arfs->tuple.dst_ipv6,
&input->flow.ipv6_flow.dst_ip,
@@ -473,7 +473,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
*ether_type = rte_cpu_to_be_16(arfs->tuple.eth_proto);
switch (arfs->tuple.eth_proto) {
- case ETHER_TYPE_IPv4:
+ case RTE_ETHER_TYPE_IPv4:
ip = (struct ipv4_hdr *)raw_pkt;
ip->version_ihl = QEDE_FDIR_IP_DEFAULT_VERSION_IHL;
ip->total_length = sizeof(struct ipv4_hdr);
@@ -506,7 +506,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
params->tcp = true;
}
break;
- case ETHER_TYPE_IPv6:
+ case RTE_ETHER_TYPE_IPv6:
ip6 = (struct ipv6_hdr *)raw_pkt;
ip6->proto = arfs->tuple.ip_proto;
ip6->vtc_flow =
@@ -992,25 +992,25 @@ qede_set_ucast_tunn_cmn_param(struct ecore_filter_ucast *ucast,
break;
case ECORE_FILTER_MAC:
memcpy(ucast->mac, conf->outer_mac.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
break;
case ECORE_FILTER_INNER_MAC:
memcpy(ucast->mac, conf->inner_mac.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
break;
case ECORE_FILTER_MAC_VNI_PAIR:
memcpy(ucast->mac, conf->outer_mac.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
ucast->vni = conf->tenant_id;
break;
case ECORE_FILTER_INNER_MAC_VNI_PAIR:
memcpy(ucast->mac, conf->inner_mac.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
ucast->vni = conf->tenant_id;
break;
case ECORE_FILTER_INNER_PAIR:
memcpy(ucast->mac, conf->inner_mac.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
ucast->vlan = conf->inner_vlan;
break;
default:
@@ -1266,7 +1266,8 @@ qede_flow_parse_pattern(__attribute__((unused))struct rte_eth_dev *dev,
spec = pattern->spec;
flow->entry.tuple.src_ipv4 = spec->hdr.src_addr;
flow->entry.tuple.dst_ipv4 = spec->hdr.dst_addr;
- flow->entry.tuple.eth_proto = ETHER_TYPE_IPv4;
+ flow->entry.tuple.eth_proto =
+ RTE_ETHER_TYPE_IPv4;
}
break;
@@ -1283,7 +1284,8 @@ qede_flow_parse_pattern(__attribute__((unused))struct rte_eth_dev *dev,
rte_memcpy(flow->entry.tuple.dst_ipv6,
spec->hdr.dst_addr,
IPV6_ADDR_LEN);
- flow->entry.tuple.eth_proto = ETHER_TYPE_IPv6;
+ flow->entry.tuple.eth_proto =
+ RTE_ETHER_TYPE_IPv6;
}
break;
diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h
index b840c74..02feaba 100644
--- a/drivers/net/qede/qede_if.h
+++ b/drivers/net/qede/qede_if.h
@@ -17,7 +17,7 @@ enum ecore_int_mode;
struct qed_dev_info {
uint8_t num_hwfns;
- uint8_t hw_mac[ETHER_ADDR_LEN];
+ uint8_t hw_mac[RTE_ETHER_ADDR_LEN];
bool is_mf_default;
/* FW version */
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index ec6190b..8a108f9 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -369,7 +369,7 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
dev_info->dev_type = edev->type;
rte_memcpy(&dev_info->hw_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
dev_info->fw_major = FW_MAJOR_VERSION;
dev_info->fw_minor = FW_MINOR_VERSION;
@@ -434,7 +434,7 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
max_vf_vlan_filters;
rte_memcpy(&info->port_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
} else {
ecore_vf_get_num_rxqs(ECORE_LEADING_HWFN(edev),
&info->num_queues);
@@ -455,7 +455,7 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
qed_fill_dev_info(edev, &info->common);
if (IS_VF(edev))
- memset(&info->common.hw_mac, 0, ETHER_ADDR_LEN);
+ memset(&info->common.hw_mac, 0, RTE_ETHER_ADDR_LEN);
return 0;
}
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 0e8a367..235f78a 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -963,21 +963,21 @@ static inline uint32_t qede_rx_cqe_to_pkt_type_outer(struct rte_mbuf *m)
ethertype = rte_cpu_to_be_16(eth_hdr->ether_type);
/* Note: Valid only if VLAN stripping is disabled */
- if (ethertype == ETHER_TYPE_VLAN) {
+ if (ethertype == RTE_ETHER_TYPE_VLAN) {
vlan_tagged = 1;
vlan_hdr = (struct rte_vlan_hdr *)(eth_hdr + 1);
len += sizeof(struct rte_vlan_hdr);
ethertype = rte_cpu_to_be_16(vlan_hdr->eth_proto);
}
- if (ethertype == ETHER_TYPE_IPv4) {
+ if (ethertype == RTE_ETHER_TYPE_IPv4) {
packet_type |= RTE_PTYPE_L3_IPV4;
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, len);
if (ipv4_hdr->next_proto_id == IPPROTO_TCP)
packet_type |= RTE_PTYPE_L4_TCP;
else if (ipv4_hdr->next_proto_id == IPPROTO_UDP)
packet_type |= RTE_PTYPE_L4_UDP;
- } else if (ethertype == ETHER_TYPE_IPv6) {
+ } else if (ethertype == RTE_ETHER_TYPE_IPv6) {
packet_type |= RTE_PTYPE_L3_IPV6;
ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, len);
if (ipv6_hdr->proto == IPPROTO_TCP)
diff --git a/drivers/net/qede/qede_rxtx.h b/drivers/net/qede/qede_rxtx.h
index 5b249cb..41a5f0f 100644
--- a/drivers/net/qede/qede_rxtx.h
+++ b/drivers/net/qede/qede_rxtx.h
@@ -70,7 +70,7 @@
#define QEDE_ETH_OVERHEAD (((2 * QEDE_VLAN_TAG_SIZE)) \
+ (QEDE_LLC_SNAP_HDR_LEN) + 2)
-#define QEDE_MAX_ETHER_HDR_LEN (ETHER_HDR_LEN + QEDE_ETH_OVERHEAD)
+#define QEDE_MAX_ETHER_HDR_LEN (RTE_ETHER_HDR_LEN + QEDE_ETH_OVERHEAD)
#define QEDE_RSS_OFFLOAD_ALL (ETH_RSS_IPV4 |\
ETH_RSS_NONFRAG_IPV4_TCP |\