Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102051056
D46368.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
D46368.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
@@ -171,7 +171,9 @@
static void ena_timer_service(void *);
static enum ena_regs_reset_reason_types check_cdesc_in_tx_cq(struct ena_adapter *,
struct ena_ring *);
-
+#ifdef DEV_NETMAP
+static int ena_reinit_netmap(struct ena_adapter *adapter);
+#endif
static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME
" v" ENA_DRV_MODULE_VERSION;
@@ -1162,6 +1164,21 @@
return (i);
}
+#ifdef DEV_NETMAP
+static int
+ena_reinit_netmap(struct ena_adapter *adapter)
+{
+ int rc;
+
+ netmap_detach(adapter->ifp);
+ rc = ena_netmap_attach(adapter);
+ if (rc != 0)
+ ena_log(adapter->pdev, ERR, "netmap attach failed: %d\n", rc);
+
+ return rc;
+}
+
+#endif /* DEV_NETMAP */
int
ena_update_buf_ring_size(struct ena_adapter *adapter,
uint32_t new_buf_ring_size)
@@ -1179,6 +1196,12 @@
/* Reconfigure buf ring for all Tx rings. */
ena_free_all_io_rings_resources(adapter);
ena_init_io_rings_advanced(adapter);
+#ifdef DEV_NETMAP
+ rc = ena_reinit_netmap(adapter);
+ if (rc != 0)
+ return rc;
+
+#endif /* DEV_NETMAP */
if (dev_was_up) {
/*
* If ena_up() fails, it's not because of recent buf_ring size
@@ -1196,7 +1219,12 @@
adapter->buf_ring_size = old_buf_ring_size;
ena_free_all_io_rings_resources(adapter);
ena_init_io_rings_advanced(adapter);
+#ifdef DEV_NETMAP
+ rc = ena_reinit_netmap(adapter);
+ if (rc != 0)
+ return rc;
+#endif /* DEV_NETMAP */
ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP_BEFORE_RESET,
adapter);
ena_trigger_reset(adapter, ENA_REGS_RESET_OS_TRIGGER);
@@ -1224,6 +1252,12 @@
/* Configure queues with new size. */
ena_init_io_rings_basic(adapter);
+#ifdef DEV_NETMAP
+ rc = ena_reinit_netmap(adapter);
+ if (rc != 0)
+ return rc;
+
+#endif /* DEV_NETMAP */
if (dev_was_up) {
rc = ena_up(adapter);
if (unlikely(rc != 0)) {
@@ -1235,7 +1269,12 @@
adapter->requested_tx_ring_size = old_tx_size;
adapter->requested_rx_ring_size = old_rx_size;
ena_init_io_rings_basic(adapter);
+#ifdef DEV_NETMAP
+ rc = ena_reinit_netmap(adapter);
+ if (rc != 0)
+ return rc;
+#endif /* DEV_NETMAP */
/* And try again. */
rc = ena_up(adapter);
if (unlikely(rc != 0)) {
@@ -1359,7 +1398,12 @@
ena_down(adapter);
ena_update_io_rings(adapter, new_num);
+#ifdef DEV_NETMAP
+ rc = ena_reinit_netmap(adapter);
+ if (rc != 0)
+ return rc;
+#endif /* DEV_NETMAP */
if (dev_was_up) {
rc = ena_up(adapter);
if (unlikely(rc != 0)) {
@@ -1369,7 +1413,12 @@
new_num, old_num);
ena_update_io_rings(adapter, old_num);
+#ifdef DEV_NETMAP
+ rc = ena_reinit_netmap(adapter);
+ if (rc != 0)
+ return rc;
+#endif /* DEV_NETMAP */
rc = ena_up(adapter);
if (unlikely(rc != 0)) {
ena_log(adapter->pdev, ERR,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 12:17 AM (21 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11145182
Default Alt Text
D46368.diff (2 KB)
Attached To
Mode
D46368: ena: Reinit netmap adapter struct upon sysctl changes
Attached
Detach File
Event Timeline
Log In to Comment