* [sashal-linux-stable:queue-4.19 47/246] drivers/net//ethernet/ti/cpsw.c:687:32: warning: passing argument 2 of 'cpsw_ale_del_mcast' discards 'const' qualifier from pointer target type
@ 2019-11-26 5:07 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-11-26 5:07 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7102 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.19
head: bcd2e1873ecc09aa0f8690dec568fb7c1aad95d2
commit: ee2510baa375b49037ce262db5b965a575022408 [47/246] net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update
config: s390-allmodconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout ee2510baa375b49037ce262db5b965a575022408
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net//ethernet/ti/cpsw.c: In function 'cpsw_add_mcast':
>> drivers/net//ethernet/ti/cpsw.c:581:33: warning: passing argument 2 of 'cpsw_ale_add_mcast' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
cpsw_ale_add_mcast(cpsw->ale, addr,
^~~~
In file included from drivers/net//ethernet/ti/cpsw.c:45:0:
drivers/net//ethernet/ti/cpsw_ale.h:112:5: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'const u8 * {aka const unsigned char *}'
int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
^~~~~~~~~~~~~~~~~~
drivers/net//ethernet/ti/cpsw.c:587:32: warning: passing argument 2 of 'cpsw_ale_add_mcast' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
cpsw_ale_add_mcast(cpsw->ale, addr, ALE_ALL_PORTS, 0, 0, 0);
^~~~
In file included from drivers/net//ethernet/ti/cpsw.c:45:0:
drivers/net//ethernet/ti/cpsw_ale.h:112:5: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'const u8 * {aka const unsigned char *}'
int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
^~~~~~~~~~~~~~~~~~
drivers/net//ethernet/ti/cpsw.c: In function 'cpsw_del_mc_addr':
>> drivers/net//ethernet/ti/cpsw.c:687:32: warning: passing argument 2 of 'cpsw_ale_del_mcast' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
cpsw_ale_del_mcast(cpsw->ale, addr, 0, flags, vid);
^~~~
In file included from drivers/net//ethernet/ti/cpsw.c:45:0:
drivers/net//ethernet/ti/cpsw_ale.h:114:5: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'const u8 * {aka const unsigned char *}'
int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
^~~~~~~~~~~~~~~~~~
vim +687 drivers/net//ethernet/ti/cpsw.c
572
573 static void cpsw_add_mcast(struct cpsw_priv *priv, const u8 *addr)
574 {
575 struct cpsw_common *cpsw = priv->cpsw;
576
577 if (cpsw->data.dual_emac) {
578 struct cpsw_slave *slave = cpsw->slaves + priv->emac_port;
579 int slave_port = cpsw_get_slave_port(slave->slave_num);
580
> 581 cpsw_ale_add_mcast(cpsw->ale, addr,
582 1 << slave_port | ALE_PORT_HOST,
583 ALE_VLAN, slave->port_vlan, 0);
584 return;
585 }
586
> 587 cpsw_ale_add_mcast(cpsw->ale, addr, ALE_ALL_PORTS, 0, 0, 0);
588 }
589
590 static void cpsw_set_promiscious(struct net_device *ndev, bool enable)
591 {
592 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
593 struct cpsw_ale *ale = cpsw->ale;
594 int i;
595
596 if (cpsw->data.dual_emac) {
597 bool flag = false;
598
599 /* Enabling promiscuous mode for one interface will be
600 * common for both the interface as the interface shares
601 * the same hardware resource.
602 */
603 for (i = 0; i < cpsw->data.slaves; i++)
604 if (cpsw->slaves[i].ndev->flags & IFF_PROMISC)
605 flag = true;
606
607 if (!enable && flag) {
608 enable = true;
609 dev_err(&ndev->dev, "promiscuity not disabled as the other interface is still in promiscuity mode\n");
610 }
611
612 if (enable) {
613 /* Enable Bypass */
614 cpsw_ale_control_set(ale, 0, ALE_BYPASS, 1);
615
616 dev_dbg(&ndev->dev, "promiscuity enabled\n");
617 } else {
618 /* Disable Bypass */
619 cpsw_ale_control_set(ale, 0, ALE_BYPASS, 0);
620 dev_dbg(&ndev->dev, "promiscuity disabled\n");
621 }
622 } else {
623 if (enable) {
624 unsigned long timeout = jiffies + HZ;
625
626 /* Disable Learn for all ports (host is port 0 and slaves are port 1 and up */
627 for (i = 0; i <= cpsw->data.slaves; i++) {
628 cpsw_ale_control_set(ale, i,
629 ALE_PORT_NOLEARN, 1);
630 cpsw_ale_control_set(ale, i,
631 ALE_PORT_NO_SA_UPDATE, 1);
632 }
633
634 /* Clear All Untouched entries */
635 cpsw_ale_control_set(ale, 0, ALE_AGEOUT, 1);
636 do {
637 cpu_relax();
638 if (cpsw_ale_control_get(ale, 0, ALE_AGEOUT))
639 break;
640 } while (time_after(timeout, jiffies));
641 cpsw_ale_control_set(ale, 0, ALE_AGEOUT, 1);
642
643 /* Clear all mcast from ALE */
644 cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS, -1);
645
646 /* Flood All Unicast Packets to Host port */
647 cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1);
648 dev_dbg(&ndev->dev, "promiscuity enabled\n");
649 } else {
650 /* Don't Flood All Unicast Packets to Host port */
651 cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 0);
652
653 /* Enable Learn for all ports (host is port 0 and slaves are port 1 and up */
654 for (i = 0; i <= cpsw->data.slaves; i++) {
655 cpsw_ale_control_set(ale, i,
656 ALE_PORT_NOLEARN, 0);
657 cpsw_ale_control_set(ale, i,
658 ALE_PORT_NO_SA_UPDATE, 0);
659 }
660 dev_dbg(&ndev->dev, "promiscuity disabled\n");
661 }
662 }
663 }
664
665 static int cpsw_add_mc_addr(struct net_device *ndev, const u8 *addr)
666 {
667 struct cpsw_priv *priv = netdev_priv(ndev);
668
669 cpsw_add_mcast(priv, addr);
670 return 0;
671 }
672
673 static int cpsw_del_mc_addr(struct net_device *ndev, const u8 *addr)
674 {
675 struct cpsw_priv *priv = netdev_priv(ndev);
676 struct cpsw_common *cpsw = priv->cpsw;
677 int vid, flags;
678
679 if (cpsw->data.dual_emac) {
680 vid = cpsw->slaves[priv->emac_port].port_vlan;
681 flags = ALE_VLAN;
682 } else {
683 vid = 0;
684 flags = 0;
685 }
686
> 687 cpsw_ale_del_mcast(cpsw->ale, addr, 0, flags, vid);
688 return 0;
689 }
690
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 50935 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-26 5:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-26 5:07 [sashal-linux-stable:queue-4.19 47/246] drivers/net//ethernet/ti/cpsw.c:687:32: warning: passing argument 2 of 'cpsw_ale_del_mcast' discards 'const' qualifier from pointer target type 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.