1 From 475747a19316b08e856c666a20503e73d7ed67ed Mon Sep 17 00:00:00 2001
2 From: Rahul Rameshbabu <rrameshbabu@nvidia.com>
3 Date: Tue, 23 Apr 2024 11:13:02 -0700
4 Subject: macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads
6 From: Rahul Rameshbabu <rrameshbabu@nvidia.com>
8 commit 475747a19316b08e856c666a20503e73d7ed67ed upstream.
10 Cannot know whether a Rx skb missing md_dst is intended for MACsec or not
11 without knowing whether the device is able to update this field during an
12 offload. Assume that an offload to a MACsec device cannot support updating
13 md_dst by default. Capable devices can advertise that they do indicate that
14 an skb is related to a MACsec offloaded packet using the md_dst.
16 Cc: Sabrina Dubroca <sd@queasysnail.net>
17 Cc: stable@vger.kernel.org
18 Fixes: 860ead89b851 ("net/macsec: Add MACsec skb_metadata_dst Rx Data path support")
19 Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
20 Reviewed-by: Benjamin Poirier <bpoirier@nvidia.com>
21 Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
22 Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
23 Link: https://lore.kernel.org/r/20240423181319.115860-2-rrameshbabu@nvidia.com
24 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 include/net/macsec.h | 2 ++
28 1 file changed, 2 insertions(+)
30 --- a/include/net/macsec.h
31 +++ b/include/net/macsec.h
32 @@ -321,6 +321,7 @@ struct macsec_context {
34 * @needed_tailroom: number of bytes reserved at the end of the sk_buff for the
36 + * @rx_uses_md_dst: whether MACsec device offload supports sk_buff md_dst
40 @@ -352,6 +353,7 @@ struct macsec_ops {
42 unsigned int needed_headroom;
43 unsigned int needed_tailroom;
44 + bool rx_uses_md_dst;
47 void macsec_pn_wrapped(struct macsec_secy *secy, struct macsec_tx_sa *tx_sa);