From nobody Sat Dec 31 12:29:14 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 4NkhJW1qnsz2nM4X; Sat, 31 Dec 2022 12:29:15 +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 4NkhJW1Mrtz4KDg; Sat, 31 Dec 2022 12:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672489755; 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=qHB76y/jD+Owd4vDJE4Udt31swR1TBcjP+KguAKTyJY=; b=ddt1tA5qVPMfl/IVnw4guQU2fMEy5ThR0Pp7yvj5IoJOV1UlFK9EWYnBCeKgh1Rp3WobTR SfNUcLabQ9J7USvukTuKZC8JGC+G38aPZd4B+5o9sMO450TX+k/PrpBR2TlmZmjikN2nEY B/ANRxqG1h9xSZZdNPoOpTcj7vrOHcn2DQtDZLNkbLUp0Ng7fRcFhS9J383Xbu870QS6aL tB9MFGG33hJUoxN1yVAjwVN7tMe8noWt7Z+Zkr+HCaHaGBFZE6GB7mHWOB7HpPja2J7gzV vRaRvh81nEW8xZL05P+KJhWhrNeN1PvHHBa37xsQvCZ8nz/2u2/ONLC9eBEnLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672489755; 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=qHB76y/jD+Owd4vDJE4Udt31swR1TBcjP+KguAKTyJY=; b=iakxnbHfoSucubcqv/ZowchtNeWPwjLj5T9Y6At7PW0yQlakRMpPJTL5U4JQ7BbnPeC1Mp sr60zhez03shDo/DPfqxMtmWMvUtWNY/9gWzWnH0DVmybppyhxXbeyx98/LXv08Fnw9fci zgOr8zWe8az5Za/gwPNtfI8TbTzJ5yqm4uFrTBDkAqgnfNUOYzuWrLRzwKvw2q3/EXRQSm 1Y9bimxeF51kQyx3qC4q5uLKozttLbMKoqA2LoKeQseUL8NSszC/Usyl+ohw8zWYFoJqUb +7G/XgL0eiEkr0TetemiycnhYX+cQLvxhthAtaydGcp5dYBpzluVjYUCB6zOqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672489755; a=rsa-sha256; cv=none; b=LCr9kYmpmSLvcbi7ByLixGS/WlsAW6Ng6vyW3X0pGCUZTlE3r/xn9ZlcN84oH0vHK9YmZ1 o5qrgya0Gvxl7Se5fs/McjNMWaIWePV8OHFpfe9sNadhGbPnTgdwohdMHeWmcTuzebf5vH GEHltEBy5yiHbuWZ8lw7ZCyEoZGOTRTxJiqKTnafaQAfacVRBWOkiExIwWcKCgKpaTGXNs Lqg8CL/xn9jKYryA2SmZ+XRnQGyQQjMm62tYqckBFFikS1Pwh03MAQ5XC3Mp6H29rvLdhW ECVYD9RDpNVcAp50UJzgY00YZYVvjOTZBYp69rlDtl8tBfu2sZBSib+DqWJ7BA== 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 4NkhJW0B55zp6H; Sat, 31 Dec 2022 12:29:15 +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 2BVCTE66069971; Sat, 31 Dec 2022 12:29:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BVCTEqV069970; Sat, 31 Dec 2022 12:29:14 GMT (envelope-from git) Date: Sat, 31 Dec 2022 12:29:14 GMT Message-Id: <202212311229.2BVCTEqV069970@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: b0491d5a73d1 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: b0491d5a73d16a3d8144c0d95a158498c29f841a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=b0491d5a73d16a3d8144c0d95a158498c29f841a commit b0491d5a73d16a3d8144c0d95a158498c29f841a Author: Vincenzo Maffione AuthorDate: 2022-12-03 18:12:04 +0000 Commit: Vincenzo Maffione CommitDate: 2022-12-31 12:13:55 +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 52c7987f32fe..d3a0e935aef1 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -760,6 +760,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