On 9/4/2023 5:56 AM, wa...@3snic.com wrote: > From: Renyong Wan <wa...@3snic.com> > > Mailbox is a message channel used to communicate between PF and > VF as well as driver and hardware functions. > Mailbox messages are received by driver through event queue, and > sent by driver through registers of mailbox. > There are two transfer modes for sending mailbox message, one is > DMA mode used to send message to PF, another is inline mode used > to send message to VF. > > Signed-off-by: Steven Song <steven.s...@3snic.com> > Signed-off-by: Renyong Wan <wa...@3snic.com> >
<...> > diff --git a/drivers/net/sssnic/base/sssnic_mbox.h > b/drivers/net/sssnic/base/sssnic_mbox.h > new file mode 100644 > index 0000000000..00fa02ea78 > --- /dev/null > +++ b/drivers/net/sssnic/base/sssnic_mbox.h > @@ -0,0 +1,45 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2018-2022 Shenzhen 3SNIC Information Technology Co., Ltd. > + */ > + > +#ifndef _SSSNIC_MBOX_H_ > +#define _SSSNIC_MBOX_H_ > + > +#include <rte_spinlock.h> > + > +#include "sssnic_msg.h" > + > +enum sssnic_mbox_state { > + /* Mbox is sending message or waiting for response */ > + SSSNIC_MBOX_STATE_RUNNING, > + /* Waiting for response timed out*/ > + SSSNIC_MBOX_STATE_TIMEOUT, > + /* Mbox failed to send message */ > + SSSNIC_MBOX_STATE_FAILED, > + /* Response is ready */ > + SSSNIC_MBOX_STATE_READY, > + /* Mbox is idle, it can send message */ > + SSSNIC_MBOX_STATE_IDLE, > +}; > + > +struct sssnic_sendbox; > + > +struct sssnic_mbox { > + struct sssnic_hw *hw; > + /* just be used for sending request msg*/ > + pthread_mutex_t req_lock; > This is causing build error in my local environment for armv8 cross compile, I guess including pthread header explicitly is required: In file included from ../drivers/net/sssnic/base/sssnic_ctrlq.c:15: ../drivers/net/sssnic/base/sssnic_mbox.h:30:9: error: unknown type name ‘pthread_mutex_t’ 30 | pthread_mutex_t req_lock; | ^~~~~~~~~~~~~~~