From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.15 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796024470; b=bJkiw5JyzZU78cY9joNErx2Hbme9dtUm1tLpRIdGsTIy9Oy7YNsNsog9XJ/SrGzs4G3E YPP3UGLWHTcbPsLWk2YO5wQuSDCGDnKsDtCbmjqBQBPRPebEPGD4VJbdWZLbw3Qzo4CXM o6QDKpvzfpx2ncaj2FDtV9xFCq8qsqCRTFO0mL0oStpvgbyrfmNFlYn3OkJbHeReIRvjA vLideFIPtTxWtK7WkBMhKarTcutOA19VqyQAFjHQt1JxsQ1oGMs6McfRn4j9aWR5puVfu 3DiU6j5GMeLGYLXvMNqw58CJ5Gv69JcbaJTn0VCDNFlqkrqirylWdOpTvn4lFu9p+Dw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796024470; h=DMARC-Filter:DKIM-Signature:Received:Received:Message-ID:Date: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=r5dk+3YzptDjdVSIaekLsqRC8o74AE0KD3I9sD5IJ6w=; b=xvBuYP1aCzsJ5K9m8irPN8TdoSBL3cPuvbXpB+7Jzs/17dgsbXS1eBnn1yAfK1aSb4sY jAgW8xi+OMRom2DjgRaw7hJyx57qDioeEc4gEeO3NFRI79vrNtrktyb1iWSJf4BuXBIjD R2i4bgfibF7mypM9U2NrHty2YK1bY4kvYHfNoMtRTFY2i/92nbzALDZ8T8VMkRCEclhnb 34Eh85KtmakEzFgFWeujBaxgX4fVW71XEBwbJgHb561WM62JrOk2rDTc6LLWXpdkRnX5H WdjH4C4H9R8Un9U5wGUFroUe4Z3//epRqmX+SWVYcjgwCcPrFcdHI2FnOiyjUyugoYg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=S6Y0DBJ5; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.15 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010015.outbound.protection.outlook.com [52.101.201.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBCCD606A31C; Mon, 30 Nov 2026 07:41:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CBCCD606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=S6Y0DBJ5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B9ZbS3jn+6oUaZRrgVvIz5LgRyrRFNxPuLuc4pXHJgSCO4oTGKjjYne8KYJI12cdqrdaJRzAQ7DbAPWx6eAvbUyxbGZmpIKY+SXjlNV5b/k5n/LU5fcGBbahkxNGOqmVE23ogACOSwuyM3OxXDbtJUu/s+z/QMBlqjw+yRT4eMuKsRKhMUBRyWXtLdJ1C2ivTQ7ERZ5OMlCsRwBP4Lal80z+8DIoDrG9Azbxar28JZ9myaFGP4LWsWC0b7vCTHN5ZpdUNt2rsKzG6fWSZDj5vQljD0WLifB8ALTabQXWdfqYSqlpYzQQRyuMkzctDYl2F8C8TJN6YxZRHQTBYwIjiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r5dk+3YzptDjdVSIaekLsqRC8o74AE0KD3I9sD5IJ6w=; b=hw749YhfzB+aqAq0nrBVwAlANdOTXBLuZBGmtXHjk3XaI0nPtHzndzKk2xbXfeQpv4rl6D0RlY1xVw44RfpbjA1LkphULANU0U0gNxBFMIpqGe9wHO6GyRB0MciZbUpeMdxWyMTbRI/Uw2IJ0tDEgVf1jFrlhRuof2ZFDodoYextoYyY7j9gQTxikK9pahg7+hLVnYIgZvCx1tcsKs4rEJCF58MeClQfPbbOYARfDc4cryupPfby6ax+dnCrkJcozGUREycuHPv/BCojeUCpD1jzl9RUi3fBH2cVMSVKzFfcz4GtZqQX8JpmL9LWyLIYJHiBKAJ3XPT1+Fp6KA87EQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r5dk+3YzptDjdVSIaekLsqRC8o74AE0KD3I9sD5IJ6w=; b=S6Y0DBJ5nogLRZ+/AR6Ra5ZIVtufasubSxtrTNUJwtGS/hULhEWZwQkXFzYuX+R8njGQlKdDEVYN1NGjRUppnxKH35bT8UzBWwzrWFJ7q/fVg20YDkDKsfOZdk1Z/1ryuisL4uw7HKlVQdNdmtvQb08T50M77UYcVYSFjG5K9u/nFI1Hgm1CLO84xSCNtyWCeYmftp+Xx9UOl9kVgBfds3NoXrkHdZKK1E5KUCEZRe2cHAXciLYDiaHKZR7kGNU74y4theJAIopFyoLhnG/HXQTz6jSDWW2nYi3P9DF6kO8B0OnvfUqaC2gZ864ynISavpFiV4tbuso9bhDKpVgI1g== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from SAVPR12MB999143.namprd12.prod.outlook.com (2603:10b6:806:4e5::21) by LV8PR12MB9262.namprd12.prod.outlook.com (2603:10b6:408:1e7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Mon, 30 Nov 2026 07:41:06 +0000 Received: from SAVPR12MB999143.namprd12.prod.outlook.com ([fe80::219e:6553:2ec0:3761]) by SAVPR12MB999143.namprd12.prod.outlook.com ([fe80::219e:6553:2ec0:3761%4]) with mapi id 15.21.0662.007; Mon, 30 Nov 2026 07:41:06 +0000 Message-ID: <922daa79-0cc7-49a0-80f4-095c8c5d99fb@nvidia.com> Date: Mon, 30 Nov 2026 15:40:51 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net 05/10] net/mlx5e: Drop IPsec tunnel traffic if the neigh cannot be created To: netdev-bot+sashiko@kernel.org, tariqt@nvidia.com Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, willemb@google.com, parri.andrea@gmail.com, borisp@nvidia.com, cratiu@nvidia.com, eedmunds@nvidia.com, gal@nvidia.com, jmassar@nvidia.com, kuniyu@google.com, leon@kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, phaddad@nvidia.com, raeds@nvidia.com, saeedm@nvidia.com, horms@kernel.org, sridhar.samudrala@intel.com, steffen.klassert@secunet.com References: <20261126215614.792598-6-tariqt@nvidia.com> <179581873325.3135.13078869091632134545@kernel.org> Content-Language: en-US From: Jianbo Liu In-Reply-To: <179581873325.3135.13078869091632134545@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: JH0PR01CA0096.apcprd01.prod.exchangelabs.com (2603:1096:990:58::10) To SAVPR12MB999143.namprd12.prod.outlook.com (2603:10b6:806:4e5::21) X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SAVPR12MB999143:EE_|LV8PR12MB9262:EE_ X-MS-Office365-Filtering-Correlation-Id: bc4e3e9b-5b1b-4087-0e25-08df4eb54ae1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|23010399003|1800799024|7416014|376014|10067099003|56012099006|261028144727099003|261026121527099003|261026140227099003|261021123027099003|261022075727099003|261022105027099003|261022113327099003|261009223027099003|7136999003|11062099010|18002099003|22082099003|4143699003|11063799006; X-Microsoft-Antispam-Message-Info: mCeCZ4j/XIN/vrQHlrY4Eb15S8CdkxYBOxCAomiUSAc6BPddBXzjtIirtBbVk8uSyGj/bMD+9w6z8GIaCLN1HsQIDxT3LLeqfDQPEfElxPa1P+/7ZQuYj1Ra+eD/w/5svYj3oeDeJ0Gvi2Y+O28ipEImST3k7SSo/y9hUt8FcZGhqidSmtDYioY7AkS3GPSQJvmgRDijj3UOfBsOgfEdX6x6E9qOF/94qof2nW/i1iw9qWvzi/ekrxQj+hcn7WlgB6F84XJgLnVb4cBbaEcxyWxj1+NRsMbGdH7ni8/7cGm6wXbPpaqSmajVl5oftieiKm3RCVvAhyJJSrOXJqki92KBcqgbzwmqrwDab44MVKmOi83vcUIQOM8JMFcVXUmBIKxg9Z37tNDDb3ougaFJAXgPNTHF0KyZod4XsaQMMDOGvkAkZJi2AX19HpBX8rdCcG22WjIKBjgvJjI6T1dt5BhjKcWERI0FQV7AuUXAV0t4kF/XU+FVd4oli+B/9qPuTHEI+1AwpZ7tpjGLYEToBWdymx6TFiY0I4DfHt+Ci+DgM4p7MeHDMqKFtW9iDCoA5SralXjrx2TRiuxOCWtMo9ZYzKQSl8irpg4IL3g31ZQsQa/Sy51dI8nLKsBd0xoWo9Zc5HUs0XzZATj/dtnHueekcqkCBeYdXYpA8RLKDm8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SAVPR12MB999143.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(7416014)(376014)(10067099003)(56012099006)(261028144727099003)(261026121527099003)(261026140227099003)(261021123027099003)(261022075727099003)(261022105027099003)(261022113327099003)(261009223027099003)(7136999003)(11062099010)(18002099003)(22082099003)(4143699003)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NHYyclMrUFp2UFRhbHA2MndtRnlwMGJkNDZrOVlFelovWWYwK1ZCNDdvdVhm?= =?utf-8?B?TzlkSXhsOTd6YzRLOGYzYjIxblcrbUkvMXQzckZScTdISmdBYktEbFcxa1F3?= =?utf-8?B?VCtENmYwS1JGTW5IcU5mR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DhDeE5maTFka0NDWVlzWWRhN1JP?= =?utf-8?B?YnlxQ1dieENQTDg5S2hoUG01Y3RKVzB0cFBaTmQ3QnpyL1djSGE0ck5SejZE?= =?utf-8?B?eTRBcmdyZklsS29SL1ZpMDgrK1lncjdnemFVR29YRE9CK2tOVndEUDZnbHgy?= =?utf-8?B?UGIxQlZmTnBjdDJqUE1PWkhlblhMdW1wSmJObWRIeHBhZkdEUnZMMFZaRGRX?= =?utf-8?B?bjZTdFVaSFNXYlNWNHpGdjN6VVc4MXlIYVAyejUrTFZpeFJ6S1lCUnR2Yyt6?= =?utf-8?B?MGFpZTFwSjI3STRYR2ZTVk1RRkR4OGtoT29oRWxnaTJ1WmhJTGtSNkZLYUli?= =?utf-8?B?cFRqTGhwMms2ZTlBR2JJTkZaNmx4em1YZ0FRaERENzdWZTZ0M1VheW9yOGJw?= =?utf-8?B?NmN4VEdUSHU3SmN1MjM5azJGNDYwT0dzYUdubUxOaGl5KzU0MEdZUT09?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc4e3e9b-5b1b-4087-0e25-08df4eb54ae1 X-MS-Exchange-CrossTenant-AuthSource: SAVPR12MB999143.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 07:41:06.5134 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k9Wkee4rMi0EpKtbWAbTCnyvHcLmhd8uTR3i5Z5+/A737SxQY1TeGkS6os3XiN2EjzMcOOfLYvwwhDgpx5ovKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9262 On 11/28/2026 6:32 AM, netdev-bot+sashiko@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 3 potential > issue(s) to consider. > > Critical: 0 · High: 0 · Medium: 3 · Low: 0 > > If you believe none of the issues are legitimate, please reply to each > issue of Medium severity or higher and explain why the AI is wrong. > If any of them are legitimate and you plan to respin, please let patchwork > know by including "pw-bot: cr" as a separate line at the end of your reply > (one such reply per series is enough). > > - [Medium] The patch only covers the case where neighbour creation fails. > - [Medium] Setting attrs->drop = true when the neighbour cannot be > created permanently stops the SA's software lifetime worker. > - [Medium] The new 'attrs->drop = true' on neighbour-creation failure in > mlx5e_ipsec_init_macs() (ipsec.c:371) is not limited to the TX… > > -- > > net/mlx5e: Drop IPsec tunnel traffic if the neigh cannot be created > > This patch moves the attrs->drop assignment in mlx5e_ipsec_init_macs() so > it happens before the IS_ERR() check on the result of ipv4_neigh_create(). > When the peer neighbour cannot be created, the tunnel packet offload SA > is now installed as a drop rule. Before, it forwarded traffic with an > all-zero destination MAC. > >> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c >> index ea7a1ae2056fa..4daad648460fe 100644 >> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c >> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c >> @@ -368,10 +368,10 @@ static void mlx5e_ipsec_init_macs(struct mlx5e_ipsec_sa_entry *sa_entry, >> n = ipv4_neigh_lookup(netdev, pkey); >> if (!n) { >> n = ipv4_neigh_create(netdev, pkey); >> + attrs->drop = true; >> if (IS_ERR(n)) >> return; > > [Severity: Medium] > Should this drop be limited to XFRM_DEV_OFFLOAD_OUT? > > For an inbound SA, mlx5e_ipsec_init_macs() sets src = attrs->dmac (the > netdev's own MAC) and dst = attrs->smac (the peer MAC). The unresolved > peer MAC only becomes the source MAC of the L2 header that > setup_pkt_reformat() adds to the decrypted inner frame: > > drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:setup_pkt_reformat() { > ... > ether_addr_copy(eth_hdr->h_dest, attrs->dmac); > ether_addr_copy(eth_hdr->h_source, attrs->smac); > ... > } > > Before this patch, an RX SA in this state still delivered decrypted > traffic to the host, with h_source set to 00:00:00:00:00:00. With drop > set, rx_add_rule() now installs CRYPTO_DECRYPT|DROP: > > drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:rx_add_rule() { > ... > if (attrs->drop) { > flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_DROP; > rule = mlx5_add_flow_rules(rx->ft.sa, spec, &flow_act, NULL, 0); > ... > } > > n is an ERR_PTR here, so neigh_event_send() is never called and no > resolution starts. > > Could inbound traffic for this SA stay blackholed until some unrelated > event creates and validates the neighbour? That can't happen while the > table is still full. > > The commit message only describes the TX case ("add the TX SA ..."). > The drop in this path is not limited to TX. Commit 4c24272b4e2b added it for the IN case as well as the OUT case, and the code before this patch drops both directions for a neighbour that this path has just created. The patch makes a failed create do the same. Right, no probe is sent in this branch, there is no neighbour to probe. mlx5e_ipsec_netevent_event() still finds the SA, and it is switched to forward when a neighbour entry for the peer address becomes valid. Until then the SA drops, and no such entry is learned while the table is full. A created neighbour that gets no answer to the probe leaves the SA in the same state today. > [Severity: Medium] > Does setting drop here permanently stop the software lifetime worker for > this SA? > > mlx5e_xfrm_add_state() queues sa_entry->dwork once, MLX5_IPSEC_RESCHED > after install. mlx5e_ipsec_handle_sw_limits() returns early when drop is > set and only re-queues itself at the end: > > mlx5e_ipsec_handle_sw_limits() { > ... > if (sa_entry->attrs.drop) > return; > ... > xfrm_state_check_expire(x); > spin_unlock_bh(&x->lock); > > queue_delayed_work(sa_entry->ipsec->wq, &dwork->dwork, > MLX5_IPSEC_RESCHED); > } > > This IS_ERR() branch sends no probe. Drop is therefore almost certainly > still set when the worker first runs, and the worker is never queued > again. > > If the neighbour resolves later, mlx5e_ipsec_handle_netdev_event() > clears the flag and reprograms the rules to forward: > > attrs->drop = false; > mlx5e_accel_ipsec_fs_modify(sa_entry); > > It does not re-arm the dwork. Would the SA then forward traffic without > any xfrm_state_check_expire() calls, so the soft and hard byte limits > are never enforced? > > Before this patch, the IS_ERR() branch left drop false and the worker > kept running. The root cause seems to be that attrs->drop means both > "expired" and "neighbour unresolved". > > A later commit in the series, "net/mlx5e: Copy back only replay_esn > after an IPsec ESN update", fixes the ESN rebuild variant of this > problem. At the end of the series, the early return in > mlx5e_ipsec_handle_sw_limits() and the missing re-arm in > mlx5e_ipsec_handle_netdev_event() are both still there. > >> neigh_event_send(n, NULL); >> - attrs->drop = true; >> } else { >> neigh_ha_snapshot(addr, n, netdev); >> ether_addr_copy(dst, addr); > Yes, the work returns when it finds the SA in the drop state and is not queued again. It is an existing problem, which needs a seperate fix, as I said in the reply to patch 2. > [Severity: Medium] > The commit message says this makes creation failure behave "as for a > created but still unresolved neigh". Does that hold outside the create > branch of the fallback path? > > In this else branch, ipv4_neigh_lookup() can return an existing > neighbour that is INCOMPLETE or FAILED. Its zero ha is copied into dmac, > drop stays false, and no probe is sent. > > The route path earlier in mlx5e_ipsec_init_macs() shows the same > symptom. dst_neigh_lookup() goes through > ipv4_dst_neigh_lookup()->ip_neigh_gw4(), which calls __neigh_create() > on a miss. It returns a new unresolved neighbour instead of NULL, so the > fallback is never reached: > > n = dst_neigh_lookup(rt_dst_entry, pkey); > ... > neigh_ha_snapshot(addr, n, netdev); > ether_addr_copy(dst, addr); > if (attrs->dir == XFRM_DEV_OFFLOAD_OUT && > is_zero_ether_addr(addr)) > neigh_event_send(n, NULL); > > attrs->drop is never set on that path, and tx_add_rule() chooses the > action from attrs->drop alone: > > drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c:tx_add_rule() { > ... > if (attrs->drop) > flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_DROP; > else > flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; > ... > } > > Suppose a route to the peer exists but the next hop is not resolved yet, > for example the first SA toward a new peer. Won't the TX SA still be > installed with dmac 00:00:00:00:00:00 and forwarding enabled? That is > the symptom this commit describes. > > Commit 9ab89bde13e5 describes this route path case ("the hardware rule > is programmed with an all-zero destination MAC address") but only adds a > probe, not a drop. The route path still has no drop at the end of the > series. > > A later commit in the series, "net/mlx5e: Validate neighbour events > before updating IPsec SAs", fixes the related problem that gateway > neighbour updates were never matched. > It seems irrelevant. This patch is only about the failed create.