Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102193199
D37837.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D37837.diff
View Options
diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -575,7 +575,7 @@
for (i = 0; i < tx_ring->ring_size; ++i) {
tx_info = &tx_ring->tx_buffer_info[i];
#ifdef DEV_NETMAP
- if (adapter->ifp->if_capenable & IFCAP_NETMAP) {
+ if (if_getcapenable(adapter->ifp) & IFCAP_NETMAP) {
nm_info = &tx_info->nm_info;
for (j = 0; j < ENA_PKT_MAX_BUFS; ++j) {
if (nm_info->map_seg[j] != NULL) {
@@ -661,7 +661,7 @@
}
#ifdef DEV_NETMAP
- if (adapter->ifp->if_capenable & IFCAP_NETMAP) {
+ if (if_getcapenable(adapter->ifp) & IFCAP_NETMAP) {
map = tx_ring->tx_buffer_info[i].nm_info.map_seg;
for (j = 0; j < ENA_PKT_MAX_BUFS; j++) {
err = bus_dmamap_create(adapter->tx_buf_tag, 0,
@@ -750,7 +750,7 @@
tx_ring->tx_buffer_info[i].dmamap);
#ifdef DEV_NETMAP
- if (adapter->ifp->if_capenable & IFCAP_NETMAP) {
+ if (if_getcapenable(adapter->ifp) & IFCAP_NETMAP) {
nm_info = &tx_ring->tx_buffer_info[i].nm_info;
for (j = 0; j < ENA_PKT_MAX_BUFS; j++) {
if (nm_info->socket_buf_idx[j] != 0) {
@@ -882,7 +882,7 @@
}
/* Create LRO for the ring */
- if ((adapter->ifp->if_capenable & IFCAP_LRO) != 0) {
+ if ((if_getcapenable(adapter->ifp) & IFCAP_LRO) != 0) {
int err = tcp_lro_init(&rx_ring->lro);
if (err != 0) {
ena_log(pdev, ERR, "LRO[%d] Initialization failed!\n",
@@ -1292,7 +1292,7 @@
ena_free_rx_mbuf(adapter, rx_ring, rx_info);
#ifdef DEV_NETMAP
if (((if_getflags(adapter->ifp) & IFF_DYING) == 0) &&
- (adapter->ifp->if_capenable & IFCAP_NETMAP)) {
+ (if_getcapenable(adapter->ifp) & IFCAP_NETMAP)) {
if (rx_info->netmap_buf_idx != 0)
ena_netmap_free_rx_slot(adapter, rx_ring,
rx_info);
@@ -1964,7 +1964,7 @@
}
}
- rc = ena_change_mtu(adapter->ifp, adapter->ifp->if_mtu);
+ rc = ena_change_mtu(adapter->ifp, if_getmtu(adapter->ifp));
if (unlikely(rc != 0))
return (rc);
@@ -2225,7 +2225,7 @@
struct ifreq *ifr;
int rc;
- adapter = ifp->if_softc;
+ adapter = if_getsoftc(ifp);
ifr = (struct ifreq *)data;
/*
@@ -2234,7 +2234,7 @@
rc = 0;
switch (command) {
case SIOCSIFMTU:
- if (ifp->if_mtu == ifr->ifr_mtu)
+ if (if_getmtu(ifp) == ifr->ifr_mtu)
break;
ENA_LOCK_LOCK();
ena_down(adapter);
@@ -2246,10 +2246,10 @@
break;
case SIOCSIFFLAGS:
- if ((ifp->if_flags & IFF_UP) != 0) {
+ if ((if_getflags(ifp) & IFF_UP) != 0) {
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) {
- if ((ifp->if_flags &
- (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+ if ((if_getflags(ifp) & (IFF_PROMISC |
+ IFF_ALLMULTI)) != 0) {
ena_log(adapter->pdev, INFO,
"ioctl promisc/allmulti\n");
}
@@ -2280,8 +2280,8 @@
{
int reinit = 0;
- if (ifr->ifr_reqcap != ifp->if_capenable) {
- ifp->if_capenable = ifr->ifr_reqcap;
+ if (ifr->ifr_reqcap != if_getcapenable(ifp)) {
+ if_setcapenable(ifp, ifr->ifr_reqcap);
reinit = 1;
}
@@ -2414,10 +2414,10 @@
if_setcapabilitiesbit(ifp, caps, 0);
/* TSO parameters */
- ifp->if_hw_tsomax = ENA_TSO_MAXSIZE -
- (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN);
- ifp->if_hw_tsomaxsegcount = adapter->max_tx_sgl_size - 1;
- ifp->if_hw_tsomaxsegsize = ENA_TSO_MAXSIZE;
+ if_sethwtsomax(ifp, ENA_TSO_MAXSIZE -
+ (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN));
+ if_sethwtsomaxsegcount(ifp, adapter->max_tx_sgl_size - 1);
+ if_sethwtsomaxsegsize(ifp, ENA_TSO_MAXSIZE);
if_setifheaderlen(ifp, sizeof(struct ether_vlan_header));
if_setcapenable(ifp, if_getcapabilities(ifp));
@@ -3744,7 +3744,7 @@
int rc;
/* Make sure VLANS are not using driver */
- if (adapter->ifp->if_vlantrunk != NULL) {
+ if (if_vlantrunkinuse(adapter->ifp)) {
ena_log(adapter->pdev, ERR, "VLAN is in use, detach first\n");
return (EBUSY);
}
diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c
--- a/sys/dev/ena/ena_datapath.c
+++ b/sys/dev/ena/ena_datapath.c
@@ -115,7 +115,7 @@
ena_deferred_mq_start(void *arg, int pending)
{
struct ena_ring *tx_ring = (struct ena_ring *)arg;
- struct ifnet *ifp = tx_ring->adapter->ifp;
+ if_t ifp = tx_ring->adapter->ifp;
while (!drbr_empty(ifp, tx_ring->br) && tx_ring->running &&
(if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) {
@@ -128,7 +128,7 @@
int
ena_mq_start(if_t ifp, struct mbuf *m)
{
- struct ena_adapter *adapter = ifp->if_softc;
+ struct ena_adapter *adapter = if_getsoftc(ifp);
struct ena_ring *tx_ring;
int ret, is_drbr_empty;
uint32_t i;
@@ -179,7 +179,7 @@
void
ena_qflush(if_t ifp)
{
- struct ena_adapter *adapter = ifp->if_softc;
+ struct ena_adapter *adapter = if_getsoftc(ifp);
struct ena_ring *tx_ring = adapter->tx_ring;
int i;
@@ -643,8 +643,8 @@
break;
}
- if (((ifp->if_capenable & IFCAP_RXCSUM) != 0) ||
- ((ifp->if_capenable & IFCAP_RXCSUM_IPV6) != 0)) {
+ if (((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) ||
+ ((if_getcapenable(ifp) & IFCAP_RXCSUM_IPV6) != 0)) {
ena_rx_checksum(rx_ring, &ena_rx_ctx, mbuf);
}
@@ -659,7 +659,7 @@
* should be computed by hardware.
*/
do_if_input = 1;
- if (((ifp->if_capenable & IFCAP_LRO) != 0) &&
+ if (((if_getcapenable(ifp) & IFCAP_LRO) != 0) &&
((mbuf->m_pkthdr.csum_flags & CSUM_IP_VALID) != 0) &&
(ena_rx_ctx.l4_proto == ENA_ETH_IO_L4_PROTO_TCP)) {
/*
@@ -675,7 +675,7 @@
if (do_if_input != 0) {
ena_log_io(pdev, DBG,
"calling if_input() with mbuf %p\n", mbuf);
- (*ifp->if_input)(ifp, mbuf);
+ if_input(ifp, mbuf);
}
counter_enter();
diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c
--- a/sys/dev/ena/ena_netmap.c
+++ b/sys/dev/ena/ena_netmap.c
@@ -224,7 +224,7 @@
struct netmap_adapter *na;
struct netmap_kring *kring;
- if (adapter->ifp->if_capenable & IFCAP_NETMAP) {
+ if (if_getcapenable(adapter->ifp) & IFCAP_NETMAP) {
na = NA(adapter->ifp);
kring = (x == NR_RX) ? na->rx_rings[qid] : na->tx_rings[qid];
if (kring->nr_mode == NKR_NETMAP_ON)
@@ -271,8 +271,8 @@
static int
ena_netmap_reg(struct netmap_adapter *na, int onoff)
{
- struct ifnet *ifp = na->ifp;
- struct ena_adapter *adapter = ifp->if_softc;
+ if_t ifp = na->ifp;
+ struct ena_adapter *adapter = if_getsoftc(ifp);
device_t pdev = adapter->pdev;
struct netmap_kring *kring;
enum txrx t;
@@ -528,7 +528,7 @@
device_t pdev;
int rc;
- pdev = ((struct ena_adapter *)na->ifp->if_softc)->pdev;
+ pdev = ((struct ena_adapter *)if_getsoftc(na->ifp))->pdev;
*vaddr = PNMB(na, slot, paddr);
if (unlikely(vaddr == NULL)) {
@@ -1065,7 +1065,7 @@
{
ctx->kring = kring;
ctx->na = kring->na;
- ctx->adapter = ctx->na->ifp->if_softc;
+ ctx->adapter = if_getsoftc(ctx->na->ifp);
ctx->lim = kring->nkr_num_slots - 1;
ctx->io_cq = &ctx->adapter->ena_dev->io_cq_queues[ena_qid];
ctx->io_sq = &ctx->adapter->ena_dev->io_sq_queues[ena_qid];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 6:44 PM (20 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14564299
Default Alt Text
D37837.diff (6 KB)
Attached To
Mode
D37837: Mechanically convert ena(4) to DrvAPI
Attached
Detach File
Event Timeline
Log In to Comment