* [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx @ 2017-10-27 17:08 Atul Gupta 2017-10-27 17:08 ` [PATCH net-next 2/2] chcr: Add support for Inline IPSec Atul Gupta 2017-10-28 23:15 ` [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx kbuild test robot 0 siblings, 2 replies; 5+ messages in thread From: Atul Gupta @ 2017-10-27 17:08 UTC (permalink / raw) To: netdev, davem, steffen.klassert, herbert, linux-crypto; +Cc: Ganesh Goudar Added Tx routine for ULD - define interface for ULD Tx. Export routines used for Tx data - Routines common for data transmit are used by cxgb4 and chcr drivers. - EXPORT routines enable transmit from chcr driver. Signed-off-by: Atul Gupta <atul.gupta@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 23 +++++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 2 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 3 + drivers/net/ethernet/chelsio/cxgb4/sge.c | 101 ++++++++++----------- 6 files changed, 80 insertions(+), 52 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 92a0b02..ee3832a 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h @@ -58,6 +58,13 @@ extern struct list_head adapter_list; extern struct mutex uld_mutex; +/* Suspend an Ethernet Tx queue with fewer available descriptors than this. + * This is the same as calc_tx_descs() for a TSO packet with + * nr_frags == MAX_SKB_FRAGS. + */ +#define ETHTXQ_STOP_THRES \ + (1 + DIV_ROUND_UP((3 * MAX_SKB_FRAGS) / 2 + (MAX_SKB_FRAGS & 1), 8)) + enum { MAX_NPORTS = 4, /* max # of ports */ SERNUM_LEN = 24, /* Serial # length */ @@ -555,6 +562,7 @@ enum { /* adapter flags */ enum { ULP_CRYPTO_LOOKASIDE = 1 << 0, + ULP_CRYPTO_IPSEC_INLINE = 1 << 1, }; struct rx_sw_desc; @@ -957,6 +965,11 @@ enum { SCHED_CLASS_RATEMODE_ABS = 1, /* Kb/s */ }; +struct tx_sw_desc { /* SW state per Tx descriptor */ + struct sk_buff *skb; + struct ulptx_sgl *sgl; +}; + /* Support for "sched_queue" command to allow one or more NIC TX Queues * to be bound to a TX Scheduling Class. */ @@ -1662,4 +1675,14 @@ void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, void free_tx_desc(struct adapter *adap, struct sge_txq *q, unsigned int n, bool unmap); void free_txq(struct adapter *adap, struct sge_txq *q); +inline void cxgb4_reclaim_completed_tx(struct adapter *adap, + struct sge_txq *q, bool unmap); +int cxgb4_map_skb(struct device *dev, const struct sk_buff *skb, + dma_addr_t *addr); +void cxgb4_inline_tx_skb(const struct sk_buff *skb, const struct sge_txq *q, + void *pos); +void cxgb4_write_sgl(const struct sk_buff *skb, struct sge_txq *q, + struct ulptx_sgl *sgl, u64 *end, unsigned int start, + const dma_addr_t *addr); +inline void cxgb4_ring_tx_db(struct adapter *adap, struct sge_txq *q, int n); #endif /* __CXGB4_H__ */ diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c index 917663b..cf47183 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c @@ -3096,6 +3096,8 @@ static int chcr_show(struct seq_file *seq, void *v) atomic_read(&adap->chcr_stats.error)); seq_printf(seq, "Fallback: %10u \n", atomic_read(&adap->chcr_stats.fallback)); + seq_printf(seq, "IPSec PDU: %10u\n", + atomic_read(&adap->chcr_stats.ipsec_cnt)); return 0; } diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index e16078d..538a8a7 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -4079,7 +4079,7 @@ static int adap_init0(struct adapter *adap) } else { adap->vres.ncrypto_fc = val[0]; } - adap->params.crypto |= ULP_CRYPTO_LOOKASIDE; + adap->params.crypto = ntohs(caps_cmd.cryptocaps); adap->num_uld += 1; } #undef FW_PARAM_PFVF diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c index 71a315b..6b5fea4 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c @@ -637,6 +637,7 @@ static void uld_init(struct adapter *adap, struct cxgb4_lld_info *lld) lld->nchan = adap->params.nports; lld->nports = adap->params.nports; lld->wr_cred = adap->params.ofldq_wr_cred; + lld->crypto = adap->params.crypto; lld->iscsi_iolen = MAXRXDATA_G(t4_read_reg(adap, TP_PARA_REG2_A)); lld->iscsi_tagmask = t4_read_reg(adap, ULP_RX_ISCSI_TAGMASK_A); lld->iscsi_pgsz_order = t4_read_reg(adap, ULP_RX_ISCSI_PSZ_A); diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h index 52324c7..879b4c6 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h @@ -295,6 +295,7 @@ struct chcr_stats_debug { atomic_t complete; atomic_t error; atomic_t fallback; + atomic_t ipsec_cnt; }; #define OCQ_WIN_OFFSET(pdev, vres) \ @@ -320,6 +321,7 @@ struct cxgb4_lld_info { unsigned char wr_cred; /* WR 16-byte credits */ unsigned char adapter_type; /* type of adapter */ unsigned char fw_api_ver; /* FW API version */ + unsigned char crypto; /* crypto support */ unsigned int fw_vers; /* FW version */ unsigned int iscsi_iolen; /* iSCSI max I/O length */ unsigned int cclk_ps; /* Core clock period in psec */ @@ -368,6 +370,7 @@ struct cxgb4_uld_info { struct t4_lro_mgr *lro_mgr, struct napi_struct *napi); void (*lro_flush)(struct t4_lro_mgr *); + int (*tx_handler)(struct sk_buff *skb, struct net_device *dev); }; int cxgb4_register_uld(enum cxgb4_uld type, const struct cxgb4_uld_info *p); diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 4ef68f6..833d498 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -41,6 +41,7 @@ #include <linux/jiffies.h> #include <linux/prefetch.h> #include <linux/export.h> +#include <net/xfrm.h> #include <net/ipv6.h> #include <net/tcp.h> #include <net/busy_poll.h> @@ -53,6 +54,7 @@ #include "t4_msg.h" #include "t4fw_api.h" #include "cxgb4_ptp.h" +#include "cxgb4_uld.h" /* * Rx buffer size. We use largish buffers if possible but settle for single @@ -110,14 +112,6 @@ #define NOMEM_TMR_IDX (SGE_NTIMERS - 1) /* - * Suspend an Ethernet Tx queue with fewer available descriptors than this. - * This is the same as calc_tx_descs() for a TSO packet with - * nr_frags == MAX_SKB_FRAGS. - */ -#define ETHTXQ_STOP_THRES \ - (1 + DIV_ROUND_UP((3 * MAX_SKB_FRAGS) / 2 + (MAX_SKB_FRAGS & 1), 8)) - -/* * Suspension threshold for non-Ethernet Tx queues. We require enough room * for a full sized WR. */ @@ -134,11 +128,6 @@ */ #define MAX_CTRL_WR_LEN SGE_MAX_WR_LEN -struct tx_sw_desc { /* SW state per Tx descriptor */ - struct sk_buff *skb; - struct ulptx_sgl *sgl; -}; - struct rx_sw_desc { /* SW state per Rx descriptor */ struct page *page; dma_addr_t dma_addr; @@ -248,8 +237,8 @@ static inline bool fl_starving(const struct adapter *adapter, return fl->avail - fl->pend_cred <= s->fl_starve_thres; } -static int map_skb(struct device *dev, const struct sk_buff *skb, - dma_addr_t *addr) +int cxgb4_map_skb(struct device *dev, const struct sk_buff *skb, + dma_addr_t *addr) { const skb_frag_t *fp, *end; const struct skb_shared_info *si; @@ -277,6 +266,7 @@ static int map_skb(struct device *dev, const struct sk_buff *skb, out_err: return -ENOMEM; } +EXPORT_SYMBOL(cxgb4_map_skb); #ifdef CONFIG_NEED_DMA_MAP_STATE static void unmap_skb(struct device *dev, const struct sk_buff *skb, @@ -411,7 +401,7 @@ static inline int reclaimable(const struct sge_txq *q) } /** - * reclaim_completed_tx - reclaims completed Tx descriptors + * cxgb4_reclaim_completed_tx - reclaims completed Tx descriptors * @adap: the adapter * @q: the Tx queue to reclaim completed descriptors from * @unmap: whether the buffers should be unmapped for DMA @@ -420,7 +410,7 @@ static inline int reclaimable(const struct sge_txq *q) * and frees the associated buffers if possible. Called with the Tx * queue locked. */ -static inline void reclaim_completed_tx(struct adapter *adap, struct sge_txq *q, +inline void cxgb4_reclaim_completed_tx(struct adapter *adap, struct sge_txq *q, bool unmap) { int avail = reclaimable(q); @@ -437,6 +427,7 @@ static inline void reclaim_completed_tx(struct adapter *adap, struct sge_txq *q, q->in_use -= avail; } } +EXPORT_SYMBOL(cxgb4_reclaim_completed_tx); static inline int get_buf_size(struct adapter *adapter, const struct rx_sw_desc *d) @@ -833,7 +824,7 @@ static inline unsigned int calc_tx_descs(const struct sk_buff *skb) } /** - * write_sgl - populate a scatter/gather list for a packet + * cxgb4_write_sgl - populate a scatter/gather list for a packet * @skb: the packet * @q: the Tx queue we are writing into * @sgl: starting location for writing the SGL @@ -849,9 +840,9 @@ static inline unsigned int calc_tx_descs(const struct sk_buff *skb) * right after the end of the SGL but does not account for any potential * wrap around, i.e., @end > @sgl. */ -static void write_sgl(const struct sk_buff *skb, struct sge_txq *q, - struct ulptx_sgl *sgl, u64 *end, unsigned int start, - const dma_addr_t *addr) +void cxgb4_write_sgl(const struct sk_buff *skb, struct sge_txq *q, + struct ulptx_sgl *sgl, u64 *end, unsigned int start, + const dma_addr_t *addr) { unsigned int i, len; struct ulptx_sge_pair *to; @@ -903,6 +894,7 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *q, if ((uintptr_t)end & 8) /* 0-pad to multiple of 16 */ *end = 0; } +EXPORT_SYMBOL(cxgb4_write_sgl); /* This function copies 64 byte coalesced work request to * memory mapped BAR2 space. For coalesced WR SGE fetches @@ -921,14 +913,14 @@ static void cxgb_pio_copy(u64 __iomem *dst, u64 *src) } /** - * ring_tx_db - check and potentially ring a Tx queue's doorbell + * cxgb4_ring_tx_db - check and potentially ring a Tx queue's doorbell * @adap: the adapter * @q: the Tx queue * @n: number of new descriptors to give to HW * * Ring the doorbel for a Tx queue. */ -static inline void ring_tx_db(struct adapter *adap, struct sge_txq *q, int n) +inline void cxgb4_ring_tx_db(struct adapter *adap, struct sge_txq *q, int n) { /* Make sure that all writes to the TX Descriptors are committed * before we tell the hardware about them. @@ -995,9 +987,10 @@ static inline void ring_tx_db(struct adapter *adap, struct sge_txq *q, int n) wmb(); } } +EXPORT_SYMBOL(cxgb4_ring_tx_db); /** - * inline_tx_skb - inline a packet's data into Tx descriptors + * cxgb4_inline_tx_skb - inline a packet's data into Tx descriptors * @skb: the packet * @q: the Tx queue where the packet will be inlined * @pos: starting position in the Tx queue where to inline the packet @@ -1007,8 +1000,8 @@ static inline void ring_tx_db(struct adapter *adap, struct sge_txq *q, int n) * Most of the complexity of this operation is dealing with wrap arounds * in the middle of the packet we want to inline. */ -static void inline_tx_skb(const struct sk_buff *skb, const struct sge_txq *q, - void *pos) +void cxgb4_inline_tx_skb(const struct sk_buff *skb, + const struct sge_txq *q, void *pos) { u64 *p; int left = (void *)q->stat - pos; @@ -1030,6 +1023,7 @@ static void inline_tx_skb(const struct sk_buff *skb, const struct sge_txq *q, if ((uintptr_t)p & 8) *p = 0; } +EXPORT_SYMBOL(cxgb4_inline_tx_skb); static void *inline_tx_skb_header(const struct sk_buff *skb, const struct sge_txq *q, void *pos, @@ -1199,6 +1193,11 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev) pi = netdev_priv(dev); adap = pi->adapter; + ssi = skb_shinfo(skb); + + if (xfrm_offload(skb) && !ssi->gso_size) + return adap->uld[CXGB4_ULD_CRYPTO].tx_handler(skb, dev); + qidx = skb_get_queue_mapping(skb); if (ptp_enabled) { spin_lock(&adap->ptp_lock); @@ -1215,7 +1214,7 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev) } skb_tx_timestamp(skb); - reclaim_completed_tx(adap, &q->q, true); + cxgb4_reclaim_completed_tx(adap, &q->q, true); cntrl = TXPKT_L4CSUM_DIS_F | TXPKT_IPCSUM_DIS_F; #ifdef CONFIG_CHELSIO_T4_FCOE @@ -1245,7 +1244,7 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev) immediate = true; if (!immediate && - unlikely(map_skb(adap->pdev_dev, skb, addr) < 0)) { + unlikely(cxgb4_map_skb(adap->pdev_dev, skb, addr) < 0)) { q->mapping_err++; if (ptp_enabled) spin_unlock(&adap->ptp_lock); @@ -1264,7 +1263,6 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev) end = (u64 *)wr + flits; len = immediate ? skb->len : 0; - ssi = skb_shinfo(skb); if (ssi->gso_size) { struct cpl_tx_pkt_lso *lso = (void *)wr; bool v6 = (ssi->gso_type & SKB_GSO_TCPV6) != 0; @@ -1341,13 +1339,13 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev) cpl->ctrl1 = cpu_to_be64(cntrl); if (immediate) { - inline_tx_skb(skb, &q->q, cpl + 1); + cxgb4_inline_tx_skb(skb, &q->q, cpl + 1); dev_consume_skb_any(skb); } else { int last_desc; - write_sgl(skb, &q->q, (struct ulptx_sgl *)(cpl + 1), end, 0, - addr); + cxgb4_write_sgl(skb, &q->q, (struct ulptx_sgl *)(cpl + 1), + end, 0, addr); skb_orphan(skb); last_desc = q->q.pidx + ndesc - 1; @@ -1359,7 +1357,7 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev) txq_advance(&q->q, ndesc); - ring_tx_db(adap, &q->q, ndesc); + cxgb4_ring_tx_db(adap, &q->q, ndesc); if (ptp_enabled) spin_unlock(&adap->ptp_lock); return NETDEV_TX_OK; @@ -1369,9 +1367,9 @@ netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev) * reclaim_completed_tx_imm - reclaim completed control-queue Tx descs * @q: the SGE control Tx queue * - * This is a variant of reclaim_completed_tx() that is used for Tx queues - * that send only immediate data (presently just the control queues) and - * thus do not have any sk_buffs to release. + * This is a variant of cxgb4_reclaim_completed_tx() that is used + * for Tx queues that send only immediate data (presently just + * the control queues) and thus do not have any sk_buffs to release. */ static inline void reclaim_completed_tx_imm(struct sge_txq *q) { @@ -1446,13 +1444,13 @@ static int ctrl_xmit(struct sge_ctrl_txq *q, struct sk_buff *skb) } wr = (struct fw_wr_hdr *)&q->q.desc[q->q.pidx]; - inline_tx_skb(skb, &q->q, wr); + cxgb4_inline_tx_skb(skb, &q->q, wr); txq_advance(&q->q, ndesc); if (unlikely(txq_avail(&q->q) < TXQ_STOP_THRES)) ctrlq_check_stop(q, wr); - ring_tx_db(q->adap, &q->q, ndesc); + cxgb4_ring_tx_db(q->adap, &q->q, ndesc); spin_unlock(&q->sendq.lock); kfree_skb(skb); @@ -1487,7 +1485,7 @@ static void restart_ctrlq(unsigned long data) txq_advance(&q->q, ndesc); spin_unlock(&q->sendq.lock); - inline_tx_skb(skb, &q->q, wr); + cxgb4_inline_tx_skb(skb, &q->q, wr); kfree_skb(skb); if (unlikely(txq_avail(&q->q) < TXQ_STOP_THRES)) { @@ -1500,14 +1498,15 @@ static void restart_ctrlq(unsigned long data) } } if (written > 16) { - ring_tx_db(q->adap, &q->q, written); + cxgb4_ring_tx_db(q->adap, &q->q, written); written = 0; } spin_lock(&q->sendq.lock); } q->full = 0; -ringdb: if (written) - ring_tx_db(q->adap, &q->q, written); +ringdb: + if (written) + cxgb4_ring_tx_db(q->adap, &q->q, written); spin_unlock(&q->sendq.lock); } @@ -1644,7 +1643,7 @@ static void service_ofldq(struct sge_uld_txq *q) */ spin_unlock(&q->sendq.lock); - reclaim_completed_tx(q->adap, &q->q, false); + cxgb4_reclaim_completed_tx(q->adap, &q->q, false); flits = skb->priority; /* previously saved */ ndesc = flits_to_desc(flits); @@ -1655,9 +1654,9 @@ static void service_ofldq(struct sge_uld_txq *q) pos = (u64 *)&q->q.desc[q->q.pidx]; if (is_ofld_imm(skb)) - inline_tx_skb(skb, &q->q, pos); - else if (map_skb(q->adap->pdev_dev, skb, - (dma_addr_t *)skb->head)) { + cxgb4_inline_tx_skb(skb, &q->q, pos); + else if (cxgb4_map_skb(q->adap->pdev_dev, skb, + (dma_addr_t *)skb->head)) { txq_stop_maperr(q); spin_lock(&q->sendq.lock); break; @@ -1688,9 +1687,9 @@ static void service_ofldq(struct sge_uld_txq *q) pos = (void *)txq->desc; } - write_sgl(skb, &q->q, (void *)pos, - end, hdr_len, - (dma_addr_t *)skb->head); + cxgb4_write_sgl(skb, &q->q, (void *)pos, + end, hdr_len, + (dma_addr_t *)skb->head); #ifdef CONFIG_NEED_DMA_MAP_STATE skb->dev = q->adap->port[0]; skb->destructor = deferred_unmap_destructor; @@ -1704,7 +1703,7 @@ static void service_ofldq(struct sge_uld_txq *q) txq_advance(&q->q, ndesc); written += ndesc; if (unlikely(written > 32)) { - ring_tx_db(q->adap, &q->q, written); + cxgb4_ring_tx_db(q->adap, &q->q, written); written = 0; } @@ -1719,7 +1718,7 @@ static void service_ofldq(struct sge_uld_txq *q) kfree_skb(skb); } if (likely(written)) - ring_tx_db(q->adap, &q->q, written); + cxgb4_ring_tx_db(q->adap, &q->q, written); /*Indicate that no thread is processing the Pending Send Queue * currently. -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next 2/2] chcr: Add support for Inline IPSec 2017-10-27 17:08 [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx Atul Gupta @ 2017-10-27 17:08 ` Atul Gupta 2017-10-28 23:35 ` kbuild test robot 2017-10-29 6:00 ` kbuild test robot 2017-10-28 23:15 ` [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx kbuild test robot 1 sibling, 2 replies; 5+ messages in thread From: Atul Gupta @ 2017-10-27 17:08 UTC (permalink / raw) To: netdev, davem, steffen.klassert, herbert, linux-crypto Cc: Harsh Jain, Ganesh Goudar register xfrmdev_ops callbacks, Send IPsec tunneled data to HW for inline processing. The driver use hardware crypto accelerator to encrypt and generate ICV for the transmitted packet in Inline mode. Signed-off-by: Atul Gupta <atul.gupta@chelsio.com> Signed-off-by: Harsh Jain <harsh@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> --- drivers/crypto/chelsio/Makefile | 2 +- drivers/crypto/chelsio/chcr_algo.c | 45 ++- drivers/crypto/chelsio/chcr_algo.h | 17 - drivers/crypto/chelsio/chcr_core.c | 8 + drivers/crypto/chelsio/chcr_core.h | 39 +++ drivers/crypto/chelsio/chcr_crypto.h | 17 +- drivers/crypto/chelsio/chcr_ipsec.c | 659 +++++++++++++++++++++++++++++++++++ 7 files changed, 740 insertions(+), 47 deletions(-) create mode 100644 drivers/crypto/chelsio/chcr_ipsec.c diff --git a/drivers/crypto/chelsio/Makefile b/drivers/crypto/chelsio/Makefile index bebdf06..9056420 100644 --- a/drivers/crypto/chelsio/Makefile +++ b/drivers/crypto/chelsio/Makefile @@ -1,4 +1,4 @@ ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb4 obj-$(CONFIG_CRYPTO_DEV_CHELSIO) += chcr.o -chcr-objs := chcr_core.o chcr_algo.o +chcr-objs := chcr_core.o chcr_algo.o chcr_ipsec.o diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 0e81607..060f747 100644 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto/chelsio/chcr_algo.c @@ -70,6 +70,29 @@ #include "chcr_algo.h" #include "chcr_crypto.h" +unsigned int sgl_ent_len[] = {0, 0, 16, 24, 40, + 48, 64, 72, 88, + 96, 112, 120, 136, + 144, 160, 168, 184, 192}; + +unsigned int dsgl_ent_len[] = {0, 32, 32, 48, 48, 64, 64, 80, 80, + 112, 112, 128, 128, 144, 144, 160, 160, + 192, 192, 208, 208, 224, 224, 240, 240, + 272, 272, 288, 288, 304, 304, 320, 320}; + +static u32 round_constant[11] = { + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x1B000000, 0x36000000, 0x6C000000 +}; + +static int is_newsg(struct scatterlist *sgl, unsigned int *newents); +static struct scatterlist *alloc_new_sg(struct scatterlist *sgl, + unsigned int nents); +static inline void free_new_sg(struct scatterlist *sgl); +static int chcr_handle_cipher_resp(struct ablkcipher_request *req, + unsigned char *input, int err); + static inline struct chcr_aead_ctx *AEAD_CTX(struct chcr_context *ctx) { return ctx->crypto_ctx->aeadctx; @@ -105,18 +128,6 @@ static inline int is_ofld_imm(const struct sk_buff *skb) return (skb->len <= CRYPTO_MAX_IMM_TX_PKT_LEN); } -/* - * sgl_len - calculates the size of an SGL of the given capacity - * @n: the number of SGL entries - * Calculates the number of flits needed for a scatter/gather list that - * can hold the given number of entries. - */ -static inline unsigned int sgl_len(unsigned int n) -{ - n--; - return (3 * n) / 2 + (n & 1) + 2; -} - static void chcr_verify_tag(struct aead_request *req, u8 *input, int *err) { u8 temp[SHA512_DIGEST_SIZE]; @@ -432,7 +443,7 @@ static inline int map_writesg_phys_cpl(struct device *dev, return 0; } -static inline int get_aead_subtype(struct crypto_aead *aead) +inline int get_aead_subtype(struct crypto_aead *aead) { struct aead_alg *alg = crypto_aead_alg(aead); struct chcr_alg_template *chcr_crypto_alg = @@ -3134,10 +3145,10 @@ static int chcr_aead_decrypt(struct aead_request *req) } } -static int chcr_aead_op(struct aead_request *req, - unsigned short op_type, - int size, - create_wr_t create_wr_fn) +int chcr_aead_op(struct aead_request *req, + unsigned short op_type, + int size, + create_wr_t create_wr_fn) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct chcr_context *ctx = crypto_aead_ctx(tfm); diff --git a/drivers/crypto/chelsio/chcr_algo.h b/drivers/crypto/chelsio/chcr_algo.h index 583008d..a5f5b19 100644 --- a/drivers/crypto/chelsio/chcr_algo.h +++ b/drivers/crypto/chelsio/chcr_algo.h @@ -217,7 +217,6 @@ ULP_TX_SC_MORE_V((immdatalen) ? 0 : 1)) #define MAX_NK 8 -#define CRYPTO_MAX_IMM_TX_PKT_LEN 256 #define MAX_WR_SIZE 512 #define ROUND_16(bytes) ((bytes) & 0xFFFFFFF0) #define MAX_DSGL_ENT 32 @@ -230,16 +229,6 @@ #define SPACE_LEFT(len) \ ((MAX_WR_SIZE - WR_MIN_LEN - (len))) -unsigned int sgl_ent_len[] = {0, 0, 16, 24, 40, - 48, 64, 72, 88, - 96, 112, 120, 136, - 144, 160, 168, 184, - 192}; -unsigned int dsgl_ent_len[] = {0, 32, 32, 48, 48, 64, 64, 80, 80, - 112, 112, 128, 128, 144, 144, 160, 160, - 192, 192, 208, 208, 224, 224, 240, 240, - 272, 272, 288, 288, 304, 304, 320, 320}; - struct algo_param { unsigned int auth_mode; unsigned int mk_size; @@ -431,10 +420,4 @@ static inline u32 aes_ks_subword(const u32 w) return *(u32 *)(&bytes[0]); } -static u32 round_constant[11] = { - 0x01000000, 0x02000000, 0x04000000, 0x08000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x1B000000, 0x36000000, 0x6C000000 -}; - #endif /* __CHCR_ALGO_H__ */ diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index b6dd9cb..65634e1 100644 --- a/drivers/crypto/chelsio/chcr_core.c +++ b/drivers/crypto/chelsio/chcr_core.c @@ -48,6 +48,7 @@ .add = chcr_uld_add, .state_change = chcr_uld_state_change, .rx_handler = chcr_uld_rx_handler, + .tx_handler = chcr_uld_tx_handler, }; struct uld_ctx *assign_chcr_device(void) @@ -164,6 +165,8 @@ static void *chcr_uld_add(const struct cxgb4_lld_info *lld) goto out; } u_ctx->lldi = *lld; + if (lld->crypto & ULP_CRYPTO_IPSEC_INLINE) + chcr_add_xfrmops(lld); out: return u_ctx; } @@ -187,6 +190,11 @@ int chcr_uld_rx_handler(void *handle, const __be64 *rsp, return 0; } +int chcr_uld_tx_handler(struct sk_buff *skb, struct net_device *dev) +{ + return chcr_ipsec_xmit(skb, dev); +} + static int chcr_uld_state_change(void *handle, enum cxgb4_state state) { struct uld_ctx *u_ctx = handle; diff --git a/drivers/crypto/chelsio/chcr_core.h b/drivers/crypto/chelsio/chcr_core.h index c9a19b2..d081fe0 100644 --- a/drivers/crypto/chelsio/chcr_core.h +++ b/drivers/crypto/chelsio/chcr_core.h @@ -39,6 +39,7 @@ #include <crypto/algapi.h> #include "t4_hw.h" #include "cxgb4.h" +#include "t4_msg.h" #include "cxgb4_uld.h" #define DRV_MODULE_NAME "chcr" @@ -46,6 +47,7 @@ #define MAX_PENDING_REQ_TO_HW 20 #define CHCR_TEST_RESPONSE_TIMEOUT 1000 +#define CRYPTO_MAX_IMM_TX_PKT_LEN 256 #define PAD_ERROR_BIT 1 #define CHK_PAD_ERR_BIT(x) (((x) >> PAD_ERROR_BIT) & 1) @@ -76,6 +78,28 @@ struct chcr_wr { struct _key_ctx key_ctx; }; +struct chcr_ipsec_req { + struct ulp_txpkt ulptx; + struct ulptx_idata sc_imm; + struct cpl_tx_sec_pdu sec_cpl; + struct _key_ctx key_ctx; +}; + +struct chcr_ipsec_wr { + struct fw_ulptx_wr wreq; + struct chcr_ipsec_req req; +}; + +struct ipsec_sa_entry { + int hmac_ctrl; + unsigned int enckey_len; + unsigned int kctx_len; + unsigned int authsize; + __be32 key_ctx_hdr; + char salt[MAX_SALT]; + char key[2 * AES_MAX_KEY_SIZE]; +}; + struct chcr_dev { spinlock_t lock_chcr_dev; struct uld_ctx *u_ctx; @@ -89,12 +113,27 @@ struct uld_ctx { struct chcr_dev *dev; }; +/* + * sgl_len - calculates the size of an SGL of the given capacity + * @n: the number of SGL entries + * Calculates the number of flits needed for a scatter/gather list that + * can hold the given number of entries. + */ +static inline unsigned int sgl_len(unsigned int n) +{ + n--; + return (3 * n) / 2 + (n & 1) + 2; +} + struct uld_ctx * assign_chcr_device(void); int chcr_send_wr(struct sk_buff *skb); int start_crypto(void); int stop_crypto(void); int chcr_uld_rx_handler(void *handle, const __be64 *rsp, const struct pkt_gl *pgl); +int chcr_uld_tx_handler(struct sk_buff *skb, struct net_device *dev); int chcr_handle_resp(struct crypto_async_request *req, unsigned char *input, int err); +int chcr_ipsec_xmit(struct sk_buff *skb, struct net_device *dev); +void chcr_add_xfrmops(const struct cxgb4_lld_info *lld); #endif /* __CHCR_CORE_H__ */ diff --git a/drivers/crypto/chelsio/chcr_crypto.h b/drivers/crypto/chelsio/chcr_crypto.h index 30af1ee..f435b75 100644 --- a/drivers/crypto/chelsio/chcr_crypto.h +++ b/drivers/crypto/chelsio/chcr_crypto.h @@ -284,16 +284,9 @@ struct sge_opaque_hdr { unsigned short qid, int size, unsigned short op_type); - -static int chcr_aead_op(struct aead_request *req_base, - unsigned short op_type, - int size, - create_wr_t create_wr_fn); -static inline int get_aead_subtype(struct crypto_aead *aead); -static int is_newsg(struct scatterlist *sgl, unsigned int *newents); -static struct scatterlist *alloc_new_sg(struct scatterlist *sgl, - unsigned int nents); -static inline void free_new_sg(struct scatterlist *sgl); -static int chcr_handle_cipher_resp(struct ablkcipher_request *req, - unsigned char *input, int err); +int chcr_aead_op(struct aead_request *req_base, + unsigned short op_type, + int size, + create_wr_t create_wr_fn); +inline int get_aead_subtype(struct crypto_aead *aead); #endif /* __CHCR_CRYPTO_H__ */ diff --git a/drivers/crypto/chelsio/chcr_ipsec.c b/drivers/crypto/chelsio/chcr_ipsec.c new file mode 100644 index 0000000..4b5df88 --- /dev/null +++ b/drivers/crypto/chelsio/chcr_ipsec.c @@ -0,0 +1,659 @@ +/* + * This file is part of the Chelsio T6 Crypto driver for Linux. + * + * Copyright (c) 2003-2017 Chelsio Communications, Inc. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Written and Maintained by: + * Atul Gupta (atul.gupta@chelsio.com) + */ + +#define pr_fmt(fmt) "chcr:" fmt + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/crypto.h> +#include <linux/cryptohash.h> +#include <linux/skbuff.h> +#include <linux/rtnetlink.h> +#include <linux/highmem.h> +#include <linux/if_vlan.h> +#include <linux/ip.h> +#include <linux/netdevice.h> +#include <net/esp.h> +#include <net/xfrm.h> +#include <crypto/aes.h> +#include <crypto/algapi.h> +#include <crypto/hash.h> +#include <crypto/sha.h> +#include <crypto/authenc.h> +#include <crypto/internal/aead.h> +#include <crypto/null.h> +#include <crypto/internal/skcipher.h> +#include <crypto/aead.h> +#include <crypto/scatterwalk.h> +#include <crypto/internal/hash.h> + +#include "chcr_core.h" +#include "chcr_algo.h" +#include "chcr_crypto.h" + +/* + * Max Tx descriptor space we allow for an Ethernet packet to be inlined + * into a WR. + */ +#define MAX_IMM_TX_PKT_LEN 256 +#define GCM_ESP_IV_SIZE 8 + +static int chcr_xfrm_add_state(struct xfrm_state *x); +static void chcr_xfrm_del_state(struct xfrm_state *x); +static void chcr_xfrm_free_state(struct xfrm_state *x); +static bool chcr_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *x); + +static const struct xfrmdev_ops chcr_xfrmdev_ops = { + .xdo_dev_state_add = chcr_xfrm_add_state, + .xdo_dev_state_delete = chcr_xfrm_del_state, + .xdo_dev_state_free = chcr_xfrm_free_state, + .xdo_dev_offload_ok = chcr_ipsec_offload_ok, +}; + +/* Add offload xfrms to Chelsio Interface */ +void chcr_add_xfrmops(const struct cxgb4_lld_info *lld) +{ + struct net_device *netdev = NULL; + int i; + + for (i = 0; i < lld->nports; i++) { + netdev = lld->ports[i]; + if (!netdev) + continue; + netdev->xfrmdev_ops = &chcr_xfrmdev_ops; + netdev->hw_enc_features |= NETIF_F_HW_ESP; + netdev->features |= NETIF_F_HW_ESP; + rtnl_lock(); + netdev_change_features(netdev); + rtnl_unlock(); + } +} + +static inline int chcr_ipsec_setauthsize(struct xfrm_state *x, + struct ipsec_sa_entry *sa_entry) +{ + int hmac_ctrl; + int authsize = x->aead->alg_icv_len / 8; + + sa_entry->authsize = authsize; + + switch (authsize) { + case ICV_8: + hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; + break; + case ICV_12: + hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; + break; + case ICV_16: + hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; + break; + default: + return -EINVAL; + } + return hmac_ctrl; +} + +static inline int chcr_ipsec_setkey(struct xfrm_state *x, + struct ipsec_sa_entry *sa_entry) +{ + struct crypto_cipher *cipher; + int keylen = (x->aead->alg_key_len + 7) / 8; + unsigned char *key = x->aead->alg_key; + int ck_size, key_ctx_size = 0; + unsigned char ghash_h[AEAD_H_SIZE]; + int ret = 0; + + if (keylen > 3) { + keylen -= 4; /* nonce/salt is present in the last 4 bytes */ + memcpy(sa_entry->salt, key + keylen, 4); + } + + if (keylen == AES_KEYSIZE_128) { + ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_128; + } else if (keylen == AES_KEYSIZE_192) { + ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_192; + } else if (keylen == AES_KEYSIZE_256) { + ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_256; + } else { + pr_err("GCM: Invalid key length %d\n", keylen); + ret = -EINVAL; + goto out; + } + + memcpy(sa_entry->key, key, keylen); + sa_entry->enckey_len = keylen; + key_ctx_size = sizeof(struct _key_ctx) + + ((DIV_ROUND_UP(keylen, 16)) << 4) + + AEAD_H_SIZE; + + sa_entry->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, + CHCR_KEYCTX_MAC_KEY_SIZE_128, + 0, 0, + key_ctx_size >> 4); + + /* Calculate the H = CIPH(K, 0 repeated 16 times). + * It will go in key context + */ + cipher = crypto_alloc_cipher("aes-generic", 0, 0); + if (IS_ERR(cipher)) { + sa_entry->enckey_len = 0; + ret = -ENOMEM; + goto out; + } + + ret = crypto_cipher_setkey(cipher, key, keylen); + if (ret) { + sa_entry->enckey_len = 0; + goto out1; + } + memset(ghash_h, 0, AEAD_H_SIZE); + crypto_cipher_encrypt_one(cipher, ghash_h, ghash_h); + memcpy(sa_entry->key + (DIV_ROUND_UP(sa_entry->enckey_len, 16) * + 16), ghash_h, AEAD_H_SIZE); + sa_entry->kctx_len = ((DIV_ROUND_UP(sa_entry->enckey_len, 16)) << 4) + + AEAD_H_SIZE; +out1: + crypto_free_cipher(cipher); +out: + return ret; +} + +/* + * chcr_xfrm_add_state + * returns 0 on success, negative error if failed to send message to FPGA + * positive error if FPGA returned a bad response + */ +static int chcr_xfrm_add_state(struct xfrm_state *x) +{ + struct net_device *netdev = x->xso.dev; + struct port_info *pi = netdev_priv(netdev); + struct ipsec_sa_entry *sa_entry; + struct adapter *adap; + int res = 0; + + adap = pi->adapter; + + if (x->props.aalgo != SADB_AALG_NONE) { + pr_debug("CHCR: Cannot offload authenticated xfrm states\n"); + return -EINVAL; + } + if (x->props.calgo != SADB_X_CALG_NONE) { + pr_debug("CHCR: Cannot offload compressed xfrm states\n"); + return -EINVAL; + } + if (x->props.flags & XFRM_STATE_ESN) { + pr_debug("CHCR: Cannot offload ESN xfrm states\n"); + return -EINVAL; + } + if (x->props.family != AF_INET && + x->props.family != AF_INET6) { + pr_debug("CHCR: Only IPv4/6 xfrm state offloaded\n"); + return -EINVAL; + } + if (x->props.mode != XFRM_MODE_TRANSPORT && + x->props.mode != XFRM_MODE_TUNNEL) { + pr_debug("CHCR: Only transport and tunnel xfrm offload\n"); + return -EINVAL; + } + if (x->id.proto != IPPROTO_ESP) { + pr_debug("CHCR: Only ESP xfrm state offloaded\n"); + return -EINVAL; + } + if (x->encap) { + pr_debug("CHCR: Encapsulated xfrm state not offloaded\n"); + return -EINVAL; + } + if (!x->aead) { + pr_debug("CHCR: Cannot offload xfrm states without aead\n"); + return -EINVAL; + } + if (x->aead->alg_icv_len != 128 && + x->aead->alg_icv_len != 96) { + pr_debug("CHCR: Cannot offload xfrm states with AEAD ICV length other than 96b & 128b\n"); + return -EINVAL; + } + if ((x->aead->alg_key_len != 128 + 32) && + (x->aead->alg_key_len != 256 + 32)) { + pr_debug("CHCR: Cannot offload xfrm states with AEAD key length other than 128/256 bit\n"); + return -EINVAL; + } + if (x->tfcpad) { + pr_debug("CHCR: Cannot offload xfrm states with tfc padding\n"); + return -EINVAL; + } + if (!x->geniv) { + pr_debug("CHCR: Cannot offload xfrm states without geniv\n"); + return -EINVAL; + } + if (strcmp(x->geniv, "seqiv")) { + pr_debug("CHCR: Cannot offload xfrm states with geniv other than seqiv\n"); + return -EINVAL; + } + + sa_entry = kzalloc(sizeof(*sa_entry), GFP_KERNEL); + if (!sa_entry) { + res = -ENOMEM; + goto out; + } + + sa_entry->hmac_ctrl = chcr_ipsec_setauthsize(x, sa_entry); + chcr_ipsec_setkey(x, sa_entry); + x->xso.offload_handle = (unsigned long)sa_entry; + try_module_get(THIS_MODULE); +out: + return res; +} + +static void chcr_xfrm_del_state(struct xfrm_state *x) +{ + /* do nothing */ + if (!x->xso.offload_handle) + return; +} + +static void chcr_xfrm_free_state(struct xfrm_state *x) +{ + struct ipsec_sa_entry *sa_entry; + + if (!x->xso.offload_handle) + return; + + sa_entry = (struct ipsec_sa_entry *)x->xso.offload_handle; + kfree(sa_entry); + module_put(THIS_MODULE); +} + +static bool chcr_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *x) +{ + /* Offload with IP options is not supported yet */ + if (ip_hdr(skb)->ihl > 5) + return false; + + return true; +} + +static inline int is_eth_imm(const struct sk_buff *skb, unsigned int kctx_len) +{ + int hdrlen = sizeof(struct chcr_ipsec_req) + kctx_len; + + hdrlen += sizeof(struct cpl_tx_pkt); + if (skb->len <= MAX_IMM_TX_PKT_LEN - hdrlen) + return hdrlen; + return 0; +} + +static inline unsigned int calc_tx_sec_flits(const struct sk_buff *skb, + unsigned int kctx_len) +{ + unsigned int flits; + int hdrlen = is_eth_imm(skb, kctx_len); + + /* If the skb is small enough, we can pump it out as a work request + * with only immediate data. In that case we just have to have the + * TX Packet header plus the skb data in the Work Request. + */ + + if (hdrlen) + return DIV_ROUND_UP(skb->len + hdrlen, sizeof(__be64)); + + flits = sgl_len(skb_shinfo(skb)->nr_frags + 1); + + /* Otherwise, we're going to have to construct a Scatter gather list + * of the skb body and fragments. We also include the flits necessary + * for the TX Packet Work Request and CPL. We always have a firmware + * Write Header (incorporated as part of the cpl_tx_pkt_lso and + * cpl_tx_pkt structures), followed by either a TX Packet Write CPL + * message or, if we're doing a Large Send Offload, an LSO CPL message + * with an embedded TX Packet Write CPL message. + */ + flits += (sizeof(struct fw_ulptx_wr) + + sizeof(struct chcr_ipsec_req) + + kctx_len + + sizeof(struct cpl_tx_pkt_core)) / sizeof(__be64); + return flits; +} + +inline void *copy_cpltx_pktxt(struct sk_buff *skb, + struct net_device *dev, + void *pos) +{ + struct adapter *adap; + struct port_info *pi; + struct sge_eth_txq *q; + struct cpl_tx_pkt_core *cpl; + u64 cntrl; + u32 ctrl0, qidx; + + pi = netdev_priv(dev); + adap = pi->adapter; + qidx = skb->queue_mapping; + q = &adap->sge.ethtxq[qidx + pi->first_qset]; + + cpl = (struct cpl_tx_pkt_core *)pos; + + if (skb->ip_summed == CHECKSUM_PARTIAL) + cntrl = TXPKT_L4CSUM_DIS_F | TXPKT_IPCSUM_DIS_F; + ctrl0 = TXPKT_OPCODE_V(CPL_TX_PKT_XT) | TXPKT_INTF_V(pi->tx_chan) | + TXPKT_PF_V(adap->pf); + if (skb_vlan_tag_present(skb)) { + q->vlan_ins++; + cntrl |= TXPKT_VLAN_VLD_F | TXPKT_VLAN_V(skb_vlan_tag_get(skb)); + } + + cpl->ctrl0 = htonl(ctrl0); + cpl->pack = htons(0); + cpl->len = htons(skb->len); + cpl->ctrl1 = cpu_to_be64(cntrl); + + pos += sizeof(struct cpl_tx_pkt_core); + return pos; +} + +inline void *copy_key_cpltx_pktxt(struct sk_buff *skb, + struct net_device *dev, + void *pos, + struct ipsec_sa_entry *sa_entry) +{ + struct adapter *adap; + struct port_info *pi; + struct sge_eth_txq *q; + unsigned int len, qidx; + struct _key_ctx *key_ctx; + int left, eoq, key_len; + + pi = netdev_priv(dev); + adap = pi->adapter; + qidx = skb->queue_mapping; + q = &adap->sge.ethtxq[qidx + pi->first_qset]; + len = sa_entry->enckey_len + sizeof(struct cpl_tx_pkt_core); + key_len = sa_entry->kctx_len; + + /* end of queue, reset pos to start of queue */ + eoq = (void *)q->q.stat - pos; + left = eoq; + if (!eoq) { + pos = q->q.desc; + left = 64 * q->q.size; + } + + /* Copy the Key context header */ + key_ctx = (struct _key_ctx *)pos; + key_ctx->ctx_hdr = sa_entry->key_ctx_hdr; + memcpy(key_ctx->salt, sa_entry->salt, MAX_SALT); + pos += sizeof(struct _key_ctx); + left -= sizeof(struct _key_ctx); + + if (likely(len <= left)) { + memcpy(key_ctx->key, sa_entry->key, key_len); + pos += key_len; + } else { + if (key_len <= left) { + memcpy(pos, sa_entry->key, key_len); + pos += key_len; + } else { + memcpy(pos, sa_entry->key, left); + memcpy(q->q.desc, sa_entry->key + left, + key_len - left); + pos = q->q.desc + (key_len - left); + } + } + /* Copy CPL TX PKT XT */ + pos = copy_cpltx_pktxt(skb, dev, pos); + + return pos; +} + +inline void *chcr_crypto_wreq(struct sk_buff *skb, + struct net_device *dev, + void *pos, + int credits, + struct ipsec_sa_entry *sa_entry) +{ + struct port_info *pi = netdev_priv(dev); + struct adapter *adap = pi->adapter; + unsigned int immdatalen = 0; + unsigned int ivsize = GCM_ESP_IV_SIZE; + struct chcr_ipsec_wr *wr; + unsigned int flits; + u32 wr_mid; + int qidx = skb_get_queue_mapping(skb); + struct sge_eth_txq *q = &adap->sge.ethtxq[qidx + pi->first_qset]; + unsigned int kctx_len = sa_entry->kctx_len; + int qid = q->q.cntxt_id; + + atomic_inc(&adap->chcr_stats.ipsec_cnt); + + flits = calc_tx_sec_flits(skb, kctx_len); + + if (is_eth_imm(skb, kctx_len)) + immdatalen = skb->len; + + /* WR Header */ + wr = (struct chcr_ipsec_wr *)pos; + wr->wreq.op_to_compl = htonl(FW_WR_OP_V(FW_ULPTX_WR)); + wr_mid = FW_CRYPTO_LOOKASIDE_WR_LEN16_V(DIV_ROUND_UP(flits, 2)); + + if (unlikely(credits < ETHTXQ_STOP_THRES)) { + netif_tx_stop_queue(q->txq); + q->q.stops++; + wr_mid |= FW_WR_EQUEQ_F | FW_WR_EQUIQ_F; + } + wr->wreq.flowid_len16 = htonl(wr_mid); + + /* ULPTX */ + wr->req.ulptx.cmd_dest = FILL_ULPTX_CMD_DEST(pi->port_id, qid); + wr->req.ulptx.len = htonl(DIV_ROUND_UP(flits, 2) - 1); + + /* Sub-command */ + wr->req.sc_imm.cmd_more = FILL_CMD_MORE(immdatalen); + wr->req.sc_imm.len = cpu_to_be32(sizeof(struct cpl_tx_sec_pdu) + + sizeof(wr->req.key_ctx) + + kctx_len + + sizeof(struct cpl_tx_pkt_core) + + immdatalen); + + /* CPL_SEC_PDU */ + wr->req.sec_cpl.op_ivinsrtofst = htonl( + CPL_TX_SEC_PDU_OPCODE_V(CPL_TX_SEC_PDU) | + CPL_TX_SEC_PDU_CPLLEN_V(2) | + CPL_TX_SEC_PDU_PLACEHOLDER_V(1) | + CPL_TX_SEC_PDU_IVINSRTOFST_V( + (skb_transport_offset(skb) + + sizeof(struct ip_esp_hdr) + 1))); + + wr->req.sec_cpl.pldlen = htonl(skb->len); + + wr->req.sec_cpl.aadstart_cipherstop_hi = FILL_SEC_CPL_CIPHERSTOP_HI( + (skb_transport_offset(skb) + 1), + (skb_transport_offset(skb) + + sizeof(struct ip_esp_hdr)), + (skb_transport_offset(skb) + + sizeof(struct ip_esp_hdr) + + GCM_ESP_IV_SIZE + 1), 0); + + wr->req.sec_cpl.cipherstop_lo_authinsert = + FILL_SEC_CPL_AUTHINSERT(0, skb_transport_offset(skb) + + sizeof(struct ip_esp_hdr) + + GCM_ESP_IV_SIZE + 1, + sa_entry->authsize, + sa_entry->authsize); + wr->req.sec_cpl.seqno_numivs = + FILL_SEC_CPL_SCMD0_SEQNO(CHCR_ENCRYPT_OP, 1, + CHCR_SCMD_CIPHER_MODE_AES_GCM, + CHCR_SCMD_AUTH_MODE_GHASH, + sa_entry->hmac_ctrl, + ivsize >> 1); + wr->req.sec_cpl.ivgen_hdrlen = FILL_SEC_CPL_IVGEN_HDRLEN(0, 0, 1, + 0, 0, 0); + + pos += sizeof(struct fw_ulptx_wr) + + sizeof(struct ulp_txpkt) + + sizeof(struct ulptx_idata) + + sizeof(struct cpl_tx_sec_pdu); + + pos = copy_key_cpltx_pktxt(skb, dev, pos, sa_entry); + + return pos; +} + +/** + * flits_to_desc - returns the num of Tx descriptors for the given flits + * @n: the number of flits + * + * Returns the number of Tx descriptors needed for the supplied number + * of flits. + */ +static inline unsigned int flits_to_desc(unsigned int n) +{ + WARN_ON(n > SGE_MAX_WR_LEN / 8); + return DIV_ROUND_UP(n, 8); +} + +static inline unsigned int txq_avail(const struct sge_txq *q) +{ + return q->size - 1 - q->in_use; +} + +static void eth_txq_stop(struct sge_eth_txq *q) +{ + netif_tx_stop_queue(q->txq); + q->q.stops++; +} + +static inline void txq_advance(struct sge_txq *q, unsigned int n) +{ + q->in_use += n; + q->pidx += n; + if (q->pidx >= q->size) + q->pidx -= q->size; +} + +/* + * chcr_ipsec_xmit called from ULD Tx handler + */ +int chcr_ipsec_xmit(struct sk_buff *skb, struct net_device *dev) +{ + struct xfrm_state *x = xfrm_input_state(skb); + struct ipsec_sa_entry *sa_entry; + u64 *pos, *end, *before, cntrl, *sgl; + int qidx, left, credits; + unsigned int flits = 0, ndesc, kctx_len; + struct adapter *adap; + struct sge_eth_txq *q; + struct port_info *pi; + dma_addr_t addr[MAX_SKB_FRAGS + 1]; + bool immediate = false; + + if (!x->xso.offload_handle) + return NETDEV_TX_BUSY; + + sa_entry = (struct ipsec_sa_entry *)x->xso.offload_handle; + kctx_len = sa_entry->kctx_len; + + if (skb->sp->len != 1) { +out_free: dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + + pi = netdev_priv(dev); + adap = pi->adapter; + qidx = skb->queue_mapping; + q = &adap->sge.ethtxq[qidx + pi->first_qset]; + + cxgb4_reclaim_completed_tx(adap, &q->q, true); + cntrl = TXPKT_L4CSUM_DIS_F | TXPKT_IPCSUM_DIS_F; + + flits = calc_tx_sec_flits(skb, sa_entry->kctx_len); + ndesc = flits_to_desc(flits); + credits = txq_avail(&q->q) - ndesc; + + if (unlikely(credits < 0)) { + eth_txq_stop(q); + dev_err(adap->pdev_dev, + "%s: Tx ring %u full while queue awake! cred:%d %d %d flits:%d\n", + dev->name, qidx, credits, ndesc, txq_avail(&q->q), + flits); + return NETDEV_TX_BUSY; + } + + if (is_eth_imm(skb, kctx_len)) + immediate = true; + + if (!immediate && + unlikely(cxgb4_map_skb(adap->pdev_dev, skb, addr) < 0)) { + q->mapping_err++; + goto out_free; + } + + pos = (u64 *)&q->q.desc[q->q.pidx]; + before = (u64 *)pos; + end = (u64 *)pos + flits; + /* Setup IPSec CPL */ + pos = (void *)chcr_crypto_wreq(skb, dev, (void *)pos, + credits, sa_entry); + if (before > (u64 *)pos) { + left = (u8 *)end - (u8 *)q->q.stat; + end = (void *)q->q.desc + left; + } + if (pos == (u64 *)q->q.stat) { + left = (u8 *)end - (u8 *)q->q.stat; + end = (void *)q->q.desc + left; + pos = (void *)q->q.desc; + } + + sgl = (void *)pos; + if (immediate) { + cxgb4_inline_tx_skb(skb, &q->q, sgl); + dev_consume_skb_any(skb); + } else { + int last_desc; + + cxgb4_write_sgl(skb, &q->q, (void *)sgl, end, + 0, addr); + skb_orphan(skb); + + last_desc = q->q.pidx + ndesc - 1; + if (last_desc >= q->q.size) + last_desc -= q->q.size; + q->q.sdesc[last_desc].skb = skb; + q->q.sdesc[last_desc].sgl = (struct ulptx_sgl *)sgl; + } + txq_advance(&q->q, ndesc); + + cxgb4_ring_tx_db(adap, &q->q, ndesc); + return NETDEV_TX_OK; +} -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 2/2] chcr: Add support for Inline IPSec 2017-10-27 17:08 ` [PATCH net-next 2/2] chcr: Add support for Inline IPSec Atul Gupta @ 2017-10-28 23:35 ` kbuild test robot 2017-10-29 6:00 ` kbuild test robot 1 sibling, 0 replies; 5+ messages in thread From: kbuild test robot @ 2017-10-28 23:35 UTC (permalink / raw) To: Atul Gupta Cc: kbuild-all, netdev, davem, steffen.klassert, herbert, linux-crypto, Harsh Jain, Ganesh Goudar [-- Attachment #1: Type: text/plain, Size: 21847 bytes --] Hi Atul, Thank you for the patch! Yet we hit a small issue. [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Atul-Gupta/cxgb4-Add-support-for-Inline-IPSec-Tx/20171029-060344 config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers/crypto/chelsio/chcr_core.h:41:0, from drivers/crypto/chelsio/chcr_ipsec.c:64: drivers/crypto/chelsio/chcr_ipsec.c: In function 'chcr_ipsec_xmit': >> drivers/net/ethernet/chelsio/cxgb4/cxgb4.h:1678:13: error: inlining failed in call to always_inline 'cxgb4_reclaim_completed_tx': function body not available inline void cxgb4_reclaim_completed_tx(struct adapter *adap, ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/crypto/chelsio/chcr_ipsec.c:597:2: note: called from here cxgb4_reclaim_completed_tx(adap, &q->q, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/crypto/chelsio/chcr_core.h:41:0, from drivers/crypto/chelsio/chcr_ipsec.c:64: >> drivers/net/ethernet/chelsio/cxgb4/cxgb4.h:1678:13: error: inlining failed in call to always_inline 'cxgb4_reclaim_completed_tx': function body not available inline void cxgb4_reclaim_completed_tx(struct adapter *adap, ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/crypto/chelsio/chcr_ipsec.c:597:2: note: called from here cxgb4_reclaim_completed_tx(adap, &q->q, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/crypto/chelsio/chcr_core.h:41:0, from drivers/crypto/chelsio/chcr_ipsec.c:64: >> drivers/net/ethernet/chelsio/cxgb4/cxgb4.h:1687:13: error: inlining failed in call to always_inline 'cxgb4_ring_tx_db': function body not available inline void cxgb4_ring_tx_db(struct adapter *adap, struct sge_txq *q, int n); ^~~~~~~~~~~~~~~~ drivers/crypto/chelsio/chcr_ipsec.c:657:2: note: called from here cxgb4_ring_tx_db(adap, &q->q, ndesc); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/crypto/chelsio/chcr_core.h:41:0, from drivers/crypto/chelsio/chcr_ipsec.c:64: >> drivers/net/ethernet/chelsio/cxgb4/cxgb4.h:1687:13: error: inlining failed in call to always_inline 'cxgb4_ring_tx_db': function body not available inline void cxgb4_ring_tx_db(struct adapter *adap, struct sge_txq *q, int n); ^~~~~~~~~~~~~~~~ drivers/crypto/chelsio/chcr_ipsec.c:657:2: note: called from here cxgb4_ring_tx_db(adap, &q->q, ndesc); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/cxgb4_reclaim_completed_tx +1678 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h f2b7e78db drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-12-10 1562 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1563 void t4_wol_magic_enable(struct adapter *adap, unsigned int port, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1564 const u8 *addr); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1565 int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1566 u64 mask0, u64 mask1, unsigned int crc, bool enable); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1567 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1568 int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1569 enum dev_master master, enum dev_state *state); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1570 int t4_fw_bye(struct adapter *adap, unsigned int mbox); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1571 int t4_early_init(struct adapter *adap, unsigned int mbox); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1572 int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); 636f9d371 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-09-26 1573 int t4_fixup_host_params(struct adapter *adap, unsigned int page_size, 636f9d371 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-09-26 1574 unsigned int cache_line_size); 636f9d371 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-09-26 1575 int t4_fw_initialize(struct adapter *adap, unsigned int mbox); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1576 int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1577 unsigned int vf, unsigned int nparams, const u32 *params, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1578 u32 *val); 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1579 int t4_query_params_ns(struct adapter *adap, unsigned int mbox, unsigned int pf, 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1580 unsigned int vf, unsigned int nparams, const u32 *params, 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1581 u32 *val); 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1582 int t4_query_params_rw(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1583 unsigned int vf, unsigned int nparams, const u32 *params, 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1584 u32 *val, int rw, bool sleep_ok); 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1585 int t4_set_params_timeout(struct adapter *adap, unsigned int mbox, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1586 unsigned int pf, unsigned int vf, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1587 unsigned int nparams, const u32 *params, 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1588 const u32 *val, int timeout); 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1589 int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf, 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1590 unsigned int vf, unsigned int nparams, const u32 *params, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1591 const u32 *val); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1592 int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1593 unsigned int vf, unsigned int txq, unsigned int txq_eth_ctrl, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1594 unsigned int rxqi, unsigned int rxq, unsigned int tc, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1595 unsigned int vi, unsigned int cmask, unsigned int pmask, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1596 unsigned int nexact, unsigned int rcaps, unsigned int wxcaps); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1597 int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1598 unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1599 unsigned int *rss_size); 4f3a0fcfb drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1600 int t4_free_vi(struct adapter *adap, unsigned int mbox, 4f3a0fcfb drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1601 unsigned int pf, unsigned int vf, 4f3a0fcfb drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1602 unsigned int viid); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1603 int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid, f8f5aafa9 drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-05-10 1604 int mtu, int promisc, int all_multi, int bcast, int vlanex, f8f5aafa9 drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-05-10 1605 bool sleep_ok); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1606 int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1607 unsigned int viid, bool free, unsigned int naddr, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1608 const u8 **addr, u16 *idx, u64 *hash, bool sleep_ok); fc08a01a6 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-02-16 1609 int t4_free_mac_filt(struct adapter *adap, unsigned int mbox, fc08a01a6 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-02-16 1610 unsigned int viid, unsigned int naddr, fc08a01a6 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-02-16 1611 const u8 **addr, bool sleep_ok); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1612 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1613 int idx, const u8 *addr, bool persist, bool add_smt); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1614 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1615 bool ucast, u64 vec, bool sleep_ok); 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1616 int t4_enable_vi_params(struct adapter *adap, unsigned int mbox, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1617 unsigned int viid, bool rx_en, bool tx_en, bool dcb_en); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1618 int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1619 bool rx_en, bool tx_en); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1620 int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1621 unsigned int nblinks); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1622 int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1623 unsigned int mmd, unsigned int reg, u16 *valp); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1624 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1625 unsigned int mmd, unsigned int reg, u16 val); ebf4dc2b1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-11 1626 int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf, ebf4dc2b1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-11 1627 unsigned int vf, unsigned int iqtype, unsigned int iqid, ebf4dc2b1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-11 1628 unsigned int fl0id, unsigned int fl1id); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1629 int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1630 unsigned int vf, unsigned int iqtype, unsigned int iqid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1631 unsigned int fl0id, unsigned int fl1id); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1632 int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1633 unsigned int vf, unsigned int eqid); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1634 int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1635 unsigned int vf, unsigned int eqid); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1636 int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1637 unsigned int vf, unsigned int eqid); 5d700ecb0 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1638 int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); 23853a0a9 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-26 1639 void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl); 2061ec3f1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Ganesh Goudar 2017-05-19 1640 int t4_update_port_info(struct port_info *pi); c3168cabe drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Ganesh Goudar 2017-08-20 1641 int t4_get_link_params(struct port_info *pi, unsigned int *link_okp, c3168cabe drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Ganesh Goudar 2017-08-20 1642 unsigned int *speedp, unsigned int *mtup); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1643 int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); 881806bc1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1644 void t4_db_full(struct adapter *adapter); 881806bc1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1645 void t4_db_dropped(struct adapter *adapter); 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1646 int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp, 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1647 int filter_index, int enable); 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1648 void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp, 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1649 int filter_index, int *enabled); 8caa1e844 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1650 int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, 8caa1e844 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1651 u32 addr, u32 val); b72a32dac drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2016-08-22 1652 int t4_sched_params(struct adapter *adapter, int type, int level, int mode, b72a32dac drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2016-08-22 1653 int rateunit, int ratemode, int channel, int class, b72a32dac drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2016-08-22 1654 int minrate, int maxrate, int weight, int pktsize); 68bce1922 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Kumar Sanghvi 2014-03-13 1655 void t4_sge_decode_idma_state(struct adapter *adapter, int state); a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1656 void t4_idma_monitor_init(struct adapter *adapter, a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1657 struct sge_idma_monitor_state *idma); a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1658 void t4_idma_monitor(struct adapter *adapter, a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1659 struct sge_idma_monitor_state *idma, a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1660 int hz, int ticks); 858aa65c5 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-08-11 1661 int t4_set_vf_mac_acl(struct adapter *adapter, unsigned int vf, 858aa65c5 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-08-11 1662 unsigned int naddr, u8 *addr); 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1663 void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1664 u32 start_index, bool sleep_ok); 4359cf336 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1665 void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs, 4359cf336 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1666 u32 start_index, bool sleep_ok); 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1667 void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1668 u32 start_index, bool sleep_ok); 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1669 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1670 void t4_uld_mem_free(struct adapter *adap); 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1671 int t4_uld_mem_alloc(struct adapter *adap); 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1672 void t4_uld_clean_up(struct adapter *adap); 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1673 void t4_register_netevent_notifier(void); 94cdb8bb9 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-08-17 1674 void free_rspq_fl(struct adapter *adap, struct sge_rspq *rq, struct sge_fl *fl); ab677ff4a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-11-18 1675 void free_tx_desc(struct adapter *adap, struct sge_txq *q, ab677ff4a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-11-18 1676 unsigned int n, bool unmap); ab677ff4a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-11-18 1677 void free_txq(struct adapter *adap, struct sge_txq *q); fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 @1678 inline void cxgb4_reclaim_completed_tx(struct adapter *adap, fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1679 struct sge_txq *q, bool unmap); fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1680 int cxgb4_map_skb(struct device *dev, const struct sk_buff *skb, fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1681 dma_addr_t *addr); fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1682 void cxgb4_inline_tx_skb(const struct sk_buff *skb, const struct sge_txq *q, fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1683 void *pos); fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1684 void cxgb4_write_sgl(const struct sk_buff *skb, struct sge_txq *q, fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1685 struct ulptx_sgl *sgl, u64 *end, unsigned int start, fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 1686 const dma_addr_t *addr); fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 @1687 inline void cxgb4_ring_tx_db(struct adapter *adap, struct sge_txq *q, int n); :::::: The code at line 1678 was first introduced by commit :::::: fecc6d8b46e45fab51454b2d09c2a763ce8b5aad cxgb4: Add support for Inline IPSec Tx :::::: TO: Atul Gupta <atul.gupta@chelsio.com> :::::: CC: 0day robot <fengguang.wu@intel.com> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 48838 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 2/2] chcr: Add support for Inline IPSec 2017-10-27 17:08 ` [PATCH net-next 2/2] chcr: Add support for Inline IPSec Atul Gupta 2017-10-28 23:35 ` kbuild test robot @ 2017-10-29 6:00 ` kbuild test robot 1 sibling, 0 replies; 5+ messages in thread From: kbuild test robot @ 2017-10-29 6:00 UTC (permalink / raw) To: Atul Gupta Cc: kbuild-all, netdev, davem, steffen.klassert, herbert, linux-crypto, Harsh Jain, Ganesh Goudar Hi Atul, Thank you for the patch! Yet we hit a small issue. [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Atul-Gupta/cxgb4-Add-support-for-Inline-IPSec-Tx/20171029-060344 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) vim +1678 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h f2b7e78db drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-12-10 1562 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1563 void t4_wol_magic_enable(struct adapter *adap, unsigned int port, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1564 const u8 *addr); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1565 int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1566 u64 mask0, u64 mask1, unsigned int crc, bool enable); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1567 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1568 int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1569 enum dev_master master, enum dev_state *state); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1570 int t4_fw_bye(struct adapter *adap, unsigned int mbox); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1571 int t4_early_init(struct adapter *adap, unsigned int mbox); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1572 int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); 636f9d371 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-09-26 1573 int t4_fixup_host_params(struct adapter *adap, unsigned int page_size, 636f9d371 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-09-26 1574 unsigned int cache_line_size); 636f9d371 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-09-26 1575 int t4_fw_initialize(struct adapter *adap, unsigned int mbox); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1576 int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1577 unsigned int vf, unsigned int nparams, const u32 *params, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1578 u32 *val); 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1579 int t4_query_params_ns(struct adapter *adap, unsigned int mbox, unsigned int pf, 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1580 unsigned int vf, unsigned int nparams, const u32 *params, 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1581 u32 *val); 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1582 int t4_query_params_rw(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1583 unsigned int vf, unsigned int nparams, const u32 *params, 8f46d4671 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Arjun Vynipadath 2017-06-23 1584 u32 *val, int rw, bool sleep_ok); 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1585 int t4_set_params_timeout(struct adapter *adap, unsigned int mbox, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1586 unsigned int pf, unsigned int vf, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1587 unsigned int nparams, const u32 *params, 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1588 const u32 *val, int timeout); 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1589 int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf, 01b696141 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-22 1590 unsigned int vf, unsigned int nparams, const u32 *params, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1591 const u32 *val); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1592 int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1593 unsigned int vf, unsigned int txq, unsigned int txq_eth_ctrl, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1594 unsigned int rxqi, unsigned int rxq, unsigned int tc, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1595 unsigned int vi, unsigned int cmask, unsigned int pmask, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1596 unsigned int nexact, unsigned int rcaps, unsigned int wxcaps); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1597 int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1598 unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1599 unsigned int *rss_size); 4f3a0fcfb drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1600 int t4_free_vi(struct adapter *adap, unsigned int mbox, 4f3a0fcfb drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1601 unsigned int pf, unsigned int vf, 4f3a0fcfb drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1602 unsigned int viid); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1603 int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid, f8f5aafa9 drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-05-10 1604 int mtu, int promisc, int all_multi, int bcast, int vlanex, f8f5aafa9 drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-05-10 1605 bool sleep_ok); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1606 int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1607 unsigned int viid, bool free, unsigned int naddr, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1608 const u8 **addr, u16 *idx, u64 *hash, bool sleep_ok); fc08a01a6 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-02-16 1609 int t4_free_mac_filt(struct adapter *adap, unsigned int mbox, fc08a01a6 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-02-16 1610 unsigned int viid, unsigned int naddr, fc08a01a6 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-02-16 1611 const u8 **addr, bool sleep_ok); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1612 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1613 int idx, const u8 *addr, bool persist, bool add_smt); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1614 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1615 bool ucast, u64 vec, bool sleep_ok); 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1616 int t4_enable_vi_params(struct adapter *adap, unsigned int mbox, 688848b14 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Anish Bhatt 2014-06-19 1617 unsigned int viid, bool rx_en, bool tx_en, bool dcb_en); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1618 int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1619 bool rx_en, bool tx_en); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1620 int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1621 unsigned int nblinks); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1622 int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1623 unsigned int mmd, unsigned int reg, u16 *valp); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1624 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1625 unsigned int mmd, unsigned int reg, u16 val); ebf4dc2b1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-11 1626 int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf, ebf4dc2b1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-11 1627 unsigned int vf, unsigned int iqtype, unsigned int iqid, ebf4dc2b1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-11 1628 unsigned int fl0id, unsigned int fl1id); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1629 int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1630 unsigned int vf, unsigned int iqtype, unsigned int iqid, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1631 unsigned int fl0id, unsigned int fl1id); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1632 int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1633 unsigned int vf, unsigned int eqid); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1634 int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1635 unsigned int vf, unsigned int eqid); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1636 int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1637 unsigned int vf, unsigned int eqid); 5d700ecb0 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-06-05 1638 int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); 23853a0a9 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-04-26 1639 void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl); 2061ec3f1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Ganesh Goudar 2017-05-19 1640 int t4_update_port_info(struct port_info *pi); c3168cabe drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Ganesh Goudar 2017-08-20 1641 int t4_get_link_params(struct port_info *pi, unsigned int *link_okp, c3168cabe drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Ganesh Goudar 2017-08-20 1642 unsigned int *speedp, unsigned int *mtup); 625ba2c2e drivers/net/cxgb4/cxgb4.h Dimitris Michailidis 2010-04-01 1643 int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); 881806bc1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1644 void t4_db_full(struct adapter *adapter); 881806bc1 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1645 void t4_db_dropped(struct adapter *adapter); 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1646 int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp, 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1647 int filter_index, int enable); 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1648 void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp, 8e3d04fd7 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-08-13 1649 int filter_index, int *enabled); 8caa1e844 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1650 int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, 8caa1e844 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Vipul Pandya 2012-05-18 1651 u32 addr, u32 val); b72a32dac drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2016-08-22 1652 int t4_sched_params(struct adapter *adapter, int type, int level, int mode, b72a32dac drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2016-08-22 1653 int rateunit, int ratemode, int channel, int class, b72a32dac drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2016-08-22 1654 int minrate, int maxrate, int weight, int pktsize); 68bce1922 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Kumar Sanghvi 2014-03-13 1655 void t4_sge_decode_idma_state(struct adapter *adapter, int state); a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1656 void t4_idma_monitor_init(struct adapter *adapter, a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1657 struct sge_idma_monitor_state *idma); a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1658 void t4_idma_monitor(struct adapter *adapter, a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1659 struct sge_idma_monitor_state *idma, a3bfb6179 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2015-05-05 1660 int hz, int ticks); 858aa65c5 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-08-11 1661 int t4_set_vf_mac_acl(struct adapter *adapter, unsigned int vf, 858aa65c5 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-08-11 1662 unsigned int naddr, u8 *addr); 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1663 void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1664 u32 start_index, bool sleep_ok); 4359cf336 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1665 void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs, 4359cf336 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1666 u32 start_index, bool sleep_ok); 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1667 void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1668 u32 start_index, bool sleep_ok); 5ccf9d049 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Rahul Lakkireddy 2017-10-13 1669 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1670 void t4_uld_mem_free(struct adapter *adap); 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1671 int t4_uld_mem_alloc(struct adapter *adap); 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1672 void t4_uld_clean_up(struct adapter *adap); 0fbc81b3a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-09-17 1673 void t4_register_netevent_notifier(void); 94cdb8bb9 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-08-17 1674 void free_rspq_fl(struct adapter *adap, struct sge_rspq *rq, struct sge_fl *fl); ab677ff4a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-11-18 1675 void free_tx_desc(struct adapter *adap, struct sge_txq *q, ab677ff4a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-11-18 1676 unsigned int n, bool unmap); ab677ff4a drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Hariprasad Shenai 2016-11-18 1677 void free_txq(struct adapter *adap, struct sge_txq *q); fecc6d8b4 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h Atul Gupta 2017-10-27 @1678 inline void cxgb4_reclaim_completed_tx(struct adapter *adap, :::::: The code at line 1678 was first introduced by commit :::::: fecc6d8b46e45fab51454b2d09c2a763ce8b5aad cxgb4: Add support for Inline IPSec Tx :::::: TO: Atul Gupta <atul.gupta@chelsio.com> :::::: CC: 0day robot <fengguang.wu@intel.com> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx 2017-10-27 17:08 [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx Atul Gupta 2017-10-27 17:08 ` [PATCH net-next 2/2] chcr: Add support for Inline IPSec Atul Gupta @ 2017-10-28 23:15 ` kbuild test robot 1 sibling, 0 replies; 5+ messages in thread From: kbuild test robot @ 2017-10-28 23:15 UTC (permalink / raw) To: Atul Gupta Cc: kbuild-all, netdev, davem, steffen.klassert, herbert, linux-crypto, Ganesh Goudar [-- Attachment #1: Type: text/plain, Size: 2423 bytes --] Hi Atul, Thank you for the patch! Yet we hit a small issue. [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Atul-Gupta/cxgb4-Add-support-for-Inline-IPSec-Tx/20171029-060344 config: x86_64-kexec (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers/net//ethernet/chelsio/cxgb4/sge.c: In function 't4_eth_xmit': >> drivers/net//ethernet/chelsio/cxgb4/sge.c:1198:6: error: implicit declaration of function 'xfrm_offload' [-Werror=implicit-function-declaration] if (xfrm_offload(skb) && !ssi->gso_size) ^~~~~~~~~~~~ cc1: some warnings being treated as errors vim +/xfrm_offload +1198 drivers/net//ethernet/chelsio/cxgb4/sge.c 1177 1178 /* 1179 * The chip min packet length is 10 octets but play safe and reject 1180 * anything shorter than an Ethernet header. 1181 */ 1182 if (unlikely(skb->len < ETH_HLEN)) { 1183 out_free: dev_kfree_skb_any(skb); 1184 return NETDEV_TX_OK; 1185 } 1186 1187 /* Discard the packet if the length is greater than mtu */ 1188 max_pkt_len = ETH_HLEN + dev->mtu; 1189 if (skb_vlan_tagged(skb)) 1190 max_pkt_len += VLAN_HLEN; 1191 if (!skb_shinfo(skb)->gso_size && (unlikely(skb->len > max_pkt_len))) 1192 goto out_free; 1193 1194 pi = netdev_priv(dev); 1195 adap = pi->adapter; 1196 ssi = skb_shinfo(skb); 1197 > 1198 if (xfrm_offload(skb) && !ssi->gso_size) 1199 return adap->uld[CXGB4_ULD_CRYPTO].tx_handler(skb, dev); 1200 1201 qidx = skb_get_queue_mapping(skb); 1202 if (ptp_enabled) { 1203 spin_lock(&adap->ptp_lock); 1204 if (!(adap->ptp_tx_skb)) { 1205 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; 1206 adap->ptp_tx_skb = skb_get(skb); 1207 } else { 1208 spin_unlock(&adap->ptp_lock); 1209 goto out_free; 1210 } 1211 q = &adap->sge.ptptxq; 1212 } else { 1213 q = &adap->sge.ethtxq[qidx + pi->first_qset]; 1214 } 1215 skb_tx_timestamp(skb); 1216 1217 cxgb4_reclaim_completed_tx(adap, &q->q, true); 1218 cntrl = TXPKT_L4CSUM_DIS_F | TXPKT_IPCSUM_DIS_F; 1219 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 26248 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-10-29 6:00 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-10-27 17:08 [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx Atul Gupta 2017-10-27 17:08 ` [PATCH net-next 2/2] chcr: Add support for Inline IPSec Atul Gupta 2017-10-28 23:35 ` kbuild test robot 2017-10-29 6:00 ` kbuild test robot 2017-10-28 23:15 ` [PATCH net-next 1/2] cxgb4: Add support for Inline IPSec Tx kbuild test robot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox