Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148468125
D7825.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D7825.diff
View Options
Index: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c
@@ -57,9 +57,9 @@
/*
* Forward declarations
*/
-static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc);
+static int hn_nvs_conn_chim(struct hn_softc *sc);
static int hn_nvs_conn_rxbuf(struct hn_softc *);
-static int hv_nv_destroy_send_buffer(struct hn_softc *sc);
+static int hn_nvs_disconn_chim(struct hn_softc *sc);
static int hn_nvs_disconn_rxbuf(struct hn_softc *sc);
static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu);
static void hn_nvs_sent_none(struct hn_send_ctx *sndc,
@@ -231,11 +231,8 @@
return (error);
}
-/*
- * Net VSC initialize send buffer with net VSP
- */
static int
-hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc)
+hn_nvs_conn_chim(struct hn_softc *sc)
{
struct vmbus_xact *xact = NULL;
struct hn_nvs_chim_conn *chim;
@@ -255,8 +252,7 @@
sc->hn_chim_dma.hv_paddr, NETVSC_SEND_BUFFER_SIZE,
&sc->hn_chim_gpadl);
if (error) {
- if_printf(sc->hn_ifp, "chimney sending buffer gpadl "
- "connect failed: %d\n", error);
+ if_printf(sc->hn_ifp, "chim gpadl conn failed: %d\n", error);
goto cleanup;
}
@@ -279,7 +275,7 @@
resp = hn_nvs_xact_execute(sc, xact, chim, sizeof(*chim), &resp_len,
HN_NVS_TYPE_CHIM_CONNRESP);
if (resp == NULL) {
- if_printf(sc->hn_ifp, "exec chim conn failed\n");
+ if_printf(sc->hn_ifp, "exec nvs chim conn failed\n");
error = EIO;
goto cleanup;
}
@@ -290,14 +286,14 @@
xact = NULL;
if (status != HN_NVS_STATUS_OK) {
- if_printf(sc->hn_ifp, "chim conn failed: %x\n", status);
+ if_printf(sc->hn_ifp, "nvs chim conn failed: %x\n", status);
error = EIO;
goto cleanup;
}
if (sectsz == 0) {
if_printf(sc->hn_ifp, "zero chimney sending buffer "
"section size\n");
- return 0;
+ return (0);
}
sc->hn_chim_szmax = sectsz;
@@ -321,12 +317,12 @@
if_printf(sc->hn_ifp, "chimney sending buffer %d/%d\n",
sc->hn_chim_szmax, sc->hn_chim_cnt);
}
- return 0;
+ return (0);
cleanup:
if (xact != NULL)
vmbus_xact_put(xact);
- hv_nv_destroy_send_buffer(sc);
+ hn_nvs_disconn_chim(sc);
return (error);
}
@@ -371,13 +367,10 @@
return (0);
}
-/*
- * Net VSC destroy send buffer
- */
static int
-hv_nv_destroy_send_buffer(struct hn_softc *sc)
+hn_nvs_disconn_chim(struct hn_softc *sc)
{
- int ret = 0;
+ int error;
if (sc->hn_flags & HN_FLAG_CHIM_CONNECTED) {
struct hn_nvs_chim_disconn disconn;
@@ -390,25 +383,25 @@
disconn.nvs_sig = HN_NVS_CHIM_SIG;
/* NOTE: No response. */
- ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn));
- if (ret != 0) {
+ error = hn_nvs_req_send(sc, &disconn, sizeof(disconn));
+ if (error) {
if_printf(sc->hn_ifp,
- "send chim disconn failed: %d\n", ret);
- return (ret);
+ "send nvs chim disconn failed: %d\n", error);
+ return (error);
}
sc->hn_flags &= ~HN_FLAG_CHIM_CONNECTED;
}
-
+
if (sc->hn_chim_gpadl != 0) {
/*
* Disconnect chimney sending buffer from primary channel.
*/
- ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan,
+ error = vmbus_chan_gpadl_disconnect(sc->hn_prichan,
sc->hn_chim_gpadl);
- if (ret != 0) {
+ if (error) {
if_printf(sc->hn_ifp,
- "chim disconn failed: %d\n", ret);
- return (ret);
+ "chim gpadl disconn failed: %d\n", error);
+ return (error);
}
sc->hn_chim_gpadl = 0;
}
@@ -417,8 +410,7 @@
free(sc->hn_chim_bmap, M_NETVSC);
sc->hn_chim_bmap = NULL;
}
-
- return (ret);
+ return (0);
}
static int
@@ -567,7 +559,7 @@
/*
* Connect chimney sending buffer.
*/
- return hv_nv_init_send_buffer_with_net_vsp(sc);
+ return hn_nvs_conn_chim(sc);
}
/*
@@ -577,7 +569,7 @@
hv_nv_disconnect_from_vsp(struct hn_softc *sc)
{
hn_nvs_disconn_rxbuf(sc);
- hv_nv_destroy_send_buffer(sc);
+ hn_nvs_disconn_chim(sc);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 19, 2:32 AM (16 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29939853
Default Alt Text
D7825.diff (3 KB)
Attached To
Mode
D7825: hyperv/hn: Rename chimney sending buffer connect/disconnect functions.
Attached
Detach File
Event Timeline
Log In to Comment