From nobody Sat Dec 03 18:27:13 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 4NPdZT3p5lz4j498; Sat, 3 Dec 2022 18:27:13 +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 4NPdZT35Ygz4FFw; Sat, 3 Dec 2022 18:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670092033; 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=3nKEqb960MULLuKO8oLOr4CciC4C5A1Z50KYhSiRjqg=; b=KMoTmJol7NX7afK1GR/wQywnUfZDVyL/pD2PfpLSbtRrWNC/Iy1v05F+lFW7xpyxAKr5pN zGJx26a2G3qoJZZQ6ACipzcIkMT22PLQKSlKkmSNRRXp1oZkg941MgvsxE2hf5RasKvO7a q459H0FCW3PEiKJt9/yS4PIFU7rM7UKM5DAeroMp6cfN/8+J38q0TfZLiwn/MBEVJioDjf dl5MkRMV1ckK24NNrW9hCllgr0HXNj8DhOBdKf41K7T7gCrFUShjVdb9jYrAEjPFxe9BEc +2XpMESYZ0P/QpZn+xJPh5qtBt6FPnqn6VC/I/Oz+SN1SVvRJ1uD7AnEMSnldQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670092033; 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=3nKEqb960MULLuKO8oLOr4CciC4C5A1Z50KYhSiRjqg=; b=SD/iwWMrBoSZpmM+f7qr9HtUEbHBtJsA4d7bZ9x8Zcv04OR2F3dIxPh4Qb+nRL71+Wt6gw QzKmjwpw+f9FcF8hN8Rqt2iC//PQnmP741w3J4gk86zsCQb42N7G2oPigsAjitbC5D9z1K Sn/XJvsIf7tFxk/9NBwqaf6pfl8/iQEKQvQcPSk3RolmltAWVPUVEbcdRxSRqV562BueQo +nMXRcj+W5DnoQn458EpdLel4MxXLSP4VRlOBqpriv+X5slelGqLEZpdIigLqaWNgG1G7X 6iQLRwlwqmqmiA+1xHF8OnlB2Fgj9mblV0U3v23Uxrrk6+jjYoSrORro28vjEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670092033; a=rsa-sha256; cv=none; b=nGfWZbdHws0l3NC2hevWUXpw/7A+Dkkx7GCtsXw4HzrgD1ovlQQKPpWHvBjFIwXjJuaAmF lvg8tk1dpA6PPDXKh9RvSWJ7plj3/rLmXEzMnbp1CJo2w5EiLgVD5kXC2AK/cANtO6T1FU l/ZBKdIhuiLTVBSfhitr2IWMBziAAzS6+Km0ArfcpBWno0AATOtL5w+xLmhoCMsejQ45rI iIZB3YZtYq4pGYRA/Utjec5pMUdCuO75GT68t5zqhph29BrmHSj6r6GA1kkx0Gwl/azpjo nsLRR0p5nAQTRTIXPjd3BuH6d6lSK/44EdVcD9Gi7lUWl1VmI2ukkrfKsc9oRw== 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 4NPdZT27WJz14BT; Sat, 3 Dec 2022 18:27:13 +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 2B3IRDbt006963; Sat, 3 Dec 2022 18:27:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B3IRD2J006962; Sat, 3 Dec 2022 18:27:13 GMT (envelope-from git) Date: Sat, 3 Dec 2022 18:27:13 GMT Message-Id: <202212031827.2B3IRD2J006962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vincenzo Maffione Subject: git: 4ad57c7afaca - main - 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/main X-Git-Reftype: branch X-Git-Commit: 4ad57c7afaca3fd94b67c00706e210f0373b8e62 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=4ad57c7afaca3fd94b67c00706e210f0373b8e62 commit 4ad57c7afaca3fd94b67c00706e210f0373b8e62 Author: Vincenzo Maffione AuthorDate: 2022-12-03 18:12:04 +0000 Commit: Vincenzo Maffione CommitDate: 2022-12-03 18:12:04 +0000 netmap_update_config: update na->name to cope with reconfigurations MFC after: 1 week --- 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 a166bc9d233d..4bafa507384d 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 a88eaf11b07c..ac8629141601 100644 --- a/sys/dev/netmap/netmap_bdg.h +++ b/sys/dev/netmap/netmap_bdg.h @@ -192,7 +192,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 acceaa9df540..e5be1c793f4d 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -1155,6 +1155,7 @@ struct netmap_bwrap_adapter { struct netmap_vp_adapter *saved_na_vp; int (*nm_intr_notify)(struct netmap_kring *kring, int flags); }; +int nm_is_bwrap(struct netmap_adapter *na); int nm_bdg_polling(struct nmreq_header *hdr); int netmap_bdg_attach(struct nmreq_header *hdr, void *auth_token); @@ -1566,6 +1567,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