All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Cc: netdev@vger.kernel.org, Leon Romanovsky <leon@kernel.org>,
	Saeed Mahameed <saeed@kernel.org>, Gal Pressman <gal@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH RFC net-next v1 2/3] macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst
Date: Wed, 13 Dec 2023 15:36:54 +0100	[thread overview]
Message-ID: <ZXnBhouKZPf39Hkb@hog> (raw)
In-Reply-To: <87wmu36mhw.fsf@nvidia.com>

2023-11-27, 11:10:19 -0800, Rahul Rameshbabu wrote:
> On Thu, 23 Nov, 2023 15:38:04 +0100 Sabrina Dubroca <sd@queasysnail.net> wrote:
> > If the device provided md_dst, either we find the corresponding rx_sc,
> > then we receive on this macsec device only, or we don't and try the
> > other macsec devices.
> >
> > Something like this (completely untested):
> >
> > 	if (macsec_is_offloaded(macsec) && netif_running(ndev)) {
> > 		struct macsec_rx_sc *rx_sc = NULL;
> > 		bool exact = false;
> >
> > 		if (macsec->offload_md_dst && !is_macsec_md_dst)
> > 			continue;
> >
> > 		if (is_macsec_md_dst) {
> > 			DEBUG_NET_WARN_ON_ONCE(!macsec->offload_md_dst);
> > 			rx_sc = find_rx_sc(&macsec->secy, md_dst->u.macsec_info.sci);
> > 			if (!rx_sc)
> > 				continue;
> > 			exact = true;
> > 		}
> >
> > 		if (exact ||
> > 		    ether_addr_equal_64bits(hdr->h_dest, ndev->dev_addr)) {
> > 			/* exact match, divert skb to this port */
> > 	[keep the existing code after this]
> >
> >
> > Am I missing something?
> 
> I just have one question with regards to this (will be testing this out
> too). For the exact match case, if the receiving traffic was macsec
> encrypted multicast, would the pkt_type be PACKET_HOST or
> PACKET_BROADCAST/PACKET_MULTICAST? My intuition is screaming to me that
> '[keep the existing code after this]' is not 100% true because we would
> want to update the skb pkt_type to PACKET_BROADCAST/PACKET_MULTICAST
> even if we are able to identify the incoming multicast frame was macsec
> encrypted and specifically intended for this device. Does that sound
> right?

Yes, I guess. SW decrypt path calls eth_type_trans, but that does a
lot more than we need here.

-- 
Sabrina


  reply	other threads:[~2023-12-13 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 18:28 [PATCH RFC net-next v1 0/3] Take advantage of certain device drivers during MACsec offload Rahul Rameshbabu
2023-11-16 18:28 ` [PATCH RFC net-next v1 1/3] macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads Rahul Rameshbabu
2023-11-16 18:28 ` [PATCH RFC net-next v1 2/3] macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst Rahul Rameshbabu
2023-11-23 14:38   ` Sabrina Dubroca
2023-11-27 19:10     ` Rahul Rameshbabu
2023-12-13 14:36       ` Sabrina Dubroca [this message]
2023-11-16 18:29 ` [PATCH RFC net-next v1 3/3] net/mlx5e: Advertise mlx5 ethernet driver updates sk_buff md_dst for MACsec Rahul Rameshbabu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZXnBhouKZPf39Hkb@hog \
    --to=sd@queasysnail.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rrameshbabu@nvidia.com \
    --cc=saeed@kernel.org \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.