[linux-next:master 8458/11353] drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:27: error: implicit declaration of function 'tls_driver_ctx'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dimitris,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   cb153b68ff91cbc434f3de70ac549e110543e1bb
commit: 749efb1e6d73f528598b13302864227b77810da5 [8458/11353] net/fungible: Kconfig, Makefiles, and MAINTAINERS
config: arc-randconfig-r033-20220307 (https://download.01.org/0day-ci/archive/20220309/202203090200.gmeETipN-lkp@xxxxxxxxx/config)
compiler: arc-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=749efb1e6d73f528598b13302864227b77810da5
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 749efb1e6d73f528598b13302864227b77810da5
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   drivers/net/ethernet/fungible/funeth/funeth_tx.c: In function 'write_pkt_desc':
>> drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:27: error: implicit declaration of function 'tls_driver_ctx' [-Werror=implicit-function-declaration]
     244 |                 tls_ctx = tls_driver_ctx(skb->sk, TLS_OFFLOAD_CTX_DIR_TX);
         |                           ^~~~~~~~~~~~~~
>> drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:51: error: 'TLS_OFFLOAD_CTX_DIR_TX' undeclared (first use in this function)
     244 |                 tls_ctx = tls_driver_ctx(skb->sk, TLS_OFFLOAD_CTX_DIR_TX);
         |                                                   ^~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:51: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/ethernet/fungible/funeth/funeth_tx.c:245:37: error: invalid use of undefined type 'struct fun_ktls_tx_ctx'
     245 |                 tls->tlsid = tls_ctx->tlsid;
         |                                     ^~
   drivers/net/ethernet/fungible/funeth/funeth_tx.c:246:24: error: invalid use of undefined type 'struct fun_ktls_tx_ctx'
     246 |                 tls_ctx->next_seq += tls_len;
         |                        ^~
   drivers/net/ethernet/fungible/funeth/funeth_tx.c: In function 'fun_start_xmit':
>> drivers/net/ethernet/fungible/funeth/funeth_tx.c:310:13: error: implicit declaration of function 'tls_is_sk_tx_device_offloaded' [-Werror=implicit-function-declaration]
     310 |             tls_is_sk_tx_device_offloaded(skb->sk)) {
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/fungible/funeth/funeth_tx.c:311:23: error: implicit declaration of function 'fun_tls_tx'; did you mean 'fun_xdp_tx'? [-Werror=implicit-function-declaration]
     311 |                 skb = fun_tls_tx(skb, q, &tls_len);
         |                       ^~~~~~~~~~
         |                       fun_xdp_tx
   drivers/net/ethernet/fungible/funeth/funeth_tx.c:311:21: warning: assignment to 'struct sk_buff *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     311 |                 skb = fun_tls_tx(skb, q, &tls_len);
         |                     ^
   cc1: some warnings being treated as errors


vim +/tls_driver_ctx +244 drivers/net/ethernet/fungible/funeth/funeth_tx.c

db37bc177dae89 Dimitris Michailidis 2022-02-24  113  
db37bc177dae89 Dimitris Michailidis 2022-02-24  114  /* Write as many descriptors as needed for the supplied skb starting at the
db37bc177dae89 Dimitris Michailidis 2022-02-24  115   * current producer location. The caller has made certain enough descriptors
db37bc177dae89 Dimitris Michailidis 2022-02-24  116   * are available.
db37bc177dae89 Dimitris Michailidis 2022-02-24  117   *
db37bc177dae89 Dimitris Michailidis 2022-02-24  118   * Returns the number of descriptors written, 0 on error.
db37bc177dae89 Dimitris Michailidis 2022-02-24  119   */
db37bc177dae89 Dimitris Michailidis 2022-02-24  120  static unsigned int write_pkt_desc(struct sk_buff *skb, struct funeth_txq *q,
db37bc177dae89 Dimitris Michailidis 2022-02-24  121  				   unsigned int tls_len)
db37bc177dae89 Dimitris Michailidis 2022-02-24  122  {
db37bc177dae89 Dimitris Michailidis 2022-02-24  123  	unsigned int extra_bytes = 0, extra_pkts = 0;
db37bc177dae89 Dimitris Michailidis 2022-02-24  124  	unsigned int idx = q->prod_cnt & q->mask;
db37bc177dae89 Dimitris Michailidis 2022-02-24  125  	const struct skb_shared_info *shinfo;
db37bc177dae89 Dimitris Michailidis 2022-02-24  126  	unsigned int lens[MAX_SKB_FRAGS + 1];
db37bc177dae89 Dimitris Michailidis 2022-02-24  127  	dma_addr_t addrs[MAX_SKB_FRAGS + 1];
db37bc177dae89 Dimitris Michailidis 2022-02-24  128  	struct fun_eth_tx_req *req;
db37bc177dae89 Dimitris Michailidis 2022-02-24  129  	struct fun_dataop_gl *gle;
db37bc177dae89 Dimitris Michailidis 2022-02-24  130  	const struct tcphdr *th;
db37bc177dae89 Dimitris Michailidis 2022-02-24  131  	unsigned int ngle, i;
db37bc177dae89 Dimitris Michailidis 2022-02-24  132  	u16 flags;
db37bc177dae89 Dimitris Michailidis 2022-02-24  133  
db37bc177dae89 Dimitris Michailidis 2022-02-24  134  	if (unlikely(map_skb(skb, q->dma_dev, addrs, lens))) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  135  		FUN_QSTAT_INC(q, tx_map_err);
db37bc177dae89 Dimitris Michailidis 2022-02-24  136  		return 0;
db37bc177dae89 Dimitris Michailidis 2022-02-24  137  	}
db37bc177dae89 Dimitris Michailidis 2022-02-24  138  
db37bc177dae89 Dimitris Michailidis 2022-02-24  139  	req = fun_tx_desc_addr(q, idx);
db37bc177dae89 Dimitris Michailidis 2022-02-24  140  	req->op = FUN_ETH_OP_TX;
db37bc177dae89 Dimitris Michailidis 2022-02-24  141  	req->len8 = 0;
db37bc177dae89 Dimitris Michailidis 2022-02-24  142  	req->flags = 0;
db37bc177dae89 Dimitris Michailidis 2022-02-24  143  	req->suboff8 = offsetof(struct fun_eth_tx_req, dataop);
db37bc177dae89 Dimitris Michailidis 2022-02-24  144  	req->repr_idn = 0;
db37bc177dae89 Dimitris Michailidis 2022-02-24  145  	req->encap_proto = 0;
db37bc177dae89 Dimitris Michailidis 2022-02-24  146  
db37bc177dae89 Dimitris Michailidis 2022-02-24  147  	shinfo = skb_shinfo(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  148  	if (likely(shinfo->gso_size)) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  149  		if (skb->encapsulation) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  150  			u16 ol4_ofst;
db37bc177dae89 Dimitris Michailidis 2022-02-24  151  
db37bc177dae89 Dimitris Michailidis 2022-02-24  152  			flags = FUN_ETH_OUTER_EN | FUN_ETH_INNER_LSO |
db37bc177dae89 Dimitris Michailidis 2022-02-24  153  				FUN_ETH_UPDATE_INNER_L4_CKSUM |
db37bc177dae89 Dimitris Michailidis 2022-02-24  154  				FUN_ETH_UPDATE_OUTER_L3_LEN;
db37bc177dae89 Dimitris Michailidis 2022-02-24  155  			if (shinfo->gso_type & (SKB_GSO_UDP_TUNNEL |
db37bc177dae89 Dimitris Michailidis 2022-02-24  156  						SKB_GSO_UDP_TUNNEL_CSUM)) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  157  				flags |= FUN_ETH_UPDATE_OUTER_L4_LEN |
db37bc177dae89 Dimitris Michailidis 2022-02-24  158  					 FUN_ETH_OUTER_UDP;
db37bc177dae89 Dimitris Michailidis 2022-02-24  159  				if (shinfo->gso_type & SKB_GSO_UDP_TUNNEL_CSUM)
db37bc177dae89 Dimitris Michailidis 2022-02-24  160  					flags |= FUN_ETH_UPDATE_OUTER_L4_CKSUM;
db37bc177dae89 Dimitris Michailidis 2022-02-24  161  				ol4_ofst = skb_transport_offset(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  162  			} else {
db37bc177dae89 Dimitris Michailidis 2022-02-24  163  				ol4_ofst = skb_inner_network_offset(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  164  			}
db37bc177dae89 Dimitris Michailidis 2022-02-24  165  
db37bc177dae89 Dimitris Michailidis 2022-02-24  166  			if (ip_hdr(skb)->version == 4)
db37bc177dae89 Dimitris Michailidis 2022-02-24  167  				flags |= FUN_ETH_UPDATE_OUTER_L3_CKSUM;
db37bc177dae89 Dimitris Michailidis 2022-02-24  168  			else
db37bc177dae89 Dimitris Michailidis 2022-02-24  169  				flags |= FUN_ETH_OUTER_IPV6;
db37bc177dae89 Dimitris Michailidis 2022-02-24  170  
db37bc177dae89 Dimitris Michailidis 2022-02-24  171  			if (skb->inner_network_header) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  172  				if (inner_ip_hdr(skb)->version == 4)
db37bc177dae89 Dimitris Michailidis 2022-02-24  173  					flags |= FUN_ETH_UPDATE_INNER_L3_CKSUM |
db37bc177dae89 Dimitris Michailidis 2022-02-24  174  						 FUN_ETH_UPDATE_INNER_L3_LEN;
db37bc177dae89 Dimitris Michailidis 2022-02-24  175  				else
db37bc177dae89 Dimitris Michailidis 2022-02-24  176  					flags |= FUN_ETH_INNER_IPV6 |
db37bc177dae89 Dimitris Michailidis 2022-02-24  177  						 FUN_ETH_UPDATE_INNER_L3_LEN;
db37bc177dae89 Dimitris Michailidis 2022-02-24  178  			}
db37bc177dae89 Dimitris Michailidis 2022-02-24  179  			th = inner_tcp_hdr(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  180  			fun_eth_offload_init(&req->offload, flags,
db37bc177dae89 Dimitris Michailidis 2022-02-24  181  					     shinfo->gso_size,
db37bc177dae89 Dimitris Michailidis 2022-02-24  182  					     tcp_hdr_doff_flags(th), 0,
db37bc177dae89 Dimitris Michailidis 2022-02-24  183  					     skb_inner_network_offset(skb),
db37bc177dae89 Dimitris Michailidis 2022-02-24  184  					     skb_inner_transport_offset(skb),
db37bc177dae89 Dimitris Michailidis 2022-02-24  185  					     skb_network_offset(skb), ol4_ofst);
db37bc177dae89 Dimitris Michailidis 2022-02-24  186  			FUN_QSTAT_INC(q, tx_encap_tso);
db37bc177dae89 Dimitris Michailidis 2022-02-24  187  		} else {
db37bc177dae89 Dimitris Michailidis 2022-02-24  188  			/* HW considers one set of headers as inner */
db37bc177dae89 Dimitris Michailidis 2022-02-24  189  			flags = FUN_ETH_INNER_LSO |
db37bc177dae89 Dimitris Michailidis 2022-02-24  190  				FUN_ETH_UPDATE_INNER_L4_CKSUM |
db37bc177dae89 Dimitris Michailidis 2022-02-24  191  				FUN_ETH_UPDATE_INNER_L3_LEN;
db37bc177dae89 Dimitris Michailidis 2022-02-24  192  			if (shinfo->gso_type & SKB_GSO_TCPV6)
db37bc177dae89 Dimitris Michailidis 2022-02-24  193  				flags |= FUN_ETH_INNER_IPV6;
db37bc177dae89 Dimitris Michailidis 2022-02-24  194  			else
db37bc177dae89 Dimitris Michailidis 2022-02-24  195  				flags |= FUN_ETH_UPDATE_INNER_L3_CKSUM;
db37bc177dae89 Dimitris Michailidis 2022-02-24  196  			th = tcp_hdr(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  197  			fun_eth_offload_init(&req->offload, flags,
db37bc177dae89 Dimitris Michailidis 2022-02-24  198  					     shinfo->gso_size,
db37bc177dae89 Dimitris Michailidis 2022-02-24  199  					     tcp_hdr_doff_flags(th), 0,
db37bc177dae89 Dimitris Michailidis 2022-02-24  200  					     skb_network_offset(skb),
db37bc177dae89 Dimitris Michailidis 2022-02-24  201  					     skb_transport_offset(skb), 0, 0);
db37bc177dae89 Dimitris Michailidis 2022-02-24  202  			FUN_QSTAT_INC(q, tx_tso);
db37bc177dae89 Dimitris Michailidis 2022-02-24  203  		}
db37bc177dae89 Dimitris Michailidis 2022-02-24  204  
db37bc177dae89 Dimitris Michailidis 2022-02-24  205  		u64_stats_update_begin(&q->syncp);
db37bc177dae89 Dimitris Michailidis 2022-02-24  206  		q->stats.tx_cso += shinfo->gso_segs;
db37bc177dae89 Dimitris Michailidis 2022-02-24  207  		u64_stats_update_end(&q->syncp);
db37bc177dae89 Dimitris Michailidis 2022-02-24  208  
db37bc177dae89 Dimitris Michailidis 2022-02-24  209  		extra_pkts = shinfo->gso_segs - 1;
db37bc177dae89 Dimitris Michailidis 2022-02-24  210  		extra_bytes = (be16_to_cpu(req->offload.inner_l4_off) +
db37bc177dae89 Dimitris Michailidis 2022-02-24  211  			       __tcp_hdrlen(th)) * extra_pkts;
db37bc177dae89 Dimitris Michailidis 2022-02-24  212  	} else if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  213  		flags = FUN_ETH_UPDATE_INNER_L4_CKSUM;
db37bc177dae89 Dimitris Michailidis 2022-02-24  214  		if (skb->csum_offset == offsetof(struct udphdr, check))
db37bc177dae89 Dimitris Michailidis 2022-02-24  215  			flags |= FUN_ETH_INNER_UDP;
db37bc177dae89 Dimitris Michailidis 2022-02-24  216  		fun_eth_offload_init(&req->offload, flags, 0, 0, 0, 0,
db37bc177dae89 Dimitris Michailidis 2022-02-24  217  				     skb_checksum_start_offset(skb), 0, 0);
db37bc177dae89 Dimitris Michailidis 2022-02-24  218  		FUN_QSTAT_INC(q, tx_cso);
db37bc177dae89 Dimitris Michailidis 2022-02-24  219  	} else {
db37bc177dae89 Dimitris Michailidis 2022-02-24  220  		fun_eth_offload_init(&req->offload, 0, 0, 0, 0, 0, 0, 0, 0);
db37bc177dae89 Dimitris Michailidis 2022-02-24  221  	}
db37bc177dae89 Dimitris Michailidis 2022-02-24  222  
db37bc177dae89 Dimitris Michailidis 2022-02-24  223  	ngle = shinfo->nr_frags + 1;
db37bc177dae89 Dimitris Michailidis 2022-02-24  224  	req->len8 = (sizeof(*req) + ngle * sizeof(*gle)) / 8;
db37bc177dae89 Dimitris Michailidis 2022-02-24  225  	req->dataop = FUN_DATAOP_HDR_INIT(ngle, 0, ngle, 0, skb->len);
db37bc177dae89 Dimitris Michailidis 2022-02-24  226  
db37bc177dae89 Dimitris Michailidis 2022-02-24  227  	for (i = 0, gle = (struct fun_dataop_gl *)req->dataop.imm;
db37bc177dae89 Dimitris Michailidis 2022-02-24  228  	     i < ngle && txq_to_end(q, gle); i++, gle++)
db37bc177dae89 Dimitris Michailidis 2022-02-24  229  		fun_dataop_gl_init(gle, 0, 0, lens[i], addrs[i]);
db37bc177dae89 Dimitris Michailidis 2022-02-24  230  
db37bc177dae89 Dimitris Michailidis 2022-02-24  231  	if (txq_to_end(q, gle) == 0) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  232  		gle = (struct fun_dataop_gl *)q->desc;
db37bc177dae89 Dimitris Michailidis 2022-02-24  233  		for ( ; i < ngle; i++, gle++)
db37bc177dae89 Dimitris Michailidis 2022-02-24  234  			fun_dataop_gl_init(gle, 0, 0, lens[i], addrs[i]);
db37bc177dae89 Dimitris Michailidis 2022-02-24  235  	}
db37bc177dae89 Dimitris Michailidis 2022-02-24  236  
db37bc177dae89 Dimitris Michailidis 2022-02-24  237  	if (IS_ENABLED(CONFIG_TLS_DEVICE) && unlikely(tls_len)) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  238  		struct fun_eth_tls *tls = (struct fun_eth_tls *)gle;
db37bc177dae89 Dimitris Michailidis 2022-02-24  239  		struct fun_ktls_tx_ctx *tls_ctx;
db37bc177dae89 Dimitris Michailidis 2022-02-24  240  
db37bc177dae89 Dimitris Michailidis 2022-02-24  241  		req->len8 += FUNETH_TLS_SZ / 8;
db37bc177dae89 Dimitris Michailidis 2022-02-24  242  		req->flags = cpu_to_be16(FUN_ETH_TX_TLS);
db37bc177dae89 Dimitris Michailidis 2022-02-24  243  
db37bc177dae89 Dimitris Michailidis 2022-02-24 @244  		tls_ctx = tls_driver_ctx(skb->sk, TLS_OFFLOAD_CTX_DIR_TX);
db37bc177dae89 Dimitris Michailidis 2022-02-24 @245  		tls->tlsid = tls_ctx->tlsid;
db37bc177dae89 Dimitris Michailidis 2022-02-24  246  		tls_ctx->next_seq += tls_len;
db37bc177dae89 Dimitris Michailidis 2022-02-24  247  
db37bc177dae89 Dimitris Michailidis 2022-02-24  248  		u64_stats_update_begin(&q->syncp);
db37bc177dae89 Dimitris Michailidis 2022-02-24  249  		q->stats.tx_tls_bytes += tls_len;
db37bc177dae89 Dimitris Michailidis 2022-02-24  250  		q->stats.tx_tls_pkts += 1 + extra_pkts;
db37bc177dae89 Dimitris Michailidis 2022-02-24  251  		u64_stats_update_end(&q->syncp);
db37bc177dae89 Dimitris Michailidis 2022-02-24  252  	}
db37bc177dae89 Dimitris Michailidis 2022-02-24  253  
db37bc177dae89 Dimitris Michailidis 2022-02-24  254  	u64_stats_update_begin(&q->syncp);
db37bc177dae89 Dimitris Michailidis 2022-02-24  255  	q->stats.tx_bytes += skb->len + extra_bytes;
db37bc177dae89 Dimitris Michailidis 2022-02-24  256  	q->stats.tx_pkts += 1 + extra_pkts;
db37bc177dae89 Dimitris Michailidis 2022-02-24  257  	u64_stats_update_end(&q->syncp);
db37bc177dae89 Dimitris Michailidis 2022-02-24  258  
db37bc177dae89 Dimitris Michailidis 2022-02-24  259  	q->info[idx].skb = skb;
db37bc177dae89 Dimitris Michailidis 2022-02-24  260  
db37bc177dae89 Dimitris Michailidis 2022-02-24  261  	trace_funeth_tx(q, skb->len, idx, req->dataop.ngather);
db37bc177dae89 Dimitris Michailidis 2022-02-24  262  	return tx_req_ndesc(req);
db37bc177dae89 Dimitris Michailidis 2022-02-24  263  }
db37bc177dae89 Dimitris Michailidis 2022-02-24  264  
db37bc177dae89 Dimitris Michailidis 2022-02-24  265  /* Return the number of available descriptors of a Tx queue.
db37bc177dae89 Dimitris Michailidis 2022-02-24  266   * HW assumes head==tail means the ring is empty so we need to keep one
db37bc177dae89 Dimitris Michailidis 2022-02-24  267   * descriptor unused.
db37bc177dae89 Dimitris Michailidis 2022-02-24  268   */
db37bc177dae89 Dimitris Michailidis 2022-02-24  269  static unsigned int fun_txq_avail(const struct funeth_txq *q)
db37bc177dae89 Dimitris Michailidis 2022-02-24  270  {
db37bc177dae89 Dimitris Michailidis 2022-02-24  271  	return q->mask - q->prod_cnt + q->cons_cnt;
db37bc177dae89 Dimitris Michailidis 2022-02-24  272  }
db37bc177dae89 Dimitris Michailidis 2022-02-24  273  
db37bc177dae89 Dimitris Michailidis 2022-02-24  274  /* Stop a queue if it can't handle another worst-case packet. */
db37bc177dae89 Dimitris Michailidis 2022-02-24  275  static void fun_tx_check_stop(struct funeth_txq *q)
db37bc177dae89 Dimitris Michailidis 2022-02-24  276  {
db37bc177dae89 Dimitris Michailidis 2022-02-24  277  	if (likely(fun_txq_avail(q) >= FUNETH_MAX_PKT_DESC))
db37bc177dae89 Dimitris Michailidis 2022-02-24  278  		return;
db37bc177dae89 Dimitris Michailidis 2022-02-24  279  
db37bc177dae89 Dimitris Michailidis 2022-02-24  280  	netif_tx_stop_queue(q->ndq);
db37bc177dae89 Dimitris Michailidis 2022-02-24  281  
db37bc177dae89 Dimitris Michailidis 2022-02-24  282  	/* NAPI reclaim is freeing packets in parallel with us and we may race.
db37bc177dae89 Dimitris Michailidis 2022-02-24  283  	 * We have stopped the queue but check again after synchronizing with
db37bc177dae89 Dimitris Michailidis 2022-02-24  284  	 * reclaim.
db37bc177dae89 Dimitris Michailidis 2022-02-24  285  	 */
db37bc177dae89 Dimitris Michailidis 2022-02-24  286  	smp_mb();
db37bc177dae89 Dimitris Michailidis 2022-02-24  287  	if (likely(fun_txq_avail(q) < FUNETH_MAX_PKT_DESC))
db37bc177dae89 Dimitris Michailidis 2022-02-24  288  		FUN_QSTAT_INC(q, tx_nstops);
db37bc177dae89 Dimitris Michailidis 2022-02-24  289  	else
db37bc177dae89 Dimitris Michailidis 2022-02-24  290  		netif_tx_start_queue(q->ndq);
db37bc177dae89 Dimitris Michailidis 2022-02-24  291  }
db37bc177dae89 Dimitris Michailidis 2022-02-24  292  
db37bc177dae89 Dimitris Michailidis 2022-02-24  293  /* Return true if a queue has enough space to restart. Current condition is
db37bc177dae89 Dimitris Michailidis 2022-02-24  294   * that the queue must be >= 1/4 empty.
db37bc177dae89 Dimitris Michailidis 2022-02-24  295   */
db37bc177dae89 Dimitris Michailidis 2022-02-24  296  static bool fun_txq_may_restart(struct funeth_txq *q)
db37bc177dae89 Dimitris Michailidis 2022-02-24  297  {
db37bc177dae89 Dimitris Michailidis 2022-02-24  298  	return fun_txq_avail(q) >= q->mask / 4;
db37bc177dae89 Dimitris Michailidis 2022-02-24  299  }
db37bc177dae89 Dimitris Michailidis 2022-02-24  300  
db37bc177dae89 Dimitris Michailidis 2022-02-24  301  netdev_tx_t fun_start_xmit(struct sk_buff *skb, struct net_device *netdev)
db37bc177dae89 Dimitris Michailidis 2022-02-24  302  {
db37bc177dae89 Dimitris Michailidis 2022-02-24  303  	struct funeth_priv *fp = netdev_priv(netdev);
db37bc177dae89 Dimitris Michailidis 2022-02-24  304  	unsigned int qid = skb_get_queue_mapping(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  305  	struct funeth_txq *q = fp->txqs[qid];
db37bc177dae89 Dimitris Michailidis 2022-02-24  306  	unsigned int tls_len = 0;
db37bc177dae89 Dimitris Michailidis 2022-02-24  307  	unsigned int ndesc;
db37bc177dae89 Dimitris Michailidis 2022-02-24  308  
db37bc177dae89 Dimitris Michailidis 2022-02-24  309  	if (IS_ENABLED(CONFIG_TLS_DEVICE) && skb->sk &&
db37bc177dae89 Dimitris Michailidis 2022-02-24 @310  	    tls_is_sk_tx_device_offloaded(skb->sk)) {
db37bc177dae89 Dimitris Michailidis 2022-02-24 @311  		skb = fun_tls_tx(skb, q, &tls_len);
db37bc177dae89 Dimitris Michailidis 2022-02-24  312  		if (unlikely(!skb))
db37bc177dae89 Dimitris Michailidis 2022-02-24  313  			goto dropped;
db37bc177dae89 Dimitris Michailidis 2022-02-24  314  	}
db37bc177dae89 Dimitris Michailidis 2022-02-24  315  
db37bc177dae89 Dimitris Michailidis 2022-02-24  316  	ndesc = write_pkt_desc(skb, q, tls_len);
db37bc177dae89 Dimitris Michailidis 2022-02-24  317  	if (unlikely(!ndesc)) {
db37bc177dae89 Dimitris Michailidis 2022-02-24  318  		dev_kfree_skb_any(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  319  		goto dropped;
db37bc177dae89 Dimitris Michailidis 2022-02-24  320  	}
db37bc177dae89 Dimitris Michailidis 2022-02-24  321  
db37bc177dae89 Dimitris Michailidis 2022-02-24  322  	q->prod_cnt += ndesc;
db37bc177dae89 Dimitris Michailidis 2022-02-24  323  	fun_tx_check_stop(q);
db37bc177dae89 Dimitris Michailidis 2022-02-24  324  
db37bc177dae89 Dimitris Michailidis 2022-02-24  325  	skb_tx_timestamp(skb);
db37bc177dae89 Dimitris Michailidis 2022-02-24  326  
db37bc177dae89 Dimitris Michailidis 2022-02-24  327  	if (__netdev_tx_sent_queue(q->ndq, skb->len, netdev_xmit_more()))
db37bc177dae89 Dimitris Michailidis 2022-02-24  328  		fun_txq_wr_db(q);
db37bc177dae89 Dimitris Michailidis 2022-02-24  329  	else
db37bc177dae89 Dimitris Michailidis 2022-02-24  330  		FUN_QSTAT_INC(q, tx_more);
db37bc177dae89 Dimitris Michailidis 2022-02-24  331  
db37bc177dae89 Dimitris Michailidis 2022-02-24  332  	return NETDEV_TX_OK;
db37bc177dae89 Dimitris Michailidis 2022-02-24  333  
db37bc177dae89 Dimitris Michailidis 2022-02-24  334  dropped:
db37bc177dae89 Dimitris Michailidis 2022-02-24  335  	/* A dropped packet may be the last one in a xmit_more train,
db37bc177dae89 Dimitris Michailidis 2022-02-24  336  	 * ring the doorbell just in case.
db37bc177dae89 Dimitris Michailidis 2022-02-24  337  	 */
db37bc177dae89 Dimitris Michailidis 2022-02-24  338  	if (!netdev_xmit_more())
db37bc177dae89 Dimitris Michailidis 2022-02-24  339  		fun_txq_wr_db(q);
db37bc177dae89 Dimitris Michailidis 2022-02-24  340  	return NETDEV_TX_OK;
db37bc177dae89 Dimitris Michailidis 2022-02-24  341  }
db37bc177dae89 Dimitris Michailidis 2022-02-24  342  

:::::: The code at line 244 was first introduced by commit
:::::: db37bc177dae89cef6fc37bdbe6b223929f70245 net/funeth: add the data path

:::::: TO: Dimitris Michailidis <d.michailidis@xxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux