From: Srujana Challa <schalla@marvell.com>
Sync MAC address set mailbox format with kernel. And
send match table index to the kernel to add the
mac address. This fixes the issues on cn10kb, where
traffic was not received when promisc is disabled
and two ports are used.
Signed-off-by: Srujana Challa <schalla@marvell.com>
---
drivers/common/cnxk/roc_mbox.h | 1 +
drivers/common/cnxk/roc_nix.c | 1 +
drivers/common/cnxk/roc_nix_mac.c | 8 ++++++--
drivers/common/cnxk/roc_nix_priv.h | 1 +
4 files changed, 9 insertions(+), 2 deletions(-)
@@ -584,6 +584,7 @@ struct cgx_fec_stats_rsp {
struct cgx_mac_addr_set_or_get {
struct mbox_msghdr hdr;
uint8_t __io mac_addr[PLT_ETHER_ADDR_LEN];
+ uint32_t index;
};
/* Structure for requesting the operation to
@@ -475,6 +475,7 @@ roc_nix_dev_init(struct roc_nix *roc_nix)
nix->pci_dev = pci_dev;
nix->reta_sz = reta_sz;
nix->mtu = ROC_NIX_DEFAULT_HW_FRS;
+ nix->dmac_flt_idx = -1;
/* Register error and ras interrupts */
rc = nix_register_irqs(nix);
@@ -81,9 +81,9 @@ int
roc_nix_mac_addr_set(struct roc_nix *roc_nix, const uint8_t addr[])
{
struct nix *nix = roc_nix_to_nix_priv(roc_nix);
+ struct cgx_mac_addr_set_or_get *req, *rsp;
struct dev *dev = &nix->dev;
struct mbox *mbox = mbox_get(dev->mbox);
- struct cgx_mac_addr_set_or_get *req;
int rc;
if (roc_nix_is_vf_or_sdp(roc_nix)) {
@@ -97,9 +97,13 @@ roc_nix_mac_addr_set(struct roc_nix *roc_nix, const uint8_t addr[])
}
req = mbox_alloc_msg_cgx_mac_addr_set(mbox);
+ req->index = nix->dmac_flt_idx;
mbox_memcpy(req->mac_addr, addr, PLT_ETHER_ADDR_LEN);
- rc = mbox_process(mbox);
+ rc = mbox_process_msg(mbox, (void *)&rsp);
+ if (rc)
+ goto exit;
+ nix->dmac_flt_idx = rsp->index;
exit:
mbox_put(mbox);
return rc;
@@ -153,6 +153,7 @@ struct nix {
uint8_t sdp_links;
uint8_t tx_link;
uint16_t sqb_size;
+ uint32_t dmac_flt_idx;
/* Without FCS, with L2 overhead */
uint16_t mtu;
uint16_t chan_cnt;