diff mbox series

[RFC,net-next,v1,1/3] macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads

Message ID 20231116182900.46052-2-rrameshbabu@nvidia.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series Take advantage of certain device drivers during MACsec offload | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1217 this patch: 1217
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 1155 this patch: 1155
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1281 this patch: 1281
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 28 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc fail Errors and warnings before: 36 this patch: 37
netdev/source_inline success Was 0 now: 0

Commit Message

Rahul Rameshbabu Nov. 16, 2023, 6:28 p.m. UTC
Cannot know whether a Rx skb missing md_dst is intended for MACsec or not
without knowing whether the device is able to update this field during an
offload. Assume that an offload to a MACsec device cannot support updating
md_dst by default. Capable devices can advertise that they do indicate that
an skb is related to a MACsec offloaded packet using the md_dst.

Cc: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
---
 drivers/net/macsec.c | 3 +++
 include/net/macsec.h | 1 +
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 9663050a852d..8c0b12490e89 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -93,6 +93,7 @@  struct pcpu_secy_stats {
  * @secys: linked list of SecY's on the underlying device
  * @gro_cells: pointer to the Generic Receive Offload cell
  * @offload: status of offloading on the MACsec device
+ * @offload_md_dst: whether MACsec device offload supports sk_buff md_dst
  */
 struct macsec_dev {
 	struct macsec_secy secy;
@@ -102,6 +103,7 @@  struct macsec_dev {
 	struct list_head secys;
 	struct gro_cells gro_cells;
 	enum macsec_offload offload;
+	bool offload_md_dst;
 };
 
 /**
@@ -3525,6 +3527,7 @@  static int macsec_dev_open(struct net_device *dev)
 		}
 
 		ctx.secy = &macsec->secy;
+		ctx.offload_md_dst = &macsec->offload_md_dst;
 		err = macsec_offload(ops->mdo_dev_open, &ctx);
 		if (err)
 			goto clear_allmulti;
diff --git a/include/net/macsec.h b/include/net/macsec.h
index ebf9bc54036a..09ca118d2df6 100644
--- a/include/net/macsec.h
+++ b/include/net/macsec.h
@@ -255,6 +255,7 @@  struct macsec_context {
 	};
 	enum macsec_offload offload;
 
+	bool *offload_md_dst;
 	struct macsec_secy *secy;
 	struct macsec_rx_sc *rx_sc;
 	struct {