int len, seg_len, total_len;
int i, j, n_seg;
- int cur_match, num_matches, total_matches;
+ int cur_match, num_matches, total_matches = 0;
/* chain matching */
for (i = 0; i < pm_test_buf_len; i++) {
struct rte_pm_inbuf in_buf;
int i, j, len;
- int match, num_matches, total_matches;
+ int match, num_matches, total_matches = 0;
/* look at same segment three times */
for (i = 0; i < pm_test_buf_len; i++) {
static unsigned int l2fwd_rx_queue_per_lcore = 1;
-#define MAX_PKT_BURST 32
struct mbuf_table {
unsigned len;
struct rte_mbuf *m_table[MAX_PKT_BURST];
struct lcore_queue_conf *qconf;
struct rte_eth_dev_info dev_info;
int ret;
- unsigned int nb_ports;
- unsigned portid, last_port;
+ uint8_t nb_ports;
+ uint8_t portid, last_port;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;
nb_ports_in_mask++;
- rte_eth_dev_info_get((uint8_t) portid, &dev_info);
+ rte_eth_dev_info_get(portid, &dev_info);
}
if (nb_ports_in_mask < 2 || nb_ports_in_mask % 2) {
printf("Notice: odd number of ports in portmask.\n");
qconf->rx_port_list[qconf->n_rx_port] = portid;
qconf->n_rx_port++;
- printf("Lcore %u: RX port %u\n", rx_lcore_id, portid);
+ printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid);
}
/* Initialise each port */
for (portid = 0; portid < nb_ports; portid++) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
- printf("Skipping disabled port %u\n", portid);
+ printf("Skipping disabled port %u\n", (unsigned) portid);
continue;
}
/* init port */
- printf("Initializing port %u... ", portid);
+ printf("Initializing port %u... ", (unsigned) portid);
fflush(stdout);
- ret = rte_eth_dev_configure((uint8_t) portid, 1, 1, &port_conf);
+ ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
- ret, portid);
+ ret, (unsigned) portid);
- rte_eth_macaddr_get((uint8_t) portid,&l2fwd_ports_eth_addr[portid]);
+ rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]);
/* init one RX queue */
fflush(stdout);
- ret = rte_eth_rx_queue_setup((uint8_t) portid, 0, nb_rxd,
- SOCKET0, &rx_conf,
+ ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
+ rte_eth_dev_socket_id(portid), &rx_conf,
l2fwd_pktmbuf_pool);
if (ret < 0)
- rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
- ret, portid);
+ rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
+ ret, (unsigned) portid);
/* init one TX queue logical core on each port */
fflush(stdout);
- ret = rte_eth_tx_queue_setup((uint8_t) portid, 0, nb_txd,
+ ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
SOCKET0, &tx_conf);
if (ret < 0)
rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
- ret, portid);
+ ret, (unsigned) portid);
/* Start device */
- ret = rte_eth_dev_start((uint8_t) portid);
+ ret = rte_eth_dev_start(portid);
if (ret < 0)
rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n",
- ret, portid);
+ ret, (unsigned) portid);
printf("done: \n");
- rte_eth_promiscuous_enable((uint8_t)portid);
+ rte_eth_promiscuous_enable(portid);
printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
- portid,
+ (unsigned) portid,
l2fwd_ports_eth_addr[portid].addr_bytes[0],
l2fwd_ports_eth_addr[portid].addr_bytes[1],
l2fwd_ports_eth_addr[portid].addr_bytes[2],
memset(&port_statistics, 0, sizeof(port_statistics));
}
- check_all_ports_link_status((uint8_t)nb_ports, l2fwd_enabled_port_mask);
+ check_all_ports_link_status(nb_ports, l2fwd_enabled_port_mask);
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MASTER);
struct lcore_queue_conf *qconf;
struct rte_eth_dev_info dev_info;
int ret;
- unsigned int nb_ports;
- unsigned portid, portid_last = 0;
+ uint8_t nb_ports;
+ uint8_t portid, portid_last = 0;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;
nb_ports_in_mask++;
- rte_eth_dev_info_get((uint8_t) portid, &dev_info);
+ rte_eth_dev_info_get(portid, &dev_info);
}
if (nb_ports_in_mask < 2 || nb_ports_in_mask % 2)
rte_exit(EXIT_FAILURE, "Current enabled port number is %u, "
qconf->rx_port_list[qconf->n_rx_port] = portid;
qconf->n_rx_port++;
- printf("Lcore %u: RX port %u\n",rx_lcore_id, portid);
+ printf("Lcore %u: RX port %u\n",rx_lcore_id, (unsigned) portid);
}
/* Initialise each port */
for (portid = 0; portid < nb_ports; portid++) {
/* skip ports that are not enabled */
if ((lsi_enabled_port_mask & (1 << portid)) == 0) {
- printf("Skipping disabled port %u\n", portid);
+ printf("Skipping disabled port %u\n", (unsigned) portid);
continue;
}
/* init port */
- printf("Initializing port %u... ", portid);
+ printf("Initializing port %u... ", (unsigned) portid);
fflush(stdout);
- ret = rte_eth_dev_configure((uint8_t) portid, 1, 1, &port_conf);
+ ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
- ret, portid);
+ ret, (unsigned) portid);
/* register lsi interrupt callback, need to be after
* rte_eth_dev_configure(). if (intr_conf.lsc == 0), no
* lsc interrupt will be present, and below callback to
* be registered will never be called.
*/
- rte_eth_dev_callback_register((uint8_t)portid,
+ rte_eth_dev_callback_register(portid,
RTE_ETH_EVENT_INTR_LSC, lsi_event_callback, NULL);
- rte_eth_macaddr_get((uint8_t) portid,
+ rte_eth_macaddr_get(portid,
&lsi_ports_eth_addr[portid]);
/* init one RX queue */
fflush(stdout);
- ret = rte_eth_rx_queue_setup((uint8_t) portid, 0, nb_rxd,
+ ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
SOCKET0, &rx_conf,
lsi_pktmbuf_pool);
if (ret < 0)
- rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%u\n",
- ret, portid);
+ rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, port=%u\n",
+ ret, (unsigned) portid);
/* init one TX queue logical core on each port */
fflush(stdout);
- ret = rte_eth_tx_queue_setup((uint8_t) portid, 0, nb_txd,
+ ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
SOCKET0, &tx_conf);
if (ret < 0)
rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d,port=%u\n",
- ret, portid);
+ ret, (unsigned) portid);
/* Start device */
- ret = rte_eth_dev_start((uint8_t) portid);
+ ret = rte_eth_dev_start(portid);
if (ret < 0)
rte_exit(EXIT_FAILURE, "rte_eth_dev_start: err=%d, port=%u\n",
- ret, portid);
+ ret, (unsigned) portid);
printf("done:\n");
printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
- portid,
+ (unsigned) portid,
lsi_ports_eth_addr[portid].addr_bytes[0],
lsi_ports_eth_addr[portid].addr_bytes[1],
lsi_ports_eth_addr[portid].addr_bytes[2],
memset(&port_statistics, 0, sizeof(port_statistics));
}
- check_all_ports_link_status((uint8_t)nb_ports, lsi_enabled_port_mask);
+ check_all_ports_link_status(nb_ports, lsi_enabled_port_mask);
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(lsi_launch_one_lcore, NULL, CALL_MASTER);
__attribute__((unused)) struct cmdline *cl,
__attribute__((unused)) void *data)
{
- void *msg;
+ void *msg = NULL;
struct cmd_send_result *res = parsed_result;
if (rte_mempool_get(message_pool, &msg) < 0)
* power-of-two value.
*/
#define RTE_ALIGN_FLOOR(val, align) \
- (typeof(val))(val & (~((typeof(val))(align - 1))))
+ (typeof(val))((val) & (~((typeof(val))((align) - 1))))
/**
* Macro to align a pointer to a given power-of-two. The resultant
* must be a power-of-two value.
*/
#define RTE_PTR_ALIGN_CEIL(ptr, align) \
- RTE_PTR_ALIGN_FLOOR(RTE_PTR_ADD(ptr, align - 1), align)
+ RTE_PTR_ALIGN_FLOOR(RTE_PTR_ADD(ptr, (align) - 1), align)
/**
* Macro to align a value to a given power-of-two. The resultant value
* value.
*/
#define RTE_ALIGN_CEIL(val, align) \
- RTE_ALIGN_FLOOR((val + ((typeof(val)) align - 1)), align)
+ RTE_ALIGN_FLOOR(((val) + ((typeof(val)) (align) - 1)), align)
/**
* Macro to align a pointer to a given power-of-two. The resultant
/* now convert to int values */
errno = 0;
- *domain = (uint8_t)strtoul(splitaddr.domain, NULL, 16);
+ *domain = (uint16_t)strtoul(splitaddr.domain, NULL, 16);
*bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16);
*devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16);
*function = (uint8_t)strtoul(splitaddr.function, NULL, 10);
kni->mbuf_size = dev_info.mbuf_size;
KNI_PRINT("tx_phys: 0x%016llx, tx_q addr: 0x%p\n",
- dev_info.tx_phys, kni->tx_q);
+ (unsigned long long) dev_info.tx_phys, kni->tx_q);
KNI_PRINT("rx_phys: 0x%016llx, rx_q addr: 0x%p\n",
- dev_info.rx_phys, kni->rx_q);
+ (unsigned long long) dev_info.rx_phys, kni->rx_q);
KNI_PRINT("alloc_phys: 0x%016llx, alloc_q addr: 0x%p\n",
- dev_info.alloc_phys, kni->alloc_q);
+ (unsigned long long) dev_info.alloc_phys, kni->alloc_q);
KNI_PRINT("free_phys: 0x%016llx, free_q addr: 0x%p\n",
- dev_info.free_phys, kni->free_q);
+ (unsigned long long) dev_info.free_phys, kni->free_q);
KNI_PRINT("req_phys: 0x%016llx, req_q addr: 0x%p\n",
- dev_info.req_phys, kni->req_q);
+ (unsigned long long) dev_info.req_phys, kni->req_q);
KNI_PRINT("resp_phys: 0x%016llx, resp_q addr: 0x%p\n",
- dev_info.resp_phys, kni->resp_q);
+ (unsigned long long) dev_info.resp_phys, kni->resp_q);
KNI_PRINT("mbuf_phys: 0x%016llx, mbuf_kva: 0x%p\n",
- dev_info.mbuf_phys, kni->mbuf_kva);
+ (unsigned long long) dev_info.mbuf_phys, kni->mbuf_kva);
KNI_PRINT("mbuf_va: 0x%p\n", dev_info.mbuf_va);
KNI_PRINT("mbuf_size: %u\n", kni->mbuf_size);
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+ifeq ($(CC), icc)
+#
+# CFLAGS for icc
+#
+CFLAGS_LAD = -wd177 -wd181 -wd188 -wd869 -wd2259
+else
+#
+# CFLAGS for gcc
+#
+CFLAGS_LAD = -Wno-uninitialized -Wno-unused-parameter
+CFLAGS_LAD += -Wno-unused-variable
+endif
+
+#
+# Add extra flags for LAD source files to disable warnings in them
+#
+LAD_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_e1000/e1000/*.c)))
+$(foreach obj, $(LAD_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_LAD)))
+
VPATH += $(RTE_SDK)/lib/librte_pmd_e1000/e1000
#
#include "../e1000_logs.h"
-/* Remove some compiler warnings for the files in this dir */
-#ifdef __INTEL_COMPILER
-#pragma warning(disable:2259) /* conversion may lose significant bits */
-#pragma warning(disable:869) /* Parameter was never referenced */
-#pragma warning(disable:181) /* Arg incompatible with format string */
-#pragma warning(disable:188) /* enumerated type mixed with another type */
-#pragma warning(disable:1599) /* declaration hides variable */
-#pragma warning(disable:177) /* declared but never referenced */
-#else
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-#pragma GCC diagnostic ignored "-Wformat"
-#pragma GCC diagnostic ignored "-Wuninitialized"
-#pragma GCC diagnostic ignored "-Wunused-variable"
-#if (((__GNUC__) >= 4) && ((__GNUC_MINOR__) >= 7))
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#endif
-#endif
-
#define DELAY(x) rte_delay_us(x)
#define usec_delay(x) DELAY(x)
#define msec_delay(x) DELAY(1000*(x))
#define E1000_ACCESS_PANIC(x, hw, reg, value) \
rte_panic("%s:%u\t" RTE_STR(x) "(%p, 0x%x, 0x%x)", \
- __FILE__, __LINE__, (hw), (reg), (value))
+ __FILE__, __LINE__, (hw), (reg), (unsigned int)(value))
/*
* To be able to do IO write, we need to map IO BAR
* void
*/
static void
-eth_em_interrupt_handler(struct rte_intr_handle *handle, void *param)
+eth_em_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
+ void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
cmd_len = E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_C;
l2len = hdrlen.f.l2_len;
- ipcse = l2len + hdrlen.f.l3_len;
+ ipcse = (uint16_t)(l2len + hdrlen.f.l3_len);
/* setup IPCS* fields */
- ctx.lower_setup.ip_fields.ipcss = l2len;
- ctx.lower_setup.ip_fields.ipcso =l2len +
- offsetof(struct ipv4_hdr, hdr_checksum);
+ ctx.lower_setup.ip_fields.ipcss = (uint8_t)l2len;
+ ctx.lower_setup.ip_fields.ipcso = (uint8_t)(l2len +
+ offsetof(struct ipv4_hdr, hdr_checksum));
/*
* When doing checksum or TCP segmentation with IPv6 headers,
* IPCSE field should be set t0 0.
*/
if (flags & PKT_TX_IP_CKSUM) {
- ctx.lower_setup.ip_fields.ipcse = rte_cpu_to_le_16(ipcse - 1);
+ ctx.lower_setup.ip_fields.ipcse =
+ (uint16_t)rte_cpu_to_le_16(ipcse - 1);
cmd_len |= E1000_TXD_CMD_IP;
cmp_mask |= TX_MACIP_LEN_CMP_MASK;
} else {
}
/* setup TUCS* fields */
- ctx.upper_setup.tcp_fields.tucss = ipcse;
+ ctx.upper_setup.tcp_fields.tucss = (uint8_t)ipcse;
ctx.upper_setup.tcp_fields.tucse = 0;
switch (flags & PKT_TX_L4_MASK) {
case PKT_TX_UDP_CKSUM:
- ctx.upper_setup.tcp_fields.tucso = ipcse +
- offsetof(struct udp_hdr, dgram_cksum);
+ ctx.upper_setup.tcp_fields.tucso = (uint8_t)(ipcse +
+ offsetof(struct udp_hdr, dgram_cksum));
cmp_mask |= TX_MACIP_LEN_CMP_MASK;
break;
case PKT_TX_TCP_CKSUM:
- ctx.upper_setup.tcp_fields.tucso = ipcse +
- offsetof(struct tcp_hdr, cksum);
+ ctx.upper_setup.tcp_fields.tucso = (uint8_t)(ipcse +
+ offsetof(struct tcp_hdr, cksum));
cmd_len |= E1000_TXD_CMD_TCP;
cmp_mask |= TX_MACIP_LEN_CMP_MASK;
break;
uint16_t nb_tx_to_clean;
/* Determine the last descriptor needing to be cleaned */
- desc_to_clean_to = last_desc_cleaned + txq->tx_rs_thresh;
+ desc_to_clean_to = (uint16_t)(last_desc_cleaned + txq->tx_rs_thresh);
if (desc_to_clean_to >= nb_tx_desc)
- desc_to_clean_to = desc_to_clean_to - nb_tx_desc;
+ desc_to_clean_to = (uint16_t)(desc_to_clean_to - nb_tx_desc);
/* Check to make sure the last descriptor to clean is done */
desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
/* Figure out how many descriptors will be cleaned */
if (last_desc_cleaned > desc_to_clean_to)
- nb_tx_to_clean = ((nb_tx_desc - last_desc_cleaned) +
- desc_to_clean_to);
+ nb_tx_to_clean = (uint16_t)((nb_tx_desc - last_desc_cleaned) +
+ desc_to_clean_to);
else
- nb_tx_to_clean = desc_to_clean_to - last_desc_cleaned;
+ nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
+ last_desc_cleaned);
PMD_TX_FREE_LOG(DEBUG,
"Cleaning %4u TX descriptors: %4u to %4u "
/* Update the txq to reflect the last descriptor that was cleaned */
txq->last_desc_cleaned = desc_to_clean_to;
- txq->nb_tx_free += nb_tx_to_clean;
+ txq->nb_tx_free = (uint16_t)(txq->nb_tx_free + nb_tx_to_clean);
/* No Error */
return (0);
ol_flags = tx_pkt->ol_flags;
/* If hardware offload required */
- tx_ol_req = ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK);
+ tx_ol_req = (uint16_t)(ol_flags & (PKT_TX_IP_CKSUM |
+ PKT_TX_L4_MASK));
if (tx_ol_req) {
hdrlen = tx_pkt->pkt.vlan_macip;
/* If new context to be built or reuse the exist ctx. */
* This will always be the number of segments + the number of
* Context descriptors required to transmit the packet
*/
- nb_used = tx_pkt->pkt.nb_segs + new_ctx;
+ nb_used = (uint16_t)(tx_pkt->pkt.nb_segs + new_ctx);
/*
* The number of descriptors that must be allocated for a
* The last packet data descriptor needs End Of Packet (EOP)
*/
cmd_type_len |= E1000_TXD_CMD_EOP;
- txq->nb_tx_used += nb_used;
- txq->nb_tx_free -= nb_used;
+ txq->nb_tx_used = (uint16_t)(txq->nb_tx_used + nb_used);
+ txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
/* Set RS bit only on threshold packets' last descriptor */
if (txq->nb_tx_used >= txq->tx_rs_thresh) {
uint16_t pkt_flags;
/* Check if VLAN present */
- pkt_flags = (uint16_t) (rx_status & E1000_RXD_STAT_VP) ?
- PKT_RX_VLAN_PKT : 0;
+ pkt_flags = (uint16_t)((rx_status & E1000_RXD_STAT_VP) ?
+ PKT_RX_VLAN_PKT : 0);
return pkt_flags;
}
rxm->pkt.in_port = rxq->port_id;
rxm->ol_flags = rx_desc_status_to_pkt_flags(status);
- rxm->ol_flags |= rx_desc_error_to_pkt_flags(rxd.errors);
+ rxm->ol_flags = (uint16_t)(rxm->ol_flags |
+ rx_desc_error_to_pkt_flags(rxd.errors));
/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
rxm->pkt.vlan_macip.f.vlan_tci = rte_le_to_cpu_16(rxd.special);
first_seg->pkt.in_port = rxq->port_id;
first_seg->ol_flags = rx_desc_status_to_pkt_flags(status);
- first_seg->ol_flags |= rx_desc_error_to_pkt_flags(rxd.errors);
+ first_seg->ol_flags = (uint16_t)(first_seg->ol_flags |
+ rx_desc_error_to_pkt_flags(rxd.errors));
/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
rxm->pkt.vlan_macip.f.vlan_tci = rte_le_to_cpu_16(rxd.special);
tx_free_thresh = tx_conf->tx_free_thresh;
if (tx_free_thresh == 0)
- tx_free_thresh = RTE_MIN(nb_desc / 4, DEFAULT_TX_FREE_THRESH);
+ tx_free_thresh = (uint16_t)RTE_MIN(nb_desc / 4,
+ DEFAULT_TX_FREE_THRESH);
tx_rs_thresh = tx_conf->tx_rs_thresh;
if (tx_rs_thresh == 0)
- tx_rs_thresh = RTE_MIN(tx_free_thresh, DEFAULT_TX_RS_THRESH);
+ tx_rs_thresh = (uint16_t)RTE_MIN(tx_free_thresh,
+ DEFAULT_TX_RS_THRESH);
if (tx_free_thresh >= (nb_desc - 3)) {
- RTE_LOG(ERR, PMD,
- "tx_free_thresh must be less than the "
- "number of TX descriptors minus 3. "
- "(tx_free_thresh=%u port=%d queue=%d)\n",
- tx_free_thresh, dev->data->port_id, queue_idx);
+ RTE_LOG(ERR, PMD, "tx_free_thresh must be less than the "
+ "number of TX descriptors minus 3. (tx_free_thresh=%u "
+ "port=%d queue=%d)\n", (unsigned int)tx_free_thresh,
+ (int)dev->data->port_id, (int)queue_idx);
return -(EINVAL);
}
if (tx_rs_thresh > tx_free_thresh) {
- RTE_LOG(ERR, PMD,
- "tx_rs_thresh must be less than or equal to "
- "tx_free_thresh. "
- "(tx_free_thresh=%u tx_rs_thresh=%u "
- "port=%d queue=%d)\n",
- tx_free_thresh, tx_rs_thresh, dev->data->port_id,
- queue_idx);
+ RTE_LOG(ERR, PMD, "tx_rs_thresh must be less than or equal to "
+ "tx_free_thresh. (tx_free_thresh=%u tx_rs_thresh=%u "
+ "port=%d queue=%d)\n", (unsigned int)tx_free_thresh,
+ (unsigned int)tx_rs_thresh, (int)dev->data->port_id,
+ (int)queue_idx);
return -(EINVAL);
}
* accumulates WTHRESH descriptors.
*/
if (tx_conf->tx_thresh.wthresh != 0 && tx_rs_thresh != 1) {
- RTE_LOG(ERR, PMD,
- "TX WTHRESH must be set to 0 if "
- "tx_rs_thresh is greater than 1. "
- "(tx_rs_thresh=%u port=%d queue=%d)\n",
- tx_rs_thresh, dev->data->port_id, queue_idx);
+ RTE_LOG(ERR, PMD, "TX WTHRESH must be set to 0 if "
+ "tx_rs_thresh is greater than 1. (tx_rs_thresh=%u "
+ "port=%d queue=%d)\n", (unsigned int)tx_rs_thresh,
+ (int)dev->data->port_id, (int)queue_idx);
return -(EINVAL);
}
* Returns (BSIZE | BSEX | FLXBUF) fields of RCTL register.
*/
static uint32_t
-em_rctl_bsize(enum e1000_mac_type hwtyp, uint32_t *bufsz)
+em_rctl_bsize(__rte_unused enum e1000_mac_type hwtyp, uint32_t *bufsz)
{
/*
* For BSIZE & BSEX all configurable sizes are:
* void
*/
static void
-eth_igb_interrupt_handler(struct rte_intr_handle *handle, void *param)
+eth_igb_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
+ void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
mask = 1;
for (j = 0; j < 32; j++){
if(vfta & mask)
- igbvf_set_vfta(hw, (i<<5)+j, on);
+ igbvf_set_vfta(hw,
+ (uint16_t)((i<<5)+j), on);
mask<<=1;
}
}
ol_flags = tx_pkt->ol_flags;
vlan_macip_lens = tx_pkt->pkt.vlan_macip.data;
- tx_ol_req = (ol_flags & PKT_TX_OFFLOAD_MASK);
+ tx_ol_req = (uint16_t)(ol_flags & PKT_TX_OFFLOAD_MASK);
/* If a Context Descriptor need be built . */
if (tx_ol_req) {
0, 0, 0, 0,
};
- pkt_flags = (uint16_t) (hl_tp_rs & E1000_RXDADV_PKTTYPE_ETQF) ?
+ pkt_flags = (uint16_t)((hl_tp_rs & E1000_RXDADV_PKTTYPE_ETQF) ?
ip_pkt_etqf_map[(hl_tp_rs >> 4) & 0x07] :
- ip_pkt_types_map[(hl_tp_rs >> 4) & 0x0F];
+ ip_pkt_types_map[(hl_tp_rs >> 4) & 0x0F]);
#else
- pkt_flags = (uint16_t) (hl_tp_rs & E1000_RXDADV_PKTTYPE_ETQF) ? 0 :
- ip_pkt_types_map[(hl_tp_rs >> 4) & 0x0F];
+ pkt_flags = (uint16_t)((hl_tp_rs & E1000_RXDADV_PKTTYPE_ETQF) ? 0 :
+ ip_pkt_types_map[(hl_tp_rs >> 4) & 0x0F]);
#endif
- return pkt_flags | (uint16_t) (((hl_tp_rs & 0x0F) == 0) ? 0 :
- PKT_RX_RSS_HASH);
+ return (uint16_t)(pkt_flags | (((hl_tp_rs & 0x0F) == 0) ?
+ 0 : PKT_RX_RSS_HASH));
}
static inline uint16_t
uint16_t pkt_flags;
/* Check if VLAN present */
- pkt_flags = (uint16_t) (rx_status & E1000_RXD_STAT_VP) ? PKT_RX_VLAN_PKT : 0;
+ pkt_flags = (uint16_t)((rx_status & E1000_RXD_STAT_VP) ?
+ PKT_RX_VLAN_PKT : 0);
#if defined(RTE_LIBRTE_IEEE1588)
if (rx_status & E1000_RXD_STAT_TMST)
- pkt_flags = pkt_flags | PKT_RX_IEEE1588_TMST;
+ pkt_flags = (uint16_t)(pkt_flags | PKT_RX_IEEE1588_TMST);
#endif
return pkt_flags;
}
rte_le_to_cpu_16(rxd.wb.upper.vlan);
pkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);
- pkt_flags = (pkt_flags |
- rx_desc_status_to_pkt_flags(staterr));
- pkt_flags = (pkt_flags |
- rx_desc_error_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_status_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_error_to_pkt_flags(staterr));
rxm->ol_flags = pkt_flags;
/*
rte_le_to_cpu_16(rxd.wb.upper.vlan);
hlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);
pkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);
- pkt_flags = (pkt_flags | rx_desc_status_to_pkt_flags(staterr));
- pkt_flags = (pkt_flags | rx_desc_error_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_status_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_error_to_pkt_flags(staterr));
first_seg->ol_flags = pkt_flags;
/* Prefetch data of first segment, if configured to do so. */
}
/* Initialize ring entries */
- prev = txq->nb_tx_desc - 1;
+ prev = (uint16_t)(txq->nb_tx_desc - 1);
for (i = 0; i < txq->nb_tx_desc; i++) {
volatile union e1000_adv_tx_desc *txd = &(txq->tx_ring[i]);
#
LIB = librte_pmd_ixgbe.a
-CFLAGS += -O3 -Wno-deprecated
+CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+ifeq ($(CC), icc)
+#
+# CFLAGS for icc
+#
+CFLAGS_LAD = -wd174 -wd593 -wd869 -wd981 -wd2259
+else
+#
+# CFLAGS for gcc
+#
+ifneq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 3 && echo 1), 1)
+CFLAGS += -Wno-deprecated
+endif
+CFLAGS_LAD = -Wno-unused-parameter -Wno-unused-value
+CFLAGS_LAD += -Wno-strict-aliasing -Wno-format-extra-args
+
+ifeq ($(shell test $(GCC_MAJOR_VERSION) -ge 4 -a $(GCC_MINOR_VERSION) -ge 6 && echo 1), 1)
+CFLAGS_ixgbe_common.o += -Wno-unused-but-set-variable
+endif
+endif
+
+#
+# Add extra flags for LAD source files to disable warnings in them
+#
+LAD_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_ixgbe/ixgbe/*.c)))
+$(foreach obj, $(LAD_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_LAD)))
+
VPATH += $(RTE_SDK)/lib/librte_pmd_ixgbe/ixgbe
#
#include "../ixgbe_logs.h"
-/* Remove some compiler warnings for the files in this dir */
-#ifdef __INTEL_COMPILER
-#pragma warning(disable:2259) /* Conversion may lose significant bits */
-#pragma warning(disable:869) /* Parameter was never referenced */
-#pragma warning(disable:181) /* Arg incompatible with format string */
-#pragma warning(disable:1419) /* External declaration in primary source file */
-#pragma warning(disable:111) /* Statement is unreachable */
-#pragma warning(disable:981) /* Operands are evaluated in unspecified order */
-#pragma warning(disable:593) /* Variable was set but never used */
-#pragma warning(disable:174) /* expression has no effect */
-#else
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-#pragma GCC diagnostic ignored "-Wformat"
-#pragma GCC diagnostic ignored "-Wuninitialized"
-#pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#pragma GCC diagnostic ignored "-Wunused-value"
-#pragma GCC diagnostic ignored "-Wformat-extra-args"
-#if (((__GNUC__) >= 4) && ((__GNUC_MINOR__) >= 6))
-#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
-#endif
-#if (((__GNUC__) >= 4) && ((__GNUC_MINOR__) >= 7))
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#endif
-#endif
-
#define ASSERT(x) if(!(x)) rte_panic("IXGBE: x")
#define DELAY(x) rte_delay_us(x)
PMD_INIT_LOG(INFO, "Setting port %d, %s queue_id %d to stat index %d\n",
(int)(eth_dev->data->port_id), is_rx ? "RX" : "TX", queue_id, stat_idx);
- n = queue_id / NB_QMAP_FIELDS_PER_QSM_REG;
+ n = (uint8_t)(queue_id / NB_QMAP_FIELDS_PER_QSM_REG);
if (n >= IXGBE_NB_STAT_MAPPING_REGS) {
PMD_INIT_LOG(ERR, "Nb of stat mapping registers exceeded\n");
return -EIO;
}
- offset = queue_id % NB_QMAP_FIELDS_PER_QSM_REG;
+ offset = (uint8_t)(queue_id % NB_QMAP_FIELDS_PER_QSM_REG);
/* Now clear any previous stat_idx set */
clearing_mask <<= (QSM_REG_NB_BITS_PER_QMAP_FIELD * offset);
{
uint8_t i;
struct ixgbe_dcb_tc_config *tc;
- int dcb_max_tc = IXGBE_DCB_MAX_TRAFFIC_CLASS;
+ uint8_t dcb_max_tc = IXGBE_DCB_MAX_TRAFFIC_CLASS;
dcb_config->num_tcs.pg_tcs = dcb_max_tc;
dcb_config->num_tcs.pfc_tcs = dcb_max_tc;
for (i = 0; i < dcb_max_tc; i++) {
tc = &dcb_config->tc_config[i];
tc->path[IXGBE_DCB_TX_CONFIG].bwg_id = i;
- tc->path[IXGBE_DCB_TX_CONFIG].bwg_percent = 100/dcb_max_tc + (i & 1);
+ tc->path[IXGBE_DCB_TX_CONFIG].bwg_percent =
+ (uint8_t)(100/dcb_max_tc + (i & 1));
tc->path[IXGBE_DCB_RX_CONFIG].bwg_id = i;
- tc->path[IXGBE_DCB_RX_CONFIG].bwg_percent = 100/dcb_max_tc + (i & 1);
+ tc->path[IXGBE_DCB_RX_CONFIG].bwg_percent =
+ (uint8_t)(100/dcb_max_tc + (i & 1));
tc->pfc = ixgbe_dcb_pfc_disabled;
}
hw_stats->gprc += IXGBE_READ_REG(hw, IXGBE_GPRC);
if (hw->mac.type != ixgbe_mac_82598EB) {
- hw_stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCL) +
- ((u64)IXGBE_READ_REG(hw, IXGBE_GORCH) << 32);
- hw_stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL) +
- ((u64)IXGBE_READ_REG(hw, IXGBE_GOTCH) << 32);
- hw_stats->tor += IXGBE_READ_REG(hw, IXGBE_TORL) +
- ((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32);
+ hw_stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCL);
+ hw_stats->gorc += ((u64)IXGBE_READ_REG(hw, IXGBE_GORCH) << 32);
+ hw_stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL);
+ hw_stats->gotc += ((u64)IXGBE_READ_REG(hw, IXGBE_GOTCH) << 32);
+ hw_stats->tor += IXGBE_READ_REG(hw, IXGBE_TORL);
+ hw_stats->tor += ((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32);
hw_stats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT);
hw_stats->lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT);
} else {
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- dev_info->max_rx_queues = hw->mac.max_rx_queues;
- dev_info->max_tx_queues = hw->mac.max_tx_queues;
+ dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
+ dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL register */
dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS register */
dev_info->max_mac_addrs = hw->mac.num_rar_entries;
* void
*/
static void
-ixgbe_dev_interrupt_handler(struct rte_intr_handle *handle, void *param)
+ixgbe_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
+ void *param)
{
int64_t timeout;
struct rte_eth_link link;
{
struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- uint32_t i, on = 0;
+ uint16_t i;
+ int on = 0;
/* VF function only support hw strip feature, others are not support */
if(mask & ETH_VLAN_STRIP_MASK){
ixgbevf_vlan_strip_queue_set(dev,i,on);
}
}
-
* that it can be used for removing signature and perfect filters.
*/
static s32
-fdir_erase_filter_82599(struct ixgbe_hw *hw, union ixgbe_atr_input *input,
- uint32_t fdirhash)
+fdir_erase_filter_82599(struct ixgbe_hw *hw,
+ __rte_unused union ixgbe_atr_input *input, uint32_t fdirhash)
{
u32 fdircmd = 0;
u32 retry_count;
}
/* buffers were freed, update counters */
- txq->nb_tx_free += txq->tx_rs_thresh;
- txq->tx_next_dd += txq->tx_rs_thresh;
+ txq->nb_tx_free = (uint16_t)(txq->nb_tx_free + txq->tx_rs_thresh);
+ txq->tx_next_dd = (uint16_t)(txq->tx_next_dd + txq->tx_rs_thresh);
if (txq->tx_next_dd >= txq->nb_tx_desc)
- txq->tx_next_dd = txq->tx_rs_thresh - 1;
+ txq->tx_next_dd = (uint16_t)(txq->tx_rs_thresh - 1);
return txq->tx_rs_thresh;
}
ixgbe_tx_free_bufs(txq);
/* Only use descriptors that are available */
- nb_pkts = RTE_MIN(txq->nb_tx_free, nb_pkts);
+ nb_pkts = (uint16_t)RTE_MIN(txq->nb_tx_free, nb_pkts);
if (unlikely(nb_pkts == 0))
return 0;
/* Use exactly nb_pkts descriptors */
- txq->nb_tx_free -= nb_pkts;
+ txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_pkts);
/*
* At this point, we know there are enough descriptors in the
* the processing looks just like the "bottom" part anyway...
*/
if ((txq->tx_tail + nb_pkts) > txq->nb_tx_desc) {
- n = txq->nb_tx_desc - txq->tx_tail;
+ n = (uint16_t)(txq->nb_tx_desc - txq->tx_tail);
ixgbe_tx_fill_hw_ring(txq, tx_pkts, n);
/*
*/
tx_r[txq->tx_next_rs].read.cmd_type_len |=
rte_cpu_to_le_32(IXGBE_ADVTXD_DCMD_RS);
- txq->tx_next_rs = txq->tx_rs_thresh - 1;
+ txq->tx_next_rs = (uint16_t)(txq->tx_rs_thresh - 1);
txq->tx_tail = 0;
}
/* Fill H/W descriptor ring with mbuf data */
- ixgbe_tx_fill_hw_ring(txq, tx_pkts + n, nb_pkts - n);
- txq->tx_tail += (nb_pkts - n);
+ ixgbe_tx_fill_hw_ring(txq, tx_pkts + n, (uint16_t)(nb_pkts - n));
+ txq->tx_tail = (uint16_t)(txq->tx_tail + (nb_pkts - n));
/*
* Determine if RS bit should be set
if (txq->tx_tail > txq->tx_next_rs) {
tx_r[txq->tx_next_rs].read.cmd_type_len |=
rte_cpu_to_le_32(IXGBE_ADVTXD_DCMD_RS);
- txq->tx_next_rs += txq->tx_rs_thresh;
+ txq->tx_next_rs = (uint16_t)(txq->tx_next_rs +
+ txq->tx_rs_thresh);
if (txq->tx_next_rs >= txq->nb_tx_desc)
- txq->tx_next_rs = txq->tx_rs_thresh - 1;
+ txq->tx_next_rs = (uint16_t)(txq->tx_rs_thresh - 1);
}
/*
nb_tx = 0;
while (nb_pkts) {
uint16_t ret, n;
- n = RTE_MIN(nb_pkts, RTE_PMD_IXGBE_TX_MAX_BURST);
+ n = (uint16_t)RTE_MIN(nb_pkts, RTE_PMD_IXGBE_TX_MAX_BURST);
ret = tx_xmit_pkts(tx_queue, &(tx_pkts[nb_tx]), n);
- nb_tx += ret;
- nb_pkts -= ret;
+ nb_tx = (uint16_t)(nb_tx + ret);
+ nb_pkts = (uint16_t)(nb_pkts - ret);
if (ret < n)
break;
}
uint16_t nb_tx_to_clean;
/* Determine the last descriptor needing to be cleaned */
- desc_to_clean_to = last_desc_cleaned + txq->tx_rs_thresh;
+ desc_to_clean_to = (uint16_t)(last_desc_cleaned + txq->tx_rs_thresh);
if (desc_to_clean_to >= nb_tx_desc)
- desc_to_clean_to = desc_to_clean_to - nb_tx_desc;
+ desc_to_clean_to = (uint16_t)(desc_to_clean_to - nb_tx_desc);
/* Check to make sure the last descriptor to clean is done */
desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
/* Figure out how many descriptors will be cleaned */
if (last_desc_cleaned > desc_to_clean_to)
- nb_tx_to_clean = ((nb_tx_desc - last_desc_cleaned) +
- desc_to_clean_to);
+ nb_tx_to_clean = (uint16_t)((nb_tx_desc - last_desc_cleaned) +
+ desc_to_clean_to);
else
- nb_tx_to_clean = desc_to_clean_to - last_desc_cleaned;
+ nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
+ last_desc_cleaned);
PMD_TX_FREE_LOG(DEBUG,
"Cleaning %4u TX descriptors: %4u to %4u "
/* Update the txq to reflect the last descriptor that was cleaned */
txq->last_desc_cleaned = desc_to_clean_to;
- txq->nb_tx_free += nb_tx_to_clean;
+ txq->nb_tx_free = (uint16_t)(txq->nb_tx_free + nb_tx_to_clean);
/* No Error */
return (0);
vlan_macip_lens = tx_pkt->pkt.vlan_macip.data;
/* If hardware offload required */
- tx_ol_req = ol_flags & PKT_TX_OFFLOAD_MASK;
+ tx_ol_req = (uint16_t)(ol_flags & PKT_TX_OFFLOAD_MASK);
if (tx_ol_req) {
/* If new context need be built or reuse the exist ctx. */
ctx = what_advctx_update(txq, tx_ol_req,
* This will always be the number of segments + the number of
* Context descriptors required to transmit the packet
*/
- nb_used = tx_pkt->pkt.nb_segs + new_ctx;
+ nb_used = (uint16_t)(tx_pkt->pkt.nb_segs + new_ctx);
/*
* The number of descriptors that must be allocated for a
* The last packet data descriptor needs End Of Packet (EOP)
*/
cmd_type_len |= IXGBE_TXD_CMD_EOP;
- txq->nb_tx_used += nb_used;
- txq->nb_tx_free -= nb_used;
+ txq->nb_tx_used = (uint16_t)(txq->nb_tx_used + nb_used);
+ txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);
/* Set RS bit only on threshold packets' last descriptor */
if (txq->nb_tx_used >= txq->tx_rs_thresh) {
ip_pkt_types_map[(hl_tp_rs >> 4) & 0x0F]);
#endif
- return (pkt_flags | ip_rss_types_map[hl_tp_rs & 0xF]);
+ return (uint16_t)(pkt_flags | ip_rss_types_map[hl_tp_rs & 0xF]);
}
static inline uint16_t
* Do not check whether L3/L4 rx checksum done by NIC or not,
* That can be found from rte_eth_rxmode.hw_ip_checksum flag
*/
- pkt_flags = (uint16_t) (rx_status & IXGBE_RXD_STAT_VP) ? PKT_RX_VLAN_PKT : 0;
+ pkt_flags = (uint16_t)((rx_status & IXGBE_RXD_STAT_VP) ?
+ PKT_RX_VLAN_PKT : 0);
#ifdef RTE_LIBRTE_IEEE1588
if (rx_status & IXGBE_RXD_STAT_TMST)
- pkt_flags = (pkt_flags | PKT_RX_IEEE1588_TMST);
+ pkt_flags = (uint16_t)(pkt_flags | PKT_RX_IEEE1588_TMST);
#endif
return pkt_flags;
}
/* Translate descriptor info to mbuf format */
for (j = 0; j < nb_dd; ++j) {
mb = rxep[j].mbuf;
- pkt_len = rxdp[j].wb.upper.length - rxq->crc_len;
+ pkt_len = (uint16_t)(rxdp[j].wb.upper.length -
+ rxq->crc_len);
mb->pkt.data_len = pkt_len;
mb->pkt.pkt_len = pkt_len;
mb->pkt.vlan_macip.f.vlan_tci = rxdp[j].wb.upper.vlan;
mb->ol_flags = rx_desc_hlen_type_rss_to_pkt_flags(
rxdp[j].wb.lower.lo_dword.data);
/* reuse status field from scan list */
- mb->ol_flags |= rx_desc_status_to_pkt_flags(s[j]);
- mb->ol_flags |= rx_desc_error_to_pkt_flags(s[j]);
+ mb->ol_flags = (uint16_t)(mb->ol_flags |
+ rx_desc_status_to_pkt_flags(s[j]));
+ mb->ol_flags = (uint16_t)(mb->ol_flags |
+ rx_desc_error_to_pkt_flags(s[j]));
}
/* Move mbuf pointers from the S/W ring to the stage */
}
/* clear software ring entries so we can cleanup correctly */
- for (i = 0; i < nb_rx; ++i)
+ for (i = 0; i < nb_rx; ++i) {
rxq->sw_ring[rxq->rx_tail + i].mbuf = NULL;
+ }
+
return nb_rx;
}
int diag, i;
/* allocate buffers in bulk directly into the S/W ring */
- alloc_idx = rxq->rx_free_trigger - (rxq->rx_free_thresh - 1);
+ alloc_idx = (uint16_t)(rxq->rx_free_trigger -
+ (rxq->rx_free_thresh - 1));
rxep = &rxq->sw_ring[alloc_idx];
diag = rte_mempool_get_bulk(rxq->mb_pool, (void *)rxep,
rxq->rx_free_thresh);
IXGBE_PCI_REG_WRITE(rxq->rdt_reg_addr, rxq->rx_free_trigger);
/* update state of internal queue structure */
- rxq->rx_free_trigger += rxq->rx_free_thresh;
+ rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_trigger +
+ rxq->rx_free_thresh);
if (rxq->rx_free_trigger >= rxq->nb_rx_desc)
- rxq->rx_free_trigger = (rxq->rx_free_thresh - 1);
+ rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1);
/* no errors */
return 0;
int i;
/* how many packets are ready to return? */
- nb_pkts = RTE_MIN(nb_pkts, rxq->rx_nb_avail);
+ nb_pkts = (uint16_t)RTE_MIN(nb_pkts, rxq->rx_nb_avail);
/* copy mbuf pointers to the application's packet list */
for (i = 0; i < nb_pkts; ++i)
rx_pkts[i] = stage[i];
/* update internal queue state */
- rxq->rx_nb_avail -= nb_pkts;
- rxq->rx_next_avail += nb_pkts;
+ rxq->rx_nb_avail = (uint16_t)(rxq->rx_nb_avail - nb_pkts);
+ rxq->rx_next_avail = (uint16_t)(rxq->rx_next_avail + nb_pkts);
return nb_pkts;
}
return ixgbe_rx_fill_from_stage(rxq, rx_pkts, nb_pkts);
/* Scan the H/W ring for packets to receive */
- nb_rx = ixgbe_rx_scan_hw_ring(rxq);
+ nb_rx = (uint16_t)ixgbe_rx_scan_hw_ring(rxq);
/* update internal queue state */
rxq->rx_next_avail = 0;
rxq->rx_nb_avail = nb_rx;
- rxq->rx_tail += nb_rx;
+ rxq->rx_tail = (uint16_t)(rxq->rx_tail + nb_rx);
/* if required, allocate new buffers to replenish descriptors */
if (rxq->rx_tail > rxq->rx_free_trigger) {
* allocate new buffers to replenish the old ones.
*/
rxq->rx_nb_avail = 0;
- rxq->rx_tail -= nb_rx;
+ rxq->rx_tail = (uint16_t)(rxq->rx_tail - nb_rx);
for (i = 0, j = rxq->rx_tail; i < nb_rx; ++i, ++j)
rxq->sw_ring[j].mbuf = rxq->rx_stage[i];
nb_rx = 0;
while (nb_pkts) {
uint16_t ret, n;
- n = RTE_MIN(nb_pkts, RTE_PMD_IXGBE_RX_MAX_BURST);
+ n = (uint16_t)RTE_MIN(nb_pkts, RTE_PMD_IXGBE_RX_MAX_BURST);
ret = rx_recv_pkts(rx_queue, &rx_pkts[nb_rx], n);
- nb_rx += ret;
- nb_pkts -= ret;
+ nb_rx = (uint16_t)(nb_rx + ret);
+ nb_pkts = (uint16_t)(nb_pkts - ret);
if (ret < n)
break;
}
rte_le_to_cpu_16(rxd.wb.upper.vlan);
pkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);
- pkt_flags = (pkt_flags | rx_desc_status_to_pkt_flags(staterr));
- pkt_flags = (pkt_flags | rx_desc_error_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_status_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_error_to_pkt_flags(staterr));
rxm->ol_flags = pkt_flags;
if (likely(pkt_flags & PKT_RX_RSS_HASH))
rte_le_to_cpu_16(rxd.wb.upper.vlan);
hlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);
pkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);
- pkt_flags = (pkt_flags |
- rx_desc_status_to_pkt_flags(staterr));
- pkt_flags = (pkt_flags |
- rx_desc_error_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_status_to_pkt_flags(staterr));
+ pkt_flags = (uint16_t)(pkt_flags |
+ rx_desc_error_to_pkt_flags(staterr));
first_seg->ol_flags = pkt_flags;
if (likely(pkt_flags & PKT_RX_RSS_HASH))
prev = i;
}
- txq->tx_next_dd = txq->tx_rs_thresh - 1;
- txq->tx_next_rs = txq->tx_rs_thresh - 1;
+ txq->tx_next_dd = (uint16_t)(txq->tx_rs_thresh - 1);
+ txq->tx_next_rs = (uint16_t)(txq->tx_rs_thresh - 1);
txq->tx_tail = 0;
txq->nb_tx_used = 0;
* H/W race condition, hence the maximum threshold constraints.
* When set to zero use default values.
*/
- tx_rs_thresh = (tx_conf->tx_rs_thresh) ?
- tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH;
- tx_free_thresh = (tx_conf->tx_free_thresh) ?
- tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH;
+ tx_rs_thresh = (uint16_t)((tx_conf->tx_rs_thresh) ?
+ tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH);
+ tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ?
+ tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH);
if (tx_rs_thresh >= (nb_desc - 2)) {
- RTE_LOG(ERR, PMD,
- "tx_rs_thresh must be less than the "
- "number of TX descriptors minus 2. "
- "(tx_rs_thresh=%u port=%d queue=%d)\n",
- tx_rs_thresh, dev->data->port_id, queue_idx);
+ RTE_LOG(ERR, PMD, "tx_rs_thresh must be less than the number "
+ "of TX descriptors minus 2. (tx_rs_thresh=%u port=%d "
+ "queue=%d)\n", (unsigned int)tx_rs_thresh,
+ (int)dev->data->port_id, (int)queue_idx);
return -(EINVAL);
}
if (tx_free_thresh >= (nb_desc - 3)) {
- RTE_LOG(ERR, PMD,
- "tx_rs_thresh must be less than the "
- "tx_free_thresh must be less than the "
- "number of TX descriptors minus 3. "
- "(tx_free_thresh=%u port=%d queue=%d)\n",
- tx_free_thresh, dev->data->port_id, queue_idx);
+ RTE_LOG(ERR, PMD, "tx_rs_thresh must be less than the "
+ "tx_free_thresh must be less than the number of TX "
+ "descriptors minus 3. (tx_free_thresh=%u port=%d "
+ "queue=%d)\n", (unsigned int)tx_free_thresh,
+ (int)dev->data->port_id, (int)queue_idx);
return -(EINVAL);
}
if (tx_rs_thresh > tx_free_thresh) {
- RTE_LOG(ERR, PMD,
- "tx_rs_thresh must be less than or equal to "
- "tx_free_thresh. "
- "(tx_free_thresh=%u tx_rs_thresh=%u "
- "port=%d queue=%d)\n",
- tx_free_thresh, tx_rs_thresh,
- dev->data->port_id, queue_idx);
+ RTE_LOG(ERR, PMD, "tx_rs_thresh must be less than or equal to "
+ "tx_free_thresh. (tx_free_thresh=%u tx_rs_thresh=%u "
+ "port=%d queue=%d)\n", (unsigned int)tx_free_thresh,
+ (unsigned int)tx_rs_thresh, (int)dev->data->port_id,
+ (int)queue_idx);
return -(EINVAL);
}
if ((nb_desc % tx_rs_thresh) != 0) {
- RTE_LOG(ERR, PMD,
- "tx_rs_thresh must be a divisor of the"
- "number of TX descriptors. "
- "(tx_rs_thresh=%u port=%d queue=%d)\n",
- tx_rs_thresh, dev->data->port_id, queue_idx);
+ RTE_LOG(ERR, PMD, "tx_rs_thresh must be a divisor of the "
+ "number of TX descriptors. (tx_rs_thresh=%u port=%d "
+ "queue=%d)\n", (unsigned int)tx_rs_thresh,
+ (int)dev->data->port_id, (int)queue_idx);
return -(EINVAL);
}
* accumulates WTHRESH descriptors.
*/
if ((tx_rs_thresh > 1) && (tx_conf->tx_thresh.wthresh != 0)) {
- RTE_LOG(ERR, PMD,
- "TX WTHRESH must be set to 0 if "
- "tx_rs_thresh is greater than 1. "
- "(tx_rs_thresh=%u port=%d queue=%d)\n",
- tx_rs_thresh,
- dev->data->port_id, queue_idx);
+ RTE_LOG(ERR, PMD, "TX WTHRESH must be set to 0 if "
+ "tx_rs_thresh is greater than 1. (tx_rs_thresh=%u "
+ "port=%d queue=%d)\n", (unsigned int)tx_rs_thresh,
+ (int)dev->data->port_id, (int)queue_idx);
return -(EINVAL);
}
* function must be used.
*/
static inline int
+#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC
check_rx_burst_bulk_alloc_preconditions(struct igb_rx_queue *rxq)
+#else
+check_rx_burst_bulk_alloc_preconditions(__rte_unused struct igb_rx_queue *rxq)
+#endif
{
int ret = 0;
#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC
if (check_rx_burst_bulk_alloc_preconditions(rxq) == 0)
/* zero out extra memory */
- len = rxq->nb_rx_desc + RTE_PMD_IXGBE_RX_MAX_BURST;
+ len = (uint16_t)(rxq->nb_rx_desc + RTE_PMD_IXGBE_RX_MAX_BURST);
else
#endif
/* do not zero out extra memory */
rxq->rx_nb_avail = 0;
rxq->rx_next_avail = 0;
- rxq->rx_free_trigger = rxq->rx_free_thresh - 1;
+ rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1);
#endif /* RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC */
rxq->rx_tail = 0;
rxq->nb_rx_hold = 0;
rxq->rx_free_thresh = rx_conf->rx_free_thresh;
rxq->queue_id = queue_idx;
rxq->port_id = dev->data->port_id;
- rxq->crc_len = (uint8_t) ((dev->data->dev_conf.rxmode.hw_strip_crc) ? 0 :
- ETHER_CRC_LEN);
+ rxq->crc_len = (uint8_t) ((dev->data->dev_conf.rxmode.hw_strip_crc) ?
+ 0 : ETHER_CRC_LEN);
rxq->drop_en = rx_conf->rx_drop_en;
/*
* function does not access an invalid memory region.
*/
#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC
- len = nb_desc + RTE_PMD_IXGBE_RX_MAX_BURST;
+ len = (uint16_t)(nb_desc + RTE_PMD_IXGBE_RX_MAX_BURST);
#else
len = nb_desc;
#endif
for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
j = vmdq_rx_conf->dcb_queue[i];
tc = &dcb_config->tc_config[j];
- tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap = (1 << j);
+ tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap =
+ (uint8_t)(1 << j);
}
}
for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
j = vmdq_tx_conf->dcb_queue[i];
tc = &dcb_config->tc_config[j];
- tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap = (1 << j);
+ tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap =
+ (uint8_t)(1 << j);
}
return;
}
static void
-ixgbe_dcb_rx_config(struct rte_eth_dev *dev,struct ixgbe_dcb_config *dcb_config)
+ixgbe_dcb_rx_config(struct rte_eth_dev *dev,
+ struct ixgbe_dcb_config *dcb_config)
{
struct rte_eth_dcb_rx_conf *rx_conf =
&dev->data->dev_conf.rx_adv_conf.dcb_rx_conf;
struct ixgbe_dcb_tc_config *tc;
uint8_t i,j;
- dcb_config->num_tcs.pg_tcs = rx_conf->nb_tcs;
- dcb_config->num_tcs.pfc_tcs = rx_conf->nb_tcs;
+ dcb_config->num_tcs.pg_tcs = (uint8_t)rx_conf->nb_tcs;
+ dcb_config->num_tcs.pfc_tcs = (uint8_t)rx_conf->nb_tcs;
/* User Priority to Traffic Class mapping */
for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
j = rx_conf->dcb_queue[i];
tc = &dcb_config->tc_config[j];
- tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap = (1 << j);
+ tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap =
+ (uint8_t)(1 << j);
}
}
static void
-ixgbe_dcb_tx_config(struct rte_eth_dev *dev,struct ixgbe_dcb_config *dcb_config)
+ixgbe_dcb_tx_config(struct rte_eth_dev *dev,
+ struct ixgbe_dcb_config *dcb_config)
{
struct rte_eth_dcb_tx_conf *tx_conf =
&dev->data->dev_conf.tx_adv_conf.dcb_tx_conf;
struct ixgbe_dcb_tc_config *tc;
uint8_t i,j;
- dcb_config->num_tcs.pg_tcs = tx_conf->nb_tcs;
- dcb_config->num_tcs.pfc_tcs = tx_conf->nb_tcs;
+ dcb_config->num_tcs.pg_tcs = (uint8_t)tx_conf->nb_tcs;
+ dcb_config->num_tcs.pfc_tcs = (uint8_t)tx_conf->nb_tcs;
/* User Priority to Traffic Class mapping */
for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
j = tx_conf->dcb_queue[i];
tc = &dcb_config->tc_config[j];
- tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap = (1 << j);
+ tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap =
+ (uint8_t)(1 << j);
}
}
uint8_t j = 4;
uint8_t mask = 0xFF;
for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES - 4; i++)
- mask &= ~ (1 << map[i]);
+ mask = (uint8_t)(mask & (~ (1 << map[i])));
for (i = 0; mask && (i < IXGBE_DCB_MAX_TRAFFIC_CLASS); i++) {
if ((mask & 0x1) && (j < ETH_DCB_NUM_USER_PRIORITIES))
map[j++] = i;
/* Re-configure 4 TCs BW */
for (i = 0; i < nb_tcs; i++) {
tc = &dcb_config->tc_config[i];
- tc->path[IXGBE_DCB_TX_CONFIG].bwg_percent = 100 / nb_tcs;
- tc->path[IXGBE_DCB_RX_CONFIG].bwg_percent = 100 / nb_tcs;
+ tc->path[IXGBE_DCB_TX_CONFIG].bwg_percent =
+ (uint8_t)(100 / nb_tcs);
+ tc->path[IXGBE_DCB_RX_CONFIG].bwg_percent =
+ (uint8_t)(100 / nb_tcs);
}
for (; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
tc = &dcb_config->tc_config[i];