From: Salil Mehta <salil.mehta@huawei.com>
To: <dledford@redhat.com>
Cc: <salil.mehta@huawei.com>, <xavier.huwei@huawei.com>,
<oulijun@huawei.com>, <yisen.zhuang@huawei.com>,
<mehta.salil.lnk@gmail.com>, <linux-rdma@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
Daode Huang <huangdaode@hisilicon.com>
Subject: [PATCH for-next 7/8] net: hns: bug fix about broadcast/multicast packets
Date: Sat, 10 Sep 2016 05:09:29 +0100 [thread overview]
Message-ID: <20160910040930.25988-8-salil.mehta@huawei.com> (raw)
In-Reply-To: <20160910040930.25988-1-salil.mehta@huawei.com>
From: Daode Huang <huangdaode@hisilicon.com>
When the dsaf mode receives a broadcast packet, it will filter
the packet by comparing the received queue number and destination
queue number(get from forwarding table), if they are the same,
the packet will be filtered. Otherwise, the packet will be loopback.
So this patch select queue 0 to send broadcast and multicast packets.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 09ed237..4105df8 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -1597,6 +1597,20 @@ struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev,
return stats;
}
+static u16
+hns_nic_select_queue(struct net_device *ndev, struct sk_buff *skb,
+ void *accel_priv, select_queue_fallback_t fallback)
+{
+ struct hns_nic_priv *priv = netdev_priv(ndev);
+ struct ethhdr *eth_hdr = (struct ethhdr *)skb->data;
+
+ /*fix hardware broadcast/multicast packets queue loopback */
+ if (!AE_IS_VER1(priv->enet_ver) &&
+ is_multicast_ether_addr(eth_hdr->h_dest))
+ return 0;
+ else
+ return fallback(ndev, skb);
+}
static const struct net_device_ops hns_nic_netdev_ops = {
.ndo_open = hns_nic_net_open,
.ndo_stop = hns_nic_net_stop,
@@ -1612,6 +1626,7 @@ static const struct net_device_ops hns_nic_netdev_ops = {
.ndo_poll_controller = hns_nic_poll_controller,
#endif
.ndo_set_rx_mode = hns_nic_set_rx_mode,
+ .ndo_select_queue = hns_nic_select_queue,
};
static void hns_nic_update_link_status(struct net_device *netdev)
--
1.9.1
next prev parent reply other threads:[~2016-09-10 4:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-10 4:09 [PATCH for-next 0/8] Bug Fixes and Code Improvement in HNS driver Salil Mehta
2016-09-10 4:09 ` [PATCH for-next 1/8] net: hns: fix port unavailable after hnae_reserve_buffer_map fail Salil Mehta
2016-09-10 4:09 ` [PATCH for-next 2/8] net: hns: bug fix about setting coalsecs-usecs to 0 Salil Mehta
2016-09-10 4:09 ` [PATCH for-next 3/8] net: hns: add fini_process for v2 napi process Salil Mehta
2016-09-10 4:09 ` [PATCH for-next 4/8] net: hns: delete repeat read fbd num after while Salil Mehta
2016-09-10 4:09 ` [PATCH for-next 5/8] net: hns: fix port not available after testing loopback Salil Mehta
2016-09-10 4:09 ` [PATCH for-next 6/8] net: hns: fix the bug of forwarding table Salil Mehta
2016-09-10 4:09 ` Salil Mehta [this message]
2016-09-10 4:09 ` [PATCH for-next 8/8] net: hns: delete redundant broadcast packet filter process Salil Mehta
2016-09-28 14:57 ` [PATCH for-next 0/8] Bug Fixes and Code Improvement in HNS driver Doug Ledford
2016-09-28 16:06 ` Salil Mehta
2016-09-29 17:16 ` Salil Mehta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160910040930.25988-8-salil.mehta@huawei.com \
--to=salil.mehta@huawei.com \
--cc=dledford@redhat.com \
--cc=huangdaode@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mehta.salil.lnk@gmail.com \
--cc=oulijun@huawei.com \
--cc=xavier.huwei@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®