RE: [PATCH v3 4/5] net: hpe: Add GXP UMAC Driver

From: Hawkins, Nick
Date: Thu Aug 17 2023 - 15:21:51 EST


Hi Andrew,

> > +static int umac_init_hw(struct net_device *ndev)


> > +{
> > + } else {
> > + value |= UMAC_CFG_FULL_DUPLEX;
> > +
> > + if (ndev->phydev->speed == SPEED_1000) {

> I'm pretty sure i pointed this out once before. It is not safe to
> access phydev members outside of the adjust link callback.

My mistake I missed this phydev member access. I will rely on
the adjust link callback to configure it.

> > +static int umac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> > +{
> > + struct umac_priv *umac = netdev_priv(ndev);
> > + struct umac_tx_desc_entry *ptxdesc;
> > + unsigned int length;
> > + u8 *pframe;
> > +
> > + ptxdesc = &umac->tx_descs->entrylist[umac->tx_cur];
> > + pframe = umac->tx_descs->framelist[umac->tx_cur];
> > +
> > + length = skb->len;
> > + if (length > 1514) {
> > + netdev_err(ndev, "send data %d bytes > 1514, clamp it to 1514\n",
> > + skb->len);

> Than should be rate limited.

How is this done? Is there a particular function to call that
will handle it in the backend?
I thought the rate limiting is happening in this
function already below at:

/* if current tx ring buffer is full, stop the queue */
ptxdesc = &umac->tx_descs->entrylist[umac->tx_cur];
if (ptxdesc->status & UMAC_RING_ENTRY_HW_OWN)
netif_stop_queue(ndev);

> Also, if you chop the end of the packet, it is going to be useless. It
> is better to drop it, to improve your goodput.

I will drop it.

Thanks,

-Nick Hawkins