-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the first of several parts for a new driver supporting Broadcom/Qlogic NetXtremeII 10 gigabit devices. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Harish Patil <harish.patil@qlogic.com>
- Loading branch information
1 parent
632b2d1
commit 540a211
Showing
11 changed files
with
18,226 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (c) 2013-2015 Brocade Communications Systems, Inc. | ||
* | ||
* All rights reserved. | ||
*/ | ||
|
||
#ifndef PMD_BNX2X_ETHDEV_H | ||
#define PMD_BNX2X_ETHDEV_H | ||
|
||
#include <sys/queue.h> | ||
#include <sys/param.h> | ||
#include <sys/user.h> | ||
#include <sys/stat.h> | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <errno.h> | ||
#include <stdint.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
#include <stdarg.h> | ||
#include <inttypes.h> | ||
#include <assert.h> | ||
|
||
#include <rte_byteorder.h> | ||
#include <rte_common.h> | ||
#include <rte_cycles.h> | ||
#include <rte_log.h> | ||
#include <rte_debug.h> | ||
#include <rte_pci.h> | ||
#include <rte_malloc.h> | ||
#include <rte_ethdev.h> | ||
#include <rte_spinlock.h> | ||
#include <rte_memzone.h> | ||
#include <rte_eal.h> | ||
#include <rte_mempool.h> | ||
#include <rte_mbuf.h> | ||
|
||
#include "bnx2x_rxtx.h" | ||
#include "bnx2x_logs.h" | ||
|
||
#define DELAY(x) rte_delay_us(x) | ||
#define DELAY_MS(x) rte_delay_ms(x) | ||
#define usec_delay(x) DELAY(x) | ||
#define msec_delay(x) DELAY(1000*(x)) | ||
|
||
#define FALSE 0 | ||
#define TRUE 1 | ||
|
||
#define false 0 | ||
#define true 1 | ||
#define min(a,b) RTE_MIN(a,b) | ||
|
||
#define mb() rte_mb() | ||
#define wmb() rte_wmb() | ||
#define rmb() rte_rmb() | ||
|
||
|
||
#define MAX_QUEUES sysconf(_SC_NPROCESSORS_CONF) | ||
|
||
#define BNX2X_MIN_RX_BUF_SIZE 1024 | ||
#define BNX2X_MAX_RX_PKT_LEN 15872 | ||
#define BNX2X_MAX_MAC_ADDRS 1 | ||
|
||
/* Hardware RX tick timer (usecs) */ | ||
#define BNX2X_RX_TICKS 25 | ||
/* Hardware TX tick timer (usecs) */ | ||
#define BNX2X_TX_TICKS 50 | ||
/* Maximum number of Rx packets to process at a time */ | ||
#define BNX2X_RX_BUDGET 0xffffffff | ||
|
||
#endif | ||
|
||
/* MAC address operations */ | ||
struct bnx2x_mac_ops { | ||
void (*mac_addr_add)(struct rte_eth_dev *dev, struct ether_addr *addr, | ||
uint16_t index, uint32_t pool); /* not implemented yet */ | ||
void (*mac_addr_remove)(struct rte_eth_dev *dev, uint16_t index); /* not implemented yet */ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2013-2015 Brocade Communications Systems, Inc. | ||
* | ||
* All rights reserved. | ||
*/ | ||
|
||
#ifndef _PMD_LOGS_H_ | ||
#define _PMD_LOGS_H_ | ||
|
||
#define PMD_INIT_LOG(level, fmt, args...) \ | ||
rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \ | ||
"PMD: %s(): " fmt "\n", __func__, ##args) | ||
|
||
#ifdef RTE_LIBRTE_BNX2X_DEBUG_INIT | ||
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") | ||
#else | ||
#define PMD_INIT_FUNC_TRACE() do { } while(0) | ||
#endif | ||
|
||
#ifdef RTE_LIBRTE_BNX2X_DEBUG_RX | ||
#define PMD_RX_LOG(level, fmt, args...) \ | ||
RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) | ||
#else | ||
#define PMD_RX_LOG(level, fmt, args...) do { } while(0) | ||
#endif | ||
|
||
#ifdef RTE_LIBRTE_BNX2X_DEBUG_TX | ||
#define PMD_TX_LOG(level, fmt, args...) \ | ||
RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) | ||
#else | ||
#define PMD_TX_LOG(level, fmt, args...) do { } while(0) | ||
#endif | ||
|
||
#ifdef RTE_LIBRTE_BNX2X_DEBUG_TX_FREE | ||
#define PMD_TX_FREE_LOG(level, fmt, args...) \ | ||
RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) | ||
#else | ||
#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0) | ||
#endif | ||
|
||
#ifdef RTE_LIBRTE_BNX2X_DEBUG_DRIVER | ||
#define PMD_DRV_LOG_RAW(level, fmt, args...) \ | ||
RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args) | ||
#else | ||
#define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0) | ||
#endif | ||
|
||
#define PMD_DRV_LOG(level, fmt, args...) \ | ||
PMD_DRV_LOG_RAW(level, fmt "\n", ## args) | ||
|
||
#endif /* _PMD_LOGS_H_ */ |
Oops, something went wrong.