Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168003180
D57437.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D57437.id.diff
View Options
diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c
--- a/sys/dev/aq/aq_main.c
+++ b/sys/dev/aq/aq_main.c
@@ -392,8 +392,8 @@
scctx->isc_tx_csum_flags = CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO;
#if __FreeBSD__ >= 12
scctx->isc_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_HWCSUM |
- IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_MTU |
- IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM;
+ IFCAP_TSO | IFCAP_LRO | IFCAP_JUMBO_MTU | IFCAP_VLAN_HWFILTER |
+ IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM;
scctx->isc_capenable = scctx->isc_capabilities;
#else
if_t ifp;
@@ -408,6 +408,8 @@
HW_ATL_B0_TSO_SIZE - sizeof(struct ether_vlan_header);
scctx->isc_tx_tso_segsize_max = HW_ATL_B0_MTU_JUMBO;
scctx->isc_min_frame_size = 52;
+ scctx->isc_max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN +
+ ETHER_VLAN_ENCAP_LEN;
scctx->isc_txrx = &aq_txrx;
scctx->isc_txqsizes[0] = sizeof(aq_tx_desc_t) * scctx->isc_ntxd[0];
@@ -512,21 +514,18 @@
static int
aq_if_shutdown(if_ctx_t ctx)
{
-
- AQ_DBG_ENTER();
-
- AQ_XXX_UNIMPLEMENTED_FUNCTION;
-
- AQ_DBG_EXIT(0);
- return (0);
+ return (aq_if_suspend(ctx));
}
static int
aq_if_suspend(if_ctx_t ctx)
{
+ struct aq_dev *softc = iflib_get_softc(ctx);
+
AQ_DBG_ENTER();
- AQ_XXX_UNIMPLEMENTED_FUNCTION;
+ aq_if_stop(ctx);
+ aq_hw_deinit(&softc->hw);
AQ_DBG_EXIT(0);
return (0);
@@ -535,12 +534,13 @@
static int
aq_if_resume(if_ctx_t ctx)
{
- AQ_DBG_ENTER();
-
- AQ_XXX_UNIMPLEMENTED_FUNCTION;
+ struct aq_dev *softc = iflib_get_softc(ctx);
+ int err;
- AQ_DBG_EXIT(0);
- return (0);
+ AQ_DBG_ENTER();
+ err = aq_hw_mpi_create(&softc->hw);
+ AQ_DBG_EXIT(err);
+ return (err);
}
_Static_assert(sizeof(struct aq_ring_stats) % sizeof(counter_u64_t) == 0,
@@ -755,6 +755,7 @@
}
for (i = 0; i < softc->rx_rings_count; i++) {
struct aq_ring *ring = softc->rx_rings[i];
+ ring->rx_max_frame_size = iflib_get_rx_mbuf_sz(ctx);
err = aq_ring_rx_init(&softc->hw, ring);
if (err) {
device_printf(softc->dev,
@@ -901,11 +902,21 @@
static int
aq_if_mtu_set(if_ctx_t ctx, uint32_t mtu)
{
- int err = 0;
- AQ_DBG_ENTER();
+ if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx);
+ uint32_t max_frame;
- AQ_DBG_EXIT(err);
- return (err);
+ AQ_DBG_ENTERA("mtu %u", mtu);
+
+ max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN;
+ if (max_frame > HW_ATL_B0_MTU_JUMBO) {
+ AQ_DBG_EXIT(EINVAL);
+ return (EINVAL);
+ }
+
+ scctx->isc_max_frame_size = max_frame;
+
+ AQ_DBG_EXIT(0);
+ return (0);
}
static void
diff --git a/sys/dev/aq/aq_ring.c b/sys/dev/aq/aq_ring.c
--- a/sys/dev/aq/aq_ring.c
+++ b/sys/dev/aq/aq_ring.c
@@ -371,7 +371,7 @@
len = ring->rx_max_frame_size;
} else {
total_len = le32toh(rx_desc->wb.pkt_len);
- len = total_len & (ring->rx_max_frame_size - 1);
+ len = total_len - (size_t)i * ring->rx_max_frame_size;
}
ri->iri_frags[i].irf_flid = 0;
ri->iri_frags[i].irf_idx = cidx;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 26, 9:00 PM (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37327311
Default Alt Text
D57437.id.diff (2 KB)
Attached To
Mode
D57437: aq(4): enable jumbo frames, software LRO, and suspend/resume
Attached
Detach File
Event Timeline
Log In to Comment