All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 6672/14131] drivers/net/dsa/sja1105/sja1105_vl.c:576:5: warning: no previous prototype for function 'sja1105_vl_gate'
@ 2020-05-29 22:36 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-29 22:36 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 14588 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 834f8933d5ddd732274cb6050252bd1c7cc7349d [6672/14131] net: dsa: sja1105: implement tc-gate using time-triggered virtual links
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2d068e534f1671459e1b135852c1b3c10502e929)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout 834f8933d5ddd732274cb6050252bd1c7cc7349d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

drivers/net/dsa/sja1105/sja1105_vl.c:348:5: warning: no previous prototype for function 'sja1105_vl_redirect' [-Wmissing-prototypes]
int sja1105_vl_redirect(struct sja1105_private *priv, int port,
^
drivers/net/dsa/sja1105/sja1105_vl.c:348:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sja1105_vl_redirect(struct sja1105_private *priv, int port,
^
static
drivers/net/dsa/sja1105/sja1105_vl.c:396:5: warning: no previous prototype for function 'sja1105_vl_delete' [-Wmissing-prototypes]
int sja1105_vl_delete(struct sja1105_private *priv, int port,
^
drivers/net/dsa/sja1105/sja1105_vl.c:396:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sja1105_vl_delete(struct sja1105_private *priv, int port,
^
static
>> drivers/net/dsa/sja1105/sja1105_vl.c:576:5: warning: no previous prototype for function 'sja1105_vl_gate' [-Wmissing-prototypes]
int sja1105_vl_gate(struct sja1105_private *priv, int port,
^
drivers/net/dsa/sja1105/sja1105_vl.c:576:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sja1105_vl_gate(struct sja1105_private *priv, int port,
^
static
>> drivers/net/dsa/sja1105/sja1105_vl.c:756:5: warning: no previous prototype for function 'sja1105_vl_stats' [-Wmissing-prototypes]
int sja1105_vl_stats(struct sja1105_private *priv, int port,
^
drivers/net/dsa/sja1105/sja1105_vl.c:756:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sja1105_vl_stats(struct sja1105_private *priv, int port,
^
static
4 warnings generated.

vim +/sja1105_vl_gate +576 drivers/net/dsa/sja1105/sja1105_vl.c

   395	
 > 396	int sja1105_vl_delete(struct sja1105_private *priv, int port,
   397			      struct sja1105_rule *rule, struct netlink_ext_ack *extack)
   398	{
   399		int rc;
   400	
   401		rule->port_mask &= ~BIT(port);
   402		if (!rule->port_mask) {
   403			list_del(&rule->list);
   404			kfree(rule);
   405		}
   406	
   407		rc = sja1105_init_virtual_links(priv, extack);
   408		if (rc)
   409			return rc;
   410	
   411		return sja1105_static_config_reload(priv, SJA1105_VIRTUAL_LINKS);
   412	}
   413	
   414	/* Insert into the global gate list, sorted by gate action time. */
   415	static int sja1105_insert_gate_entry(struct sja1105_gating_config *gating_cfg,
   416					     struct sja1105_rule *rule,
   417					     u8 gate_state, s64 entry_time,
   418					     struct netlink_ext_ack *extack)
   419	{
   420		struct sja1105_gate_entry *e;
   421		int rc;
   422	
   423		e = kzalloc(sizeof(*e), GFP_KERNEL);
   424		if (!e)
   425			return -ENOMEM;
   426	
   427		e->rule = rule;
   428		e->gate_state = gate_state;
   429		e->interval = entry_time;
   430	
   431		if (list_empty(&gating_cfg->entries)) {
   432			list_add(&e->list, &gating_cfg->entries);
   433		} else {
   434			struct sja1105_gate_entry *p;
   435	
   436			list_for_each_entry(p, &gating_cfg->entries, list) {
   437				if (p->interval == e->interval) {
   438					NL_SET_ERR_MSG_MOD(extack,
   439							   "Gate conflict");
   440					rc = -EBUSY;
   441					goto err;
   442				}
   443	
   444				if (e->interval < p->interval)
   445					break;
   446			}
   447			list_add(&e->list, p->list.prev);
   448		}
   449	
   450		gating_cfg->num_entries++;
   451	
   452		return 0;
   453	err:
   454		kfree(e);
   455		return rc;
   456	}
   457	
   458	/* The gate entries contain absolute times in their e->interval field. Convert
   459	 * that to proper intervals (i.e. "0, 5, 10, 15" to "5, 5, 5, 5").
   460	 */
   461	static void
   462	sja1105_gating_cfg_time_to_interval(struct sja1105_gating_config *gating_cfg,
   463					    u64 cycle_time)
   464	{
   465		struct sja1105_gate_entry *last_e;
   466		struct sja1105_gate_entry *e;
   467		struct list_head *prev;
   468		u32 prev_time = 0;
   469	
   470		list_for_each_entry(e, &gating_cfg->entries, list) {
   471			struct sja1105_gate_entry *p;
   472	
   473			prev = e->list.prev;
   474	
   475			if (prev == &gating_cfg->entries)
   476				continue;
   477	
   478			p = list_entry(prev, struct sja1105_gate_entry, list);
   479			prev_time = e->interval;
   480			p->interval = e->interval - p->interval;
   481		}
   482		last_e = list_last_entry(&gating_cfg->entries,
   483					 struct sja1105_gate_entry, list);
   484		if (last_e->list.prev != &gating_cfg->entries)
   485			last_e->interval = cycle_time - last_e->interval;
   486	}
   487	
   488	static void sja1105_free_gating_config(struct sja1105_gating_config *gating_cfg)
   489	{
   490		struct sja1105_gate_entry *e, *n;
   491	
   492		list_for_each_entry_safe(e, n, &gating_cfg->entries, list) {
   493			list_del(&e->list);
   494			kfree(e);
   495		}
   496	}
   497	
   498	static int sja1105_compose_gating_subschedule(struct sja1105_private *priv,
   499						      struct netlink_ext_ack *extack)
   500	{
   501		struct sja1105_gating_config *gating_cfg = &priv->tas_data.gating_cfg;
   502		struct sja1105_rule *rule;
   503		s64 max_cycle_time = 0;
   504		s64 its_base_time = 0;
   505		int i, rc = 0;
   506	
   507		list_for_each_entry(rule, &priv->flow_block.rules, list) {
   508			if (rule->type != SJA1105_RULE_VL)
   509				continue;
   510			if (rule->vl.type != SJA1105_VL_TIME_TRIGGERED)
   511				continue;
   512	
   513			if (max_cycle_time < rule->vl.cycle_time) {
   514				max_cycle_time = rule->vl.cycle_time;
   515				its_base_time = rule->vl.base_time;
   516			}
   517		}
   518	
   519		if (!max_cycle_time)
   520			return 0;
   521	
   522		dev_dbg(priv->ds->dev, "max_cycle_time %lld its_base_time %lld\n",
   523			max_cycle_time, its_base_time);
   524	
   525		sja1105_free_gating_config(gating_cfg);
   526	
   527		gating_cfg->base_time = its_base_time;
   528		gating_cfg->cycle_time = max_cycle_time;
   529		gating_cfg->num_entries = 0;
   530	
   531		list_for_each_entry(rule, &priv->flow_block.rules, list) {
   532			s64 time;
   533			s64 rbt;
   534	
   535			if (rule->type != SJA1105_RULE_VL)
   536				continue;
   537			if (rule->vl.type != SJA1105_VL_TIME_TRIGGERED)
   538				continue;
   539	
   540			/* Calculate the difference between this gating schedule's
   541			 * base time, and the base time of the gating schedule with the
   542			 * longest cycle time. We call it the relative base time (rbt).
   543			 */
   544			rbt = future_base_time(rule->vl.base_time, rule->vl.cycle_time,
   545					       its_base_time);
   546			rbt -= its_base_time;
   547	
   548			time = rbt;
   549	
   550			for (i = 0; i < rule->vl.num_entries; i++) {
   551				u8 gate_state = rule->vl.entries[i].gate_state;
   552				s64 entry_time = time;
   553	
   554				while (entry_time < max_cycle_time) {
   555					rc = sja1105_insert_gate_entry(gating_cfg, rule,
   556								       gate_state,
   557								       entry_time,
   558								       extack);
   559					if (rc)
   560						goto err;
   561	
   562					entry_time += rule->vl.cycle_time;
   563				}
   564				time += rule->vl.entries[i].interval;
   565			}
   566		}
   567	
   568		sja1105_gating_cfg_time_to_interval(gating_cfg, max_cycle_time);
   569	
   570		return 0;
   571	err:
   572		sja1105_free_gating_config(gating_cfg);
   573		return rc;
   574	}
   575	
 > 576	int sja1105_vl_gate(struct sja1105_private *priv, int port,
   577			    struct netlink_ext_ack *extack, unsigned long cookie,
   578			    struct sja1105_key *key, u32 index, s32 prio,
   579			    u64 base_time, u64 cycle_time, u64 cycle_time_ext,
   580			    u32 num_entries, struct action_gate_entry *entries)
   581	{
   582		struct sja1105_rule *rule = sja1105_rule_find(priv, cookie);
   583		int ipv = -1;
   584		int i, rc;
   585		s32 rem;
   586	
   587		if (cycle_time_ext) {
   588			NL_SET_ERR_MSG_MOD(extack,
   589					   "Cycle time extension not supported");
   590			return -EOPNOTSUPP;
   591		}
   592	
   593		div_s64_rem(base_time, sja1105_delta_to_ns(1), &rem);
   594		if (rem) {
   595			NL_SET_ERR_MSG_MOD(extack,
   596					   "Base time must be multiple of 200 ns");
   597			return -ERANGE;
   598		}
   599	
   600		div_s64_rem(cycle_time, sja1105_delta_to_ns(1), &rem);
   601		if (rem) {
   602			NL_SET_ERR_MSG_MOD(extack,
   603					   "Cycle time must be multiple of 200 ns");
   604			return -ERANGE;
   605		}
   606	
   607		if (dsa_port_is_vlan_filtering(dsa_to_port(priv->ds, port)) &&
   608		    key->type != SJA1105_KEY_VLAN_AWARE_VL) {
   609			NL_SET_ERR_MSG_MOD(extack,
   610					   "Can only gate based on {DMAC, VID, PCP}");
   611			return -EOPNOTSUPP;
   612		} else if (key->type != SJA1105_KEY_VLAN_UNAWARE_VL) {
   613			NL_SET_ERR_MSG_MOD(extack,
   614					   "Can only gate based on DMAC");
   615			return -EOPNOTSUPP;
   616		}
   617	
   618		if (!rule) {
   619			rule = kzalloc(sizeof(*rule), GFP_KERNEL);
   620			if (!rule)
   621				return -ENOMEM;
   622	
   623			list_add(&rule->list, &priv->flow_block.rules);
   624			rule->cookie = cookie;
   625			rule->type = SJA1105_RULE_VL;
   626			rule->key = *key;
   627			rule->vl.type = SJA1105_VL_TIME_TRIGGERED;
   628			rule->vl.sharindx = index;
   629			rule->vl.base_time = base_time;
   630			rule->vl.cycle_time = cycle_time;
   631			rule->vl.num_entries = num_entries;
   632			rule->vl.entries = kcalloc(num_entries,
   633						   sizeof(struct action_gate_entry),
   634						   GFP_KERNEL);
   635			if (!rule->vl.entries) {
   636				rc = -ENOMEM;
   637				goto out;
   638			}
   639	
   640			for (i = 0; i < num_entries; i++) {
   641				div_s64_rem(entries[i].interval,
   642					    sja1105_delta_to_ns(1), &rem);
   643				if (rem) {
   644					NL_SET_ERR_MSG_MOD(extack,
   645							   "Interval must be multiple of 200 ns");
   646					rc = -ERANGE;
   647					goto out;
   648				}
   649	
   650				if (!entries[i].interval) {
   651					NL_SET_ERR_MSG_MOD(extack,
   652							   "Interval cannot be zero");
   653					rc = -ERANGE;
   654					goto out;
   655				}
   656	
   657				if (ns_to_sja1105_delta(entries[i].interval) >
   658				    SJA1105_TAS_MAX_DELTA) {
   659					NL_SET_ERR_MSG_MOD(extack,
   660							   "Maximum interval is 52 ms");
   661					rc = -ERANGE;
   662					goto out;
   663				}
   664	
   665				if (entries[i].maxoctets != -1) {
   666					NL_SET_ERR_MSG_MOD(extack,
   667							   "Cannot offload IntervalOctetMax");
   668					rc = -EOPNOTSUPP;
   669					goto out;
   670				}
   671	
   672				if (ipv == -1) {
   673					ipv = entries[i].ipv;
   674				} else if (ipv != entries[i].ipv) {
   675					NL_SET_ERR_MSG_MOD(extack,
   676							   "Only support a single IPV per VL");
   677					rc = -EOPNOTSUPP;
   678					goto out;
   679				}
   680	
   681				rule->vl.entries[i] = entries[i];
   682			}
   683	
   684			if (ipv == -1) {
   685				if (key->type == SJA1105_KEY_VLAN_AWARE_VL)
   686					ipv = key->vl.pcp;
   687				else
   688					ipv = 0;
   689			}
   690	
   691			/* TODO: support per-flow MTU */
   692			rule->vl.maxlen = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN;
   693			rule->vl.ipv = ipv;
   694		}
   695	
   696		rule->port_mask |= BIT(port);
   697	
   698		rc = sja1105_compose_gating_subschedule(priv, extack);
   699		if (rc)
   700			goto out;
   701	
   702		rc = sja1105_init_virtual_links(priv, extack);
   703		if (rc)
   704			goto out;
   705	
   706		if (sja1105_gating_check_conflicts(priv, -1, extack)) {
   707			NL_SET_ERR_MSG_MOD(extack, "Conflict with tc-taprio schedule");
   708			rc = -ERANGE;
   709			goto out;
   710		}
   711	
   712	out:
   713		if (rc) {
   714			rule->port_mask &= ~BIT(port);
   715			if (!rule->port_mask) {
   716				list_del(&rule->list);
   717				kfree(rule->vl.entries);
   718				kfree(rule);
   719			}
   720		}
   721	
   722		return rc;
   723	}
   724	
   725	static int sja1105_find_vlid(struct sja1105_private *priv, int port,
   726				     struct sja1105_key *key)
   727	{
   728		struct sja1105_vl_lookup_entry *vl_lookup;
   729		struct sja1105_table *table;
   730		int i;
   731	
   732		if (WARN_ON(key->type != SJA1105_KEY_VLAN_AWARE_VL &&
   733			    key->type != SJA1105_KEY_VLAN_UNAWARE_VL))
   734			return -1;
   735	
   736		table = &priv->static_config.tables[BLK_IDX_VL_LOOKUP];
   737		vl_lookup = table->entries;
   738	
   739		for (i = 0; i < table->entry_count; i++) {
   740			if (key->type == SJA1105_KEY_VLAN_AWARE_VL) {
   741				if (vl_lookup[i].port == port &&
   742				    vl_lookup[i].macaddr == key->vl.dmac &&
   743				    vl_lookup[i].vlanid == key->vl.vid &&
   744				    vl_lookup[i].vlanprior == key->vl.pcp)
   745					return i;
   746			} else {
   747				if (vl_lookup[i].port == port &&
   748				    vl_lookup[i].macaddr == key->vl.dmac)
   749					return i;
   750			}
   751		}
   752	
   753		return -1;
   754	}
   755	
 > 756	int sja1105_vl_stats(struct sja1105_private *priv, int port,

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 73556 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-29 22:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 22:36 [linux-next:master 6672/14131] drivers/net/dsa/sja1105/sja1105_vl.c:576:5: warning: no previous prototype for function 'sja1105_vl_gate' kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.