dpaa: Support jumbo frames as multi-buffer frames
This commit is contained in:
+22
-3
@@ -360,7 +360,8 @@ dpaa_eth_fq_rx_callback(device_t portal, struct qman_fq *fq,
|
||||
|
||||
frame_va = DPAA_FD_GET_ADDR(frame);
|
||||
frame_ic = frame_va; /* internal context at head of the frame */
|
||||
KASSERT(frame->format == 0,
|
||||
/* Only simple (single- or multi-) frames are supported. */
|
||||
KASSERT(frame->format == 0 || frame->format == 4,
|
||||
("%s(): Got unsupported frame format 0x%02X!", __func__,
|
||||
frame->format));
|
||||
|
||||
@@ -374,8 +375,26 @@ dpaa_eth_fq_rx_callback(device_t portal, struct qman_fq *fq,
|
||||
if (m == NULL)
|
||||
goto err;
|
||||
|
||||
m_extadd(m, (char *)frame_va + frame->offset, frame->length,
|
||||
dpaa_eth_fq_mext_free, frame_va, sc, 0, EXT_NET_DRV);
|
||||
if (frame->format == 0) {
|
||||
/* Single-frame format */
|
||||
m_extadd(m, (char *)frame_va + frame->offset, frame->length,
|
||||
dpaa_eth_fq_mext_free, frame_va, sc, 0, EXT_NET_DRV);
|
||||
} else {
|
||||
struct dpaa_sgte *sgt =
|
||||
(struct dpaa_sgte *)(char *)frame_va + frame->offset;
|
||||
/* Simple multi-frame format */
|
||||
for (int i = 0; i < DPAA_NUM_OF_SG_TABLE_ENTRY; i++) {
|
||||
if (sgt[i].length > 0)
|
||||
m_extadd(m, PHYS_TO_DMAP(sgt[i].addr),
|
||||
sgt[i].length, dpaa_eth_fq_mext_free,
|
||||
PHYS_TO_DMAP(sgt[i].addr), sc, 0,
|
||||
EXT_NET_DRV);
|
||||
if (sgt[i].final)
|
||||
break;
|
||||
}
|
||||
/* Free the SGT buffer, it's no longer needed. */
|
||||
bman_put_buffer(sc->sc_rx_pool, frame->addr, sc->sc_rx_bpid);
|
||||
}
|
||||
|
||||
if (if_getcapenable(sc->sc_ifnet) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
|
||||
dpaa_eth_update_csum_flags(frame, &frame_ic->prs, m);
|
||||
|
||||
@@ -617,7 +617,8 @@ memac_attach(device_t dev)
|
||||
device_get_unit(sc->sc_base.sc_dev));
|
||||
|
||||
|
||||
if_setcapabilities(ifp, IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM |
|
||||
if_setcapabilities(ifp, IFCAP_JUMBO_MTU |
|
||||
IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM |
|
||||
IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 |
|
||||
IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6);
|
||||
if_setcapenable(ifp, if_getcapabilities(ifp));
|
||||
|
||||
Reference in New Issue
Block a user