hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
....@@ -14,6 +14,7 @@
1414 #include <net/xdp.h>
1515
1616 #include "vf.h"
17
+#include "ipsec.h"
1718
1819 #define IXGBE_MAX_TXD_PWR 14
1920 #define IXGBE_MAX_DATA_PER_TXD BIT(IXGBE_MAX_TXD_PWR)
....@@ -163,6 +164,7 @@
163164 #define IXGBE_TX_FLAGS_VLAN BIT(1)
164165 #define IXGBE_TX_FLAGS_TSO BIT(2)
165166 #define IXGBE_TX_FLAGS_IPV4 BIT(3)
167
+#define IXGBE_TX_FLAGS_IPSEC BIT(4)
166168 #define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000
167169 #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000
168170 #define IXGBE_TX_FLAGS_VLAN_SHIFT 16
....@@ -338,6 +340,7 @@
338340 struct ixgbevf_ring *tx_ring[MAX_TX_QUEUES]; /* One per active queue */
339341 u64 restart_queue;
340342 u32 tx_timeout_count;
343
+ u64 tx_ipsec;
341344
342345 /* RX */
343346 int num_rx_queues;
....@@ -348,6 +351,7 @@
348351 u64 alloc_rx_page_failed;
349352 u64 alloc_rx_buff_failed;
350353 u64 alloc_rx_page;
354
+ u64 rx_ipsec;
351355
352356 struct msix_entry *msix_entries;
353357
....@@ -384,6 +388,10 @@
384388 u8 rss_indir_tbl[IXGBEVF_X550_VFRETA_SIZE];
385389 u32 flags;
386390 #define IXGBEVF_FLAGS_LEGACY_RX BIT(1)
391
+
392
+#ifdef CONFIG_XFRM
393
+ struct ixgbevf_ipsec *ipsec;
394
+#endif /* CONFIG_XFRM */
387395 };
388396
389397 enum ixbgevf_state_t {
....@@ -432,7 +440,6 @@
432440
433441 /* needed by ethtool.c */
434442 extern const char ixgbevf_driver_name[];
435
-extern const char ixgbevf_driver_version[];
436443
437444 int ixgbevf_open(struct net_device *netdev);
438445 int ixgbevf_close(struct net_device *netdev);
....@@ -451,6 +458,31 @@
451458
452459 extern void ixgbevf_write_eitr(struct ixgbevf_q_vector *q_vector);
453460
461
+#ifdef CONFIG_IXGBEVF_IPSEC
462
+void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter);
463
+void ixgbevf_stop_ipsec_offload(struct ixgbevf_adapter *adapter);
464
+void ixgbevf_ipsec_restore(struct ixgbevf_adapter *adapter);
465
+void ixgbevf_ipsec_rx(struct ixgbevf_ring *rx_ring,
466
+ union ixgbe_adv_rx_desc *rx_desc,
467
+ struct sk_buff *skb);
468
+int ixgbevf_ipsec_tx(struct ixgbevf_ring *tx_ring,
469
+ struct ixgbevf_tx_buffer *first,
470
+ struct ixgbevf_ipsec_tx_data *itd);
471
+#else
472
+static inline void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter)
473
+{ }
474
+static inline void ixgbevf_stop_ipsec_offload(struct ixgbevf_adapter *adapter)
475
+{ }
476
+static inline void ixgbevf_ipsec_restore(struct ixgbevf_adapter *adapter) { }
477
+static inline void ixgbevf_ipsec_rx(struct ixgbevf_ring *rx_ring,
478
+ union ixgbe_adv_rx_desc *rx_desc,
479
+ struct sk_buff *skb) { }
480
+static inline int ixgbevf_ipsec_tx(struct ixgbevf_ring *tx_ring,
481
+ struct ixgbevf_tx_buffer *first,
482
+ struct ixgbevf_ipsec_tx_data *itd)
483
+{ return 0; }
484
+#endif /* CONFIG_IXGBEVF_IPSEC */
485
+
454486 void ixgbe_napi_add_all(struct ixgbevf_adapter *adapter);
455487 void ixgbe_napi_del_all(struct ixgbevf_adapter *adapter);
456488