From nobody Sat Dec 24 14:12:04 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NfQwN4twwz1mTMD; Sat, 24 Dec 2022 14:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NfQwN4S5wz4Vty; Sat, 24 Dec 2022 14:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671891124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CLmEQ7O7VfSAN3z6pTBOJK9HsbUFcVgJP1bArQm0DY8=; b=kAsSkQXycmoc/WBOmTF0vHIApDTeLfp3YV3fckX5wR/0D/VZXErAPR8QMlsFjyN2OvRObP ZenJ/+AyQiJ8owFoS8LNhJnsN1teHG55RIkI6GSuMRJpTqRcZ2JheL4sA8pC06D27rng5n Rb3cQfOgWU22ovjSTsnDgC2oD+2EqHplDP1hRkJTXiBp462lS4U8NpPVUteJUeUlcCd9We i366KTA05SAQJpaUhMfzWMDS3vzKvRmUSgZMZiW1vahpJSnbb1PDCsIuqi0ZohI/k6/sgR o6bnm50mN24wcgF3rU57ARj7sWBMddQmmKmSW1386gIU+Wlp2LpGpySKOdecOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671891124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CLmEQ7O7VfSAN3z6pTBOJK9HsbUFcVgJP1bArQm0DY8=; b=vBZthx/LOeyq1JsFw+2YIJn6PbfjHNZKTo32jiSh7rYlTRxSnKzGsXPoJo6MhxW/7PtAtC k3+FBy5SuAldMnNpKLR4tv0vV3fBeLXZhbowVk8diE7qippm4e1bW4LBa78T5Zsqwrf6Yn bF8EgoxBfi2QIJ/K9DgQNH8/vjy2azD9MAEdfsYuBaVWr2yjAFu9SZEtoJHjC6qi3gkZWb dlBRgEwc1y6I1bv23+3sMvdAPYn2x9QZJ6aa6Dx+Sgp2XhVjvZ2PH80hxRctmmLYX/kN0l AromyIXmD/fgUfDYyiFPSc6kEY/wx0YaWHtqyOzm/bIpjfe1iLZVhhC/21LTHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671891124; a=rsa-sha256; cv=none; b=kqzZZTN+uhlx6GR8+pUzXh0lyW62pji2B+HFU/ZEiBV5GqUfF5s0SnBHNMCrhUuFuRSMrp TTMQsB2zP+ERUsEktHJZpaUUHn8qam6wWnOTwh2mnCa/r2fISnsDqppu4lTZe6QGqgZXJh iAd1zxdHpv8cEbFImByv+Mi9OARHzpJdXXgS7/gYUO8twax2mflckSueobePIxQS0HpoZT H2HmFJOpzat9Cks9JRZ7VSL0SqQrDibu2zgUT1OvI2WxlbAEHN0RtdJQeUunbk072Qq7II VwAt0qaacCQs8T/+0dZbccLuuM74wPOoqhw6IFmvRw1zyjkIRdUGZyqTW4El1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NfQwN3X0xzGZ1; Sat, 24 Dec 2022 14:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BOEC4Pd072163; Sat, 24 Dec 2022 14:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BOEC4XA072162; Sat, 24 Dec 2022 14:12:04 GMT (envelope-from git) Date: Sat, 24 Dec 2022 14:12:04 GMT Message-Id: <202212241412.2BOEC4XA072162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: c5084b3fbcd3 - stable/13 - netmap_update_config: update na->name to cope with reconfigurations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c5084b3fbcd393ee7c92c81db40652dad88c2121 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=c5084b3fbcd393ee7c92c81db40652dad88c2121 commit c5084b3fbcd393ee7c92c81db40652dad88c2121 Author: Vincenzo Maffione AuthorDate: 2022-12-03 18:12:04 +0000 Commit: Vincenzo Maffione CommitDate: 2022-12-24 11:46:02 +0000 netmap_update_config: update na->name to cope with reconfigurations MFC after: 1 week (cherry picked from commit 4ad57c7afaca3fd94b67c00706e210f0373b8e62) --- sys/dev/netmap/netmap.c | 4 ++++ sys/dev/netmap/netmap_bdg.h | 1 - sys/dev/netmap/netmap_kern.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 5baadc3e8014..e76e0f2198b4 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -763,6 +763,10 @@ netmap_update_config(struct netmap_adapter *na) { struct nm_config_info info; + if (na->ifp && !nm_is_bwrap(na)) { + strlcpy(na->name, na->ifp->if_xname, sizeof(na->name)); + } + bzero(&info, sizeof(info)); if (na->nm_config == NULL || na->nm_config(na, &info)) { diff --git a/sys/dev/netmap/netmap_bdg.h b/sys/dev/netmap/netmap_bdg.h index e4683885e66c..42640128fcbd 100644 --- a/sys/dev/netmap/netmap_bdg.h +++ b/sys/dev/netmap/netmap_bdg.h @@ -190,7 +190,6 @@ void netmap_uninit_bridges2(struct nm_bridge *, u_int); int netmap_bdg_update_private_data(const char *name, bdg_update_private_data_fn_t callback, void *callback_data, void *auth_token); int netmap_bdg_config(struct nm_ifreq *nifr); -int nm_is_bwrap(struct netmap_adapter *); #define NM_NEED_BWRAP (-2) #endif /* _NET_NETMAP_BDG_H_ */ diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index 297e4c25e641..a45a405d5163 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -1097,6 +1097,7 @@ struct netmap_bwrap_adapter { */ struct netmap_vp_adapter *saved_na_vp; }; +int nm_is_bwrap(struct netmap_adapter *na); int nm_bdg_polling(struct nmreq_header *hdr); #ifdef WITH_VALE @@ -1511,6 +1512,7 @@ extern unsigned int vale_max_bridges; #define netmap_get_vale_na(_1, _2, _3, _4) 0 #define netmap_bdg_create(_1, _2) NULL #define netmap_bdg_destroy(_1, _2) 0 +#define vale_max_bridges 1 #endif /* !WITH_VALE */ #ifdef WITH_PIPES