| .. | .. |
|---|
| 14 | 14 | #include <net/xdp.h> |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | #include "vf.h" |
|---|
| 17 | +#include "ipsec.h" |
|---|
| 17 | 18 | |
|---|
| 18 | 19 | #define IXGBE_MAX_TXD_PWR 14 |
|---|
| 19 | 20 | #define IXGBE_MAX_DATA_PER_TXD BIT(IXGBE_MAX_TXD_PWR) |
|---|
| .. | .. |
|---|
| 163 | 164 | #define IXGBE_TX_FLAGS_VLAN BIT(1) |
|---|
| 164 | 165 | #define IXGBE_TX_FLAGS_TSO BIT(2) |
|---|
| 165 | 166 | #define IXGBE_TX_FLAGS_IPV4 BIT(3) |
|---|
| 167 | +#define IXGBE_TX_FLAGS_IPSEC BIT(4) |
|---|
| 166 | 168 | #define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000 |
|---|
| 167 | 169 | #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000 |
|---|
| 168 | 170 | #define IXGBE_TX_FLAGS_VLAN_SHIFT 16 |
|---|
| .. | .. |
|---|
| 338 | 340 | struct ixgbevf_ring *tx_ring[MAX_TX_QUEUES]; /* One per active queue */ |
|---|
| 339 | 341 | u64 restart_queue; |
|---|
| 340 | 342 | u32 tx_timeout_count; |
|---|
| 343 | + u64 tx_ipsec; |
|---|
| 341 | 344 | |
|---|
| 342 | 345 | /* RX */ |
|---|
| 343 | 346 | int num_rx_queues; |
|---|
| .. | .. |
|---|
| 348 | 351 | u64 alloc_rx_page_failed; |
|---|
| 349 | 352 | u64 alloc_rx_buff_failed; |
|---|
| 350 | 353 | u64 alloc_rx_page; |
|---|
| 354 | + u64 rx_ipsec; |
|---|
| 351 | 355 | |
|---|
| 352 | 356 | struct msix_entry *msix_entries; |
|---|
| 353 | 357 | |
|---|
| .. | .. |
|---|
| 384 | 388 | u8 rss_indir_tbl[IXGBEVF_X550_VFRETA_SIZE]; |
|---|
| 385 | 389 | u32 flags; |
|---|
| 386 | 390 | #define IXGBEVF_FLAGS_LEGACY_RX BIT(1) |
|---|
| 391 | + |
|---|
| 392 | +#ifdef CONFIG_XFRM |
|---|
| 393 | + struct ixgbevf_ipsec *ipsec; |
|---|
| 394 | +#endif /* CONFIG_XFRM */ |
|---|
| 387 | 395 | }; |
|---|
| 388 | 396 | |
|---|
| 389 | 397 | enum ixbgevf_state_t { |
|---|
| .. | .. |
|---|
| 432 | 440 | |
|---|
| 433 | 441 | /* needed by ethtool.c */ |
|---|
| 434 | 442 | extern const char ixgbevf_driver_name[]; |
|---|
| 435 | | -extern const char ixgbevf_driver_version[]; |
|---|
| 436 | 443 | |
|---|
| 437 | 444 | int ixgbevf_open(struct net_device *netdev); |
|---|
| 438 | 445 | int ixgbevf_close(struct net_device *netdev); |
|---|
| .. | .. |
|---|
| 451 | 458 | |
|---|
| 452 | 459 | extern void ixgbevf_write_eitr(struct ixgbevf_q_vector *q_vector); |
|---|
| 453 | 460 | |
|---|
| 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 | + |
|---|
| 454 | 486 | void ixgbe_napi_add_all(struct ixgbevf_adapter *adapter); |
|---|
| 455 | 487 | void ixgbe_napi_del_all(struct ixgbevf_adapter *adapter); |
|---|
| 456 | 488 | |
|---|