Make frontend features distinct from netback feature flags.
PATCH 1/1 Make frontend features distinct from netback feature flags.
Make sure that if a feature flag is disabled by ethtool on netback that we do not gratuitously re-enabled it when we check the frontend features during ring connection.
Signed-off-by Paul Durrant <[email protected]>
Cc Ian Campbell <[email protected]>
--- drivers/xen/netback/common.h | 15 ++++++--- drivers/xen/netback/interface.c | 68 ++++++++++++++++++++++++++++++-------- drivers/xen/netback/netback.c | 2 +- drivers/xen/netback/xenbus.c | 51 +++++++++++------------------ 4 files changed, 83 insertions(+), 53 deletions(-)
drivers/xen/netback/common.h +10 -5
@@ -76,14 +76,18 @@ struct xen_netif {struct vm_struct *tx_comms_area;struct vm_struct *rx_comms_area; -/* Set of features that can be turned on in dev->features. */ -int features; +/* Flags that must not be set in dev->features */ +int features_disabled; -int smart_poll; +/* Frontend feature information. */ + u8 can_sg:1; + u8 gso:1; + u8 gso_prefix:1; + u8 csum:1; + u8 smart_poll:1;/* Internal feature information. */ u8 can_queue:1; /* can queue packets for receiver? */ - u8 gso_prefix:1; /* use a prefix segment for GSO information *//* Allow netif_be_start_xmit() to peek ahead in the rx request * ring. This is a prediction of what rx_req_cons will be once
@@ -189,6 +193,7 @@ void netif_accel_init(void);void netif_disconnect (struct xen_netif *netif); +void netif_set_features (struct xen_netif *netif);struct xen_netif *netif_alloc (struct device *parent,domid_t domid,unsigned int handle);int netif_map (struct xen_netif *netif,unsigned long tx_ring_ref,unsigned long rx_ring_ref,unsigned int evtchn);
@@ -225,7 +230,7 @@ static inline int netbk_can_queue(struct net_device *dev)static inline int netbk_can_sg (struct net_device *dev) {struct xen_netif *netif =netdev_priv (dev); -return netif->features &NETIF_F_SG ; +return netif->can_sg; }struct pending_tx_info {
drivers/xen/netback/interface.c +53 -15
106 lines not on this page · raw message
drivers/xen/netback/netback.c +1 -1
@@ -238,7 +238,7 @@ static struct sk_buff *netbk_copy_skb(struct sk_buff *skb)static inline int netbk_max_required_rx_slots (struct xen_netif *netif) { -if (netif->features & (NETIF_F_SG |NETIF_F_TSO )) +if (netif->can_sg || netif->gso || netif->gso_prefix)return MAX_SKB_FRAGS +2 ;/* header + extra_info + frags */ return 1 ;/* all in one */ }
drivers/xen/netback/xenbus.c +19 -32
86 lines not on this page · raw message
Signature · 1 line
1.5.6.5