[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d3628e6-5cb4-497d-a152-c6bbaac02259@intel.com>
Date: Mon, 13 Jan 2025 11:48:20 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Leon Romanovsky <leon@...nel.org>
CC: Tariq Toukan <tariqt@...dia.com>, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "Eric
Dumazet" <edumazet@...gle.com>, Andrew Lunn <andrew+netdev@...n.ch>,
<netdev@...r.kernel.org>, Saeed Mahameed <saeedm@...dia.com>, Gal Pressman
<gal@...dia.com>, Mark Bloch <mbloch@...dia.com>, Moshe Shemesh
<moshe@...dia.com>
Subject: Re: [PATCH net 6/8] net/mlx5e: Properly match IPsec subnet addresses
On 1/13/2025 11:23 AM, Leon Romanovsky wrote:
> On Mon, Jan 13, 2025 at 11:07:03AM -0800, Jacob Keller wrote:
>>
>>
>> On 1/13/2025 7:40 AM, Tariq Toukan wrote:
>>> +static void addr4_to_mask(__be32 *addr, __be32 *mask)
>>> +{
>>> + int i;
>>> +
>>> + *mask = 0;
>>> + for (i = 0; i < 4; i++)
>>> + *mask |= ((*addr >> 8 * i) & 0xFF) ? (0xFF << 8 * i) : 0;
>>> +}
>>> +
>>
>> I'm surprised this isn't already a common helper function.
>
> I failed to find.
>
> Thanks
To clarify, I didn't find one either, and I don't think its a blocker on
this fix. I'm just surprised that there hasn't been another user with
the same need before.
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists